input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testReadInputStream ( ) { try ( java . io . InputStream source = new java . io . ByteArrayInputStream ( sourceBytes ) ) { "<AssertPlaceHolder>" ; } } read ( java . io . InputStream , int ) { if ( count == 0 ) { return new byte [ 0 ] ; } final java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( 512 ) ; net . yacy . kelondro . util . FileUtils . copy ( source , baos , count ) ; baos . close ( ) ; return baos . toByteArray ( ) ; }
|
org . junit . Assert . assertEquals ( sourceBytes . length , net . yacy . kelondro . util . FileUtils . read ( source , ( ( sourceBytes . length ) + 10 ) ) . length )
|
testLiteralWithStrings ( ) { org . apache . commons . jexl3 . JexlExpression e = org . apache . commons . jexl3 . JEXL . createExpression ( "[<sp>'foo'<sp>,<sp>'bar'<sp>]" ) ; org . apache . commons . jexl3 . JexlContext jc = new org . apache . commons . jexl3 . MapContext ( ) ; java . lang . Object o = e . evaluate ( jc ) ; java . lang . Object [ ] check = new java . lang . Object [ ] { "foo" , "bar" } ; "<AssertPlaceHolder>" ; } equals ( org . apache . commons . jexl3 . ArithmeticTest$Var , org . apache . commons . jexl3 . ArithmeticTest$Var ) { return ( lhs . value ) == ( rhs . value ) ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( check , ( ( java . lang . Object [ ] ) ( o ) ) ) )
|
testBevatAlleenAnummerWijzigingenMeerWijzigingen ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . Persoon persoon = new nl . bzk . algemeenbrp . dal . domein . brp . entity . Persoon ( nl . bzk . algemeenbrp . dal . domein . brp . enums . SoortPersoon . INGESCHREVENE ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonNummerverwijzingHistorie historie = new nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonNummerverwijzingHistorie ( persoon ) ; final nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . VergelijkerResultaat resultaat = new nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . DeltaVergelijkerResultaat ( ) ; resultaat . voegToeOfVervangVerschil ( new nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil ( new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . EntiteitSleutel ( nl . bzk . algemeenbrp . dal . domein . brp . entity . Persoon . class , "persoonNummerverwijzingHistorieSet" ) , null , historie , VerschilType . RIJ_TOEGEVOEGD , null , historie ) ) ; resultaat . voegToeOfVervangVerschil ( new nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil ( new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . EntiteitSleutel ( nl . bzk . algemeenbrp . dal . domein . brp . entity . Persoon . class , "persoonAdresSet" ) , null , new nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonAdres ( persoon ) , VerschilType . RIJ_TOEGEVOEGD , null , null ) ) ; "<AssertPlaceHolder>" ; } bevatAlleenAnummerWijzigingen ( nl . bzk . algemeenbrp . dal . domein . brp . entity . Persoon ) { boolean result = bevatNummerverwijzingHistorieWijziging ( ) ; final java . util . Iterator < nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil > verschilIterator = interneVerschilNaarVerschilGroepMap . keySet ( ) . iterator ( ) ; while ( result && ( verschilIterator . hasNext ( ) ) ) { final nl . bzk . migratiebrp . synchronisatie . dal . service . impl . delta . Verschil verschil = verschilIterator . next ( ) ; if ( ( verschil . getVerschilType ( ) . equals ( VerschilType . RIJ_TOEGEVOEGD ) ) && ( ( ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . EntiteitSleutel ) ( verschil . getSleutel ( ) ) ) . getEntiteit ( ) . isAssignableFrom ( nl . bzk . algemeenbrp . dal . domein . brp . entity . Persoon . class ) ) ) { final java . lang . reflect . Field bestaandeRijenVeld = persoon . getClass ( ) . getDeclaredField ( verschil . getSleutel ( ) . getVeld ( ) ) ; bestaandeRijenVeld . setAccessible ( true ) ; final java . util . Set < nl . bzk . algemeenbrp . dal . domein . brp . entity . FormeleHistorie > bestaandeRijen = ( ( java . util . Set < nl . bzk . algemeenbrp . dal . domein . brp . entity . FormeleHistorie > ) ( bestaandeRijenVeld . get ( persoon ) ) ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . FormeleHistorie actueleRij = nl . bzk . algemeenbrp . dal . domein . brp . entity . FormeleHistorieZonderVerantwoording . getActueelHistorieVoorkomen ( bestaandeRijen ) ; if ( actueleRij == null ) { result = ( verschil . getNieuweHistorieRij ( ) ) instanceof nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonNummerverwijzingHistorie ; } else { result = bevatRijGeenOfToegestaneWijzigingenVoorAnummerWijziging ( actueleRij , verschil . getNieuweHistorieRij ( ) ) ; } } else { result = verschil . isToegestaanVoorAnummerWijziging ( ) ; } } return result ; }
|
org . junit . Assert . assertFalse ( resultaat . bevatAlleenAnummerWijzigingen ( persoon ) )
|
testSynthesisCollectWithEmptyOracle ( ) { fr . inria . main . evolution . AstorMain main1 = new fr . inria . main . evolution . AstorMain ( ) ; fr . inria . main . CommandSummary cs = fr . inria . astor . test . repair . evaluation . regression . MathCommandsTests . getMath70Command ( ) ; cs . command . put ( "-flthreshold" , "0" 0 ) ; cs . command . put ( "-stopfirst" , "true" ) ; cs . command . put ( "-loglevel" , "DEBUG" ) ; cs . command . put ( "-saveall" , "true" ) ; cs . command . put ( "-maxgen" , "0" ) ; cs . append ( "-parameters" , "logtestexecution:true:disablelog:true" ) ; fr . inria . astor . test . repair . core . SynthesisComponentTest . log . info ( java . util . Arrays . toString ( cs . flat ( ) ) ) ; main1 . execute ( cs . flat ( ) ) ; "<AssertPlaceHolder>" ; fr . inria . astor . core . entities . ProgramVariant variant = main1 . getEngine ( ) . getVariants ( ) . get ( 0 ) ; fr . inria . astor . core . manipulation . synthesis . dynamoth . DynamothCollectorFacade sc = new fr . inria . astor . core . manipulation . synthesis . dynamoth . DynamothCollectorFacade ( ) ; fr . inria . astor . core . entities . SuspiciousModificationPoint mp8 = ( ( fr . inria . astor . core . entities . SuspiciousModificationPoint ) ( variant . getModificationPoints ( ) . get ( 0 ) ) ) ; java . lang . String [ ] tests = sc . getCoverTest ( mp8 ) ; java . util . Map < java . lang . String , java . lang . Object [ ] > oracle = new java . util . HashMap ( ) ; fr . inria . astor . core . manipulation . synthesis . dynamoth . DynamothCollector dynamothCodeGenesis = sc . createCollector ( main1 . getEngine ( ) . getProjectFacade ( ) , mp8 , oracle , tests ) ; java . lang . Double angelicValue62 = 6.2 ; oracle . clear ( ) ; for ( java . lang . String testCase : tests ) { oracle . put ( testCase , new java . lang . Double [ ] { angelicValue62 } ) ; } } getEngine ( ) { return astorCore ; }
|
org . junit . Assert . assertEquals ( 1 , main1 . getEngine ( ) . getVariants ( ) . size ( ) )
|
testVersionPartialOverlapAcrossMinReverse ( ) { org . jboss . forge . furnace . versions . VersionRange versionRange1 = org . jboss . forge . furnace . versions . Versions . parseVersionRange ( "(10,20)" ) ; org . jboss . forge . furnace . versions . VersionRange versionRange2 = org . jboss . forge . furnace . versions . Versions . parseVersionRange ( "(7,13)" ) ; org . jboss . windup . config . metadata . TechnologyReference technologyReference = new org . jboss . windup . config . metadata . TechnologyReference ( "tech" , versionRange1 ) ; boolean overlap = technologyReference . versionRangesOverlap ( versionRange2 ) ; "<AssertPlaceHolder>" ; } versionRangesOverlap ( org . jboss . forge . furnace . versions . VersionRange ) { if ( ( ( this . getVersionRange ( ) ) == null ) || ( otherRange == null ) ) return true ; org . jboss . forge . furnace . versions . MultipleVersionRange range1Multiple ; if ( ( getVersionRange ( ) ) instanceof org . jboss . forge . furnace . versions . MultipleVersionRange ) range1Multiple = ( ( org . jboss . forge . furnace . versions . MultipleVersionRange ) ( getVersionRange ( ) ) ) ; else range1Multiple = new org . jboss . forge . furnace . versions . MultipleVersionRange ( getVersionRange ( ) ) ; try { org . jboss . forge . furnace . versions . VersionRange intersection = range1Multiple . getIntersection ( otherRange ) ; return ( intersection != null ) && ( ! ( intersection . isEmpty ( ) ) ) ; } catch ( java . lang . Throwable t ) { return false ; } }
|
org . junit . Assert . assertTrue ( overlap )
|
testByBatch ( ) { java . lang . String topic = "kafka.AvroTopic" ; java . lang . String group = "avroGroup" ; com . ctrip . hermes . producer . api . Producer producer = com . ctrip . hermes . producer . api . Producer . getInstance ( ) ; com . ctrip . hermes . consumer . engine . Engine engine = com . ctrip . hermes . consumer . engine . Engine . getInstance ( ) ; final java . util . List < com . ctrip . hermes . kafka . avro . AvroVisitEvent > actualResult = new java . util . ArrayList ( ) ; final java . util . List < com . ctrip . hermes . kafka . avro . AvroVisitEvent > expectedResult = new java . util . ArrayList ( ) ; com . ctrip . hermes . consumer . engine . Subscriber s = new com . ctrip . hermes . consumer . engine . Subscriber ( topic , group , new com . ctrip . hermes . consumer . Consumer < com . ctrip . hermes . kafka . avro . AvroVisitEvent > ( ) { @ com . ctrip . hermes . kafka . avro . Override public void consume ( java . util . List < com . ctrip . hermes . core . message . ConsumerMessage < com . ctrip . hermes . kafka . avro . AvroVisitEvent > > msgs ) { for ( com . ctrip . hermes . core . message . ConsumerMessage < com . ctrip . hermes . kafka . avro . AvroVisitEvent > msg : msgs ) { com . ctrip . hermes . kafka . avro . AvroVisitEvent event = msg . getBody ( ) ; System . out . println ( ( "Consumer<sp>Received:<sp>" + event ) ) ; actualResult . add ( event ) ; } } } ) ; System . out . println ( "Starting<sp>consumer..." ) ; engine . start ( java . util . Arrays . asList ( s ) ) ; int limit = ( new java . util . Random ( ) . nextInt ( 20 ) ) + 1 ; int i = 0 ; while ( ( i ++ ) < limit ) { com . ctrip . hermes . kafka . avro . AvroVisitEvent event = com . ctrip . hermes . kafka . avro . KafkaAvroTest . generateEvent ( ) ; com . ctrip . hermes . producer . api . Producer . MessageHolder holder = producer . message ( topic , event ) ; java . util . concurrent . Future < com . ctrip . hermes . core . result . SendResult > future = holder . send ( ) ; future . get ( ) ; if ( future . isDone ( ) ) { System . out . println ( ( "Producer<sp>Sent:<sp>" + event ) ) ; expectedResult . add ( event ) ; } } "<AssertPlaceHolder>" ; } size ( ) { return m_msgSeqs . size ( ) ; }
|
org . junit . Assert . assertEquals ( expectedResult . size ( ) , actualResult . size ( ) )
|
whenAbsolutePathWithShorthandResolved_thenSuccess ( ) { java . io . File file = new java . io . File ( "baeldung/bar/baz/../bar-one.txt" ) ; java . lang . String expectedPath = ( org . baeldung . java . io . JavaFilePathUnitTest . isWindows ( ) ) ? ( org . baeldung . java . io . JavaFilePathUnitTest . userDir ) + "\\baeldung\\bar\\baz\\..\\bar-one.txt" : ( org . baeldung . java . io . JavaFilePathUnitTest . userDir ) + "/baeldung/bar/baz/../bar-one.txt" ; java . lang . String actualPath = file . getAbsolutePath ( ) ; "<AssertPlaceHolder>" ; } isWindows ( ) { java . lang . String osName = java . lang . System . getProperty ( "os.name" ) ; return osName . contains ( "Windows" ) ; }
|
org . junit . Assert . assertEquals ( expectedPath , actualPath )
|
testSearch ( ) { com . ning . http . client . RequestBuilder builder = new com . ning . http . client . RequestBuilder ( "GET" ) ; java . lang . String uri = com . damnhandy . uri . template . UriTemplate . buildFromTemplate ( com . damnhandy . uri . template . examples . TestTwitterSearchApi . SEARCH_BASE ) . literal ( com . damnhandy . uri . template . examples . TestTwitterSearchApi . SEARCH_PARAMS ) . build ( ) . set ( "format" , "json" ) . set ( "q" , "URI<sp>Templates" ) . set ( "rpp" , "5" ) . set ( "include_entities" , true ) . set ( "http://search.twitter.com/search.json?q=URI%20Templates&result_type=mixed&rpp=5&include_entities=true&result_type=mixed" 0 , "mixed" ) . expand ( ) ; com . ning . http . client . Request request = builder . setUrl ( uri ) . build ( ) ; "<AssertPlaceHolder>" ; executeRequest ( createClient ( ) , request ) ; } build ( ) { return new com . damnhandy . uri . template . Expression ( operator , varSpecs ) ; }
|
org . junit . Assert . assertEquals ( "http://search.twitter.com/search.json?q=URI%20Templates&result_type=mixed&rpp=5&include_entities=true&result_type=mixed" , uri )
|
testAuthenticateWithInvalidCredentials ( ) { java . util . List < javax . jcr . Credentials > invalid = new java . util . ArrayList < javax . jcr . Credentials > ( ) ; invalid . add ( new javax . jcr . GuestCredentials ( ) ) ; invalid . add ( new javax . jcr . SimpleCredentials ( userId , new char [ 0 ] ) ) ; for ( javax . jcr . Credentials creds : invalid ) { "<AssertPlaceHolder>" ; } } authenticate ( javax . jcr . Credentials ) { if ( ( ( tokenProvider ) != null ) && ( credentials instanceof org . apache . jackrabbit . api . security . authentication . token . TokenCredentials ) ) { org . apache . jackrabbit . api . security . authentication . token . TokenCredentials tc = ( ( org . apache . jackrabbit . api . security . authentication . token . TokenCredentials ) ( credentials ) ) ; if ( ! ( validateCredentials ( tc ) ) ) { throw new javax . security . auth . login . LoginException ( "Invalid<sp>token<sp>credentials." ) ; } else { return true ; } } return false ; }
|
org . junit . Assert . assertFalse ( authentication . authenticate ( creds ) )
|
testEmptyArrayCreation ( ) { final java . lang . String [ ] array = org . apache . commons . lang3 . ArrayUtils . < java . lang . String > toArray ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 0 , array . length )
|
testDeleteFile ( ) { org . pentaho . platform . dataaccess . datasource . wizard . csv . FileUtils fu = new org . pentaho . platform . dataaccess . datasource . wizard . csv . FileUtils ( ) ; java . lang . String testUniqueFileName = "testFileToDelete-" + ( java . lang . System . currentTimeMillis ( ) ) ; java . io . File testUniqueFile = new java . io . File ( ( ( ( fu . getRelativeSolutionPath ( ) ) + ( java . io . File . separatorChar ) ) + testUniqueFileName ) ) ; try { testUniqueFile . createNewFile ( ) ; } catch ( java . io . IOException ioe ) { org . junit . Assert . fail ( "File<sp>creation<sp>failed" ) ; } if ( ! ( testUniqueFile . exists ( ) ) ) { org . junit . Assert . fail ( "File<sp>could<sp>not<sp>be<sp>created" ) ; } org . pentaho . platform . dataaccess . datasource . wizard . models . FileInfo [ ] files = fu . listFiles ( ) ; if ( ( files != null ) && ( ( files . length ) > 0 ) ) { fu . deleteFile ( testUniqueFileName ) ; org . pentaho . platform . dataaccess . datasource . wizard . models . FileInfo [ ] files1 = fu . listFiles ( ) ; System . err . println ( ( "File1<sp>length<sp>" + ( files1 . length ) ) ) ; System . err . println ( ( "Files<sp>length<sp>" + ( files . length ) ) ) ; try { "<AssertPlaceHolder>" ; } finally { for ( org . pentaho . platform . dataaccess . datasource . wizard . models . FileInfo file : files1 ) { if ( file . getName ( ) . contains ( testUniqueFileName ) ) { testUniqueFile . deleteOnExit ( ) ; org . junit . Assert . fail ( "File<sp>should<sp>have<sp>been<sp>deleted.<sp>We<sp>will<sp>delete<sp>the<sp>file<sp>ourselves" ) ; } } } } } listFiles ( ) { java . util . List < org . pentaho . platform . dataaccess . datasource . wizard . models . FileInfo > fileList = new java . util . ArrayList < org . pentaho . platform . dataaccess . datasource . wizard . models . FileInfo > ( ) ; java . lang . String path = getRelativeSolutionPath ( ) ; java . io . File folder = new java . io . File ( path ) ; if ( folder . exists ( ) ) { java . io . File [ ] files = folder . listFiles ( ) ; for ( java . io . File file : files ) { java . lang . String name = file . getName ( ) ; if ( file . isFile ( ) ) { long lastModified = file . lastModified ( ) ; java . text . DateFormat fmt = org . pentaho . platform . util . messages . LocaleHelper . getShortDateFormat ( true , true ) ; java . util . Date modified = new java . util . Date ( ) ; modified . setTime ( lastModified ) ; java . lang . String modifiedStr = fmt . format ( modified ) ; long size = file . length ( ) ; org . pentaho . platform . dataaccess . datasource . wizard . models . FileInfo info = new org . pentaho . platform . dataaccess . datasource . wizard . models . FileInfo ( ) ; info . setModified ( modifiedStr ) ; info . setName ( name ) ; info . setSize ( size ) ; fileList . add ( info ) ; } } } return fileList . toArray ( new org . pentaho . platform . dataaccess . datasource . wizard . models . FileInfo [ fileList . size ( ) ] ) ; }
|
org . junit . Assert . assertTrue ( ( ( files1 . length ) < ( files . length ) ) )
|
test ( ) { int rank = 3 ; for ( long postId = 0 ; postId < ( postCount ) ; postId ++ ) { com . vladmihalcea . book . hpjp . hibernate . query . recursive . complex . List < com . vladmihalcea . book . hpjp . hibernate . query . recursive . PostCommentScore > result = postCommentScores ( postId , rank ) ; "<AssertPlaceHolder>" ; } logReporter . report ( ) ; } postCommentScores ( java . lang . Long , int ) { return doInJOOQ ( ( sql ) -> { return sql . select ( field ( name ( TSG , "id" ) , . class ) , field ( name ( TSG , "parent_id" ) , . class ) , field ( name ( TSG , "review" ) , . class ) , field ( name ( TSG , "created_on" ) , . class ) , field ( name ( TSG , "score" ) , . class ) ) . from ( sql . select ( field ( name ( ST , "id" ) ) , field ( name ( ST , "parent_id" ) ) , field ( name ( ST , "review" ) ) , field ( name ( ST , "created_on" ) ) , field ( name ( ST , "score" ) ) , denseRank ( ) . over ( orderBy ( field ( name ( ST , "total_score" ) ) . desc ( ) ) ) . as ( "rank" ) ) . from ( sql . select ( field ( name ( SBC , "id" ) ) , field ( name ( SBC , "parent_id" ) ) , field ( name ( SBC , "review" ) ) , field ( name ( SBC , "created_on" ) ) , field ( name ( SBC , "score" ) ) , sum ( field ( name ( SBC , "score" ) , . class ) ) . over ( partitionBy ( field ( name ( SBC , "root_id" ) ) ) ) . as ( "total_score" ) ) . from ( sql . withRecursive ( withRecursiveExpression ( sql , postId ) ) . select ( field ( name ( PCS , "id" ) ) , field ( name ( PCS , "parent_id" ) ) , field ( name ( PCS , "root_id" ) ) , field ( name ( PCS , "review" ) ) , field ( name ( PCS , "created_on" ) ) , field ( name ( PCS , "score" ) ) ) . from ( table ( PCS ) ) . asTable ( SBC ) ) . asTable ( ST ) ) . orderBy ( field ( name ( ST , "total_score" ) ) . desc ( ) , field ( name ( ST , "id" ) ) . asc ( ) ) . asTable ( TSG ) ) . where ( field ( name ( TSG , "rank" ) , . class ) . le ( rank ) ) . fetchInto ( . class ) ; } ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
testTarGzipImportCommand ( ) { command . targets = com . beust . jcommander . internal . Lists . newArrayList ( org . kitesdk . cli . commands . TestTarImportCommand . TAR_TEST_GZIP_FILE , org . kitesdk . cli . commands . TestTarImportCommand . datasetUri ) ; command . compressionType = "gzip" ; "<AssertPlaceHolder>" ; verify ( console ) . info ( "Using<sp>{}<sp>compression" , TarImportCommand . CompressionType . GZIP ) ; verify ( console ) . info ( "Added<sp>{}<sp>records<sp>to<sp>\"{}\"" , org . kitesdk . cli . commands . TestTarImportCommand . NUM_TEST_FILES , org . kitesdk . cli . commands . TestTarImportCommand . TEST_DATASET_NAME ) ; } run ( ) { try { command . run ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( "Caught<sp>IOException" , e ) ; } }
|
org . junit . Assert . assertEquals ( 0 , command . run ( ) )
|
testNotifyNormalStartupForKnownBounceProxy ( ) { setMockedHttpRequestHandlerResponse ( HttpStatus . SC_NO_CONTENT ) ; reporter . startStartupReporting ( ) ; int i = 50 ; while ( ( i > 0 ) && ( ! ( reporter . hasReportedStartup ( ) ) ) ) { i -- ; java . lang . Thread . sleep ( 100 ) ; } verify ( handler , org . mockito . Mockito . times ( 1 ) ) . handle ( org . mockito . Mockito . argThat ( new io . joynr . messaging . bounceproxy . monitoring . MonitoringServiceClientTest . IsAnyStartupHttpRequest ( "X.Y" , "http://joyn-bpX.de/bp/" , "http://joyn-bpX.muc/bp/" ) ) , any ( org . apache . http . HttpResponse . class ) , any ( org . apache . http . protocol . HttpContext . class ) ) ; "<AssertPlaceHolder>" ; } hasReportedStartup ( ) { return startupReporter . hasBounceProxyBeenRegistered ( ) ; }
|
org . junit . Assert . assertTrue ( reporter . hasReportedStartup ( ) )
|
lastVersion_oneVersion_returnVersion ( ) { javax . jcr . version . VersionIterator versionIterator = mock ( javax . jcr . version . VersionIterator . class , withSettings ( ) . extraInterfaces ( java . util . Iterator . class ) ) ; when ( versionIterator . hasNext ( ) ) . thenReturn ( true , false ) ; javax . jcr . version . Version last = mock ( javax . jcr . version . Version . class ) ; when ( versionIterator . next ( ) ) . thenReturn ( last ) ; org . apache . sling . api . resource . Resource resource = mockResource ( versionIterator ) ; javax . jcr . version . Version result = underTest . lastVersion ( resource ) ; "<AssertPlaceHolder>" ; } lastVersion ( org . apache . sling . api . resource . Resource ) { try { org . apache . sling . api . resource . Resource versionableResource = ( resource . isResourceType ( NameConstants . NT_PAGE ) ) ? resource . getChild ( NameConstants . NN_CONTENT ) : resource ; javax . jcr . version . VersionManager versionManager = versionableResource . getResourceResolver ( ) . adaptTo ( javax . jcr . Session . class ) . getWorkspace ( ) . getVersionManager ( ) ; final java . util . Iterator < javax . jcr . version . Version > allVersions = versionManager . getVersionHistory ( versionableResource . getPath ( ) ) . getAllVersions ( ) ; return com . google . common . collect . Iterators . getLast ( allVersions ) ; } catch ( javax . jcr . RepositoryException e ) { com . adobe . acs . commons . wcm . comparisons . impl . VersionServiceImpl . log . error ( "Error<sp>receiving<sp>last<sp>version<sp>of<sp>resource<sp>[<sp>{}<sp>]" , resource . getName ( ) ) ; } return null ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( last ) )
|
testGetLocaleWhenLocaleIsAvailable ( ) { com . liferay . dynamic . data . mapping . model . DDMForm ddmForm = new com . liferay . dynamic . data . mapping . model . DDMForm ( ) ; ddmForm . setDefaultLocale ( LocaleUtil . BRAZIL ) ; ddmForm . setAvailableLocales ( createAvailableLocales ( LocaleUtil . BRAZIL , LocaleUtil . US ) ) ; java . util . Locale locale = _ddmFormRendererTag . getLocale ( _request , ddmForm ) ; "<AssertPlaceHolder>" ; } getLocale ( javax . servlet . http . HttpServletRequest , com . liferay . dynamic . data . mapping . model . DDMForm ) { java . util . Set < java . util . Locale > availableLocales = ddmForm . getAvailableLocales ( ) ; java . lang . String languageId = com . liferay . portal . kernel . language . LanguageUtil . getLanguageId ( request ) ; java . util . Locale locale = com . liferay . portal . kernel . util . LocaleUtil . fromLanguageId ( languageId ) ; if ( availableLocales . contains ( locale ) ) { return locale ; } return ddmForm . getDefaultLocale ( ) ; }
|
org . junit . Assert . assertEquals ( LocaleUtil . US , locale )
|
testDuration ( ) { java . net . URI recordingFileUri = this . getClass ( ) . getClassLoader ( ) . getResource ( "test_recording.wav" ) . toURI ( ) ; java . io . File recordingFile = new java . io . File ( recordingFileUri ) ; double duration = org . restcomm . connect . commons . util . WavUtils . getAudioDuration ( recordingFile ) ; "<AssertPlaceHolder>" ; } getAudioDuration ( java . net . URI ) { return org . restcomm . connect . commons . util . WavUtils . getAudioDuration ( new java . io . File ( wavFile ) ) ; }
|
org . junit . Assert . assertEquals ( 12 , duration , 1.0 )
|
testGetAuditsForEntity ( ) { try ( com . salesforce . dva . argus . sdk . ArgusService argusService = new com . salesforce . dva . argus . sdk . ArgusService ( getMockedClient ( "/AuditServiceTest.json" ) ) ) { com . salesforce . dva . argus . sdk . AuditService auditService = argusService . getAuditService ( ) ; java . util . List < com . salesforce . dva . argus . sdk . entity . Audit > result = auditService . getAuditsForEntity ( BigInteger . ONE ) ; java . util . List < com . salesforce . dva . argus . sdk . entity . Audit > expected = java . util . Arrays . asList ( new com . salesforce . dva . argus . sdk . entity . Audit [ ] { _constructPersistedAudit ( ) } ) ; "<AssertPlaceHolder>" ; } } _constructPersistedAudit ( ) { com . salesforce . dva . argus . sdk . entity . Audit result = new com . salesforce . dva . argus . sdk . entity . Audit ( ) ; result . setCreatedDate ( new java . util . Date ( 1472282830936L ) ) ; result . setHostName ( "localhost" ) ; result . setId ( BigInteger . ONE ) ; result . setMessage ( "TestMessage" ) ; result . setEntityId ( BigInteger . ONE ) ; return result ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testGetLineUnix ( ) { java . lang . String input = "col1\tcol2\tcol3\ndata1\tdata2\tdata3\n" ; java . lang . String expected = "col1\tcol2\tcol3" ; java . lang . String output = org . pentaho . di . trans . steps . fileinput . text . TextFileInputUtils . getLine ( null , org . pentaho . di . trans . steps . fileinput . text . TextFileInputTest . getInputStreamReader ( input ) , TextFileInputMeta . FILE_FORMAT_UNIX , new java . lang . StringBuilder ( 1000 ) ) ; "<AssertPlaceHolder>" ; } getInputStreamReader ( java . lang . String ) { return new java . io . InputStreamReader ( new java . io . ByteArrayInputStream ( data . getBytes ( "UTF-8" ) ) ) ; }
|
org . junit . Assert . assertEquals ( expected , output )
|
testNumberTypeCompare_inEmbed ( ) { java . lang . String query = "LBService[@resourceId<sp>in<sp>(\"192.168.3.1\")<sp>]{@resourceId}.capacities[@available<sp>><sp>50]{@used,@available}" ; com . ebay . cloud . cms . query . service . IQueryResult result = queryService . query ( query , cmsdbContext ) ; "<AssertPlaceHolder>" ; } getEntities ( ) { return entities ; }
|
org . junit . Assert . assertTrue ( ( ( result . getEntities ( ) . size ( ) ) == 1 ) )
|
testCauseOfTypeWithCycle ( ) { software . amazon . ion . IonException ie1 = new software . amazon . ion . IonException ( ) ; software . amazon . ion . IonException ie2 = new software . amazon . ion . IonException ( ie1 ) ; ie1 . initCause ( ie2 ) ; software . amazon . ion . IonException ion = new software . amazon . ion . IonException ( ie1 ) ; "<AssertPlaceHolder>" ; } causeOfType ( java . lang . Class ) { java . util . IdentityHashMap < java . lang . Throwable , java . lang . Throwable > seen = new java . util . IdentityHashMap < java . lang . Throwable , java . lang . Throwable > ( ) ; java . lang . Throwable cause = getCause ( ) ; while ( ( cause != null ) && ( ! ( type . isInstance ( cause ) ) ) ) { if ( ( seen . put ( cause , cause ) ) != null ) { return null ; } cause = cause . getCause ( ) ; } return ( ( T ) ( cause ) ) ; }
|
org . junit . Assert . assertNull ( ion . causeOfType ( java . io . IOException . class ) )
|
bug55030 ( ) { org . apache . poi . hslf . usermodel . HSLFSlideShow ppt = org . apache . poi . hslf . usermodel . TestBugs . open ( "bug55030.ppt" ) ; java . lang . String expFamily = "隶书" ; org . apache . poi . hslf . usermodel . HSLFSlide sl = ppt . getSlides ( ) . get ( 0 ) ; for ( java . util . List < org . apache . poi . hslf . usermodel . HSLFTextParagraph > paraList : sl . getTextParagraphs ( ) ) { for ( org . apache . poi . hslf . usermodel . HSLFTextParagraph htp : paraList ) { for ( org . apache . poi . hslf . usermodel . HSLFTextRun htr : htp ) { java . lang . String actFamily = htr . getFontFamily ( FontGroup . EAST_ASIAN ) ; "<AssertPlaceHolder>" ; } } } ppt . close ( ) ; } getFontFamily ( org . apache . poi . common . usermodel . fonts . FontGroup ) { return new org . apache . poi . xslf . usermodel . XSLFTextRun . XSLFFontInfo ( fontGroup ) . getTypeface ( ) ; }
|
org . junit . Assert . assertEquals ( expFamily , actFamily )
|
testAdd2 ( ) { org . diirt . datasource . ReadRecipeBuilder builder = new org . diirt . datasource . ReadRecipeBuilder ( ) ; org . diirt . datasource . ValueCache valueCache1 = new org . diirt . datasource . ValueCacheImpl < java . lang . Object > ( java . lang . Object . class ) ; org . diirt . datasource . ValueCache valueCache2 = new org . diirt . datasource . ValueCacheImpl < java . lang . Object > ( java . lang . Object . class ) ; builder . addChannel ( "test" , valueCache1 ) ; builder . addChannel ( "test" , valueCache2 ) ; org . diirt . datasource . WriteFunction < java . lang . Exception > writeCache = new org . diirt . datasource . WriteCache < java . lang . Exception > ( ) ; org . diirt . datasource . ConnectionCollector connectionCollector = new org . diirt . datasource . ConnectionCollector ( ) ; org . diirt . datasource . ReadRecipe recipe = builder . build ( writeCache , connectionCollector ) ; "<AssertPlaceHolder>" ; } getChannelReadRecipes ( ) { return channelReadRecipes ; }
|
org . junit . Assert . assertThat ( recipe . getChannelReadRecipes ( ) . size ( ) , equalTo ( 2 ) )
|
showTreeCommand ( ) { java . lang . String bundleTreeOutput = executeCommand ( "bundle:tree-show<sp>org.apache.karaf.management.server" ) ; System . out . println ( bundleTreeOutput ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertFalse ( bundleTreeOutput . isEmpty ( ) )
|
new2 ( ) { java . io . File file = new java . io . File ( "DOES_NOT_EXISTS" ) ; org . diirt . service . jdbc . JDBCServiceProvider factory = new org . diirt . service . jdbc . JDBCServiceProvider ( file ) ; java . util . Collection < org . diirt . service . Service > services = factory . createServices ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return values . size ( ) ; }
|
org . junit . Assert . assertThat ( services . size ( ) , equalTo ( 0 ) )
|
testWasSuccessfulWhenBothWarningsAndErrorsAreRecorded ( ) { "<AssertPlaceHolder>" ; } wasSuccessful ( ) { runCodes ( ) ; return ( numErrors ) == 0 ; }
|
org . junit . Assert . assertThat ( report . wasSuccessful ( ) , org . hamcrest . Matchers . equalTo ( false ) )
|
testCreateFailConstructor ( ) { org . pf4j . PluginDescriptor pluginDescriptor = mock ( org . pf4j . PluginDescriptor . class ) ; when ( pluginDescriptor . getPluginClass ( ) ) . thenReturn ( org . pf4j . plugin . AnotherFailTestPlugin . class . getName ( ) ) ; org . pf4j . PluginWrapper pluginWrapper = mock ( org . pf4j . PluginWrapper . class ) ; when ( pluginWrapper . getDescriptor ( ) ) . thenReturn ( pluginDescriptor ) ; when ( pluginWrapper . getPluginClassLoader ( ) ) . thenReturn ( getClass ( ) . getClassLoader ( ) ) ; org . pf4j . PluginFactory pluginFactory = new org . pf4j . DefaultPluginFactory ( ) ; org . pf4j . Plugin plugin = pluginFactory . create ( pluginWrapper ) ; "<AssertPlaceHolder>" ; } create ( org . pf4j . PluginWrapper ) { java . lang . String pluginClassName = pluginWrapper . getDescriptor ( ) . getPluginClass ( ) ; org . pf4j . DefaultPluginFactory . log . debug ( "Create<sp>instance<sp>for<sp>plugin<sp>'{}'" , pluginClassName ) ; java . lang . Class < ? > pluginClass ; try { pluginClass = pluginWrapper . getPluginClassLoader ( ) . loadClass ( pluginClassName ) ; } catch ( java . lang . ClassNotFoundException e ) { org . pf4j . DefaultPluginFactory . log . error ( e . getMessage ( ) , e ) ; return null ; } int modifiers = pluginClass . getModifiers ( ) ; if ( ( ( java . lang . reflect . Modifier . isAbstract ( modifiers ) ) || ( java . lang . reflect . Modifier . isInterface ( modifiers ) ) ) || ( ! ( org . pf4j . Plugin . class . isAssignableFrom ( pluginClass ) ) ) ) { org . pf4j . DefaultPluginFactory . log . error ( "The<sp>plugin<sp>class<sp>'{}'<sp>is<sp>not<sp>valid" , pluginClassName ) ; return null ; } try { java . lang . reflect . Constructor < ? > constructor = pluginClass . getConstructor ( org . pf4j . PluginWrapper . class ) ; return ( ( org . pf4j . Plugin ) ( constructor . newInstance ( pluginWrapper ) ) ) ; } catch ( java . lang . Exception e ) { org . pf4j . DefaultPluginFactory . log . error ( e . getMessage ( ) , e ) ; } return null ; }
|
org . junit . Assert . assertNull ( plugin )
|
testFieldWithExtIdNo_CustomObject ( ) { inputFieldName = "ParentObjectId__c" ; expectedFieldName = "ParentObjectId__c" ; java . lang . String fieldToNullName = org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . getFieldToNullName ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtilsTest . logMock , inputFieldName , false ) ; "<AssertPlaceHolder>" ; } getFieldToNullName ( org . pentaho . di . core . logging . LogChannelInterface , java . lang . String , boolean ) { java . lang . String fieldToNullName = field ; if ( isUseExtId ) { if ( ! ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . FIELD_NAME_WITH_EXTID_PATTERN . matcher ( field ) . matches ( ) ) ) { if ( log . isDebug ( ) ) { log . logDebug ( org . pentaho . di . i18n . BaseMessages . getString ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . PKG , "SalesforceUtils.Warn.IncorrectExternalKeySyntax" , field , fieldToNullName ) ) ; } return fieldToNullName ; } java . lang . String lookupField = field . substring ( ( ( field . indexOf ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . EXTID_SEPARATOR ) ) + 1 ) ) ; if ( lookupField . endsWith ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . CUSTOM_OBJECT_RELATIONSHIP_FIELD_SUFFIX ) ) { fieldToNullName = ( lookupField . substring ( 0 , ( ( lookupField . length ( ) ) - ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . CUSTOM_OBJECT_RELATIONSHIP_FIELD_SUFFIX . length ( ) ) ) ) ) + ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . CUSTOM_OBJECT_SUFFIX ) ; if ( log . isDebug ( ) ) { log . logDebug ( org . pentaho . di . i18n . BaseMessages . getString ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . PKG , "SalesforceUtils.Debug.NullFieldName" , fieldToNullName ) ) ; } return fieldToNullName ; } fieldToNullName = lookupField + "Id" ; } if ( log . isDebug ( ) ) { log . logDebug ( org . pentaho . di . i18n . BaseMessages . getString ( org . pentaho . di . trans . steps . salesforceutils . SalesforceUtils . PKG , "SalesforceUtils.Debug.NullFieldName" , fieldToNullName ) ) ; } return fieldToNullName ; }
|
org . junit . Assert . assertEquals ( expectedFieldName , fieldToNullName )
|
getPatchedDocument ( ) { java . util . Map < java . lang . String , java . lang . Object > latestDoc = new java . util . HashMap ( ) ; latestDoc . put ( Constants . GUID , "guid" ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > comments = new java . util . ArrayList ( ) ; comments . add ( new org . apache . metron . indexing . dao . search . AlertComment ( "user" 2 , "user" , 0L ) . asMap ( ) ) ; comments . add ( new org . apache . metron . indexing . dao . search . AlertComment ( "user" 0 , "user_2" , 0L ) . asMap ( ) ) ; latestDoc . put ( org . apache . metron . solr . dao . COMMENTS_FIELD , comments ) ; org . apache . metron . indexing . dao . update . Document latest = new org . apache . metron . indexing . dao . update . Document ( latestDoc , "guid" , "user" 1 , 0L ) ; org . apache . metron . solr . dao . SolrRetrieveLatestDao retrieveLatestDao = spy ( new org . apache . metron . solr . dao . SolrRetrieveLatestDao ( null , org . apache . metron . solr . dao . SolrUpdateDaoTest . accessConfig ) ) ; doReturn ( latest ) . when ( retrieveLatestDao ) . getLatest ( "guid" , "user" 1 ) ; org . apache . metron . indexing . dao . update . PatchRequest request = new org . apache . metron . indexing . dao . update . PatchRequest ( ) ; request . setIndex ( "user" 1 ) ; request . setSensorType ( "user" 1 ) ; request . setGuid ( "guid" ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > patchList = new java . util . ArrayList ( ) ; java . util . Map < java . lang . String , java . lang . Object > patch = new java . util . HashMap ( ) ; patch . put ( "op" , "add" ) ; patch . put ( "path" , "/project" ) ; patch . put ( "value" , "metron" ) ; patchList . add ( patch ) ; request . setPatch ( patchList ) ; org . apache . metron . indexing . dao . update . Document actual = solrUpdateDao . getPatchedDocument ( retrieveLatestDao , request , java . util . Optional . of ( 0L ) ) ; latest . getDocument ( ) . put ( "project" , "metron" ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , java . lang . Object ) { throw new java . lang . UnsupportedOperationException ( "Merged<sp>map<sp>is<sp>immutable." ) ; }
|
org . junit . Assert . assertEquals ( actual , latest )
|
AsyncHeadBooleanRequest ( ) { final boolean result = createService ( com . azure . common . implementation . RestProxyTests . Service10 . class ) . headBooleanAsync ( ) . block ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( result )
|
testAlertEnqueue ( ) { com . salesforce . dva . argus . service . UserService userService = system . getServiceFactory ( ) . getUserService ( ) ; com . salesforce . dva . argus . service . AlertService alertService = system . getServiceFactory ( ) . getAlertService ( ) ; com . salesforce . dva . argus . service . MQService mqService = system . getServiceFactory ( ) . getMQService ( ) ; com . salesforce . dva . argus . entity . PrincipalUser user = userService . findAdminUser ( ) ; java . util . List < com . salesforce . dva . argus . entity . Alert > actualAlertList = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { actualAlertList . add ( alertService . updateAlert ( new com . salesforce . dva . argus . entity . Alert ( user , user , createRandomName ( ) , com . salesforce . dva . argus . service . AlertServiceTest . EXPRESSION , "*<sp>*<sp>*<sp>*<sp>*" ) ) ) ; } alertService . enqueueAlerts ( actualAlertList ) ; java . util . List < com . salesforce . dva . argus . service . alert . DefaultAlertService . AlertWithTimestamp > expectedList = mqService . dequeue ( MQQueue . ALERT . getQueueName ( ) , com . salesforce . dva . argus . service . alert . DefaultAlertService . AlertWithTimestamp . class , 1000 , 10 ) ; "<AssertPlaceHolder>" ; } dequeue ( java . lang . String , com . fasterxml . jackson . databind . JavaType , int , int ) { requireNotDisposed ( ) ; requireConsumerEnabled ( ) ; requireArgument ( ( ( topic != null ) && ( ! ( topic . trim ( ) . isEmpty ( ) ) ) ) , "Topic<sp>cannot<sp>be<sp>null<sp>or<sp>empty." ) ; requireArgument ( ( type != null ) , "Result<sp>object<sp>runtime<sp>type<sp>cannot<sp>be<sp>null." ) ; requireArgument ( ( timeout > 0 ) , "Timeout<sp>in<sp>milliseconds<sp>must<sp>be<sp>greater<sp>than<sp>zero." ) ; requireArgument ( ( limit > 0 ) , "Limit<sp>must<sp>be<sp>non-negative." ) ; _consumer . initializeTopic ( topic ) ; return _consumer . dequeueFromBuffer ( topic , type , timeout , limit ) ; }
|
org . junit . Assert . assertEquals ( actualAlertList . size ( ) , expectedList . size ( ) )
|
testGetScope_06 ( ) { org . eclipse . xtext . scoping . IScope scope = scopeProvider . getScope ( field . eResource ( ) , TypesPackage . Literals . JVM_CONSTRAINT_OWNER__CONSTRAINTS ) ; "<AssertPlaceHolder>" ; } getScope ( org . eclipse . emf . ecore . EObject , org . eclipse . emf . ecore . EReference ) { if ( reference == ( ArithmeticsPackage . Literals . IMPORT__MODULE ) ) { return super . getGlobalScope ( context . eResource ( ) , reference ) ; } final org . eclipse . xtext . example . arithmetics . arithmetics . Module module = org . eclipse . xtext . EcoreUtil2 . < org . eclipse . xtext . example . arithmetics . arithmetics . Module > getContainerOfType ( context , org . eclipse . xtext . example . arithmetics . arithmetics . Module . class ) ; org . eclipse . xtext . scoping . IScope result = org . eclipse . xtext . scoping . IScope . NULLSCOPE ; org . eclipse . emf . common . util . EList < org . eclipse . xtext . example . arithmetics . arithmetics . Import > _imports = module . getImports ( ) ; for ( final org . eclipse . xtext . example . arithmetics . arithmetics . Import import_ : _imports ) { boolean _eIsProxy = import_ . getModule ( ) . eIsProxy ( ) ; boolean _not = ! _eIsProxy ; if ( _not ) { result = this . getModuleScope ( context , reference , import_ . getModule ( ) , result ) ; } } result = this . getModuleScope ( context , reference , module , result ) ; return this . getDefinitionScope ( context , reference , result ) ; }
|
org . junit . Assert . assertSame ( IScope . NULLSCOPE , scope )
|
set_boolean_enablesChaining ( ) { array . add ( false ) ; "<AssertPlaceHolder>" ; } set ( java . lang . String , com . eclipsesource . json . JsonValue ) { if ( name == null ) { throw new java . lang . NullPointerException ( "name<sp>is<sp>null" ) ; } if ( value == null ) { throw new java . lang . NullPointerException ( "value<sp>is<sp>null" ) ; } int index = indexOf ( name ) ; if ( index != ( - 1 ) ) { values . set ( index , value ) ; } else { table . add ( name , names . size ( ) ) ; names . add ( name ) ; values . add ( value ) ; } return this ; }
|
org . junit . Assert . assertSame ( array , array . set ( 0 , true ) )
|
testDiToAvroLogicalTime ( ) { org . apache . avro . Schema expectedSchema = org . talend . daikon . avro . AvroUtils . _logicalTime ( ) ; org . apache . avro . Schema designSchema = org . apache . avro . SchemaBuilder . builder ( ) . record ( "Record" ) . fields ( ) . name ( "booleanField" ) . type ( ) . booleanType ( ) . noDefault ( ) . endRecord ( ) ; org . talend . codegen . enforcer . IncomingSchemaEnforcer enforcer = new org . talend . codegen . enforcer . IncomingSchemaEnforcer ( designSchema ) ; org . apache . avro . Schema actualSchema = enforcer . diToAvro ( null , "time-millis" ) ; "<AssertPlaceHolder>" ; } diToAvro ( java . lang . String , java . lang . String ) { org . apache . avro . Schema fieldSchema = org . talend . daikon . avro . LogicalTypeUtils . getSchemaByLogicalType ( logicalType ) ; if ( fieldSchema != null ) { return fieldSchema ; } if ( "id_String" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . STRING ) ; } else if ( "id_Boolean" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . BOOLEAN ) ; } else if ( "id_Byte" 0.e quals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . INT ) ; } else if ( "id_Byte" 1.e quals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . LONG ) ; } else if ( "id_Double" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . DOUBLE ) ; } else if ( "id_Float" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . FLOAT ) ; } else if ( "id_Byte" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _byte ( ) ; } else if ( "id_Short" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _short ( ) ; } else if ( "id_Character" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _character ( ) ; } else if ( "id_BigDecimal" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _decimal ( ) ; } else if ( "id_Date" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _date ( ) ; } else { throw new java . lang . UnsupportedOperationException ( ( "Unrecognized<sp>type<sp>" + diType ) ) ; } return fieldSchema ; }
|
org . junit . Assert . assertEquals ( expectedSchema , actualSchema )
|
max ( ) { "<AssertPlaceHolder>" ; System . out . println ( ( "2<sp>vs<sp>3<sp>,<sp>max:" + ( org . xm . similarity . util . MathUtil . max ( 2 , 3 ) ) ) ) ; } max ( int , int ) { return a > b ? a : b ; }
|
org . junit . Assert . assertTrue ( ( ( org . xm . similarity . util . MathUtil . max ( 2 , 3 ) ) > 2 ) )
|
testHungrySoberComplimentedKing ( ) { final com . iluwatar . servant . King king = new com . iluwatar . servant . King ( ) ; king . receiveCompliments ( ) ; king . changeMood ( ) ; "<AssertPlaceHolder>" ; } getMood ( ) { return isHappy ; }
|
org . junit . Assert . assertFalse ( king . getMood ( ) )
|
serializeNewEntityWithNumericNullId ( ) { org . springframework . flex . hibernate3 . domain . PersonNP person = new org . springframework . flex . hibernate3 . domain . PersonNP ( ) ; person . id = null ; person . name = "Bob" ; serialize ( person ) ; org . springframework . flex . hibernate3 . domain . PersonNP result = ( ( org . springframework . flex . hibernate3 . domain . PersonNP ) ( deserialize ( ) ) ) ; "<AssertPlaceHolder>" ; } deserialize ( ) { this . request . setContent ( this . response . getContentAsByteArray ( ) ) ; this . deserializer . initialize ( new flex . messaging . io . SerializationContext ( ) , this . request . getInputStream ( ) , deserializerTrace ) ; flex . messaging . io . amf . MessageBody body = new flex . messaging . io . amf . MessageBody ( ) ; this . deserializer . readBody ( body , 0 ) ; return body . getData ( ) ; }
|
org . junit . Assert . assertEquals ( null , result . id )
|
testGetFeatureStoreAddFeatures ( ) { org . geotools . data . FeatureReader < org . opengis . feature . simple . SimpleFeatureType , org . opengis . feature . simple . SimpleFeature > reader = org . geotools . data . DataUtilities . reader ( new org . opengis . feature . simple . SimpleFeature [ ] { first . newFeature } ) ; org . geotools . data . simple . SimpleFeatureStore road = ( ( org . geotools . data . simple . SimpleFeatureStore ) ( data . getFeatureSource ( first . typeName ) ) ) ; road . addFeatures ( org . geotools . data . DataUtilities . collection ( reader ) ) ; "<AssertPlaceHolder>" ; } getFeatures ( ) { return features = nonNullSet ( features , org . opengis . feature . type . FeatureType . class ) ; }
|
org . junit . Assert . assertEquals ( ( ( first . features . length ) + 1 ) , road . getFeatures ( ) . size ( ) )
|
testGetEntriesCountInDifferentCompany ( ) { addEntry ( 0 , 0 ) ; int entriesCount = com . liferay . announcements . kernel . service . AnnouncementsEntryLocalServiceUtil . getEntriesCount ( _company2 . getCompanyId ( ) , 0 , 0 , false ) ; "<AssertPlaceHolder>" ; } getCompanyId ( ) { return _companyId ; }
|
org . junit . Assert . assertEquals ( 0 , entriesCount )
|
getMainWikiDescriptor ( ) { org . xwiki . wiki . internal . descriptor . DefaultWikiDescriptor descriptor = new org . xwiki . wiki . internal . descriptor . DefaultWikiDescriptor ( "xwiki" , "xwiki" ) ; when ( cache . getFromId ( "xwiki" ) ) . thenReturn ( descriptor ) ; "<AssertPlaceHolder>" ; } getMainWikiDescriptor ( ) { org . xwiki . wiki . internal . descriptor . DefaultWikiDescriptor descriptor = new org . xwiki . wiki . internal . descriptor . DefaultWikiDescriptor ( "xwiki" , "xwiki" ) ; when ( cache . getFromId ( "xwiki" ) ) . thenReturn ( descriptor ) ; org . junit . Assert . assertEquals ( descriptor , this . mocker . getComponentUnderTest ( ) . getMainWikiDescriptor ( ) ) ; }
|
org . junit . Assert . assertEquals ( descriptor , this . mocker . getComponentUnderTest ( ) . getMainWikiDescriptor ( ) )
|
testNoArgs ( ) { org . eclipse . ceylon . common . tool . ToolModel < org . eclipse . ceylon . tools . classpath . CeylonClasspathTool > model = pluginLoader . loadToolModel ( "classpath" ) ; "<AssertPlaceHolder>" ; try { org . eclipse . ceylon . tools . classpath . CeylonClasspathTool tool = pluginFactory . bindArguments ( model , getMainTool ( ) , java . util . Collections . < java . lang . String > emptyList ( ) ) ; org . junit . Assert . fail ( ) ; } catch ( org . eclipse . ceylon . common . tool . OptionArgumentException e ) { } }
|
org . junit . Assert . assertNotNull ( model )
|
two_$this_contains_any_returns_false_when_all_expression_values_not_in_array ( ) { com . redhat . lightblue . query . QueryExpression expr = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'array':'field6.$this.$this.nf5',<sp>'contains':'$any',<sp>'values':[1,2,3,4]}" ) ; com . redhat . lightblue . eval . QueryEvaluator eval = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( expr , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext context = eval . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; }
|
org . junit . Assert . assertFalse ( context . getResult ( ) )
|
testFormatByMethod ( ) { java . lang . String tpl = "${a2}-${a1}" ; java . util . Map < java . lang . String , java . lang . Object > args = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; cn . bc . template . util . FreeMarkerUtilsTest . T a1 = new cn . bc . template . util . FreeMarkerUtilsTest . T ( ) ; a1 . setA1 ( "name" ) ; args . put ( "a1" , a1 ) ; args . put ( "a2" , "a2" ) ; "<AssertPlaceHolder>" ; } format ( java . lang . String , java . util . Map ) { return cn . bc . core . util . FreeMarkerUtils . format ( tpl , ( ( java . lang . Object ) ( args ) ) ) ; }
|
org . junit . Assert . assertEquals ( "name" , cn . bc . core . util . FreeMarkerUtils . format ( tpl , args ) )
|
rasterizeToTemporaryResourceReturnsNullOnExceptions ( ) { org . xwiki . resource . temporary . TemporaryResourceReference tref = this . mocker . getComponentUnderTest ( ) . rasterizeToTemporaryResource ( org . xwiki . platform . svg . internal . BatikSVGRasterizerTest . INVALID_SVG , 0 , 0 ) ; "<AssertPlaceHolder>" ; } rasterizeToTemporaryResource ( java . lang . String , int , int ) { return rasterizeToTemporaryResource ( content , width , height , getCurrentDocument ( ) ) ; }
|
org . junit . Assert . assertNull ( tref )
|
isServerTypeValid_invalid_serverTypeNotMatching ( ) { org . oscm . app . ror . client . RORClient rorClient = mock ( org . oscm . app . ror . client . RORClient . class ) ; parameters . put ( PropertyHandler . VSERVER_TYPE , new org . oscm . app . v2_0 . data . Setting ( org . oscm . app . iaas . PropertyHandler . VSERVER_TYPE , SERVERTYPE2 ) ) ; java . util . List < java . lang . String > serverList = new java . util . ArrayList ( ) ; serverList . add ( SERVERTYPE1 ) ; doReturn ( rorClient ) . when ( rorVServerCommunication ) . getVdcClient ( paramHandler ) ; doReturn ( serverList ) . when ( rorClient ) . listServerTypes ( ) ; boolean isServerTypeValid = rorVServerCommunication . isServerTypeValid ( paramHandler ) ; "<AssertPlaceHolder>" ; } isServerTypeValid ( org . oscm . app . iaas . PropertyHandler ) { return true ; }
|
org . junit . Assert . assertFalse ( isServerTypeValid )
|
testDeleteAllFolders ( ) { com . liferay . portal . kernel . model . Group group = com . liferay . portal . kernel . test . util . GroupTestUtil . addGroup ( ) ; com . liferay . journal . model . JournalFolder parentFolder = com . liferay . journal . test . util . JournalTestUtil . addFolder ( group . getGroupId ( ) , "parent" ) ; com . liferay . journal . model . JournalFolder childFolder = com . liferay . journal . test . util . JournalTestUtil . addFolder ( group . getGroupId ( ) , parentFolder . getFolderId ( ) , "child" ) ; com . liferay . journal . service . JournalFolderLocalServiceUtil . moveFolderToTrash ( com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) , childFolder . getFolderId ( ) ) ; com . liferay . journal . service . JournalFolderLocalServiceUtil . moveFolderToTrash ( com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) , parentFolder . getFolderId ( ) ) ; com . liferay . journal . service . JournalFolderLocalServiceUtil . deleteFolder ( parentFolder . getFolderId ( ) , false ) ; com . liferay . portal . kernel . service . GroupLocalServiceUtil . deleteGroup ( group ) ; java . util . List < com . liferay . journal . model . JournalFolder > folders = com . liferay . journal . service . JournalFolderLocalServiceUtil . getFolders ( group . getGroupId ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( folders . toString ( ) , 0 , folders . size ( ) )
|
testDoFilterInternalMetExceptie ( ) { final nl . bzk . brp . beheer . webapp . configuratie . LogFilter logFilter = new nl . bzk . brp . beheer . webapp . configuratie . LogFilter ( ) ; org . mockito . Mockito . when ( request . getHeader ( "Access-Control-Request-Method" ) ) . thenReturn ( "GET" ) ; org . mockito . Mockito . when ( request . getAuthType ( ) ) . thenReturn ( "EenAuthMethode" ) ; org . mockito . Mockito . when ( request . getRemoteHost ( ) ) . thenReturn ( "123.123.123.123" ) ; org . mockito . Mockito . when ( request . getRequestURL ( ) ) . thenReturn ( new java . lang . StringBuffer ( "http://een.test.url" ) ) ; org . mockito . Mockito . when ( request . getParameter ( "Eerste" ) ) . thenReturn ( "EersteWaarde" ) ; org . mockito . Mockito . when ( request . getParameter ( "Tweede" ) ) . thenReturn ( "TweedeWaarde" ) ; final java . util . Enumeration < java . lang . String > enumParameters = new java . util . Enumeration < java . lang . String > ( ) { private java . util . List < java . lang . String > waarden = java . util . Arrays . asList ( "Eerste" , "Tweede" ) ; private int counter ; @ nl . bzk . brp . beheer . webapp . configuratie . Override public boolean hasMoreElements ( ) { return ( counter ) < 2 ; } @ nl . bzk . brp . beheer . webapp . configuratie . Override public java . lang . String nextElement ( ) { return waarden . get ( ( ( counter ) ++ ) ) ; } } ; org . mockito . Mockito . when ( request . getParameterNames ( ) ) . thenReturn ( enumParameters ) ; org . mockito . Mockito . when ( response . getStatus ( ) ) . thenReturn ( HttpServletResponse . SC_UNAUTHORIZED ) ; org . mockito . Mockito . doThrow ( new java . io . IOException ( "test" ) ) . when ( chain ) . doFilter ( request , response ) ; try { logFilter . doFilterInternal ( request , response , chain ) ; org . junit . Assert . fail ( ) ; } catch ( java . io . IOException | javax . servlet . ServletException ex ) { "<AssertPlaceHolder>" ; } } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , events . size ( ) )
|
testGetArrivalsAndDeparturesForStopInTimeRange01 ( ) { org . onebusaway . realtime . api . TimepointPredictionRecord tprA = new org . onebusaway . realtime . api . TimepointPredictionRecord ( ) ; tprA . setTimepointId ( mStopA . getId ( ) ) ; long tprATime = createPredictedTime ( time ( 13 , 30 ) ) ; tprA . setTimepointPredictedArrivalTime ( tprATime ) ; tprA . setTripId ( mTrip1 . getId ( ) ) ; org . onebusaway . realtime . api . TimepointPredictionRecord tprB = new org . onebusaway . realtime . api . TimepointPredictionRecord ( ) ; tprB . setTimepointId ( mStopB . getId ( ) ) ; long tprBTime = createPredictedTime ( time ( 13 , 50 ) ) ; tprB . setTimepointPredictedArrivalTime ( tprBTime ) ; tprB . setTripId ( mTrip1 . getId ( ) ) ; java . util . List < org . onebusaway . transit_data_federation . services . realtime . ArrivalAndDepartureInstance > arrivalsAndDepartures = getArrivalsAndDeparturesForStopInTimeRangeByTimepointPredictionRecord ( java . util . Arrays . asList ( tprA , tprB ) ) ; long predictedArrivalTime = getPredictedArrivalTimeByStopId ( arrivalsAndDepartures , mStopB . getId ( ) ) ; "<AssertPlaceHolder>" ; } getTimepointPredictedArrivalTime ( ) { return timepointPredictedArrivalTime ; }
|
org . junit . Assert . assertEquals ( tprB . getTimepointPredictedArrivalTime ( ) , predictedArrivalTime )
|
testReplaceBaseCallWithParameters ( ) { java . lang . String input = "result<sp>=<sp>this.base(<sp>arguments,<sp>23,<sp>'foo'<sp>);" ; org . eclipse . rap . clientbuilder . TokenList tokens = org . eclipse . rap . clientbuilder . TestUtil . parse ( input ) ; org . eclipse . rap . clientbuilder . QxCodeCleaner cleaner = new org . eclipse . rap . clientbuilder . QxCodeCleaner ( tokens ) ; cleaner . cleanupQxCode ( ) ; java . lang . String expected = "result<sp>=<sp>arguments.callee.base.call<sp>(<sp>this,<sp>23,<sp>\"foo\"<sp>);" ; "<AssertPlaceHolder>" ; } printTokens ( org . eclipse . rap . clientbuilder . TokenList ) { return org . eclipse . rap . clientbuilder . JavaScriptPrinter . printTokens ( tokens , 0 , ( ( tokens . size ( ) ) - 1 ) ) ; }
|
org . junit . Assert . assertEquals ( expected , org . eclipse . rap . clientbuilder . JavaScriptPrinter . printTokens ( tokens ) )
|
testIsCurrent_Current ( ) { org . terasoluna . gfw . web . pagination . PaginationInfo info = new org . terasoluna . gfw . web . pagination . PaginationInfo ( page , pathTmpl , queryTmpl , 0 ) ; boolean result = info . isCurrent ( 5 ) ; "<AssertPlaceHolder>" ; } isCurrent ( int ) { return ( current ) == page ; }
|
org . junit . Assert . assertTrue ( result )
|
testGetSlot ( ) { d_pm . addSlot ( ) ; d_pm . getSlot ( 0 ) . setValue ( d_ade2 ) ; "<AssertPlaceHolder>" ; } getSlot ( int ) { return d_slots . get ( idx ) ; }
|
org . junit . Assert . assertEquals ( d_ade2 , d_pm . getSlot ( 0 ) . getValue ( ) )
|
assertOptimizeAlwaysFalseRangeConditions ( ) { org . apache . shardingsphere . core . parse . old . parser . context . condition . Condition condition1 = new org . apache . shardingsphere . core . parse . old . parser . context . condition . Condition ( new org . apache . shardingsphere . core . parse . old . parser . context . condition . Column ( "column" , "tbl" ) , new org . apache . shardingsphere . core . parse . old . parser . expression . SQLNumberExpression ( 1 ) , new org . apache . shardingsphere . core . parse . old . parser . expression . SQLNumberExpression ( 2 ) ) ; org . apache . shardingsphere . core . parse . old . parser . context . condition . Condition condition2 = new org . apache . shardingsphere . core . parse . old . parser . context . condition . Condition ( new org . apache . shardingsphere . core . parse . old . parser . context . condition . Column ( "column" , "tbl" ) , new org . apache . shardingsphere . core . parse . old . parser . expression . SQLNumberExpression ( 3 ) , new org . apache . shardingsphere . core . parse . old . parser . expression . SQLNumberExpression ( 4 ) ) ; org . apache . shardingsphere . core . parse . old . parser . context . condition . AndCondition andCondition = new org . apache . shardingsphere . core . parse . old . parser . context . condition . AndCondition ( ) ; andCondition . getConditions ( ) . add ( condition1 ) ; andCondition . getConditions ( ) . add ( condition2 ) ; org . apache . shardingsphere . core . parse . old . parser . context . condition . OrCondition orCondition = new org . apache . shardingsphere . core . parse . old . parser . context . condition . OrCondition ( ) ; orCondition . getAndConditions ( ) . add ( andCondition ) ; org . apache . shardingsphere . core . optimize . condition . ShardingConditions shardingConditions = new org . apache . shardingsphere . core . optimize . engine . sharding . query . QueryOptimizeEngine ( orCondition , java . util . Collections . emptyList ( ) ) . optimize ( ) . getShardingConditions ( ) ; "<AssertPlaceHolder>" ; } isAlwaysFalse ( ) { if ( shardingConditions . isEmpty ( ) ) { return false ; } for ( org . apache . shardingsphere . core . optimize . condition . ShardingCondition each : shardingConditions ) { if ( ! ( each instanceof org . apache . shardingsphere . core . optimize . engine . sharding . query . AlwaysFalseShardingCondition ) ) { return false ; } } return true ; }
|
org . junit . Assert . assertTrue ( shardingConditions . isAlwaysFalse ( ) )
|
buildConversationIdHeaderCreatingContainer ( ) { java . lang . String kieServerId = "KieServerId" ; org . kie . server . api . KieServerEnvironment . setServerId ( kieServerId ) ; org . kie . server . services . impl . KieContainerInstanceImpl containerInstanceImpl = new org . kie . server . services . impl . KieContainerInstanceImpl ( org . kie . server . remote . rest . common . util . RestUtilsTest . CONTAINER_ID , org . kie . server . api . model . KieContainerStatus . CREATING ) ; when ( registry . getContainer ( org . kie . server . remote . rest . common . util . RestUtilsTest . CONTAINER_ID ) ) . thenReturn ( containerInstanceImpl ) ; org . kie . server . remote . rest . common . Header conversationIdHeader = org . kie . server . remote . rest . common . util . RestUtils . buildConversationIdHeader ( org . kie . server . remote . rest . common . util . RestUtilsTest . CONTAINER_ID , registry , headers ) ; "<AssertPlaceHolder>" ; } buildConversationIdHeader ( java . lang . String , org . kie . server . services . api . KieServerRegistry , javax . ws . rs . core . HttpHeaders ) { java . util . List < java . lang . String > conversationIdHeader = headers . getRequestHeader ( KieServerConstants . KIE_CONVERSATION_ID_TYPE_HEADER ) ; if ( ( conversationIdHeader != null ) && ( ! ( conversationIdHeader . isEmpty ( ) ) ) ) { return new org . kie . server . remote . rest . common . Header ( org . kie . server . api . KieServerConstants . KIE_CONVERSATION_ID_TYPE_HEADER , conversationIdHeader . get ( 0 ) ) ; } org . kie . server . services . impl . KieContainerInstanceImpl container = registry . getContainer ( containerId ) ; if ( ( container != null ) && ( KieContainerStatus . STARTED . equals ( container . getStatus ( ) ) ) ) { org . kie . server . api . model . ReleaseId releaseId = container . getResource ( ) . getResolvedReleaseId ( ) ; if ( releaseId == null ) { releaseId = container . getResource ( ) . getReleaseId ( ) ; } java . lang . String conversationId = org . kie . server . api . ConversationId . from ( org . kie . server . api . KieServerEnvironment . getServerId ( ) , containerId , releaseId ) . toString ( ) ; return new org . kie . server . remote . rest . common . Header ( org . kie . server . api . KieServerConstants . KIE_CONVERSATION_ID_TYPE_HEADER , conversationId ) ; } return null ; }
|
org . junit . Assert . assertNull ( conversationIdHeader )
|
test ( ) { jsprit . core . problem . VehicleRoutingProblem . Builder builder = VehicleRoutingProblem . Builder . newInstance ( ) ; new jsprit . core . problem . io . VrpXMLReader ( builder ) . read ( "src/test/resources/pdp.xml" ) ; jsprit . core . problem . VehicleRoutingProblem vrp = builder . build ( ) ; final jsprit . core . algorithm . state . StateManager stateManager = new jsprit . core . algorithm . state . StateManager ( vrp ) ; stateManager . updateLoadStates ( ) ; stateManager . addStateUpdater ( new jsprit . core . algorithm . state . UpdateVariableCosts ( vrp . getActivityCosts ( ) , vrp . getTransportCosts ( ) , stateManager ) ) ; jsprit . core . problem . constraint . ConstraintManager constraintManager = new jsprit . core . problem . constraint . ConstraintManager ( vrp , stateManager ) ; constraintManager . addLoadConstraint ( ) ; jsprit . core . problem . vehicle . VehicleFleetManager fleetManager = new jsprit . core . problem . vehicle . InfiniteFleetManagerFactory ( vrp . getVehicles ( ) ) . createFleetManager ( ) ; jsprit . core . algorithm . recreate . BestInsertionBuilder bestIBuilder = new jsprit . core . algorithm . recreate . BestInsertionBuilder ( vrp , fleetManager , stateManager , constraintManager ) ; jsprit . core . algorithm . recreate . InsertionStrategy bestInsertion = bestIBuilder . build ( ) ; jsprit . core . algorithm . ruin . RuinStrategy radial = new jsprit . core . algorithm . ruin . RadialRuinStrategyFactory ( 0.3 , new jsprit . core . algorithm . ruin . distance . AvgServiceAndShipmentDistance ( vrp . getTransportCosts ( ) ) ) . createStrategy ( vrp ) ; jsprit . core . algorithm . ruin . RuinStrategy random = new jsprit . core . algorithm . ruin . RandomRuinStrategyFactory ( 0.5 ) . createStrategy ( vrp ) ; jsprit . core . problem . solution . SolutionCostCalculator solutionCostCalculator = new jsprit . core . problem . solution . SolutionCostCalculator ( ) { @ jsprit . core . algorithm . Override public double getCosts ( jsprit . core . problem . solution . VehicleRoutingProblemSolution solution ) { double costs = 0.0 ; for ( jsprit . core . problem . solution . route . VehicleRoute route : solution . getRoutes ( ) ) { costs += stateManager . getRouteState ( route , InternalStates . COSTS , jsprit . core . algorithm . Double . class ) ; } return costs ; } } ; jsprit . core . algorithm . SearchStrategy randomStrategy = new jsprit . core . algorithm . SearchStrategy ( "random" , new jsprit . core . algorithm . selector . SelectBest ( ) , new jsprit . core . algorithm . acceptor . GreedyAcceptance ( 1 ) , solutionCostCalculator ) ; jsprit . core . algorithm . module . RuinAndRecreateModule randomModule = new jsprit . core . algorithm . module . RuinAndRecreateModule ( "randomRuin_bestInsertion" , bestInsertion , random ) ; randomStrategy . addModule ( randomModule ) ; jsprit . core . algorithm . SearchStrategy radialStrategy = new jsprit . core . algorithm . SearchStrategy ( "radial" , new jsprit . core . algorithm . selector . SelectBest ( ) , new jsprit . core . algorithm . acceptor . GreedyAcceptance ( 1 ) , solutionCostCalculator ) ; jsprit . core . algorithm . module . RuinAndRecreateModule radialModule = new jsprit . core . algorithm . module . RuinAndRecreateModule ( "radialRuin_bestInsertion" , bestInsertion , radial ) ; radialStrategy . addModule ( radialModule ) ; jsprit . core . algorithm . SearchStrategyManager strategyManager = new jsprit . core . algorithm . SearchStrategyManager ( ) ; strategyManager . addStrategy ( radialStrategy , 0.5 ) ; strategyManager . addStrategy ( randomStrategy , 0.5 ) ; jsprit . core . algorithm . VehicleRoutingAlgorithm vra = new jsprit . core . algorithm . VehicleRoutingAlgorithm ( vrp , strategyManager ) ; vra . addListener ( stateManager ) ; vra . addListener ( new jsprit . core . algorithm . RemoveEmptyVehicles ( fleetManager ) ) ; jsprit . core . problem . solution . VehicleRoutingProblemSolution iniSolution = new jsprit . core . algorithm . InsertionInitialSolutionFactory ( bestInsertion , solutionCostCalculator ) . createSolution ( vrp ) ; vra . addInitialSolution ( iniSolution ) ; vra . setMaxIterations ( 3 ) ; java . util . Collection < jsprit . core . problem . solution . VehicleRoutingProblemSolution > solutions = vra . searchSolutions ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( ( ! ( solutions . isEmpty ( ) ) ) )
|
should_return_value_of_expression_passed_in ( ) { java . util . Optional < java . lang . String > result = uk . co . benjiweber . expressions . NullSafe . nullSafe ( ( ) -> foo . foo ( ) . bar ( ) . baz ( ) ) ; "<AssertPlaceHolder>" ; } baz ( ) { return "baz" ; }
|
org . junit . Assert . assertEquals ( "baz" , result . get ( ) )
|
testIsLocalJobExecution ( ) { final javax . management . DynamicMBean mockEndpointInfo = mockery . mock ( javax . management . DynamicMBean . class ) ; final com . ibm . websphere . kernel . server . ServerInfoMBean mockServerInfo = mockery . mock ( com . ibm . websphere . kernel . server . ServerInfoMBean . class ) ; final com . ibm . jbatch . container . ws . WSJobExecution mockWSJobExecution = mockery . mock ( com . ibm . jbatch . container . ws . WSJobExecution . class ) ; final int port = 1234 ; final java . lang . String host = "*" ; final java . lang . String defaultHostname = "def.com" ; final java . lang . String jobExecRestUrl = ( ( ( "https://" + defaultHostname ) + ":" ) + port ) + "/ibm/api/batch" ; final java . lang . String userDir = "/wlp/usr/" ; final java . lang . String serverName = "myserver" ; final java . lang . String jobExecServerId = ( ( defaultHostname + "/" ) + userDir ) + serverName ; mockery . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockEndpointInfo ) . getAttribute ( "Host" ) ; will ( returnValue ( host ) ) ; oneOf ( mockEndpointInfo ) . getAttribute ( "Port" ) ; will ( returnValue ( port ) ) ; oneOf ( mockServerInfo ) . getDefaultHostname ( ) ; will ( returnValue ( defaultHostname ) ) ; allowing ( mockWSJobExecution ) . getRestUrl ( ) ; will ( returnValue ( jobExecRestUrl ) ) ; oneOf ( mockWSJobExecution ) . getServerId ( ) ; will ( returnValue ( jobExecServerId ) ) ; } } ) ; com . ibm . jbatch . container . ws . impl . BatchLocationServiceImpl batchLocationService = new com . ibm . jbatch . container . ws . impl . BatchLocationServiceImpl ( ) ; batchLocationService . setServerInfoMBean ( mockServerInfo ) ; batchLocationService . setEndPointInfoMBean ( mockEndpointInfo ) ; "<AssertPlaceHolder>" ; } isLocalJobExecution ( long ) { javax . batch . runtime . JobExecution jobExecution = javax . batch . runtime . BatchRuntime . getJobOperator ( ) . getJobExecution ( executionId ) ; return jobExecution instanceof com . ibm . jbatch . container . ws . WSJobExecution ? isLocalJobExecution ( ( ( com . ibm . jbatch . container . ws . WSJobExecution ) ( jobExecution ) ) ) : true ; }
|
org . junit . Assert . assertTrue ( batchLocationService . isLocalJobExecution ( mockWSJobExecution ) )
|
testSingleElement ( ) { org . antlr . v4 . runtime . misc . IntervalSet s = org . antlr . v4 . runtime . misc . IntervalSet . of ( 99 ) ; java . lang . String expecting = "99" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( a ) + ".." ) + ( b ) ; }
|
org . junit . Assert . assertEquals ( s . toString ( ) , expecting )
|
when_pdroute_futureMaxLoatAtAct2ShouldBe10 ( ) { stateManager . informInsertionStarts ( java . util . Arrays . asList ( pickup_delivery_route ) , java . util . Collections . < com . graphhopper . jsprit . core . algorithm . state . Job > emptyList ( ) ) ; com . graphhopper . jsprit . core . algorithm . state . Capacity atAct2 = stateManager . getActivityState ( pickup_delivery_route . getActivities ( ) . get ( 1 ) , InternalStates . FUTURE_MAXLOAD , com . graphhopper . jsprit . core . algorithm . state . Capacity . class ) ; "<AssertPlaceHolder>" ; } get ( com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute ) { return com . graphhopper . jsprit . core . algorithm . state . Arrays . asList ( route . getVehicle ( ) ) ; }
|
org . junit . Assert . assertEquals ( 10 , atAct2 . get ( 0 ) )
|
testParseNegativeBoth ( ) { java . lang . String source = ( ( ( "-1" + ( getDecimalCharacter ( ) ) ) + "232323232323<sp>-<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "434343434343i" ; org . apache . commons . numbers . complex . Complex expected = org . apache . commons . numbers . complex . Complex . ofCartesian ( ( - 1.232323232323 ) , ( - 1.434343434343 ) ) ; org . apache . commons . numbers . complex . Complex actual = complexFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . text . ParsePosition parsePosition = new java . text . ParsePosition ( 0 ) ; org . apache . commons . math4 . geometry . euclidean . twod . Vector2D result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { throw new org . apache . commons . math4 . exception . MathParseException ( source , parsePosition . getErrorIndex ( ) , org . apache . commons . math4 . geometry . euclidean . twod . Vector2D . class ) ; } return result ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testIdentity ( ) { io . ebeaninternal . api . SpiEbeanServer server = spiEbeanServer ( ) ; io . ebean . config . dbplatform . IdType idType = server . getDatabasePlatform ( ) . getDbIdentity ( ) . getIdType ( ) ; if ( ! ( IdType . IDENTITY . equals ( idType ) ) ) { return ; } try ( io . ebean . Transaction tx = server . beginTransaction ( ) ) { org . tests . idkeys . db . GenKeyIdentity al = new org . tests . idkeys . db . GenKeyIdentity ( ) ; al . setDescription ( "my<sp>description" ) ; server . save ( al ) ; tx . commit ( ) ; "<AssertPlaceHolder>" ; } } getId ( ) { return id ; }
|
org . junit . Assert . assertNotNull ( al . getId ( ) )
|
testEmptyBindInputs ( ) { java . util . List < io . cloudslang . lang . entities . bindings . Input > inputs = java . util . Collections . emptyList ( ) ; java . util . Map < java . lang . String , io . cloudslang . lang . entities . bindings . values . Value > result = bindInputs ( inputs ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return stack . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( result . isEmpty ( ) )
|
testIfVersionReturnedByInfoPackageMatchesFrameworkVersion_shouldWork ( ) { java . lang . String versionOfBundleReturnedOnPage = getVersionReturnedByWebpage ( ) ; java . lang . String versionOfBundleItself = getBundleVersion ( ) ; "<AssertPlaceHolder>" ; } getBundleVersion ( ) { org . osgi . framework . Bundle [ ] bundles = getBundleContext ( ) . getBundles ( ) ; for ( int i = 0 ; i < ( bundles . length ) ; i ++ ) { if ( bundles [ i ] . getSymbolicName ( ) . equals ( "org.openengsb.framework.info" ) ) { return bundles [ i ] . getVersion ( ) . toString ( ) . trim ( ) ; } } return null ; }
|
org . junit . Assert . assertThat ( versionOfBundleReturnedOnPage , org . hamcrest . CoreMatchers . equalTo ( versionOfBundleItself ) )
|
testKindWasNogNietGeborenOpDatumOverlijden ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > overtreders = brby0909 . voerRegelUit ( maakHuidigePersoon ( false , 20100101 ) , maakNieuwePersoon ( 20090101 ) , null , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , overtreders . size ( ) )
|
hashIndexTable_remove_doesNotChangePrecedingElements ( ) { com . restfb . json . JsonObject . HashIndexTable indexTable = new com . restfb . json . JsonObject . HashIndexTable ( ) ; indexTable . add ( "foo" , 23 ) ; indexTable . add ( "bar" , 42 ) ; indexTable . remove ( 42 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { int slot = hashSlotFor ( name ) ; return ( ( hashTable [ slot ] ) & 255 ) - 1 ; }
|
org . junit . Assert . assertEquals ( 23 , indexTable . get ( "foo" ) )
|
testSecureSourceWhileChannelInactive ( ) { final java . net . InetSocketAddress remoteAddress = new java . net . InetSocketAddress ( "192.168.1.22" , 2727 ) ; final io . netty . channel . Channel channel = org . mockito . Mockito . mock ( io . netty . channel . Channel . class ) ; final io . netty . channel . ChannelFuture connectFuture = org . mockito . Mockito . mock ( io . netty . channel . ChannelFuture . class ) ; final org . restcomm . media . core . network . netty . filter . NetworkGuard guard = new org . restcomm . media . core . network . netty . filter . SbcNetworkGuard ( ) ; org . mockito . Mockito . when ( channel . isActive ( ) ) . thenReturn ( false ) ; org . mockito . Mockito . when ( channel . remoteAddress ( ) ) . thenReturn ( null ) ; org . mockito . Mockito . when ( channel . connect ( remoteAddress ) ) . thenReturn ( connectFuture ) ; org . mockito . Mockito . when ( connectFuture . isSuccess ( ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( connectFuture . sync ( ) ) . thenReturn ( connectFuture ) ; final boolean secure = guard . isSecure ( channel , remoteAddress ) ; "<AssertPlaceHolder>" ; } isSecure ( org . restcomm . media . core . network . deprecated . channel . NetworkChannel , java . net . InetSocketAddress ) { if ( channel . isConnected ( ) ) { return channel . getRemoteAddress ( ) . equals ( source ) ; } return false ; }
|
org . junit . Assert . assertTrue ( secure )
|
testSchemeWithNoStuff3 ( ) { com . ning . atlas . spi . Uri < ? > uri = com . ning . atlas . spi . Uri . valueOf ( "rds" , com . google . common . collect . ImmutableMap . < java . lang . String , java . util . Collection < java . lang . String > > of ( "hello" , java . util . Arrays . asList ( "world" ) ) ) ; com . ning . atlas . spi . Uri < ? > dup = com . ning . atlas . spi . Uri . valueOf ( uri . toString ( ) ) ; "<AssertPlaceHolder>" ; } getScheme ( ) { return scheme ; }
|
org . junit . Assert . assertThat ( dup . getScheme ( ) , org . hamcrest . CoreMatchers . equalTo ( "rds" ) )
|
testGo ( ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintStream ps = new java . io . PrintStream ( baos ) ; new org . drools . example . api . namedkiesessionfromfile . NamedKieSessionFromFileExample ( ) . go ( ps ) ; ps . close ( ) ; java . lang . String actual = new java . lang . String ( baos . toByteArray ( ) ) ; java . lang . String expected = ( ( ( "" + "Dave:<sp>Hello,<sp>HAL.<sp>Do<sp>you<sp>read<sp>me,<sp>HAL?" ) + ( org . drools . example . api . namedkiesessionfromfile . NamedKieSessionFromFileExampleTest . NL ) ) + "HAL:<sp>Dave.<sp>I<sp>read<sp>you." ) + ( org . drools . example . api . namedkiesessionfromfile . NamedKieSessionFromFileExampleTest . NL ) ; "<AssertPlaceHolder>" ; } toByteArray ( ) { java . io . ByteArrayOutputStream buf = new java . io . ByteArrayOutputStream ( ) ; try { java . io . ObjectOutputStream out = new java . io . ObjectOutputStream ( buf ) ; out . writeObject ( xjcOpts ) ; out . writeObject ( systemId ) ; out . writeObject ( classes ) ; out . close ( ) ; } catch ( java . io . IOException e ) { logger . error ( "Error<sp>serializing<sp>decision<sp>table<sp>configuration." , e ) ; } return buf . toByteArray ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testSFBug585811 ( ) { java . lang . String smiles = "CC(C(C8CCC(CC8)=O)C3C4C(CC5(CCC(C9=CC(C=CN%10)=C%10C=C9)CCCC5)C4)C2CCC1CCC7(CCC7)C6(CC6)C1C2C3)=O" ; org . openscience . cdk . interfaces . IAtomContainer mol = org . openscience . cdk . smiles . SmilesParserTest . sp . parseSmiles ( smiles ) ; "<AssertPlaceHolder>" ; } getAtomCount ( ) { return this . atomCount ; }
|
org . junit . Assert . assertTrue ( ( ( mol . getAtomCount ( ) ) > 0 ) )
|
testDefaultValue ( ) { field . setValue ( "sample" ) ; view . initialize ( field , child ) ; "<AssertPlaceHolder>" ; } getText ( ) { java . lang . CharSequence text = getEditTextView ( ) . getText ( ) ; return text == null ? null : text . toString ( ) ; }
|
org . junit . Assert . assertThat ( view . getText ( ) , org . hamcrest . CoreMatchers . equalTo ( "sample" ) )
|
whenAddingTwoVehiclesWithSameTypeIdStartAndEndLocationAndWorkingShift_getAvailableVehicleShouldReturnOnlyOneOfThem ( ) { jsprit . core . problem . vehicle . VehicleTypeImpl type = VehicleTypeImpl . Builder . newInstance ( "standard" ) . build ( ) ; jsprit . core . problem . vehicle . Vehicle v1 = VehicleImpl . Builder . newInstance ( "v1" ) . setStartLocation ( jsprit . core . problem . Location . newInstance ( "loc" ) ) . setEndLocation ( jsprit . core . problem . Location . newInstance ( "endLoc" ) ) . setType ( type ) . setEarliestStart ( 0.0 ) . setLatestArrival ( 10.0 ) . build ( ) ; jsprit . core . problem . vehicle . Vehicle v2 = VehicleImpl . Builder . newInstance ( "v2" ) . setStartLocation ( jsprit . core . problem . Location . newInstance ( "loc" ) ) . setEndLocation ( jsprit . core . problem . Location . newInstance ( "endLoc" ) ) . setType ( type ) . setEarliestStart ( 0.0 ) . setLatestArrival ( 10.0 ) . build ( ) ; jsprit . core . problem . vehicle . VehicleFleetManager fleetManager = new jsprit . core . problem . vehicle . FiniteFleetManagerFactory ( java . util . Arrays . asList ( v1 , v2 ) ) . createFleetManager ( ) ; java . util . Collection < jsprit . core . problem . vehicle . Vehicle > vehicles = fleetManager . getAvailableVehicles ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 1 , vehicles . size ( ) )
|
charge_invoice ( ) { org . oscm . psp . data . ChargingData chargingData = createChargingData ( ) ; org . oscm . psp . data . RequestData requestData = createRequestData ( org . oscm . paymentservice . bean . PaymentServiceProviderBeanTest . INVOICE ) ; org . oscm . payproc . stubs . PostMethodStub . setStubReturnValue ( org . oscm . paymentservice . bean . PaymentServiceProviderBeanTest . sampleResponse ) ; org . oscm . psp . data . ChargingResult chargingResult = psp . charge ( requestData , chargingData ) ; "<AssertPlaceHolder>" ; } charge ( org . oscm . psp . data . RequestData , org . oscm . psp . data . ChargingData ) { return delegate . charge ( data , chargingData ) ; }
|
org . junit . Assert . assertNotNull ( chargingResult )
|
testDisaster ( ) { com . cloudera . science . matching . VertexData d1 = new com . cloudera . science . matching . VertexData ( "1" , true , com . google . common . collect . ImmutableMap . of ( "3" , 3 ) ) ; com . cloudera . science . matching . VertexData d2 = new com . cloudera . science . matching . VertexData ( "2" , true , com . google . common . collect . ImmutableMap . of ( "3" , 1 ) ) ; com . cloudera . science . matching . VertexData d3 = new com . cloudera . science . matching . VertexData ( "3" , false , com . google . common . collect . ImmutableMap . of ( "1" , ( - 1 ) , "2" , ( - 1 ) ) ) ; java . lang . String [ ] data = new java . lang . String [ ] { mapper . writeValueAsString ( d1 ) , mapper . writeValueAsString ( d2 ) , mapper . writeValueAsString ( d3 ) } ; java . util . Map < java . lang . String , com . cloudera . science . matching . VertexData > out = run ( data ) ; "<AssertPlaceHolder>" ; } getMatchId ( ) { return matchId ; }
|
org . junit . Assert . assertTrue ( ( ( out . get ( "1" ) . getMatchId ( ) . equals ( "" ) ) || ( out . get ( "2" ) . getMatchId ( ) . equals ( "" ) ) ) )
|
testPreorderList ( ) { "<AssertPlaceHolder>" ; } preorderList ( ) { return com . google . common . collect . Lists . newArrayList ( preorderIterator ( ) ) ; }
|
org . junit . Assert . assertThat ( a . preorderList ( ) , org . hamcrest . CoreMatchers . is ( com . google . common . collect . Lists . newArrayList ( a , b , c , f , d , e ) ) )
|
shouldAllowSubclassesToReferenceParentElement ( ) { com . redhat . darcy . ui . AbstractViewElement viewElement = new com . redhat . darcy . ui . AbstractViewElement ( com . redhat . darcy . ui . By . id ( "parent" ) ) { } ; "<AssertPlaceHolder>" ; } id ( java . lang . String ) { return new com . redhat . darcy . ui . By . ById ( id ) ; }
|
org . junit . Assert . assertNotNull ( viewElement . parent )
|
matchDirectPath ( ) { ch . rasc . wampspring . method . DestinationPatternsMessageCondition condition = ch . rasc . wampspring . method . DestinationPatternsMessageConditionTest . condition ( "/foo" ) ; ch . rasc . wampspring . method . DestinationPatternsMessageCondition match = condition . getMatchingCondition ( ch . rasc . wampspring . method . DestinationPatternsMessageConditionTest . messageTo ( "/foo" ) ) ; "<AssertPlaceHolder>" ; } messageTo ( java . lang . String ) { return new ch . rasc . wampspring . message . CallMessage ( java . util . UUID . randomUUID ( ) . toString ( ) , destination ) ; }
|
org . junit . Assert . assertNotNull ( match )
|
deveObterVersaoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . evento . cancelamento . NFRetornoCancelamento cancelamento = new com . fincatto . documentofiscal . nfe310 . classes . evento . cancelamento . NFRetornoCancelamento ( ) ; final java . lang . String versao = "3.10" ; cancelamento . setVersao ( versao ) ; "<AssertPlaceHolder>" ; } getVersao ( ) { return this . versao ; }
|
org . junit . Assert . assertEquals ( "3.10" , cancelamento . getVersao ( ) )
|
translateCatalogException ( ) { final org . sentilo . web . catalog . exception . CatalogException ex = new org . sentilo . web . catalog . exception . CatalogException ( errorMessageKey ) ; try { interceptor . doTranslationAction ( ex ) ; } catch ( final org . sentilo . web . catalog . exception . CatalogException e ) { "<AssertPlaceHolder>" ; } } doTranslationAction ( java . lang . RuntimeException ) { platformExceptionTranslator . translateExceptionIfPossible ( ex ) ; }
|
org . junit . Assert . assertEquals ( ex , e )
|
shouldReturnAbsentForSearchingOnEmptyString ( ) { edu . stanford . bmir . protege . web . shared . search . EntityNameMatcher matcher = new edu . stanford . bmir . protege . web . shared . search . EntityNameMatcher ( "a" ) ; java . util . Optional < edu . stanford . bmir . protege . web . shared . search . EntityNameMatchResult > result = matcher . findIn ( "" ) ; "<AssertPlaceHolder>" ; } findIn ( java . lang . String ) { checkNotNull ( entityName ) ; java . util . Optional < edu . stanford . bmir . protege . web . shared . search . EntityNameMatchResult > exactMatchResult = searchForExactEntityNameMatch ( entityName ) ; if ( exactMatchResult . isPresent ( ) ) { return exactMatchResult ; } return searchForBestPartialEntityNameMatch ( entityName ) ; }
|
org . junit . Assert . assertEquals ( false , result . isPresent ( ) )
|
testRemoveSPARQLprefix ( ) { java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; map . put ( "rdfs" , "<http://www.w3.org/2000/01/rdf-schema#>" ) ; map . put ( "xsd" , "<http://www.w3.org/2000/01/rdf-schema#>" ) ; map . put ( "owl" , "<http://www.w3.org/2000/01/rdf-schema#>" ) ; map . put ( "rdf" , "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>" ) ; map . put ( "ex" , "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>" ) ; org . apache . stanbol . commons . owl . RunSingleSPARQL instance = new org . apache . stanbol . commons . owl . RunSingleSPARQL ( owl , map ) ; boolean result = instance . removeSPARQLprefix ( "ex" ) ; if ( result ) { java . util . Map < java . lang . String , java . lang . String > mymap = instance . getSPARQLprefix ( ) ; "<AssertPlaceHolder>" ; } else { org . junit . Assert . fail ( "Some<sp>errors<sp>occur<sp>in<sp>removeSPARQLprefix<sp>of<sp>KReSRunSPARQL." ) ; } } getSPARQLprefix ( ) { return this . sparqlprefix ; }
|
org . junit . Assert . assertEquals ( false , mymap . containsKey ( "ex" ) )
|
testCreateWithExistingProfile ( ) { org . jboss . forge . addon . maven . profiles . ProfileImpl profile = new org . jboss . forge . addon . maven . profiles . ProfileImpl ( ) ; profile . setId ( "testprofile" ) ; org . jboss . forge . addon . maven . profiles . ProfileBuilder profileBuilder = org . jboss . forge . addon . maven . profiles . ProfileBuilder . create ( profile ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertThat ( profileBuilder . getId ( ) , org . hamcrest . CoreMatchers . is ( profile . getId ( ) ) )
|
shouldSupportMultipleBootstrapServers ( ) { final java . util . List < java . lang . String > expectedBootstrapServers = java . util . Arrays . asList ( "broker1:9092" , "broker2:9092" ) ; final java . lang . String bootstrapServersString = org . apache . kafka . common . utils . Utils . join ( expectedBootstrapServers , "," ) ; final java . util . Properties props = new java . util . Properties ( ) ; props . put ( StreamsConfig . APPLICATION_ID_CONFIG , "irrelevant" ) ; props . put ( StreamsConfig . BOOTSTRAP_SERVERS_CONFIG , bootstrapServersString ) ; final org . apache . kafka . streams . StreamsConfig config = new org . apache . kafka . streams . StreamsConfig ( props ) ; final java . util . List < java . lang . String > actualBootstrapServers = config . getList ( StreamsConfig . BOOTSTRAP_SERVERS_CONFIG ) ; "<AssertPlaceHolder>" ; } getList ( java . lang . String ) { return ( ( java . util . List < java . lang . String > ) ( get ( key ) ) ) ; }
|
org . junit . Assert . assertEquals ( expectedBootstrapServers , actualBootstrapServers )
|
testConcavePolygon ( ) { org . openspaces . spatial . shapes . Polygon concavePolygon = org . openspaces . spatial . ShapeFactory . polygon ( org . openspaces . spatial . ShapeFactory . point ( 5 , 5 ) , org . openspaces . spatial . ShapeFactory . point ( 5 , 0 ) , org . openspaces . spatial . ShapeFactory . point ( 2.5 , 2.5 ) , org . openspaces . spatial . ShapeFactory . point ( 0 , 0 ) , org . openspaces . spatial . ShapeFactory . point ( 0 , 5 ) ) ; org . locationtech . spatial4j . shape . Shape spatial4jPolygon = _handler . toShape ( concavePolygon ) ; "<AssertPlaceHolder>" ; } toShape ( java . lang . Object ) { if ( obj instanceof org . openspaces . spatial . spatial4j . Spatial4jShapeProvider ) return ( ( org . openspaces . spatial . spatial4j . Spatial4jShapeProvider ) ( obj ) ) . getSpatial4jShape ( _luceneConfiguration . getSpatialContext ( ) ) ; throw new java . lang . IllegalArgumentException ( ( ( "Unsupported<sp>shape<sp>[" + ( obj . getClass ( ) . getName ( ) ) ) + "]" ) ) ; }
|
org . junit . Assert . assertNotNull ( spatial4jPolygon )
|
testExclude ( ) { com . vividsolutions . jts . geom . Envelope env = ( ( com . vividsolutions . jts . geom . Envelope ) ( Filter . EXCLUDE . accept ( visitor , null ) ) ) ; "<AssertPlaceHolder>" ; } isNull ( ) { return true ; }
|
org . junit . Assert . assertTrue ( env . isNull ( ) )
|
returnsCorrectPercentage ( ) { pipe . actions . gui . ZoomManager zoomUI = new pipe . actions . gui . ZoomUI ( 1 , pipe . views . ZoomUITest . ZOOM_INCREMENT , pipe . views . ZoomUITest . MAX_ZOOM , pipe . views . ZoomUITest . MIN_ZOOM , null ) ; "<AssertPlaceHolder>" ; } getPercentageZoom ( ) { return ( ( int ) ( ( zoom ) * 100 ) ) ; }
|
org . junit . Assert . assertEquals ( 100 , zoomUI . getPercentageZoom ( ) )
|
optional_int_getAsInt ( ) { java . util . OptionalInt optionalInt = java . util . OptionalInt . of ( 90 ) ; "<AssertPlaceHolder>" ; } getAsInt ( ) { return 10 ; }
|
org . junit . Assert . assertEquals ( 90 , optionalInt . getAsInt ( ) , 0 )
|
testGetParametersWithDefaultEntityAndDIsabledStatus ( ) { unit . setActive ( false ) ; org . lnu . is . domain . person . education . PersonEducation entity = new org . lnu . is . domain . person . education . PersonEducation ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "userGroups" , groups ) ; 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 )
|
createsClientWithCustomConnectionName ( ) { com . github . msemys . esjc . EventStore result = com . github . msemys . esjc . EventStoreBuilder . newBuilder ( ) . connectionName ( "test" ) . singleNodeAddress ( "localhost" , 1009 ) . build ( ) ; "<AssertPlaceHolder>" ; } settings ( ) { return settings ; }
|
org . junit . Assert . assertEquals ( "test" , result . settings ( ) . connectionName )
|
testAppendNullByteArrayBuffer ( ) { final org . apache . hc . core5 . util . CharArrayBuffer buffer = new org . apache . hc . core5 . util . CharArrayBuffer ( 8 ) ; buffer . append ( ( ( org . apache . hc . core5 . util . ByteArrayBuffer ) ( null ) ) , 0 , 0 ) ; "<AssertPlaceHolder>" ; } toString ( ) { final java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; builder . append ( "[headerTableSize=" ) . append ( this . headerTableSize ) . append ( ",<sp>pushEnabled=" ) . append ( this . pushEnabled ) . append ( ",<sp>maxConcurrentStreams=" ) . append ( this . maxConcurrentStreams ) . append ( ",<sp>initialWindowSize=" ) . append ( this . initialWindowSize ) . append ( ",<sp>maxFrameSize=" ) . append ( this . maxFrameSize ) . append ( ",<sp>maxHeaderListSize=" ) . append ( this . maxHeaderListSize ) . append ( "]" ) ; return builder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "" , buffer . toString ( ) )
|
runTestReflection5 ( ) { soot . jimple . infoflow . results . InfoflowResults res = analyzeAPKFile ( "Reflection/Reflection5.apk" , null , enableReflectionCallback ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( this . results ) == null ? 0 : this . results . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , res . size ( ) )
|
returnsResultAfterSupplier ( ) { new org . awaitility . classes . Asynch ( fakeRepository ) . perform ( ) ; int value = org . awaitility . Awaitility . await ( ) . until ( new java . util . concurrent . Callable < java . lang . Integer > ( ) { public org . awaitility . Integer call ( ) throws org . awaitility . Exception { return fakeRepository . getValue ( ) ; } } , org . hamcrest . Matchers . greaterThan ( 0 ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return currentConditionValue ; }
|
org . junit . Assert . assertEquals ( 1 , value )
|
dockerOnceRetention1 ( ) { final com . github . kostyasha . yad . DockerSlaveTemplate template = new com . github . kostyasha . yad . DockerSlaveTemplate ( "id" ) ; template . setRetentionStrategy ( new com . github . kostyasha . yad . strategy . DockerOnceRetentionStrategy ( 3 ) ) ; "<AssertPlaceHolder>" ; } notAllowedStrategy ( com . github . kostyasha . yad . DockerSlaveTemplate ) { if ( isNull ( template ) ) { com . github . kostyasha . yad . DockerProvisioningStrategy . LOG . debug ( "Skipping<sp>DockerProvisioningStrategy<sp>because:<sp>template<sp>is<sp>null" ) ; return true ; } final hudson . slaves . RetentionStrategy retentionStrategy = template . getRetentionStrategy ( ) ; if ( isNull ( retentionStrategy ) ) { com . github . kostyasha . yad . DockerProvisioningStrategy . LOG . debug ( "Skipping<sp>DockerProvisioningStrategy<sp>because:<sp>strategy<sp>is<sp>null<sp>for<sp>{}" , template ) ; } if ( retentionStrategy instanceof com . github . kostyasha . yad . strategy . DockerOnceRetentionStrategy ) { if ( ( template . getNumExecutors ( ) ) == 1 ) { com . github . kostyasha . yad . DockerProvisioningStrategy . LOG . debug ( "Applying<sp>faster<sp>provisioning<sp>for<sp>single<sp>executor<sp>template<sp>{}" , template ) ; return false ; } else { com . github . kostyasha . yad . DockerProvisioningStrategy . LOG . debug ( "Skipping<sp>DockerProvisioningStrategy<sp>because:<sp>numExecutors<sp>is<sp>{}<sp>for<sp>{}" , template . getNumExecutors ( ) , template ) ; return true ; } } if ( retentionStrategy instanceof hudson . slaves . RetentionStrategy . Demand ) { com . github . kostyasha . yad . DockerProvisioningStrategy . LOG . debug ( "Applying<sp>faster<sp>provisioning<sp>for<sp>Demand<sp>strategy<sp>for<sp>template<sp>{}" , template ) ; return false ; } com . github . kostyasha . yad . DockerProvisioningStrategy . LOG . trace ( "Skipping<sp>YAD<sp>provisioning<sp>for<sp>unknown<sp>mix<sp>of<sp>configuration<sp>for<sp>{}" , template ) ; return true ; }
|
org . junit . Assert . assertThat ( com . github . kostyasha . yad . DockerProvisioningStrategy . notAllowedStrategy ( template ) , org . hamcrest . Matchers . is ( false ) )
|
givenFooService_whenCallOptionsForAllow_thenReceiveValueOfAllowHeader ( ) { final java . util . Set < org . springframework . http . HttpMethod > optionsForAllow = restTemplate . optionsForAllow ( org . baeldung . client . RestTemplateBasicLiveTest . fooResourceUrl ) ; final org . springframework . http . HttpMethod [ ] supportedMethods = new org . springframework . http . HttpMethod [ ] { org . springframework . http . HttpMethod . GET , org . springframework . http . HttpMethod . POST , org . springframework . http . HttpMethod . HEAD } ; "<AssertPlaceHolder>" ; } containsAll ( java . util . Collection ) { for ( java . lang . Object o : collection ) { if ( ! ( contains ( o ) ) ) { return false ; } } return true ; }
|
org . junit . Assert . assertTrue ( optionsForAllow . containsAll ( java . util . Arrays . asList ( supportedMethods ) ) )
|
setFiles ( ) { java . util . TreeSet < java . lang . String > files = new java . util . TreeSet < java . lang . String > ( ) ; files . add ( "file1.file" ) ; files . add ( "file2.file" ) ; instance . setFiles ( files ) ; "<AssertPlaceHolder>" ; } getFiles ( ) { org . apache . lucene . index . IndexReader ireader = null ; org . apache . lucene . index . TermsEnum iter = null ; org . apache . lucene . index . Terms terms ; java . util . Set < java . lang . String > files = new java . util . HashSet ( ) ; try { ireader = org . apache . lucene . index . DirectoryReader . open ( indexDirectory ) ; int numDocs = ireader . numDocs ( ) ; if ( numDocs > 0 ) { org . apache . lucene . index . Fields uFields = org . apache . lucene . index . MultiFields . getFields ( ireader ) ; terms = uFields . terms ( QueryBuilder . U ) ; iter = terms . iterator ( ) ; } while ( ( iter != null ) && ( ( iter . term ( ) ) != null ) ) { java . lang . String value = iter . term ( ) . utf8ToString ( ) ; if ( value . isEmpty ( ) ) { iter . next ( ) ; continue ; } files . add ( org . opengrok . indexer . web . Util . uid2url ( value ) ) ; org . apache . lucene . util . BytesRef next = iter . next ( ) ; if ( next == null ) { iter = null ; } } } finally { if ( ireader != null ) { try { ireader . close ( ) ; } catch ( java . io . IOException e ) { org . opengrok . indexer . index . IndexDatabase . LOGGER . log ( Level . WARNING , "An<sp>error<sp>occurred<sp>while<sp>closing<sp>index<sp>reader" , e ) ; } } } return files ; }
|
org . junit . Assert . assertEquals ( 2 , instance . getFiles ( ) . size ( ) )
|
testNoContentResponse ( ) { final org . apache . hc . core5 . http . protocol . HttpCoreContext context = org . apache . hc . core5 . http . protocol . HttpCoreContext . create ( ) ; final org . apache . hc . core5 . http . ClassicHttpRequest request = new org . apache . hc . core5 . http . message . BasicClassicHttpRequest ( org . apache . hc . core5 . http . Methods . GET , "/" ) ; org . mockito . Mockito . when ( conn . receiveRequestHeader ( ) ) . thenReturn ( request ) ; org . mockito . Mockito . when ( responseFactory . newHttpResponse ( 200 ) ) . thenReturn ( response ) ; org . mockito . Mockito . when ( handlerResolver . resolve ( request , context ) ) . thenReturn ( new org . apache . hc . core5 . http . io . HttpRequestHandler ( ) { @ org . apache . hc . core5 . http . impl . io . Override public void handle ( final org . apache . hc . core5 . http . ClassicHttpRequest request , final org . apache . hc . core5 . http . ClassicHttpResponse response , final org . apache . hc . core5 . http . protocol . HttpContext context ) throws java . io . IOException , org . apache . hc . core5 . http . HttpException { response . setCode ( HttpStatus . SC_NO_CONTENT ) ; } } ) ; org . mockito . Mockito . when ( connReuseStrategy . keepAlive ( request , response , context ) ) . thenReturn ( Boolean . TRUE ) ; httpservice . handleRequest ( conn , context ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( httprocessor ) . process ( response , response . getEntity ( ) , context ) ; org . mockito . Mockito . verify ( conn ) . sendResponseHeader ( response ) ; org . mockito . Mockito . verify ( conn , org . mockito . Mockito . never ( ) ) . sendResponseEntity ( org . mockito . ArgumentMatchers . < org . apache . hc . core5 . http . ClassicHttpResponse > any ( ) ) ; org . mockito . Mockito . verify ( conn ) . flush ( ) ; org . mockito . Mockito . verify ( conn , org . mockito . Mockito . never ( ) ) . close ( ) ; org . mockito . Mockito . verify ( response ) . close ( ) ; } getRequest ( ) { return getAttribute ( org . apache . hc . core5 . http . protocol . HttpCoreContext . HTTP_REQUEST , org . apache . hc . core5 . http . HttpRequest . class ) ; }
|
org . junit . Assert . assertSame ( request , context . getRequest ( ) )
|
testUid ( ) { java . nio . file . Path file = java . nio . file . Files . createFile ( root . resolve ( "file" ) ) ; java . lang . Integer uid = ( ( java . lang . Integer ) ( java . nio . file . Files . getAttribute ( file , "unix:uid" ) ) ) ; "<AssertPlaceHolder>" ; } resolve ( com . github . sbridges . ephemeralfs . EphemeralFsPath ) { return com . github . sbridges . ephemeralfs . ResolvedPath . resolve ( path , false ) ; }
|
org . junit . Assert . assertTrue ( ( uid > 0 ) )
|
testExportWithTime ( ) { org . geotools . geometry . jts . ReferencedEnvelope latLonBox = new org . geotools . geometry . jts . ReferencedEnvelope ( 12 , 13 , ( - 30 ) , ( - 31 ) , org . geotools . referencing . crs . DefaultGeographicCRS . WGS84 ) ; org . esa . beam . framework . datamodel . ProductData . UTC startTime = ProductData . UTC . parse ( "10-03-1999" , "dd-MM-yyyy" ) ; org . esa . beam . framework . datamodel . ProductData . UTC endTime = ProductData . UTC . parse ( "11-03-1999" , "dd-MM-yyyy" ) ; org . esa . beam . util . kmz . KmlGroundOverlay groundOverlay = new org . esa . beam . util . kmz . KmlGroundOverlay ( "scene" , new org . esa . beam . util . kmz . DummyTestOpImage ( 3 , 3 ) , latLonBox , startTime , endTime ) ; java . lang . String expected = getExpectedWithTime ( ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; groundOverlay . createKml ( builder ) ; "<AssertPlaceHolder>" ; } toString ( ) { return languageName ; }
|
org . junit . Assert . assertEquals ( expected , builder . toString ( ) )
|
getPropertyDisplayNameWhenDisplayNameIsNotSetShouldReturnTechnicalKey ( ) { java . lang . String displayName = null ; java . lang . String technicalKey = "technicalKey" ; resourceEditProperty = new ch . puzzle . itc . mobiliar . builders . ResourceEditPropertyBuilder ( ) . withDisplayName ( displayName ) . withTechnicalKey ( technicalKey ) . build ( ) ; java . lang . String propertyDisplayName = resourceEditProperty . getPropertyDisplayName ( ) ; "<AssertPlaceHolder>" ; } getPropertyDisplayName ( ) { if ( ( ( this . displayName ) == null ) || ( this . displayName . isEmpty ( ) ) ) { return this . technicalKey ; } return displayName ; }
|
org . junit . Assert . assertEquals ( technicalKey , propertyDisplayName )
|
avoid_checking_for_null_with_guava_optional ( ) { com . google . common . base . Optional < com . levelup . java . guava . OptionalExample . PullRequest > pr = getPullRequestUsingGuavaOptional ( ) ; if ( pr . isPresent ( ) ) { com . levelup . java . guava . OptionalExample . PullRequest pullRequest = pr . get ( ) ; com . levelup . java . guava . OptionalExample . logger . info ( pullRequest ) ; } else { com . levelup . java . guava . OptionalExample . logger . info ( "object<sp>was<sp>null" ) ; } "<AssertPlaceHolder>" ; } get ( ) { com . levelup . java . util . OptionalExample . Framework framework = new com . levelup . java . util . OptionalExample . Framework ( ) ; framework . communityUsers = 200000 ; framework . name = "Java" ; return framework ; }
|
org . junit . Assert . assertFalse ( pr . isPresent ( ) )
|
testPRBindingOnNonexistingWatchedAttribute ( ) { final java . lang . String str = "package<sp>org.drools.test;\n" + ( ( ( ( ( ( ( ( ( ( "\n" + "import<sp>org.drools.compiler.integrationtests.PropertyReactivityTest.Klass4;\n" ) + "\n" ) + "global<sp>java.util.List<sp>list;\n" ) + "\n" ) + "rule<sp>\"Get<sp>Person<sp>name\"\n" ) + "salience<sp>1\n" ) + "when\n" ) + "<sp>$x<sp>:<sp>Klass4(<sp>)<sp>@watch(<sp>nmae<sp>)\n" ) + "then\n" ) + "end\n" ) ; final org . kie . internal . builder . KnowledgeBuilder knowledgeBuilder = org . kie . internal . builder . KnowledgeBuilderFactory . newKnowledgeBuilder ( ) ; knowledgeBuilder . add ( new org . drools . core . io . impl . ByteArrayResource ( str . getBytes ( ) ) , ResourceType . DRL ) ; System . out . println ( knowledgeBuilder . getErrors ( ) ) ; "<AssertPlaceHolder>" ; } hasErrors ( ) { return messages . stream ( ) . anyMatch ( ( m ) -> DMNMessage . Severity . ERROR . equals ( m . getSeverity ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( knowledgeBuilder . hasErrors ( ) )
|
should_vote_answer_down ( ) { int firstAnswerVoteCount = questionPage . firstAnswerVoteCount ( ) ; int countAfter = questionPage . voteFirstAnswer ( VoteType . DOWN ) . firstAnswerVoteCount ( ) ; "<AssertPlaceHolder>" ; } firstAnswerVoteCount ( ) { java . lang . String text = firstAnswer ( ) . findElement ( org . openqa . selenium . By . className ( "vote-count" ) ) . getText ( ) ; return java . lang . Integer . parseInt ( text ) ; }
|
org . junit . Assert . assertEquals ( ( firstAnswerVoteCount - 1 ) , countAfter )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.