input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testResourcesNameLoadingService ( ) { java . lang . ClassLoader classLoader = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; io . datakernel . loader . ResourcesNameLoadingService preDownloadResources = io . datakernel . loader . ResourcesNameLoadingService . create ( io . datakernel . eventloop . Eventloop . getCurrentEventloop ( ) , java . util . concurrent . Executors . newSingleThreadExecutor ( ) , classLoader , "dir2" ) ; preDownloadResources . start ( ) ; io . datakernel . eventloop . Eventloop . getCurrentEventloop ( ) . run ( ) ; io . datakernel . loader . StaticLoader testLoader = ( name ) -> name . equals ( "dir2/testFile.txt" ) ? io . datakernel . async . Promise . of ( io . datakernel . bytebuf . ByteBufStrings . wrapAscii ( io . datakernel . http . StaticServletsTest . EXPECTED_CONTENT ) ) : io . datakernel . async . Promise . ofException ( new java . nio . file . NoSuchFileException ( name ) ) ; io . datakernel . http . StaticServlet staticServlet = io . datakernel . http . StaticServlet . create ( io . datakernel . eventloop . Eventloop . getCurrentEventloop ( ) , testLoader . filter ( preDownloadResources :: contains ) ) ; io . datakernel . http . HttpResponse response = await ( staticServlet . serve ( io . datakernel . http . HttpRequest . get ( "http://test.com:8080/dir2/testFile.txt" ) ) ) ; io . datakernel . bytebuf . ByteBuf body = await ( response . getBody ( ) ) ; "<AssertPlaceHolder>" ; } asString ( java . nio . charset . Charset ) { java . lang . String string = getString ( charset ) ; recycle ( ) ; return string ; }
org . junit . Assert . assertEquals ( io . datakernel . http . StaticServletsTest . EXPECTED_CONTENT , body . asString ( io . datakernel . http . UTF_8 ) )
generateWithHydrogenAndCountAdjunct ( ) { org . openscience . cdk . renderer . generators . standard . AtomSymbol symbol = atomGenerator . generatePeriodicSymbol ( 7 , 2 , ( - 1 ) , 0 , 0 , HydrogenPosition . Right ) ; "<AssertPlaceHolder>" ; } getOutlines ( ) { java . util . List < java . awt . Shape > shapes = new java . util . ArrayList < java . awt . Shape > ( ) ; shapes . add ( element . getOutline ( ) ) ; for ( org . openscience . cdk . renderer . generators . standard . TextOutline adjunct : adjuncts ) shapes . add ( adjunct . getOutline ( ) ) ; return shapes ; }
org . junit . Assert . assertThat ( symbol . getOutlines ( ) . size ( ) , org . hamcrest . CoreMatchers . is ( 3 ) )
cleanUpOnDep1 ( ) { clear ( ) ; "<AssertPlaceHolder>" ; } getAllTopics ( ) { return service . listTopics ( "" , 1000 ) ; }
org . junit . Assert . assertEquals ( 0 , getAllTopics ( ) . size ( ) )
testGetAdvancedSearchUrlForCountryCodes ( java . lang . String , java . lang . String ) { com . catpeds . model . PedigreeCriteria criteria = new com . catpeds . model . PedigreeCriteria ( ) ; criteria . setNationalityCountryCode ( nationalityCountryCode ) ; criteria . setLocationCountryCode ( locationCountryCode ) ; java . lang . String url = pawpedsUrlService . getAdvancedSearchUrl ( criteria ) ; java . lang . String expectedUrl = "https://www.pawpeds.com/db/?a=as&p=nfo&date=iso&name=&ems=&sex=B&" + ( "born_after=&born_before=&born_in=&lives_in=" + "&picture=B&health_info=B&g=2" ) ; "<AssertPlaceHolder>" ; } getAdvancedSearchUrl ( com . catpeds . model . PedigreeCriteria ) { com . catpeds . crawler . pawpeds . PawpedsUrlService . LOGGER . info ( "getAdvancedSearchUrl<sp>with<sp>criteria<sp>{}" , criteria ) ; java . lang . String bornAfter = ( ( criteria . getBornAfter ( ) ) == null ) ? "" : criteria . getBornAfter ( ) . toString ( ) ; java . lang . String bornBefore = ( ( criteria . getBornBefore ( ) ) == null ) ? "" : criteria . getBornBefore ( ) . toString ( ) ; return encodeUrl ( java . lang . String . format ( com . catpeds . crawler . pawpeds . PawpedsUrlService . URL_ADVANCED_SEARCH , nullToEmpty ( criteria . getName ( ) ) , bornAfter , bornBefore , nullToEmpty ( criteria . getNationalityCountryCode ( ) ) , nullToEmpty ( criteria . getLocationCountryCode ( ) ) ) ) ; }
org . junit . Assert . assertEquals ( expectedUrl , url )
testAddPolicyToGroup_errorInAdd_assertException ( ) { boolean exceptionOccured = false ; final javax . persistence . EntityManager mgr = mock ( javax . persistence . EntityManager . class ) ; doThrow ( new java . lang . RuntimeException ( "Just<sp>Passing<sp>Through" ) ) . when ( mgr ) . persist ( ( ( org . nhindirect . config . store . CertPolicyGroupReltn ) ( any ( ) ) ) ) ; final org . nhindirect . config . store . dao . impl . CertPolicyDaoImpl certDao = new org . nhindirect . config . store . dao . impl . CertPolicyDaoImpl ( ) { @ org . nhindirect . config . store . Override public org . nhindirect . config . store . CertPolicy getPolicyById ( long id ) throws org . nhindirect . config . store . ConfigurationStoreException { return new org . nhindirect . config . store . CertPolicy ( ) ; } @ org . nhindirect . config . store . Override public org . nhindirect . config . store . CertPolicyGroup getPolicyGroupById ( long id ) throws org . nhindirect . config . store . ConfigurationStoreException { return new org . nhindirect . config . store . CertPolicyGroup ( ) ; } } ; certDao . setEntityManager ( mgr ) ; final org . nhindirect . config . store . dao . impl . CertPolicyDaoImpl spyDao = spy ( certDao ) ; try { spyDao . addPolicyUseToGroup ( 1234L , 5678L , CertPolicyUse . PRIVATE_RESOLVER , true , true ) ; } catch ( org . nhindirect . config . store . ConfigurationStoreException e ) { exceptionOccured = true ; } "<AssertPlaceHolder>" ; verify ( spyDao , times ( 1 ) ) . getPolicyGroupById ( 1234 ) ; verify ( spyDao , times ( 1 ) ) . getPolicyById ( 5678 ) ; verify ( mgr , times ( 1 ) ) . persist ( ( ( org . nhindirect . config . store . CertPolicyGroupReltn ) ( any ( ) ) ) ) ; }
org . junit . Assert . assertTrue ( exceptionOccured )
testLset ( ) { redis1 . rpush ( key , "1" , "2" , "3" ) ; redis1 . lset ( key , 0 , "4" ) ; "<AssertPlaceHolder>" ; System . out . println ( java . lang . String . format ( "[CRAFT-ATOM-REDIS]<sp>(^_^)<sp><%s><sp>Case<sp>-><sp>test<sp>lset.<sp>" , io . craft . atom . test . CaseCounter . incr ( 1 ) ) ) ; } lrange ( java . lang . String , long , long ) { executeCommand ( CommandEnum . LRANGE , key , start , stop ) ; }
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( new java . lang . String [ ] { "4" , "2" , "3" } , redis1 . lrange ( key , 0 , ( - 1 ) ) . toArray ( new java . lang . String [ ] { } ) ) )
loadFederation_empty ( ) { java . io . File f = dataFolder . getFile ( "empty-file.yml" ) ; com . hotels . bdp . waggledance . mapping . service . impl . YamlFederatedMetaStoreStorage storage = new com . hotels . bdp . waggledance . mapping . service . impl . YamlFederatedMetaStoreStorage ( f . toURI ( ) . toString ( ) , configuration ) ; storage . loadFederation ( ) ; "<AssertPlaceHolder>" ; } getAll ( ) { return com . google . common . collect . ImmutableList . copyOf ( federationsMap . values ( ) ) ; }
org . junit . Assert . assertThat ( storage . getAll ( ) . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) )
testUnsupportedMethods ( ) { com . vaadin . v7 . data . util . BeanContainer < java . lang . String , com . vaadin . v7 . data . util . Person > container = new com . vaadin . v7 . data . util . BeanContainer < java . lang . String , com . vaadin . v7 . data . util . Person > ( com . vaadin . v7 . data . util . Person . class ) ; container . addItem ( "John" , new com . vaadin . v7 . data . util . Person ( "John" ) ) ; try { container . addItem ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . UnsupportedOperationException e ) { } try { container . addItem ( null ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . UnsupportedOperationException e ) { } try { container . addItemAfter ( null , null ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . UnsupportedOperationException e ) { } try { container . addItemAfter ( new com . vaadin . v7 . data . util . Person ( "Jane" ) ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . UnsupportedOperationException e ) { } try { container . addItemAt ( 0 ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . UnsupportedOperationException e ) { } try { container . addItemAt ( 0 , new com . vaadin . v7 . data . util . Person ( "Jane" ) ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . UnsupportedOperationException e ) { } try { container . addContainerProperty ( "lastName" , java . lang . String . class , "" ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . UnsupportedOperationException e ) { } "<AssertPlaceHolder>" ; } size ( ) { updateCount ( ) ; return ( ( size ) + ( sizeOfAddedItems ( ) ) ) - ( removedItems . size ( ) ) ; }
org . junit . Assert . assertEquals ( 1 , container . size ( ) )
shouldInjectScapCap ( ) { com . couchbase . client . java . query . N1qlParams source = com . couchbase . client . java . query . N1qlParams . build ( ) . scanCap ( 5 ) ; com . couchbase . client . java . document . json . JsonObject expected = com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "scan_cap" , "5" ) ; com . couchbase . client . java . document . json . JsonObject actual = com . couchbase . client . java . document . json . JsonObject . empty ( ) ; source . injectParams ( actual ) ; "<AssertPlaceHolder>" ; } injectParams ( com . couchbase . client . java . document . json . JsonObject ) { if ( ( this . serverSideTimeout ) != null ) { queryJson . put ( "timeout" , this . serverSideTimeout ) ; } if ( ( this . clientContextId ) != null ) { queryJson . put ( "client_context_id" , this . clientContextId ) ; } if ( pretty ) { queryJson . put ( "pretty" , true ) ; } if ( deferred ) { queryJson . put ( "mode" , "async" ) ; } if ( ( this . rawParams ) != null ) { for ( Map . Entry < java . lang . String , java . lang . Object > entry : rawParams . entrySet ( ) ) { queryJson . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } }
org . junit . Assert . assertEquals ( expected , actual )
testDetectFragment ( ) { java . lang . String header = "<html><head><title>My<sp>Doc</title></head><body>" ; java . lang . String body = "The<sp>Body" ; java . lang . String footer = "</body></html>" ; java . io . InputStream stream = new org . sakaiproject . content . impl . WrappedInputStream ( new java . io . ByteArrayInputStream ( body . getBytes ( ) ) , header , footer , true ) ; byte [ ] output = readAll ( stream ) ; "<AssertPlaceHolder>" ; } readAll ( java . io . InputStream ) { byte [ ] output = new byte [ 0 ] ; byte [ ] buffer = new byte [ 1024 ] ; int read ; while ( ( read = stream . read ( buffer ) ) > 0 ) { byte [ ] tmp = new byte [ ( output . length ) + read ] ; java . lang . System . arraycopy ( output , 0 , tmp , 0 , output . length ) ; java . lang . System . arraycopy ( buffer , 0 , tmp , output . length , read ) ; output = tmp ; } return output ; }
org . junit . Assert . assertEquals ( ( ( header + body ) + footer ) , new java . lang . String ( output ) )
testValidator_pass_for_young_file ( ) { long now = java . lang . System . currentTimeMillis ( ) ; when ( file . lastModified ( ) ) . thenReturn ( now ) ; "<AssertPlaceHolder>" ; } validate ( T ) { boolean retVal = false ; java . io . File file = ( ( java . io . File ) ( obj ) ) ; if ( fileAgeValidator . validate ( file ) ) { results . addFile ( file . getPath ( ) ) ; checkFile ( file ) ; retVal = true ; } return retVal ; }
org . junit . Assert . assertTrue ( instance . validate ( file ) )
testPathRequest ( ) { try { final fr . gouv . vitam . common . database . builder . query . Query query = fr . gouv . vitam . common . database . builder . query . QueryHelper . path ( "id1" , "id2" ) ; "<AssertPlaceHolder>" ; } catch ( final fr . gouv . vitam . common . database . builder . request . exception . InvalidCreateOperationException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } isReady ( ) { return ready ; }
org . junit . Assert . assertTrue ( query . isReady ( ) )
testConsistentHashing ( ) { final int LOC_COUNT = 20 ; final int MIN_LOC_COUNT = 4 ; final int SPLIT_COUNT = 100 ; java . util . List < java . lang . String > locations = createLocations ( LOC_COUNT ) ; org . apache . hadoop . mapred . InputSplit [ ] splits = createSplits ( SPLIT_COUNT ) ; java . lang . StringBuilder failBuilder = new java . lang . StringBuilder ( "\n" ) ; java . lang . String [ ] lastLocations = new java . lang . String [ splits . length ] ; double movedRatioSum = 0 ; double newRatioSum = 0 ; double movedRatioWorst = 0 ; double newRatioWorst = Double . MAX_VALUE ; for ( int locs = MIN_LOC_COUNT ; locs <= ( locations . size ( ) ) ; ++ locs ) { java . util . List < java . lang . String > partLoc = locations . subList ( 0 , locs ) ; org . apache . hadoop . hive . ql . exec . tez . HostAffinitySplitLocationProvider lp = new org . apache . hadoop . hive . ql . exec . tez . HostAffinitySplitLocationProvider ( partLoc ) ; int moved = 0 ; int newLoc = 0 ; java . lang . String newNode = partLoc . get ( ( locs - 1 ) ) ; for ( int splitIx = 0 ; splitIx < ( splits . length ) ; ++ splitIx ) { java . lang . String [ ] splitLocations = lp . getLocations ( splits [ splitIx ] ) ; "<AssertPlaceHolder>" ; java . lang . String splitLocation = splitLocations [ 0 ] ; if ( ( locs > MIN_LOC_COUNT ) && ( ! ( splitLocation . equals ( lastLocations [ splitIx ] ) ) ) ) { ++ moved ; } if ( newNode . equals ( splitLocation ) ) { ++ newLoc ; } lastLocations [ splitIx ] = splitLocation ; } if ( locs == MIN_LOC_COUNT ) { continue ; } java . lang . String msgTail = ( "<sp>when<sp>going<sp>to<sp>" + locs ) + "<sp>locations" ; java . lang . String movedMsg = moved + "<sp>splits<sp>moved" ; java . lang . String newMsg = newLoc + "<sp>splits<sp>went<sp>to<sp>the<sp>new<sp>node" ; LOG . info ( ( ( ( movedMsg + "<sp>and<sp>" ) + newMsg ) + msgTail ) ) ; double maxMoved = ( 1.0F * ( splits . length ) ) / locs ; double minNew = ( 1.0F * ( splits . length ) ) / locs ; movedRatioSum += moved / maxMoved ; movedRatioWorst = java . lang . Math . max ( ( moved / maxMoved ) , movedRatioWorst ) ; newRatioSum += newLoc / minNew ; newRatioWorst = java . lang . Math . min ( ( newLoc / minNew ) , newRatioWorst ) ; logBadRatios ( failBuilder , moved , newLoc , msgTail , movedMsg , newMsg , maxMoved , minNew ) ; } int count = ( locations . size ( ) ) - MIN_LOC_COUNT ; double moveRatioAvg = movedRatioSum / count ; double newRatioAvg = newRatioSum / count ; java . lang . String errorMsg = ( ( ( ( ( ( "Move<sp>counts:<sp>average<sp>" + moveRatioAvg ) + ",<sp>worst<sp>" ) + movedRatioWorst ) + ";<sp>assigned<sp>to<sp>new<sp>node:<sp>average<sp>" ) + newRatioAvg ) + ",<sp>worst<sp>" ) + newRatioWorst ; LOG . info ( errorMsg ) ; if ( ( ( ( moveRatioAvg > 1.2F ) || ( newRatioAvg < 0.8F ) ) || ( movedRatioWorst > 1.67F ) ) || ( newRatioWorst < 0.5F ) ) { org . junit . Assert . fail ( ( ( errorMsg + ";<sp>example<sp>failures:<sp>" ) + ( failBuilder . toString ( ) ) ) ) ; } } getLocations ( org . apache . hadoop . mapred . InputSplit ) { if ( ! ( split instanceof org . apache . hadoop . mapred . FileSplit ) ) { if ( isDebugEnabled ) { org . apache . hadoop . hive . ql . exec . tez . HostAffinitySplitLocationProvider . LOG . debug ( ( ( "Split:<sp>" + split ) + "<sp>is<sp>not<sp>a<sp>FileSplit.<sp>Using<sp>default<sp>locations" ) ) ; } return split . getLocations ( ) ; } org . apache . hadoop . mapred . FileSplit fsplit = ( ( org . apache . hadoop . mapred . FileSplit ) ( split ) ) ; java . lang . String splitDesc = ( ( ( ( "Split<sp>at<sp>" + ( fsplit . getPath ( ) ) ) + "<sp>with<sp>offset=<sp>" ) + ( fsplit . getStart ( ) ) ) + ",<sp>length=" ) + ( fsplit . getLength ( ) ) ; java . util . List < java . lang . String > preferredLocations = preferLocations ( fsplit ) ; java . lang . String location = preferredLocations . get ( org . apache . hadoop . hive . ql . exec . tez . HostAffinitySplitLocationProvider . determineLocation ( preferredLocations , fsplit . getPath ( ) . toString ( ) , fsplit . getStart ( ) , splitDesc ) ) ; return location != null ? new java . lang . String [ ] { location } : null ; }
org . junit . Assert . assertEquals ( 1 , splitLocations . length )
testGetEnglishWordCountMany ( ) { java . lang . String string = "many<sp>words<sp>in<sp>a<sp>sentence.<sp>second<sp>sentence" ; com . box . l10n . mojito . service . WordCountService instance = new com . box . l10n . mojito . service . WordCountService ( ) ; int expResult = 7 ; int result = instance . getEnglishWordCount ( string ) ; "<AssertPlaceHolder>" ; } getEnglishWordCount ( java . lang . String ) { int wordCount = 0 ; java . text . BreakIterator wordBreakIterator = java . text . BreakIterator . getWordInstance ( Locale . ENGLISH ) ; wordBreakIterator . setText ( string ) ; int start = wordBreakIterator . first ( ) ; int end = wordBreakIterator . next ( ) ; while ( end != ( java . text . BreakIterator . DONE ) ) { if ( java . lang . Character . isLetterOrDigit ( string . charAt ( start ) ) ) { wordCount += 1 ; } start = end ; end = wordBreakIterator . next ( ) ; } return wordCount ; }
org . junit . Assert . assertEquals ( expResult , result )
testClass ( ) { com . jfireframework . codejson . function . WriteStrategy strategy = new com . jfireframework . codejson . function . WriteStrategy ( ) ; strategy . setUseTracker ( true ) ; strategy . addTypeStrategy ( java . util . Date . class , new com . jfireframework . codejson . function . impl . write . WriterAdapter ( ) { private java . text . SimpleDateFormat format = new java . text . SimpleDateFormat ( "yyyy-MM-dd" ) ; @ com . jfireframework . codejson . test . Override public void write ( java . lang . Object field , com . jfireframework . baseutil . collection . StringCache cache , java . lang . Object entity , com . jfireframework . codejson . tracker . Tracker tracker ) { cache . append ( '\"' ) . append ( format . format ( ( ( java . util . Date ) ( field ) ) ) ) . append ( '\"' ) ; } } ) ; logger . info ( strategy . write ( info ) ) ; java . lang . String result = "{\"d\":2.3569,\"date\":\"2015-11-14\",\"dates\":[\"2015-11-14\",\"2015-11-14\"],\"nestInfo\":{\"date\":\"2015-11-14\"}}" ; "<AssertPlaceHolder>" ; } write ( java . lang . Object ) { com . jfireframework . baseutil . collection . StringCache cache = com . jfireframework . codejson . JsonTool . cacheLocal . get ( ) ; cache . clear ( ) ; com . jfireframework . codejson . function . WriterContext . write ( value , cache ) ; return cache . toString ( ) ; }
org . junit . Assert . assertEquals ( result , strategy . write ( info ) )
testContainsKeyObject ( ) { java . lang . String prefix = com . sun . mail . util . logging . LogManagerPropertiesTest . class . getName ( ) ; java . util . Properties parent = new java . util . Properties ( ) ; com . sun . mail . util . logging . LogManagerProperties mp = new com . sun . mail . util . logging . LogManagerProperties ( parent , prefix ) ; java . lang . String key = "key" ; java . lang . Object value = new java . lang . Object ( ) ; parent . put ( key , value ) ; "<AssertPlaceHolder>" ; } containsKey ( java . lang . Object ) { boolean found = ( key instanceof java . lang . String ) && ( ( getProperty ( ( ( java . lang . String ) ( key ) ) ) ) != null ) ; if ( ! found ) { found = ( defaults . containsKey ( key ) ) || ( super . containsKey ( key ) ) ; } return found ; }
org . junit . Assert . assertEquals ( parent . containsKey ( key ) , mp . containsKey ( key ) )
equalsInputNotNullOutputFalse3 ( ) { final com . freedomotic . environment . GraphEdge objectUnderTest = new com . freedomotic . environment . GraphEdge ( ( - 303054864 ) , 134217728 , null ) ; final com . freedomotic . environment . GraphEdge other = new com . freedomotic . environment . GraphEdge ( ( - 303054864 ) , 0 , ( - 2147483647 ) ) ; final boolean retval = objectUnderTest . equals ( other ) ; "<AssertPlaceHolder>" ; } equals ( com . darkprograms . speech . util . Complex ) { return ( ( re ) == ( other . re ) ) && ( ( im ) == ( other . im ) ) ; }
org . junit . Assert . assertEquals ( false , retval )
testSaveAndReload ( ) { org . semanticweb . owlapi . model . OWLOntology ontA = getOWLOntology ( ) ; ontA . add ( axioms . build ( ) ) ; org . semanticweb . owlapi . model . OWLOntology ontB = roundTrip ( ontA ) ; java . util . Set < org . semanticweb . owlapi . model . OWLLogicalAxiom > aMinusB = asUnorderedSet ( ontA . logicalAxioms ( ) ) ; aMinusB . removeAll ( asList ( ontB . axioms ( ) ) ) ; java . util . Set < org . semanticweb . owlapi . model . OWLLogicalAxiom > bMinusA = asUnorderedSet ( ontB . logicalAxioms ( ) ) ; bMinusA . removeAll ( asList ( ontA . axioms ( ) ) ) ; java . lang . StringBuilder msg = new java . lang . StringBuilder ( ) ; if ( ( aMinusB . isEmpty ( ) ) && ( bMinusA . isEmpty ( ) ) ) { msg . append ( "Ontology<sp>save/load<sp>roundtrip<sp>OK.\n" ) ; } else { msg . append ( "Ontology<sp>save/load<sp>roundtripping<sp>error.\n" ) ; msg . append ( "=><sp>" ) . append ( aMinusB . size ( ) ) . append ( "<sp>axioms<sp>lost<sp>in<sp>roundtripping.\n" ) ; for ( org . semanticweb . owlapi . model . OWLAxiom axiom : aMinusB ) { msg . append ( axiom ) . append ( "\n" ) ; } msg . append ( "=><sp>" ) . append ( bMinusA . size ( ) ) . append ( "<sp>axioms<sp>added<sp>after<sp>roundtripping.\n" ) ; for ( org . semanticweb . owlapi . model . OWLAxiom axiom : bMinusA ) { msg . append ( axiom ) . append ( "\n" ) ; } } "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( tag ) ; sb . append ( '(' ) ; for ( java . lang . Object ob : values ) { sb . append ( '<sp>' ) ; sb . append ( ob ) ; } if ( ! ( qualifierValues . isEmpty ( ) ) ) { sb . append ( '{' ) ; for ( org . obolibrary . oboformat . model . QualifierValue qv : qualifierValues ) { sb . append ( qv ) ; sb . append ( '<sp>' ) ; } sb . append ( '}' ) ; } if ( ! ( xrefs . isEmpty ( ) ) ) { sb . append ( '[' ) ; for ( org . obolibrary . oboformat . model . Xref x : xrefs ) { sb . append ( x ) ; sb . append ( '<sp>' ) ; } sb . append ( ']' ) ; } sb . append ( ')' ) ; return sb . toString ( ) ; }
org . junit . Assert . assertTrue ( msg . toString ( ) , ( ( aMinusB . isEmpty ( ) ) && ( bMinusA . isEmpty ( ) ) ) )
givenIntegerArray_whenSortedWithQuickSort_thenGetSortedArray ( ) { int [ ] actual = new int [ ] { 9 , 5 , 1 , 0 , 6 , 2 , 3 , 4 , 7 , 8 } ; int [ ] expected = new int [ ] { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ; com . baeldung . algorithms . quicksort . QuickSort . quickSort ( actual , 0 , ( ( actual . length ) - 1 ) ) ; "<AssertPlaceHolder>" ; } quickSort ( int [ ] , int , int ) { if ( begin < end ) { int partitionIndex = com . baeldung . algorithms . quicksort . QuickSort . partition ( arr , begin , end ) ; com . baeldung . algorithms . quicksort . QuickSort . quickSort ( arr , begin , ( partitionIndex - 1 ) ) ; com . baeldung . algorithms . quicksort . QuickSort . quickSort ( arr , ( partitionIndex + 1 ) , end ) ; } }
org . junit . Assert . assertArrayEquals ( expected , actual )
testNonInplaceOp2 ( ) { lombok . val arrayX = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) ; lombok . val arrayY = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) ; arrayX . assign ( 3.0 ) ; arrayY . assign ( 1.0 ) ; lombok . val exp = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) . assign ( 4.0 ) ; org . nd4j . linalg . api . ops . CustomOp op = org . nd4j . linalg . api . ops . DynamicCustomOp . builder ( "add" ) . addInputs ( arrayX , arrayY ) . addOutputs ( arrayX ) . build ( ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( op ) ; "<AssertPlaceHolder>" ; } exec ( java . lang . String ) { code = org . datavec . python . PythonExecutioner . getFunctionalCode ( ( "__f_" + ( java . lang . Thread . currentThread ( ) . getId ( ) ) ) , code ) ; org . datavec . python . PythonExecutioner . acquireGIL ( ) ; log . info ( "CPython:<sp>PyRun_SimpleStringFlag()" ) ; log . info ( code ) ; int result = PyRun_SimpleStringFlags ( code , null ) ; if ( result != 0 ) { PyErr_Print ( ) ; throw new java . lang . RuntimeException ( "exec<sp>failed" ) ; } log . info ( "Exec<sp>done" ) ; org . datavec . python . PythonExecutioner . releaseGIL ( ) ; }
org . junit . Assert . assertEquals ( exp , arrayX )
generate_single_random_number ( ) { int randomNumber = ( ( int ) ( ( java . lang . Math . random ( ) ) * 10 ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( ( randomNumber < 10 ) )
testSetLastLoginTime ( ) { System . out . println ( "setLastLogin" ) ; edu . harvard . iq . dataverse . authorization . users . AuthenticatedUserTest . testUser . setLastLoginTime ( edu . harvard . iq . dataverse . authorization . users . AuthenticatedUserTest . loginTime ) ; java . sql . Timestamp lastLogin = edu . harvard . iq . dataverse . authorization . users . AuthenticatedUserTest . testUser . getLastLoginTime ( ) ; "<AssertPlaceHolder>" ; } getLastLoginTime ( ) { return this . lastLoginTime ; }
org . junit . Assert . assertEquals ( edu . harvard . iq . dataverse . authorization . users . AuthenticatedUserTest . loginTime , lastLogin )
testGettingTheAdminProxy ( ) { org . rioproject . eventcollector . api . EventCollectorAdmin admin = ( ( org . rioproject . eventcollector . api . EventCollectorAdmin ) ( eventCollector . getAdmin ( ) ) ) ; "<AssertPlaceHolder>" ; } getAdmin ( ) { return admin ; }
org . junit . Assert . assertNotNull ( admin )
testDeleteDeletedNode ( ) { theirRoot . getTree ( "/x" ) . remove ( ) ; ourRoot . getTree ( "/x" ) . remove ( ) ; theirRoot . commit ( ) ; ourRoot . commit ( ) ; "<AssertPlaceHolder>" ; } getTree ( java . lang . String ) { return base . getTree ( path ) ; }
org . junit . Assert . assertFalse ( ourRoot . getTree ( "/x" ) . exists ( ) )
testHandlingOfMainSourceConflictingWithLibSource ( ) { final org . opendaylight . yangtools . yang . model . api . SchemaContext schemaContext = org . opendaylight . yangtools . yang . parser . rfc7950 . reactor . RFC7950Reactors . defaultReactor ( ) . newBuild ( ) . addSource ( org . opendaylight . yangtools . yang . stmt . StmtTestUtils . sourceForResource ( "/bugs/bug7480/main-source-lib-source-conflict-test/parent-module.yang" ) ) . addLibSources ( org . opendaylight . yangtools . yang . stmt . StmtTestUtils . sourceForResource ( "/bugs/bug7480/main-source-lib-source-conflict-test/child-module.yang" ) , org . opendaylight . yangtools . yang . stmt . StmtTestUtils . sourceForResource ( "/bugs/bug7480/main-source-lib-source-conflict-test/parent-module.yang" ) ) . buildEffective ( ) ; "<AssertPlaceHolder>" ; } buildEffective ( ) { return root . buildEffective ( ) ; }
org . junit . Assert . assertNotNull ( schemaContext )
create_null ( ) { "<AssertPlaceHolder>" ; } ciString ( java . lang . String ) { if ( value == null ) { return null ; } return new net . ripe . db . whois . common . domain . CIString ( value ) ; }
org . junit . Assert . assertNull ( net . ripe . db . whois . common . domain . CIString . ciString ( null ) )
testGetRaDetailByClaimNo ( ) { java . lang . String claimNo1 = "111" ; java . lang . String claimNo2 = "222" ; org . oscarehr . common . model . RaDetail raDetail1 = new org . oscarehr . common . model . RaDetail ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( raDetail1 ) ; raDetail1 . setClaimNo ( claimNo1 ) ; dao . persist ( raDetail1 ) ; org . oscarehr . common . model . RaDetail raDetail2 = new org . oscarehr . common . model . RaDetail ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( raDetail2 ) ; raDetail2 . setClaimNo ( claimNo2 ) ; dao . persist ( raDetail2 ) ; org . oscarehr . common . model . RaDetail raDetail3 = new org . oscarehr . common . model . RaDetail ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( raDetail3 ) ; raDetail3 . setClaimNo ( claimNo1 ) ; dao . persist ( raDetail3 ) ; org . oscarehr . common . model . RaDetail raDetail4 = new org . oscarehr . common . model . RaDetail ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( raDetail4 ) ; raDetail4 . setClaimNo ( claimNo1 ) ; dao . persist ( raDetail4 ) ; java . util . List < org . oscarehr . common . model . RaDetail > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . RaDetail > ( java . util . Arrays . asList ( raDetail1 , raDetail3 , raDetail4 ) ) ; java . util . List < org . oscarehr . common . model . RaDetail > result = dao . getRaDetailByClaimNo ( claimNo1 ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } }
org . junit . Assert . assertTrue ( true )
testConfiguration ( ) { org . jboss . as . core . model . test . KernelServices kernelServices = createKernelServicesBuilder ( TestModelType . HOST ) . setXmlResource ( "kerberos-host.xml" ) . validateDescription ( ) . build ( ) ; "<AssertPlaceHolder>" ; java . lang . String marshalled = kernelServices . getPersistedSubsystemXml ( ) ; org . jboss . as . model . test . ModelTestUtils . compareXml ( org . jboss . as . model . test . ModelTestUtils . readResource ( this . getClass ( ) , "kerberos-host.xml" ) , marshalled ) ; } isSuccessfulBoot ( ) { return bootSuccess ; }
org . junit . Assert . assertTrue ( kernelServices . isSuccessfulBoot ( ) )
testEqualsObjectNull ( ) { boolean result = target . equals ( null ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == ( this ) ) { return true ; } if ( ! ( obj instanceof org . o3project . odenos . remoteobject . event . EventSubscription ) ) { return false ; } org . o3project . odenos . remoteobject . event . EventSubscription eventSubscription = ( ( org . o3project . odenos . remoteobject . event . EventSubscription ) ( obj ) ) ; return this . subscriberId . equals ( eventSubscription . getSubscriberId ( ) ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
testAvailable ( ) { org . omg . CORBA . portable . OutputStream out = orb . create_output_stream ( ) ; out . write_long ( 1234 ) ; org . omg . CORBA . portable . InputStream in = out . create_input_stream ( ) ; "<AssertPlaceHolder>" ; in . read_octet ( ) ; in . read_octet ( ) ; in . read_octet ( ) ; in . read_octet ( ) ; } available ( ) { return ( buffer . length ) - ( index ) ; }
org . junit . Assert . assertEquals ( 4 , in . available ( ) )
testLoadDataUri ( ) { initializeExpectedTable ( 2 ) ; expect ( bigquery . getOptions ( ) ) . andReturn ( mockOptions ) ; com . google . cloud . bigquery . Job expectedJob = new com . google . cloud . bigquery . Job ( serviceMockReturnsOptions , new com . google . cloud . bigquery . JobInfo . BuilderImpl ( com . google . cloud . bigquery . TableTest . LOAD_JOB_INFO ) ) ; expect ( bigquery . create ( com . google . cloud . bigquery . TableTest . LOAD_JOB_INFO ) ) . andReturn ( expectedJob ) ; replay ( bigquery ) ; initializeTable ( ) ; com . google . cloud . bigquery . Job job = table . load ( com . google . cloud . bigquery . FormatOptions . json ( ) , "URI" ) ; "<AssertPlaceHolder>" ; } json ( ) { return new com . google . cloud . bigquery . FormatOptions ( com . google . cloud . bigquery . FormatOptions . JSON ) ; }
org . junit . Assert . assertSame ( expectedJob , job )
canGetEvent ( ) { java . lang . String eventId = "e313e0a0-9c1f-11e8-9f6d-3b25765db004" ; com . microsoft . azure . applicationinsights . query . models . EventsResults eventsResult = com . microsoft . azure . applicationinsights . query . ApplicationInsightsDataClientTests . applicationInsightsClient . events ( ) . get ( com . microsoft . azure . applicationinsights . query . ApplicationInsightsDataClientTests . appId , EventType . AVAILABILITY_RESULTS , eventId ) ; "<AssertPlaceHolder>" ; } value ( ) { return this . value ; }
org . junit . Assert . assertNotNull ( eventsResult . value ( ) . get ( 0 ) . id ( ) )
isLastId_freeformTwoItemsAdded_returnsTrueForLastAddedItem ( ) { com . vaadin . v7 . data . util . sqlcontainer . SQLContainer container = new com . vaadin . v7 . data . util . sqlcontainer . SQLContainer ( new com . vaadin . v7 . data . util . sqlcontainer . query . FreeformQuery ( "SELECT<sp>*<sp>FROM<sp>people" , connectionPool , "ID" ) ) ; container . addItem ( ) ; java . lang . Object id2 = container . addItem ( ) ; "<AssertPlaceHolder>" ; } isLastId ( java . lang . Object ) { return lastItemId ( ) . equals ( itemId ) ; }
org . junit . Assert . assertTrue ( container . isLastId ( id2 ) )
xupdateAttributesAndElements ( ) { org . xmldb . api . base . ResourceSet result ; java . lang . String query ; query = "declare<sp>function<sp>local:update-game($game)<sp>{\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "local:update-frames($game),\n" + "<strikes>4</strikes>\n" 7 ) + "<stats>\n" ) + "<strikes>4</strikes>\n" ) + "<strikes>4</strikes>\n" 4 ) + "<attempted>4</attempted>\n" ) + "<strikes>4</strikes>\n" 5 ) + "<strikes>4</strikes>\n" 3 ) + "<strikes>4</strikes>\n" 1 ) + "<strikes>4</strikes>\n" 0 ) + "declare<sp>function<sp>local:update-frames($game)<sp>{\n" ) + "for<sp>$frame<sp>in<sp>$game/frame\n" ) + "return<sp>update<sp>insert<sp>attribute<sp>points<sp>{4}<sp>into<sp>$frame\n" ) + "<strikes>4</strikes>\n" 0 ) + "let<sp>$series<sp>:=<sp>doc(\'bowling.xml\')/series\n" ) + "let<sp>$nul1<sp>:=<sp>for<sp>$game<sp>in<sp>$series/game<sp>return<sp>local:update-game($game)\n" ) + "<strikes>4</strikes>\n" 6 ) ; org . xmldb . api . modules . XPathQueryService service = storeXMLStringAndGetQueryService ( org . exist . xquery . XQueryTest . BOWLING_XML , org . exist . xquery . XQueryTest . bowling ) ; result = service . query ( query ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return model . size ( ) ; }
org . junit . Assert . assertEquals ( ( "<strikes>4</strikes>\n" 2 + query ) , 3 , result . getSize ( ) )
compileAnEmptyProgram ( ) { me . tomassetti . turin . compiler . TurinFile turinFile = emptyProgram ( ) ; java . lang . Compiler instance = new java . lang . Compiler ( new me . tomassetti . turin . resolvers . InFileSymbolResolver ( me . tomassetti . turin . resolvers . jdk . JdkTypeResolver . getInstance ( ) ) , new java . lang . Compiler . Options ( ) ) ; java . util . List < me . tomassetti . turin . classloading . ClassFileDefinition > classFileDefinitions = instance . compile ( turinFile , new me . tomassetti . turin . compiler . MyErrorCollector ( ) ) ; "<AssertPlaceHolder>" ; loadAndInvoke ( classFileDefinitions . get ( 0 ) ) ; } compile ( me . tomassetti . turin . compiler . TurinFile , me . tomassetti . turin . compiler . errorhandling . ErrorCollector ) { ResolverRegistry . INSTANCE . record ( turinFile , resolver ) ; return new me . tomassetti . turin . compiler . Compilation ( resolver , errorCollector ) . compile ( turinFile ) ; }
org . junit . Assert . assertEquals ( 1 , classFileDefinitions . size ( ) )
testAvroRegistered ( ) { org . apache . crunch . types . avro . AvroType < org . apache . avro . util . Utf8 > at = new org . apache . crunch . types . avro . AvroType < org . apache . avro . util . Utf8 > ( org . apache . avro . util . Utf8 . class , org . apache . avro . Schema . create ( Schema . Type . STRING ) , org . apache . crunch . types . NoOpDeepCopier . < org . apache . avro . util . Utf8 > create ( ) ) ; org . apache . crunch . types . avro . Avros . register ( org . apache . avro . util . Utf8 . class , at ) ; "<AssertPlaceHolder>" ; } records ( java . lang . Class ) { if ( org . apache . crunch . types . avro . Avros . EXTENSIONS . containsKey ( clazz ) ) { return ( ( org . apache . crunch . types . avro . AvroType < T > ) ( org . apache . crunch . types . avro . Avros . EXTENSIONS . get ( clazz ) ) ) ; } return org . apache . crunch . types . avro . Avros . containers ( clazz ) ; }
org . junit . Assert . assertEquals ( at , org . apache . crunch . types . avro . Avros . records ( org . apache . avro . util . Utf8 . class ) )
testGeneral ( ) { com . orsoncharts . util . Anchor2D anchor = new com . orsoncharts . util . Anchor2D ( RefPt2D . BOTTOM_LEFT , new com . orsoncharts . graphics3d . Offset2D ( 5.0 , 10.0 ) ) ; java . awt . geom . Point2D pt = anchor . getAnchorPoint ( new java . awt . Rectangle ( 10 , 20 , 30 , 40 ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( new java . awt . geom . Point2D . Double ( 15 , 50 ) , pt )
whenBuildingANonEmptyTourV2_tourReverseIterIteratesOverActivitiesCorrectly ( ) { com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute . Builder routeBuilder = VehicleRoute . Builder . newInstance ( vehicle , driver ) ; routeBuilder . addService ( Service . Builder . newInstance ( "2" ) . addSizeDimension ( 0 , 30 ) . setLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "1" ) ) . build ( ) ) ; com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute route = routeBuilder . build ( ) ; java . util . Iterator < com . graphhopper . jsprit . core . problem . solution . route . activity . TourActivity > iter = route . getTourActivities ( ) . reverseActivityIterator ( ) ; int count = 0 ; while ( iter . hasNext ( ) ) { @ com . graphhopper . jsprit . core . problem . solution . route . SuppressWarnings ( "unused" ) com . graphhopper . jsprit . core . problem . solution . route . activity . TourActivity act = iter . next ( ) ; count ++ ; } "<AssertPlaceHolder>" ; } next ( ) { return null ; }
org . junit . Assert . assertEquals ( 1 , count )
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . change . tracking . model . CTProcess . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "ctProcessId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . change . tracking . model . CTProcess > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testMaxIngestedEventTime ( ) { final org . apache . druid . segment . incremental . IncrementalIndex rtIndex = new org . apache . druid . segment . incremental . IncrementalIndex . Builder ( ) . setSimpleTestingIndexSchema ( new org . apache . druid . query . aggregation . CountAggregatorFactory ( "count" ) ) . setMaxRowCount ( 1000 ) . buildOnheap ( ) ; final org . apache . druid . query . QueryRunner runner = org . apache . druid . query . QueryRunnerTestHelper . makeQueryRunner ( new org . apache . druid . query . datasourcemetadata . DataSourceMetadataQueryRunnerFactory ( new org . apache . druid . query . datasourcemetadata . DataSourceQueryQueryToolChest ( org . apache . druid . query . DefaultGenericQueryMetricsFactory . instance ( ) ) , org . apache . druid . query . QueryRunnerTestHelper . NOOP_QUERYWATCHER ) , new org . apache . druid . segment . IncrementalIndexSegment ( rtIndex , org . apache . druid . timeline . SegmentId . dummy ( "test" ) ) , null ) ; org . joda . time . DateTime timestamp = org . apache . druid . java . util . common . DateTimes . nowUtc ( ) ; rtIndex . add ( new org . apache . druid . data . input . MapBasedInputRow ( timestamp . getMillis ( ) , com . google . common . collect . ImmutableList . of ( "dim1" ) , com . google . common . collect . ImmutableMap . of ( "dim1" , "x" ) ) ) ; org . apache . druid . query . datasourcemetadata . DataSourceMetadataQuery dataSourceMetadataQuery = org . apache . druid . query . Druids . newDataSourceMetadataQueryBuilder ( ) . dataSource ( "testing" ) . build ( ) ; java . util . concurrent . ConcurrentMap < java . lang . String , java . lang . Object > context = new java . util . concurrent . ConcurrentHashMap ( ) ; context . put ( Result . MISSING_SEGMENTS_KEY , new java . util . ArrayList ( ) ) ; java . lang . Iterable < org . apache . druid . query . Result < org . apache . druid . query . datasourcemetadata . DataSourceMetadataResultValue > > results = runner . run ( org . apache . druid . query . QueryPlus . wrap ( dataSourceMetadataQuery ) , context ) . toList ( ) ; org . apache . druid . query . datasourcemetadata . DataSourceMetadataResultValue val = results . iterator ( ) . next ( ) . getValue ( ) ; org . joda . time . DateTime maxIngestedEventTime = val . getMaxIngestedEventTime ( ) ; "<AssertPlaceHolder>" ; } getMaxIngestedEventTime ( ) { return maxIngestedEventTime ; }
org . junit . Assert . assertEquals ( timestamp , maxIngestedEventTime )
testObjectIsAssignableFromNull ( ) { final org . jboss . errai . codegen . meta . MetaClass metaObject = getMetaClass ( java . lang . Object . class ) ; final org . jboss . errai . codegen . meta . MetaClass metaNull = getMetaClass ( org . mvel2 . util . NullType . class ) ; "<AssertPlaceHolder>" ; } isAssignableFrom ( org . jboss . errai . codegen . meta . MetaParameterizedType ) { final org . jboss . errai . codegen . meta . MetaType [ ] compareFrom = org . jboss . errai . common . client . api . Assert . notNull ( fromType ) . getTypeParameters ( ) ; final org . jboss . errai . codegen . meta . MetaType [ ] compareTo = getTypeParameters ( ) ; if ( ( compareTo . length ) != ( compareFrom . length ) ) return false ; for ( int i = 0 ; i < ( compareTo . length ) ; i ++ ) { final org . jboss . errai . codegen . meta . MetaType from = compareFrom [ i ] ; final org . jboss . errai . codegen . meta . MetaType to = compareTo [ i ] ; if ( ( from instanceof org . jboss . errai . codegen . meta . MetaClass ) && ( to instanceof org . jboss . errai . codegen . meta . MetaClass ) ) { if ( ! ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( from ) ) . isAssignableTo ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( to ) ) ) ) ) { return false ; } } else if ( to instanceof org . jboss . errai . codegen . meta . MetaParameterizedType ) { return false ; } else if ( to instanceof org . jboss . errai . codegen . meta . MetaWildcardType ) { if ( from instanceof org . jboss . errai . codegen . meta . MetaClass ) { final org . jboss . errai . codegen . meta . MetaClass fromMC = ( ( org . jboss . errai . codegen . meta . MetaClass ) ( from ) ) ; final boolean violatesUpperBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaWildcardType ) ( to ) ) . getUpperBounds ( ) ) . filter ( ( bound ) -> ! ( fromMC . isAssignableTo ( bound ) ) ) . findAny ( ) . isPresent ( ) ; final boolean violatesLowerBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaWildcardType ) ( to ) ) . getLowerBounds ( ) ) . filter ( ( bound ) -> ! ( bound . isAssignableTo ( fromMC ) ) ) . findAny ( ) . isPresent ( ) ; if ( violatesLowerBound || violatesUpperBound ) { return false ; } } else { return false ; } } else if ( ( from instanceof org . jboss . errai . codegen . meta . MetaTypeVariable ) && ( to instanceof org . jboss . errai . codegen . meta . MetaClass ) ) { final boolean hasAssignableUpperBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaTypeVariable ) ( from ) ) . getBounds ( ) ) . filter ( ( fromBound ) -> fromBound . isAssignableFrom ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( to ) ) ) ) . findAny ( ) . isPresent ( ) ; if ( ! hasAssignableUpperBound ) { return false ; } } } return true ; }
org . junit . Assert . assertTrue ( metaObject . isAssignableFrom ( metaNull ) )
testForEach07 ( ) { final java . util . concurrent . atomic . AtomicInteger callCnt = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; org . stjs . javascript . ArrayForEachTest . ForEachCB < java . lang . Integer > callbackfn = new org . stjs . javascript . ArrayForEachTest . ForEachCB < java . lang . Integer > ( ) { @ org . stjs . javascript . Override public void $invoke ( java . lang . Integer val , java . lang . Long idx , org . stjs . javascript . Array < java . lang . Integer > obj ) { callCnt . incrementAndGet ( ) ; } } ; org . stjs . javascript . Array < java . lang . Integer > arr = new org . stjs . javascript . Array ( 10 ) ; arr . $set ( 1 , null ) ; arr . forEach ( callbackfn ) ; "<AssertPlaceHolder>" ; } get ( ) { return this ; }
org . junit . Assert . assertEquals ( 1 , callCnt . get ( ) )
testPostEmpty ( ) { startServer ( com . sun . jersey . osgi . tests . jetty . HttpMethodTest . HttpMethodResource . class ) ; com . sun . jersey . api . client . WebResource r = createClient ( ) . resource ( getUri ( ) . path ( "test" ) . build ( ) ) ; "<AssertPlaceHolder>" ; } post ( java . lang . String , java . lang . String ) { return foo + bar ; }
org . junit . Assert . assertEquals ( "" , r . post ( java . lang . String . class , "" ) )
testCreateTasksOnAutoCreateSimpleVariableDays ( ) { final com . marand . thinkmed . medications . dto . VariableSimpleTherapyDto therapy = new com . marand . thinkmed . medications . dto . VariableSimpleTherapyDto ( ) ; therapy . setCompositionUid ( "uid1" ) ; therapy . setEhrOrderName ( "1" ) ; therapy . setStart ( new org . joda . time . DateTime ( 2014 , 2 , 4 , 9 , 0 ) ) ; therapy . setEnd ( new org . joda . time . DateTime ( 2014 , 2 , 5 , 20 , 0 ) ) ; therapy . setDosingFrequency ( new com . marand . thinkmed . medications . dto . DosingFrequencyDto ( com . marand . thinkmed . medications . DosingFrequencyTypeEnum . DAILY_COUNT , 2 ) ) ; therapy . setQuantityUnit ( "mg" ) ; therapy . setQuantityDenominatorUnit ( "ml" ) ; therapy . setMedication ( getMedication ( 123L , "Paracetamol" ) ) ; therapy . getTimedDoseElements ( ) . add ( getTimedSimpleDoseElement ( 100.0 , new com . marand . maf . core . data . object . HourMinuteDto ( 9 , 0 ) , new org . joda . time . DateTime ( 2014 , 2 , 4 , 0 , 0 ) ) ) ; therapy . getTimedDoseElements ( ) . add ( getTimedSimpleDoseElement ( 200.0 , new com . marand . maf . core . data . object . HourMinuteDto ( 20 , 0 ) , new org . joda . time . DateTime ( 2014 , 2 , 4 , 0 , 0 ) ) ) ; therapy . getTimedDoseElements ( ) . add ( getTimedSimpleDoseElement ( 300.0 , new com . marand . maf . core . data . object . HourMinuteDto ( 9 , 0 ) , new org . joda . time . DateTime ( 2014 , 2 , 5 , 0 , 0 ) ) ) ; therapy . getTimedDoseElements ( ) . add ( getTimedSimpleDoseElement ( 400.0 , new com . marand . maf . core . data . object . HourMinuteDto ( 20 , 0 ) , new org . joda . time . DateTime ( 2014 , 2 , 5 , 0 , 0 ) ) ) ; final java . util . List < com . marand . thinkmed . process . dto . NewTaskRequestDto > tasks = administrationTaskCreator . createTaskRequests ( "1" , therapy , AdministrationTaskCreateActionEnum . AUTO_CREATE , new org . joda . time . DateTime ( 2014 , 2 , 5 , 1 , 0 ) , new org . joda . time . DateTime ( 2014 , 2 , 5 , 20 , 0 ) ) ; "<AssertPlaceHolder>" ; } getTimedDoseElements ( ) { return timedDoseElements ; }
org . junit . Assert . assertTrue ( tasks . isEmpty ( ) )
size_bicyclo ( ) { int [ ] [ ] bicyclo = org . openscience . cdk . graph . InitialCyclesTest . bicyclo ( ) ; org . openscience . cdk . graph . EdgeShortCycles esc = new org . openscience . cdk . graph . EdgeShortCycles ( bicyclo ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; }
org . junit . Assert . assertThat ( esc . size ( ) , org . hamcrest . CoreMatchers . is ( 3 ) )
testStoreOverwrite ( ) { try { java . util . ArrayList < i5 . las2peer . p2p . PastryNodeImpl > nodes = i5 . las2peer . testing . TestSuite . launchNetwork ( ( ( SharedStorage . DEFAULT_NUM_OF_REPLICAS ) + 1 ) ) ; i5 . las2peer . p2p . PastryNodeImpl firstNode = nodes . get ( 0 ) ; byte [ ] testData = new java . lang . String ( "This<sp>is<sp>las2peer!" ) . getBytes ( StandardCharsets . UTF_8 ) ; byte [ ] hash = i5 . las2peer . tools . CryptoTools . getSecureHash ( testData ) ; firstNode . storeHashedContent ( testData ) ; firstNode . storeHashedContent ( testData ) ; byte [ ] fetched = firstNode . fetchHashedContent ( hash ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . toString ( ) ) ; } } fetchHashedContent ( byte [ ] ) { if ( ! ( hashToData . containsKey ( hash ) ) ) { byte [ ] data = super . fetchHashedContent ( hash ) ; hashToData . put ( hash , data ) ; } return hashToData . get ( hash ) ; }
org . junit . Assert . assertArrayEquals ( testData , fetched )
testConstructor_withMessage ( ) { com . hazelcast . simulator . test . TestException exception = new com . hazelcast . simulator . test . TestException ( "cause" ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; }
org . junit . Assert . assertEquals ( "cause" , exception . getMessage ( ) )
testSpaces ( ) { "<AssertPlaceHolder>" ; } process ( java . io . File ) { return com . github . rjeschke . txtmark . Processor . process ( file , builder . build ( ) ) ; }
org . junit . Assert . assertEquals ( "" , m . process ( "<sp>" ) )
testEncodeMongoDBDatabaseRare ( ) { System . out . println ( ( ( com . telefonica . iot . cygnus . utils . CommonUtilsForTests . getTestTraceHead ( "[NGSICharsets.encodeMongoDBDatabase]" ) ) + "--------<sp>Rare<sp>characters<sp>are<sp>not<sp>encoded" ) ) ; java . lang . String in = "!#%&'()*+,-_:;<>?@[]^`{|}~" ; java . lang . String expected = "!#%&'()*+,-_:;<>?@[]^`{|}~" ; java . lang . String out = com . telefonica . iot . cygnus . utils . NGSICharsets . encodeMongoDBDatabase ( in ) ; try { "<AssertPlaceHolder>" ; System . out . println ( ( ( ( ( com . telefonica . iot . cygnus . utils . CommonUtilsForTests . getTestTraceHead ( "[NGSICharsets.encodeMongoDBDatabase]" ) ) + "-<sp>OK<sp>-<sp>'" ) + in ) + "'<sp>has<sp>not<sp>been<sp>encoded" ) ) ; } catch ( java . lang . AssertionError e ) { System . out . println ( ( ( ( ( ( ( com . telefonica . iot . cygnus . utils . CommonUtilsForTests . getTestTraceHead ( "[NGSICharsets.encodeMongoDBDatabase]" ) ) + "-<sp>FAIL<sp>-<sp>'" ) + in ) + "'<sp>has<sp>been<sp>encoded<sp>as<sp>'" ) + out ) + "'" ) ) ; throw e ; }
org . junit . Assert . assertEquals ( expected , out )
testQueryByInvalidCaseInstanceId ( ) { org . camunda . bpm . engine . runtime . ProcessInstanceQuery query = runtimeService . createProcessInstanceQuery ( ) ; query . caseInstanceId ( "invalid" ) ; "<AssertPlaceHolder>" ; try { query . caseInstanceId ( null ) ; org . junit . Assert . fail ( "The<sp>passed<sp>case<sp>instance<sp>should<sp>not<sp>be<sp>null." ) ; } catch ( java . lang . Exception ignored ) { } } count ( ) { this . resultType = org . camunda . bpm . engine . impl . AbstractNativeQuery . ResultType . COUNT ; if ( ( commandExecutor ) != null ) { return ( ( java . lang . Long ) ( commandExecutor . execute ( this ) ) ) ; } return executeCount ( org . camunda . bpm . engine . impl . context . Context . getCommandContext ( ) , getParameterMap ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , query . count ( ) )
testBadMethod2 ( ) { final org . pac4j . core . matching . HttpMethodMatcher matcher = new org . pac4j . core . matching . HttpMethodMatcher ( HTTP_METHOD . GET , HTTP_METHOD . PUT ) ; final org . pac4j . core . context . MockWebContext context = org . pac4j . core . context . MockWebContext . create ( ) . setRequestMethod ( HTTP_METHOD . POST . name ( ) ) ; "<AssertPlaceHolder>" ; } matches ( org . pac4j . core . context . WebContext ) { org . pac4j . core . util . CommonHelper . assertNotNull ( "methods" , methods ) ; final java . lang . String requestMethod = context . getRequestMethod ( ) ; for ( final org . pac4j . core . matching . HTTP_METHOD method : methods ) { if ( method . name ( ) . equalsIgnoreCase ( requestMethod ) ) { return true ; } } return false ; }
org . junit . Assert . assertFalse ( matcher . matches ( context ) )
testGetParametersWithDisabledDEtauls ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String abbrName = "abbrName" ; java . lang . String name = "name" ; org . lnu . is . domain . asset . type . AssetType entity = new org . lnu . is . domain . asset . type . AssetType ( ) ; entity . setAbbrName ( abbrName ) ; entity . setName ( name ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "abbrName" , abbrName ) ; expected . put ( "name" , name ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
org . junit . Assert . assertEquals ( expected , actual )
testSerializability ( ) { org . hibernate . search . backend . spi . LuceneIndexingParameters param = new org . hibernate . search . backend . spi . LuceneIndexingParameters ( new java . util . Properties ( ) ) ; org . hibernate . search . backend . spi . LuceneIndexingParameters paramCopy = ( ( org . hibernate . search . backend . spi . LuceneIndexingParameters ) ( org . hibernate . search . testsupport . serialization . SerializationTestHelper . duplicateBySerialization ( param ) ) ) ; "<AssertPlaceHolder>" ; } getIndexParameters ( ) { return indexParameters ; }
org . junit . Assert . assertEquals ( param . getIndexParameters ( ) , paramCopy . getIndexParameters ( ) )
testQuartzCompatibilityIfDoYisQuestionMark ( ) { final com . cronutils . model . time . ExecutionTime executionTime = com . cronutils . model . time . ExecutionTime . forCron ( parser . parse ( com . cronutils . model . time . ExecutionTimeQuartzWithDayOfYearExtensionIntegrationTest . WITHOUT_SPECIFIC_DAY_OF_YEAR ) ) ; final com . cronutils . model . time . ExecutionTime quartzExecutionTime = com . cronutils . model . time . ExecutionTime . forCron ( quartzParser . parse ( com . cronutils . model . time . ExecutionTimeQuartzWithDayOfYearExtensionIntegrationTest . WITHOUT_DAY_OF_YEAR ) ) ; java . time . ZonedDateTime start = java . time . ZonedDateTime . of ( 2017 , 1 , 1 , 0 , 0 , 0 , 0 , com . cronutils . model . time . UTC ) . minusSeconds ( 1 ) ; for ( int i = 0 ; i < 12 ; i ++ ) { final java . util . Optional < java . time . ZonedDateTime > nextQuartzExecution = quartzExecutionTime . nextExecution ( start ) ; final java . util . Optional < java . time . ZonedDateTime > nextExecution = executionTime . nextExecution ( start ) ; if ( ( nextQuartzExecution . isPresent ( ) ) && ( nextExecution . isPresent ( ) ) ) { final java . time . ZonedDateTime expectedDateTime = nextQuartzExecution . get ( ) ; "<AssertPlaceHolder>" ; start = expectedDateTime . plusSeconds ( 1 ) ; } else { org . junit . Assert . fail ( "one<sp>of<sp>the<sp>asserted<sp>executions<sp>was<sp>not<sp>present" ) ; } } } nextExecution ( java . time . ZonedDateTime ) { com . cronutils . utils . Preconditions . checkNotNull ( date ) ; try { java . time . ZonedDateTime nextMatch = nextClosestMatch ( date ) ; if ( nextMatch . equals ( date ) ) { nextMatch = nextClosestMatch ( date . plusSeconds ( 1 ) ) ; } return java . util . Optional . of ( nextMatch ) ; } catch ( final com . cronutils . model . time . generator . NoSuchValueException e ) { return java . util . Optional . empty ( ) ; } }
org . junit . Assert . assertEquals ( expectedDateTime , nextExecution . get ( ) )
test ( ) { org . springframework . cloud . deployer . resource . support . DelegatingResourceLoader delegatingResourceLoader = new org . springframework . cloud . deployer . resource . support . DelegatingResourceLoader ( ) ; org . springframework . core . io . Resource resource = delegatingResourceLoader . getResource ( "https://repo.spring.io/libs-release/org/springframework/cloud/stream/app/file-sink-rabbit/1.2.0.RELEASE/file-sink-rabbit-1.2.0.RELEASE.jar" ) ; java . io . File file1 = resource . getFile ( ) ; java . io . File file2 = resource . getFile ( ) ; "<AssertPlaceHolder>" ; } getFile ( ) { return resolver . resolve ( this ) . getFile ( ) ; }
org . junit . Assert . assertThat ( file1 , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( file2 ) ) )
initFromClassCollectionNotAnnotated ( ) { java . util . Set < java . lang . Class < ? > > annotatedClassesAndMore = new java . util . HashSet < java . lang . Class < ? > > ( org . apache . olingo . odata2 . annotation . processor . core . datasource . AnnotationsInMemoryDsTest . ANNOTATED_ENTITY_SET_CLASSES ) ; annotatedClassesAndMore . add ( java . lang . String . class ) ; annotatedClassesAndMore . add ( java . lang . Object . class ) ; org . apache . olingo . odata2 . annotation . processor . core . datasource . AnnotationInMemoryDs ds = new org . apache . olingo . odata2 . annotation . processor . core . datasource . AnnotationInMemoryDs ( annotatedClassesAndMore , false ) ; "<AssertPlaceHolder>" ; } add ( org . apache . olingo . odata2 . api . processor . ODataContext . RuntimeMeasurement ) { if ( ( ( ( timeStarted ) <= ( runtimeMeasurement . getTimeStarted ( ) ) ) && ( ( timeStopped ) != 0 ) ) && ( ( timeStopped ) >= ( runtimeMeasurement . getTimeStopped ( ) ) ) ) { for ( org . apache . olingo . odata2 . core . debug . DebugInfoRuntime . RuntimeNode candidate : children ) { if ( candidate . add ( runtimeMeasurement ) ) { return true ; } } children . add ( new org . apache . olingo . odata2 . core . debug . DebugInfoRuntime . RuntimeNode ( runtimeMeasurement ) ) ; return true ; } else { return false ; } }
org . junit . Assert . assertNotNull ( ds )
testBuildWithEmptyFieldsWithOrderBy ( ) { org . lnu . is . domain . asset . address . AssetAddress context = new org . lnu . is . domain . asset . address . AssetAddress ( ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "zipcode" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "street" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy3 = new org . lnu . is . pagination . OrderBy ( "house" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy4 = new org . lnu . is . pagination . OrderBy ( "apartment" , 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 expected = "SELECT<sp>e<sp>FROM<sp>AssetAddress<sp>e<sp>WHERE<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>ORDER<sp>BY<sp>e.zipcode<sp>ASC,<sp>e.street<sp>DESC,<sp>e.house<sp>ASC,<sp>e.apartment<sp>DESC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . asset . address . AssetAddress > 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 ( expected , actualQuery )
testToFloatPrimitiveFromFloat ( ) { java . lang . Object result = com . orientechnologies . orient . core . metadata . schema . OType . convert ( 10.65F , Float . TYPE ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . Object , java . lang . Class ) { if ( iValue == null ) return null ; if ( iTargetClass == null ) return iValue ; if ( iValue . getClass ( ) . equals ( iTargetClass ) ) return iValue ; if ( iTargetClass . isAssignableFrom ( iValue . getClass ( ) ) ) return iValue ; try { if ( ( iValue instanceof com . orientechnologies . common . types . OBinary ) && ( iTargetClass . isAssignableFrom ( byte [ ] . class ) ) ) return ( ( com . orientechnologies . common . types . OBinary ) ( iValue ) ) . toByteArray ( ) ; else if ( byte [ ] . class . isAssignableFrom ( iTargetClass ) ) { return com . orientechnologies . orient . core . serialization . serializer . OStringSerializerHelper . getBinaryContent ( iValue ) ; } else if ( byte [ ] . class . isAssignableFrom ( iValue . getClass ( ) ) ) { return iValue ; } else if ( iTargetClass . isEnum ( ) ) { if ( iValue instanceof java . lang . Number ) return ( ( java . lang . Class < java . lang . Enum > ) ( iTargetClass ) ) . getEnumConstants ( ) [ ( ( java . lang . Number ) ( iValue ) ) . intValue ( ) ] ; return java . lang . Enum . valueOf ( ( ( java . lang . Class < java . lang . Enum > ) ( iTargetClass ) ) , iValue . toString ( ) ) ; } else if ( ( iTargetClass . equals ( Byte . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Byte . class ) ) ) { if ( iValue instanceof java . lang . Byte ) return iValue ; else if ( iValue instanceof java . lang . String ) return java . lang . Byte . parseByte ( ( ( java . lang . String ) ( iValue ) ) ) ; else return ( ( java . lang . Number ) ( iValue ) ) . byteValue ( ) ; } else if ( ( iTargetClass . equals ( Short . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Short . class ) ) ) { if ( iValue instanceof java . lang . Short ) return iValue ; else if ( iValue instanceof java . lang . String ) return java . lang . Short . parseShort ( ( ( java . lang . String ) ( iValue ) ) ) ; else return ( ( java . lang . Number ) ( iValue ) ) . shortValue ( ) ; } else if ( ( iTargetClass . equals ( Integer . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Integer . class ) ) ) { if ( iValue instanceof java . lang . Integer ) return iValue ; else if ( iValue instanceof java . lang . String ) { if ( iValue . toString ( ) . equals ( "" ) ) { return null ; } return java . lang . Integer . parseInt ( ( ( java . lang . String ) ( iValue ) ) ) ; } else return ( ( java . lang . Number ) ( iValue ) ) . intValue ( ) ; } else if ( ( iTargetClass . equals ( Long . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Long . class ) ) ) { if ( iValue instanceof java . lang . Long ) return iValue ; else if ( iValue instanceof java . lang . String ) return java . lang . Long . parseLong ( ( ( java . lang . String ) ( iValue ) ) ) ; else if ( iValue instanceof java . util . Date ) return ( ( java . util . Date ) ( iValue ) ) . getTime ( ) ; else return ( ( java . lang . Number ) ( iValue ) ) . longValue ( ) ; } else if ( ( iTargetClass . equals ( Float . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Float . class ) ) ) { if ( iValue instanceof java . lang . Float ) return iValue ; else if ( iValue instanceof java . lang . String ) return java . lang . Float . parseFloat ( ( ( java . lang . String ) ( iValue ) ) ) ; else return ( ( java . lang . Number ) ( iValue ) ) . floatValue ( ) ; } else if ( iTargetClass . equals ( java . math . BigDecimal . class ) ) { if ( iValue instanceof java . lang . String ) return new java . math . BigDecimal ( ( ( java . lang . String ) ( iValue ) ) ) ; else if ( iValue instanceof java . lang . Number ) return new java . math . BigDecimal ( iValue . toString ( ) ) ; } else if ( ( iTargetClass . equals ( Double . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Double . class ) )
org . junit . Assert . assertEquals ( result , 10.65F )
testActivateAlreadyActiveProcessDefinition ( ) { org . flowable . engine . repository . ProcessDefinition processDefinition = repositoryService . createProcessDefinitionQuery ( ) . singleResult ( ) ; "<AssertPlaceHolder>" ; com . fasterxml . jackson . databind . node . ObjectNode requestNode = objectMapper . createObjectNode ( ) ; requestNode . put ( "action" , "activate" ) ; org . apache . http . client . methods . HttpPut httpPut = new org . apache . http . client . methods . HttpPut ( ( ( SERVER_URL_PREFIX ) + ( org . flowable . rest . service . api . RestUrls . createRelativeResourceUrl ( RestUrls . URL_PROCESS_DEFINITION , processDefinition . getId ( ) ) ) ) ) ; httpPut . setEntity ( new org . apache . http . entity . StringEntity ( requestNode . toString ( ) ) ) ; org . apache . http . client . methods . CloseableHttpResponse response = executeRequest ( httpPut , HttpStatus . SC_CONFLICT ) ; closeResponse ( response ) ; } isSuspended ( ) { return ( suspensionState ) == ( SuspensionState . SUSPENDED . getStateCode ( ) ) ; }
org . junit . Assert . assertFalse ( processDefinition . isSuspended ( ) )
testIsSubProject3 ( ) { java . io . File build = root . newFile ( "build.gradle" ) ; java . io . File settings = root . newFile ( "settings.gradle" ) ; java . io . File module = root . newFolder ( "module" ) ; java . nio . file . Files . write ( settings . toPath ( ) , java . util . Arrays . asList ( "include<sp>':module2'" ) ) ; org . netbeans . modules . gradle . spi . GradleFiles gf = new org . netbeans . modules . gradle . spi . GradleFiles ( module ) ; "<AssertPlaceHolder>" ; } isSubProject ( ) { return ( isProject ( ) ) && ( ! ( isRootProject ( ) ) ) ; }
org . junit . Assert . assertFalse ( gf . isSubProject ( ) )
returnsNullWhenNoShroudAround ( ) { "<AssertPlaceHolder>" ; } getFacing ( boolean , boolean , boolean , boolean ) { int value = 0 ; value |= ( isTopSame ) ? com . fundynamic . d2tm . game . map . MapEditor . BIT_MASK_TOP : com . fundynamic . d2tm . game . map . MapEditor . BIT_MASK_NONE ; value |= ( isRightSame ) ? com . fundynamic . d2tm . game . map . MapEditor . BIT_MASK_RIGHT : com . fundynamic . d2tm . game . map . MapEditor . BIT_MASK_NONE ; value |= ( isBottomSame ) ? com . fundynamic . d2tm . game . map . MapEditor . BIT_MASK_BOTTOM : com . fundynamic . d2tm . game . map . MapEditor . BIT_MASK_NONE ; value |= ( isLeftSame ) ? com . fundynamic . d2tm . game . map . MapEditor . BIT_MASK_LEFT : com . fundynamic . d2tm . game . map . MapEditor . BIT_MASK_NONE ; return com . fundynamic . d2tm . game . map . MapEditor . FACINGS [ value ] ; }
org . junit . Assert . assertNull ( getFacing ( false , false , false , false ) )
isWatching ( ) { group = new org . bitcoinj . wallet . KeyChainGroup ( org . bitcoinj . wallet . KeyChainGroupTest . PARAMS , org . bitcoinj . wallet . DeterministicKey . deserializeB58 ( "xpub69bjfJ91ikC5ghsqsVDHNq2dRGaV2HHVx7Y9LXi27LN9BWWAXPTQr4u8U3wAtap8bLdHdkqPpAcZmhMS5SnrMQC4ccaoBccFhh315P4UYzo" , org . bitcoinj . wallet . KeyChainGroupTest . PARAMS ) ) ; final org . bitcoinj . wallet . ECKey watchingKey = org . bitcoinj . wallet . ECKey . fromPublicOnly ( new org . bitcoinj . wallet . ECKey ( ) . getPubKeyPoint ( ) ) ; group . importKeys ( watchingKey ) ; "<AssertPlaceHolder>" ; } isWatching ( ) { keyChainGroupLock . lock ( ) ; try { maybeUpgradeToHD ( ) ; return keyChainGroup . isWatching ( ) ; } finally { keyChainGroupLock . unlock ( ) ; } }
org . junit . Assert . assertTrue ( group . isWatching ( ) )
test_rollAdd ( ) { com . baeldung . gregorian . calendar . GregorianCalendarExample calendarDemo = new com . baeldung . gregorian . calendar . GregorianCalendarExample ( ) ; java . util . GregorianCalendar calendarActual = new java . util . GregorianCalendar ( 2018 , 6 , 28 ) ; java . util . GregorianCalendar calendarExpected = new java . util . GregorianCalendar ( 2018 , 6 , 28 ) ; calendarExpected . roll ( Calendar . MONTH , 8 ) ; java . util . Date expectedDate = calendarExpected . getTime ( ) ; "<AssertPlaceHolder>" ; } rollAdd ( java . util . GregorianCalendar , int ) { calendar . roll ( GregorianCalendar . MONTH , amount ) ; return calendar . getTime ( ) ; }
org . junit . Assert . assertEquals ( expectedDate , calendarDemo . rollAdd ( calendarActual , 8 ) )
treeMenuLeafs ( ) { java . util . List < ? extends org . geosdi . geoplatform . gui . configuration . GPMenuGenericTool > tools = gpTreeMenuStore . getTools ( new org . geosdi . geoplatform . gui . configuration . composite . menu . store . MultiSelectionCompositeKey ( org . geosdi . geoplatform . gui . configuration . composite . menu . MultiSelectionElementType . ONLY_LEAF ) ) ; "<AssertPlaceHolder>" ; logger . info ( "LEAFS<sp>TREE<sp>MENU<sp>@@@@@@@@@@@@@@@@@@@@@@@@@@<sp>\n\n<sp>{}<sp>\n" , tools ) ; } size ( ) { return list . size ( ) ; }
org . junit . Assert . assertEquals ( 2 , tools . size ( ) )
testConvertWithRelation ( ) { java . lang . String name = "1234" ; java . lang . String abbrName = "abbrName" ; java . lang . Long parentId = 1L ; org . lnu . is . domain . enrolment . type . EnrolmentType parent = new org . lnu . is . domain . enrolment . type . EnrolmentType ( ) ; parent . setId ( parentId ) ; org . lnu . is . domain . enrolment . type . EnrolmentType source = new org . lnu . is . domain . enrolment . type . EnrolmentType ( ) ; source . setName ( name ) ; source . setAbbrName ( abbrName ) ; source . setParent ( parent ) ; org . lnu . is . resource . enrolment . type . EnrolmentTypeResource expected = new org . lnu . is . resource . enrolment . type . EnrolmentTypeResource ( ) ; expected . setName ( name ) ; expected . setAbbrName ( abbrName ) ; expected . setParentId ( parentId ) ; org . lnu . is . resource . enrolment . type . EnrolmentTypeResource actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetStatementGroup ( ) { org . wikidata . wdtk . datamodel . helpers . Statement s = org . wikidata . wdtk . datamodel . helpers . Datamodel . makeStatement ( factory . getItemIdValue ( "Q42" , "foo" ) , factory . getNoValueSnak ( factory . getPropertyIdValue ( "P42" , "foo" ) ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , StatementRank . NORMAL , "MyId" ) ; org . wikidata . wdtk . datamodel . helpers . StatementGroup o1 = org . wikidata . wdtk . datamodel . helpers . Datamodel . makeStatementGroup ( java . util . Collections . singletonList ( s ) ) ; org . wikidata . wdtk . datamodel . helpers . StatementGroup o2 = factory . getStatementGroup ( java . util . Collections . singletonList ( s ) ) ; "<AssertPlaceHolder>" ; } getStatementGroup ( java . util . List ) { return new org . wikidata . wdtk . datamodel . implementation . StatementGroupImpl ( statements ) ; }
org . junit . Assert . assertEquals ( o1 , o2 )
testListJobs ( ) { when ( jobLocator . getJobNames ( ) ) . thenReturn ( java . util . Arrays . asList ( "job1" , "job2" ) ) ; "<AssertPlaceHolder>" ; } listJobs ( int , int ) { java . util . Collection < java . lang . String > jobNames = new java . util . LinkedHashSet < java . lang . String > ( jobLocator . getJobNames ( ) ) ; jobNames . addAll ( getJsrJobNames ( ) ) ; if ( ( start + count ) > ( jobNames . size ( ) ) ) { jobNames . addAll ( jobInstanceDao . getJobNames ( ) ) ; } if ( start >= ( jobNames . size ( ) ) ) { start = jobNames . size ( ) ; } if ( ( start + count ) >= ( jobNames . size ( ) ) ) { count = ( jobNames . size ( ) ) - start ; } return new java . util . ArrayList < java . lang . String > ( jobNames ) . subList ( start , ( start + count ) ) ; }
org . junit . Assert . assertEquals ( 2 , service . listJobs ( 0 , 2 ) . size ( ) )
testGetDefaultSequenceGenerator ( ) { "<AssertPlaceHolder>" ; } getDefaultSequenceGenerator ( ) { return org . seasar . extension . jdbc . gen . internal . util . AnnotationUtil . DEFAULT_SEQUENCE_GENERATOR ; }
org . junit . Assert . assertNotNull ( org . seasar . extension . jdbc . gen . internal . util . AnnotationUtil . getDefaultSequenceGenerator ( ) )
disabledComponent_fireAlwaysEnabledDomEvent_listenerReceivesEvent ( ) { com . vaadin . flow . component . ComponentTest . TestDiv div = new com . vaadin . flow . component . ComponentTest . TestDiv ( ) ; div . getElement ( ) . setEnabled ( false ) ; java . util . concurrent . atomic . AtomicInteger count = new java . util . concurrent . atomic . AtomicInteger ( ) ; div . addListener ( com . vaadin . flow . component . ComponentTest . EnabledDomEvent . class , ( event ) -> count . incrementAndGet ( ) ) ; div . getElement ( ) . getNode ( ) . getFeature ( com . vaadin . flow . internal . nodefeature . ElementListenerMap . class ) . fireEvent ( createEvent ( "foo" , div ) ) ; "<AssertPlaceHolder>" ; } get ( ) { return com . vaadin . flow . dom . impl . BasicTextElementStateProvider . INSTANCE ; }
org . junit . Assert . assertEquals ( 1 , count . get ( ) )
testRemoveNotificationsByKeyHash ( ) { java . nio . ByteBuffer epKeyHash = java . nio . ByteBuffer . wrap ( generateBytes ( ) ) ; generateEndpointNotification ( epKeyHash , 3 ) ; unicastNotificationDao . removeNotificationsByKeyHash ( epKeyHash . array ( ) ) ; java . util . List < org . kaaproject . kaa . server . common . nosql . cassandra . dao . model . CassandraEndpointNotification > found = unicastNotificationDao . findNotificationsByKeyHash ( epKeyHash . array ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return rawSchema . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( found . isEmpty ( ) )
itShouldAllowToAddOptionalPropertyGroupName ( ) { java . lang . String expectedProperty = "Property<sp>[propertyName=delimiter,<sp>propertyRenderer=TEXT,<sp>propertyGroup=TextProperties,<sp>propertySubGroup=GENERAL,<sp>propertyDataType=String,<sp>propertyType=USER,<sp>propertyListeners=[]]" ; hydrograph . ui . propertywindow . property . Property property = new hydrograph . ui . propertywindow . property . Property . Builder ( "String" , "delimiter" , "TEXT" ) . group ( "TextProperties" ) . build ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; builder . append ( "LookupPropertyGrid<sp>[lookupMapProperties=" ) ; builder . append ( lookupMapProperties ) ; builder . append ( ",<sp>lookupInputProperties=" ) ; builder . append ( lookupInputProperties ) ; builder . append ( ",<sp>filterList=" ) ; builder . append ( "]" ) ; return builder . toString ( ) ; }
org . junit . Assert . assertEquals ( expectedProperty , property . toString ( ) )
endsWith ( ) { java . nio . file . Path rootPath = java . nio . file . Paths . get ( hdfs . jsr203 . TestPath . clusterUri ) ; java . nio . file . Path p = rootPath . resolve ( "tmp/testNormalize/test" ) ; "<AssertPlaceHolder>" ; } endsWith ( java . nio . file . Path ) { final hdfs . jsr203 . HadoopPath o = checkPath ( other ) ; int olast = ( o . path . length ) - 1 ; if ( ( olast > 0 ) && ( ( o . path [ olast ] ) == '/' ) ) { olast -- ; } int last = ( this . path . length ) - 1 ; if ( ( last > 0 ) && ( ( this . path [ last ] ) == '/' ) ) last -- ; if ( olast == ( - 1 ) ) return last == ( - 1 ) ; if ( ( ( o . isAbsolute ( ) ) && ( ( ! ( this . isAbsolute ( ) ) ) || ( olast != last ) ) ) || ( last < olast ) ) return false ; for ( ; olast >= 0 ; olast -- , last -- ) { if ( ( o . path [ olast ] ) != ( this . path [ last ] ) ) { return false ; } } return ( ( ( o . path [ ( olast + 1 ) ] ) == '/' ) || ( last == ( - 1 ) ) ) || ( ( this . path [ last ] ) == '/' ) ; }
org . junit . Assert . assertTrue ( p . endsWith ( "test" ) )
testProcessFormFieldValueDifferentValueAndResult ( ) { when ( requestDataValueProcessor . processFormFieldValue ( any ( javax . servlet . http . HttpServletRequest . class ) , anyString ( ) , anyString ( ) , anyString ( ) ) ) . thenReturn ( "other_value" ) ; java . lang . String result = compositeRequestDataValueProcessor . processFormFieldValue ( request , "" , "value" , "" ) ; "<AssertPlaceHolder>" ; } processFormFieldValue ( javax . servlet . http . HttpServletRequest , java . lang . String , java . lang . String , java . lang . String ) { return value ; }
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( "other_value" ) )
testGetValue_0args ( ) { System . out . println ( "getValue" ) ; kg . apc . jmeter . dbmon . DbMonSampleResult instance = new kg . apc . jmeter . dbmon . DbMonSampleResult ( ) ; instance . setResponseMessage ( "0" ) ; double expResult = 0.0 ; double result = instance . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return getPropertyAsString ( kg . apc . jmeter . modifiers . FifoPutPostProcessor . VALUE ) ; }
org . junit . Assert . assertEquals ( expResult , result , 0.0 )
testJATSync2 ( ) { final java . util . concurrent . atomic . AtomicBoolean ok = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; org . jrebirth . af . core . concurrent . JRebirth . run ( RunType . JAT_SYNC , "JAT_Sync<sp>test<sp>2" , ( ) -> { org . jrebirth . af . core . concurrent . ThreadTest . LOGGER . info ( ( "Running<sp>into<sp>" + ( java . lang . Thread . currentThread ( ) . getName ( ) ) ) ) ; ok . set ( org . jrebirth . af . core . concurrent . JRebirth . isJAT ( ) ) ; } ) ; "<AssertPlaceHolder>" ; } get ( ) { return builder ( ) . get ( this ) ; }
org . junit . Assert . assertEquals ( true , ok . get ( ) )
addingUpdatesAtPathWorks ( ) { com . google . firebase . database . core . CompoundWrite compoundWrite = com . google . firebase . database . core . CompoundWrite . emptyWrite ( ) ; final java . util . Map < java . lang . String , java . lang . Object > base = new com . google . firebase . database . MapBuilder ( ) . put ( "child-1" , "value-1" ) . put ( "child-2" , "value-2" ) . build ( ) ; java . util . Map < com . google . firebase . database . snapshot . ChildKey , com . google . firebase . database . snapshot . Node > updates = new java . util . HashMap ( ) ; updates . put ( com . google . firebase . database . snapshot . ChildKey . fromString ( "foo" ) , com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( "foo-value" ) ) ; updates . put ( com . google . firebase . database . snapshot . ChildKey . fromString ( "bar" ) , com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( "bar-value" ) ) ; compoundWrite = compoundWrite . addWrites ( new com . google . firebase . database . core . Path ( "child-1" ) , com . google . firebase . database . core . CompoundWrite . fromChildMerge ( updates ) ) ; com . google . firebase . database . snapshot . Node baseNode = com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( base ) ; java . util . Map < java . lang . String , java . lang . Object > expectedChildOne = new com . google . firebase . database . MapBuilder ( ) . put ( "foo" , "foo-value" ) . put ( "bar" , "bar-value" ) . build ( ) ; com . google . firebase . database . snapshot . Node expected = baseNode . updateImmediateChild ( com . google . firebase . database . snapshot . ChildKey . fromString ( "child-1" ) , com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( expectedChildOne ) ) ; "<AssertPlaceHolder>" ; } apply ( com . google . firebase . database . snapshot . Node ) { return applySubtreeWrite ( com . google . firebase . database . core . Path . getEmptyPath ( ) , this . writeTree , node ) ; }
org . junit . Assert . assertEquals ( expected , compoundWrite . apply ( baseNode ) )
testReadEntryRequestInvalidMapping ( ) { org . apache . olingo . odata2 . client . core . ep . deserializer . XmlEntityDeserializer xec = new org . apache . olingo . odata2 . client . core . ep . deserializer . XmlEntityDeserializer ( ) ; org . apache . olingo . odata2 . api . edm . EdmEntitySet entitySet = org . apache . olingo . odata2 . testutil . mock . MockFacade . getMockEdm ( ) . getDefaultEntityContainer ( ) . getEntitySet ( "Employees" ) ; java . io . InputStream content = createContentAsStream ( org . apache . olingo . odata2 . client . core . ep . deserializer . XmlEntityDeserializerTest . EMPLOYEE_1_XML ) ; org . apache . olingo . odata2 . client . api . ep . EntityStream stream = new org . apache . olingo . odata2 . client . api . ep . EntityStream ( ) ; stream . setContent ( content ) ; stream . setReadProperties ( org . apache . olingo . odata2 . client . api . ep . DeserializerProperties . init ( ) . addTypeMappings ( createTypeMappings ( "EmployeeName" , org . apache . olingo . odata2 . client . core . ep . deserializer . Integer . class ) ) . build ( ) ) ; org . apache . olingo . odata2 . api . ep . entry . ODataEntry result = xec . readEntry ( entitySet , stream ) ; java . util . Map < java . lang . String , java . lang . Object > properties = result . getProperties ( ) ; "<AssertPlaceHolder>" ; } getProperties ( ) { return properties ; }
org . junit . Assert . assertEquals ( 9 , properties . size ( ) )
testEncodeSecondTransformation ( ) { java . lang . String encodedString = org . apache . johnzon . core . JsonPointerUtil . encode ( "/" ) ; "<AssertPlaceHolder>" ; } encode ( java . lang . String ) { if ( ( s == null ) || ( ( s . length ( ) ) == 0 ) ) { return s ; } return s . replace ( "~" , "~0" ) . replace ( "/" , "~1" ) ; }
org . junit . Assert . assertEquals ( "~1" , encodedString )
testRunManyClients ( ) { executor . execute ( runner ) ; int count = 10 ; while ( ( count -- ) > 0 ) { ch . qos . logback . core . net . server . MockClient client = new ch . qos . logback . core . net . server . MockClient ( ) ; listener . addClient ( client ) ; int retries = ( ch . qos . logback . core . net . server . ConcurrentServerRunnerTest . DELAY ) / ( ch . qos . logback . core . net . server . ConcurrentServerRunnerTest . SHORT_DELAY ) ; synchronized ( client ) { while ( ( ( retries -- ) > 0 ) && ( ! ( client . isRunning ( ) ) ) ) { client . wait ( ch . qos . logback . core . net . server . ConcurrentServerRunnerTest . SHORT_DELAY ) ; } } "<AssertPlaceHolder>" ; } runner . stop ( ) ; } awaitRunState ( boolean , long ) { lock . lock ( ) ; try { while ( ( isRunning ( ) ) != state ) { runningCondition . await ( delay , TimeUnit . MILLISECONDS ) ; } return isRunning ( ) ; } finally { lock . unlock ( ) ; } }
org . junit . Assert . assertTrue ( runner . awaitRunState ( true , ch . qos . logback . core . net . server . ConcurrentServerRunnerTest . DELAY ) )
test_getDecimalPlaces_JPY ( ) { org . joda . money . CurrencyUnit test = org . joda . money . CurrencyUnit . of ( "JPY" ) ; "<AssertPlaceHolder>" ; } getDecimalPlaces ( ) { return ( decimalPlaces ) < 0 ? 0 : decimalPlaces ; }
org . junit . Assert . assertEquals ( 0 , test . getDecimalPlaces ( ) )
additionalTags ( ) { org . jmxtrans . agent . influxdb . InfluxMetric converted = org . jmxtrans . agent . influxdb . InfluxMetricConverter . convertToInfluxMetric ( "foo,tag1=tagValue1" , 1 , java . util . Arrays . asList ( new org . jmxtrans . agent . influxdb . InfluxTag ( "additionalTag" , "value" ) ) , 2L ) ; org . jmxtrans . agent . influxdb . InfluxMetric expected = new org . jmxtrans . agent . influxdb . InfluxMetric ( "foo" , java . util . Arrays . asList ( new org . jmxtrans . agent . influxdb . InfluxTag ( "additionalTag" , "value" ) , new org . jmxtrans . agent . influxdb . InfluxTag ( "tag1" , "tagValue1" ) ) , 1 , 2L ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertThat ( converted , equalTo ( expected ) )
testTrainC_ClassificationDataSet_ExecutorService ( ) { System . out . println ( "trainC" ) ; for ( jsat . classifiers . linear . kernelized . CSKLR . UpdateMode mode : CSKLR . UpdateMode . values ( ) ) { jsat . classifiers . linear . kernelized . CSKLR instance = new jsat . classifiers . linear . kernelized . CSKLR ( 0.5 , new jsat . distributions . kernels . RBFKernel ( 0.5 ) , 10 , mode ) ; instance . setMode ( mode ) ; jsat . classifiers . ClassificationDataSet train = jsat . FixedProblems . getInnerOuterCircle ( 200 , jsat . utils . random . RandomUtil . getRandom ( ) ) ; jsat . classifiers . ClassificationDataSet test = jsat . FixedProblems . getInnerOuterCircle ( 100 , jsat . utils . random . RandomUtil . getRandom ( ) ) ; jsat . classifiers . ClassificationModelEvaluation cme = new jsat . classifiers . ClassificationModelEvaluation ( instance , train , true ) ; cme . evaluateTestSet ( test ) ; "<AssertPlaceHolder>" ; } } getErrorRate ( ) { return 1.0 - ( ( getCorrectWeights ( ) ) / ( sumOfWeights ) ) ; }
org . junit . Assert . assertEquals ( 0 , cme . getErrorRate ( ) , 0.0 )
testConfigureVRRP ( ) { org . opennaas . extensions . router . capability . vrrp . IVRRPCapability vrrpCapability = ( ( org . opennaas . extensions . router . capability . vrrp . IVRRPCapability ) ( routerResource . getCapability ( org . opennaas . itests . helpers . InitializerTestHelper . getCapabilityInformation ( TestsConstants . VRRP_CAPABILITY_TYPE ) ) ) ) ; vrrpCapability . configureVRRP ( ( ( org . opennaas . extensions . router . model . VRRPProtocolEndpoint ) ( org . opennaas . itests . router . helpers . ParamCreationHelper . newParamsVRRPGroupWithOneEndpoint ( "192.168.1.1" , "fe-0/3/2" , "192.168.1.100" , "255.255.255.0" ) . getProtocolEndpoint ( ) . get ( 0 ) ) ) ) ; org . opennaas . extensions . queuemanager . IQueueManagerCapability queueCapability = ( ( org . opennaas . extensions . queuemanager . IQueueManagerCapability ) ( routerResource . getCapability ( org . opennaas . itests . helpers . InitializerTestHelper . getCapabilityInformation ( TestsConstants . QUEUE_CAPABILIY_TYPE ) ) ) ) ; org . opennaas . core . resources . queue . QueueResponse queueResponse = ( ( org . opennaas . core . resources . queue . QueueResponse ) ( queueCapability . execute ( ) ) ) ; "<AssertPlaceHolder>" ; stopResource ( ) ; } isOk ( ) { for ( org . opennaas . core . resources . action . ActionResponse action : responses ) { if ( ( action . getStatus ( ) ) == ( org . opennaas . core . resources . action . ActionResponse . STATUS . ERROR ) ) return false ; } return ( getConfirmResponse ( ) . getStatus ( ) . equals ( STATUS . OK ) ) && ( getRefreshResponse ( ) . getStatus ( ) . equals ( STATUS . OK ) ) ; }
org . junit . Assert . assertTrue ( queueResponse . isOk ( ) )
checkISBNAndCaseNormalized ( ) { org . orcid . jaxb . model . v3 . rc2 . record . ExternalID normed = new org . orcid . jaxb . model . v3 . rc2 . record . ExternalID ( ) ; normed . setRelationship ( Relationship . SELF ) ; normed . setType ( "isbn" ) ; normed . setValue ( "ISBN:<sp>123-456-7-89x<sp>junk" ) ; normed . setNormalized ( new org . orcid . jaxb . model . v3 . rc2 . common . TransientNonEmptyString ( "123456789X" ) ) ; org . orcid . jaxb . model . v3 . rc2 . record . ExternalID id1 = new org . orcid . jaxb . model . v3 . rc2 . record . ExternalID ( ) ; id1 . setRelationship ( Relationship . SELF ) ; id1 . setType ( "isbn" ) ; id1 . setValue ( "ISBN:<sp>123-456-7-89x<sp>junk" ) ; id1 . setNormalized ( new org . orcid . jaxb . model . v3 . rc2 . common . TransientNonEmptyString ( norm . normalise ( id1 . getType ( ) , id1 . getValue ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( normed , id1 )
parse_doesNotFailWithManyEmptyObjects ( ) { com . restfb . json . JsonArray array = new com . restfb . json . JsonArray ( ) ; for ( int i = 0 ; i < 1001 ; i ++ ) { array . add ( new com . restfb . json . JsonObject ( ) ) ; } final java . lang . String input = array . toString ( ) ; com . restfb . json . JsonValue result = com . restfb . json . Json . parse ( input ) ; "<AssertPlaceHolder>" ; } isArray ( ) { return false ; }
org . junit . Assert . assertTrue ( result . isArray ( ) )
testProducerRecordSerializableWithoutTimestamp ( ) { org . apache . kafka . clients . producer . ProducerRecord < java . lang . String , java . lang . String > decodedRecord = verifySerialization ( 1 , null ) ; "<AssertPlaceHolder>" ; } timestamp ( ) { return outerContext . timestamp ( ) ; }
org . junit . Assert . assertNull ( decodedRecord . timestamp ( ) )
testBuildWithParametersAndDisabledDefaultConstraintsWithOrderBy ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String abbrName = "abbrname" ; java . lang . String name = "fgdsfds" ; org . lnu . is . domain . enrolment . subject . EnrolmentSubject context = new org . lnu . is . domain . enrolment . subject . EnrolmentSubject ( ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "parent" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "abbrName" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy3 = new org . lnu . is . pagination . OrderBy ( "name" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy4 = new org . lnu . is . pagination . OrderBy ( "isTesting" , 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>EnrolmentSubject<sp>e<sp>WHERE<sp>(<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>AND<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>)<sp>ORDER<sp>BY<sp>e.parent<sp>ASC,<sp>e.abbrName<sp>DESC,<sp>e.name<sp>ASC,<sp>e.isTesting<sp>DESC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . enrolment . subject . EnrolmentSubject > 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 )
testNewPacket ( ) { try { org . pcap4j . packet . IcmpV6CommonPacket p = org . pcap4j . packet . IcmpV6CommonPacket . newPacket ( packet . getRawData ( ) , 0 , packet . getRawData ( ) . length ) ; "<AssertPlaceHolder>" ; } catch ( org . pcap4j . packet . IllegalRawDataException e ) { throw new java . lang . AssertionError ( e ) ; } } getRawData ( ) { byte [ ] rawData = new byte [ length ( ) ] ; rawData [ 0 ] = getType ( ) . value ( ) ; rawData [ 1 ] = length ; rawData [ 2 ] = pointer ; rawData [ 3 ] = flag . value ( ) ; rawData [ 3 ] = ( ( byte ) ( ( rawData [ 3 ] ) | ( ( overflow ) << 4 ) ) ) ; if ( ( data ) != null ) { java . lang . System . arraycopy ( data . getRawData ( ) , 0 , rawData , 4 , data . length ( ) ) ; } return rawData ; }
org . junit . Assert . assertEquals ( packet , p )
header ( ) { final net . jadler . KeyValues headers = net . jadler . Request . builder ( ) . method ( net . jadler . RequestTest . METHOD ) . requestURI ( net . jadler . RequestTest . URI ) . header ( net . jadler . RequestTest . HEADER1_NAME , net . jadler . RequestTest . HEADER1_VALUE1 ) . header ( net . jadler . RequestTest . HEADER1_NAME , net . jadler . RequestTest . HEADER1_VALUE2 ) . header ( net . jadler . RequestTest . HEADER2_NAME , net . jadler . RequestTest . HEADER2_VALUE ) . build ( ) . getHeaders ( ) ; "<AssertPlaceHolder>" ; } add ( java . lang . String , java . lang . String ) { org . apache . commons . lang . Validate . notEmpty ( key , "key<sp>cannot<sp>be<sp>empty" ) ; org . apache . commons . lang . Validate . notNull ( value , "value<sp>cannot<sp>be<sp>null,<sp>use<sp>an<sp>empty<sp>string<sp>instead" ) ; final net . jadler . KeyValues res = new net . jadler . KeyValues ( ) ; res . values . putAll ( this . values ) ; res . values . put ( key . toLowerCase ( ) , value ) ; return res ; }
org . junit . Assert . assertThat ( headers , is ( new net . jadler . KeyValues ( ) . add ( net . jadler . RequestTest . HEADER1_NAME , net . jadler . RequestTest . HEADER1_VALUE1 ) . add ( net . jadler . RequestTest . HEADER1_NAME , net . jadler . RequestTest . HEADER1_VALUE2 ) . add ( net . jadler . RequestTest . HEADER2_NAME , net . jadler . RequestTest . HEADER2_VALUE ) ) )
testPatchParserFromKeyValue ( ) { java . io . File configFile = new java . io . File ( parsersDir , "myparser.json" ) ; org . apache . metron . integration . utils . TestUtils . write ( configFile , org . apache . metron . common . cli . ConfigurationManagerIntegrationTest . squidParserConfig ) ; pushConfigs ( org . apache . metron . common . cli . PARSER , configDir , java . util . Optional . of ( "myparser" ) ) ; patchConfigs ( org . apache . metron . common . cli . PARSER , java . util . Optional . empty ( ) , java . util . Optional . of ( "myparser" ) , java . util . Optional . of ( PatchMode . ADD ) , java . util . Optional . of ( "/parserConfig/timestampField" ) , java . util . Optional . of ( "\"\"heyjoe\"\"" ) ) ; byte [ ] expected = JSONUtils . INSTANCE . toJSONPretty ( org . apache . metron . common . cli . ConfigurationManagerIntegrationTest . expectedPatchedParser ) ; byte [ ] actual = JSONUtils . INSTANCE . toJSONPretty ( stripLines ( dumpConfigs ( org . apache . metron . common . cli . PARSER , java . util . Optional . of ( "myparser" ) ) , 1 ) ) ; "<AssertPlaceHolder>" ; } of ( java . lang . String ) { if ( option . hasArg ( ) ) { return new org . apache . metron . maas . service . AbstractMap . SimpleEntry < > ( this , value ) ; } return new org . apache . metron . maas . service . AbstractMap . SimpleEntry < > ( this , null ) ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . equalTo ( expected ) )
getDrugsByMapping_shouldReturnADrugThatMatchesTheCodeAndSourceAndTheBestMapType ( ) { executeDataSet ( org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . DrugController1_10Test . DRUG_MAPPINGS ) ; final java . lang . String sourceUuid = conceptService . getConceptSource ( 1 ) . getUuid ( ) ; java . lang . String expectedDrugUuid = conceptService . getDrug ( 3 ) . getUuid ( ) ; java . lang . String mapTypeUuids = conceptService . getConceptMapType ( 3 ) . getUuid ( ) ; org . openmrs . module . webservices . rest . SimpleObject results = deserialize ( handle ( newGetRequest ( getURI ( ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . Parameter ( "s" , "getDrugsByMapping" ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . Parameter ( "code" , "CD41003" ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . Parameter ( "source" , sourceUuid ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . Parameter ( "preferredMapTypes" , mapTypeUuids ) ) ) ) ; "<AssertPlaceHolder>" ; mapTypeUuids = conceptService . getConceptMapType ( 2 ) . getUuid ( ) ; results = deserialize ( handle ( newGetRequest ( getURI ( ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . Parameter ( "s" , "getDrugsByMapping" ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . Parameter ( "code" , "CD41003" ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . Parameter ( "source" , sourceUuid ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_10 . Parameter ( "preferredMapTypes" , mapTypeUuids ) ) ) ) ; java . util . Set < java . lang . Object > actualDrugs = new java . util . HashSet < java . lang . Object > ( ) ; for ( java . lang . Object drug : org . openmrs . module . webservices . rest . test . Util . getResultsList ( results ) ) { actualDrugs . add ( org . apache . commons . beanutils . PropertyUtils . getProperty ( drug , "uuid" ) ) ; } assert actualDrugs . contains ( expectedDrugUuid ) ; } getResultsSize ( org . openmrs . module . webservices . rest . SimpleObject ) { return org . openmrs . module . webservices . rest . test . Util . getResultsList ( result ) . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , org . openmrs . module . webservices . rest . test . Util . getResultsSize ( results ) )
query_by_map_idkeyset ( ) { java . util . List < org . nutz . dao . test . meta . Pet > pets = dao . query ( org . nutz . dao . test . meta . Pet . class , null , null ) ; java . util . Map < java . lang . Integer , org . nutz . dao . test . meta . Pet > map = new java . util . HashMap < java . lang . Integer , org . nutz . dao . test . meta . Pet > ( ) ; map . put ( pets . get ( 2 ) . getId ( ) , null ) ; map . put ( pets . get ( 4 ) . getId ( ) , null ) ; pets = dao . query ( org . nutz . dao . test . meta . Pet . class , org . nutz . dao . Cnd . where ( "id" , "in" , map . keySet ( ) ) , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . keys ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 2 , pets . size ( ) )
indexOf_returnsNoIndexIfEmpty ( ) { "<AssertPlaceHolder>" ; } indexOf ( java . lang . Object ) { int index = hashTable . get ( element ) ; if ( ( index != ( - 1 ) ) && ( element . equals ( get ( index ) ) ) ) { return index ; } return super . indexOf ( element ) ; }
org . junit . Assert . assertEquals ( ( - 1 ) , object . indexOf ( "a" ) )
testFindOnEmpty ( ) { final org . eclipse . jgit . dircache . DirCache dc = org . eclipse . jgit . dircache . DirCache . newInCore ( ) ; final byte [ ] path = org . eclipse . jgit . lib . Constants . encode ( "a" ) ; "<AssertPlaceHolder>" ; } findEntry ( byte [ ] , int ) { return findEntry ( 0 , p , pLen ) ; }
org . junit . Assert . assertEquals ( ( - 1 ) , dc . findEntry ( path , path . length ) )
getNodeItems ( ) { org . openstreetmap . osmosis . plugin . elasticsearch . dao . Way way = org . openstreetmap . osmosis . plugin . elasticsearch . testutils . OsmDataBuilder . buildSampleWay ( ) ; org . elasticsearch . action . get . MultiGetRequestBuilder multiGetRequestBuilderMocked = mock ( org . elasticsearch . action . get . MultiGetRequestBuilder . class ) ; when ( clientMocked . prepareMultiGet ( ) ) . thenReturn ( multiGetRequestBuilderMocked ) ; org . elasticsearch . action . ListenableActionFuture < org . elasticsearch . action . get . MultiGetResponse > listenableActionFutureMocked = mock ( org . elasticsearch . action . ListenableActionFuture . class ) ; when ( multiGetRequestBuilderMocked . execute ( ) ) . thenReturn ( listenableActionFutureMocked ) ; org . elasticsearch . action . get . MultiGetResponse multiGetResponseMocked = mock ( org . elasticsearch . action . get . MultiGetResponse . class ) ; when ( listenableActionFutureMocked . actionGet ( ) ) . thenReturn ( multiGetResponseMocked ) ; org . openstreetmap . osmosis . plugin . elasticsearch . dao . Iterator < org . elasticsearch . action . get . MultiGetItemResponse > iteratorMocked = mock ( org . openstreetmap . osmosis . plugin . elasticsearch . dao . Iterator . class ) ; when ( multiGetResponseMocked . iterator ( ) ) . thenReturn ( iteratorMocked ) ; org . openstreetmap . osmosis . plugin . elasticsearch . dao . Iterator < org . elasticsearch . action . get . MultiGetItemResponse > actual = entityDao . getNodeItems ( org . openstreetmap . osmosis . plugin . elasticsearch . dao . Arrays . asList ( way ) ) ; org . elasticsearch . action . get . MultiGetRequest . Item item = new org . elasticsearch . action . get . MultiGetRequest . Item ( org . openstreetmap . osmosis . plugin . elasticsearch . dao . EntityDaoUTest . INDEX_NAME , ESEntityType . NODE . getIndiceName ( ) , "1" ) ; verify ( multiGetRequestBuilderMocked ) . add ( argThat ( new org . openstreetmap . osmosis . plugin . elasticsearch . dao . EntityDaoUTest . ItemMatcher ( item ) ) ) ; verify ( multiGetRequestBuilderMocked , times ( 1 ) ) . execute ( ) ; "<AssertPlaceHolder>" ; } add ( org . openstreetmap . osmosis . core . domain . v0_6 . Entity ) { buffer . add ( entity ) ; if ( ( buffer . size ( ) ) == ( size ) ) { flush ( ) ; return true ; } else return false ; }
org . junit . Assert . assertSame ( iteratorMocked , actual )
testUniqueColumnCombination ( ) { de . hpi . isg . mdms . model . constraints . ConstraintCollection < de . hpi . isg . mdms . flink . UniqueColumnCombination > cc = store . createConstraintCollection ( null , de . hpi . isg . mdms . flink . UniqueColumnCombination . class , store . getTargetByName ( "PDB" ) ) ; int [ ] columns = new int [ ] { col1 . getId ( ) } ; cc . add ( new de . hpi . isg . mdms . flink . UniqueColumnCombination ( columns ) ) ; this . store . flush ( ) ; org . apache . flink . api . java . DataSet < org . apache . flink . api . java . tuple . Tuple > constraints = de . hpi . isg . mdms . flink . readwrite . FlinkMetdataStoreAdapter . getConstraintsFromCollection ( this . flinkExecutionEnvironment , this . store , cc , new de . hpi . isg . mdms . flink . UCCFlinkSerializer ( ) ) ; java . util . List < org . apache . flink . api . java . tuple . Tuple2 < int [ ] , int [ ] > > outData = new java . util . ArrayList < org . apache . flink . api . java . tuple . Tuple2 < int [ ] , int [ ] > > ( ) ; constraints . output ( new org . apache . flink . api . java . io . LocalCollectionOutputFormat ( outData ) ) ; this . flinkExecutionEnvironment . execute ( "Unique<sp>Column<sp>Combination<sp>Reading" ) ; "<AssertPlaceHolder>" ; } execute ( T ) { de . hpi . isg . mdms . db . query . PreparedQuery . LOGGER . trace ( "Query<sp>issued:<sp>{}<sp>with<sp>{}" , this . sql , element ) ; this . databaseAccess . flush ( this . queriedTables ) ; ensureStatementPrepared ( ) ; setStatementParameters ( element ) ; long startTime = java . lang . System . currentTimeMillis ( ) ; java . sql . ResultSet resultSet = this . preparedStatement . executeQuery ( ) ; long endTime = java . lang . System . currentTimeMillis ( ) ; de . hpi . isg . mdms . db . query . PreparedQuery . LOGGER . trace ( "ResultSet<sp>available<sp>after<sp>{}<sp>ms" , ( endTime - startTime ) ) ; return resultSet ; }
org . junit . Assert . assertTrue ( ( ( outData . size ( ) ) == 1 ) )
testIsHasMoreShardsTrue ( ) { when ( mockDescription . getLastEvaluatedShardId ( ) ) . thenReturn ( TEST_STRING ) ; "<AssertPlaceHolder>" ; } isHasMoreShards ( ) { return ( internalDescription . getLastEvaluatedShardId ( ) ) != null ; }
org . junit . Assert . assertTrue ( adapter . isHasMoreShards ( ) )
testExpire ( ) { java . net . InetAddress addr1 = java . net . InetAddress . getByAddress ( new byte [ ] { 10 , 0 , 0 , 1 } ) ; java . net . InetAddress addr2 = java . net . InetAddress . getByAddress ( new byte [ ] { 10 , 0 , 0 , 2 } ) ; io . netty . channel . EventLoopGroup group = new io . netty . channel . DefaultEventLoopGroup ( 1 ) ; try { io . netty . channel . EventLoop loop = group . next ( ) ; final io . netty . resolver . dns . DefaultDnsCache cache = new io . netty . resolver . dns . DefaultDnsCache ( ) ; cache . cache ( "netty.io" , null , addr1 , 1 , loop ) ; cache . cache ( "netty.io" , null , addr2 , 10000 , loop ) ; java . lang . Throwable error = loop . schedule ( new java . util . concurrent . Callable < java . lang . Throwable > ( ) { @ io . netty . resolver . dns . Override public java . lang . Throwable call ( ) { try { "<AssertPlaceHolder>" ; return null ; } catch ( java . lang . Throwable cause ) { return cause ; } } } , 1 , TimeUnit . SECONDS ) . get ( ) ; if ( error != null ) { throw error ; } } finally { group . shutdownGracefully ( ) ; } } get ( java . lang . CharSequence , java . lang . CharSequence ) { java . lang . CharSequence value = get ( name ) ; return value != null ? value : defaultValue ; }
org . junit . Assert . assertNull ( cache . get ( "netty.io" , null ) )
collectToList ( ) { java . util . List < java . lang . String > collected = java . util . stream . Stream . of ( "a" , "b" , "c" ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "a" , "b" , "c" ) , collected )
testSetIgnoreLeadingWhitespaces ( ) { final com . orangesignal . csv . CsvConfig cfg = new com . orangesignal . csv . CsvConfig ( ) ; cfg . setIgnoreLeadingWhitespaces ( true ) ; "<AssertPlaceHolder>" ; } isIgnoreLeadingWhitespaces ( ) { return ignoreLeadingWhitespaces ; }
org . junit . Assert . assertThat ( cfg . isIgnoreLeadingWhitespaces ( ) , org . hamcrest . core . Is . is ( true ) )