input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testServerWithoutTimeoutException ( ) { boolean status = true ; org . apache . servicecomb . loadbalance . SessionStickinessRule ss = new org . apache . servicecomb . loadbalance . SessionStickinessRule ( ) ; org . apache . servicecomb . core . Invocation invocation = mock ( org . apache . servicecomb . core . Invocation . class ) ; org . apache . servicecomb . loadbalance . ServiceCombServer server = mock ( org . apache . servicecomb . loadbalance . ServiceCombServer . class ) ; java . util . List < org . apache . servicecomb . loadbalance . ServiceCombServer > servers = new java . util . ArrayList ( ) ; servers . add ( server ) ; mockit . Deencapsulation . setField ( ss , "lastServer" , server ) ; new mockit . MockUp < org . apache . servicecomb . loadbalance . SessionStickinessRule > ( ) { @ mockit . Mock private boolean isTimeOut ( ) { return false ; } } ; try { ss . choose ( servers , invocation ) ; } catch ( java . lang . Exception e ) { status = false ; } "<AssertPlaceHolder>" ; } choose ( java . util . List , org . apache . servicecomb . core . Invocation ) { if ( ( lastServer ) == null ) { return chooseInitialServer ( servers , invocation ) ; } if ( isTimeOut ( ) ) { org . apache . servicecomb . loadbalance . SessionStickinessRule . LOG . warn ( "session<sp>timeout.<sp>choose<sp>another<sp>server." ) ; return chooseServerWhenTimeout ( servers , invocation ) ; } else { this . lastAccessedTime = java . lang . System . currentTimeMillis ( ) ; } if ( isErrorThresholdMet ( ) ) { org . apache . servicecomb . loadbalance . SessionStickinessRule . LOG . warn ( "reached<sp>max<sp>error.<sp>choose<sp>another<sp>server." ) ; errorThresholdMet = true ; return chooseServerErrorThresholdMet ( servers , invocation ) ; } if ( ! ( servers . contains ( lastServer ) ) ) { return chooseNextServer ( servers , invocation ) ; } return lastServer ; }
org . junit . Assert . assertFalse ( status )
testAddFileToZip ( ) { java . io . File tmpZipFile = com . archimatetool . tests . TestUtils . createTempFile ( ".zip" ) ; java . io . File srcFile = new java . io . File ( com . archimatetool . editor . TestSupport . getTestDataFolder ( ) , "filetest/readme.txt" ) ; java . io . BufferedOutputStream out = new java . io . BufferedOutputStream ( new java . io . FileOutputStream ( tmpZipFile ) ) ; java . util . zip . ZipOutputStream zOut = new java . util . zip . ZipOutputStream ( out ) ; com . archimatetool . editor . utils . ZipUtils . addFileToZip ( srcFile , srcFile . getName ( ) , zOut ) ; zOut . flush ( ) ; zOut . close ( ) ; java . io . File tmpOutFolder = com . archimatetool . tests . TestUtils . createTempFolder ( "ziptest" ) ; com . archimatetool . editor . utils . ZipUtils . unpackZip ( tmpZipFile , tmpOutFolder ) ; java . io . File outFile = new java . io . File ( tmpOutFolder , srcFile . getName ( ) ) ; com . archimatetool . editor . TestSupport . checkSourceAndTargetFileSame ( srcFile , outFile ) ; "<AssertPlaceHolder>" ; } checkSourceAndTargetFileSame ( java . io . File , java . io . File ) { if ( ! ( srcFile . exists ( ) ) ) { throw new java . io . IOException ( ( "Source<sp>File<sp>doesn't<sp>exist:<sp>" + targetFile ) ) ; } if ( ! ( targetFile . exists ( ) ) ) { throw new java . io . IOException ( ( "Target<sp>File<sp>doesn't<sp>exist:<sp>" + targetFile ) ) ; } if ( ( targetFile . length ( ) ) != ( srcFile . length ( ) ) ) { throw new java . io . IOException ( ( ( ( "Files<sp>don't<sp>compare<sp>in<sp>size:<sp>" + srcFile ) + "<sp>and<sp>" ) + targetFile ) ) ; } }
org . junit . Assert . assertTrue ( true )
testGetFactories ( ) { java . lang . String id = "java2" ; flex . messaging . factories . JavaFactory expected = new flex . messaging . factories . JavaFactory ( ) ; broker . addFactory ( id , expected ) ; int size = broker . getFactories ( ) . size ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 2 , size )
testRankedPlugin ( ) { org . eclipse . equinox . cm . test . Configuration config = cm . getConfiguration ( "test" ) ; org . eclipse . equinox . cm . test . Dictionary < java . lang . String , java . lang . Object > props = new org . eclipse . equinox . cm . test . Hashtable < java . lang . String , java . lang . Object > ( ) ; props . put ( "testkey" , "testvalue" ) ; config . update ( props ) ; org . eclipse . equinox . cm . test . ConfigurationPlugin plugin = new org . eclipse . equinox . cm . test . ConfigurationPlugin ( ) { public void modifyConfiguration ( org . osgi . framework . ServiceReference < ? > serviceReference , org . eclipse . equinox . cm . test . Dictionary < java . lang . String , java . lang . Object > properties ) { properties . put ( "plugin" , "plugin1" ) ; } } ; org . eclipse . equinox . cm . test . Dictionary < java . lang . String , java . lang . Object > pluginDict = new org . eclipse . equinox . cm . test . Hashtable < java . lang . String , java . lang . Object > ( ) ; pluginDict . put ( ConfigurationPlugin . CM_RANKING , new java . lang . Integer ( 1 ) ) ; org . osgi . framework . ServiceRegistration < org . eclipse . equinox . cm . test . ConfigurationPlugin > pluginReg1 = org . eclipse . equinox . cm . test . Activator . getBundleContext ( ) . registerService ( org . eclipse . equinox . cm . test . ConfigurationPlugin . class , plugin , pluginDict ) ; org . eclipse . equinox . cm . test . ConfigurationPlugin plugin2 = new org . eclipse . equinox . cm . test . ConfigurationPlugin ( ) { public void modifyConfiguration ( org . osgi . framework . ServiceReference < ? > serviceReference , org . eclipse . equinox . cm . test . Dictionary < java . lang . String , java . lang . Object > properties ) { properties . put ( "plugin" , "plugin2" ) ; } } ; org . osgi . framework . ServiceRegistration < org . eclipse . equinox . cm . test . ConfigurationPlugin > pluginReg2 = org . eclipse . equinox . cm . test . Activator . getBundleContext ( ) . registerService ( org . eclipse . equinox . cm . test . ConfigurationPlugin . class , plugin2 , null ) ; org . eclipse . equinox . cm . test . ManagedService ms = new org . eclipse . equinox . cm . test . ManagedService ( ) { public void updated ( org . eclipse . equinox . cm . test . Dictionary < java . lang . String , ? > properties ) { synchronized ( lock ) { locked = false ; lock . notify ( ) ; success = "plugin1" . equals ( properties . get ( "plugin" ) ) ; } } } ; org . eclipse . equinox . cm . test . Dictionary < java . lang . String , java . lang . Object > dict = new org . eclipse . equinox . cm . test . Hashtable < java . lang . String , java . lang . Object > ( ) ; dict . put ( org . osgi . framework . Constants . SERVICE_PID , "test" ) ; org . osgi . framework . ServiceRegistration < org . eclipse . equinox . cm . test . ManagedService > reg = null ; synchronized ( lock ) { success = false ; reg = org . eclipse . equinox . cm . test . Activator . getBundleContext ( ) . registerService ( org . eclipse . equinox . cm . test . ManagedService . class , ms , dict ) ; locked = true ; lock . wait ( 5000 ) ; if ( locked ) org . junit . Assert . fail ( "should<sp>have<sp>updated" ) ; "<AssertPlaceHolder>" ; } reg . unregister ( ) ; pluginReg1 . unregister ( ) ; pluginReg2 . unregister ( ) ; config . delete ( ) ; } fail ( java . lang . Throwable ) { coordinator . checkPermission ( CoordinationPermission . PARTICIPATE , name ) ; if ( reason == null ) throw new java . lang . NullPointerException ( org . eclipse . osgi . util . NLS . bind ( Messages . MissingFailureCause , getName ( ) , getId ( ) ) ) ; synchronized ( this ) { if ( terminated ) return false ; terminate ( ) ; failure = reason ; } java . util . List < org . osgi . service . coordinator . Participant > participantsToNotify = new java . util . ArrayList < org . osgi . service . coordinator . Participant > ( this . participants ) ; java . util . Collections . reverse ( participantsToNotify ) ; for ( org . osgi . service . coordinator . Participant participant : participantsToNotify ) { try { participant . failed ( referent ) ; } catch ( java . lang . Exception e ) { coordinator . getLogService ( ) . log ( org . osgi . service . log . LogService . LOG_WARNING , org . eclipse . osgi . util . NLS . bind ( Messages . ParticipantFailedError , new java . lang . Object [ ] { participant , name , id } ) , e ) ; } } synchronized ( this ) { notifyAll ( ) ; } return true ; }
org . junit . Assert . assertTrue ( success )
testHashSet ( ) { org . fastcatsearch . ir . dictionary . SetDictionary dictionary = new org . fastcatsearch . ir . dictionary . SetDictionary ( ) ; java . lang . String [ ] terms = new java . lang . String [ ] { "" , "LG" , "" } ; for ( java . lang . String term : terms ) { dictionary . addEntry ( term , null ) ; } java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; dictionary . writeTo ( out ) ; out . close ( ) ; for ( java . lang . String term : terms ) { boolean contains = dictionary . getUnmodifiableSet ( ) . contains ( new org . fastcatsearch . ir . io . CharVector ( term ) ) ; System . out . println ( ( ( ( "is<sp>set<sp>has<sp>term<sp>" + term ) + "<sp>?<sp>" ) + contains ) ) ; } byte [ ] buffer = out . toByteArray ( ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( buffer ) ; org . fastcatsearch . ir . dictionary . SetDictionary dictionary2 = new org . fastcatsearch . ir . dictionary . SetDictionary ( bais , true ) ; bais . close ( ) ; for ( java . lang . String term : terms ) { boolean contains = dictionary2 . getUnmodifiableSet ( ) . contains ( new org . fastcatsearch . ir . io . CharVector ( term ) ) ; System . out . println ( ( ( ( "is<sp>set2<sp>has<sp>term<sp>" + term ) + "<sp>?<sp>" ) + contains ) ) ; } java . io . ByteArrayOutputStream out2 = new java . io . ByteArrayOutputStream ( ) ; dictionary2 . writeTo ( out2 ) ; out2 . close ( ) ; java . io . ByteArrayInputStream bais2 = new java . io . ByteArrayInputStream ( buffer ) ; org . fastcatsearch . ir . dictionary . SetDictionary dictionary3 = new org . fastcatsearch . ir . dictionary . SetDictionary ( bais2 , true ) ; bais2 . close ( ) ; for ( java . lang . String term : terms ) { boolean contains = dictionary3 . getUnmodifiableSet ( ) . contains ( new org . fastcatsearch . ir . io . CharVector ( term ) ) ; System . out . println ( ( ( ( "is<sp>set3<sp>has<sp>term<sp>" + term ) + "<sp>?<sp>" ) + contains ) ) ; } byte [ ] buffer2 = out2 . toByteArray ( ) ; "<AssertPlaceHolder>" ; for ( int i = 0 ; i < ( buffer2 . length ) ; i ++ ) { System . out . println ( ( ( ( buffer [ i ] ) + ":" ) + ( buffer2 [ i ] ) ) ) ; if ( ( buffer [ i ] ) != ( buffer2 [ i ] ) ) { System . out . println ( ">>>>>>>>>>>>>>>>" ) ; } } contains ( org . fastcatsearch . ir . io . CharVector ) { int hashValue = org . fastcatsearch . ir . dic . HashSetDictionary . hfunc . hash ( term , bucketSize ) ; int idx = bucket [ hashValue ] ; while ( idx >= 0 ) { if ( isTheSame ( term , idx ) ) break ; idx = nextIdx [ idx ] ; } if ( idx < 0 ) return false ; else { return true ; } }
org . junit . Assert . assertEquals ( buffer . length , buffer2 . length )
debieraCrearUsuario ( ) { mx . edu . um . mateo . colportor . dao . UsuarioDaoTest . log . debug ( "Debiera<sp>crear<sp>usuario" ) ; mx . edu . um . mateo . general . model . Organizacion organizacion = new mx . edu . um . mateo . general . model . Organizacion ( "tst-01" , "test-01" , "test-01" ) ; currentSession ( ) . save ( organizacion ) ; mx . edu . um . mateo . general . model . Empresa empresa = new mx . edu . um . mateo . general . model . Empresa ( "tst-01" , "test-01" , "test-01" , "000000000001" , organizacion ) ; currentSession ( ) . save ( empresa ) ; mx . edu . um . mateo . inventario . model . Almacen almacen = new mx . edu . um . mateo . inventario . model . Almacen ( "TST" , "TEST" , empresa ) ; currentSession ( ) . save ( almacen ) ; mx . edu . um . mateo . general . model . Rol rol = new mx . edu . um . mateo . general . model . Rol ( mx . edu . um . mateo . general . utils . Constantes . ROLE_COL ) ; currentSession ( ) . save ( rol ) ; mx . edu . um . mateo . colportor . dao . Set < mx . edu . um . mateo . general . model . Rol > roles = new mx . edu . um . mateo . colportor . dao . HashSet ( ) ; roles . add ( rol ) ; mx . edu . um . mateo . general . model . Usuario usuario = new mx . edu . um . mateo . general . model . Usuario ( "test@test.com" , "test" , "test" , "test" , "test" ) ; usuario . setEmpresa ( empresa ) ; usuario . setAlmacen ( almacen ) ; usuario = instance . crea ( usuario , new java . lang . String [ ] { rol . getAuthority ( ) } ) ; java . lang . Long id = usuario . getId ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertNotNull ( id )
testCreateExperimentFailedDatabaseCreateExperiment ( ) { com . intuit . wasabi . experimentobjects . NewExperiment testExp = com . intuit . wasabi . experimentobjects . NewExperiment . withID ( experimentID ) . withAppName ( com . intuit . wasabi . experiment . impl . ExperimentsImplTest . testApp ) . withLabel ( com . intuit . wasabi . experiment . impl . ExperimentsImplTest . testLabel ) . withSamplingPercent ( samplingPercent ) . withStartTime ( startTime ) . withEndTime ( endTime ) . withDescription ( description ) . build ( ) ; doNothing ( ) . when ( validator ) . validateNewExperiment ( testExp ) ; doThrow ( new com . intuit . wasabi . repository . RepositoryException ( ) ) . when ( databaseRepository ) . createExperiment ( testExp ) ; try { expImpl . createExperiment ( testExp , com . intuit . wasabi . authenticationobjects . UserInfo . from ( UserInfo . Username . valueOf ( "user" ) ) . build ( ) ) ; org . junit . Assert . fail ( "Expected<sp>RepositoryException." ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } verify ( cassandraRepository , times ( 0 ) ) . createExperiment ( any ( com . intuit . wasabi . experimentobjects . NewExperiment . class ) ) ; verify ( databaseRepository , times ( 0 ) ) . deleteExperiment ( testExp ) ; verify ( eventLog , times ( 0 ) ) . postEvent ( any ( com . intuit . wasabi . eventlog . events . ExperimentCreateEvent . class ) ) ; } build ( ) { return this . item ; }
org . junit . Assert . assertEquals ( e . getClass ( ) , com . intuit . wasabi . repository . RepositoryException . class )
testMarkLog_EmitEvent ( ) { logMarker . markLog ( "test" ) ; org . mockito . ArgumentCaptor < org . sonatype . nexus . common . log . LogMarkInsertedEvent > argCaptor = org . mockito . ArgumentCaptor . forClass ( org . sonatype . nexus . common . log . LogMarkInsertedEvent . class ) ; verify ( eventManager ) . post ( argCaptor . capture ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertThat ( argCaptor . getValue ( ) . getMessage ( ) , org . hamcrest . Matchers . is ( "test" ) )
testSingleRetry ( ) { org . hawkular . apm . server . api . task . ProcessingUnit < java . lang . String , java . lang . String > pu = new org . hawkular . apm . server . api . task . ProcessingUnit < java . lang . String , java . lang . String > ( ) ; org . hawkular . apm . server . api . task . Processor < java . lang . String , java . lang . String > proc = new org . hawkular . apm . server . api . task . AbstractProcessor < java . lang . String , java . lang . String > ( org . hawkular . apm . server . api . task . Processor . ProcessorType . OneToOne ) { @ org . hawkular . apm . server . api . task . Override public java . lang . String processOneToOne ( java . lang . String tenantId , java . lang . String item ) throws org . hawkular . apm . server . api . task . RetryAttemptException { throw new org . hawkular . apm . server . api . task . RetryAttemptException ( "PLEASE<sp>RETRY" ) ; } } ; pu . setProcessor ( proc ) ; pu . setRetryCount ( 1 ) ; java . util . List < java . lang . String > results = new java . util . ArrayList < java . lang . String > ( ) ; pu . setRetryHandler ( new org . hawkular . apm . server . api . task . Handler < java . lang . String > ( ) { @ org . hawkular . apm . server . api . task . Override public void handle ( java . lang . String tenantId , java . util . List < java . lang . String > items ) throws org . hawkular . apm . server . api . task . Exception { results . addAll ( items ) ; } } ) ; java . util . List < java . lang . String > source = new java . util . ArrayList < java . lang . String > ( ) ; source . add ( "hello" ) ; source . add ( "world" ) ; try { pu . handle ( null , source ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Failed<sp>to<sp>process:<sp>" + e ) ) ; } "<AssertPlaceHolder>" ; } handle ( org . hawkular . apm . client . opentracing . Message , org . hawkular . apm . client . opentracing . AsyncService$Handler ) { io . opentracing . SpanContext spanCtx = getTracer ( ) . extract ( Format . Builtin . TEXT_MAP , new io . opentracing . propagation . TextMapExtractAdapter ( message . getHeaders ( ) ) ) ; io . opentracing . Span serverSpan = getTracer ( ) . buildSpan ( "Server" ) . asChildOf ( spanCtx ) . withTag ( Constants . ZIPKIN_BIN_ANNOTATION_HTTP_URL , "http://localhost:8080/inbound?orderId=123&verbose=true" ) . withTag ( "orderId" , "1243343456455" ) . start ( ) ; delay ( 500 ) ; callService ( serverSpan , ( obj ) -> { serverSpan . finish ( ) ; handler . handle ( obj ) ; } ) ; }
org . junit . Assert . assertEquals ( source , results )
getGemeenteTestOK ( ) { final java . lang . String gemCode = "0008" ; final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Partij expectedPartij = new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Partij ( "Bierum" , java . lang . Integer . parseInt ( gemCode ) ) ; final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Gemeente expectedGem = new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Gemeente ( ( ( short ) ( 1 ) ) , "Bierum" , new java . lang . Short ( gemCode ) , expectedPartij ) ; final java . lang . String gemCodePadded = nl . bzk . migratiebrp . ggo . viewer . service . impl . Lo3StamtabelServiceTest . zeroPad ( java . lang . String . valueOf ( expectedPartij . getCode ( ) ) , 4 ) ; final java . lang . String expected = java . lang . String . format ( nl . bzk . migratiebrp . ggo . viewer . service . impl . Lo3StamtabelServiceTest . STRING_FORMAT , gemCodePadded , expectedPartij . getNaam ( ) ) ; org . mockito . Mockito . doReturn ( expectedGem ) . when ( dynamischeStamtabelRepository ) . getGemeenteByGemeentecode ( new java . lang . Short ( gemCode ) ) ; final java . lang . String resultGem = lo3StamtabelService . getGemeente ( gemCode ) ; "<AssertPlaceHolder>" ; } getGemeente ( java . lang . Object ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . Gemeente entiteit = entityManager . createQuery ( "from<sp>Gemeente<sp>where<sp>code<sp>=<sp>:code" , nl . bzk . algemeenbrp . dal . domein . brp . entity . Gemeente . class ) . setParameter ( nl . bzk . brp . beheer . webapp . configuratie . json . modules . AttribuutSerializer . CODE , value . toString ( ) ) . getSingleResult ( ) ; return ( ( ( entiteit . getCode ( ) ) + ( nl . bzk . brp . beheer . webapp . configuratie . json . modules . AttribuutSerializer . SPATIE_OPEN_HAAK ) ) + ( entiteit . getNaam ( ) ) ) + ( nl . bzk . brp . beheer . webapp . configuratie . json . modules . AttribuutSerializer . SLUIT_HAAK ) ; }
org . junit . Assert . assertEquals ( expected , resultGem )
testFindNodeMissingNode ( ) { com . fasterxml . jackson . databind . JsonNode unit = fr . gouv . vitam . common . json . JsonHandler . getFromFile ( fr . gouv . vitam . common . PropertiesUtils . getResourceFile ( "archive-unit_OK.json" ) ) ; com . fasterxml . jackson . databind . JsonNode node = fr . gouv . vitam . common . json . JsonHandler . findNode ( unit , "ArchiveUnit.xxx" ) ; "<AssertPlaceHolder>" ; } findNode ( com . fasterxml . jackson . databind . JsonNode , java . lang . String ) { if ( ( rootNode == null ) || ( com . google . common . base . Strings . isNullOrEmpty ( path ) ) ) { return com . fasterxml . jackson . databind . node . MissingNode . getInstance ( ) ; } java . lang . String [ ] nodeNames = path . split ( fr . gouv . vitam . common . json . JsonHandler . REG_EXP_JSONPATH_SEPARATOR ) ; com . fasterxml . jackson . databind . JsonNode currentNode = rootNode ; for ( java . lang . String nodeName : nodeNames ) { currentNode = currentNode . path ( nodeName ) ; if ( currentNode . isMissingNode ( ) ) { return currentNode ; } } return currentNode ; }
org . junit . Assert . assertTrue ( node . isMissingNode ( ) )
testHttpsRouteWithoutProxies ( ) { com . philemonworks . critter . httpclient . ProxyRoutePlanner proxyRoutePlanner = new com . philemonworks . critter . httpclient . ProxyRoutePlanner ( null , null , "" ) ; org . apache . http . HttpHost httpHost = createHttpsHost ( ) ; "<AssertPlaceHolder>" ; } determineProxy ( org . apache . http . HttpHost , org . apache . http . HttpRequest , org . apache . http . protocol . HttpContext ) { org . apache . http . HttpHost proxyHost = null ; if ( hostMustBeProxied ( target ) ) { proxyHost = determineEnvironmentProxy ( target . getSchemeName ( ) ) ; } return proxyHost ; }
org . junit . Assert . assertNull ( proxyRoutePlanner . determineProxy ( httpHost , null , null ) )
testUncleIsAssignableToChild ( ) { final org . jboss . errai . codegen . meta . MetaClass metaChild = getMetaClass ( org . jboss . errai . codegen . test . model . tree . Child . class ) ; final org . jboss . errai . codegen . meta . MetaClass metaUncle = getMetaClass ( org . jboss . errai . codegen . test . model . tree . ParentInterface . class ) ; "<AssertPlaceHolder>" ; } isAssignableTo ( java . lang . Class ) { return beanDef . isAssignableTo ( type ) ; }
org . junit . Assert . assertTrue ( metaChild . isAssignableTo ( metaUncle ) )
testGetSessionDisplayAfterDisplayDisposed ( ) { org . eclipse . swt . widgets . Display display = new org . eclipse . swt . widgets . Display ( ) ; display . dispose ( ) ; org . eclipse . swt . widgets . Display sessionDisplay = org . eclipse . rap . rwt . internal . lifecycle . LifeCycleUtil . getSessionDisplay ( ) ; "<AssertPlaceHolder>" ; } getSessionDisplay ( ) { org . eclipse . swt . widgets . Display result = null ; if ( org . eclipse . rap . rwt . internal . service . ContextProvider . hasContext ( ) ) { org . eclipse . rap . rwt . service . UISession uiSession = org . eclipse . rap . rwt . internal . service . ContextProvider . getUISession ( ) ; result = org . eclipse . rap . rwt . internal . lifecycle . LifeCycleUtil . getSessionDisplay ( uiSession ) ; } return result ; }
org . junit . Assert . assertSame ( display , sessionDisplay )
testOAuth10 ( ) { setAuthType ( AuthType . OAUTH10 , true ) ; boolean result = checkExpected ( "Authentication_API_OAuth10_MainWindow" , "Successfully<sp>logged<sp>in" ) ; "<AssertPlaceHolder>" ; } getExpectedErrorMsg ( ) { return expectedErrorMsg ; }
org . junit . Assert . assertTrue ( getExpectedErrorMsg ( ) , result )
addAttributes_handleNull ( ) { cmd . addAttributes ( "" ) ; cmd . addAttributes ( null ) ; cmd . addAttributes ( "blah" ) ; "<AssertPlaceHolder>" ; } getAttributes ( ) { return m_attributes ; }
org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { } , cmd . getAttributes ( ) )
testViewInitialization ( ) { org . dashbuilder . dataset . filter . DataSetFilter filter = new org . dashbuilder . dataset . filter . DataSetFilter ( ) ; org . dashbuilder . dataset . filter . ColumnFilter filter1 = org . dashbuilder . dataset . filter . FilterFactory . equalsTo ( "column1" , "Test" ) ; filter . addFilterColumn ( filter1 ) ; org . dashbuilder . displayer . client . widgets . filter . DataSetFilterEditor filterEditor = new org . dashbuilder . displayer . client . widgets . filter . DataSetFilterEditor ( filterView , beanManager , changedEvent ) ; filterEditor . init ( filter , metadata ) ; "<AssertPlaceHolder>" ; verify ( filterView ) . showNewFilterHome ( ) ; verify ( filterView ) . addColumn ( "column1" ) ; verify ( filterView ) . addColumn ( "column2" ) ; verify ( filterView ) . addColumn ( "column3" ) ; verify ( filterView , times ( filter . getColumnFilterList ( ) . size ( ) ) ) . addColumnFilterEditor ( any ( org . dashbuilder . displayer . client . widgets . filter . ColumnFilterEditor . class ) ) ; } init ( java . io . ByteArrayOutputStream , java . lang . String ) { this . originalPath = ioService . get ( new java . net . URI ( uri ) ) ; this . zipWriter = new org . guvnor . common . services . backend . archive . ZipWriter ( outputStream ) ; }
org . junit . Assert . assertEquals ( filterView , filterEditor . view )
type13_tip_eji_j2l ( ) { org . jnbis . api . model . Nist decoded = decode ( org . jnbis . AnsiReferencesTest . FILES [ 24 ] ) ; commonAssert ( decoded ) ; "<AssertPlaceHolder>" ; } getVariableResLatentImages ( ) { return variableResolutionLatentImages ; }
org . junit . Assert . assertEquals ( 5 , decoded . getVariableResLatentImages ( ) . size ( ) )
getClassHierarchyList ( ) { org . slim3 . datastore . meta . BbbMeta bbbMeta = new org . slim3 . datastore . meta . BbbMeta ( ) ; "<AssertPlaceHolder>" ; } getClassHierarchyList ( ) { org . slim3 . datastore . meta . BbbMeta bbbMeta = new org . slim3 . datastore . meta . BbbMeta ( ) ; org . junit . Assert . assertThat ( bbbMeta . getClassHierarchyList ( ) , org . junit . matchers . JUnitMatchers . hasItem ( org . slim3 . datastore . model . Bbb . class . getName ( ) ) ) ; }
org . junit . Assert . assertThat ( bbbMeta . getClassHierarchyList ( ) , org . junit . matchers . JUnitMatchers . hasItem ( org . slim3 . datastore . model . Bbb . class . getName ( ) ) )
testPayloadPass ( ) { final java . nio . file . Path folder = org . jboss . forge . furnace . util . OperatingSystemUtils . createTempDir ( ) . toPath ( ) ; try ( final org . jboss . windup . graph . GraphContext context = factory . create ( folder , true ) ) { context . getFramed ( ) . addFramedVertex ( org . jboss . windup . config . iteration . payload . TestPayloadModel . class ) ; context . getFramed ( ) . addFramedVertex ( org . jboss . windup . config . iteration . payload . TestPayloadModel . class ) ; context . getFramed ( ) . addFramedVertex ( org . jboss . windup . config . iteration . payload . TestPayloadModel . class ) ; org . jboss . windup . config . GraphRewrite event = new org . jboss . windup . config . GraphRewrite ( context ) ; org . jboss . windup . config . DefaultEvaluationContext evaluationContext = createEvalContext ( event ) ; org . jboss . windup . graph . model . WindupConfigurationModel windupCfg = context . getFramed ( ) . addFramedVertex ( org . jboss . windup . graph . model . WindupConfigurationModel . class ) ; org . jboss . windup . graph . service . FileService fileModelService = new org . jboss . windup . graph . service . FileService ( context ) ; windupCfg . addInputPath ( fileModelService . createByFilePath ( "/tmp/testpath" ) ) ; org . jboss . windup . config . iteration . payload . IterationPayLoadPassTest . TestIterationPayLoadPassProvider provider = new org . jboss . windup . config . iteration . payload . IterationPayLoadPassTest . TestIterationPayLoadPassProvider ( ) ; org . ocpsoft . rewrite . config . Configuration configuration = provider . getConfiguration ( null ) ; org . jboss . windup . config . RuleSubset . create ( configuration ) . perform ( event , evaluationContext ) ; "<AssertPlaceHolder>" ; org . jboss . windup . config . iteration . payload . IterationPayLoadPassTest . modelCounter = 0 ; } } perform ( org . jboss . windup . config . GraphRewrite , org . ocpsoft . rewrite . context . EvaluationContext ) { org . jboss . windup . config . tags . TagService tagService = tagServiceHolder . getTagService ( ) ; org . jboss . windup . reporting . service . ReportService reportService = new org . jboss . windup . reporting . service . ReportService ( event . getGraphContext ( ) ) ; java . nio . file . Path outputDir = reportService . getReportDirectory ( ) ; java . io . File tagsDataFile = outputDir . resolve ( "resources/tagsData.js" ) . toFile ( ) ; try { org . apache . commons . io . FileUtils . forceMkdir ( tagsDataFile . getParentFile ( ) ) ; } catch ( java . io . IOException ex ) { org . jboss . windup . reporting . rules . rendering . RenderTagsJavaScriptRuleProvider . LOG . severe ( ( "Error<sp>creating<sp>a<sp>directory:<sp>" + ( tagsDataFile . getParentFile ( ) . getPath ( ) ) ) ) ; return ; } try ( java . io . FileWriter writer = new java . io . FileWriter ( tagsDataFile ) ) { tagService . writeTagsToJavaScript ( writer ) ; org . jboss . windup . reporting . rules . rendering . RenderTagsJavaScriptRuleProvider . LOG . info ( ( "Exporting<sp>tags<sp>data<sp>to<sp>file:<sp>" + ( tagsDataFile . getPath ( ) ) ) ) ; } catch ( java . io . IOException e ) { org . jboss . windup . reporting . rules . rendering . RenderTagsJavaScriptRuleProvider . LOG . severe ( ( "Error<sp>exporting<sp>tags<sp>data<sp>to:<sp>" + ( tagsDataFile . getPath ( ) ) ) ) ; return ; } }
org . junit . Assert . assertEquals ( 3 , org . jboss . windup . config . iteration . payload . IterationPayLoadPassTest . modelCounter )
recognise ( ) { org . apache . tika . config . TikaConfig config = null ; java . io . InputStream is = getClass ( ) . getResourceAsStream ( "dl4j-vgg16-config.xml" ) ; try { config = new org . apache . tika . config . TikaConfig ( getClass ( ) . getResourceAsStream ( "dl4j-vgg16-config.xml" ) ) ; } catch ( java . lang . Exception e ) { if ( ( ( e . getMessage ( ) ) != null ) && ( ( e . getMessage ( ) . contains ( "Connection<sp>refused" ) ) || ( e . getMessage ( ) . contains ( "connect<sp>timed<sp>out" ) ) ) ) { return ; } } if ( config != null ) { org . apache . tika . Tika tika = new org . apache . tika . Tika ( config ) ; org . apache . tika . metadata . Metadata md = new org . apache . tika . metadata . Metadata ( ) ; tika . parse ( getClass ( ) . getResourceAsStream ( "lion.jpg" ) , md ) ; java . lang . String [ ] objects = md . getValues ( "OBJECT" ) ; boolean found = false ; for ( java . lang . String object : objects ) { if ( object . contains ( "lion" ) ) { found = true ; } } "<AssertPlaceHolder>" ; } } contains ( java . nio . charset . Charset ) { return cs . equals ( StandardCharsets . US_ASCII ) ; }
org . junit . Assert . assertTrue ( found )
testConstructor ( ) { @ com . j256 . ormlite . logger . SuppressWarnings ( "rawtypes" ) java . lang . reflect . Constructor [ ] constructors = com . j256 . ormlite . logger . LoggerFactory . class . getDeclaredConstructors ( ) ; "<AssertPlaceHolder>" ; constructors [ 0 ] . setAccessible ( true ) ; constructors [ 0 ] . newInstance ( ) ; }
org . junit . Assert . assertEquals ( 1 , constructors . length )
testUpdateByUUIDWithoutPerm ( ) { com . gentics . mesh . core . data . Tag tag = tag ( "vehicle" ) ; com . gentics . mesh . core . data . TagFamily parentTagFamily = tagFamily ( "basic" ) ; try ( com . syncleus . ferma . tx . Tx tx = tx ( ) ) { role ( ) . revokePermissions ( tag , com . gentics . mesh . core . tag . UPDATE_PERM ) ; tx . success ( ) ; } try ( com . syncleus . ferma . tx . Tx tx = tx ( ) ) { java . lang . String tagName = tag . getName ( ) ; java . lang . String tagUuid = tag . getUuid ( ) ; com . gentics . mesh . core . rest . tag . TagUpdateRequest request = new com . gentics . mesh . core . rest . tag . TagUpdateRequest ( ) ; request . setName ( "new<sp>Name" ) ; call ( ( ) -> client ( ) . updateTag ( com . gentics . mesh . core . tag . PROJECT_NAME , parentTagFamily . getUuid ( ) , tagUuid , request ) , io . netty . handler . codec . http . HttpResponseStatus . FORBIDDEN , "error_missing_perm" , tagUuid , com . gentics . mesh . core . tag . UPDATE_PERM . getRestPerm ( ) . getName ( ) ) ; com . gentics . mesh . core . rest . tag . TagResponse loadedTag = client ( ) . findTagByUuid ( com . gentics . mesh . core . tag . PROJECT_NAME , parentTagFamily . getUuid ( ) , tagUuid ) . blockingGet ( ) ; "<AssertPlaceHolder>" ; } } getName ( ) { return "Fix<sp>data<sp>inconsistency<sp>for<sp>older<sp>versions." ; }
org . junit . Assert . assertEquals ( tagName , loadedTag . getName ( ) )
testRepeatedRestOpList ( ) { org . stringtemplate . v4 . ST e = new org . stringtemplate . v4 . ST ( "<rest(names)>,<sp><rest(names)>" ) ; e . add ( "names" , java . util . Arrays . asList ( "Ter" , "Tom" ) ) ; java . lang . String expecting = "Tom,<sp>Tom" ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
org . junit . Assert . assertEquals ( expecting , e . render ( ) )
get_on_iterator_return_value ( ) { org . jmxtrans . agent . util . collect . Set < java . lang . String > in = new org . jmxtrans . agent . util . collect . TreeSet ( org . jmxtrans . agent . util . collect . Arrays . asList ( "val0" , "val1" , "val2" , "val3" ) ) ; java . lang . String actual = org . jmxtrans . agent . util . collect . Iterables2 . get ( in , 2 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Iterable , int ) { if ( iterable == null ) throw new java . lang . NullPointerException ( "iterable" ) ; if ( iterable instanceof java . util . List ) { return ( ( java . util . List < T > ) ( iterable ) ) . get ( position ) ; } if ( position < 0 ) throw new java . lang . IndexOutOfBoundsException ( ( ( "Requested<sp>position<sp>must<sp>be<sp>greater<sp>than<sp>0,<sp>'" + position ) + "'<sp>is<sp>invalid" ) ) ; int idx = 0 ; for ( T value : iterable ) { if ( idx == position ) { return value ; } idx ++ ; } throw new java . lang . IndexOutOfBoundsException ( ( ( ( ( "Requested<sp>position<sp>must<sp>be<sp>smaller<sp>than<sp>iterable<sp>size<sp>(" + idx ) + "),<sp>'" ) + position ) + "'<sp>is<sp>invalid" ) ) ; }
org . junit . Assert . assertThat ( actual , is ( "val2" ) )
testTruncation ( ) { int length = ( ( int ) ( getResourceAsFile ( "/test-documents/testWORD_various.docx" ) . length ( ) ) ) ; java . util . Random r = new java . util . Random ( ) ; for ( int i = 0 ; i < 50 ; i ++ ) { int targetLength = r . nextInt ( length ) ; java . io . InputStream is = truncate ( "testWORD_various.docx" , targetLength ) ; java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; org . apache . tika . io . IOUtils . copy ( is , bos ) ; "<AssertPlaceHolder>" ; } try { java . io . InputStream is = truncate ( "testWORD_various.docx" , ( length + 1 ) ) ; org . junit . Assert . fail ( "should<sp>have<sp>thrown<sp>EOF" ) ; } catch ( java . io . EOFException e ) { } } copy ( java . io . InputStream , java . io . OutputStream ) { long count = org . apache . tika . io . IOUtils . copyLarge ( input , output ) ; if ( count > ( Integer . MAX_VALUE ) ) { return - 1 ; } return ( ( int ) ( count ) ) ; }
org . junit . Assert . assertEquals ( targetLength , bos . toByteArray ( ) . length )
TypeParameterTest07 ( ) { java . lang . String code = "class<sp>A{isA<sp>T1;}class<sp>B{}<sp>trait<sp>T1<X,Y>{}" ; cruise . umple . compiler . UmpleModel model = getModel ( code ) ; boolean result = false ; try { model . run ( ) ; } catch ( java . lang . Exception e ) { result = e . getMessage ( ) . contains ( "219" ) ; } finally { cruise . umple . util . SampleFileWriter . destroy ( "traitTest.ump" ) ; "<AssertPlaceHolder>" ; } } contains ( java . lang . Object ) { if ( ( parent ) != null ) { return ( super . contains ( obj ) ) || ( parent . contains ( obj ) ) ; } else { return super . contains ( obj ) ; } }
org . junit . Assert . assertTrue ( result )
testGetBytesAsStringEmpty ( ) { byte [ ] data = new byte [ ] { } ; java . lang . String stringData = org . eclipse . kura . core . comm . CommConnectionImpl . getBytesAsString ( data ) ; "<AssertPlaceHolder>" ; } getBytesAsString ( byte [ ] ) { if ( bytes == null ) { return null ; } java . util . StringJoiner sj = new java . util . StringJoiner ( "<sp>" ) ; for ( byte b : bytes ) { sj . add ( java . lang . String . format ( "%02X" , b ) ) ; } return sj . toString ( ) ; }
org . junit . Assert . assertEquals ( "" , stringData )
testSearchServices_Anonymous_HTMLFiltering ( ) { org . oscm . serviceprovisioningservice . bean . VOServiceListResult hits = org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . search . searchServices ( org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . FUJITSU , "en" , ( ( "<b>" + ( org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . TAG1 ) ) + "<b/>" ) ) ; "<AssertPlaceHolder>" ; } getResultSize ( ) { return resultSize ; }
org . junit . Assert . assertEquals ( 0 , hits . getResultSize ( ) )
testDataForSQLQueryWithFunctions ( ) { java . lang . String ddl = ( "CREATE<sp>TABLE<sp>" + ( org . apache . phoenix . pig . PhoenixHBaseLoaderIT . TABLE_FULL_NAME ) ) + "<sp>(ID<sp>INTEGER<sp>NOT<sp>NULL<sp>PRIMARY<sp>KEY,<sp>NAME<sp>VARCHAR)<sp>" ; org . apache . phoenix . pig . PhoenixHBaseLoaderIT . conn . createStatement ( ) . execute ( ddl ) ; final java . lang . String dml = ( "UPSERT<sp>INTO<sp>" + ( org . apache . phoenix . pig . PhoenixHBaseLoaderIT . TABLE_FULL_NAME ) ) + "<sp>VALUES(?,?)" ; java . sql . PreparedStatement stmt = org . apache . phoenix . pig . PhoenixHBaseLoaderIT . conn . prepareStatement ( dml ) ; int rows = 20 ; for ( int i = 0 ; i < rows ; i ++ ) { stmt . setInt ( 1 , i ) ; stmt . setString ( 2 , ( "a" + i ) ) ; stmt . execute ( ) ; } org . apache . phoenix . pig . PhoenixHBaseLoaderIT . conn . commit ( ) ; final java . lang . String sqlQuery = ( "<sp>SELECT<sp>UPPER(NAME)<sp>AS<sp>n<sp>FROM<sp>" + ( org . apache . phoenix . pig . PhoenixHBaseLoaderIT . TABLE_FULL_NAME ) ) + "<sp>ORDER<sp>BY<sp>ID" ; org . apache . phoenix . pig . PhoenixHBaseLoaderIT . pigServer . registerQuery ( java . lang . String . format ( ( ( "A<sp>=<sp>load<sp>'hbase://query/%s'<sp>using<sp>" + ( org . apache . phoenix . pig . PhoenixHBaseLoader . class . getName ( ) ) ) + "('%s');" ) , sqlQuery , org . apache . phoenix . pig . PhoenixHBaseLoaderIT . zkQuorum ) ) ; java . util . Iterator < org . apache . pig . data . Tuple > iterator = org . apache . phoenix . pig . PhoenixHBaseLoaderIT . pigServer . openIterator ( "A" ) ; int i = 0 ; while ( iterator . hasNext ( ) ) { org . apache . pig . data . Tuple tuple = iterator . next ( ) ; java . lang . String name = ( ( java . lang . String ) ( tuple . get ( 0 ) ) ) ; "<AssertPlaceHolder>" ; i ++ ; } } get ( org . apache . hadoop . hbase . KeyValue ) { return this . delegatee . get ( kv ) ; }
org . junit . Assert . assertEquals ( ( "A" + i ) , name )
emptyArray ( ) { "<AssertPlaceHolder>" ; } emptyArray ( ) { org . junit . Assert . assertEquals ( 0 , com . zuoxiaolong . niubi . job . core . helper . StringHelper . emptyArray ( ) . length ) ; }
org . junit . Assert . assertEquals ( 0 , com . zuoxiaolong . niubi . job . core . helper . StringHelper . emptyArray ( ) . length )
testUsesUIConfigurationOfUI ( ) { com . eclipsesource . tabris . ui . UI ui = mock ( com . eclipsesource . tabris . ui . UI . class ) ; com . eclipsesource . tabris . ui . UIConfiguration config = mock ( com . eclipsesource . tabris . ui . UIConfiguration . class ) ; when ( ui . getConfiguration ( ) ) . thenReturn ( config ) ; com . eclipsesource . tabris . ui . AbstractActionTest . TestAbstractAction action = new com . eclipsesource . tabris . ui . AbstractActionTest . TestAbstractAction ( ) ; action . execute ( ui ) ; com . eclipsesource . tabris . ui . UIConfiguration actualConfiguration = action . getUIConfiguration ( ) ; "<AssertPlaceHolder>" ; } execute ( com . eclipsesource . tabris . ui . UI ) { this . ui = ui ; execute ( ) ; }
org . junit . Assert . assertSame ( config , actualConfiguration )
testExpiredTeacherStaffAssociation ( ) { org . slc . sli . api . security . context . validator . Set < java . lang . String > ids = new org . slc . sli . api . security . context . validator . HashSet < java . lang . String > ( org . slc . sli . api . security . context . validator . Arrays . asList ( staff4 . getEntityId ( ) ) ) ; "<AssertPlaceHolder>" ; } validate ( java . lang . String , org . slc . sli . api . security . context . validator . Set ) { if ( ! ( areParametersValid ( EntityNames . STAFF , entityName , staffIds ) ) ) { return Collections . EMPTY_SET ; } org . slc . sli . api . security . context . validator . Set < java . lang . String > validIds = new org . slc . sli . api . security . context . validator . HashSet < java . lang . String > ( ) ; org . slc . sli . domain . NeutralQuery basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "staffReference" , org . slc . sli . domain . NeutralCriteria . CRITERIA_IN , staffIds ) ) ; basicQuery . setIncludeFields ( org . slc . sli . api . security . context . validator . Arrays . asList ( "educationOrganizationReference" , "staffReference" ) ) ; org . slc . sli . api . security . context . validator . TransitiveStaffToStaffValidator . LOG . info ( "Attempting<sp>to<sp>validate<sp>transitively<sp>from<sp>staff<sp>to<sp>staff<sp>with<sp>ids<sp>{}" , staffIds ) ; injectEndDateQuery ( basicQuery ) ; java . lang . Iterable < org . slc . sli . domain . Entity > edOrgAssoc = repo . findAll ( EntityNames . STAFF_ED_ORG_ASSOCIATION , basicQuery ) ; org . slc . sli . api . security . context . validator . Map < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > staffEdorgMap = new org . slc . sli . api . security . context . validator . HashMap < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > ( ) ; populateMapFromMongoResponse ( staffEdorgMap , edOrgAssoc ) ; org . slc . sli . api . security . context . validator . Set < java . lang . String > edOrgLineage = getStaffEdOrgLineage ( ) ; if ( ( edOrgLineage . isEmpty ( ) ) || ( staffEdorgMap . isEmpty ( ) ) ) { return Collections . EMPTY_SET ; } for ( java . util . Map . Entry < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > entry : staffEdorgMap . entrySet ( ) ) { org . slc . sli . api . security . context . validator . Set < java . lang . String > tmpSet = new org . slc . sli . api . security . context . validator . HashSet < java . lang . String > ( entry . getValue ( ) ) ; tmpSet . retainAll ( edOrgLineage ) ; if ( ( tmpSet . size ( ) ) != 0 ) { validIds . add ( entry . getKey ( ) ) ; } } validIds . addAll ( validateThrough ( EntityNames . STAFF_PROGRAM_ASSOCIATION , "programId" ) ) ; validIds . addAll ( validateThrough ( EntityNames . STAFF_COHORT_ASSOCIATION , "cohortId" ) ) ; basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "_id" , "in" , edOrgLineage ) ) ; java . lang . Iterable < org . slc . sli . domain . Entity > edorgs = repo . findAll ( EntityNames . EDUCATION_ORGANIZATION , basicQuery ) ; org . slc . sli . api . security . context . validator . List < java . lang . String > programs = new org . slc . sli . api . security . context . validator . ArrayList < java . lang . String > ( ) ; for ( org . slc . sli . domain . Entity e : edorgs ) { java . lang . Object value = e . getBody ( ) . get ( "programReference" ) ; if ( value != null ) { if ( org . slc . sli . api . security . context . validator . List . class . isAssignableFrom ( value . getClass ( ) ) ) { programs . addAll ( ( ( org . slc . sli . api . security . context . validator . List < java . lang . String > ) ( value ) ) ) ; } else if ( java . lang . String . class . isAssignableFrom ( value . getClass ( ) ) ) { programs . add ( ( ( java . lang . String ) ( value ) ) ) ; } } } validIds . addAll ( getIds ( EntityNames . STAFF_PROGRAM_ASSOCIATION , "programId" , programs ) ) ; basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "educationOrgId" , "in" , edOrgLineage ) ) ; org . slc . sli . api . security . context . validator . List < java . lang . String > cohorts = ( ( org . slc . sli . api . security . context . validator . List < java . lang . String > ) ( repo . findAllIds ( EntityNames
org . junit . Assert . assertFalse ( validator . validate ( EntityNames . STAFF , ids ) . equals ( ids ) )
shouldDoNumericProjectionWithStringBasedQuery ( ) { org . springframework . data . couchbase . repository . Party partyHasKeyword = new org . springframework . data . couchbase . repository . Party ( org . springframework . data . couchbase . repository . N1qlCrudRepositoryTests . KEY_PARTY_KEYWORD , "party" , "desc<sp>is<sp>a<sp>N1QL<sp>keyword" , new java . util . Date ( ) , 4000000 , new org . springframework . data . geo . Point ( 500 , 500 ) ) ; partyRepository . save ( partyHasKeyword ) ; long max = partyRepository . findMaxAttendees ( ) ; "<AssertPlaceHolder>" ; } save ( java . util . Collection ) { save ( batchToSave , PersistTo . NONE , ReplicateTo . NONE ) ; }
org . junit . Assert . assertEquals ( 4000000 , max )
testFMeasureTableRenderer ( ) { final com . bbn . bue . common . diff . FMeasureTableRenderer renderer = com . bbn . bue . common . diff . FMeasureTableRenderer . create ( ) ; final java . util . Map < java . lang . String , com . bbn . bue . common . evaluation . FMeasureCounts > data = com . google . common . collect . ImmutableMap . of ( "foo" , com . bbn . bue . common . evaluation . FMeasureCounts . from ( 1 , 2 , 3 ) , "bar" , com . bbn . bue . common . evaluation . FMeasureCounts . from ( 4 , 5 , 6 ) ) ; final java . lang . String expected = "Name<sp>TP<sp>FP<sp>FN<sp>P<sp>R<sp>F1\n" + ( ( "===============================================================================\n" + "bar<sp>4.0<sp>5.0<sp>6.0<sp>44.44<sp>40.00<sp>42.11\n" ) + "foo<sp>1.0<sp>2.0<sp>3.0<sp>33.33<sp>25.00<sp>28.57\n" ) ; final java . lang . String result = renderer . render ( data ) ; "<AssertPlaceHolder>" ; } render ( java . util . Map ) { final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; final java . lang . String titleFormatString = java . lang . String . format ( "%%-%ds<sp>%%%ds<sp>%%%ds<sp>%%%ds<sp>%%%ds<sp>%%%ds<sp>%%%ds\n" , nameFieldLength , com . bbn . bue . common . diff . FMeasureTableRenderer . TP_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . FP_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . FN_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . P_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . R_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . F1_FIELD_LENGTH ) ; final java . lang . String lineFormatString = java . lang . String . format ( "%%-%ds<sp>%%%d.1f<sp>%%%d.1f<sp>%%%d.1f<sp>%%%d.2f<sp>%%%d.2f<sp>%%%d.2f\n" , nameFieldLength , com . bbn . bue . common . diff . FMeasureTableRenderer . TP_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . FP_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . FN_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . P_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . R_FIELD_LENGTH , com . bbn . bue . common . diff . FMeasureTableRenderer . F1_FIELD_LENGTH ) ; final int lineLength = ( ( ( ( ( ( ( nameFieldLength ) + ( com . bbn . bue . common . diff . FMeasureTableRenderer . TP_FIELD_LENGTH ) ) + ( com . bbn . bue . common . diff . FMeasureTableRenderer . FP_FIELD_LENGTH ) ) + ( com . bbn . bue . common . diff . FMeasureTableRenderer . FN_FIELD_LENGTH ) ) + ( com . bbn . bue . common . diff . FMeasureTableRenderer . P_FIELD_LENGTH ) ) + ( com . bbn . bue . common . diff . FMeasureTableRenderer . R_FIELD_LENGTH ) ) + ( com . bbn . bue . common . diff . FMeasureTableRenderer . F1_FIELD_LENGTH ) ) + 6 ; sb . append ( java . lang . String . format ( titleFormatString , "Name" , "TP" , "FP" , "FP" 0 , "P" , "R" , "F1" ) ) ; sb . append ( com . google . common . base . Strings . repeat ( "=" , lineLength ) ) . append ( "\n" ) ; for ( final Map . Entry < java . lang . String , com . bbn . bue . common . evaluation . FMeasureCounts > countsEntry : ordering . sortedCopy ( fMeasureCounts . entrySet ( ) ) ) { final java . lang . String name = countsEntry . getKey ( ) ; final com . bbn . bue . common . evaluation . FMeasureCounts counts = countsEntry . getValue ( ) ; sb . append ( java . lang . String . format ( lineFormatString , name , counts . truePositives ( ) , counts . falsePositives ( ) , counts . falseNegatives ( ) , ( 100.0 * ( counts . precision ( ) ) ) , ( 100.0 * ( counts . recall ( ) ) ) , ( 100.0 * ( counts . F1 ( ) ) ) ) ) ; } return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , result )
testRemoveReactionScheme_IReactionScheme ( ) { org . openscience . cdk . interfaces . IReactionScheme scheme = ( ( org . openscience . cdk . interfaces . IReactionScheme ) ( newChemObject ( ) ) ) ; org . openscience . cdk . interfaces . IReactionScheme scheme1 = ( ( org . openscience . cdk . interfaces . IReactionScheme ) ( newChemObject ( ) ) ) ; org . openscience . cdk . interfaces . IReactionScheme scheme2 = ( ( org . openscience . cdk . interfaces . IReactionScheme ) ( newChemObject ( ) ) ) ; scheme . add ( scheme1 ) ; scheme . add ( scheme2 ) ; scheme . removeReactionScheme ( scheme1 ) ; "<AssertPlaceHolder>" ; } getReactionSchemeCount ( ) { return reactionScheme . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , scheme . getReactionSchemeCount ( ) )
test_getLong_on_FLOAT_thatFits_getsIt ( ) { final com . dremio . exec . vector . accessor . SqlAccessor uut = new com . dremio . jdbc . impl . TypeConvertingSqlAccessor ( new com . dremio . jdbc . impl . TypeConvertingSqlAccessorTest . FloatStubAccessor ( ( 9223372036854775807L * 1.0F ) ) ) ; "<AssertPlaceHolder>" ; } getLong ( int ) { final long result ; switch ( getType ( ) . getMinorType ( ) ) { case BIGINT : result = innerAccessor . getLong ( rowOffset ) ; break ; case TINYINT : result = innerAccessor . getByte ( rowOffset ) ; break ; case SMALLINT : result = innerAccessor . getShort ( rowOffset ) ; break ; case INT : result = innerAccessor . getInt ( rowOffset ) ; break ; case FLOAT4 : result = com . dremio . jdbc . impl . TypeConvertingSqlAccessor . getLongValueOrThrow ( innerAccessor . getFloat ( rowOffset ) , "Java<sp>float<sp>/<sp>SQL<sp>REAL/FLOAT" ) ; break ; case FLOAT8 : result = com . dremio . jdbc . impl . TypeConvertingSqlAccessor . getLongValueOrThrow ( innerAccessor . getDouble ( rowOffset ) , "Java<sp>double<sp>/<sp>SQL<sp>DOUBLE<sp>PRECISION" ) ; break ; default : result = innerAccessor . getLong ( rowOffset ) ; break ; } return result ; }
org . junit . Assert . assertThat ( uut . getLong ( 0 ) , org . hamcrest . CoreMatchers . equalTo ( 9223372036854775807L ) )
testGet ( ) { c . stubGet ( s . getPath ( ) , com . sparkplatform . api . models . CustomFieldTest . JSON , 200 ) ; com . sparkplatform . api . core . Response r = c . get ( s . getPath ( ) , new java . util . HashMap < com . sparkplatform . api . core . ApiParameter , java . lang . String > ( ) ) ; "<AssertPlaceHolder>" ; com . sparkplatform . api . models . CustomFieldResults map = r . getResults ( com . sparkplatform . api . models . CustomFieldResults . class ) . get ( 0 ) ; com . sparkplatform . api . models . CustomField m = map . getCustomFieldMap ( ) . values ( ) . iterator ( ) . next ( ) ; validate ( m ) ; } getPath ( ) { return com . sparkplatform . api . services . ExampleService . PATH ; }
org . junit . Assert . assertNotNull ( r )
trimAll_A$String_annotationClass ( ) { org . junithelper . core . filter . impl . TrimAnnotationFilter target = new org . junithelper . core . filter . impl . TrimAnnotationFilter ( ) ; java . lang . String src = "@SuppressWarnings(value<sp>=<sp>{<sp>\"issue<sp>28\"<sp>})<sp>@Documented<sp>@Retention(RetentionPolicy.RUNTIME)<sp>@Target(<sp>{<sp>ElementType.TYPE,<sp>ElementType.METHOD<sp>})<sp>public<sp>@interface<sp>AdminRoleRequired<sp>{" ; java . lang . String actual = target . trimAll ( src ) ; java . lang . String expected = "<sp>public<sp>interface<sp>AdminRoleRequired<sp>{" ; "<AssertPlaceHolder>" ; } trimAll ( java . lang . String ) { if ( src == null ) { return null ; } return src . replaceFirst ( "@interface" , "interface" ) . replaceAll ( "@[^\\s\r\n\\(]+(\\([^\\)]*\\))*" , "<sp>" ) . replaceAll ( "@[^\\s\r\n]+" , "" ) ; }
org . junit . Assert . assertEquals ( expected , actual )
test1dForward ( ) { org . deeplearning4j . nn . conf . MultiLayerConfiguration . Builder builder = new org . deeplearning4j . nn . conf . NeuralNetConfiguration . Builder ( ) . seed ( 123 ) . optimizationAlgo ( OptimizationAlgorithm . STOCHASTIC_GRADIENT_DESCENT ) . l2 ( 2.0E-4 ) . updater ( new org . nd4j . linalg . learning . config . Nesterovs ( 0.9 ) ) . dropOut ( 0.5 ) . list ( ) . layer ( new org . deeplearning4j . nn . layers . convolution . LocallyConnected1D . Builder ( ) . kernelSize ( 8 ) . nIn ( 3 ) . stride ( 1 ) . nOut ( 16 ) . dropOut ( 0.5 ) . convolutionMode ( ConvolutionMode . Strict ) . setInputSize ( 28 ) . activation ( Activation . RELU ) . weightInit ( WeightInit . XAVIER ) . build ( ) ) . layer ( new org . deeplearning4j . nn . layers . convolution . OutputLayer . Builder ( LossFunctions . LossFunction . SQUARED_LOSS ) . nOut ( 10 ) . weightInit ( WeightInit . XAVIER ) . activation ( Activation . SOFTMAX ) . build ( ) ) . setInputType ( org . deeplearning4j . nn . conf . inputs . InputType . recurrent ( 3 , 28 ) ) ; org . deeplearning4j . nn . conf . MultiLayerConfiguration conf = builder . build ( ) ; org . deeplearning4j . nn . multilayer . MultiLayerNetwork network = new org . deeplearning4j . nn . multilayer . MultiLayerNetwork ( conf ) ; network . init ( ) ; org . nd4j . linalg . api . ndarray . INDArray input = org . nd4j . linalg . factory . Nd4j . ones ( 10 , 3 , 28 ) ; org . nd4j . linalg . api . ndarray . INDArray output = network . output ( input , false ) ; for ( int i = 0 ; i < 100 ; i ++ ) { output = network . output ( input , false ) ; } "<AssertPlaceHolder>" ; network . fit ( input , output ) ; } shape ( ) { return sameDiff . shape ( this ) ; }
org . junit . Assert . assertArrayEquals ( new long [ ] { ( ( 28 - 8 ) + 1 ) * 10 , 10 } , output . shape ( ) )
serializeWithoutLength ( ) { final org . mule . runtime . api . metadata . TypedValue < java . lang . Object > typedValue = new org . mule . runtime . api . metadata . TypedValue ( org . mule . runtime . core . message . TypedValueTestCase . OBJECT_VALUE , org . mule . runtime . api . metadata . DataType . fromObject ( org . mule . runtime . core . message . TypedValueTestCase . OBJECT_VALUE ) , java . util . OptionalLong . empty ( ) ) ; final org . mule . runtime . api . metadata . TypedValue < java . lang . Object > deserealized = serializationRoundTrip ( typedValue ) ; "<AssertPlaceHolder>" ; } equalTo ( java . util . Collection ) { return new org . mule . tck . util . EnumerationMatcher ( items ) ; }
org . junit . Assert . assertThat ( deserealized , org . hamcrest . CoreMatchers . equalTo ( typedValue ) )
given_noAnnotation_and_configurationSetToIgnoreQueryOnly_andSafeSemantics_thenNone ( ) { allowingPublishingConfigurationToReturn ( "ignoreQueryOnly" ) ; final java . lang . reflect . Method actionMethod = findMethod ( org . apache . isis . core . metamodel . facets . actions . action . ActionAnnotationFacetFactoryTest . Customer . class , "someAction" ) ; facetedMethod . addFacet ( new org . apache . isis . core . metamodel . facets . actions . semantics . ActionSemanticsFacetAbstract ( org . apache . isis . applib . annotation . ActionSemantics . Of . SAFE , facetedMethod ) { } ) ; facetFactory . processPublishing ( new org . apache . isis . core . metamodel . facets . FacetFactory . ProcessMethodContext ( org . apache . isis . core . metamodel . facets . actions . action . ActionAnnotationFacetFactoryTest . Customer . class , null , null , actionMethod , mockMethodRemover , facetedMethod ) ) ; final org . apache . isis . core . metamodel . facetapi . Facet facet = facetedMethod . getFacet ( org . apache . isis . core . metamodel . facets . actions . publish . PublishedActionFacet . class ) ; "<AssertPlaceHolder>" ; } getFacet ( java . lang . Class ) { final org . apache . isis . core . metamodel . facetapi . FacetHolder facetHolder = getAction ( ) ; return facetHolder . getFacet ( facetType ) ; }
org . junit . Assert . assertNull ( facet )
test ( ) { owltools . gaf . GafDocument gafdoc = loadGaf ( "test_gene_association_mgi.gaf" ) ; owltools . gaf . rules . AnnotationRule rule = new owltools . gaf . rules . go . GoICAnnotationRule ( eco ) ; java . util . List < owltools . gaf . GeneAnnotation > annotations = gafdoc . getGeneAnnotations ( ) ; java . util . List < owltools . gaf . rules . AnnotationRuleViolation > allViolations = new java . util . ArrayList < owltools . gaf . rules . AnnotationRuleViolation > ( ) ; for ( owltools . gaf . GeneAnnotation annotation : annotations ) { java . util . Set < owltools . gaf . rules . AnnotationRuleViolation > violations = rule . getRuleViolations ( annotation ) ; if ( ( violations != null ) && ( ! ( violations . isEmpty ( ) ) ) ) { allViolations . addAll ( violations ) ; } } "<AssertPlaceHolder>" ; } size ( ) { return this . bitSetSize ; }
org . junit . Assert . assertEquals ( 0 , allViolations . size ( ) )
shouldReturnCustomers ( ) { final java . lang . String urlApp = "/rest-security/services/customers?" ; final java . lang . String fullUrl = "http://localhost:8080" + urlApp ; domain . CustomerList list = template . execute ( fullUrl , HttpMethod . GET , new org . springframework . web . client . RequestCallback ( ) { @ service . Override public void doWithRequest ( org . springframework . http . client . ClientHttpRequest request ) throws java . io . IOException { org . springframework . http . HttpHeaders headers = request . getHeaders ( ) ; headers . add ( "Accept" , "*/*" ) ; headers . add ( SignatureHelper . APIKEY_HEADER , SignatureHelper . API_KEY ) ; headers . add ( SignatureHelper . TIMESTAMP_HEADER , ( "" + ( java . lang . System . currentTimeMillis ( ) ) ) ) ; try { headers . add ( SignatureHelper . SIGNATURE_HEADER , filter . SignatureHelper . createSignature ( headers , urlApp , SignatureHelper . PRIVATE_KEY ) ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ) ; } } } , responseExtractor ) ; "<AssertPlaceHolder>" ; } getCustomer ( ) { if ( ( customer ) == null ) { customer = new java . util . ArrayList < domain . Customer > ( ) ; } return this . customer ; }
org . junit . Assert . assertTrue ( ( ( list . getCustomer ( ) . size ( ) ) > 0 ) )
getDisplayString_shouldReturnTheEmptyStringWhenNoLocalizedMessageIsSpecifiedAndTheNamePropertyIsNull ( ) { org . openmrs . Location location = new org . openmrs . Location ( ) ; location . setName ( null ) ; org . openmrs . module . webservices . rest . web . resource . impl . MetadataDelegatingCrudResourceTest . MockLocationResource resource = new org . openmrs . module . webservices . rest . web . resource . impl . MetadataDelegatingCrudResourceTest . MockLocationResource ( ) ; java . lang . String display = resource . getDisplayString ( location ) ; "<AssertPlaceHolder>" ; } getDisplayString ( org . openmrs . ConceptSearchResult ) { org . openmrs . ConceptName cn = csr . getConcept ( ) . getName ( ) ; return cn == null ? null : cn . getName ( ) ; }
org . junit . Assert . assertThat ( display , org . hamcrest . core . Is . is ( "" ) )
getOutputKind ( ) { "<AssertPlaceHolder>" ; } getOutputKind ( ) { org . junit . Assert . assertEquals ( "ImageStreamTag" , com . openshift . internal . restclient . model . v1 . BuildTest . build . getOutputKind ( ) ) ; }
org . junit . Assert . assertEquals ( "ImageStreamTag" , com . openshift . internal . restclient . model . v1 . BuildTest . build . getOutputKind ( ) )
testTextPair ( ) { cc . pp . hadoop . io . TextPair tp1 = new cc . pp . hadoop . io . TextPair ( "a" , "b" ) ; cc . pp . hadoop . io . TextPair tp2 = new cc . pp . hadoop . io . TextPair ( "b" , "a" ) ; org . apache . hadoop . io . RawComparator comparator = org . apache . hadoop . io . WritableComparator . get ( cc . pp . hadoop . io . TextPair . class ) ; "<AssertPlaceHolder>" ; } compare ( org . apache . hadoop . io . WritableComparable , org . apache . hadoop . io . WritableComparable ) { if ( ( a instanceof cc . pp . hadoop . io . TextPair ) && ( b instanceof cc . pp . hadoop . io . TextPair ) ) { return ( ( cc . pp . hadoop . io . TextPair ) ( a ) ) . getFirst ( ) . compareTo ( ( ( cc . pp . hadoop . io . TextPair ) ( b ) ) . getFirst ( ) ) ; } return super . compare ( a , b ) ; }
org . junit . Assert . assertThat ( comparator . compare ( tp1 , tp2 ) , org . hamcrest . CoreMatchers . is ( ( - 1 ) ) )
httpProxy_500 ( ) { io . netty . channel . DefaultEventLoopGroup elg = new io . netty . channel . DefaultEventLoopGroup ( 1 ) ; io . netty . channel . local . LocalAddress proxy = new io . netty . channel . local . LocalAddress ( "httpProxy_500" ) ; java . net . SocketAddress host = java . net . InetSocketAddress . createUnresolved ( "specialHost" , 314 ) ; io . netty . channel . ChannelInboundHandler mockHandler = mock ( io . netty . channel . ChannelInboundHandler . class ) ; io . netty . channel . Channel serverChannel = new io . netty . bootstrap . ServerBootstrap ( ) . group ( elg ) . channel ( io . netty . channel . local . LocalServerChannel . class ) . childHandler ( mockHandler ) . bind ( proxy ) . sync ( ) . channel ( ) ; io . grpc . netty . ProtocolNegotiator nego = io . grpc . netty . ProtocolNegotiators . httpProxy ( proxy , null , null , io . grpc . netty . ProtocolNegotiators . plaintext ( ) ) ; io . netty . channel . ChannelHandler handler = nego . newHandler ( io . grpc . netty . ProtocolNegotiatorsTest . FakeGrpcHttp2ConnectionHandler . noopHandler ( ) ) ; io . netty . channel . Channel channel = new io . netty . bootstrap . Bootstrap ( ) . group ( elg ) . channel ( io . netty . channel . local . LocalChannel . class ) . handler ( handler ) . register ( ) . sync ( ) . channel ( ) ; pipeline = channel . pipeline ( ) ; channel . eventLoop ( ) . submit ( io . grpc . netty . ProtocolNegotiatorsTest . NOOP_RUNNABLE ) . sync ( ) ; channel . connect ( host ) . sync ( ) ; serverChannel . close ( ) ; org . mockito . ArgumentCaptor < io . netty . channel . ChannelHandlerContext > contextCaptor = org . mockito . ArgumentCaptor . forClass ( io . netty . channel . ChannelHandlerContext . class ) ; org . mockito . Mockito . verify ( mockHandler ) . channelActive ( contextCaptor . capture ( ) ) ; io . netty . channel . ChannelHandlerContext serverContext = contextCaptor . getValue ( ) ; final java . lang . String golden = "isThisThingOn?" ; io . netty . channel . ChannelFuture negotiationFuture = channel . writeAndFlush ( io . grpc . netty . ProtocolNegotiatorsTest . bb ( golden , channel ) ) ; channel . eventLoop ( ) . submit ( io . grpc . netty . ProtocolNegotiatorsTest . NOOP_RUNNABLE ) . sync ( ) ; org . mockito . ArgumentCaptor < java . lang . Object > objectCaptor = org . mockito . ArgumentCaptor . forClass ( java . lang . Object . class ) ; org . mockito . Mockito . verify ( mockHandler ) . channelRead ( any ( io . netty . channel . ChannelHandlerContext . class ) , objectCaptor . capture ( ) ) ; io . netty . buffer . ByteBuf request = ( ( io . netty . buffer . ByteBuf ) ( objectCaptor . getValue ( ) ) ) ; request . release ( ) ; "<AssertPlaceHolder>" ; java . lang . String response = "HTTP/1.1<sp>500<sp>OMG\r\nContent-Length:<sp>4\r\n\r\noops" ; serverContext . writeAndFlush ( io . grpc . netty . ProtocolNegotiatorsTest . bb ( response , serverContext . channel ( ) ) ) . sync ( ) ; thrown . expect ( io . netty . handler . proxy . ProxyConnectException . class ) ; try { negotiationFuture . sync ( ) ; } finally { channel . close ( ) ; } } isDone ( ) { return ( done ) || ( canceled ) ; }
org . junit . Assert . assertFalse ( negotiationFuture . isDone ( ) )
testTemplate ( ) { simpleJdbcTemplate . execute ( "delete<sp>from<sp>T_FOOS" ) ; int count = simpleJdbcTemplate . queryForObject ( "select<sp>count(*)<sp>from<sp>T_FOOS" , com . springsource . open . foo . test . Integer . class ) ; "<AssertPlaceHolder>" ; simpleJdbcTemplate . update ( "INSERT<sp>into<sp>T_FOOS<sp>(id,name,foo_date)<sp>values<sp>(?,?,null)" , 0 , "foo" ) ; }
org . junit . Assert . assertEquals ( 0 , count )
testEarlySchemaSelectAllAndMetadata ( ) { org . apache . drill . common . types . TypeProtos . MajorType nullType = org . apache . drill . common . types . TypeProtos . MajorType . newBuilder ( ) . setMinorType ( MinorType . VARCHAR ) . setMode ( DataMode . OPTIONAL ) . build ( ) ; org . apache . drill . exec . physical . impl . scan . project . ScanSchemaOrchestrator . ScanOrchestratorBuilder builder = new org . apache . drill . exec . physical . impl . scan . project . ScanSchemaOrchestrator . ScanOrchestratorBuilder ( ) ; builder . setNullType ( nullType ) ; org . apache . hadoop . fs . Path filePath = new org . apache . hadoop . fs . Path ( "hdfs:///w/x/y/z.csv" ) ; org . apache . drill . exec . physical . impl . scan . file . FileMetadataManager metadataManager = new org . apache . drill . exec . physical . impl . scan . file . FileMetadataManager ( fixture . getOptionManager ( ) , standardOptions ( filePath ) ) ; builder . withMetadata ( metadataManager ) ; builder . setProjection ( org . apache . drill . exec . physical . rowSet . impl . RowSetTestUtils . projectList ( "a" , "b" , "dir0" , "suffix" ) ) ; org . apache . drill . exec . physical . impl . scan . project . ScanSchemaOrchestrator scanner = new org . apache . drill . exec . physical . impl . scan . project . ScanSchemaOrchestrator ( fixture . allocator ( ) , builder ) ; metadataManager . startFile ( filePath ) ; org . apache . drill . exec . physical . impl . scan . project . ReaderSchemaOrchestrator reader = scanner . startReader ( ) ; org . apache . drill . exec . record . metadata . TupleMetadata tableSchema = new org . apache . drill . exec . record . metadata . SchemaBuilder ( ) . add ( "a" , MinorType . INT ) . add ( "b" , MinorType . VARCHAR ) . buildSchema ( ) ; org . apache . drill . exec . physical . rowSet . ResultSetLoader loader = reader . makeTableLoader ( tableSchema ) ; reader . defineSchema ( ) ; org . apache . drill . exec . record . BatchSchema expectedSchema = new org . apache . drill . exec . record . metadata . SchemaBuilder ( ) . add ( "a" , MinorType . INT ) . add ( "b" , MinorType . VARCHAR ) . addNullable ( "dir0" , MinorType . VARCHAR ) . add ( "suffix" , MinorType . VARCHAR ) . build ( ) ; { org . apache . drill . test . rowSet . RowSet . SingleRowSet expected = fixture . rowSetBuilder ( expectedSchema ) . build ( ) ; "<AssertPlaceHolder>" ; org . apache . drill . test . rowSet . RowSetUtilities . verify ( expected , fixture . wrap ( scanner . output ( ) ) ) ; } reader . startBatch ( ) ; loader . writer ( ) . addRow ( 1 , "fred" ) . addRow ( 2 , "wilma" ) ; reader . endBatch ( ) ; { org . apache . drill . test . rowSet . RowSet . SingleRowSet expected = fixture . rowSetBuilder ( expectedSchema ) . addRow ( 1 , "fred" , "x" , "csv" ) . addRow ( 2 , "wilma" , "x" , "csv" ) . build ( ) ; org . apache . drill . test . rowSet . RowSetUtilities . verify ( expected , fixture . wrap ( scanner . output ( ) ) ) ; } scanner . close ( ) ; } output ( ) { out . value = value . value ; }
org . junit . Assert . assertNotNull ( scanner . output ( ) )
memcacheIncrement ( ) { tester . setUp ( ) ; com . google . appengine . api . memcache . MemcacheService ms = com . google . appengine . api . memcache . MemcacheServiceFactory . getMemcacheService ( ) ; ms . increment ( "aaa" , 1 , 1L ) ; tester . tearDown ( ) ; com . google . apphosting . api . ApiProxy . setDelegate ( AppEngineTester . apiProxyLocalImpl ) ; com . google . apphosting . api . ApiProxy . setEnvironmentForCurrentThread ( new org . slim3 . tester . TestEnvironment ( ) ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return ms . contains ( key ) ; }
org . junit . Assert . assertThat ( ms . contains ( "aaa" ) , org . hamcrest . CoreMatchers . is ( false ) )
testEqualsEqual ( ) { nl . knaw . huygens . timbuctoo . model . Datable first = new nl . knaw . huygens . timbuctoo . model . Datable ( "20131011" ) ; nl . knaw . huygens . timbuctoo . model . Datable second = new nl . knaw . huygens . timbuctoo . model . Datable ( "20131011" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( obj instanceof nl . knaw . huygens . security . client . model . HuygensSecurityInformation ) ) { return false ; } nl . knaw . huygens . security . client . model . HuygensSecurityInformation other = ( ( nl . knaw . huygens . security . client . model . HuygensSecurityInformation ) ( obj ) ) ; boolean isEqual = com . google . common . base . Objects . equal ( other . affiliations , affiliations ) ; isEqual &= com . google . common . base . Objects . equal ( other . commonName , commonName ) ; isEqual &= com . google . common . base . Objects . equal ( other . displayName , displayName ) ; isEqual &= com . google . common . base . Objects . equal ( other . emailAddress , emailAddress ) ; isEqual &= com . google . common . base . Objects . equal ( other . givenName , givenName ) ; isEqual &= com . google . common . base . Objects . equal ( other . organization , organization ) ; isEqual &= com . google . common . base . Objects . equal ( other . persistentID , persistentID ) ; isEqual &= com . google . common . base . Objects . equal ( other . surname , surname ) ; isEqual &= com . google . common . base . Objects . equal ( other . principal , principal ) ; return isEqual ; }
org . junit . Assert . assertTrue ( first . equals ( second ) )
find_no_inetnum ( ) { final java . util . List < net . ripe . db . whois . common . dao . RpslObjectInfo > found = subject . findInIndex ( whoisTemplate , rpslObjectInfo . getKey ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return count ; }
org . junit . Assert . assertThat ( found . size ( ) , org . hamcrest . core . Is . is ( 0 ) )
getCopyForCustomer ( ) { java . util . List < org . oscm . domobjects . Product > result = runTX ( new java . util . concurrent . Callable < java . util . List < org . oscm . domobjects . Product > > ( ) { @ org . oscm . subscriptionservice . dao . Override public java . util . List < org . oscm . domobjects . Product > call ( ) throws org . oscm . subscriptionservice . dao . Exception { return dao . getCopyForCustomer ( product , supplierCustomer ) ; } } ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testGetFooter ( ) { final byte [ ] footer = brpJsonLayout . getFooter ( ) ; "<AssertPlaceHolder>" ; } getFooter ( ) { return null ; }
org . junit . Assert . assertNull ( footer )
ctor ( ) { liquibase . statement . AutoIncrementConstraint constraint = new liquibase . statement . AutoIncrementConstraint ( "COL_NAME" ) ; "<AssertPlaceHolder>" ; } getColumnName ( ) { return columnName ; }
org . junit . Assert . assertEquals ( "COL_NAME" , constraint . getColumnName ( ) )
isImportDisabled_UserSelected ( ) { user . setSelected ( true ) ; bean . setUsers ( java . util . Arrays . asList ( user ) ) ; "<AssertPlaceHolder>" ; } isImportDisabled ( ) { bean . setUsers ( java . util . Arrays . asList ( user ) ) ; org . junit . Assert . assertTrue ( bean . isImportDisabled ( ) ) ; }
org . junit . Assert . assertFalse ( bean . isImportDisabled ( ) )
testConvert ( ) { java . lang . String name = "first<sp>blood" ; java . lang . String abbrName = "fb" ; org . lnu . is . domain . person . type . PersonType expected = new org . lnu . is . domain . person . type . PersonType ( ) ; expected . setName ( name ) ; expected . setAbbrName ( abbrName ) ; org . lnu . is . resource . person . type . PersonTypeResource source = new org . lnu . is . resource . person . type . PersonTypeResource ( ) ; source . setName ( name ) ; source . setAbbrName ( abbrName ) ; org . lnu . is . domain . person . type . PersonType actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testNonNumericTimeoutShouldReturnMaxInt ( ) { hudson . plugins . ec2 . SlaveTemplate st = new hudson . plugins . ec2 . SlaveTemplate ( "" , EC2AbstractSlave . TEST_ZONE , null , "default" , "foo" , com . amazonaws . services . ec2 . model . InstanceType . M1Large , false , "ttt" , Node . Mode . NORMAL , "" , "bar" , "iamInstanceProfile" 1 , "aaa" , "iamInstanceProfile" 0 , "iamInstanceProfile" 2 , null , "-Xmx1g" , false , "subnet<sp>456" , null , null , false , null , "iamInstanceProfile" , false , false , "NotANumber" , false , "" ) ; "<AssertPlaceHolder>" ; } getLaunchTimeout ( ) { return ( launchTimeout ) <= 0 ? Integer . MAX_VALUE : launchTimeout ; }
org . junit . Assert . assertEquals ( Integer . MAX_VALUE , st . getLaunchTimeout ( ) )
testImmutableDate ( ) { java . util . Date now = new java . util . Date ( ) ; io . motown . domain . api . chargingstation . TransactionStoppedEvent event = new io . motown . domain . api . chargingstation . TransactionStoppedEvent ( CHARGING_STATION_ID , TRANSACTION_ID , IDENTIFYING_TOKEN , METER_STOP , now , NULL_USER_IDENTITY_CONTEXT ) ; event . getTimestamp ( ) . setTime ( io . motown . domain . api . chargingstation . TWO_MINUTES_AGO . getTime ( ) ) ; "<AssertPlaceHolder>" ; } getTimestamp ( ) { return new java . util . Date ( timestamp . getTime ( ) ) ; }
org . junit . Assert . assertEquals ( now , event . getTimestamp ( ) )
testBeanManager ( ) { "<AssertPlaceHolder>" ; } getBeanManager ( ) { try { javax . naming . InitialContext initialContext = new javax . naming . InitialContext ( ) ; return ( ( javax . enterprise . inject . spi . BeanManager ) ( initialContext . lookup ( "java:comp/BeanManager" ) ) ) ; } catch ( javax . naming . NameNotFoundException nnfe ) { return null ; } catch ( javax . naming . NamingException ne ) { return null ; } }
org . junit . Assert . assertNotNull ( factory . getBeanManager ( ) )
testLanguageFilterArgumentsEmpty ( ) { java . lang . String [ ] args = new java . lang . String [ ] { "--fLang" , "-" } ; org . wikidata . wdtk . client . ClientConfiguration config = new org . wikidata . wdtk . client . ClientConfiguration ( args ) ; java . util . Set < java . lang . String > langFilters = new java . util . HashSet ( ) ; "<AssertPlaceHolder>" ; } getFilterLanguages ( ) { return this . filterLanguages ; }
org . junit . Assert . assertEquals ( langFilters , config . getFilterLanguages ( ) )
testNonAbsoluteURI ( ) { org . apache . taverna . scufl2 . api . activity . Activity a = new org . apache . taverna . scufl2 . api . activity . Activity ( ) ; java . net . URI type = new java . net . URI ( "fred/soup" ) ; a . setType ( type ) ; org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator cv = new org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator ( ) ; org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener rcvl = new org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener ( ) ; cv . checkCorrectness ( a , false , rcvl ) ; java . util . Set < org . apache . taverna . scufl2 . validation . correctness . report . NonAbsoluteURIProblem > problems = rcvl . getNonAbsoluteURIProblems ( ) ; boolean problem = false ; for ( org . apache . taverna . scufl2 . validation . correctness . report . NonAbsoluteURIProblem p : problems ) { if ( ( ( p . getBean ( ) . equals ( a ) ) && ( p . getFieldName ( ) . equals ( "configurableType" ) ) ) && ( p . getFieldValue ( ) . equals ( type ) ) ) { problem = true ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return ( getClass ( ) ) == ( obj . getClass ( ) ) ; }
org . junit . Assert . assertTrue ( problem )
testGetBytes ( ) { byte [ ] bytes = new byte [ ] { 0 , 1 , 2 , 3 , 4 , 5 } ; for ( int i = 0 ; i < ( bytes . length ) ; i ++ ) { com . drew . lang . SequentialReader reader = createReader ( bytes ) ; byte [ ] readBytes = reader . getBytes ( i ) ; for ( int j = 0 ; j < i ; j ++ ) { "<AssertPlaceHolder>" ; } } } getBytes ( int ) { byte [ ] bytes = new byte [ count ] ; getBytes ( bytes , 0 , count ) ; return bytes ; }
org . junit . Assert . assertEquals ( bytes [ j ] , readBytes [ j ] )
testFetchByPrimaryKeyExisting ( ) { com . liferay . segments . model . SegmentsExperience newSegmentsExperience = addSegmentsExperience ( ) ; com . liferay . segments . model . SegmentsExperience existingSegmentsExperience = _persistence . fetchByPrimaryKey ( newSegmentsExperience . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertEquals ( existingSegmentsExperience , newSegmentsExperience )
testUnCapitalize2 ( ) { java . lang . Object target = "<sp>ABC" ; java . lang . String expResult = "<sp>ABC" ; java . lang . String result = org . thymeleaf . util . StringUtils . unCapitalize ( target ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expResult , result )
testBuildAndSearchBinaryESPIndex ( ) { java . lang . String buildCmd = "-dimension<sp>4096<sp>-maxnonalphabetchars<sp>20<sp>-vectortype<sp>binary<sp>-luceneindexpath<sp>tmp/predication_index" ; java . lang . String searchCmd = "-searchtype<sp>boundproduct<sp>-queryvectorfile<sp>semanticvectors.bin<sp>-boundvectorfile<sp>predicatevectors.bin<sp>-searchvectorfile<sp>elementalvectors.bin<sp>-matchcase<sp>mexico<sp>HAS_CURRENCY" ; int rank = espBuildSearchGetRank ( buildCmd , searchCmd , "mexican_peso" ) ; "<AssertPlaceHolder>" ; } espBuildSearchGetRank ( java . lang . String , java . lang . String , java . lang . String ) { java . lang . String [ ] filesToBuild = new java . lang . String [ ] { "elementalvectors.bin" , "predicatevectors.bin" , "semanticvectors.bin" } ; java . lang . String [ ] buildArgs = buildCmd . split ( "\\s+" ) ; for ( java . lang . String fn : filesToBuild ) { if ( new java . io . File ( fn ) . isFile ( ) ) { new java . io . File ( fn ) . delete ( ) ; } org . junit . Assert . assertFalse ( new java . io . File ( fn ) . isFile ( ) ) ; } pitt . search . semanticvectors . ESP . main ( buildArgs ) ; for ( java . lang . String fn : filesToBuild ) org . junit . Assert . assertTrue ( new java . io . File ( fn ) . isFile ( ) ) ; java . lang . String [ ] searchArgs = searchCmd . split ( "\\s+" ) ; pitt . search . semanticvectors . integrationtests . List < pitt . search . semanticvectors . SearchResult > results = pitt . search . semanticvectors . Search . runSearch ( pitt . search . semanticvectors . FlagConfig . getFlagConfig ( searchArgs ) ) ; int rank = 1 ; if ( results . isEmpty ( ) ) { throw new java . lang . RuntimeException ( "Results<sp>were<sp>empty!" ) ; } else { for ( pitt . search . semanticvectors . SearchResult result : results ) { java . lang . String term = ( ( java . lang . String ) ( result . getObjectVector ( ) . getObject ( ) ) ) ; if ( term . contains ( targetTerm ) ) break ; ++ rank ; } } for ( java . lang . String fn : filesToBuild ) { System . err . println ( ( "Deleting<sp>file:<sp>" + fn ) ) ; org . junit . Assert . assertTrue ( ( "Failed<sp>to<sp>delete<sp>file:<sp>" + fn ) , new java . io . File ( fn ) . delete ( ) ) ; } return rank ; }
org . junit . Assert . assertTrue ( ( rank < 2 ) )
testLogicOperatorsWithNullValues ( ) { com . mitchellbosecke . pebble . PebbleEngine pebble = new com . mitchellbosecke . pebble . PebbleEngine . Builder ( ) . loader ( new com . mitchellbosecke . pebble . loader . StringLoader ( ) ) . strictVariables ( false ) . build ( ) ; java . lang . String source = "{%<sp>if<sp>a<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "{%<sp>if<sp>b<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" + "b" 4 ) + "b" 1 ) + "{%<sp>if<sp>true<sp>and<sp>a<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" ) + "b" 9 ) + "{%<sp>if<sp>true<sp>and<sp>c<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" ) + "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" 3 ) + "b" 3 ) + "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" 0 ) + "{%<sp>if<sp>c<sp>and<sp>true<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" ) + "b" 7 ) + "b" 2 ) + "{%<sp>if<sp>false<sp>or<sp>b<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" ) + "b" 6 ) + "b" 5 ) + "{%<sp>if<sp>a<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" ) + "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" 2 ) + "{%<sp>if<sp>c<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" ) + "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" ) ; com . mitchellbosecke . pebble . template . PebbleTemplate template = pebble . getTemplate ( source ) ; java . util . Map < java . lang . String , java . lang . Object > context = new java . util . HashMap ( ) ; context . put ( "b" , null ) ; context . put ( "b" 8 , false ) ; context . put ( "b" 0 , true ) ; java . io . Writer writer = new java . io . StringWriter ( ) ; template . evaluate ( writer , context ) ; "<AssertPlaceHolder>" ; } toString ( ) { return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( ( "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" 1 + ( ( ( "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" 1 + "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" 1 ) + "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" 1 ) + "{%<sp>if<sp>d<sp>or<sp>false<sp>%}yes{%<sp>else<sp>%}no{%<sp>endif<sp>%}" 1 ) ) , writer . toString ( ) )
setGetCacheBuilder ( ) { cacheManager = new com . cetsoft . imcache . spring . ImcacheCacheManager ( ) ; cacheManager . setCacheBuilder ( builder ) ; "<AssertPlaceHolder>" ; } getCacheBuilder ( ) { return cacheBuilder ; }
org . junit . Assert . assertEquals ( builder , cacheManager . getCacheBuilder ( ) )
buildQueryConditionsWithParameters_should_construct_correct_named_query_for_in_operator ( ) { final java . lang . String bind_query = "select<sp>*<sp>from<sp>customer_all<sp>WHERE<sp>age<sp>in<sp>:age<sp>and<sp>x=<sp>:name" ; final int firstAge = 23 ; final int secondAge = 25 ; final java . lang . String convertedFirstAge = org . springframework . data . simpledb . attributeutil . SimpleDBAttributeConverter . encode ( firstAge ) ; final java . lang . String convertedSecondAge = org . springframework . data . simpledb . attributeutil . SimpleDBAttributeConverter . encode ( secondAge ) ; java . lang . String expectedQuery = ( ( ( "select<sp>*<sp>from<sp>customer_all<sp>WHERE<sp>age<sp>in<sp>('" + convertedFirstAge ) + "','" ) + convertedSecondAge ) + "')<sp>and<sp>x=<sp>'name'" ; final org . springframework . data . repository . query . Parameters parameters = getMockParameters ( new java . lang . String [ ] { ":name" , ":age" } , new java . lang . Class [ ] { java . lang . String . class , int [ ] . class } ) ; java . lang . String resultedQuery = org . springframework . data . simpledb . query . QueryUtils . buildQuery ( bind_query , parameters , "name" , new int [ ] { firstAge , secondAge } ) ; "<AssertPlaceHolder>" ; } encode ( java . lang . Object ) { java . lang . String integerNumberEncoding = org . springframework . data . simpledb . attributeutil . AmazonSimpleDBUtil . encodeAsIntegerNumber ( ob ) ; if ( integerNumberEncoding != null ) { return integerNumberEncoding ; } java . lang . String realNumberEncoding = org . springframework . data . simpledb . attributeutil . AmazonSimpleDBUtil . encodeAsRealNumber ( ob ) ; if ( realNumberEncoding != null ) { return realNumberEncoding ; } if ( ob instanceof java . util . Date ) { java . util . Date d = ( ( java . util . Date ) ( ob ) ) ; return org . springframework . data . simpledb . attributeutil . AmazonSimpleDBUtil . encodeDate ( d ) ; } return ob . toString ( ) ; }
org . junit . Assert . assertThat ( resultedQuery , org . hamcrest . CoreMatchers . is ( expectedQuery ) )
processForUpdate ( ) { org . apache . apex . malhar . kudu . KuduExecutionContext < org . apache . apex . malhar . kudu . UnitTestTablePojo > newInsertExecutionContext = new org . apache . apex . malhar . kudu . KuduExecutionContext ( ) ; org . apache . apex . malhar . kudu . UnitTestTablePojo unitTestTablePojo = new org . apache . apex . malhar . kudu . UnitTestTablePojo ( ) ; unitTestTablePojo . setIntrowkey ( 2 ) ; unitTestTablePojo . setStringrowkey ( ( "two" + ( java . lang . System . currentTimeMillis ( ) ) ) ) ; unitTestTablePojo . setTimestamprowkey ( java . lang . System . currentTimeMillis ( ) ) ; unitTestTablePojo . setBooldata ( true ) ; unitTestTablePojo . setFloatdata ( 3.2F ) ; unitTestTablePojo . setStringdata ( ( "" + ( java . lang . System . currentTimeMillis ( ) ) ) ) ; unitTestTablePojo . setLongdata ( ( ( java . lang . System . currentTimeMillis ( ) ) + 1 ) ) ; unitTestTablePojo . setTimestampdata ( ( ( java . lang . System . currentTimeMillis ( ) ) + 2 ) ) ; unitTestTablePojo . setBinarydata ( java . nio . ByteBuffer . wrap ( "stringdata" . getBytes ( ) ) ) ; newInsertExecutionContext . setMutationType ( KuduMutationType . INSERT ) ; newInsertExecutionContext . setPayload ( unitTestTablePojo ) ; simpleKuduOutputOperator . beginWindow ( 1 ) ; simpleKuduOutputOperator . input . process ( newInsertExecutionContext ) ; org . apache . apex . malhar . kudu . KuduExecutionContext < org . apache . apex . malhar . kudu . UnitTestTablePojo > updateExecutionContext = new org . apache . apex . malhar . kudu . KuduExecutionContext ( ) ; org . apache . apex . malhar . kudu . UnitTestTablePojo updatingRecord = new org . apache . apex . malhar . kudu . UnitTestTablePojo ( ) ; updateExecutionContext . setMutationType ( KuduMutationType . UPDATE ) ; updatingRecord . setBooldata ( false ) ; updatingRecord . setIntrowkey ( unitTestTablePojo . getIntrowkey ( ) ) ; updatingRecord . setStringrowkey ( unitTestTablePojo . getStringrowkey ( ) ) ; updatingRecord . setTimestamprowkey ( unitTestTablePojo . getTimestamprowkey ( ) ) ; updateExecutionContext . setPayload ( updatingRecord ) ; simpleKuduOutputOperator . input . process ( updateExecutionContext ) ; simpleKuduOutputOperator . endWindow ( ) ; org . apache . apex . malhar . kudu . UnitTestTablePojo unitTestTablePojoRead = new org . apache . apex . malhar . kudu . UnitTestTablePojo ( ) ; unitTestTablePojoRead . setIntrowkey ( unitTestTablePojo . getIntrowkey ( ) ) ; unitTestTablePojoRead . setStringrowkey ( unitTestTablePojo . getStringrowkey ( ) ) ; unitTestTablePojoRead . setTimestamprowkey ( unitTestTablePojo . getTimestamprowkey ( ) ) ; lookUpAndPopulateRecord ( unitTestTablePojoRead ) ; "<AssertPlaceHolder>" ; } isBooldata ( ) { return booldata ; }
org . junit . Assert . assertEquals ( unitTestTablePojoRead . isBooldata ( ) , false )
testGetFWRevision ( ) { java . lang . String fw = "1.40" ; org . eclipse . kura . bluetooth . le . BluetoothLeGattCharacteristic bch = mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattCharacteristic . class ) ; when ( bch . readValue ( ) ) . thenReturn ( fw . getBytes ( ) ) ; org . eclipse . kura . bluetooth . le . BluetoothLeGattService infoSvcMock = mock ( org . eclipse . kura . bluetooth . le . BluetoothLeGattService . class ) ; when ( infoSvcMock . findCharacteristic ( TiSensorTagGatt . UUID_DEVINFO_FIRMWARE_REVISION ) ) . thenReturn ( bch ) ; org . eclipse . kura . internal . driver . ble . sensortag . TiSensorTagBuilder builder = new org . eclipse . kura . internal . driver . ble . sensortag . TiSensorTagBuilder ( true , true ) . addService ( TiSensorTagGatt . UUID_DEVINFO_SERVICE , infoSvcMock ) ; org . eclipse . kura . internal . driver . ble . sensortag . TiSensorTag tag = builder . build ( true ) ; "<AssertPlaceHolder>" ; } getFirmareRevision ( ) { return this . firmwareRevision ; }
org . junit . Assert . assertEquals ( fw , tag . getFirmareRevision ( ) )
the_default_output_directory_can_be_overriden_using_a_thucydides_system_property ( ) { environmentVariables . setProperty ( "thucydides.outputDirectory" , "thucydides-reports" ) ; java . io . File outputDirectory = configuration . getOutputDirectory ( ) ; "<AssertPlaceHolder>" ; } getPath ( ) { if ( ( userStory ) != null ) { return userStory . getPath ( ) ; } else { return null ; } }
org . junit . Assert . assertThat ( outputDirectory . getPath ( ) , org . hamcrest . core . Is . is ( "thucydides-reports" ) )
testSetFallback ( ) { org . orbisgis . legend . thematic . categorize . CategorizedArea ca = getCategorizedArea ( ) ; org . orbisgis . legend . thematic . AreaParameters ap1 = new org . orbisgis . legend . thematic . AreaParameters ( org . orbisgis . legend . thematic . categorize . Color . decode ( "#211111" ) , 0.4 , 22.0 , "21<sp>1" , org . orbisgis . legend . thematic . categorize . Color . decode ( "#211111" ) , 0.4 ) ; org . orbisgis . legend . thematic . AreaParameters ap2 = new org . orbisgis . legend . thematic . AreaParameters ( org . orbisgis . legend . thematic . categorize . Color . decode ( "#211111" ) , 0.4 , 22.0 , "21<sp>1" , org . orbisgis . legend . thematic . categorize . Color . decode ( "#211111" ) , 0.4 ) ; ca . setFallbackParameters ( ap1 ) ; "<AssertPlaceHolder>" ; } getFallbackParameters ( ) { return new org . orbisgis . legend . thematic . LineParameters ( color . getFallbackValue ( ) , opacity . getFallbackValue ( ) , width . getFallbackValue ( ) , dash . getFallbackValue ( ) ) ; }
org . junit . Assert . assertTrue ( ca . getFallbackParameters ( ) . equals ( ap2 ) )
testGetPortletName3 ( ) { com . liferay . portal . kernel . model . PortletInstance portletInstance = com . liferay . portal . kernel . model . PortletInstance . fromPortletInstanceKey ( getPortletInstanceKey ( PortletKeys . TEST , 1234 ) ) ; "<AssertPlaceHolder>" ; } getPortletName ( ) { return com . liferay . social . activity . web . internal . constants . SocialActivityPortletKeys . SOCIAL_ACTIVITY ; }
org . junit . Assert . assertEquals ( PortletKeys . TEST , portletInstance . getPortletName ( ) )
testProcessImgTagWithAttributesAndSimpleDocumentURL ( ) { com . liferay . document . library . document . conversion . internal . DocumentHTMLProcessor documentHTMLProcessor = new com . liferay . document . library . document . conversion . internal . DocumentHTMLProcessor ( ) ; java . lang . String originalHTML = com . liferay . petra . string . StringBundler . concat ( "<html><head><title>test-title</title></head><body>" , "<img<sp>class=\"test\"<sp>src=\"/documents/29543/100903188/how-long" , "/4e69-b2cc-e6ef21c10?t=1513212\"/></body></html>" ) ; java . io . InputStream originalIS = new java . io . ByteArrayInputStream ( originalHTML . getBytes ( ) ) ; java . io . InputStream processedIS = documentHTMLProcessor . process ( originalIS ) ; java . lang . String processedHTML = org . apache . commons . io . IOUtils . toString ( processedIS , "UTF-8" ) ; java . lang . String expectedHTML = com . liferay . petra . string . StringBundler . concat ( "<html><head><title>test-title</title></head><body>" , "<img<sp>class=\"test\"<sp>src=\"/documents/29543/100903188/how-long" , "/4e69-b2cc-e6ef21c10?t=1513212&auth_token=authtoken\"/></body>" , "</html>" ) ; "<AssertPlaceHolder>" ; } concat ( java . lang . Object [ ] ) { java . lang . String [ ] strings = new java . lang . String [ objects . length ] ; for ( int i = 0 ; i < ( objects . length ) ; i ++ ) { strings [ i ] = java . lang . String . valueOf ( objects [ i ] ) ; } return com . liferay . petra . string . StringBundler . _toString ( strings , strings . length ) ; }
org . junit . Assert . assertEquals ( expectedHTML , processedHTML )
testIntegerAnnotations ( ) { org . apache . htrace . Span span = getSpan ( ) ; org . apache . phoenix . trace . TracingUtils . addAnnotation ( span , "message" , 10 ) ; org . apache . phoenix . trace . TraceSpanReceiver source = new org . apache . phoenix . trace . TraceSpanReceiver ( ) ; org . apache . htrace . Trace . addReceiver ( source ) ; org . apache . htrace . Tracer . getInstance ( ) . deliver ( span ) ; "<AssertPlaceHolder>" ; } getNumSpans ( ) { return spanQueue . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( source . getNumSpans ( ) ) == 1 ) )
testNoContinuationForOneWay ( ) { org . apache . cxf . message . Exchange exchange = new org . apache . cxf . message . ExchangeImpl ( ) ; exchange . setOneWay ( true ) ; org . apache . cxf . message . Message m = new org . apache . cxf . message . MessageImpl ( ) ; m . setExchange ( exchange ) ; org . apache . cxf . transport . jms . continuations . Counter counter = org . easymock . EasyMock . createMock ( org . apache . cxf . transport . jms . continuations . Counter . class ) ; org . apache . cxf . transport . jms . continuations . JMSContinuationProvider provider = new org . apache . cxf . transport . jms . continuations . JMSContinuationProvider ( null , m , null , counter ) ; "<AssertPlaceHolder>" ; } getContinuation ( ) { org . apache . cxf . continuations . ContinuationProvider provider = ( ( org . apache . cxf . continuations . ContinuationProvider ) ( context . getMessageContext ( ) . get ( org . apache . cxf . continuations . ContinuationProvider . class . getName ( ) ) ) ) ; return provider . getContinuation ( ) ; }
org . junit . Assert . assertNull ( provider . getContinuation ( ) )
createPanelApp ( ) { wizardAction . openNewLiferayModuleWizard ( ) ; wizardAction . newModule . prepareGradle ( project . getName ( ) , com . liferay . ide . ui . module . tests . PANEL_APP ) ; wizardAction . finish ( ) ; jobAction . waitForNoRunningJobs ( ) ; "<AssertPlaceHolder>" ; viewAction . project . closeAndDelete ( project . getName ( ) ) ; } visibleFileTry ( java . lang . String [ ] ) { try { return _getProjects ( ) . isVisible ( files ) ; } catch ( java . lang . Exception e ) { _getProjects ( ) . setFocus ( ) ; try { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - 1 ) ) ; _getProjects ( ) . expand ( parents ) ; _getProjects ( ) . contextMenu ( com . liferay . ide . ui . liferay . action . REFRESH , parents ) ; ide . sleep ( 2000 ) ; } catch ( java . lang . Exception e1 ) { } for ( int i = ( files . length ) - 1 ; i > 0 ; i -- ) { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - i ) ) ; org . eclipse . swtbot . swt . finder . widgets . SWTBotTreeItem parent = _getProjects ( ) . getTreeItem ( parents ) ; _getProjects ( ) . expand ( parents ) ; java . lang . String subnode = files [ ( ( files . length ) - i ) ] ; _jobAction . waitForSubnode ( parent , subnode , com . liferay . ide . ui . liferay . action . REFRESH ) ; } return _getProjects ( ) . isVisible ( files ) ; } }
org . junit . Assert . assertTrue ( viewAction . project . visibleFileTry ( project . getName ( ) ) )
testGetMaxTTDReturnsAdapterSpecificValue ( ) { final org . eclipse . hono . util . TenantObject obj = org . eclipse . hono . util . TenantObject . from ( Constants . DEFAULT_TENANT , true ) ; obj . addAdapterConfiguration ( org . eclipse . hono . util . TenantObject . newAdapterConfig ( "custom" , true ) . put ( TenantConstants . FIELD_MAX_TTD , 10 ) ) ; "<AssertPlaceHolder>" ; } getMaxTimeUntilDisconnect ( java . lang . String ) { java . util . Objects . requireNonNull ( typeName ) ; final int maxTtd = java . util . Optional . ofNullable ( getAdapterConfiguration ( typeName ) ) . map ( ( conf ) -> { return java . util . Optional . ofNullable ( getProperty ( conf , TenantConstants . FIELD_MAX_TTD ) ) . map ( ( obj ) -> { return ( ( java . lang . Integer ) ( obj ) ) ; } ) . orElse ( TenantConstants . DEFAULT_MAX_TTD ) ; } ) . orElse ( java . util . Optional . ofNullable ( getProperty ( TenantConstants . FIELD_MAX_TTD ) ) . map ( ( obj ) -> { return ( ( java . lang . Integer ) ( obj ) ) ; } ) . orElse ( TenantConstants . DEFAULT_MAX_TTD ) ) ; if ( maxTtd < 0 ) { return TenantConstants . DEFAULT_MAX_TTD ; } else { return maxTtd ; } }
org . junit . Assert . assertThat ( obj . getMaxTimeUntilDisconnect ( "custom" ) , org . hamcrest . CoreMatchers . is ( 10 ) )
testNotEmpty ( ) { org . onosproject . net . resource . DiscreteResource res1 = org . onosproject . net . resource . Resources . discrete ( org . onosproject . net . DeviceId . deviceId ( "a" ) ) . resource ( ) ; org . onosproject . store . resource . impl . DiscreteResources sut = org . onosproject . store . resource . impl . GenericDiscreteResources . of ( com . google . common . collect . ImmutableSet . of ( res1 ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return map . isEmpty ( ) ; }
org . junit . Assert . assertThat ( sut . isEmpty ( ) , org . hamcrest . Matchers . is ( false ) )
getProteinsByIdRange ( ) { deleteAll ( ) ; dao . insertProteinMatches ( createGene3dMatches ( ) ) ; java . util . Set < uk . ac . ebi . interpro . scan . model . raw . RawProtein < uk . ac . ebi . interpro . scan . model . raw . Gene3dHmmer3RawMatch > > proteins = dao . getProteinsByIdRange ( uk . ac . ebi . interpro . scan . persistence . raw . RawMatchDAOTest . SEQ_ID , uk . ac . ebi . interpro . scan . persistence . raw . RawMatchDAOTest . SEQ_ID , uk . ac . ebi . interpro . scan . persistence . raw . RawMatchDAOTest . DB_RELEASE ) ; "<AssertPlaceHolder>" ; } getProteinsByIdRange ( long , long , java . lang . String ) { javax . persistence . Query query = entityManager . createQuery ( java . lang . String . format ( ( "select<sp>p<sp>from<sp>%s<sp>p<sp>" + ( ( "where<sp>p.numericSequenceId<sp>>=<sp>:bottom<sp>" + "and<sp>p.numericSequenceId<sp><=<sp>:top<sp>" ) + "and<sp>p.signatureLibraryRelease<sp>=<sp>:sigLibRelease" ) ) , unqualifiedModelClassName ) ) . setParameter ( "bottom" , bottomId ) . setParameter ( "top" , topId ) . setParameter ( "sigLibRelease" , signatureDatabaseRelease ) ; @ uk . ac . ebi . interpro . scan . persistence . raw . SuppressWarnings ( "unchecked" ) uk . ac . ebi . interpro . scan . persistence . raw . List < T > list = query . getResultList ( ) ; uk . ac . ebi . interpro . scan . persistence . raw . Map < java . lang . String , uk . ac . ebi . interpro . scan . model . raw . RawProtein < T > > map = new uk . ac . ebi . interpro . scan . persistence . raw . HashMap < java . lang . String , uk . ac . ebi . interpro . scan . model . raw . RawProtein < T > > ( ) ; for ( T match : list ) { java . lang . String id = match . getSequenceIdentifier ( ) ; uk . ac . ebi . interpro . scan . model . raw . RawProtein < T > rawProtein = map . get ( id ) ; if ( rawProtein == null ) { rawProtein = new uk . ac . ebi . interpro . scan . model . raw . RawProtein < T > ( id ) ; map . put ( id , rawProtein ) ; } rawProtein . addMatch ( match ) ; } return new uk . ac . ebi . interpro . scan . persistence . raw . HashSet < uk . ac . ebi . interpro . scan . model . raw . RawProtein < T > > ( map . values ( ) ) ; }
org . junit . Assert . assertEquals ( 1 , proteins . size ( ) )
objects_nonNull ( ) { boolean nonNull = java . util . Objects . nonNull ( "" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( nonNull )
testDefineFunctionArrayExistence ( ) { org . nd4j . autodiff . samediff . SameDiff sameDiff = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; java . lang . String testFunctionName = "testfunction" ; org . nd4j . autodiff . samediff . SDVariable [ ] inputVars = new org . nd4j . autodiff . samediff . SDVariable [ ] { sameDiff . var ( "one" , new long [ ] { 1 , 1 } ) , sameDiff . var ( "two" , new long [ ] { 1 , 1 } ) } ; org . nd4j . autodiff . samediff . SameDiff functionDef = sameDiff . defineFunction ( testFunctionName , new org . nd4j . autodiff . samediff . SameDiff . SameDiffFunctionDefinition ( ) { @ org . nd4j . autodiff . samediff . Override public org . nd4j . autodiff . samediff . SDVariable [ ] define ( org . nd4j . autodiff . samediff . SameDiff sameDiff , org . nd4j . autodiff . samediff . Map < java . lang . String , org . nd4j . linalg . api . ndarray . INDArray > inputs , org . nd4j . autodiff . samediff . SDVariable [ ] variableInputs ) { return new org . nd4j . autodiff . samediff . SDVariable [ ] { variableInputs [ 0 ] . add ( variableInputs [ 1 ] ) } ; } } , inputVars ) ; "<AssertPlaceHolder>" ; } variables ( ) { return new org . nd4j . autodiff . samediff . ArrayList ( variableMap . values ( ) ) ; }
org . junit . Assert . assertEquals ( 3 , functionDef . variables ( ) . size ( ) )
testEmpty ( ) { final com . spotify . heroic . common . Series series = com . spotify . heroic . common . Series . of ( null , new java . util . HashMap < java . lang . String , java . lang . String > ( ) ) ; "<AssertPlaceHolder>" ; } roundTrip ( com . spotify . heroic . common . Series ) { final java . nio . ByteBuffer bb = com . spotify . heroic . metric . datastax . serialization . legacy . SeriesSerializerTest . serializer . serialize ( series ) ; final com . spotify . heroic . common . Series after = com . spotify . heroic . metric . datastax . serialization . legacy . SeriesSerializerTest . serializer . deserialize ( bb ) ; bb . rewind ( ) ; org . junit . Assert . assertEquals ( bb , com . spotify . heroic . metric . datastax . serialization . legacy . SeriesSerializerTest . serializer . serialize ( after ) ) ; return after ; }
org . junit . Assert . assertEquals ( series , roundTrip ( series ) )
testWelOverlapTweeActiesZonderDeg ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtIdentificeerbaar > overtreders = brby0024 . voerRegelUit ( maakBericht ( 2001 , 2005 , 2003 , null ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , overtreders . size ( ) )
testWhile ( ) { java . lang . String s = "WHILE<sp>@@FETCH_STATUS<sp>=<sp>0<sp>BEGIN<sp>FETCH<sp>NEXT<sp>FROM<sp>Employee_Cursor;<sp>END;<sp>" ; int result = calculate ( s ) ; "<AssertPlaceHolder>" ; } calculate ( java . lang . String ) { org . sonar . plugins . tsql . antlr . AntlrContext result = org . sonar . plugins . tsql . helpers . AntlrUtils . getRequest ( s ) ; org . sonar . plugins . tsql . antlr . visitors . CComplexityVisitor vv = new org . sonar . plugins . tsql . antlr . visitors . CComplexityVisitor ( ) ; org . sonar . plugins . tsql . antlr . visitors . CustomTreeVisitor visitor = new org . sonar . plugins . tsql . antlr . visitors . CustomTreeVisitor ( vv ) ; visitor . apply ( result . getRoot ( ) ) ; return vv . getMeasure ( ) ; }
org . junit . Assert . assertEquals ( 2 , result )
testGetParameters ( ) { java . lang . String name = "AddressN" ; java . lang . String abbrName = "AN" ; org . lnu . is . domain . course . type . CourseType entity = new org . lnu . is . domain . course . type . CourseType ( ) ; entity . setName ( name ) ; entity . setAbbrName ( abbrName ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "name" , name ) ; expected . put ( "abbrName" , abbrName ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; 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 )
testGetSetName ( ) { java . lang . String expectedName = "expectedName" ; com . microsoft . windowsazure . services . media . models . ContentKeyAuthorizationPolicyInfo contentKeyAuthorizationPolicyInfo = new com . microsoft . windowsazure . services . media . models . ContentKeyAuthorizationPolicyInfo ( null , new com . microsoft . windowsazure . services . media . implementation . content . ContentKeyAuthorizationPolicyType ( ) . setName ( expectedName ) ) ; java . lang . String actualName = contentKeyAuthorizationPolicyInfo . getName ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( expectedName , actualName )
map3 ( ) { com . querydsl . core . group . Map < java . lang . Integer , com . querydsl . core . group . Map < java . lang . Integer , com . querydsl . core . group . Map < java . lang . Integer , java . lang . String > > > actual = com . querydsl . core . group . MAP3_RESULTS . transform ( groupBy ( postId ) . as ( map ( postId , map ( commentId , commentText ) ) ) ) ; com . querydsl . core . group . Map < java . lang . Integer , com . querydsl . core . group . Map < java . lang . Integer , com . querydsl . core . group . Map < java . lang . Integer , java . lang . String > > > expected = new com . querydsl . core . group . LinkedHashMap < java . lang . Integer , com . querydsl . core . group . Map < java . lang . Integer , com . querydsl . core . group . Map < java . lang . Integer , java . lang . String > > > ( ) ; for ( com . querydsl . core . group . Iterator < com . querydsl . core . Tuple > iterator = com . querydsl . core . group . MAP3_RESULTS . iterate ( ) ; iterator . hasNext ( ) ; ) { com . querydsl . core . Tuple tuple = iterator . next ( ) ; java . lang . Object [ ] array = tuple . toArray ( ) ; com . querydsl . core . group . Map < java . lang . Integer , com . querydsl . core . group . Map < java . lang . Integer , java . lang . String > > posts = expected . get ( array [ 0 ] ) ; if ( posts == null ) { posts = new com . querydsl . core . group . LinkedHashMap < java . lang . Integer , com . querydsl . core . group . Map < java . lang . Integer , java . lang . String > > ( ) ; expected . put ( ( ( java . lang . Integer ) ( array [ 0 ] ) ) , posts ) ; } @ com . querydsl . core . group . SuppressWarnings ( "unchecked" ) com . mysema . commons . lang . Pair < java . lang . Integer , com . mysema . commons . lang . Pair < java . lang . Integer , java . lang . String > > pair = ( ( com . mysema . commons . lang . Pair < java . lang . Integer , com . mysema . commons . lang . Pair < java . lang . Integer , java . lang . String > > ) ( array [ 1 ] ) ) ; java . lang . Integer first = pair . getFirst ( ) ; com . querydsl . core . group . Map < java . lang . Integer , java . lang . String > comments = posts . get ( first ) ; if ( comments == null ) { comments = new com . querydsl . core . group . LinkedHashMap < java . lang . Integer , java . lang . String > ( ) ; posts . put ( first , comments ) ; } com . mysema . commons . lang . Pair < java . lang . Integer , java . lang . String > second = pair . getSecond ( ) ; comments . put ( second . getFirst ( ) , second . getSecond ( ) ) ; } "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) . append ( "<sp>sql:" ) . append ( nicerSql ( getSQL ( ) ) ) . append ( "<sp>connection:" ) . append ( ( ( connection ) == null ? "not<sp>connected" : "connected" ) ) . append ( "<sp>entity:" ) . append ( entity ) . append ( "<sp>exception:" ) . append ( exception ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : contextMap . entrySet ( ) ) { sb . append ( "<sp>[" ) . append ( entry . getKey ( ) ) . append ( ":" ) . append ( entry . getValue ( ) ) . append ( "]" ) ; } return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( expected . toString ( ) , actual . toString ( ) )
propertyFoundEvenWithProjectPrefix ( ) { final java . lang . String propertyName = "project.valid" ; final java . lang . String propertyValue = com . redhat . rcm . maven . plugin . buildmetadata . maven . MavenPropertyHelperPropertiesTest . PROPERTY_VALUE ; final java . util . Properties properties = new java . util . Properties ( ) ; properties . setProperty ( propertyName , propertyValue ) ; projectModel . setProperties ( properties ) ; final java . lang . String value = uut . getProperty ( propertyName ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { if ( name == null ) { throw new java . lang . NullPointerException ( "Name<sp>of<sp>requested<sp>property<sp>must<sp>not<sp>be<sp>'null'" ) ; } java . lang . String value = null ; if ( isProjectProperty ( name ) ) { value = getProjectProperty ( name ) ; } if ( value == null ) { value = getPropertiesProperty ( name ) ; } return value ; }
org . junit . Assert . assertEquals ( propertyValue , value )
testBoolean ( ) { final boolean result = org . apache . commons . lang3 . RandomUtils . nextBoolean ( ) ; "<AssertPlaceHolder>" ; } nextBoolean ( ) { return org . apache . commons . lang3 . RandomUtils . RANDOM . nextBoolean ( ) ; }
org . junit . Assert . assertTrue ( ( ( result == true ) || ( result == false ) ) )
testCorrectLinkWithRef ( ) { com . ibm . ws . microprofile . openapi . impl . validation . LinkValidator validator = com . ibm . ws . microprofile . openapi . impl . validation . LinkValidator . getInstance ( ) ; com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper vh = new com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper ( ) ; com . ibm . ws . microprofile . openapi . impl . model . links . LinkImpl correctLink = new com . ibm . ws . microprofile . openapi . impl . model . links . LinkImpl ( ) ; correctLink . setDescription ( "This<sp>is<sp>a<sp>correct<sp>test<sp>link" ) ; java . lang . String operationRef = "#/paths/~1my-test-path-two/get" ; correctLink . setOperationRef ( operationRef ) ; validator . validate ( vh , context , key , correctLink ) ; "<AssertPlaceHolder>" ; } getEventsSize ( ) { return result . getEvents ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , vh . getEventsSize ( ) )
testGetExactReturnType_extend ( ) { try { java . lang . reflect . Method m = org . evosuite . utils . generic . GenericMethodTest . C . class . getDeclaredMethod ( "bar" , java . lang . Object . class ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { } java . lang . reflect . Method m = org . evosuite . utils . generic . GenericMethodTest . C . class . getDeclaredMethod ( "bar" , org . evosuite . utils . generic . GenericMethodTest . A . class ) ; org . evosuite . utils . generic . GenericMethod gm = new org . evosuite . utils . generic . GenericMethod ( m , org . evosuite . utils . generic . GenericMethodTest . C . class ) ; java . lang . reflect . Type res = gm . getExactReturnType ( m , org . evosuite . utils . generic . GenericMethodTest . C . class ) ; "<AssertPlaceHolder>" ; } getExactReturnType ( java . lang . reflect . Method , java . lang . reflect . Type ) { org . evosuite . runtime . util . Inputs . checkNull ( m , type ) ; java . lang . reflect . Type returnType = m . getGenericReturnType ( ) ; java . lang . reflect . Type exactDeclaringType = null ; try { exactDeclaringType = com . googlecode . gentyref . GenericTypeReflector . getExactSuperType ( com . googlecode . gentyref . GenericTypeReflector . capture ( type ) , m . getDeclaringClass ( ) ) ; } catch ( org . evosuite . utils . generic . java e ) { } if ( exactDeclaringType == null ) { logger . info ( ( ( ( ( ( "The<sp>method<sp>" + m ) + "<sp>is<sp>not<sp>a<sp>member<sp>of<sp>type<sp>" ) + type ) + "<sp>-<sp>declared<sp>in<sp>" ) + ( m . getDeclaringClass ( ) ) ) ) ; return m . getReturnType ( ) ; } return mapTypeParameters ( returnType , exactDeclaringType ) ; }
org . junit . Assert . assertEquals ( org . evosuite . utils . generic . GenericMethodTest . A . class , res )
escape_cr ( ) { java . util . List < java . lang . String > results = com . asakusafw . runtime . io . text . tabular . LineCursorTest . parse ( '\\' , false , "Hello\\\rworld" ) ; "<AssertPlaceHolder>" ; } contains ( E [ ] ) { return org . hamcrest . Matchers . Matchers . contains ( items ) ; }
org . junit . Assert . assertThat ( results , contains ( "Hello\\\rworld" ) )
testDisconnect ( ) { System . out . println ( "disconnect" ) ; java . nio . channels . DatagramChannel result = instance . disconnect ( ) ; "<AssertPlaceHolder>" ; } disconnect ( ) { transport . disconnect ( ) ; }
org . junit . Assert . assertNotNull ( result )
decodeUnsupportedRequestCommandId ( ) { org . jboss . netty . buffer . ChannelBuffer buffer = com . cloudhopper . smpp . transcoder . BufferHelper . createBuffer ( "0000001000000110000000000a342ee7" ) ; try { com . cloudhopper . smpp . transcoder . EnquireLink pdu0 = ( ( com . cloudhopper . smpp . transcoder . EnquireLink ) ( transcoder . decode ( buffer ) ) ) ; org . junit . Assert . fail ( ) ; } catch ( com . cloudhopper . smpp . type . UnknownCommandIdException e ) { } "<AssertPlaceHolder>" ; } decode ( org . jboss . netty . buffer . ChannelBuffer ) { if ( ( buffer . readableBytes ( ) ) < ( com . cloudhopper . smpp . SmppConstants . PDU_INT_LENGTH ) ) { return null ; } int commandLength = buffer . getInt ( buffer . readerIndex ( ) ) ; if ( commandLength < ( com . cloudhopper . smpp . SmppConstants . PDU_HEADER_LENGTH ) ) { throw new com . cloudhopper . smpp . type . UnrecoverablePduException ( ( ( "Invalid<sp>PDU<sp>length<sp>[0x" + ( com . cloudhopper . commons . util . HexUtil . toHexString ( commandLength ) ) ) + "]<sp>parsed" ) ) ; } if ( ( buffer . readableBytes ( ) ) < commandLength ) { return null ; } org . jboss . netty . buffer . ChannelBuffer buffer0 = buffer . readSlice ( commandLength ) ; return doDecode ( commandLength , buffer0 ) ; }
org . junit . Assert . assertEquals ( 0 , buffer . readableBytes ( ) )
testConvertWithWithContextPaths ( ) { org . ikasan . component . converter . xml . XmlByteArrayToObjectConverter converter = new org . ikasan . component . converter . xml . XmlByteArrayToObjectConverter ( ) ; org . ikasan . component . converter . xml . XmlToObjectConverterConfiguration configuration = new org . ikasan . component . converter . xml . XmlToObjectConverterConfiguration ( ) ; configuration . setContextPaths ( new java . lang . String [ ] { "org.ikasan.component.converter.xml.jaxb" } ) ; converter . setConfiguration ( configuration ) ; org . ikasan . component . converter . xml . jaxb . Example converted = ( ( org . ikasan . component . converter . xml . jaxb . Example ) ( converter . convert ( new org . ikasan . component . converter . xml . ExampleEventFactory ( ) . getXmlEvent ( ) . getBytes ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getXmlEvent ( ) { return this . xml ; }
org . junit . Assert . assertEquals ( new org . ikasan . component . converter . xml . jaxb . Example ( "1" , "2" ) , converted )
testArrayParser ( ) { java . lang . Object [ ] [ ] resultSet = new java . lang . Object [ 2 ] [ ] ; resultSet [ 0 ] = new java . lang . Object [ 2 ] ; resultSet [ 0 ] [ 0 ] = "hello" ; resultSet [ 0 ] [ 1 ] = "world" ; resultSet [ 1 ] = new java . lang . Object [ 2 ] ; resultSet [ 1 ] [ 0 ] = "jajaja" ; resultSet [ 1 ] [ 1 ] = "jajaja" ; com . ctrip . xpipe . redis . core . protocal . protocal . ArrayParser parser = new com . ctrip . xpipe . redis . core . protocal . protocal . ArrayParser ( resultSet ) ; io . netty . buffer . ByteBuf byteBuf = parser . format ( ) ; logger . info ( "[result]<sp>\r\n{}" , com . ctrip . xpipe . netty . ByteBufUtils . readToString ( byteBuf ) ) ; byteBuf = parser . format ( ) ; com . ctrip . xpipe . redis . core . protocal . protocal . ArrayParser receiver = new com . ctrip . xpipe . redis . core . protocal . protocal . ArrayParser ( ) ; receiver = ( ( com . ctrip . xpipe . redis . core . protocal . protocal . ArrayParser ) ( receiver . read ( byteBuf ) ) ) ; java . lang . Object [ ] objects = receiver . getPayload ( ) ; "<AssertPlaceHolder>" ; for ( java . lang . Object obj : objects ) { logger . info ( "{}" , obj ) ; } } getPayload ( ) { return payload ; }
org . junit . Assert . assertNotNull ( objects )
testWidgetAdapterReturnsSameAdapterForEachInvocation ( ) { org . eclipse . swt . widgets . Display display = new org . eclipse . swt . widgets . Display ( ) ; org . eclipse . swt . widgets . Widget widget = new org . eclipse . swt . widgets . Shell ( display ) ; java . lang . Object adapter1 = widget . getAdapter ( org . eclipse . rap . rwt . internal . lifecycle . WidgetLCA . class ) ; java . lang . Object adapter2 = widget . getAdapter ( org . eclipse . rap . rwt . internal . lifecycle . WidgetLCA . class ) ; "<AssertPlaceHolder>" ; } getAdapter ( org . eclipse . swt . widgets . DateTime ) { return dateTime . getAdapter ( org . eclipse . swt . internal . widgets . IDateTimeAdapter . class ) ; }
org . junit . Assert . assertSame ( adapter1 , adapter2 )