input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testWorkdirIsParentDir_CreateRepositoryFromDotGitGitDir ( ) { java . io . File gitDir = getFile ( "workdir" , Constants . DOT_GIT ) ; org . eclipse . jgit . lib . Repository repo = new org . eclipse . jgit . storage . file . FileRepositoryBuilder ( ) . setGitDir ( gitDir ) . build ( ) ; java . lang . String workdir = repo . getWorkTree ( ) . getName ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { org . eclipse . jgit . junit . JGitTestUtil . GatherStackTrace stack ; try { throw new org . eclipse . jgit . junit . JGitTestUtil . GatherStackTrace ( ) ; } catch ( org . eclipse . jgit . junit . JGitTestUtil . GatherStackTrace wanted ) { stack = wanted ; } try { for ( java . lang . StackTraceElement stackTrace : stack . getStackTrace ( ) ) { java . lang . String className = stackTrace . getClassName ( ) ; java . lang . String methodName = stackTrace . getMethodName ( ) ; java . lang . reflect . Method method ; try { method = java . lang . Class . forName ( className ) . getMethod ( methodName , ( ( java . lang . Class [ ] ) ( null ) ) ) ; } catch ( java . lang . NoSuchMethodException e ) { continue ; } org . junit . Test annotation = method . getAnnotation ( org . junit . Test . class ) ; if ( annotation != null ) return methodName ; } } catch ( java . lang . ClassNotFoundException shouldNeverOccur ) { } throw new java . lang . AssertionError ( "Cannot<sp>determine<sp>name<sp>of<sp>current<sp>test" ) ; }
|
org . junit . Assert . assertEquals ( workdir , "workdir" )
|
intValueFunctionToComparator ( ) { org . eclipse . collections . api . list . MutableList < java . lang . Integer > list = org . eclipse . collections . impl . list . Interval . oneTo ( 100 ) . toList ( ) . shuffleThis ( ) ; org . eclipse . collections . api . block . function . Function < java . lang . Integer , java . lang . Integer > function = Integer :: intValue ; list . sortThis ( org . eclipse . collections . impl . block . factory . Comparators . byFunction ( function ) ) ; "<AssertPlaceHolder>" ; } oneTo ( int ) { return org . eclipse . collections . impl . list . Interval . oneToBy ( count , 1 ) ; }
|
org . junit . Assert . assertEquals ( org . eclipse . collections . impl . list . Interval . oneTo ( 100 ) . toList ( ) , list )
|
shouldFindChildrenByMotherCaseId ( ) { org . ei . drishti . domain . Child firstChild = new org . ei . drishti . domain . Child ( "CASE-1" , "MOTHER-CASE-1" , "bcg" , "3" , "male" ) . withAnm ( "ANM<sp>ID<sp>1" ) ; org . ei . drishti . domain . Child secondChild = new org . ei . drishti . domain . Child ( "CASE-2" , "MOTHER-CASE-1" , "bcg" , "3" , "male" ) . withAnm ( "ANM<sp>ID<sp>1" ) ; org . ei . drishti . domain . Child thirdChild = new org . ei . drishti . domain . Child ( "CASE-3" , "MOTHER-CASE-1" , "bcg" , "3" , "male" ) . withAnm ( "ANM<sp>ID<sp>1" ) ; org . ei . drishti . domain . Child orphan = new org . ei . drishti . domain . Child ( "CASE-4" , "MOTHER-CASE-2" , "bcg" , "3" , "male" ) . withAnm ( "ANM<sp>ID<sp>1" ) ; allChildren . add ( firstChild ) ; allChildren . add ( secondChild ) ; allChildren . add ( thirdChild ) ; allChildren . add ( orphan ) ; java . util . List < org . ei . drishti . domain . Child > childrenFromDB = allChildren . findByMotherId ( "MOTHER-CASE-1" ) ; "<AssertPlaceHolder>" ; } findByMotherId ( java . lang . String ) { return db . queryView ( createQuery ( "children_by_mother_id" ) . key ( entityId ) . includeDocs ( true ) , org . ei . drishti . domain . Child . class ) ; }
|
org . junit . Assert . assertEquals ( asList ( firstChild , secondChild , thirdChild ) , childrenFromDB )
|
testVerhuizing ( ) { initMocks ( nl . bzk . brp . model . bijhouding . RegistreerVerhuizingBericht . class , SoortBericht . BHG_VBA_REGISTREER_VERHUIZING ) ; initBerichtVerwerker ( new java . util . ArrayList < nl . bzk . brp . model . validatie . Melding > ( ) , nl . bzk . brp . bijhouding . business . dto . bijhouding . BijhoudingResultaat . class , true ) ; final nl . bzk . brp . model . bericht . kern . AdministratieveHandelingBericht adminstratieveHandeling = new nl . bzk . brp . model . bericht . kern . HandelingVerhuizingIntergemeentelijkBericht ( ) ; voegAdministratieveHandelingToeAanBericht ( adminstratieveHandeling ) ; final nl . bzk . brp . model . bijhouding . RegistreerVerhuizingAntwoordBericht testBericht = new nl . bzk . brp . model . bijhouding . RegistreerVerhuizingAntwoordBericht ( ) ; when ( getAntwoordBerichtFactory ( ) . bouwAntwoordBericht ( any ( nl . bzk . brp . model . logisch . ber . Bericht . class ) , any ( nl . bzk . brp . bijhouding . business . dto . bijhouding . BijhoudingResultaat . class ) ) ) . thenReturn ( testBericht ) ; nl . bzk . brp . model . bijhouding . RegistreerVerhuizingAntwoordBericht resultaat = ( ( nl . bzk . brp . web . service . BijhoudingService ) ( getWebService ( ) ) ) . registreerVerhuizing ( ( ( nl . bzk . brp . model . bijhouding . RegistreerVerhuizingBericht ) ( getBericht ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getBericht ( ) { return bericht ; }
|
org . junit . Assert . assertEquals ( testBericht , resultaat )
|
testGetSuspendingTriggerDefinitionOneHit ( ) { final org . oscm . domobjects . Organization org = createOrgAndSetTriggerDefinition ( true , true ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { public org . oscm . domobjects . Void call ( ) throws org . oscm . domobjects . Exception { org . oscm . domobjects . Organization storedOrg = mgr . getReference ( org . oscm . domobjects . Organization . class , org . getKey ( ) ) ; org . oscm . domobjects . TriggerDefinition suspendingTriggerDefinition = storedOrg . getSuspendingTriggerDefinition ( TriggerType . ACTIVATE_SERVICE ) ; "<AssertPlaceHolder>" ; return null ; } } ) ; } getSuspendingTriggerDefinition ( org . oscm . internal . types . enumtypes . TriggerType ) { org . oscm . domobjects . TriggerDefinition result = null ; for ( org . oscm . domobjects . TriggerDefinition td : this . triggerDefinitions ) { if ( ( ( td . getType ( ) ) == type ) && ( td . isSuspendProcess ( ) ) ) { if ( result != null ) { throw new org . oscm . internal . types . exception . SaaSSystemException ( java . lang . String . format ( "More<sp>than<sp>one<sp>suspending<sp>trigger<sp>definition<sp>found<sp>for<sp>organization<sp>'%s'.<sp>Data<sp>is<sp>inconsistent,<sp>operation<sp>aborted." , java . lang . String . valueOf ( getKey ( ) ) ) ) ; } result = td ; } } return result ; }
|
org . junit . Assert . assertNotNull ( suspendingTriggerDefinition )
|
equalsTest4 ( ) { org . opendaylight . openflowjava . nx . api . NiciraActionSerializerKey obj = new org . opendaylight . openflowjava . nx . api . NiciraActionSerializerKey ( org . opendaylight . openflowjava . nx . api . NiciraActionSerializerKeyTest . VERSION , org . opendaylight . openflowjava . nx . api . NiciraActionSerializerKeyTest . SubtypeClass . class ) ; niciraActionSerializerKey = new org . opendaylight . openflowjava . nx . api . NiciraActionSerializerKey ( org . opendaylight . openflowjava . nx . api . NiciraActionSerializerKeyTest . VERSION , org . opendaylight . yang . gen . v1 . urn . opendaylight . openflow . common . action . rev150203 . action . grouping . action . choice . PopVlanCase . class ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == object ) { return true ; } if ( ( object == null ) || ( ( getClass ( ) ) != ( object . getClass ( ) ) ) ) { return false ; } org . opendaylight . openflowplugin . applications . southboundcli . util . OFNode ofNode = ( ( org . opendaylight . openflowplugin . applications . southboundcli . util . OFNode ) ( object ) ) ; return ( nodeId ) != null ? nodeId . equals ( ofNode . nodeId ) : ( ofNode . nodeId ) == null ; }
|
org . junit . Assert . assertFalse ( niciraActionSerializerKey . equals ( obj ) )
|
testFetchResourcesWithNestedAttributesAndTypes ( ) { io . katharsis . queryspec . QuerySpec querySpec = new io . katharsis . queryspec . QuerySpec ( io . katharsis . meta . model . resource . MetaResource . class ) ; io . katharsis . queryspec . QuerySpec dataObjectSpec = querySpec . getOrCreateQuerySpec ( io . katharsis . meta . model . MetaDataObject . class ) ; dataObjectSpec . includeRelation ( java . util . Arrays . asList ( "attributes" ) ) ; io . katharsis . queryspec . QuerySpec attrSpec = querySpec . getOrCreateQuerySpec ( io . katharsis . meta . model . MetaAttribute . class ) ; attrSpec . includeRelation ( java . util . Arrays . asList ( "type" ) ) ; io . katharsis . queryspec . QuerySpec typeSpec = querySpec . getOrCreateQuerySpec ( io . katharsis . meta . model . MetaType . class ) ; typeSpec . includeRelation ( java . util . Arrays . asList ( "attributes" , "type" , "elementType" , "attributes" ) ) ; typeSpec . includeRelation ( java . util . Arrays . asList ( "elementType" ) ) ; typeSpec . includeRelation ( java . util . Arrays . asList ( "superType" ) ) ; io . katharsis . resource . list . ResourceList < io . katharsis . meta . model . resource . MetaResource > list = client . getRepositoryForType ( io . katharsis . meta . model . resource . MetaResource . class ) . findAll ( querySpec ) ; "<AssertPlaceHolder>" ; for ( io . katharsis . meta . model . resource . MetaResource elem : list ) { checkDataObjectLoaded ( elem , new java . util . HashSet < java . lang . String > ( ) ) ; } } isEmpty ( ) { return map . isEmpty ( ) ; }
|
org . junit . Assert . assertFalse ( list . isEmpty ( ) )
|
testDelete ( ) { io . hops . erasure_coding . Codec . initializeCodecs ( getConfig ( ) ) ; io . hops . metadata . hdfs . entity . EncodingPolicy policy = new io . hops . metadata . hdfs . entity . EncodingPolicy ( "src" , ( ( short ) ( 1 ) ) ) ; io . hops . erasure_coding . Util . createRandomFile ( dfs , testFile , seed , io . hops . erasure_coding . TestErasureCodingManager . TEST_BLOCK_COUNT , io . hops . erasure_coding . DFS_TEST_BLOCK_SIZE , policy ) ; io . hops . metadata . hdfs . entity . EncodingStatus status ; while ( ! ( ( status = dfs . getEncodingStatus ( testFile . toUri ( ) . getPath ( ) ) ) . isEncoded ( ) ) ) { try { java . lang . Thread . sleep ( 5000 ) ; } catch ( java . lang . InterruptedException e ) { io . hops . erasure_coding . TestErasureCodingManager . LOG . error ( "Wait<sp>for<sp>encoding<sp>thread<sp>was<sp>interrupted." ) ; } } dfs . delete ( testFile , false ) ; java . lang . Thread . sleep ( ( 2 * ( conf . getInt ( DFSConfigKeys . RECHECK_INTERVAL_KEY , DFSConfigKeys . DEFAULT_RECHECK_INTERVAL ) ) ) ) ; org . apache . hadoop . fs . Path parityPath = new org . apache . hadoop . fs . Path ( conf . get ( DFSConfigKeys . PARITY_FOLDER , DFSConfigKeys . DEFAULT_PARITY_FOLDER ) , status . getParityFileName ( ) ) ; "<AssertPlaceHolder>" ; } exists ( java . lang . String ) { checkOpen ( ) ; return ( getFileInfo ( src ) ) != null ; }
|
org . junit . Assert . assertFalse ( dfs . exists ( parityPath ) )
|
testShiftNullBoolean ( ) { final boolean [ ] array = null ; org . apache . commons . lang3 . ArrayUtils . shift ( array , 1 ) ; "<AssertPlaceHolder>" ; } shift ( java . lang . Object [ ] , int ) { if ( array == null ) { return ; } org . apache . commons . lang3 . ArrayUtils . shift ( array , 0 , array . length , offset ) ; }
|
org . junit . Assert . assertNull ( array )
|
build_state_should_always_be_success ( ) { fr . norad . visuwall . api . domain . SoftwareProjectId softwareProjectId = new fr . norad . visuwall . api . domain . SoftwareProjectId ( "projectId" ) ; fr . norad . visuwall . api . domain . BuildState state = sonar . getBuildState ( softwareProjectId , 1 ) ; "<AssertPlaceHolder>" ; } getBuildState ( fr . norad . visuwall . api . domain . SoftwareProjectId , java . lang . Integer ) { checkConnected ( ) ; checkSoftwareProjectId ( softwareProjectId ) ; return fr . norad . visuwall . api . domain . BuildState . SUCCESS ; }
|
org . junit . Assert . assertEquals ( BuildState . SUCCESS , state )
|
testValidateUrl_SubdomainAndPath ( ) { boolean result = org . oscm . validator . ADMValidator . isUrl ( "http://subdomain.domain.de/path" ) ; "<AssertPlaceHolder>" ; } isUrl ( java . lang . String ) { return org . oscm . validator . ADMValidator . URL_VALIDATOR . isValid ( value ) ; }
|
org . junit . Assert . assertTrue ( result )
|
testFileUtilNotIdenticalDirs2 ( ) { java . nio . file . Path left = _tempDir . newFolder ( "left_dir" ) . toPath ( ) ; java . nio . file . Path right = _tempDir . newFolder ( "right_dir" ) . toPath ( ) ; java . nio . file . Path left_file = java . nio . file . Files . createFile ( left . resolve ( "file1" ) ) ; java . nio . file . Files . createFile ( right . resolve ( "file1" ) ) ; com . github . perlundq . yajsync . test . FileUtil . writeToFiles ( 0 , left_file ) ; "<AssertPlaceHolder>" ; } isDirectoriesIdentical ( java . nio . file . Path , java . nio . file . Path ) { java . util . SortedMap < java . nio . file . Path , java . nio . file . Path > leftFiles = com . github . perlundq . yajsync . test . FileUtil . listDir ( leftDir ) ; java . util . SortedMap < java . nio . file . Path , java . nio . file . Path > rightFiles = com . github . perlundq . yajsync . test . FileUtil . listDir ( rightDir ) ; if ( ! ( leftFiles . keySet ( ) . equals ( rightFiles . keySet ( ) ) ) ) { return false ; } for ( Map . Entry < java . nio . file . Path , java . nio . file . Path > entrySet : leftFiles . entrySet ( ) ) { java . nio . file . Path name = entrySet . getKey ( ) ; java . nio . file . Path leftPath = entrySet . getValue ( ) ; java . nio . file . Path rightPath = rightFiles . get ( name ) ; com . github . perlundq . yajsync . attr . RsyncFileAttributes leftAttrs = com . github . perlundq . yajsync . test . FileUtil . _fileManager . stat ( leftPath ) ; com . github . perlundq . yajsync . attr . RsyncFileAttributes rightAttrs = com . github . perlundq . yajsync . test . FileUtil . _fileManager . stat ( rightPath ) ; if ( ! ( com . github . perlundq . yajsync . test . FileUtil . isFileSameTypeAndSize ( leftAttrs , rightAttrs ) ) ) { return false ; } else if ( leftAttrs . isRegularFile ( ) ) { boolean isIdentical = com . github . perlundq . yajsync . test . FileUtil . isContentIdentical ( leftPath , rightPath ) ; if ( ! isIdentical ) { return false ; } } else if ( leftAttrs . isDirectory ( ) ) { boolean isIdentical = com . github . perlundq . yajsync . test . FileUtil . isDirectoriesIdentical ( leftPath , rightPath ) ; if ( ! isIdentical ) { return false ; } } } return true ; }
|
org . junit . Assert . assertFalse ( com . github . perlundq . yajsync . test . FileUtil . isDirectoriesIdentical ( left , right ) )
|
testDescribeOptimizeAdviceOnMissIndex ( ) { try { com . fit2cloud . aliyun . rds . model . request . DescribeOptimizeAdviceOnMissIndexRequest request = new com . fit2cloud . aliyun . rds . model . request . DescribeOptimizeAdviceOnMissIndexRequest ( ) ; request . setDBInstanceId ( dBInstanceId ) ; com . fit2cloud . aliyun . Response response = client . describeOptimizeAdviceOnMissIndex ( request ) ; System . out . println ( ( "testDescribeOptimizeAdviceOnMissIndex<sp>::<sp>" + ( new com . google . gson . Gson ( ) . toJson ( response ) ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } describeOptimizeAdviceOnMissIndex ( com . fit2cloud . aliyun . rds . model . request . DescribeOptimizeAdviceOnMissIndexRequest ) { return listPageableData ( describeOptimizeAdviceOnMissIndexRequest , "DescribeOptimizeAdviceOnMissIndex" , com . fit2cloud . aliyun . rds . model . response . DescribeOptimizeAdviceOnMissIndexResponse . class ) ; }
|
org . junit . Assert . assertTrue ( true )
|
isDataAvailable ( ) { bean . buf = data ; "<AssertPlaceHolder>" ; } isDataAvailable ( ) { bean . buf = data ; org . junit . Assert . assertTrue ( bean . isDataAvailable ( ) ) ; }
|
org . junit . Assert . assertTrue ( bean . isDataAvailable ( ) )
|
testDocsForMissingSystemApi ( ) { final org . apache . nifi . registry . extension . component . manifest . ExtensionManifest extensionManifest = parse ( "src/test/resources/descriptors/extension-manifest-missing-sys-api.xml" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { try ( final java . io . InputStream inputStream = new java . io . FileInputStream ( file ) ) { return parser . parse ( inputStream ) ; } }
|
org . junit . Assert . assertNotNull ( extensionManifest )
|
constructor_withRateLimitSetZero_shouldResetBackoffTimeLimit ( ) { com . mopub . network . RequestRateTrackerTest . prepareRequestRateTracker ( adUnitId , 99 , "some_reason" ) ; org . json . JSONObject jsonObject = com . mopub . network . MultiAdResponseTest . createJsonBody ( com . mopub . network . MultiAdResponseTest . FAIL_URL , singleAdResponse ) ; com . mopub . network . MultiAdResponseTest . addBackoffParameters ( jsonObject , 0 , "reason" ) ; com . mopub . volley . NetworkResponse testResponse = new com . mopub . volley . NetworkResponse ( jsonObject . toString ( ) . getBytes ( ) ) ; com . mopub . network . MultiAdResponse subject = new com . mopub . network . MultiAdResponse ( activity , testResponse , com . mopub . common . AdFormat . BANNER , adUnitId ) ; com . mopub . network . RequestRateTracker . TimeRecord record = com . mopub . network . RequestRateTracker . getInstance ( ) . getRecordForAdUnit ( adUnitId ) ; "<AssertPlaceHolder>" ; } getRecordForAdUnit ( java . lang . String ) { return mTimeRecordMap . get ( adUnitId ) ; }
|
org . junit . Assert . assertNull ( record )
|
testGetSink ( ) { org . talend . components . marklogic . runtime . input . MarkLogicInputSink inputSink = new org . talend . components . marklogic . runtime . input . MarkLogicInputSink ( ) ; org . talend . components . marklogic . runtime . input . MarkLogicInputWriteOperation inputWriteOperation = inputSink . createWriteOperation ( ) ; "<AssertPlaceHolder>" ; } getSink ( ) { return sink ; }
|
org . junit . Assert . assertEquals ( inputSink , inputWriteOperation . getSink ( ) )
|
insert_a_article_list ( ) { java . util . List < me . yufan . gossip . mybatis . entity . Article > articles = java . util . stream . IntStream . range ( 0 , 5 ) . boxed ( ) . map ( ( i ) -> randomArticle ( ) ) . collect ( toList ( ) ) ; mapper . batchInsert ( articles ) ; long failedCount = articles . stream ( ) . filter ( ( t ) -> ( t . getId ( ) ) == null ) . count ( ) ; "<AssertPlaceHolder>" ; } randomArticle ( ) { me . yufan . gossip . mybatis . entity . Article article = me . yufan . gossip . utils . RandomArticle . randomRawArticle ( ) ; article . setId ( randomId ( ) ) ; return article ; }
|
org . junit . Assert . assertThat ( failedCount , org . hamcrest . core . Is . is ( 0L ) )
|
test_plusWeeks_noChange_same ( ) { java . time . LocalDate t = TEST_2007_07_15 . plusWeeks ( 0 ) ; "<AssertPlaceHolder>" ; } plusWeeks ( long ) { return plusDays ( java . lang . Math . multiplyExact ( weeksToAdd , 7 ) ) ; }
|
org . junit . Assert . assertSame ( t , TEST_2007_07_15 )
|
testCastIncorrect ( ) { org . hawkular . apm . instrumenter . RuleHelper helper = new org . hawkular . apm . instrumenter . RuleHelper ( null ) ; org . hawkular . apm . instrumenter . RuleHelperTest . TestObject1 to1 = new org . hawkular . apm . instrumenter . RuleHelperTest . TestObject1 ( ) ; org . hawkular . apm . instrumenter . RuleHelperTest . TestObject2 to2 = helper . < org . hawkular . apm . instrumenter . RuleHelperTest . TestObject2 > cast ( to1 , org . hawkular . apm . instrumenter . RuleHelperTest . TestObject2 . class ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNull ( to2 )
|
testPartition ( ) { org . apache . tajo . catalog . Schema schema = org . apache . tajo . catalog . SchemaBuilder . builder ( ) . add ( "l_returnflag" , Type . TEXT ) . add ( "l_linestatus" , Type . TEXT ) . build ( ) ; org . apache . tajo . catalog . SortSpec [ ] sortSpecs = org . apache . tajo . plan . util . PlannerUtil . schemaToSortSpecs ( schema ) ; org . apache . tajo . storage . VTuple s = new org . apache . tajo . storage . VTuple ( 2 ) ; s . put ( 0 , org . apache . tajo . datum . DatumFactory . createText ( "A" ) ) ; s . put ( 1 , org . apache . tajo . datum . DatumFactory . createText ( "F" ) ) ; org . apache . tajo . storage . VTuple e = new org . apache . tajo . storage . VTuple ( 2 ) ; e . put ( 0 , org . apache . tajo . datum . DatumFactory . createText ( "R" ) ) ; e . put ( 1 , org . apache . tajo . datum . DatumFactory . createText ( "O" ) ) ; org . apache . tajo . storage . TupleRange expected = new org . apache . tajo . storage . TupleRange ( sortSpecs , s , e ) ; org . apache . tajo . engine . planner . RangePartitionAlgorithm partitioner = new org . apache . tajo . engine . planner . UniformRangePartition ( expected , sortSpecs , true ) ; org . apache . tajo . storage . TupleRange [ ] ranges = partitioner . partition ( 31 ) ; org . apache . tajo . storage . TupleRange prev = null ; for ( org . apache . tajo . storage . TupleRange r : ranges ) { if ( prev != null ) { "<AssertPlaceHolder>" ; } prev = r ; } } compareTo ( org . apache . tajo . QueryId ) { int result = id . compareTo ( queryId . id ) ; if ( result == 0 ) { return ( seq ) - ( queryId . seq ) ; } else { return result ; } }
|
org . junit . Assert . assertTrue ( ( ( prev . compareTo ( r ) ) < 0 ) )
|
rootCanNeverHaveAListener ( ) { io . grpc . Context root = io . grpc . Context . current ( ) ; root . addListener ( cancellationListener , com . google . common . util . concurrent . MoreExecutors . directExecutor ( ) ) ; "<AssertPlaceHolder>" ; } listenerCount ( ) { synchronized ( this ) { return ( listeners ) == null ? 0 : listeners . size ( ) ; } }
|
org . junit . Assert . assertEquals ( 0 , root . listenerCount ( ) )
|
testProperties ( ) { java . util . Map < java . lang . String , java . lang . String > properties = java . util . Collections . singletonMap ( "test" , "test_value" ) ; runtime = new org . apache . cayenne . configuration . rop . client . ClientRuntimeBuilder ( ) . properties ( properties ) . build ( ) ; java . util . Map < java . lang . String , java . lang . String > injectedProperties = runtime . getInjector ( ) . getInstance ( org . apache . cayenne . di . Key . getMapOf ( java . lang . String . class , java . lang . String . class , Constants . PROPERTIES_MAP ) ) ; "<AssertPlaceHolder>" ; } getMapOf ( java . lang . Class , java . lang . Class , java . lang . String ) { return new org . apache . cayenne . di . Key ( org . apache . cayenne . di . TypeLiteral . mapOf ( keyType , valueType ) , bindingName ) ; }
|
org . junit . Assert . assertEquals ( properties , injectedProperties )
|
testBuildWithDisabledSecurityConstraintWithOrderBy ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject context = new org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject ( ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "enrolment" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "enrolmentSubject" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy3 = new org . lnu . is . pagination . OrderBy ( "personEnrolmentSubject" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy4 = new org . lnu . is . pagination . OrderBy ( "mark" , org . lnu . is . pagination . OrderByType . DESC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 , orderBy3 , orderBy4 ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>EnrolmentEnrolmentSubject<sp>e<sp>WHERE<sp>e.status=:status<sp>ORDER<sp>BY<sp>e.enrolment<sp>ASC,<sp>e.enrolmentSubject<sp>DESC,<sp>e.personEnrolmentSubject<sp>ASC,<sp>e.mark<sp>DESC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testTransformWithEmptyListReturnEmptyList ( ) { java . util . List < java . lang . String > returnValue = breakTransformer . transform ( new java . util . ArrayList < java . lang . String > ( ) ) . getTransformedData ( ) ; java . util . List < java . lang . String > expected = new java . util . ArrayList ( ) ; "<AssertPlaceHolder>" ; } getTransformedData ( ) { return transformedData ; }
|
org . junit . Assert . assertEquals ( expected , returnValue )
|
injectionValidatorFactory ( ) { final javax . validation . ValidatorFactory validatorFactory = persistManager . getValidatorFactory ( ) ; "<AssertPlaceHolder>" ; } getValidatorFactory ( ) { return validatorFactory ; }
|
org . junit . Assert . assertNotNull ( validatorFactory )
|
givenMap_whenEqualsAndHashCodeOverridden_thenNoMemoryLeak ( ) { java . util . Map < com . baeldung . memoryleaks . equalshashcode . PersonOptimized , java . lang . Integer > map = new java . util . HashMap < com . baeldung . memoryleaks . equalshashcode . PersonOptimized , java . lang . Integer > ( ) ; for ( int i = 0 ; i < 10000 ; i ++ ) { map . put ( new com . baeldung . memoryleaks . equalshashcode . PersonOptimized ( "jon" ) , 1 ) ; } "<AssertPlaceHolder>" ; System . out . print ( "Debug<sp>Point<sp>-<sp>VisuaLVM" ) ; } size ( ) { return elements . size ( ) ; }
|
org . junit . Assert . assertTrue ( ( ( map . size ( ) ) == 1 ) )
|
proxyIsAdded ( ) { org . openqa . grid . internal . GridRegistry registry = de . zalando . ep . zalenium . registry . ZaleniumRegistry . newInstance ( new org . openqa . grid . web . Hub ( new org . openqa . grid . internal . utils . configuration . GridHubConfiguration ( ) ) , new org . openqa . grid . internal . ProxySet ( false ) ) ; de . zalando . ep . zalenium . proxy . DockerSeleniumRemoteProxy p1 = de . zalando . ep . zalenium . util . TestUtils . getNewBasicRemoteProxy ( "app1" , "http://machine1:4444/" , registry ) ; de . zalando . ep . zalenium . proxy . DockerSeleniumRemoteProxy p2 = de . zalando . ep . zalenium . util . TestUtils . getNewBasicRemoteProxy ( "app1" , "http://machine2:4444/" , registry ) ; de . zalando . ep . zalenium . proxy . DockerSeleniumRemoteProxy p3 = de . zalando . ep . zalenium . util . TestUtils . getNewBasicRemoteProxy ( "app1" , "http://machine3:4444/" , registry ) ; de . zalando . ep . zalenium . proxy . DockerSeleniumRemoteProxy p4 = de . zalando . ep . zalenium . util . TestUtils . getNewBasicRemoteProxy ( "app1" , "http://machine4:4444/" , registry ) ; try { registry . add ( p1 ) ; registry . add ( p2 ) ; registry . add ( p3 ) ; registry . add ( p4 ) ; "<AssertPlaceHolder>" ; } finally { registry . stop ( ) ; } } getAllProxies ( ) { return proxies ; }
|
org . junit . Assert . assertEquals ( 4 , registry . getAllProxies ( ) . size ( ) )
|
testLoadingDfsUsedForVolumes ( ) { long waitIntervalTime = 5000 ; long cachedDfsUsedIntervalTime = waitIntervalTime + 1000 ; conf . setLong ( org . apache . hadoop . hdfs . DFSConfigKeys . DFS_DN_CACHED_DFSUSED_CHECK_INTERVAL_MS , cachedDfsUsedIntervalTime ) ; long cacheDfsUsed = 1024 ; long dfsUsed = getDfsUsedValueOfNewVolume ( cacheDfsUsed , waitIntervalTime ) ; "<AssertPlaceHolder>" ; } getDfsUsedValueOfNewVolume ( long , long ) { java . util . List < org . apache . hadoop . hdfs . server . protocol . NamespaceInfo > nsInfos = com . google . common . collect . Lists . newArrayList ( ) ; nsInfos . add ( new org . apache . hadoop . hdfs . server . protocol . NamespaceInfo ( 0 , org . apache . hadoop . hdfs . server . datanode . fsdataset . impl . TestFsDatasetImpl . CLUSTER_ID , org . apache . hadoop . hdfs . server . datanode . fsdataset . impl . TestFsDatasetImpl . BLOCK_POOL_IDS [ 0 ] , 1 ) ) ; java . lang . String CURRENT_DIR = "current" ; java . lang . String DU_CACHE_FILE = BlockPoolSlice . DU_CACHE_FILE ; java . lang . String path = ( org . apache . hadoop . hdfs . server . datanode . fsdataset . impl . TestFsDatasetImpl . BASE_DIR ) + "/newData0" ; java . lang . String pathUri = new org . apache . hadoop . fs . Path ( path ) . toUri ( ) . toString ( ) ; org . apache . hadoop . hdfs . server . datanode . StorageLocation loc = org . apache . hadoop . hdfs . server . datanode . StorageLocation . parse ( pathUri ) ; org . apache . hadoop . hdfs . server . common . Storage . StorageDirectory sd = org . apache . hadoop . hdfs . server . datanode . fsdataset . impl . TestFsDatasetImpl . createStorageDirectory ( new java . io . File ( path ) , conf ) ; org . apache . hadoop . hdfs . server . datanode . DataStorage . VolumeBuilder builder = new org . apache . hadoop . hdfs . server . datanode . DataStorage . VolumeBuilder ( storage , sd ) ; when ( storage . prepareVolume ( eq ( datanode ) , eq ( loc ) , anyList ( ) ) ) . thenReturn ( builder ) ; java . lang . String cacheFilePath = java . lang . String . format ( "%s/%s/%s/%s/%s" , path , CURRENT_DIR , org . apache . hadoop . hdfs . server . datanode . fsdataset . impl . TestFsDatasetImpl . BLOCK_POOL_IDS [ 0 ] , CURRENT_DIR , DU_CACHE_FILE ) ; java . io . File outFile = new java . io . File ( cacheFilePath ) ; if ( ! ( outFile . getParentFile ( ) . exists ( ) ) ) { outFile . getParentFile ( ) . mkdirs ( ) ; } if ( outFile . exists ( ) ) { outFile . delete ( ) ; } org . apache . hadoop . util . FakeTimer timer = new org . apache . hadoop . util . FakeTimer ( ) ; try { try ( java . io . Writer out = new java . io . OutputStreamWriter ( new java . io . FileOutputStream ( outFile ) , java . nio . charset . StandardCharsets . UTF_8 ) ) { out . write ( ( ( ( java . lang . Long . toString ( cacheDfsUsed ) ) + "<sp>" ) + ( java . lang . Long . toString ( timer . now ( ) ) ) ) ) ; out . flush ( ) ; } } catch ( java . io . IOException ioe ) { } dataset . setTimer ( timer ) ; timer . advance ( waitIntervalTime ) ; dataset . addVolume ( loc , nsInfos ) ; org . apache . hadoop . hdfs . server . datanode . fsdataset . impl . FsVolumeImpl newVolume ; try ( org . apache . hadoop . hdfs . server . datanode . fsdataset . FsDatasetSpi . FsVolumeReferences volumes = dataset . getFsVolumeReferences ( ) ) { newVolume = ( ( org . apache . hadoop . hdfs . server . datanode . fsdataset . impl . FsVolumeImpl ) ( volumes . get ( ( ( volumes . size ( ) ) - 1 ) ) ) ) ; } long dfsUsed = newVolume . getDfsUsed ( ) ; return dfsUsed ; }
|
org . junit . Assert . assertEquals ( cacheDfsUsed , dfsUsed )
|
testConnectionTriggersNonFatalException ( ) { final java . sql . Connection mockConnection = createNiceMock ( java . sql . Connection . class ) ; com . jolbox . bonecp . TestRobustness . driver = new com . jolbox . bonecp . MockJDBCDriver ( new com . jolbox . bonecp . MockJDBCAnswer ( ) { public java . sql . Connection answer ( ) throws java . sql . SQLException { return mockConnection ; } } ) ; com . jolbox . bonecp . BoneCP pool = new com . jolbox . bonecp . BoneCP ( config ) ; expect ( mockConnection . prepareStatement ( ( ( java . lang . String ) ( anyObject ( ) ) ) ) ) . andThrow ( new java . sql . SQLException ( "FOO" , "FOO" ) ) ; replay ( mockConnection ) ; try { pool . getConnection ( ) . prepareStatement ( "lalala" ) ; org . junit . Assert . fail ( "Should<sp>trigger<sp>exception" ) ; } catch ( java . sql . SQLException e ) { "<AssertPlaceHolder>" ; } pool . close ( ) ; } prepareStatement ( java . lang . String ) { return new com . jolbox . bonecp . MockPreparedStatement ( ) ; }
|
org . junit . Assert . assertEquals ( "FOO" , e . getMessage ( ) )
|
test ( ) { victim = new ro . isdc . wro . http . handler . LazyRequestHandlerDecorator ( new ro . isdc . wro . util . LazyInitializer < ro . isdc . wro . http . handler . RequestHandler > ( ) { @ ro . isdc . wro . http . handler . Override protected ro . isdc . wro . http . handler . RequestHandler initialize ( ) { return new ro . isdc . wro . http . handler . TestLazyRequestHandlerDecorator . CustomRequestHandler ( ) ; } } ) ; ro . isdc . wro . util . WroTestUtils . createInjector ( ) . inject ( victim ) ; "<AssertPlaceHolder>" ; } isEnabled ( ) { return ( super . isEnabled ( ) ) && ( context . getConfig ( ) . isDebug ( ) ) ; }
|
org . junit . Assert . assertTrue ( victim . isEnabled ( ) )
|
readWordsFromFileTest ( ) { edu . brown . cs . tbhargav . fileparsers . ExtWordsFileParser fReader = new edu . brown . cs . tbhargav . fileparsers . ExtWordsFileParser ( "other" 6 ) ; java . util . List < java . lang . String > wordsRead = new java . util . ArrayList < java . lang . String > ( ) ; try { wordsRead = fReader . readWords ( ) ; } catch ( java . io . IOException e ) { fReader . closeReader ( ) ; e . printStackTrace ( ) ; } java . util . List < java . lang . String > preCompAnswers = new java . util . ArrayList < java . lang . String > ( ) ; preCompAnswers . add ( "in" 5 ) ; preCompAnswers . add ( "other" 0 ) ; preCompAnswers . add ( "other" 2 ) ; preCompAnswers . add ( "in" 2 ) ; preCompAnswers . add ( "in" ) ; preCompAnswers . add ( "bohemia" ) ; preCompAnswers . add ( "other" 0 ) ; preCompAnswers . add ( "to" ) ; preCompAnswers . add ( "other" 9 ) ; preCompAnswers . add ( "holmes" ) ; preCompAnswers . add ( "other" 7 ) ; preCompAnswers . add ( "other" 3 ) ; preCompAnswers . add ( "always" ) ; preCompAnswers . add ( "in" 3 ) ; preCompAnswers . add ( "woman" ) ; preCompAnswers . add ( "other" 0 ) ; preCompAnswers . add ( "in" 6 ) ; preCompAnswers . add ( "seldom" ) ; preCompAnswers . add ( "in" 0 ) ; preCompAnswers . add ( "other" 5 ) ; preCompAnswers . add ( "other" 4 ) ; preCompAnswers . add ( "her" ) ; preCompAnswers . add ( "under" ) ; preCompAnswers . add ( "in" 4 ) ; preCompAnswers . add ( "other" ) ; preCompAnswers . add ( "in" 1 ) ; preCompAnswers . add ( "other" 1 ) ; preCompAnswers . add ( "other" 8 ) ; for ( int i = 0 ; ( i < ( preCompAnswers . size ( ) ) ) && ( i < ( wordsRead . size ( ) ) ) ; i ++ ) { java . lang . String s = preCompAnswers . get ( i ) ; java . lang . String t = wordsRead . get ( i ) ; "<AssertPlaceHolder>" ; } } closeReader ( ) { if ( ( br ) != null ) { try { br . close ( ) ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } } }
|
org . junit . Assert . assertTrue ( s . equalsIgnoreCase ( t ) )
|
testValueOf2 ( ) { eu . bitwalker . useragentutils . UserAgent userAgent = eu . bitwalker . useragentutils . UserAgent . parseUserAgentString ( "Mozilla/4.0<sp>(compatible;<sp>MSIE<sp>6.0;<sp>Windows<sp>NT<sp>5.2;<sp>SV1;<sp>.NET<sp>CLR<sp>1.1.4322;<sp>.NET<sp>CLR<sp>2.0.50727)" ) ; eu . bitwalker . useragentutils . UserAgent retrievedUserAgent = eu . bitwalker . useragentutils . UserAgent . valueOf ( userAgent . toString ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { PC value = ( ( dataSource ) == null ) ? null : ( ( PC ) ( dataSource . getValue ( ) ) ) ; if ( value == null ) { return null ; } FC formattedValue = format ( value ) ; return java . lang . String . valueOf ( formattedValue ) ; }
|
org . junit . Assert . assertEquals ( userAgent , retrievedUserAgent )
|
testOnDeletePresentThingy ( ) { de . jethroo . rest . example . Thingy thingy = new de . jethroo . rest . example . Thingy ( "something" ) ; dao . insert ( thingy ) ; javax . ws . rs . core . Response response = service . onDelete ( thingy . getId ( ) ) ; de . jethroo . rest . example . Thingy response_thingy = gson . fromJson ( response . getEntity ( ) . toString ( ) , de . jethroo . rest . example . Thingy . class ) ; "<AssertPlaceHolder>" ; } findById ( int ) { org . hibernate . Session session = getSessionFactory ( ) . getCurrentSession ( ) ; session . beginTransaction ( ) ; de . jethroo . rest . example . Thingy thing = ( ( de . jethroo . rest . example . Thingy ) ( session . get ( de . jethroo . rest . example . Thingy . class , id ) ) ) ; session . getTransaction ( ) . commit ( ) ; return thing ; }
|
org . junit . Assert . assertEquals ( null , dao . findById ( response_thingy . getId ( ) ) )
|
testGetIndices ( ) { com . bah . culvert . mock . MockIndex ix1 = new com . bah . culvert . mock . MockIndex ( "foo" , 0 , true , "a" . getBytes ( ) , "b" . getBytes ( ) , "c" , "d" ) ; com . bah . culvert . mock . MockIndex ix2 = new com . bah . culvert . mock . MockIndex ( "bar" , 0 , true , "e" . getBytes ( ) , "f" . getBytes ( ) , "g" , "h" ) ; org . apache . hadoop . conf . Configuration conf = com . bah . culvert . configuration . CConfiguration . getDefault ( ) ; com . bah . culvert . Client client = new com . bah . culvert . Client ( conf ) ; client . addIndex ( ix1 ) ; client . addIndex ( ix2 ) ; "<AssertPlaceHolder>" ; } getIndices ( ) { java . lang . String [ ] indexNames = this . configuration . getStrings ( com . bah . culvert . Client . INDEXES_CONF_KEY ) ; int arrayLength = ( indexNames == null ) ? 0 : indexNames . length ; com . bah . culvert . data . index . Index [ ] indices = new com . bah . culvert . data . index . Index [ arrayLength ] ; for ( int i = 0 ; i < arrayLength ; i ++ ) { java . lang . String name = indexNames [ i ] ; java . lang . Class < ? > indexClass = configuration . getClass ( com . bah . culvert . Client . indexClassConfKey ( name ) , null ) ; org . apache . hadoop . conf . Configuration indexConf = com . bah . culvert . util . ConfUtils . unpackConfigurationInPrefix ( com . bah . culvert . Client . indexConfPrefix ( name ) , configuration ) ; com . bah . culvert . data . index . Index index ; try { index = com . bah . culvert . data . index . Index . class . cast ( indexClass . newInstance ( ) ) ; } catch ( java . lang . InstantiationException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . IllegalAccessException e ) { throw new java . lang . RuntimeException ( e ) ; } index . setConf ( indexConf ) ; indices [ i ] = index ; } return indices ; }
|
org . junit . Assert . assertNotNull ( client . getIndices ( ) )
|
stream_of_empty_optionals ( ) { java . util . stream . Stream < java . lang . String > names = java . util . stream . Stream . of ( "John" , "Susan" ) ; java . util . stream . Stream < java . lang . String > transformed = names . flatMap ( ( s ) -> com . codepoetics . protonpack . StreamUtils . stream ( java . util . Optional . empty ( ) ) ) ; java . util . List < java . lang . String > results = transformed . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } toList ( ) { return collect ( java . util . stream . Collectors . toList ( ) ) ; }
|
org . junit . Assert . assertEquals ( java . util . Collections . emptyList ( ) , results )
|
testRequestsExpecting100ContinueBehaviorShouldSetExpectHeader ( ) { final org . apache . hc . core5 . http . message . BasicClassicHttpRequest post = new org . apache . hc . core5 . http . message . BasicClassicHttpRequest ( "POST" , "/" ) ; post . setHeader ( HttpHeaders . EXPECT , HeaderElements . CONTINUE ) ; post . setHeader ( "Content-Length" , "128" ) ; post . setEntity ( new org . apache . hc . core5 . http . io . entity . StringEntity ( "whatever" ) ) ; final org . easymock . Capture < org . apache . hc . core5 . http . ClassicHttpRequest > reqCap = org . easymock . EasyMock . newCapture ( ) ; org . easymock . EasyMock . expect ( mockExecChain . proceed ( org . easymock . EasyMock . capture ( reqCap ) , org . easymock . EasyMock . isA ( ExecChain . Scope . class ) ) ) . andReturn ( originResponse ) ; replayMocks ( ) ; execute ( post ) ; verifyMocks ( ) ; final org . apache . hc . core5 . http . ClassicHttpRequest forwarded = reqCap . getValue ( ) ; boolean foundExpect = false ; final java . util . Iterator < org . apache . hc . core5 . http . HeaderElement > it = org . apache . hc . core5 . http . message . MessageSupport . iterate ( forwarded , HttpHeaders . EXPECT ) ; while ( it . hasNext ( ) ) { final org . apache . hc . core5 . http . HeaderElement elt = it . next ( ) ; if ( "100-continue" . equalsIgnoreCase ( elt . getName ( ) ) ) { foundExpect = true ; break ; } } "<AssertPlaceHolder>" ; } getName ( ) { return "MyBasic" ; }
|
org . junit . Assert . assertTrue ( foundExpect )
|
testNormalizeTime ( ) { System . out . println ( "normalizeTime" ) ; long time = 0L ; kg . apc . jmeter . graphs . AbstractOverTimeVisualizer instance = new kg . apc . jmeter . graphs . AbstractOverTimeVisualizerTest . AbstractOverTimeVisualizerImpl ( ) ; long expResult = 0L ; long result = instance . normalizeTime ( time ) ; "<AssertPlaceHolder>" ; } normalizeTime ( long ) { return time - ( time % ( getGranulation ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
useDaylightTime ( ) { "<AssertPlaceHolder>" ; } useDaylightTime ( ) { org . junit . Assert . assertFalse ( new org . apache . commons . lang3 . time . GmtTimeZone ( false , 0 , 0 ) . useDaylightTime ( ) ) ; }
|
org . junit . Assert . assertFalse ( new org . apache . commons . lang3 . time . GmtTimeZone ( false , 0 , 0 ) . useDaylightTime ( ) )
|
testExpectedOutputOneIssue ( ) { java . io . File file = new java . io . File ( "foo/bar.js" ) ; com . googlecode . jslint4java . Issue issue = new com . googlecode . jslint4java . Issue . IssueBuilder ( file . toString ( ) , 1 , 1 , "no<sp>clucking" ) . evidence ( "cluck()" ) . build ( ) ; issues . add ( issue ) ; runFormatter ( file ) ; java . lang . String nl = java . lang . System . getProperty ( "line.separator" ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( file . toString ( ) ) ; sb . append ( ":1:1:<sp>no<sp>clucking" ) ; sb . append ( nl ) ; sb . append ( "cluck()" ) ; sb . append ( nl ) ; sb . append ( "^" ) ; sb . append ( nl ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( getSystemId ( ) ) + ":" ) + ( getLine ( ) ) ) + ":" ) + ( getCharacter ( ) ) ) + ":" ) + ( getReason ( ) ) ; }
|
org . junit . Assert . assertThat ( out . toString ( ) , org . hamcrest . CoreMatchers . is ( sb . toString ( ) ) )
|
shouldWriteToTerminationLog ( ) { final java . nio . file . Path tempFile = java . nio . file . Files . createTempFile ( "termination-log-" , "" ) ; tempFile . toFile ( ) . deleteOnExit ( ) ; environmentVariables . set ( com . spotify . flo . contrib . styx . TerminationLoggingTest . STYX_TERMINATION_LOG , tempFile . toString ( ) ) ; final java . lang . String expected = "{\"component_id\":<sp>\"foo\"," + ( ( ( ( "\"workflow_id\":<sp>\"bar\"," + "\"parameter\":<sp>\"2018-01-01\"," ) + "\"execution_id\":<sp>\"foobar\"," ) + "\"event\":<sp>\"exited\"," ) + "\"exit_code\":<sp>20}" ) ; terminationHook . accept ( 20 ) ; final java . lang . String content = new java . lang . String ( java . nio . file . Files . readAllBytes ( tempFile ) ) ; "<AssertPlaceHolder>" ; } accept ( T ) { value = t ; latch . countDown ( ) ; }
|
org . junit . Assert . assertThat ( content , org . hamcrest . Matchers . is ( expected ) )
|
test_bounce_unsigned_long ( ) { int result = server . bounce_unsigned_long ( 123456 ) ; "<AssertPlaceHolder>" ; } bounce_unsigned_long ( int ) { return x ; }
|
org . junit . Assert . assertEquals ( 123456 , result )
|
testResultsCountSummaryNoCount ( ) { "<AssertPlaceHolder>" ; } resultsCountSummary ( ) { java . lang . String s = null ; int total = totalResults ( ) ; if ( total >= 0 ) { int perPage = itemsPerPage ( ) ; int from = startIndex ( ) ; if ( ( ( perPage > 0 ) && ( from >= 0 ) ) && ( total > 0 ) ) { int to = ( from + perPage ) - 1 ; if ( to > total ) { to = total ; } s = java . lang . String . format ( "Showing<sp>items<sp>%d<sp>to<sp>%d<sp>of<sp>%d" , from , to , total ) ; } else { java . lang . String plural = ( total == 1 ) ? "" : "s" ; s = java . lang . String . format ( "%d<sp>result%s" , total , plural ) ; } } return s ; }
|
org . junit . Assert . assertNull ( page . resultsCountSummary ( ) )
|
getDomainCreatePermissions_validAsSystemResource ( ) { authenticateSystemResource ( ) ; final com . acciente . oacc . DomainCreatePermission domCreatePerm_superuser = com . acciente . oacc . DomainCreatePermissions . getInstance ( com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . SUPER_USER ) ) ; final com . acciente . oacc . DomainCreatePermission domCreatePerm_create_withGrant = com . acciente . oacc . DomainCreatePermissions . getInstanceWithGrantOption ( DomainCreatePermissions . CREATE ) ; final com . acciente . oacc . DomainCreatePermission domCreatePerm_child = com . acciente . oacc . DomainCreatePermissions . getInstance ( com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . CREATE_CHILD_DOMAIN ) ) ; com . acciente . oacc . Resource accessorResource = generateUnauthenticatableResource ( ) ; java . util . Set < com . acciente . oacc . DomainCreatePermission > domainCreatePermissions_pre = new java . util . HashSet ( ) ; domainCreatePermissions_pre . add ( domCreatePerm_superuser ) ; domainCreatePermissions_pre . add ( domCreatePerm_create_withGrant ) ; domainCreatePermissions_pre . add ( domCreatePerm_child ) ; accessControlContext . setDomainCreatePermissions ( accessorResource , domainCreatePermissions_pre ) ; final java . util . Set < com . acciente . oacc . DomainCreatePermission > domainCreatePermissions_post = accessControlContext . getDomainCreatePermissions ( accessorResource ) ; "<AssertPlaceHolder>" ; } getDomainCreatePermissions ( com . acciente . oacc . Resource ) { com . acciente . oacc . sql . internal . persister . SQLConnection connection = null ; __assertAuthenticated ( ) ; __assertResourceSpecified ( accessorResource ) ; try { connection = __getConnection ( ) ; accessorResource = __resolveResource ( connection , accessorResource ) ; __assertQueryAuthorization ( connection , accessorResource ) ; return __getDirectDomainCreatePermissions ( connection , accessorResource ) ; } finally { __closeConnection ( connection ) ; } }
|
org . junit . Assert . assertThat ( domainCreatePermissions_post , org . hamcrest . CoreMatchers . is ( domainCreatePermissions_pre ) )
|
testRead ( ) { final com . google . common . util . concurrent . FluentFuture < ? extends org . opendaylight . mdsal . common . api . CommitInfo > fut = mdsalUtilsAsync . put ( LogicalDatastoreType . CONFIGURATION , org . opendaylight . ovsdb . utils . mdsal . utils . MdsalUtilsAsyncTest . TEST_IID , org . opendaylight . ovsdb . utils . mdsal . utils . MdsalUtilsAsyncTest . DATA ) ; com . google . common . util . concurrent . Futures . addCallback ( fut , new com . google . common . util . concurrent . FutureCallback < org . opendaylight . mdsal . common . api . CommitInfo > ( ) { @ org . opendaylight . ovsdb . utils . mdsal . utils . Override public void onSuccess ( final org . opendaylight . mdsal . common . api . CommitInfo result ) { final com . google . common . util . concurrent . FluentFuture < java . util . Optional < org . opendaylight . yang . gen . v1 . urn . tbd . params . xml . ns . yang . network . topology . rev131021 . network . topology . topology . Node > > future = mdsalUtilsAsync . read ( LogicalDatastoreType . CONFIGURATION , org . opendaylight . ovsdb . utils . mdsal . utils . MdsalUtilsAsyncTest . TEST_IID ) ; java . util . Optional < org . opendaylight . yang . gen . v1 . urn . tbd . params . xml . ns . yang . network . topology . rev131021 . network . topology . topology . Node > optNode ; try { optNode = future . get ( ) ; if ( optNode . isPresent ( ) ) { "<AssertPlaceHolder>" ; } else { org . junit . Assert . fail ( "Couldn't<sp>read<sp>node" ) ; } } catch ( java . lang . InterruptedException | java . util . concurrent . ExecutionException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } @ org . opendaylight . ovsdb . utils . mdsal . utils . Override public void onFailure ( final java . lang . Throwable ex ) { org . junit . Assert . fail ( ex . getMessage ( ) ) ; } } , com . google . common . util . concurrent . MoreExecutors . directExecutor ( ) ) ; } read ( org . opendaylight . mdsal . common . api . LogicalDatastoreType , org . opendaylight . yangtools . yang . binding . InstanceIdentifier ) { java . util . Optional < D > optionalDataObject = readOptional ( store , path ) ; if ( optionalDataObject . isPresent ( ) ) { return optionalDataObject . get ( ) ; } org . opendaylight . ovsdb . utils . mdsal . utils . MdsalUtils . LOG . debug ( "{}:<sp>Failed<sp>to<sp>read<sp>{}" , java . lang . Thread . currentThread ( ) . getStackTrace ( ) [ 1 ] , path ) ; return null ; }
|
org . junit . Assert . assertEquals ( org . opendaylight . ovsdb . utils . mdsal . utils . MdsalUtilsAsyncTest . DATA , optNode . get ( ) )
|
hamcrest_core_isEqual ( ) { java . lang . String spottedCreator = "New<sp>Glarus<sp>Brewing<sp>Company" ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( spottedCreator , org . hamcrest . CoreMatchers . equalTo ( "New<sp>Glarus<sp>Brewing<sp>Company" ) )
|
testBooleanNamedSheet ( ) { org . apache . poi . hssf . usermodel . HSSFWorkbook wb = new org . apache . poi . hssf . usermodel . HSSFWorkbook ( ) ; org . apache . poi . hssf . usermodel . HSSFSheet sheet = wb . createSheet ( "true" ) ; org . apache . poi . hssf . usermodel . HSSFCell cell = sheet . createRow ( 0 ) . createCell ( 0 ) ; cell . setCellFormula ( "'true'!B2" ) ; "<AssertPlaceHolder>" ; wb . close ( ) ; } getCellFormula ( ) { return getCellFormula ( null ) ; }
|
org . junit . Assert . assertEquals ( "'true'!B2" , cell . getCellFormula ( ) )
|
deveGerarXMLDeAcordoComOPadraoEstabelecidoBCAliquotaPercentual ( ) { final com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemImpostoPISOutrasOperacoes pisOutrasOperacoes = new com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemImpostoPISOutrasOperacoes ( ) ; pisOutrasOperacoes . setSituacaoTributaria ( NFNotaInfoSituacaoTributariaPIS . OUTRAS_OPERACOES_SAIDA ) ; pisOutrasOperacoes . setPercentualAliquota ( new java . math . BigDecimal ( "99.99" ) ) ; pisOutrasOperacoes . setValorBaseCalculo ( new java . math . BigDecimal ( "999999999999.99" ) ) ; pisOutrasOperacoes . setValorTributo ( new java . math . BigDecimal ( "999999999999.99" ) ) ; final java . lang . String xmlEsperado = "<NFNotaInfoItemImpostoPISOutrasOperacoes><CST>49</CST><vBC>999999999999.99</vBC><pPIS>99.99</pPIS><vPIS>999999999999.99</vPIS></NFNotaInfoItemImpostoPISOutrasOperacoes>" ; "<AssertPlaceHolder>" ; } toString ( ) { return this . getDescricao ( ) ; }
|
org . junit . Assert . assertEquals ( xmlEsperado , pisOutrasOperacoes . toString ( ) )
|
addTest ( ) { doNothing ( ) . when ( listPresenter ) . addToListElement ( any ( ) ) ; final java . util . List < org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel > objs = new java . util . ArrayList < org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel > ( ) ; objs . add ( new org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel ( "foo" ) ) ; objs . add ( new org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel ( "bar" ) ) ; listPresenter . setup ( mock ( elemental2 . dom . HTMLElement . class ) , objs , ( a , b ) -> { } ) ; listPresenter . add ( new org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel ( "dee" ) ) ; verify ( listPresenter ) . addToListElement ( eq ( new org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel ( "dee" ) ) ) ; "<AssertPlaceHolder>" ; } getObjectsList ( ) { return objects ; }
|
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( new org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel ( "foo" ) , new org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel ( "bar" ) , new org . kie . workbench . common . services . shared . kmodule . SingleValueItemObjectModel ( "dee" ) ) , listPresenter . getObjectsList ( ) )
|
testRepository ( ) { com . example . readinglist . domain . Book book = new com . example . readinglist . domain . Book ( ) ; book . setAuthor ( "liangxifeng" ) ; book . setReader ( "zhansan" ) ; com . example . readinglist . domain . Book bookRes = bookList . save ( book ) ; com . example . readinglist . domain . Book bookRead = bookList . getOne ( bookRes . getId ( ) ) ; System . out . println ( ( ( ( bookRead . getAuthor ( ) ) + "reader:<sp>" ) + ( bookRead . getReader ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getAuthor ( ) { return author ; }
|
org . junit . Assert . assertTrue ( "" , ( ( bookRead . getAuthor ( ) ) == "liangxifeng" ) )
|
getSensorsFromProvider ( ) { when ( jedisSequenceUtils . getPid ( org . sentilo . platform . service . test . service . ResourceServiceImplTest . PROVIDER_ID ) ) . thenReturn ( org . sentilo . platform . service . test . service . ResourceServiceImplTest . PID ) ; when ( jedisTemplate . sMembers ( service . getKeysBuilder ( ) . getProviderSensorsKey ( org . sentilo . platform . service . test . service . ResourceServiceImplTest . PID ) ) ) . thenReturn ( java . util . Collections . < java . lang . String > emptySet ( ) ) ; final java . util . Set < java . lang . String > members = service . getSensorsFromProvider ( org . sentilo . platform . service . test . service . ResourceServiceImplTest . PROVIDER_ID ) ; verify ( jedisSequenceUtils ) . getPid ( org . sentilo . platform . service . test . service . ResourceServiceImplTest . PROVIDER_ID ) ; verify ( jedisTemplate ) . sMembers ( service . getKeysBuilder ( ) . getProviderSensorsKey ( org . sentilo . platform . service . test . service . ResourceServiceImplTest . PID ) ) ; "<AssertPlaceHolder>" ; } getProviderSensorsKey ( java . lang . Long ) { return ( "pid:" + pid ) + ":sensors" ; }
|
org . junit . Assert . assertNotNull ( members )
|
shouldFireEventWhenRosterReady ( ) { final com . calclab . emite . xtesting . handlers . RosterRetrievedTestHandler handler = new com . calclab . emite . xtesting . handlers . RosterRetrievedTestHandler ( ) ; roster . addRosterRetrievedHandler ( handler ) ; shouldRequestRosterOnLogin ( ) ; session . answerSuccess ( serverRoster ( ) ) ; "<AssertPlaceHolder>" ; } isCalledOnce ( ) { return ( getCalledTimes ( ) ) == 1 ; }
|
org . junit . Assert . assertTrue ( handler . isCalledOnce ( ) )
|
testIsInitialized_complete ( ) { com . hp . alm . ali . idea . model . Entity entity = new com . hp . alm . ali . idea . model . Entity ( "defect" , 1 ) ; entity . setComplete ( true ) ; com . hp . alm . ali . idea . tasks . HpAlmTask task = new com . hp . alm . ali . idea . tasks . HpAlmTask ( getProject ( ) , entity ) ; "<AssertPlaceHolder>" ; } isInitialized ( ) { return ( entity . isComplete ( ) ) || ( ( ( ( entity . isInitialized ( "name" ) ) && ( hasDateProperties ( entity ) ) ) && ( entity . isInitialized ( com . hp . alm . ali . idea . tasks . HpAlmTask . getDescriptionField ( entity . getType ( ) ) ) ) ) && ( ( entity . isInitialized ( "dev-comments" ) ) || ( entity . isInitialized ( "comments" ) ) ) ) ; }
|
org . junit . Assert . assertTrue ( task . isInitialized ( ) )
|
testAssertion ( ) { org . semanticweb . owlapi . util . HornAxiomVisitorEx testsubject = new org . semanticweb . owlapi . util . HornAxiomVisitorEx ( ) ; java . lang . Boolean result = object . accept ( testsubject ) ; "<AssertPlaceHolder>" ; } accept ( java . util . stream . Stream ) { org . semanticweb . owlapi . model . OWLAxiomVisitor visitor = new org . obolibrary . obo2owl . OWLAPIOwl2Obo . Translator ( ) ; axioms . forEach ( ( ax ) -> ax . accept ( visitor ) ) ; }
|
org . junit . Assert . assertEquals ( b , result )
|
queryProductDocumentsTest ( ) { java . lang . String query = "pids" 4 http : "declare<sp>variable<sp>$rid<sp>external;\n" ) + "<sp>let<sp>$props<sp>:=<sp>map<sp>{'method':<sp>'json'}\n" 6 ) + "let<sp>$pids<sp>:=<sp>(66751,<sp>98514,<sp>31386)\n" ) + "for<sp>$map<sp>in<sp>fn:collection(\"securities\"pids" 6 ) + "for<sp>$pid<sp>in<sp>$pids\n" ) + "<sp>let<sp>$inv<sp>:=<sp>m:get($map,<sp>\'inventory\')\n" ) + "pids" 9 ) + "<sp>where<sp>m:get($prod,<sp>\'product-id\')<sp>=<sp>$pid\n" ) + "<sp>let<sp>$props<sp>:=<sp>map<sp>{'method':<sp>'json'}\n" 3 ) + "<sp>where<sp>(m:get($item,<sp>\'status\')<sp>=<sp>\'active\')\n" ) + "<sp>let<sp>$props<sp>:=<sp>map<sp>{'method':<sp>'json'}\n" 2 ) + "pids" 3 ) + "pids" 0 ) + "<sp>let<sp>$props<sp>:=<sp>map<sp>{'method':<sp>'json'}\n" 1 ) ; java . util . Map < java . lang . String , java . lang . Object > params = new java . util . HashMap ( ) ; java . util . List < java . lang . Integer > pids = new java . util . ArrayList ( ) ; params . put ( "<sp>let<sp>$props<sp>:=<sp>map<sp>{'method':<sp>'json'}\n" 5 , 1161 ) ; java . util . Properties props = new java . util . Properties ( ) ; try ( com . bagri . core . api . ResultCursor < javax . xml . xquery . XQItemAccessor > results = query ( query , params , props ) ) { int cnt = 0 ; for ( javax . xml . xquery . XQItemAccessor item : results ) { cnt ++ ; } "<AssertPlaceHolder>" ; } } query ( java . lang . String , java . util . Map , java . util . Properties ) { if ( props == null ) { props = getDocumentProperties ( ) ; props . setProperty ( pn_document_headers , java . lang . String . valueOf ( DocumentAccessor . HDR_CONTENT ) ) ; } com . bagri . core . api . ResultCursor < javax . xml . xquery . XQItemAccessor > result = getQueryManagement ( ) . executeQuery ( query , params , props ) ; org . junit . Assert . assertNotNull ( result ) ; return result ; }
|
org . junit . Assert . assertEquals ( 0 , cnt )
|
testDefinePermissionToAllowUpdateDataRecordCollection ( ) { com . liferay . portal . kernel . model . Role role1 = com . liferay . portal . kernel . test . util . RoleTestUtil . addRole ( RoleConstants . TYPE_REGULAR ) ; com . liferay . portal . kernel . model . User user1 = com . liferay . portal . kernel . test . util . UserTestUtil . addGroupUser ( _group , role1 . getName ( ) ) ; com . liferay . portal . kernel . security . permission . PermissionThreadLocal . setPermissionChecker ( com . liferay . portal . kernel . security . permission . PermissionCheckerFactoryUtil . create ( _adminUser ) ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group . getGroupId ( ) , _adminUser . getUserId ( ) ) ; com . liferay . portal . kernel . service . ServiceContextThreadLocal . pushServiceContext ( serviceContext ) ; try { com . liferay . data . engine . service . DEDataRecordCollectionSavePermissionsRequest deDataRecordCollectionSavePermissionsRequest = com . liferay . data . engine . service . DEDataRecordCollectionRequestBuilder . savePermissionsBuilder ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , _group . getGroupId ( ) , new java . lang . String [ ] { role1 . getName ( ) } ) . allowDefinePermissions ( ) . build ( ) ; _deDataRecordCollectionService . execute ( deDataRecordCollectionSavePermissionsRequest ) ; } finally { com . liferay . portal . kernel . service . ServiceContextThreadLocal . popServiceContext ( ) ; } com . liferay . data . engine . model . DEDataRecordCollection deDataRecordCollection = com . liferay . data . engine . service . test . DEDataEngineTestUtil . insertDEDataRecordCollection ( _adminUser , _group , _deDataDefinitionService , _deDataRecordCollectionService ) ; com . liferay . portal . kernel . model . User user2 = com . liferay . portal . kernel . test . util . UserTestUtil . addGroupUser ( _group , RoleConstants . ORGANIZATION_USER ) ; com . liferay . portal . kernel . security . permission . PermissionThreadLocal . setPermissionChecker ( com . liferay . portal . kernel . security . permission . PermissionCheckerFactoryUtil . create ( user1 ) ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext2 = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group . getGroupId ( ) , user1 . getUserId ( ) ) ; com . liferay . portal . kernel . service . ServiceContextThreadLocal . pushServiceContext ( serviceContext2 ) ; try { com . liferay . data . engine . service . DEDataRecordCollectionSaveModelPermissionsRequest deDataRecordCollectionSaveModelPermissionsRequest2 = com . liferay . data . engine . service . DEDataRecordCollectionRequestBuilder . saveModelPermissionsBuilder ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , _group . getGroupId ( ) , user1 . getUserId ( ) , _group . getGroupId ( ) , deDataRecordCollection . getDEDataRecordCollectionId ( ) , new java . lang . String [ ] { com . liferay . portal . kernel . model . RoleConstants . ORGANIZATION_USER } ) . allowUpdate ( ) . build ( ) ; _deDataRecordCollectionService . execute ( deDataRecordCollectionSaveModelPermissionsRequest2 ) ; } finally { com . liferay . portal . kernel . service . ServiceContextThreadLocal . popServiceContext ( ) ; } com . liferay . data . engine . model . DEDataRecordCollection deDataRecordCollectionAfterUpdate = com . liferay . data . engine . service . test . DEDataEngineTestUtil . updateDEDataRecordCollection ( user2 , _group , deDataRecordCollection , _deDataRecordCollectionService ) ; "<AssertPlaceHolder>" ; } popServiceContext ( ) { java . util . LinkedList < com . liferay . portal . kernel . service . ServiceContext > serviceContextStack = com . liferay . portal . kernel . service . ServiceContextThreadLocal . _serviceContextThreadLocal . get ( ) ; if ( serviceContextStack . isEmpty ( ) ) { return null ; } return serviceContextStack . pop ( ) ; }
|
org . junit . Assert . assertEquals ( deDataRecordCollection . getDEDataRecordCollectionId ( ) , deDataRecordCollectionAfterUpdate . getDEDataRecordCollectionId ( ) )
|
testNext ( ) { for ( int i = 1 ; i <= 100 ; i ++ ) { "<AssertPlaceHolder>" ; } } toString ( boolean ) { final java . lang . StringBuffer b = new java . lang . StringBuffer ( ) ; b . append ( encoding ) ; if ( org . mobicents . media . FormatUtils . specified ( sampleRate ) ) { b . append ( ( ",<sp>" + ( ( int ) ( sampleRate ) ) ) ) ; if ( ! asInput ) { b . append ( "<sp>Hz" ) ; } } else { if ( ! asInput ) { b . append ( ",<sp>Unknown<sp>Sample<sp>Rate" ) ; } } if ( org . mobicents . media . FormatUtils . specified ( sampleSizeInBits ) ) { b . append ( ",<sp>" ) ; b . append ( ( "Unsigned" 1 + ( sampleSizeInBits ) ) ) ; if ( ! asInput ) { b . append ( "Unsigned" 4 ) ; } } if ( org . mobicents . media . FormatUtils . specified ( channels ) ) { b . append ( ",<sp>" ) ; if ( ! asInput ) { if ( ( channels ) == 1 ) { b . append ( "Mono" ) ; } else if ( ( channels ) == 2 ) { b . append ( "Unsigned" 2 ) ; } else { b . append ( ( ( "Unsigned" 1 + ( channels ) ) + "Unsigned" 3 ) ) ; } } else { b . append ( ( "Unsigned" 1 + ( channels ) ) ) ; } } if ( ( ( org . mobicents . media . FormatUtils . specified ( endian ) ) && ( org . mobicents . media . FormatUtils . specified ( sampleSizeInBits ) ) ) && ( ( sampleSizeInBits ) > 8 ) ) { b . append ( ",<sp>" ) ; if ( ! asInput ) { if ( ( endian ) == ( org . mobicents . media . format . AudioFormat . BIG_ENDIAN ) ) { b . append ( "BigEndian" ) ; } else if ( ( endian ) == ( org . mobicents . media . format . AudioFormat . LITTLE_ENDIAN ) ) { b . append ( "LittleEndian" ) ; } else { } } else { b . append ( ( "Unsigned" 1 + ( endian ) ) ) ; } } if ( org . mobicents . media . FormatUtils . specified ( signed ) ) { b . append ( ",<sp>" ) ; if ( ! asInput ) { if ( ( signed ) != ( org . mobicents . media . format . AudioFormat . SIGNED ) ) { b . append ( "Unsigned" ) ; } else { b . append ( "Signed" ) ; } } else { b . append ( ( "Unsigned" 1 + ( signed ) ) ) ; } } if ( org . mobicents . media . FormatUtils . specified ( frameRate ) ) { b . append ( ",<sp>" ) ; if ( ! asInput ) { b . append ( ( ( "Unsigned" 1 + ( frameRate ) ) + "<sp>frame<sp>rate" ) ) ; } else { b . append ( ( "Unsigned" 1 + ( frameRate ) ) ) ; } } if ( org . mobicents . media . FormatUtils . specified ( frameSizeInBits ) ) { if ( ! asInput ) { b . append ( ( ( ",<sp>FrameSize=" + ( frameSizeInBits ) ) + "Unsigned" 5 ) ) ; } else { b . append ( ( ",<sp>" + ( frameSizeInBits ) ) ) ; } } return b . toString ( ) ; }
|
org . junit . Assert . assertEquals ( java . lang . Integer . toString ( i ) , range . next ( ) )
|
testGetParametersWithEmptyFieldsAndWithoutDefaults ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . person . pension . PersonPension entity = new org . lnu . is . domain . person . pension . PersonPension ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; verify ( personDao , times ( 0 ) ) . getEntityById ( anyLong ( ) ) ; verify ( contactTypeDao , times ( 0 ) ) . getEntityById ( anyLong ( ) ) ; "<AssertPlaceHolder>" ; } getEntityById ( KEY ) { org . lnu . is . dao . dao . DefaultDao . LOG . info ( "Getting<sp>{}.entity<sp>wit<sp>id" , getEntityClass ( ) . getSimpleName ( ) , id ) ; return persistenceManager . findById ( getEntityClass ( ) , id ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
geenDatumIngang ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . Bijhoudingsautorisatie bijhoudingsautorisatie = new nl . bzk . algemeenbrp . dal . domein . brp . entity . Bijhoudingsautorisatie ( false ) ; "<AssertPlaceHolder>" ; } errorCount ( nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangLeveringsAutorisatie ) { final java . util . Map < ? , ? > result = new java . util . HashMap ( ) ; final org . springframework . validation . Errors errors = new org . springframework . validation . MapBindingResult ( result , "toegang" ) ; subject . validate ( toegang , errors ) ; return errors . getErrorCount ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , errorCount ( bijhoudingsautorisatie ) )
|
testBuild ( ) { org . lnu . is . domain . married . type . MarriedType context = new org . lnu . is . domain . married . type . MarriedType ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>MarriedType<sp>e<sp>WHERE<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . married . type . MarriedType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testXCSWithoutKey2 ( ) { org . apache . pig . data . Tuple input = tupleFactory . newTuple ( 2 ) ; input . set ( 0 , "http://en.m.wikipedia.org/wiki/James_Ingram" ) ; input . set ( 1 , "250-99" ) ; org . wikimedia . analytics . kraken . pig . ZeroFilterFunc zero = new org . wikimedia . analytics . kraken . pig . ZeroFilterFunc ( "default" ) ; "<AssertPlaceHolder>" ; } exec ( org . apache . pig . data . Tuple ) { if ( ( input == null ) || ( ( input . get ( 0 ) ) == null ) ) { return null ; } java . lang . String url = ( ( java . lang . String ) ( input . get ( 0 ) ) ) ; java . lang . String referer = ( ( java . lang . String ) ( input . get ( 1 ) ) ) ; java . lang . String userAgent = ( ( input . get ( 2 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 2 ) ) ) : "-" ; java . lang . String statusCode = ( ( input . get ( 3 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 3 ) ) ) : "-" ; java . lang . String ip = ( ( input . get ( 4 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 4 ) ) ) : "-" ; java . lang . String mimeType = ( ( input . get ( 5 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 5 ) ) ) : "-" ; java . lang . String requestMethod = ( ( input . get ( 6 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 6 ) ) ) : "-" ; org . wikimedia . analytics . kraken . pageview . Pageview pageview = new org . wikimedia . analytics . kraken . pageview . Pageview ( url , referer , userAgent , statusCode , ip , mimeType , requestMethod ) ; output = tupleFactory . newTuple ( 3 ) ; output . set ( 0 , ( pageview . isPageview ( ) ? 1 : 0 ) ) ; output . set ( 1 , ( pageview . isWebstatscollectorPageview ( ) ? 1 : 0 ) ) ; output . set ( 2 , ( pageview . isWikistatsMobileReportPageview ( ) ? 1 : 0 ) ) ; return output ; }
|
org . junit . Assert . assertTrue ( zero . exec ( input ) )
|
testGetContentInfo ( ) { final org . apache . commons . vfs2 . FileSystemManager fsManager = org . apache . commons . vfs2 . VFS . getManager ( ) ; final org . apache . commons . vfs2 . FileObject fo = fsManager . resolveFile ( "http4://www.apache.org/licenses/LICENSE-2.0.txt" ) ; final org . apache . commons . vfs2 . FileContent content = fo . getContent ( ) ; "<AssertPlaceHolder>" ; content . getContentInfo ( ) ; } getContent ( ) { return content ; }
|
org . junit . Assert . assertNotNull ( content )
|
testConvertISOTZNoMillisecond ( ) { java . lang . String source = "2018-05-09T17:34:55-07:00" ; com . box . l10n . mojito . rest . textunit . StringToDateTimeConverter instance = new com . box . l10n . mojito . rest . textunit . StringToDateTimeConverter ( ) ; org . joda . time . DateTime expResult = new org . joda . time . DateTime ( "2018-05-10T00:34:55.000Z" ) ; org . joda . time . DateTime result = instance . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { com . box . l10n . mojito . rest . entity . ExportDropConfig . Type type = null ; if ( string != null ) { try { type = ExportDropConfig . Type . valueOf ( string . toUpperCase ( ) ) ; } catch ( java . lang . IllegalArgumentException iae ) { throw new com . beust . jcommander . ParameterException ( ( ( "Invalid<sp>type<sp>[" + string ) + "]" ) ) ; } } return type ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
shouldLoadAllVisibilityPropertiesWhenGetVisProperty ( ) { final java . lang . String group = uk . gov . gchq . gaffer . commonutil . TestGroups . ENTITY ; final org . apache . accumulo . core . data . Key key = mock ( org . apache . accumulo . core . data . Key . class ) ; final org . apache . accumulo . core . data . Value value = mock ( org . apache . accumulo . core . data . Value . class ) ; final uk . gov . gchq . gaffer . accumulostore . key . AccumuloElementConverter converter = mock ( uk . gov . gchq . gaffer . accumulostore . key . AccumuloElementConverter . class ) ; final uk . gov . gchq . gaffer . store . schema . Schema schema = createSchema ( ) ; final uk . gov . gchq . gaffer . accumulostore . data . element . AccumuloEntityValueLoader loader = new uk . gov . gchq . gaffer . accumulostore . data . element . AccumuloEntityValueLoader ( group , key , value , converter , schema ) ; final uk . gov . gchq . gaffer . data . element . LazyProperties lazyProperties = mock ( uk . gov . gchq . gaffer . data . element . LazyProperties . class ) ; final uk . gov . gchq . gaffer . data . element . Properties properties = mock ( uk . gov . gchq . gaffer . data . element . Properties . class ) ; final org . apache . accumulo . core . data . ByteSequence cvData = mock ( org . apache . accumulo . core . data . ByteSequence . class ) ; given ( key . getColumnVisibilityData ( ) ) . willReturn ( cvData ) ; final byte [ ] cvBytes = new byte [ ] { 0 , 1 , 2 , 3 , 4 } ; given ( cvData . getBackingArray ( ) ) . willReturn ( cvBytes ) ; given ( converter . getPropertiesFromColumnVisibility ( group , cvBytes ) ) . willReturn ( properties ) ; given ( properties . get ( TestPropertyNames . VISIBILITY ) ) . willReturn ( "vis1" ) ; final java . lang . Object property = loader . getProperty ( TestPropertyNames . VISIBILITY , lazyProperties ) ; "<AssertPlaceHolder>" ; verify ( lazyProperties ) . putAll ( properties ) ; verify ( converter , never ( ) ) . getElementId ( key , false ) ; verify ( converter , never ( ) ) . getPropertiesFromColumnQualifier ( org . mockito . Mockito . eq ( group ) , org . mockito . Mockito . any ( byte [ ] . class ) ) ; verify ( converter , never ( ) ) . getPropertiesFromTimestamp ( org . mockito . Mockito . eq ( group ) , org . mockito . Mockito . anyLong ( ) ) ; verify ( converter , never ( ) ) . getPropertiesFromValue ( org . mockito . Mockito . eq ( group ) , org . mockito . Mockito . any ( org . apache . accumulo . core . data . Value . class ) ) ; } getProperty ( java . lang . String , uk . gov . gchq . gaffer . data . element . Properties ) { if ( null == ( eDef ) ) { eDef = schema . getElement ( group ) ; if ( null == ( eDef ) ) { throw new java . lang . IllegalArgumentException ( ( ( "Element<sp>definition<sp>for<sp>" + ( group ) ) + "<sp>could<sp>not<sp>be<sp>found<sp>in<sp>the<sp>schema" ) ) ; } } final uk . gov . gchq . gaffer . data . element . Properties props ; if ( eDef . getGroupBy ( ) . contains ( name ) ) { props = elementConverter . getPropertiesFromColumnQualifier ( group , key . getColumnQualifierData ( ) . getBackingArray ( ) ) ; } else if ( name . equals ( schema . getVisibilityProperty ( ) ) ) { props = elementConverter . getPropertiesFromColumnVisibility ( group , key . getColumnVisibilityData ( ) . getBackingArray ( ) ) ; } else if ( name . equals ( timestampProperty ) ) { props = elementConverter . getPropertiesFromTimestamp ( group , key . getTimestamp ( ) ) ; } else { props = elementConverter . getPropertiesFromValue ( group , value ) ; } lazyProperties . putAll ( props ) ; return props . get ( name ) ; }
|
org . junit . Assert . assertEquals ( "vis1" , property )
|
getVersion ( ) { "<AssertPlaceHolder>" ; } getVersion ( ) { org . junit . Assert . assertNotNull ( org . eol . globi . Version . getVersion ( ) ) ; }
|
org . junit . Assert . assertNotNull ( org . eol . globi . Version . getVersion ( ) )
|
testOrElseThrowWithPresentValue ( ) { long value = com . annimon . stream . OptionalLong . of ( 10 ) . orElseThrow ( ) ; "<AssertPlaceHolder>" ; } orElseThrow ( ) { if ( ( value ) == null ) { throw new java . util . NoSuchElementException ( "No<sp>value<sp>present" ) ; } return value ; }
|
org . junit . Assert . assertEquals ( 10 , value )
|
testToEightBitBinary ( ) { result1 = org . onosproject . isis . io . util . IsisUtil . toEightBitBinary ( "01" ) ; "<AssertPlaceHolder>" ; } length ( ) { return length ; }
|
org . junit . Assert . assertThat ( result1 . length ( ) , org . hamcrest . CoreMatchers . is ( 8 ) )
|
activeAfterEnter ( ) { statemachine . enter ( ) ; "<AssertPlaceHolder>" ; } isActive ( ) { return ( stateVector [ 0 ] ) != ( org . yakindu . src . operationcallbackimpl . OperationCallbackImplStatemachine . State . $NullState$ ) ; }
|
org . junit . Assert . assertTrue ( statemachine . isActive ( ) )
|
anySatisfy_executionException ( ) { try { this . classUnderTest ( ) . anySatisfy ( ( each ) -> { throw new java . lang . RuntimeException ( "Execution<sp>exception" ) ; } ) ; } catch ( java . lang . RuntimeException e ) { "<AssertPlaceHolder>" ; } } anySatisfy ( org . eclipse . collections . api . block . predicate . Predicate ) { return this . getMutableCollection ( ) . anySatisfy ( predicate ) ; }
|
org . junit . Assert . assertEquals ( "Execution<sp>exception" , e . getMessage ( ) )
|
testIpAddress ( ) { org . springframework . mock . web . MockHttpServletRequest request = new org . springframework . mock . web . MockHttpServletRequest ( ) ; request . setServerName ( "127.0.0.1" ) ; java . lang . String name = org . springframework . test . util . ReflectionTestUtils . invokeMethod ( cookieHelper , com . baeldung . jhipster . gateway . security . oauth2 . OAuth2CookieHelperTest . GET_COOKIE_DOMAIN_METHOD , request ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNull ( name )
|
factsFirstMissing ( ) { org . candlepin . model . Consumer first = new org . candlepin . model . Consumer ( ) ; first . setFact ( "key1" , "1" ) ; first . setFact ( "key3" , "3" ) ; org . candlepin . model . Consumer second = new org . candlepin . model . Consumer ( ) ; second . setFact ( "key1" , "1" ) ; second . setFact ( "key2" , "2" ) ; second . setFact ( "key3" , "3" ) ; "<AssertPlaceHolder>" ; } factsAreEqual ( java . util . Map ) { if ( ( ( this . getFacts ( ) ) == null ) && ( otherFacts == null ) ) { return true ; } if ( ( ( this . getFacts ( ) ) == null ) || ( otherFacts == null ) ) { return false ; } if ( ( this . getFacts ( ) . size ( ) ) != ( otherFacts . size ( ) ) ) { return false ; } for ( java . util . Map . Entry < java . lang . String , java . lang . String > entry : this . getFacts ( ) . entrySet ( ) ) { java . lang . String myVal = entry . getValue ( ) ; java . lang . String otherVal = otherFacts . get ( entry . getKey ( ) ) ; if ( myVal == null ) { if ( otherVal != null ) { return false ; } } else if ( ! ( myVal . equals ( otherVal ) ) ) { return false ; } } return true ; }
|
org . junit . Assert . assertFalse ( first . factsAreEqual ( second . getFacts ( ) ) )
|
shouldCoerceMultipleFlavors ( ) { com . facebook . buck . core . model . BuildTarget seen = new com . facebook . buck . rules . coercer . BuildTargetTypeCoercer ( unconfiguredBuildTargetTypeCoercer ) . coerce ( createCellRoots ( filesystem ) , filesystem , basePath , EmptyTargetConfiguration . INSTANCE , "//foo:bar#baz,qux" ) ; "<AssertPlaceHolder>" ; } newInstance ( java . lang . String ) { return com . facebook . buck . core . model . BuildTargetFactory . newInstance ( ( ( java . nio . file . Path ) ( null ) ) , fullyQualifiedName ) ; }
|
org . junit . Assert . assertEquals ( com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//foo:bar#baz,qux" ) , seen )
|
testInsertBeforeIndex0 ( ) { org . antlr . tool . Grammar g = new org . antlr . tool . Grammar ( ( "lexer<sp>grammar<sp>t;\n" + ( ( "A<sp>:<sp>\'a\';\n" + "B<sp>:<sp>\'b\';\n" ) + "C<sp>:<sp>\'c\';\n" ) ) ) ; org . antlr . runtime . CharStream input = new org . antlr . runtime . ANTLRStringStream ( "abc" ) ; org . antlr . tool . Interpreter lexEngine = new org . antlr . tool . Interpreter ( g , input ) ; org . antlr . runtime . TokenRewriteStream tokens = new org . antlr . runtime . TokenRewriteStream ( lexEngine ) ; tokens . insertBefore ( 0 , "0" ) ; java . lang . String result = tokens . toString ( ) ; java . lang . String expecting = "0abc" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( "[" + ( grammar . name ) ) + "." ) + ( name ) ) + ",index=" ) + ( index ) ) + ",line=" ) + ( tree . getToken ( ) . getLine ( ) ) ) + "]" ; }
|
org . junit . Assert . assertEquals ( expecting , result )
|
testCodeOKInSwitch ( ) { org . apache . zookeeper . KeeperException . Code test = org . apache . zookeeper . KeeperException . Code . OK ; switch ( test ) { case OK : "<AssertPlaceHolder>" ; break ; } }
|
org . junit . Assert . assertTrue ( true )
|
setTslLocation ( ) { this . configuration . setTslLocation ( "tslLocation" ) ; "<AssertPlaceHolder>" ; } getTslLocation ( ) { java . lang . String urlString = getConfigurationParameter ( ConfigurationParameter . TslLocation ) ; if ( ! ( eu . europa . esig . dss . client . http . Protocol . isFileUrl ( urlString ) ) ) return urlString ; try { java . lang . String filePath = new java . net . URL ( urlString ) . getPath ( ) ; if ( ! ( new org . digidoc4j . File ( filePath ) . exists ( ) ) ) { java . net . URL resource = getClass ( ) . getClassLoader ( ) . getResource ( filePath ) ; if ( resource != null ) urlString = resource . toString ( ) ; } } catch ( java . net . MalformedURLException e ) { org . digidoc4j . Configuration . LOGGER . warn ( e . getMessage ( ) ) ; } return urlString == null ? "" : urlString ; }
|
org . junit . Assert . assertEquals ( "tslLocation" , this . configuration . getTslLocation ( ) )
|
testSelectStatementForSpecificColumns ( ) { java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) , org . apache . phoenix . util . PropertiesUtil . deepCopy ( TestUtil . TEST_PROPERTIES ) ) ; final java . lang . String tableName = "TEST_TABLE" ; try { java . lang . String ddl = ( ( "CREATE<sp>TABLE<sp>" + tableName ) + "<sp>(a_string<sp>varchar<sp>not<sp>null,<sp>a_binary<sp>varbinary<sp>not<sp>null,<sp>col1<sp>integer" ) + "<sp>CONSTRAINT<sp>pk<sp>PRIMARY<sp>KEY<sp>(a_string,<sp>a_binary))\n" ; conn . createStatement ( ) . execute ( ddl ) ; final org . apache . hadoop . conf . Configuration configuration = new org . apache . hadoop . conf . Configuration ( ) ; configuration . set ( HConstants . ZOOKEEPER_QUORUM , getUrl ( ) ) ; org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . setInputTableName ( configuration , tableName ) ; org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . setSelectColumnNames ( configuration , new java . lang . String [ ] { "A_BINARY" } ) ; final java . lang . String selectStatement = org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . getSelectStatement ( configuration ) ; final java . lang . String expectedSelectStatement = "SELECT<sp>\"A_BINARY\"<sp>FROM<sp>" + tableName ; "<AssertPlaceHolder>" ; } finally { conn . close ( ) ; } } getSelectStatement ( org . apache . hadoop . conf . Configuration ) { com . google . common . base . Preconditions . checkNotNull ( configuration ) ; java . lang . String selectStmt = configuration . get ( org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . SELECT_STATEMENT ) ; if ( org . apache . commons . lang3 . StringUtils . isNotEmpty ( selectStmt ) ) { return selectStmt ; } final java . lang . String tableName = org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . getInputTableName ( configuration ) ; com . google . common . base . Preconditions . checkNotNull ( tableName ) ; final java . util . List < org . apache . phoenix . util . ColumnInfo > columnMetadataList = org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . getSelectColumnMetadataList ( configuration ) ; final java . lang . String conditions = configuration . get ( org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . INPUT_TABLE_CONDITIONS ) ; selectStmt = org . apache . phoenix . util . QueryUtil . constructSelectStatement ( tableName , columnMetadataList , conditions ) ; org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . LOG . info ( ( "Select<sp>Statement:<sp>" + selectStmt ) ) ; configuration . set ( org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . SELECT_STATEMENT , selectStmt ) ; return selectStmt ; }
|
org . junit . Assert . assertEquals ( expectedSelectStatement , selectStatement )
|
testExpression29 ( ) { java . lang . String expr = "24.3343<sp>%<sp>3" ; double expected = 24.3343 % 3 ; net . objecthunter . exp4j . Expression e = new net . objecthunter . exp4j . ExpressionBuilder ( expr ) . build ( ) ; "<AssertPlaceHolder>" ; } evaluate ( ) { final net . objecthunter . exp4j . ArrayStack output = new net . objecthunter . exp4j . ArrayStack ( ) ; for ( int i = 0 ; i < ( tokens . length ) ; i ++ ) { net . objecthunter . exp4j . tokenizer . Token t = tokens [ i ] ; else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_VARIABLE ) ) { final java . lang . String name = ( ( net . objecthunter . exp4j . tokenizer . VariableToken ) ( t ) ) . getName ( ) ; final java . lang . Double value = this . variables . get ( name ) ; if ( value == null ) { throw new java . lang . IllegalArgumentException ( ( ( "No<sp>value<sp>has<sp>been<sp>set<sp>for<sp>the<sp>setVariable<sp>'" + name ) + "'." ) ) ; } output . push ( value ) ; } else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_OPERATOR ) ) { net . objecthunter . exp4j . tokenizer . OperatorToken op = ( ( net . objecthunter . exp4j . tokenizer . OperatorToken ) ( t ) ) ; if ( ( output . size ( ) ) < ( op . getOperator ( ) . getNumOperands ( ) ) ) { throw new java . lang . IllegalArgumentException ( ( ( "Invalid<sp>number<sp>of<sp>operands<sp>available<sp>for<sp>'" + ( op . getOperator ( ) . getSymbol ( ) ) ) + "'<sp>operator" ) ) ; } if ( ( op . getOperator ( ) . getNumOperands ( ) ) == 2 ) { double rightArg = output . pop ( ) ; double leftArg = output . pop ( ) ; output . push ( op . getOperator ( ) . apply ( leftArg , rightArg ) ) ; } else if ( ( op . getOperator ( ) . getNumOperands ( ) ) == 1 ) { double arg = output . pop ( ) ; output . push ( op . getOperator ( ) . apply ( arg ) ) ; } } else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_FUNCTION ) ) { net . objecthunter . exp4j . tokenizer . FunctionToken func = ( ( net . objecthunter . exp4j . tokenizer . FunctionToken ) ( t ) ) ; final int numArguments = func . getFunction ( ) . getNumArguments ( ) ; if ( ( output . size ( ) ) < numArguments ) { throw new java . lang . IllegalArgumentException ( ( ( "Invalid<sp>number<sp>of<sp>arguments<sp>available<sp>for<sp>'" + ( func . getFunction ( ) . getName ( ) ) ) + "'<sp>function" ) ) ; } double [ ] args = new double [ numArguments ] ; for ( int j = numArguments - 1 ; j >= 0 ; j -- ) { args [ j ] = output . pop ( ) ; } output . push ( func . getFunction ( ) . apply ( args ) ) ; } } if ( ( output . size ( ) ) > 1 ) { throw new java . lang . IllegalArgumentException ( "Invalid<sp>number<sp>of<sp>items<sp>on<sp>the<sp>output<sp>queue.<sp>Might<sp>be<sp>caused<sp>by<sp>an<sp>invalid<sp>number<sp>of<sp>arguments<sp>for<sp>a<sp>function." ) ; } return output . pop ( ) ; }
|
org . junit . Assert . assertTrue ( ( expected == ( e . evaluate ( ) ) ) )
|
verifyCallbackFailure ( ) { final java . lang . String signature = "6yQRl17CNj5YSHSpF+tLjb0vVsNVEv021Tyy1bTVEQ69SWlmhwmJYuMc7jiDyeW9TLy4vRqSh4g4YEyN8eoQIM57pMoNw6Lw6Oudubqwp+E3cKtLFxW0l18db3Z/vhxn5BScAutHWwT/XrmkCNaHyCsvOOGMekwrNO7mxX9QIx21FBaEejJeviSYrF8bG6MbmFEs2VGKSybf9YrElR8BxxNe/uNfCXN3P5tO8MgR5wlL3Kr4yq8e6i4WWJgD08IVTnrSnoZR6v8JkPA+fn7I0M6cy0Xzw3BRMJAvdQB97wkobu97gFqJFKsOH2u/JR1S/UNP26vL0mzuAVuKAUwlRn0SUhWEAgcM3X0UCtWLYfCIb5QqrSHwlp7lwOkVnFt329Mrpjy+jAfYYSRqzIsw4ZsRRVauy/v3CvmjPI9sUKiJ5l1FSgkpK2lkjhFgKB3WaYZWy9ZfIAI9bDyG8vSTT7IDurlUhyTweDqVNlYUsO6jaUa4KmSpg1o9eIeHxm0XBQ2c0Lv/T39KNc/VOAi1LBfPiQYMXD1e/8VuPPBTDGgzOMD3i334ppSr36+8YtApAn3D36Hr9jqAfFrugM7uPecjCGuleWsHFyNnJErT0/amIt24Nh1GoiESEq42o7Co4wZieKZ+/yeAlIUErJzK41ACVGmTnGoDUwEBXxADOdA=" ; final java . lang . String body = "{\"order\":{\"id\":null,\"created_at\":null,\"status\":\"completed\",\"event\":null,\"total_btc\":{\"cents\":1000000000,\"currency_iso\":\"BTC\"},\"total_native\":{\"cents\":1000,\"currency_iso\":\"USD\"},\"total_payout\":{\"cents\":1000,\"currency_iso\":\"USD\"},\"custom\":\"123456789\",\"receive_address\":\"mzVoQenSY6RTBgBUcpSBTBAvUMNgGWxgJn\",\"button\":{\"type\":\"buy_now\",\"name\":\"Test<sp>Item\",\"description\":null,\"id\":null},\"transaction\":{\"id\":\"53bdfe4d091c0d74a7000003\",\"hash\":\"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\",\"confirmations\"6yQRl17CNj5YSHSpF+tLjb0vVsNVEv021Tyy1bTVEQ69SWlmhwmJYuMc7jiDyeW9TLy4vRqSh4g4YEyN8eoQIM57pMoNw6Lw6Oudubqwp+E3cKtLFxW0l18db3Z/vhxn5BScAutHWwT/XrmkCNaHyCsvOOGMekwrNO7mxX9QIx21FBaEejJeviSYrF8bG6MbmFEs2VGKSybf9YrElR8BxxNe/uNfCXN3P5tO8MgR5wlL3Kr4yq8e6i4WWJgD08IVTnrSnoZR6v8JkPA+fn7I0M6cy0Xzw3BRMJAvdQB97wkobu97gFqJFKsOH2u/JR1S/UNP26vL0mzuAVuKAUwlRn0SUhWEAgcM3X0UCtWLYfCIb5QqrSHwlp7lwOkVnFt329Mrpjy+jAfYYSRqzIsw4ZsRRVauy/v3CvmjPI9sUKiJ5l1FSgkpK2lkjhFgKB3WaYZWy9ZfIAI9bDyG8vSTT7IDurlUhyTweDqVNlYUsO6jaUa4KmSpg1o9eIeHxm0XBQ2c0Lv/T39KNc/VOAi1LBfPiQYMXD1e/8VuPPBTDGgzOMD3i334ppSr36+8YtApAn3D36Hr9jqAfFrugM7uPecjCGuleWsHFyNnJErT0/amIt24Nh1GoiESEq42o7Co4wZieKZ+/yeAlIUErJzK41ACVGmTnGoDUwEBXxADOdA=" 0 ; "<AssertPlaceHolder>" ; } verifyCallback ( java . lang . String , java . lang . String ) { try { java . security . Signature sig = java . security . Signature . getInstance ( "SHA256withRSA" ) ; sig . initVerify ( com . coinbase . api . CallbackVerifierImpl . getPublicKey ( ) ) ; sig . update ( body . getBytes ( ) ) ; return sig . verify ( org . apache . commons . codec . binary . Base64 . decodeBase64 ( signature ) ) ; } catch ( java . security . NoSuchAlgorithmException ex ) { throw new java . lang . RuntimeException ( ex ) ; } catch ( java . security . InvalidKeyException ex ) { throw new java . lang . RuntimeException ( ex ) ; } catch ( java . security . SignatureException e ) { return false ; } }
|
org . junit . Assert . assertFalse ( cb . verifyCallback ( body , signature ) )
|
shouldStoreAndGetBackfill ( ) { com . spotify . styx . storage . DatastoreStorageTransaction tx = new com . spotify . styx . storage . DatastoreStorageTransaction ( com . spotify . styx . storage . DatastoreStorageTransactionTest . datastore . newTransaction ( ) ) ; final com . spotify . styx . model . Backfill backfill = com . spotify . styx . model . Backfill . newBuilder ( ) . id ( "backfill-1" ) . start ( java . time . Instant . parse ( "2017-01-01T00:00:00Z" ) ) . end ( java . time . Instant . parse ( "2017-01-02T00:00:00Z" ) ) . workflowId ( com . spotify . styx . model . WorkflowId . create ( "component" , "workflow1" ) ) . concurrency ( 2 ) . description ( "Description" ) . nextTrigger ( java . time . Instant . parse ( "2017-01-01T00:00:00Z" ) ) . schedule ( com . spotify . styx . storage . DAYS ) . build ( ) ; tx . store ( backfill ) ; tx . commit ( ) ; com . spotify . styx . storage . DatastoreStorageTransaction newTx = new com . spotify . styx . storage . DatastoreStorageTransaction ( com . spotify . styx . storage . DatastoreStorageTransactionTest . datastore . newTransaction ( ) ) ; "<AssertPlaceHolder>" ; newTx . commit ( ) ; } backfill ( java . lang . String ) { return java . util . Optional . ofNullable ( backfillStore . get ( id ) ) ; }
|
org . junit . Assert . assertThat ( newTx . backfill ( backfill . id ( ) ) , org . hamcrest . Matchers . is ( java . util . Optional . of ( backfill ) ) )
|
authorizeInteractionGivenGrantedConsentsSystemConsentsAreNotSpecified ( ) { when ( this . consentManager . getSystemConsents ( ) ) . thenReturn ( java . util . Collections . < org . phenotips . consents . Consent > emptySet ( ) ) ; final java . util . Set < java . lang . String > grantedConsents = new java . util . HashSet ( ) ; grantedConsents . add ( org . phenotips . consents . internal . DefaultConsentAuthorizerTest . FIELD_A_LABEL ) ; final boolean authorizeInteraction = this . component . authorizeInteraction ( grantedConsents ) ; "<AssertPlaceHolder>" ; } authorizeInteraction ( java . util . Set ) { java . util . Set < org . phenotips . consents . Consent > systemConsents = this . consentManager . getSystemConsents ( ) ; if ( org . apache . commons . collections4 . CollectionUtils . isEmpty ( systemConsents ) ) { return true ; } if ( org . apache . commons . collections4 . CollectionUtils . isEmpty ( grantedConsents ) ) { return containsRequiredConsents ( systemConsents ) ; } java . util . Set < org . phenotips . consents . Consent > missingConsents = new java . util . HashSet ( ) ; for ( org . phenotips . consents . Consent consent : systemConsents ) { if ( ! ( grantedConsents . contains ( consent . getId ( ) ) ) ) { missingConsents . add ( consent ) ; } } return containsRequiredConsents ( missingConsents ) ; }
|
org . junit . Assert . assertTrue ( authorizeInteraction )
|
testHandle ( ) { java . lang . String msg = "No<sp>entity<sp>found" ; java . lang . IllegalArgumentException e = new java . lang . IllegalArgumentException ( msg ) ; org . lnu . is . resource . message . MessageResource expected = new org . lnu . is . resource . message . MessageResource ( ) ; expected . setMessageType ( MessageType . ERROR ) ; expected . setMessage ( e . getMessage ( ) ) ; org . lnu . is . resource . message . MessageResource actual = unit . handle ( e ) ; "<AssertPlaceHolder>" ; } handle ( java . lang . Exception ) { org . lnu . is . web . rest . handler . DefaultExceptionHandler . LOGGER . error ( "Handling<sp>general<sp>exception<sp>exception" , e ) ; org . lnu . is . resource . message . MessageResource message = new org . lnu . is . resource . message . MessageResource ( ) ; message . setMessageType ( MessageType . ERROR ) ; message . setMessage ( e . getMessage ( ) ) ; return message ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
toString_PaneListWithTwoItems_SerializedAsPaneArray ( ) { com . vaadin . addon . charts . model . PaneList paneList = new com . vaadin . addon . charts . model . PaneList ( ) ; paneList . addPane ( new com . vaadin . addon . charts . model . Pane ( ) ) ; paneList . addPane ( new com . vaadin . addon . charts . model . Pane ( ) ) ; com . vaadin . addon . charts . model . junittests . ConfigurationObjectJSONSerializationTest . ObjectContainer object = new com . vaadin . addon . charts . model . junittests . ConfigurationObjectJSONSerializationTest . ObjectContainer ( paneList ) ; java . lang . String paneJson1 = "{\"paneIndex\":0}" ; java . lang . String paneJson2 = "{\"paneIndex\":1}" ; java . lang . String expected = java . lang . String . format ( "{\"object\":[%s,%s]}" , paneJson1 , paneJson2 ) ; "<AssertPlaceHolder>" ; } toJSON ( com . vaadin . addon . charts . model . AbstractConfigurationObject ) { try { return com . vaadin . addon . charts . util . ChartSerialization . jsonWriter . writeValueAsString ( object ) ; } catch ( com . fasterxml . jackson . core . JsonProcessingException e ) { e . printStackTrace ( ) ; throw new java . lang . RuntimeException ( ( "Error<sp>while<sp>serializing<sp>" + ( object . getClass ( ) . getSimpleName ( ) ) ) , e ) ; } }
|
org . junit . Assert . assertEquals ( expected , toJSON ( object ) )
|
testChoiceIterator ( ) { net . sourceforge . tess4j . TessAPITest . logger . info ( "\t-<sp>" 0 ) ; java . lang . String filename = java . lang . String . format ( "%s/%s" , this . testResourcesDataPath , "eurotext.tif" ) ; java . io . File tiff = new java . io . File ( filename ) ; java . awt . image . BufferedImage image = javax . imageio . ImageIO . read ( new java . io . FileInputStream ( tiff ) ) ; java . nio . ByteBuffer buf = net . sourceforge . tess4j . util . ImageIOHelper . convertImageData ( image ) ; int bpp = image . getColorModel ( ) . getPixelSize ( ) ; int bytespp = bpp / 8 ; int bytespl = ( ( int ) ( java . lang . Math . ceil ( ( ( ( image . getWidth ( ) ) * bpp ) / 8.0 ) ) ) ) ; api . TessBaseAPIInit3 ( handle , datapath , language ) ; api . TessBaseAPISetImage ( handle , buf , image . getWidth ( ) , image . getHeight ( ) , bytespp , bytespl ) ; api . TessBaseAPISetVariable ( handle , "save_blob_choices" , "T" ) ; api . TessBaseAPISetRectangle ( handle , 37 , 228 , 548 , 31 ) ; net . sourceforge . tess4j . ETEXT_DESC monitor = new net . sourceforge . tess4j . ETEXT_DESC ( ) ; net . sourceforge . tess4j . ProgressMonitor pmo = new net . sourceforge . tess4j . ProgressMonitor ( monitor ) ; pmo . start ( ) ; api . TessBaseAPIRecognize ( handle , monitor ) ; net . sourceforge . tess4j . TessAPITest . logger . info ( ( "Message:<sp>" + ( pmo . getMessage ( ) ) ) ) ; net . sourceforge . tess4j . TessResultIterator ri = api . TessBaseAPIGetIterator ( handle ) ; int level = TessPageIteratorLevel . RIL_SYMBOL ; if ( ri != null ) { do { com . sun . jna . Pointer symbol = api . TessResultIteratorGetUTF8Text ( ri , level ) ; float conf = api . TessResultIteratorConfidence ( ri , level ) ; if ( symbol != null ) { net . sourceforge . tess4j . TessAPITest . logger . info ( java . lang . String . format ( "symbol<sp>%s,<sp>conf:<sp>%f" , symbol . getString ( 0 ) , conf ) ) ; boolean indent = false ; net . sourceforge . tess4j . TessChoiceIterator ci = api . TessResultIteratorGetChoiceIterator ( ri ) ; do { if ( indent ) { System . out . print ( "\t" ) ; } System . out . print ( "\t-<sp>" ) ; java . lang . String choice = api . TessChoiceIteratorGetUTF8Text ( ci ) ; net . sourceforge . tess4j . TessAPITest . logger . info ( java . lang . String . format ( "%s<sp>conf:<sp>%f" , choice , api . TessChoiceIteratorConfidence ( ci ) ) ) ; indent = true ; } while ( ( api . TessChoiceIteratorNext ( ci ) ) == ( net . sourceforge . tess4j . ITessAPI . TRUE ) ) ; api . TessChoiceIteratorDelete ( ci ) ; } net . sourceforge . tess4j . TessAPITest . logger . info ( "---------------------------------------------" ) ; api . TessDeleteText ( symbol ) ; } while ( ( api . TessResultIteratorNext ( ri , level ) ) == ( net . sourceforge . tess4j . ITessAPI . TRUE ) ) ; } "<AssertPlaceHolder>" ; } TessResultIteratorNext ( net . sourceforge . tess4j . ITessAPI$TessResultIterator , int ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>supported<sp>yet." ) ; }
|
org . junit . Assert . assertTrue ( true )
|
testIntersection ( ) { org . locationtech . jts . geom . GeometryFactory fact = new org . locationtech . jts . geom . GeometryFactory ( ) ; final org . locationtech . jts . geom . LinearRing ring = fact . createLinearRing ( new org . locationtech . jts . geom . Coordinate [ ] { new org . locationtech . jts . geom . Coordinate ( 0.0 , 0.0 ) , new org . locationtech . jts . geom . Coordinate ( 0.0 , 10.0 ) , new org . locationtech . jts . geom . Coordinate ( 5.0 , 10.0 ) , new org . locationtech . jts . geom . Coordinate ( 5.0 , 0.0 ) , new org . locationtech . jts . geom . Coordinate ( 0.0 , 0.0 ) } ) ; final org . locationtech . jts . geom . Geometry geom1 = fact . createPolygon ( ring , null ) ; final org . locationtech . jts . geom . LinearRing ring2 = fact . createLinearRing ( new org . locationtech . jts . geom . Coordinate [ ] { new org . locationtech . jts . geom . Coordinate ( ( - 5.0 ) , 0.0 ) , new org . locationtech . jts . geom . Coordinate ( ( - 5.0 ) , 10.0 ) , new org . locationtech . jts . geom . Coordinate ( 2.0 , 10.0 ) , new org . locationtech . jts . geom . Coordinate ( 2.0 , 0.0 ) , new org . locationtech . jts . geom . Coordinate ( ( - 5.0 ) , 0.0 ) } ) ; final org . locationtech . jts . geom . Geometry geom2 = fact . createPolygon ( ring2 , null ) ; final org . geotoolkit . process . ProcessDescriptor desc = org . geotoolkit . process . ProcessFinder . getProcessDescriptor ( GeotkProcessingRegistry . NAME , "jts:intersectionSurface" ) ; final org . opengis . parameter . ParameterValueGroup in = desc . getInputDescriptor ( ) . createValue ( ) ; in . parameter ( "geom1" ) . setValue ( geom1 ) ; in . parameter ( "geom2" ) . setValue ( geom2 ) ; final org . geotoolkit . process . Process proc = desc . createProcess ( in ) ; final java . lang . Double result = ( ( java . lang . Double ) ( proc . call ( ) . parameter ( "result_surface" ) . getValue ( ) ) ) ; final org . locationtech . jts . geom . Geometry expectedGeom = geom1 . intersection ( geom2 ) ; final double expected = expectedGeom . getArea ( ) ; "<AssertPlaceHolder>" ; } getArea ( ) { return area ; }
|
org . junit . Assert . assertTrue ( ( expected == result ) )
|
testToString ( ) { org . locationtech . geogig . repository . Hints hints = new org . locationtech . geogig . repository . Hints ( ) ; hints . set ( "key1" , "value1" ) ; hints . set ( "key2" , "value2" ) ; "<AssertPlaceHolder>" ; } getAll ( ) { return new java . util . HashMap ( this . hintsMap ) ; }
|
org . junit . Assert . assertEquals ( hints . getAll ( ) . toString ( ) , hints . toString ( ) )
|
initializesVersionOnInsert ( ) { org . springframework . data . mongodb . core . PersonWithVersionPropertyOfTypeInteger person = new org . springframework . data . mongodb . core . PersonWithVersionPropertyOfTypeInteger ( ) ; person . firstName = "Dave" ; template . insert ( person ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( person . version , is ( 0 ) )
|
testDaylightSavingTime ( ) { org . joda . time . DateTime time = new org . joda . time . DateTime ( 2015 , 11 , 1 , 2 , 1 , io . confluent . connect . hdfs . partitioner . TimeBasedPartitionerTest . DATE_TIME_ZONE ) ; java . lang . String pathFormat = "'year='YYYY/'month='MMMM/'day='dd/'hour='H/" ; org . joda . time . format . DateTimeFormatter formatter = org . joda . time . format . DateTimeFormat . forPattern ( pathFormat ) . withZone ( io . confluent . connect . hdfs . partitioner . TimeBasedPartitionerTest . DATE_TIME_ZONE ) ; long utc1 = io . confluent . connect . hdfs . partitioner . TimeBasedPartitionerTest . DATE_TIME_ZONE . convertLocalToUTC ( ( ( time . getMillis ( ) ) - ( TimeUnit . MINUTES . toMillis ( 60 ) ) ) , false ) ; long utc2 = io . confluent . connect . hdfs . partitioner . TimeBasedPartitionerTest . DATE_TIME_ZONE . convertLocalToUTC ( ( ( time . getMillis ( ) ) - ( TimeUnit . MINUTES . toMillis ( 120 ) ) ) , false ) ; org . joda . time . DateTime time1 = new org . joda . time . DateTime ( io . confluent . connect . hdfs . partitioner . TimeBasedPartitionerTest . DATE_TIME_ZONE . convertUTCToLocal ( utc1 ) ) ; org . joda . time . DateTime time2 = new org . joda . time . DateTime ( io . confluent . connect . hdfs . partitioner . TimeBasedPartitionerTest . DATE_TIME_ZONE . convertUTCToLocal ( utc2 ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( time1 . toString ( formatter ) , time2 . toString ( formatter ) )
|
testRemoveTaskNotExist ( ) { java . lang . Integer siteId = 1 ; java . lang . String taskId = "0" ; java . lang . String username = "test" ; com . ewcms . publication . task . Taskable task = mock ( com . ewcms . publication . task . Taskable . class ) ; when ( task . getId ( ) ) . thenReturn ( taskId ) ; when ( task . getUsername ( ) ) . thenReturn ( username ) ; com . ewcms . publication . task . MemoryTaskRegistry register = new com . ewcms . publication . task . MemoryTaskRegistry ( ) ; register . removeTask ( siteId , taskId , username ) ; "<AssertPlaceHolder>" ; } containsTask ( com . ewcms . publication . task . Taskable ) { synchronized ( taskPool ) { boolean contains = false ; for ( com . ewcms . publication . task . SiteTaskRunnerable runner : taskPool . values ( ) ) { contains = contains || ( runner . contains ( task ) ) ; } return contains ; } }
|
org . junit . Assert . assertFalse ( register . containsTask ( task ) )
|
shouldDeserialiseSourceDestinationValuesIncorrectWayRound ( ) { final uk . gov . gchq . gaffer . data . element . Edge edge = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . source ( "1" ) . dest ( "2" ) . directed ( true ) . group ( TestGroups . ENTITY ) . build ( ) ; final byte [ ] rowKey = converter . getRowKeysFromEdge ( edge ) . getSecond ( ) ; final byte [ ] [ ] sourceDestValues = new byte [ 2 ] [ ] ; final uk . gov . gchq . gaffer . data . element . EdgeDirection direction = converter . getSourceAndDestinationFromRowKey ( rowKey , sourceDestValues ) ; "<AssertPlaceHolder>" ; } getSourceAndDestinationFromRowKey ( byte [ ] , byte [ ] [ ] ) { final int [ ] positionsOfDelimiters = new int [ 3 ] ; short numDelims = 0 ; for ( int i = 0 ; i < ( ( rowKey . length ) - 1 ) ; ++ i ) { if ( ( rowKey [ i ] ) == ( uk . gov . gchq . gaffer . commonutil . ByteArrayEscapeUtils . DELIMITER ) ) { if ( numDelims >= 3 ) { throw new uk . gov . gchq . gaffer . accumulostore . key . exception . AccumuloElementConversionException ( "Too<sp>many<sp>delimiters<sp>found<sp>in<sp>row<sp>key<sp>-<sp>found<sp>more<sp>than<sp>the<sp>expected<sp>3." ) ; } positionsOfDelimiters [ ( numDelims ++ ) ] = i ; } } if ( numDelims != 3 ) { throw new uk . gov . gchq . gaffer . accumulostore . key . exception . AccumuloElementConversionException ( ( ( "Wrong<sp>number<sp>of<sp>delimiters<sp>found<sp>in<sp>row<sp>key<sp>-<sp>found<sp>" + numDelims ) + ",<sp>expected<sp>3." ) ) ; } byte directionFlag ; try { directionFlag = rowKey [ ( ( rowKey . length ) - 1 ) ] ; } catch ( final java . lang . NumberFormatException e ) { throw new uk . gov . gchq . gaffer . accumulostore . key . exception . AccumuloElementConversionException ( ( "Error<sp>parsing<sp>direction<sp>flag<sp>from<sp>row<sp>key<sp>-<sp>" + e ) ) ; } byte [ ] sourceBytes = uk . gov . gchq . gaffer . commonutil . ByteArrayEscapeUtils . unEscape ( rowKey , 0 , positionsOfDelimiters [ 0 ] ) ; byte [ ] destBytes = uk . gov . gchq . gaffer . commonutil . ByteArrayEscapeUtils . unEscape ( rowKey , ( ( positionsOfDelimiters [ 1 ] ) + 1 ) , positionsOfDelimiters [ 2 ] ) ; uk . gov . gchq . gaffer . data . element . EdgeDirection rtn ; sourceDestValues [ 0 ] = sourceBytes ; sourceDestValues [ 1 ] = destBytes ; switch ( directionFlag ) { case ByteEntityPositions . UNDIRECTED_EDGE : rtn = uk . gov . gchq . gaffer . data . element . EdgeDirection . UNDIRECTED ; break ; case ByteEntityPositions . CORRECT_WAY_DIRECTED_EDGE : rtn = uk . gov . gchq . gaffer . data . element . EdgeDirection . DIRECTED ; break ; case ByteEntityPositions . INCORRECT_WAY_DIRECTED_EDGE : sourceDestValues [ 0 ] = destBytes ; sourceDestValues [ 1 ] = sourceBytes ; rtn = uk . gov . gchq . gaffer . data . element . EdgeDirection . DIRECTED_REVERSED ; break ; default : throw new uk . gov . gchq . gaffer . accumulostore . key . exception . AccumuloElementConversionException ( ( "Invalid<sp>direction<sp>flag<sp>in<sp>row<sp>key<sp>-<sp>flag<sp>was<sp>" + directionFlag ) ) ; } return rtn ; }
|
org . junit . Assert . assertEquals ( EdgeDirection . DIRECTED_REVERSED , direction )
|
shouldOwnerWarningBeShownTest_OrgAdmin ( ) { org . oscm . ui . model . User owner = prepareSubOwnerWithRole ( "owner" , true , UserRoleType . ORGANIZATION_ADMIN ) ; model . setSelectedOwner ( owner ) ; boolean showOwnerWarning = ctrl . shouldOwnerWarningBeShown ( ) ; "<AssertPlaceHolder>" ; } shouldOwnerWarningBeShown ( ) { org . oscm . ui . model . User subscriptionOwner = model . getSelectedOwner ( ) ; if ( subscriptionOwner == null ) { return false ; } if ( subscriptionOwner . isOrganizationAdmin ( ) ) { return false ; } if ( ( model . getSubscription ( ) . getUnitKey ( ) ) == 0L ) { if ( subscriptionOwner . isUnitAdministrator ( ) ) { setOwnerWarningMessage ( BaseBean . WARNING_UNIT_NOT_SELECTED_UNIT_ADMIN , new java . lang . Object [ ] { model . getSelectedOwnerName ( ) } ) ; return true ; } return false ; } if ( subscriptionOwner . isSubscriptionManager ( ) ) { setOwnerWarningMessage ( BaseBean . WARNING_OWNER_IS_SUB_MAN , new java . lang . Object [ ] { model . getSubscription ( ) . getUnitName ( ) , model . getSelectedOwnerName ( ) } ) ; return true ; } java . util . List < org . oscm . internal . usergroupmgmt . POUserGroup > usergroups = getUserGroupService ( ) . getUserGroupsForUserWithRole ( subscriptionOwner . getKey ( ) , UnitRoleType . ADMINISTRATOR . getKey ( ) ) ; for ( org . oscm . internal . usergroupmgmt . POUserGroup poUserGroup : usergroups ) { if ( ( poUserGroup . getKey ( ) ) == ( model . getSubscription ( ) . getUnitKey ( ) ) ) { return false ; } } setOwnerWarningMessage ( BaseBean . WARNING_OWNER_NOT_A_UNIT_ADMIN , new java . lang . Object [ ] { model . getSubscription ( ) . getUnitName ( ) , model . getSelectedOwnerName ( ) } ) ; return true ; }
|
org . junit . Assert . assertFalse ( showOwnerWarning )
|
testCreateElasticSearchReporter ( ) { com . codahale . metrics . ScheduledReporter reporter = uk . gov . dstl . baleen . core . metrics . ReporterUtils . createElasticSearchReporter ( registry , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( reporter )
|
testPreimageProof_ElGamal ( ) { ch . bfh . unicrypt . math . algebra . multiplicative . classes . GStarMod G_q = this . G_q1 ; ch . bfh . unicrypt . crypto . schemes . encryption . classes . ElGamalEncryptionScheme elgamal = ch . bfh . unicrypt . crypto . schemes . encryption . classes . ElGamalEncryptionScheme . getInstance ( G_q . getElement ( 4 ) ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element pk = G_q . getElement ( 2 ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element m = G_q . getElement ( 2 ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element r = G_q . getZModOrder ( ) . getElement ( 2 ) ; ch . bfh . unicrypt . math . function . interfaces . Function f = elgamal . getEncryptionFunction ( ) . partiallyApply ( pk , 0 ) ; ch . bfh . unicrypt . crypto . proofsystem . classes . PlainPreimageProofSystem pg = ch . bfh . unicrypt . crypto . proofsystem . classes . PlainPreimageProofSystem . getInstance ( this . proverId , f ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element privateInput = ch . bfh . unicrypt . math . algebra . general . classes . Tuple . getInstance ( m , r ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element publicInput = ch . bfh . unicrypt . math . algebra . general . classes . Tuple . getInstance ( G_q . getElement ( 16 ) , G_q . getElement ( 8 ) ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple proof = pg . generate ( privateInput , publicInput ) ; boolean v = pg . verify ( proof , publicInput ) ; "<AssertPlaceHolder>" ; } verify ( ch . bfh . unicrypt . math . algebra . general . interfaces . Element , ch . bfh . unicrypt . math . algebra . general . interfaces . Element ) { if ( ( ! ( this . getProofSpace ( ) . contains ( proof ) ) ) || ( ! ( this . getPublicInputSpace ( ) . contains ( publicInput ) ) ) ) { throw new java . lang . IllegalArgumentException ( ) ; } return this . abstractVerify ( ( ( PE ) ( proof ) ) , ( ( PUE ) ( publicInput ) ) ) ; }
|
org . junit . Assert . assertTrue ( v )
|
testSerialization ( ) { com . orsoncharts . label . StandardCategoryLabelGenerator lg1 = new com . orsoncharts . label . StandardCategoryLabelGenerator ( ) ; com . orsoncharts . label . StandardCategoryLabelGenerator lg2 = ( ( com . orsoncharts . label . StandardCategoryLabelGenerator ) ( com . orsoncharts . TestUtils . serialized ( lg1 ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == ( this ) ) { return true ; } if ( ! ( obj instanceof com . orsoncharts . graphics3d . Offset3D ) ) { return false ; } com . orsoncharts . graphics3d . Offset3D that = ( ( com . orsoncharts . graphics3d . Offset3D ) ( obj ) ) ; if ( ( this . dx ) != ( that . dx ) ) { return false ; } if ( ( this . dy ) != ( that . dy ) ) { return false ; } if ( ( this . dz ) != ( that . dz ) ) { return false ; } return true ; }
|
org . junit . Assert . assertTrue ( lg1 . equals ( lg2 ) )
|
delete ( ) { final java . lang . String path = "/data" ; final org . sentilo . common . rest . RequestContext rc = new org . sentilo . common . rest . RequestContext ( path ) ; final java . lang . String responseContent = "Lorem<sp>ipsum" ; final org . apache . http . StatusLine statusLine = new org . apache . http . message . BasicStatusLine ( org . apache . http . HttpVersion . HTTP_1_0 , org . apache . http . HttpStatus . SC_OK , "" ) ; when ( httpClient . execute ( notNull ( org . apache . http . client . methods . HttpDelete . class ) ) ) . thenReturn ( httpResponse ) ; when ( httpResponse . getStatusLine ( ) ) . thenReturn ( statusLine ) ; when ( httpResponse . getEntity ( ) ) . thenReturn ( new org . apache . http . entity . StringEntity ( responseContent ) ) ; final java . lang . String result = restClient . delete ( rc ) ; verify ( httpClient ) . execute ( any ( org . apache . http . client . methods . HttpDelete . class ) ) ; "<AssertPlaceHolder>" ; } execute ( org . sentilo . platform . service . dao . JedisCallback ) { org . springframework . util . Assert . notNull ( action , "Callback<sp>object<sp>must<sp>not<sp>be<sp>null" ) ; redis . clients . jedis . Jedis conn = null ; boolean broken = false ; try { conn = jedisPoolUtils . getResource ( ) ; return action . doInRedis ( conn ) ; } catch ( final java . lang . Exception e ) { if ( e instanceof redis . clients . jedis . exceptions . JedisConnectionException ) { broken = true ; } throw jedisPoolUtils . convertJedisAccessException ( e ) ; } finally { jedisPoolUtils . releaseConnection ( conn , broken ) ; } }
|
org . junit . Assert . assertEquals ( responseContent , result )
|
testRunWithException ( ) { target = org . mockito . Mockito . spy ( new org . o3project . odenos . core . manager . system . SystemManager ( org . o3project . odenos . core . manager . system . SystemManagerTest . SYSTEM_MGR_ID , mockDispatcher , mockEventManagerProp ) ) ; java . util . HashMap < java . lang . String , java . lang . String > mockList = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; mockList . put ( "key1" , "value1" ) ; mockList . put ( "key2" , "value2" ) ; mockList . put ( "key3" , "value3" ) ; org . powermock . reflect . Whitebox . setInternalState ( target , "componentStateList" , mockList ) ; java . lang . String testUri = "test/componentmanager/test" ; org . o3project . odenos . core . manager . system . SystemManager . CheckComponentsTask task = org . mockito . Mockito . spy ( target . new org . o3project . odenos . core . manager . system . CheckComponentsTask ( testUri ) ) ; org . mockito . Mockito . doThrow ( new java . lang . Exception ( ) ) . when ( target ) . request ( anyString ( ) , eq ( Request . Method . GET ) , anyString ( ) , eq ( "" ) , eq ( null ) ) ; task . run ( ) ; java . util . HashMap < java . lang . String , java . lang . String > resultList = org . powermock . reflect . Whitebox . getInternalState ( target , "componentStateList" ) ; "<AssertPlaceHolder>" ; } run ( ) { this . server = new org . eclipse . jetty . server . Server ( new java . net . InetSocketAddress ( host , port ) ) ; synchronized ( this . server ) { java . util . HashMap < java . lang . String , java . lang . String > param = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; param . put ( CrossOriginFilter . ALLOWED_ORIGINS_PARAM , "*" ) ; param . put ( CrossOriginFilter . ALLOWED_METHODS_PARAM , "GET,POST,PUT,DELETE" ) ; param . put ( CrossOriginFilter . ALLOW_CREDENTIALS_PARAM , "true" ) ; org . eclipse . jetty . servlet . FilterHolder filterHolder = new org . eclipse . jetty . servlet . FilterHolder ( org . eclipse . jetty . servlets . CrossOriginFilter . class ) ; filterHolder . setInitParameters ( param ) ; org . eclipse . jetty . servlet . ServletContextHandler sch = new org . eclipse . jetty . servlet . ServletContextHandler ( org . eclipse . jetty . servlet . ServletContextHandler . SESSIONS ) ; sch . setAttribute ( Attributes . REST_TRANSLATOR , this ) ; sch . setAttribute ( "resource.root" , root ) ; sch . getSessionHandler ( ) . addEventListener ( this . sessionListener ) ; sch . addFilter ( org . eclipse . jetty . servlets . GzipFilter . class , "/*" , java . util . EnumSet . allOf ( javax . servlet . DispatcherType . class ) ) ; java . util . EnumSet < javax . servlet . DispatcherType > dispatchers = java . util . EnumSet . of ( DispatcherType . REQUEST ) ; sch . addFilter ( filterHolder , "/*" , dispatchers ) ; this . server . setHandler ( sch ) ; this . registerServlet ( sch , org . o3project . odenos . remoteobject . rest . servlet . RestServlet . class ) ; this . registerServlet ( sch , org . o3project . odenos . remoteobject . rest . servlet . StreamServlet . class ) ; this . registerServlet ( sch , org . o3project . odenos . remoteobject . rest . servlet . SubscriptionsServlet . class ) ; try { this . server . start ( ) ; } catch ( java . lang . Exception e ) { this . log . error ( "Failed<sp>to<sp>start<sp>the<sp>Jetty<sp>server." , e ) ; return ; } } try { this . server . join ( ) ; } catch ( java . lang . InterruptedException e ) { this . log . error ( "Failed<sp>to<sp>join<sp>the<sp>Jetty<sp>server." , e ) ; return ; } }
|
org . junit . Assert . assertThat ( resultList , org . hamcrest . CoreMatchers . is ( mockList ) )
|
testBigFileWithPauseAndResume ( ) { testFileComplete ( new com . am . jlfu . fileuploader . logic . UploadServletAsyncProcessorTest . RunnableInTheProcess ( ) { @ com . am . jlfu . fileuploader . logic . Override public void run ( ) throws com . am . jlfu . fileuploader . logic . InterruptedException , java . io . IOException { java . lang . String absoluteFullPathOfUploadedFile = staticStateManager . getEntity ( ) . getFileStates ( ) . get ( fileId ) . getAbsoluteFullPathOfUploadedFile ( ) ; com . am . jlfu . fileuploader . logic . UploadProcessorTest . TestFileSplitResult byteArrayFromFile = com . am . jlfu . fileuploader . logic . UploadProcessorTest . getByteArrayFromInputStream ( new java . io . ByteArrayInputStream ( fileContent ) , ( ( uploadProcessor . getSliceSizeInBytes ( ) ) * ( currentSlice ) ) , ( ( ( uploadProcessor . getSliceSizeInBytes ( ) ) * ( currentSlice ) ) + ( uploadProcessor . getSliceSizeInBytes ( ) ) ) ) ; if ( ( currentSlice ) == ( ( numberOfSlices ) / 2 ) ) { uploadProcessor . pauseFile ( java . util . Arrays . asList ( new java . util . UUID [ ] { fileId } ) ) ; long length = new java . io . File ( absoluteFullPathOfUploadedFile ) . length ( ) ; try { java . lang . Thread . sleep ( 100 ) ; } catch ( java . lang . InterruptedException e ) { throw new java . lang . RuntimeException ( e ) ; } processWaitForCompletionAndCheck ( fileId , byteArrayFromFile ) ; "<AssertPlaceHolder>" ; uploadProcessor . resumeFile ( fileId ) ; } processWaitForCompletionAndCheck ( fileId , byteArrayFromFile ) ; } } ) ; } pauseFile ( java . util . List ) { for ( java . util . UUID uuid : uuids ) { pause ( uuid ) ; jlfuListenerPropagator . getPropagator ( ) . onFileUploadPaused ( staticStateIdentifierManager . getIdentifier ( ) , uuid ) ; } }
|
org . junit . Assert . assertThat ( new java . io . File ( absoluteFullPathOfUploadedFile ) . length ( ) , org . hamcrest . CoreMatchers . is ( length ) )
|
testZeroBaselineRateShouldBeUndefined ( ) { org . drugis . addis . entities . RateMeasurement base = new org . drugis . addis . entities . BasicRateMeasurement ( 0 , 100 ) ; org . drugis . addis . entities . RateMeasurement subj = new org . drugis . addis . entities . BasicRateMeasurement ( 50 , 100 ) ; org . drugis . addis . entities . relativeeffect . BasicRiskRatio or = new org . drugis . addis . entities . relativeeffect . BasicRiskRatio ( base , subj ) ; "<AssertPlaceHolder>" ; } isDefined ( ) { return ( ( super . isDefined ( ) ) && ( isAdmissible ( d_subject ) ) ) && ( isAdmissible ( d_baseline ) ) ; }
|
org . junit . Assert . assertFalse ( or . isDefined ( ) )
|
testTreePermissionCanRead ( ) { org . apache . jackrabbit . oak . spi . security . authorization . permission . TreePermission parentPermission = org . apache . jackrabbit . oak . spi . security . authorization . permission . TreePermission . EMPTY ; for ( java . lang . String path : TP_PATHS ) { org . apache . jackrabbit . oak . api . Tree t = readOnlyRoot . getTree ( path ) ; org . apache . jackrabbit . oak . spi . security . authorization . permission . TreePermission tp = cpp . getTreePermission ( t , parentPermission ) ; "<AssertPlaceHolder>" ; parentPermission = tp ; } } canRead ( ) { return false ; }
|
org . junit . Assert . assertTrue ( tp . canRead ( ) )
|
test2Alts ( ) { java . lang . String grammar = "grammar<sp>T;\n" + ( ( ( ( ( "s\n" + "@init<sp>{setBuildParseTree(true);}\n" ) + "@after<sp>{System.out.println($r.ctx.toStringTree(this));}\n" ) + "<sp>:r=a<sp>;\n" ) + "a<sp>:<sp>\'x\'<sp>|<sp>\'y\'\n" ) + "<sp>;\n" ) ; java . lang . String result = execParser ( "T.g4" , grammar , "TParser" , "s\n" 1 , "s\n" 2 , "s\n" 0 , false ) ; java . lang . String expecting = "(a<sp>y)\n" ; "<AssertPlaceHolder>" ; } execParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean ) { return execParser ( grammarFileName , grammarStr , parserName , lexerName , startRuleName , input , debug , false ) ; }
|
org . junit . Assert . assertEquals ( expecting , result )
|
testAlreadyReadableMap ( ) { final org . apache . commons . collections4 . map . HashedMap < java . lang . String , java . lang . Integer > hashedMap = new org . apache . commons . collections4 . map . HashedMap ( ) ; "<AssertPlaceHolder>" ; } readableMap ( org . apache . commons . collections4 . Get ) { if ( get == null ) { throw new java . lang . NullPointerException ( "Get<sp>must<sp>not<sp>be<sp>null" ) ; } if ( get instanceof java . util . Map ) { return get instanceof org . apache . commons . collections4 . IterableMap ? ( ( org . apache . commons . collections4 . IterableMap < K , V > ) ( get ) ) : org . apache . commons . collections4 . MapUtils . iterableMap ( ( ( java . util . Map < K , V > ) ( get ) ) ) ; } return new org . apache . commons . collections4 . SplitMapUtils . WrappedGet ( get ) ; }
|
org . junit . Assert . assertSame ( hashedMap , org . apache . commons . collections4 . SplitMapUtils . readableMap ( hashedMap ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.