input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
initializeLocalSrTest ( ) { com . xensource . xenapi . Connection connectionMock = org . mockito . Mockito . mock ( com . xensource . xenapi . Connection . class ) ; java . util . List < com . xensource . xenapi . SR > srsMocks = new java . util . ArrayList ( ) ; com . xensource . xenapi . SR srMock1 = org . mockito . Mockito . mock ( com . xensource . xenapi . SR . class ) ; com . xensource . xenapi . SR srMock2 = org . mockito . Mockito . mock ( com . xensource . xenapi . SR . class ) ; org . mockito . Mockito . when ( srMock1 . getPhysicalSize ( connectionMock ) ) . thenReturn ( 0L ) ; org . mockito . Mockito . when ( srMock2 . getPhysicalSize ( connectionMock ) ) . thenReturn ( 100L ) ; srsMocks . add ( srMock1 ) ; srsMocks . add ( srMock2 ) ; org . mockito . Mockito . doReturn ( srsMocks ) . when ( citrixResourceBase ) . getAllLocalSrs ( connectionMock ) ; com . cloud . agent . api . StartupStorageCommand startupStorageCommandMock = org . mockito . Mockito . mock ( com . cloud . agent . api . StartupStorageCommand . class ) ; org . mockito . Mockito . doReturn ( startupStorageCommandMock ) . when ( citrixResourceBase ) . createStartUpStorageCommand ( org . mockito . Mockito . eq ( connectionMock ) , org . mockito . Mockito . any ( com . xensource . xenapi . SR . class ) ) ; java . util . List < com . cloud . agent . api . StartupStorageCommand > startUpCommandsForLocalStorage = citrixResourceBase . initializeLocalSrs ( connectionMock ) ; org . mockito . Mockito . verify ( citrixResourceBase , org . mockito . Mockito . times ( 0 ) ) . createStartUpStorageCommand ( connectionMock , srMock1 ) ; org . mockito . Mockito . verify ( citrixResourceBase , org . mockito . Mockito . times ( 1 ) ) . createStartUpStorageCommand ( connectionMock , srMock2 ) ; "<AssertPlaceHolder>" ; } size ( ) { return _count . get ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , startUpCommandsForLocalStorage . size ( ) )
|
testGetBytesFromZeroInputStream ( ) { java . net . URL emptyTxtUrl = getClass ( ) . getResource ( "/org/hibernate/jpa/test/packaging/empty.txt" ) ; if ( emptyTxtUrl == null ) { throw new java . lang . RuntimeException ( "Bah!" ) ; } java . io . InputStream emptyStream = new java . io . BufferedInputStream ( emptyTxtUrl . openStream ( ) ) ; int length = org . hibernate . jpa . boot . archive . internal . ArchiveHelper . getBytesFromInputStream ( emptyStream ) . length ; "<AssertPlaceHolder>" ; emptyStream . close ( ) ; } getBytesFromInputStream ( java . io . InputStream ) { int size ; byte [ ] entryBytes = new byte [ 0 ] ; for ( ; ; ) { byte [ ] tmpByte = new byte [ 4096 ] ; size = inputStream . read ( tmpByte ) ; if ( size == ( - 1 ) ) { break ; } byte [ ] current = new byte [ ( entryBytes . length ) + size ] ; java . lang . System . arraycopy ( entryBytes , 0 , current , 0 , entryBytes . length ) ; java . lang . System . arraycopy ( tmpByte , 0 , current , entryBytes . length , size ) ; entryBytes = current ; } return entryBytes ; }
|
org . junit . Assert . assertEquals ( length , 0 )
|
testCheckUuidUri ( ) { java . lang . String uuid = java . util . UUID . randomUUID ( ) . toString ( ) ; java . util . List < java . net . URI > uris = com . foundationdb . http . CsrfProtectionRefererFilter . parseAllowedReferers ( ( ( "https://" + uuid ) + ".com" ) ) ; "<AssertPlaceHolder>" ; } isAllowedUri ( java . util . List , java . lang . String , boolean ) { if ( ( referer == null ) || ( referer . isEmpty ( ) ) ) { return isGetRequest ; } java . net . URI refererUri = java . net . URI . create ( referer ) ; for ( java . net . URI uri : allowedReferers ) { if ( ( ( uri . getScheme ( ) . equals ( refererUri . getScheme ( ) ) ) && ( uri . getHost ( ) . equals ( refererUri . getHost ( ) ) ) ) && ( ( uri . getPort ( ) ) == ( refererUri . getPort ( ) ) ) ) { return true ; } } return false ; }
|
org . junit . Assert . assertTrue ( com . foundationdb . http . CsrfProtectionRefererFilter . isAllowedUri ( uris , ( ( "https://" + uuid ) + ".com" ) , isGetRequest ) )
|
testResumeJobException ( ) { org . pentaho . platform . api . scheduler2 . Job job = mock ( org . pentaho . platform . api . scheduler2 . Job . class ) ; doReturn ( job ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService ) . getJob ( anyString ( ) ) ; doReturn ( true ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService ) . isScheduleAllowed ( ) ; doThrow ( new org . pentaho . platform . api . scheduler2 . SchedulerException ( "pause-exception" ) ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService . scheduler ) . resumeJob ( anyString ( ) ) ; try { org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService . resumeJob ( "job-id" ) ; } catch ( org . pentaho . platform . api . scheduler2 . SchedulerException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
|
org . junit . Assert . assertEquals ( "pause-exception" , e . getMessage ( ) )
|
testDaysBack ( ) { java . util . List < gov . nih . nlm . ncbi . www . soap . eutils . EFetchPubmedServiceStub . PubmedArticleType > articles = newArrayList ( new ch . epfl . bbp . uima . pubmed . PubmedSearch2 ( ) . searchDaysBack ( 1 ) ) ; "<AssertPlaceHolder>" ; ch . epfl . bbp . io . TextFileWriter writer = new ch . epfl . bbp . io . TextFileWriter ( "target/last_day.txt" ) ; for ( gov . nih . nlm . ncbi . www . soap . eutils . EFetchPubmedServiceStub . PubmedArticleType art : articles ) { writer . addLine ( ( ( ( art . getMedlineCitation ( ) . getPMID ( ) ) + "\t" ) + ( art . getMedlineCitation ( ) . getArticle ( ) . getArticleTitle ( ) ) ) ) ; } writer . close ( ) ; } size ( ) { return map . size ( ) ; }
|
org . junit . Assert . assertTrue ( ( ( articles . size ( ) ) > 10 ) )
|
multiplyWith1NumProduceSameAsCountResult ( ) { ru . lanwen . verbalregex . VerbalExpression regex = ru . lanwen . verbalregex . VerbalExpression . regex ( ) . multiple ( "a" , 1 ) . build ( ) ; "<AssertPlaceHolder>" ; } equalToRegex ( ru . lanwen . verbalregex . VerbalExpression$Builder ) { return new org . hamcrest . FeatureMatcher < ru . lanwen . verbalregex . VerbalExpression , java . lang . String > ( org . hamcrest . CoreMatchers . equalTo ( builder . build ( ) . toString ( ) ) , "regex" , "" ) { @ ru . lanwen . verbalregex . matchers . Override protected java . lang . String featureValueOf ( ru . lanwen . verbalregex . VerbalExpression verbalExpression ) { return verbalExpression . toString ( ) ; } } ; }
|
org . junit . Assert . assertThat ( regex , equalToRegex ( ru . lanwen . verbalregex . VerbalExpression . regex ( ) . find ( "a" ) . count ( 1 ) ) )
|
testMaskUnsignedByteToIntByte_LowestValue ( ) { int actual = de . persosim . simulator . utils . Utils . maskUnsignedByteToInt ( ( ( byte ) ( 0 ) ) ) ; int expected = 0 ; "<AssertPlaceHolder>" ; } maskUnsignedByteToInt ( byte ) { return ( ( int ) ( byteValue & ( de . persosim . simulator . utils . Utils . MASK_BYTE_TO_INT ) ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
EsIndexdeleteByQueryException ( ) { com . fujitsu . dc . common . es . EsIndex index = com . fujitsu . dc . common . es . impl . v1_2 . EsRetryTest . esClient . idxAdmin ( "index_for_test" ) ; index . create ( ) ; com . fujitsu . dc . common . es . EsType type = com . fujitsu . dc . common . es . impl . v1_2 . EsRetryTest . esClient . type ( index . getName ( ) , "TypeForTest" , "" , 0 , 0 ) ; "<AssertPlaceHolder>" ; type . create ( "id00001" , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; index = createEsIndexInstanceForSuccess ( 4 ) ; com . fujitsu . dc . common . es . query . DcQueryBuilder queryBuilder = com . fujitsu . dc . common . es . query . DcQueryBuilders . matchQuery ( "_id" , "id00001" ) ; index . deleteByQuery ( "index_for_test" , queryBuilder ) ; } getName ( ) { return name ; }
|
org . junit . Assert . assertNotNull ( type )
|
deveRetornarNuloAoPassarCodigoInvalido ( ) { "<AssertPlaceHolder>" ; } valueOfCodigo ( java . lang . String ) { for ( final com . fincatto . documentofiscal . nfe310 . classes . NFOrigemProcesso origemProcesso : com . fincatto . documentofiscal . nfe310 . classes . NFOrigemProcesso . values ( ) ) { if ( origemProcesso . getCodigo ( ) . equals ( codigo ) ) { return origemProcesso ; } } return null ; }
|
org . junit . Assert . assertNull ( com . fincatto . documentofiscal . nfe310 . classes . NFOrigemProcesso . valueOfCodigo ( "" ) )
|
test_user_profile_get ( ) { com . sendgrid . SendGrid sg = new com . sendgrid . SendGrid ( "SENDGRID_API_KEY" , true ) ; sg . setHost ( "localhost:4010" ) ; sg . addRequestHeader ( "X-Mock" , "200" ) ; com . sendgrid . Request request = new com . sendgrid . Request ( ) ; request . setMethod ( Method . GET ) ; request . setEndpoint ( "user/profile" ) ; com . sendgrid . Response response = sg . api ( request ) ; "<AssertPlaceHolder>" ; } api ( com . sendgrid . Request ) { com . sendgrid . Request req = new com . sendgrid . Request ( ) ; req . setMethod ( request . getMethod ( ) ) ; req . setBaseUri ( this . host ) ; req . setEndpoint ( ( ( ( "/" + ( version ) ) + "/" ) + ( request . getEndpoint ( ) ) ) ) ; req . setBody ( request . getBody ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > header : this . requestHeaders . entrySet ( ) ) { req . addHeader ( header . getKey ( ) , header . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , java . lang . String > queryParam : request . getQueryParams ( ) . entrySet ( ) ) { req . addQueryParam ( queryParam . getKey ( ) , queryParam . getValue ( ) ) ; } return makeCall ( req ) ; }
|
org . junit . Assert . assertEquals ( 200 , response . getStatusCode ( ) )
|
testAdd ( ) { final java . util . Set < java . nio . file . Path > paths = com . github . rinde . rinsim . io . FileProvider . builder ( ) . cli ( System . out , "--add" , "src/test,src/main" ) . build ( ) . get ( ) ; final java . util . Set < java . nio . file . Path > paths2 = com . github . rinde . rinsim . io . FileProvider . builder ( ) . add ( asList ( java . nio . file . Paths . get ( "src/main/" ) , java . nio . file . Paths . get ( "src/test/" ) ) ) . build ( ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Class ) { if ( clazz == ( org . eclipse . swt . widgets . Shell . class ) ) { return clazz . cast ( shell ) ; } if ( ( clazz == ( org . eclipse . swt . graphics . Device . class ) ) || ( clazz == ( org . eclipse . swt . widgets . Display . class ) ) ) { return clazz . cast ( shell . getDisplay ( ) ) ; } if ( clazz == ( com . github . rinde . rinsim . ui . MainView . class ) ) { return clazz . cast ( this ) ; } throw new java . lang . IllegalArgumentException ( ( "Unknown<sp>type:<sp>" + clazz ) ) ; }
|
org . junit . Assert . assertEquals ( paths , paths2 )
|
wrongApiToken ( ) { java . lang . String unauthorizedBody = "\"reason\":\"Unauthorized\"" ; stubFor ( get ( urlEqualTo ( java . lang . String . format ( "/api/v1/namespaces/%s/pods" , com . hazelcast . kubernetes . KubernetesClientTest . NAMESPACE ) ) ) . withHeader ( "Authorization" , equalTo ( java . lang . String . format ( "Bearer<sp>%s" , com . hazelcast . kubernetes . KubernetesClientTest . TOKEN ) ) ) . willReturn ( aResponse ( ) . withStatus ( 401 ) . withBody ( unauthorizedBody ) ) ) ; java . util . List < com . hazelcast . kubernetes . KubernetesClient . Endpoint > result = kubernetesClient . endpoints ( ) ; "<AssertPlaceHolder>" ; } endpoints ( ) { try { java . lang . String urlString = java . lang . String . format ( "%s/api/v1/namespaces/%s/pods" , kubernetesMaster , namespace ) ; return enrichWithPublicAddresses ( com . hazelcast . kubernetes . KubernetesClient . parsePodsList ( callGet ( urlString ) ) ) ; } catch ( com . hazelcast . kubernetes . RestClientException e ) { return com . hazelcast . kubernetes . KubernetesClient . handleKnownException ( e ) ; } }
|
org . junit . Assert . assertEquals ( emptyList ( ) , result )
|
testGetRawContent ( ) { when ( diagramServiceController . getRawContent ( diagram ) ) . thenReturn ( org . kie . workbench . common . stunner . project . backend . service . ProjectDiagramServiceImplTest . RAW_CONTENT ) ; java . lang . String result = diagramService . getRawContent ( diagram ) ; "<AssertPlaceHolder>" ; } getRawContent ( org . kie . workbench . common . stunner . project . diagram . ProjectDiagram ) { return controller . getRawContent ( diagram ) ; }
|
org . junit . Assert . assertEquals ( org . kie . workbench . common . stunner . project . backend . service . ProjectDiagramServiceImplTest . RAW_CONTENT , result )
|
sendAnEsperContextMessageAndAssertThatListenerIsInvoked ( ) { template . sendEvent ( new org . opencredo . esper . integration . MessageContext ( new org . springframework . integration . channel . DirectChannel ( ) , "testSourceId" ) ) ; "<AssertPlaceHolder>" ; } getNumberOfTimesInvoked ( ) { return numberOfTimesInvoked ; }
|
org . junit . Assert . assertEquals ( 1 , listener . getNumberOfTimesInvoked ( ) )
|
solveProblemSamePredicateSymbolsDifferentArities ( ) { ws . prova . kernel2 . ProvaKnowledgeBase kb = new ws . prova . reference2 . ProvaKnowledgeBaseImpl ( ) ; ws . prova . kernel2 . ProvaResultSet resultSet = new ws . prova . reference2 . ProvaResultSetImpl ( ) ; ws . prova . kernel2 . ProvaConstant c1 = ws . prova . reference2 . ProvaConstantImpl . create ( 1 ) ; ws . prova . kernel2 . ProvaConstant c4 = ws . prova . reference2 . ProvaConstantImpl . create ( 4 ) ; ws . prova . kernel2 . ProvaVariable p = ws . prova . reference2 . ProvaVariableImpl . create ( "P" ) ; ws . prova . kernel2 . ProvaList l1 = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { c1 , p } ) ; ws . prova . kernel2 . ProvaLiteral query = kb . generateLiteral ( "queens" , l1 ) ; ws . prova . kernel2 . ProvaConstant cp = ws . prova . reference2 . ProvaConstantImpl . create ( "P" ) ; ws . prova . kernel2 . ProvaConstant cResultSet = ws . prova . reference2 . ProvaConstantImpl . create ( resultSet ) ; ws . prova . kernel2 . ProvaList lp = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { cp , p } ) ; ws . prova . kernel2 . ProvaList ls = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { cResultSet , lp } ) ; ws . prova . kernel2 . ProvaLiteral solveBuiltin = kb . generateLiteral ( "solve" , ls ) ; ws . prova . kernel2 . ProvaRule goalRule = kb . generateGoal ( new ws . prova . kernel2 . ProvaLiteral [ ] { query , solveBuiltin } ) ; ws . prova . kernel2 . ProvaVariable n1 = ws . prova . reference2 . ProvaVariableImpl . create ( "N" ) ; ws . prova . kernel2 . ProvaVariable qs1 = ws . prova . reference2 . ProvaVariableImpl . create ( "Qs" ) ; ws . prova . kernel2 . ProvaList l3 = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { n1 , qs1 } ) ; ws . prova . kernel2 . ProvaLiteral lit3 = kb . generateLiteral ( "queens" , l3 ) ; ws . prova . kernel2 . ProvaVariable ns1 = ws . prova . reference2 . ProvaVariableImpl . create ( "Ns" ) ; ws . prova . kernel2 . ProvaList l4 = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { c1 , n1 , ns1 } ) ; ws . prova . kernel2 . ProvaLiteral lit4 = kb . generateLiteral ( "range" , l4 ) ; ws . prova . kernel2 . ProvaList lEmpty = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { } ) ; ws . prova . kernel2 . ProvaList l4a = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { ns1 , lEmpty , qs1 } ) ; ws . prova . kernel2 . ProvaLiteral lit4a = kb . generateLiteral ( "queens" , l4a ) ; ws . prova . kernel2 . ProvaRule rule2 = kb . generateRule ( lit3 , new ws . prova . kernel2 . ProvaLiteral [ ] { lit4 , lit4a } ) ; ws . prova . kernel2 . ProvaVariable n2 = ws . prova . reference2 . ProvaVariableImpl . create ( "N" ) ; ws . prova . kernel2 . ProvaList l2a = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { n2 } ) ; ws . prova . kernel2 . ProvaList l2 = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { n2 , n2 , l2a } ) ; ws . prova . kernel2 . ProvaLiteral lit2 = kb . generateLiteral ( "range" , l2 ) ; ws . prova . kernel2 . ProvaRule rule1 = kb . generateRule ( lit2 , null ) ; ws . prova . kernel2 . ProvaVariable q5 = ws . prova . reference2 . ProvaVariableImpl . create ( "Q" ) ; ws . prova . kernel2 . ProvaList l5 = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { q5 , lEmpty , q5 } ) ; ws . prova . kernel2 . ProvaLiteral lit5 = kb . generateLiteral ( "queens" , l5 ) ; ws . prova . kernel2 . ProvaRule rule5 = kb . generateRule ( lit5 , null ) ; ws . prova . kernel2 . ProvaResolutionInferenceEngine engine = new ws . prova . reference2 . ProvaResolutionInferenceEngineImpl ( kb , goalRule ) ; ws . prova . kernel2 . ProvaDerivationNode result = engine . run ( ) ; "<AssertPlaceHolder>" ; } getSolutions ( ) { return solutions ; }
|
org . junit . Assert . assertEquals ( resultSet . getSolutions ( ) . size ( ) , 1 )
|
test_acceptObjectKey ( java . lang . String , java . lang . String ) { org . joda . beans . ser . json . JsonInput input = new org . joda . beans . ser . json . JsonInput ( new java . io . StringReader ( ( text + "\":" ) ) ) ; "<AssertPlaceHolder>" ; } acceptObjectKey ( org . joda . beans . ser . json . JsonEvent ) { ensureEvent ( event , JsonEvent . STRING ) ; return parseObjectKey ( ) ; }
|
org . junit . Assert . assertEquals ( input . acceptObjectKey ( JsonEvent . STRING ) , expected )
|
testPeggedToV2SerDe ( ) { org . apache . bookkeeper . meta . LedgerMetadataSerDe serDe = new org . apache . bookkeeper . meta . LedgerMetadataSerDe ( ) ; org . apache . bookkeeper . client . api . LedgerMetadata metadata = org . apache . bookkeeper . client . LedgerMetadataBuilder . create ( ) . withEnsembleSize ( 3 ) . withWriteQuorumSize ( 2 ) . withAckQuorumSize ( 1 ) . withPassword ( "foobar" . getBytes ( org . apache . bookkeeper . meta . UTF_8 ) ) . withDigestType ( DigestType . CRC32C ) . newEnsembleEntry ( 0L , com . google . common . collect . Lists . newArrayList ( new org . apache . bookkeeper . net . BookieSocketAddress ( "192.0.2.1" , 3181 ) , new org . apache . bookkeeper . net . BookieSocketAddress ( "192.0.2.2" , 3181 ) , new org . apache . bookkeeper . net . BookieSocketAddress ( "192.0.2.3" , 3181 ) ) ) . build ( ) ; byte [ ] encoded = serDe . serialize ( metadata ) ; org . apache . bookkeeper . client . api . LedgerMetadata decoded = serDe . parseConfig ( encoded , java . util . Optional . empty ( ) ) ; "<AssertPlaceHolder>" ; } getMetadataFormatVersion ( ) { return metadataFormatVersion ; }
|
org . junit . Assert . assertEquals ( 2 , decoded . getMetadataFormatVersion ( ) )
|
testUpdateSchema ( ) { org . talend . components . jdbc . dataset . JDBCDatasetProperties dataset = createDatasetProperties ( true , org . talend . components . jdbc . dataprep . JDBCDatasetTestIT . tablename ) ; org . apache . avro . Schema schema = dataset . main . schema . getValue ( ) ; "<AssertPlaceHolder>" ; org . talend . components . jdbc . common . DBTestUtils . testMetadata ( schema . getFields ( ) , true ) ; } getValue ( ) { return this . value ; }
|
org . junit . Assert . assertNotNull ( schema )
|
testDecodeUnixMilliseconds ( ) { long expectedTimestamp = 1406947271534L ; java . util . Properties testProperties = new java . util . Properties ( ) ; testProperties . setProperty ( "camus.message.timestamp.format" , "unix_milliseconds" ) ; com . linkedin . camus . etl . kafka . coders . JsonStringMessageDecoder testDecoder = new com . linkedin . camus . etl . kafka . coders . JsonStringMessageDecoder ( ) ; testDecoder . init ( testProperties , "testTopic" ) ; java . lang . String payload = ( "{\"timestamp\":<sp>" + expectedTimestamp ) + ",<sp>\"myData\":<sp>\"myValue\"}" ; byte [ ] bytePayload = payload . getBytes ( ) ; com . linkedin . camus . coders . CamusWrapper actualResult = testDecoder . decode ( new com . linkedin . camus . etl . kafka . coders . TestMessage ( ) . setPayload ( bytePayload ) ) ; long actualTimestamp = actualResult . getTimestamp ( ) ; "<AssertPlaceHolder>" ; } getTimestamp ( ) { org . apache . avro . generic . GenericData . Record header = ( ( org . apache . avro . generic . GenericData . Record ) ( super . getRecord ( ) . get ( "header" ) ) ) ; if ( ( header != null ) && ( ( header . get ( "time" ) ) != null ) ) { return ( ( java . lang . Long ) ( header . get ( "time" ) ) ) ; } else if ( ( super . getRecord ( ) . get ( "timestamp" ) ) != null ) { return ( ( java . lang . Long ) ( super . getRecord ( ) . get ( "timestamp" ) ) ) ; } else { return java . lang . System . currentTimeMillis ( ) ; } }
|
org . junit . Assert . assertEquals ( expectedTimestamp , actualTimestamp )
|
testJavaSerialization ( ) { java . lang . Object obj = new org . apache . storm . testing . TestSerObject ( 1 , 2 ) ; java . util . List < java . lang . Object > vals = com . google . common . collect . Lists . newArrayList ( obj ) ; java . util . Map < java . lang . String , java . lang . Object > conf = new java . util . HashMap ( ) ; conf . put ( Config . TOPOLOGY_KRYO_REGISTER , new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( "org.apache.storm.testing.TestSerObject" , null ) ; } } ) ; conf . put ( Config . TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION , false ) ; try { roundtrip ( vals , conf ) ; org . junit . Assert . fail ( ( "Expected<sp>Exception<sp>not<sp>Thrown<sp>for<sp>config:<sp>" + conf ) ) ; } catch ( java . lang . Exception e ) { } conf . clear ( ) ; conf . put ( Config . TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION , true ) ; "<AssertPlaceHolder>" ; } roundtrip ( java . util . List , java . util . Map ) { return deserialize ( serialize ( vals , conf ) , conf ) ; }
|
org . junit . Assert . assertEquals ( vals , roundtrip ( vals , conf ) )
|
notThrowingNPEWhenDOCXFileIsAddedToContainer ( ) { org . digidoc4j . Container container = this . createNonEmptyContainerBy ( java . nio . file . Paths . get ( "src/test/resources/testFiles/helper-files/word_file.docx" ) , "text/xml" ) ; this . createSignatureBy ( container , this . pkcs12SignatureToken ) ; "<AssertPlaceHolder>" ; } getSignatures ( ) { return m_signatures ; }
|
org . junit . Assert . assertEquals ( 1 , container . getSignatures ( ) . size ( ) )
|
testSerialization2 ( ) { org . jfree . chart . plot . dial . DialPointer i1 = new org . jfree . chart . plot . dial . DialPointer . Pointer ( 1 ) ; org . jfree . chart . plot . dial . DialPointer i2 = ( ( org . jfree . chart . plot . dial . DialPointer ) ( org . jfree . chart . TestUtilities . serialised ( i1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( i1 , i2 )
|
testGetParameterCount ( ) { com . ocpsoft . pretty . faces . url . URLPatternParser parser = new com . ocpsoft . pretty . faces . url . URLPatternParser ( "/project/#{paramsBean.project}/#{paramsBean.iteration}/#{paramsBean.story}" ) ; "<AssertPlaceHolder>" ; } getParameterCount ( ) { return pathParameters . size ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , parser . getParameterCount ( ) )
|
one_$parent_contains_none_returns_true_when_expression_values_not_in_array ( ) { com . redhat . lightblue . query . QueryExpression expr = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'array':'field6.nf4.$parent.nf5',<sp>'contains':'$none',<sp>'values':[1,2,3,4]}" ) ; com . redhat . lightblue . eval . QueryEvaluator eval = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( expr , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext context = eval . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; }
|
org . junit . Assert . assertTrue ( context . getResult ( ) )
|
robustnessParse ( ) { boolean exceptionCaught = false ; try { new greycat . internal . task . CoreTask ( ) . parse ( null , null ) . execute ( _graph , null ) ; } catch ( java . lang . RuntimeException e ) { exceptionCaught = true ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( "Unexpected<sp>exception<sp>thrown" ) ; } "<AssertPlaceHolder>" ; } execute ( greycat . internal . task . Graph , greycat . internal . task . Callback ) { executeWith ( graph , null , callback ) ; }
|
org . junit . Assert . assertEquals ( true , exceptionCaught )
|
shouldReturnTreeSetWithWithOutNullItem ( ) { final java . lang . String item = null ; final java . util . TreeSet < java . lang . String > treeSet = uk . gov . gchq . gaffer . commonutil . CollectionUtil . treeSet ( item ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , treeSet . size ( ) )
|
TestGetPowerStateWithNullStatus ( ) { com . vmware . admiral . compute . kubernetes . entities . pods . ContainerStatus status = null ; com . vmware . admiral . compute . container . ContainerService . ContainerState . PowerState state = com . vmware . admiral . adapter . kubernetes . KubernetesContainerStateMapper . getPowerState ( status ) ; "<AssertPlaceHolder>" ; } getPowerState ( com . vmware . admiral . compute . kubernetes . entities . pods . ContainerStatus ) { if ( ( status == null ) || ( ( status . state ) == null ) ) { return com . vmware . admiral . compute . container . ContainerService . ContainerState . PowerState . UNKNOWN ; } if ( ( status . state . running ) != null ) { return com . vmware . admiral . compute . container . ContainerService . ContainerState . PowerState . RUNNING ; } else if ( ( status . state . waiting ) != null ) { return com . vmware . admiral . compute . container . ContainerService . ContainerState . PowerState . PAUSED ; } else if ( ( status . state . terminated ) != null ) { return com . vmware . admiral . compute . container . ContainerService . ContainerState . PowerState . STOPPED ; } else { return com . vmware . admiral . compute . container . ContainerService . ContainerState . PowerState . UNKNOWN ; } }
|
org . junit . Assert . assertEquals ( PowerState . UNKNOWN , state )
|
testTokenizer ( ) { java . lang . String str = "" ; str = "123" 3 ; java . lang . String [ ] resultSet = new java . lang . String [ ] { "" , "abc" , "123" , "456" , "123" 0 , "123" 1 , "" , "123" 4 , "" , "" , "123" 5 , "" } ; java . io . StringReader input = new java . io . StringReader ( str ) ; org . apache . lucene . analysis . core . CSVAnalyzer analyzer = new org . apache . lucene . analysis . core . CSVAnalyzer ( ) ; org . apache . lucene . analysis . TokenStream tokenStream = analyzer . tokenStream ( "" , input ) ; tokenStream . reset ( ) ; org . fastcatsearch . ir . analysis . CSVAnalyzerTest . logger . debug ( "123" 2 , tokenStream ) ; org . apache . lucene . analysis . tokenattributes . CharTermAttribute charTermAttribute = tokenStream . getAttribute ( org . apache . lucene . analysis . tokenattributes . CharTermAttribute . class ) ; org . apache . lucene . analysis . tokenattributes . OffsetAttribute offsetAttribute = tokenStream . getAttribute ( org . apache . lucene . analysis . tokenattributes . OffsetAttribute . class ) ; for ( int inx = 0 ; tokenStream . incrementToken ( ) ; inx ++ ) { java . lang . String term = charTermAttribute . toString ( ) ; org . fastcatsearch . ir . analysis . CSVAnalyzerTest . logger . debug ( "[{}]<sp>\"{}\"<sp>{}~{}" , inx , term , offsetAttribute . startOffset ( ) , offsetAttribute . endOffset ( ) ) ; "<AssertPlaceHolder>" ; } analyzer . close ( ) ; } endOffset ( ) { return endOffset ; }
|
org . junit . Assert . assertEquals ( resultSet [ inx ] , term )
|
rightDisjunctTest ( ) { ann . setInput ( 1 , 0 ) ; ann . calculate ( ) ; print ( "1,<sp>0" , ann . getOutput ( ) [ 0 ] , 1.0 ) ; "<AssertPlaceHolder>" ; } print ( java . lang . String , double , double ) { System . out . println ( ( ( ( ( ( "Testing:<sp>" + input ) + "<sp>Expected:<sp>" ) + actual ) + "<sp>Result:<sp>" ) + output ) ) ; }
|
org . junit . Assert . assertEquals ( ann . getOutput ( ) [ 0 ] , 1.0 , 0.0 )
|
idNullTest ( ) { org . marc . everest . datatypes . generic . SET < org . marc . everest . datatypes . II > ids = org . oscarehr . e2e . model . export . body . FamilyHistoryModelTest . nullFamilyHistoryModel . getIds ( ) ; "<AssertPlaceHolder>" ; } getIds ( ) { return ids ; }
|
org . junit . Assert . assertNotNull ( ids )
|
testUninverting ( ) { remoteCache . put ( 1 , createUser1 ( ) ) ; remoteCache . put ( 2 , createUser2 ( ) ) ; org . infinispan . query . dsl . QueryFactory qf = org . infinispan . client . hotrod . Search . getQueryFactory ( remoteCache ) ; org . infinispan . query . dsl . Query query = qf . from ( org . infinispan . protostream . sampledomain . User . class ) . having ( "name" ) . eq ( "John" ) . orderBy ( "id" ) . build ( ) ; "<AssertPlaceHolder>" ; } list ( ) { return java . util . Collections . emptyList ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , query . list ( ) . size ( ) )
|
testRead ( ) { @ org . jetbrains . annotations . NotNull net . openhft . chronicle . wire . Wire wire = createWire ( ) ; wire . write ( ) ; wire . write ( net . openhft . chronicle . wire . RawWireTest . BWKey . field1 ) ; wire . write ( ( ) -> "Test" ) ; wire . read ( ) ; wire . read ( ) ; wire . read ( ) ; "<AssertPlaceHolder>" ; wire . read ( ) ; } read ( ) { readField ( acquireStringBuilder ( ) , null , net . openhft . chronicle . wire . BinaryWire . AnyCodeMatch . ANY_CODE_MATCH . code ( ) ) ; return ( bytes . readRemaining ( ) ) <= 0 ? acquireDefaultValueIn ( ) : valueIn ; }
|
org . junit . Assert . assertEquals ( 0 , bytes . readRemaining ( ) )
|
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . portal . kernel . model . UserNotificationEvent . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "userNotificationEventId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . portal . kernel . model . UserNotificationEvent > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
testCompareGelijkeIds ( ) { final nl . bzk . brp . model . operationeel . kern . HisPersoonAfgeleidAdministratiefModel afgAdm1 = maakHisPersoonAfgeleidAdministratiefModel ( 123 , new nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumTijdAttribuut ( nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumTijdAttribuut . bouwDatumTijd ( 211 , 1 , 1 ) . getWaarde ( ) ) ) ; final nl . bzk . brp . model . operationeel . kern . HisPersoonAfgeleidAdministratiefModel afgAdm2 = maakHisPersoonAfgeleidAdministratiefModel ( 123 , new nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumTijdAttribuut ( nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumTijdAttribuut . bouwDatumTijd ( 212 , 1 , 1 ) . getWaarde ( ) ) ) ; final int resultaat = comparator . compare ( afgAdm1 , afgAdm2 ) ; "<AssertPlaceHolder>" ; } compare ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Document , nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Document ) { return ( berekenHash ( document1 ) ) - ( berekenHash ( document2 ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , resultaat )
|
testGetSegmentId ( ) { java . util . UUID a = java . util . UUID . randomUUID ( ) ; java . util . UUID b = java . util . UUID . randomUUID ( ) ; java . util . UUID c = java . util . UUID . randomUUID ( ) ; writeSegment ( a ) ; writeSegment ( b ) ; writeSegment ( c ) ; tarFiles . newWriter ( ) ; java . util . Set < java . util . UUID > segmentIds = new java . util . HashSet ( ) ; tarFiles . getSegmentIds ( ) . forEach ( segmentIds :: add ) ; "<AssertPlaceHolder>" ; } getSegmentIds ( ) { java . util . List < org . apache . jackrabbit . oak . segment . SegmentId > ids = new java . util . ArrayList ( ) ; for ( java . util . UUID id : tarFiles . getSegmentIds ( ) ) { long msb = id . getMostSignificantBits ( ) ; long lsb = id . getLeastSignificantBits ( ) ; ids . add ( tracker . newSegmentId ( msb , lsb ) ) ; } return ids ; }
|
org . junit . Assert . assertEquals ( new java . util . HashSet ( java . util . Arrays . asList ( a , b , c ) ) , segmentIds )
|
testBrokenCommand ( ) { javax . transaction . xa . Xid xid = new org . neo4j . kernel . impl . transaction . XidImpl ( new byte [ 4 ] , new byte [ 4 ] ) ; javax . transaction . xa . XAResource xaRes = xaCon . getXaResource ( ) ; xaRes . start ( xid , XAResource . TMNOFLAGS ) ; long node1 = ds . nextId ( org . neo4j . graphdb . Node . class ) ; xaCon . getNodeConsumer ( ) . createNode ( node1 ) ; xaRes . end ( xid , XAResource . TMSUCCESS ) ; xaRes . prepare ( xid ) ; xaCon . clearAllTransactions ( ) ; org . neo4j . kernel . impl . nioneo . store . TestXa . copyLogicalLog ( path ( ) ) ; xaCon . clearAllTransactions ( ) ; ds . close ( ) ; deleteLogicalLogIfExist ( ) ; org . neo4j . kernel . impl . nioneo . store . TestXa . renameCopiedLogicalLog ( path ( ) ) ; truncateLogicalLog ( 37 ) ; ds = newNeoStore ( ) ; xaCon = ( ( org . neo4j . kernel . impl . nioneo . xa . NeoStoreXaConnection ) ( ds . getXaConnection ( ) ) ) ; xaRes = xaCon . getXaResource ( ) ; "<AssertPlaceHolder>" ; xaCon . clearAllTransactions ( ) ; } recover ( java . util . Iterator ) { msgLog . logMessage ( ( "<sp>transactions<sp>already<sp>rolled<sp>back." 4 + ( txLog . getName ( ) ) ) , true ) ; try { java . util . List < org . neo4j . kernel . impl . transaction . TxManager . NonCompletedTransaction > commitList = new java . util . ArrayList < org . neo4j . kernel . impl . transaction . TxManager . NonCompletedTransaction > ( ) ; java . util . List < javax . transaction . xa . Xid > rollbackList = new java . util . LinkedList < javax . transaction . xa . Xid > ( ) ; java . util . Map < org . neo4j . kernel . impl . transaction . TxManager . Resource , javax . transaction . xa . XAResource > resourceMap = new java . util . HashMap < org . neo4j . kernel . impl . transaction . TxManager . Resource , javax . transaction . xa . XAResource > ( ) ; buildRecoveryInfo ( commitList , rollbackList , resourceMap , danglingRecordList ) ; java . util . Iterator < org . neo4j . kernel . impl . transaction . TxManager . Resource > resourceItr = resourceMap . keySet ( ) . iterator ( ) ; java . util . List < javax . transaction . xa . Xid > recoveredXidsList = new java . util . LinkedList < javax . transaction . xa . Xid > ( ) ; while ( resourceItr . hasNext ( ) ) { javax . transaction . xa . XAResource xaRes = resourceMap . get ( resourceItr . next ( ) ) ; javax . transaction . xa . Xid [ ] xids = xaRes . recover ( XAResource . TMNOFLAGS ) ; for ( int i = 0 ; i < ( xids . length ) ; i ++ ) { if ( org . neo4j . kernel . impl . transaction . XidImpl . isThisTm ( xids [ i ] . getGlobalTransactionId ( ) ) ) { if ( rollbackList . contains ( xids [ i ] ) ) { org . neo4j . kernel . impl . transaction . TxManager . log . fine ( ( ( "Unknown<sp>xid:<sp>" 8 + ( xids [ i ] ) ) + "<sp>rolling<sp>back<sp>...<sp>" ) ) ; msgLog . logMessage ( ( ( "TM:<sp>Found<sp>pre<sp>commit<sp>" + ( xids [ i ] ) ) + "<sp>rolling<sp>back<sp>...<sp>" ) , true ) ; rollbackList . remove ( xids [ i ] ) ; xaRes . rollback ( xids [ i ] ) ; } else { recoveredXidsList . add ( xids [ i ] ) ; } } else { org . neo4j . kernel . impl . transaction . TxManager . log . warning ( ( "Unknown<sp>xid:<sp>" + ( xids [ i ] ) ) ) ; } } } java . util . Collections . sort ( commitList , new java . util . Comparator < org . neo4j . kernel . impl . transaction . TxManager . NonCompletedTransaction > ( ) { public int compare ( org . neo4j . kernel . impl . transaction . TxManager . NonCompletedTransaction r1 , org . neo4j . kernel . impl . transaction . TxManager . NonCompletedTransaction r2 ) { return ( r1 . getSequenceNumber ( ) ) - ( r2 . getSequenceNumber ( ) ) ; } } ) ; java . util . Iterator < org . neo4j . kernel . impl . transaction . TxManager . NonCompletedTransaction > commitItr = commitList . iterator ( ) ; while ( commitItr . hasNext ( ) ) { org . neo4j . kernel . impl . transaction . TxManager . NonCompletedTransaction nct = commitItr . next ( ) ; int seq = nct . getSequenceNumber ( ) ; javax . transaction . xa . Xid [ ] xids = nct . getXids ( ) ; org . neo4j . kernel . impl . transaction . TxManager . log . fine ( ( ( ( "Marked<sp>as<sp>commit<sp>tx-seq[" + seq ) + "]<sp>branch<sp>length:<sp>" ) + ( xids . length ) ) ) ; for ( int i = 0 ; i < ( xids . length ) ; i ++ ) { if ( ! ( recoveredXidsList . contains ( xids [ i ] ) ) ) { org . neo4j . kernel . impl . transaction . TxManager . log . fine ( ( ( ( ( ( "Tx-seq[" + seq ) + "][" ) + ( xids [ i ] ) ) + "<sp>transactions<sp>already<sp>rolled<sp>back." 2 ) + "Unknown<sp>xid:<sp>" 0 )
|
org . junit . Assert . assertEquals ( 0 , xaRes . recover ( XAResource . TMNOFLAGS ) . length )
|
testHashCode ( ) { org . eclipse . aether . repository . Authentication auth1 = new org . eclipse . aether . util . repository . SecretAuthentication ( "key" , "value" ) ; org . eclipse . aether . repository . Authentication auth2 = new org . eclipse . aether . util . repository . SecretAuthentication ( "key" , "value" ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { int hash = 17 ; hash = ( hash * 31 ) + ( org . eclipse . aether . transport . http . SslConfig . hash ( context ) ) ; hash = ( hash * 31 ) + ( org . eclipse . aether . transport . http . SslConfig . hash ( verifier ) ) ; hash = ( hash * 31 ) + ( java . util . Arrays . hashCode ( cipherSuites ) ) ; hash = ( hash * 31 ) + ( java . util . Arrays . hashCode ( protocols ) ) ; return hash ; }
|
org . junit . Assert . assertEquals ( auth1 . hashCode ( ) , auth2 . hashCode ( ) )
|
otherMessage ( ) { expected . expect ( com . airhacks . rulz . jaxrsclient . AssertionError . class ) ; expected . expectMessage ( org . hamcrest . CoreMatchers . containsString ( "Internal<sp>Server<sp>Error<sp>500<sp>returned" ) ) ; expected . expectMessage ( org . hamcrest . CoreMatchers . containsString ( "unrecognized<sp>family<sp>of<sp>response" ) ) ; javax . ws . rs . core . Response response = this . tut . request ( ) . header ( "status" , 500 ) . get ( ) ; "<AssertPlaceHolder>" ; } other ( ) { return new org . hamcrest . CustomMatcher < javax . ws . rs . core . Response > ( "unrecognized<sp>family<sp>of<sp>responses" ) { @ com . airhacks . rulz . jaxrsclient . Override public boolean matches ( java . lang . Object o ) { return ( o instanceof javax . ws . rs . core . Response ) && ( ( ( ( javax . ws . rs . core . Response ) ( o ) ) . getStatusInfo ( ) . getFamily ( ) ) == ( Response . Status . Family . OTHER ) ) ; } @ com . airhacks . rulz . jaxrsclient . Override public void describeMismatch ( java . lang . Object item , org . hamcrest . Description description ) { javax . ws . rs . core . Response response = ( ( javax . ws . rs . core . Response ) ( item ) ) ; com . airhacks . rulz . jaxrsclient . HttpMatchers . provideDescription ( response , description ) ; } } ; }
|
org . junit . Assert . assertThat ( response , org . hamcrest . CoreMatchers . is ( com . airhacks . rulz . jaxrsclient . HttpMatchers . other ( ) ) )
|
testIncompatiblePrecedence ( ) { final java . lang . String OUTER_CONFIG = "outer-config" ; final org . apache . flink . api . common . typeutils . TypeSerializer < ? > [ ] testNestedSerializers = new org . apache . flink . api . common . typeutils . TypeSerializer < ? > [ ] { new org . apache . flink . api . common . typeutils . CompositeTypeSerializerSnapshotTest . NestedSerializer ( org . apache . flink . api . common . typeutils . CompositeTypeSerializerSnapshotTest . TargetCompatibility . COMPATIBLE_AS_IS ) , new org . apache . flink . api . common . typeutils . CompositeTypeSerializerSnapshotTest . NestedSerializer ( org . apache . flink . api . common . typeutils . CompositeTypeSerializerSnapshotTest . TargetCompatibility . COMPATIBLE_AFTER_MIGRATION ) , new org . apache . flink . api . common . typeutils . CompositeTypeSerializerSnapshotTest . NestedSerializer ( org . apache . flink . api . common . typeutils . CompositeTypeSerializerSnapshotTest . TargetCompatibility . INCOMPATIBLE ) , new org . apache . flink . api . common . typeutils . CompositeTypeSerializerSnapshotTest . NestedSerializer ( org . apache . flink . api . common . typeutils . CompositeTypeSerializerSnapshotTest . TargetCompatibility . COMPATIBLE_WITH_RECONFIGURED_SERIALIZER ) } ; org . apache . flink . api . common . typeutils . TypeSerializerSchemaCompatibility < java . lang . String > compatibility = snapshotCompositeSerializerAndGetSchemaCompatibilityAfterRestore ( testNestedSerializers , testNestedSerializers , OUTER_CONFIG , OUTER_CONFIG ) ; "<AssertPlaceHolder>" ; } isIncompatible ( ) { return ( compatibilityType ) == ( TypeSerializerSchemaCompatibility . Type . INCOMPATIBLE ) ; }
|
org . junit . Assert . assertTrue ( compatibility . isIncompatible ( ) )
|
testRead ( ) { com . etsy . arbiter . Workflow actual = parser . read ( getClass ( ) . getClassLoader ( ) . getResource ( "testworkflow.yaml" ) ) ; com . etsy . arbiter . Workflow expected = new com . etsy . arbiter . Workflow ( ) ; expected . setName ( "name" ) ; com . etsy . arbiter . Action action1 = new com . etsy . arbiter . Action ( ) ; com . etsy . arbiter . Action action2 = new com . etsy . arbiter . Action ( ) ; expected . setActions ( java . util . Arrays . asList ( action1 , action2 ) ) ; action1 . setName ( "action1" ) ; action1 . setType ( "test" ) ; java . util . Map < java . lang . String , java . util . List < java . lang . String > > args = new java . util . HashMap ( ) ; args . put ( "one" , java . util . Arrays . asList ( "value" 6 , "value" 0 ) ) ; action1 . setPositionalArgs ( args ) ; action2 . setName ( "action2" ) ; action2 . setType ( "test" ) ; action2 . setDependencies ( com . google . common . collect . Sets . newHashSet ( "action1" ) ) ; args = new java . util . HashMap ( ) ; args . put ( "value" 6 , java . util . Arrays . asList ( "value" 1 , "six" ) ) ; java . util . Map < java . lang . String , java . lang . String > namedArgs = new java . util . HashMap ( ) ; namedArgs . put ( "value" 5 , "value" ) ; action2 . setNamedArgs ( namedArgs ) ; action2 . setPositionalArgs ( args ) ; com . etsy . arbiter . Action error = new com . etsy . arbiter . Action ( ) ; error . setName ( "error" ) ; error . setType ( "value" 2 ) ; args = new java . util . HashMap ( ) ; args . put ( "e" , java . util . Arrays . asList ( "value" 4 , "value" 3 ) ) ; error . setPositionalArgs ( args ) ; expected . setErrorHandler ( error ) ; "<AssertPlaceHolder>" ; } setErrorHandler ( com . etsy . arbiter . Action ) { this . errorHandler = errorHandler ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testGetResourceWithoutAwaitingIndex ( ) { com . facebook . cache . common . CacheKey key = putOneThingInCache ( ) ; com . facebook . cache . disk . DiskStorageCache cache2 = createDiskCache ( mStorage , false ) ; "<AssertPlaceHolder>" ; } getResource ( com . facebook . cache . common . CacheKey ) { java . lang . String resourceId = null ; com . facebook . cache . disk . SettableCacheEvent cacheEvent = com . facebook . cache . disk . SettableCacheEvent . obtain ( ) . setCacheKey ( key ) ; try { synchronized ( mLock ) { com . facebook . binaryresource . BinaryResource resource = null ; java . util . List < java . lang . String > resourceIds = com . facebook . cache . common . CacheKeyUtil . getResourceIds ( key ) ; for ( int i = 0 ; i < ( resourceIds . size ( ) ) ; i ++ ) { resourceId = resourceIds . get ( i ) ; cacheEvent . setResourceId ( resourceId ) ; resource = mStorage . getResource ( resourceId , key ) ; if ( resource != null ) { break ; } } if ( resource == null ) { mCacheEventListener . onMiss ( cacheEvent ) ; mResourceIndex . remove ( resourceId ) ; } else { mCacheEventListener . onHit ( cacheEvent ) ; mResourceIndex . add ( resourceId ) ; } return resource ; } } catch ( java . io . IOException ioe ) { mCacheErrorLogger . logError ( CacheErrorLogger . CacheErrorCategory . GENERIC_IO , com . facebook . cache . disk . DiskStorageCache . TAG , "getResource" , ioe ) ; cacheEvent . setException ( ioe ) ; mCacheEventListener . onReadException ( cacheEvent ) ; return null ; } finally { cacheEvent . recycle ( ) ; } }
|
org . junit . Assert . assertNotNull ( cache2 . getResource ( key ) )
|
testRewritePomWithDeepSubprojects ( ) { java . util . List < org . apache . maven . project . MavenProject > reactorProjects = createReactorProjects ( "multimodule-with-deep-subprojects" ) ; org . apache . maven . shared . release . config . ReleaseDescriptorBuilder builder = createDescriptorFromProjects ( reactorProjects , "multimodule-with-deep-subprojects" ) ; builder . addReleaseVersion ( "groupId:artifactId" , org . apache . maven . shared . release . phase . RewritePomsForBranchPhaseTest . NEXT_VERSION ) ; builder . addReleaseVersion ( "groupId:subproject1" , org . apache . maven . shared . release . phase . RewritePomsForBranchPhaseTest . ALTERNATIVE_NEXT_VERSION ) ; builder . addReleaseVersion ( "groupId:subproject2" , org . apache . maven . shared . release . phase . RewritePomsForBranchPhaseTest . ALTERNATIVE_NEXT_VERSION ) ; phase . execute ( org . apache . maven . shared . release . config . ReleaseUtils . buildReleaseDescriptor ( builder ) , new org . apache . maven . shared . release . env . DefaultReleaseEnvironment ( ) , reactorProjects ) ; "<AssertPlaceHolder>" ; } comparePomFiles ( java . util . List ) { return comparePomFiles ( reactorProjects , true ) ; }
|
org . junit . Assert . assertTrue ( comparePomFiles ( reactorProjects ) )
|
shouldNotTransformClass ( ) { final java . lang . Class < ? > clazz = com . github . bmsantos . core . cola . instrument . ColaTransformerTest . class ; final byte [ ] original = test . utils . TestUtils . loadClassBytes ( clazz ) ; final byte [ ] result = uut . transform ( com . github . bmsantos . core . cola . instrument . ColaTransformer . class . getClassLoader ( ) , clazz . getName ( ) , clazz , null , original ) ; "<AssertPlaceHolder>" ; } getName ( ) { return "fake" ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( original ) )
|
testConversion ( ) { final java . lang . String actual = new io . magentys . cinnamon . converter . CamelCaseFieldNameConverter ( ) . convert ( input ) ; "<AssertPlaceHolder>" ; } convert ( java . util . List ) { final java . util . List < T > converted = source . stream ( ) . map ( converter :: convert ) . collect ( java . util . stream . Collectors . toCollection ( LinkedList :: new ) ) ; return converted ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
withOneChar ( ) { "<AssertPlaceHolder>" ; } computePermutation ( java . lang . String ) { if ( ( str . length ( ) ) == 0 ) return recursivedp . Collections . singleton ( "" ) ; recursivedp . Map < java . lang . Character , java . lang . Integer > frequencyTable = buildFrequencyTable ( str ) ; recursivedp . Set < java . lang . String > result = new recursivedp . HashSet ( ) ; dfs ( frequencyTable , "" , str . length ( ) , result ) ; return result ; }
|
org . junit . Assert . assertEquals ( java . util . Collections . singleton ( "a" ) , s . computePermutation ( "a" ) )
|
testInnerClass ( ) { japicmp . filter . JavaDocLikeClassFilter classFilter = new japicmp . filter . JavaDocLikeClassFilter ( "japicmp.Homer" ) ; javassist . CtClass ctClass = japicmp . util . CtClassBuilder . create ( ) . name ( "japicmp.Homer$InnerHomer" ) . addToClassPool ( new javassist . ClassPool ( ) ) ; "<AssertPlaceHolder>" ; } matches ( javassist . CtClass ) { java . lang . String name = ctClass . getName ( ) ; return pattern . matcher ( name ) . matches ( ) ; }
|
org . junit . Assert . assertThat ( classFilter . matches ( ctClass ) , org . hamcrest . core . Is . is ( true ) )
|
testSingle ( ) { int [ ] packet = getPacketData ( "00<sp>00<sp>00<sp>10<sp>01<sp>00<sp>58<sp>02" ) ; com . zsmartsystems . zigbee . zcl . field . AttributeReportingConfigurationRecord record = new com . zsmartsystems . zigbee . zcl . field . AttributeReportingConfigurationRecord ( ) ; record . setAttributeIdentifier ( 0 ) ; record . setAttributeDataType ( ZclDataType . BOOLEAN ) ; record . setDirection ( 0 ) ; record . setTimeoutPeriod ( 0 ) ; record . setMinimumReportingInterval ( 1 ) ; record . setMaximumReportingInterval ( 600 ) ; com . zsmartsystems . zigbee . zcl . clusters . general . ConfigureReportingCommand command = new com . zsmartsystems . zigbee . zcl . clusters . general . ConfigureReportingCommand ( ) ; command . setClusterId ( 6 ) ; command . setDestinationAddress ( new com . zsmartsystems . zigbee . ZigBeeEndpointAddress ( 31084 , 18 ) ) ; command . setRecords ( java . util . Arrays . asList ( record ) ) ; command . setTransactionId ( 23 ) ; System . out . println ( command ) ; com . zsmartsystems . zigbee . serialization . DefaultSerializer serializer = new com . zsmartsystems . zigbee . serialization . DefaultSerializer ( ) ; com . zsmartsystems . zigbee . zcl . ZclFieldSerializer fieldSerializer = new com . zsmartsystems . zigbee . zcl . ZclFieldSerializer ( serializer ) ; command . serialize ( fieldSerializer ) ; "<AssertPlaceHolder>" ; } getPayload ( ) { return java . util . Arrays . copyOfRange ( buffer , 0 , length ) ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( packet , serializer . getPayload ( ) ) )
|
take_08 ( ) { org . apache . jena . atlas . iterator . List < java . lang . String > data = org . apache . jena . atlas . iterator . Collections . emptyList ( ) ; org . apache . jena . atlas . iterator . Iterator < java . lang . String > iter = org . apache . jena . atlas . iterator . Iter . takeWhile ( data . iterator ( ) , ( item ) -> false ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { boolean has = delegate . hasNext ( ) ; if ( has == false ) closed = true ; return has ; }
|
org . junit . Assert . assertFalse ( iter . hasNext ( ) )
|
testConvertToDataModelTypeWithoutGtCountAndAF ( ) { stats . getGenotypeCount ( ) . clear ( ) ; stats . getGenotypeFreq ( ) . clear ( ) ; stats . setAlleleCount ( ( - 1 ) ) ; stats . setRefAlleleCount ( ( - 1 ) ) ; stats . setAltAlleleCount ( ( - 1 ) ) ; org . opencb . opencga . storage . mongodb . variant . converters . DocumentToVariantStatsConverter converter = new org . opencb . opencga . storage . mongodb . variant . converters . DocumentToVariantStatsConverter ( ) ; mongoStats . put ( DocumentToVariantStatsConverter . NUMGT_FIELD , new org . bson . Document ( ) ) ; mongoStats . remove ( DocumentToVariantStatsConverter . ALT_FREQ_FIELD ) ; mongoStats . remove ( DocumentToVariantStatsConverter . REF_FREQ_FIELD ) ; org . opencb . biodata . models . variant . stats . VariantStats converted = converter . convertToDataModelType ( mongoStats , new org . opencb . biodata . models . variant . Variant ( "1" , 100 , "C" , "A" ) ) ; "<AssertPlaceHolder>" ; } remove ( java . lang . String ) { removevariants . add ( variant ) ; return this ; }
|
org . junit . Assert . assertEquals ( stats , converted )
|
convertSyncRequestTest ( ) { org . kaaproject . kaa . server . sync . ClientSync clientSync = new org . kaaproject . kaa . server . sync . ClientSync ( ) ; "<AssertPlaceHolder>" ; } convert ( org . kaaproject . kaa . common . endpoint . gen . SyncRequest ) { org . kaaproject . kaa . server . sync . ClientSync dest = new org . kaaproject . kaa . server . sync . ClientSync ( ) ; dest . setRequestId ( source . getRequestId ( ) ) ; dest . setClientSyncMetaData ( org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( source . getSyncRequestMetaData ( ) ) ) ; dest . setBootstrapSync ( org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( source . getBootstrapSyncRequest ( ) ) ) ; dest . setProfileSync ( org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( source . getProfileSyncRequest ( ) ) ) ; dest . setConfigurationSync ( org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( source . getConfigurationSyncRequest ( ) ) ) ; dest . setNotificationSync ( org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( source . getNotificationSyncRequest ( ) ) ) ; dest . setEventSync ( org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( source . getEventSyncRequest ( ) ) ) ; dest . setUserSync ( org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( source . getUserSyncRequest ( ) ) ) ; dest . setLogSync ( org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( source . getLogSyncRequest ( ) ) ) ; return dest ; }
|
org . junit . Assert . assertEquals ( clientSync , org . kaaproject . kaa . server . sync . platform . AvroEncDec . convert ( new org . kaaproject . kaa . common . endpoint . gen . SyncRequest ( ) ) )
|
testCreatesFluidGridWithMode ( ) { com . eclipsesource . tabris . passepartout . FluidGridLayout grid = com . eclipsesource . tabris . passepartout . PassePartout . createFluidGrid ( new com . eclipsesource . tabris . passepartout . FluidGridConfiguration ( LayoutMode . AUTO , 100 , 200 ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( grid )
|
testDeleteMd ( ) { expect ( mdService . deleteMaintenanceDomain ( org . onosproject . cfm . impl . MdWebResourceTest . MDNAME1 ) ) . andReturn ( true ) . anyTimes ( ) ; replay ( mdService ) ; final javax . ws . rs . client . WebTarget wt = target ( ) ; final javax . ws . rs . core . Response response = wt . path ( ( "md/" + ( org . onosproject . cfm . impl . MdWebResourceTest . MDNAME1 ) ) ) . request ( ) . delete ( ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return null ; }
|
org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) )
|
testAddWithSameName ( ) { java . lang . String tableReference = getDataManager ( ) . registerDataSource ( new java . io . File ( org . orbisgis . coremap . layerModel . LayerModelTest . class . getResource ( "../../../../data/bv_sap.shp" ) . getFile ( ) ) . toURI ( ) ) ; org . orbisgis . coremap . layerModel . ILayer lc = mc . createLayerCollection ( "firstLevel" ) ; org . orbisgis . coremap . layerModel . ILayer vl1 = mc . createLayer ( tableReference ) ; org . orbisgis . coremap . layerModel . ILayer vl2 = mc . createLayer ( tableReference ) ; lc . addLayer ( vl1 ) ; lc . addLayer ( vl2 ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertTrue ( ( ! ( vl1 . getName ( ) . equals ( vl2 . getName ( ) ) ) ) )
|
testSendFiles ( ) { System . out . println ( "sendFiles" ) ; java . io . File targetFile = java . io . File . createTempFile ( ".jtl" , "temp" ) ; java . io . PrintStream ps = new java . io . PrintStream ( targetFile ) ; ps . print ( "test" ) ; ps . close ( ) ; java . util . LinkedList < java . lang . String > perfMonFiles = new java . util . LinkedList ( ) ; org . loadosophia . jmeter . LoadosophiaAPIClientEmul instance = new org . loadosophia . jmeter . LoadosophiaAPIClientEmul ( this ) ; net . sf . json . JSONObject resp1 = new net . sf . json . JSONObject ( ) ; resp1 . put ( "QueueID" , 1 ) ; instance . addEmul ( resp1 ) ; net . sf . json . JSONObject resp2 = new net . sf . json . JSONObject ( ) ; resp2 . put ( "status" , 0 ) ; instance . addEmul ( resp2 ) ; net . sf . json . JSONObject resp3 = new net . sf . json . JSONObject ( ) ; resp3 . put ( "status" , 4 ) ; resp3 . put ( "TestID" , 2 ) ; instance . addEmul ( resp3 ) ; net . sf . json . JSONObject resp4 = new net . sf . json . JSONObject ( ) ; instance . addEmul ( resp4 ) ; org . loadosophia . jmeter . LoadosophiaUploadResults result = instance . sendFiles ( targetFile , perfMonFiles ) ; "<AssertPlaceHolder>" ; } getQueueID ( ) { return queueID ; }
|
org . junit . Assert . assertEquals ( 1 , result . getQueueID ( ) )
|
parseBadOutput ( ) { org . eclipse . xtext . xbase . lib . Procedures . Procedure1 < java . lang . String > err = createMock ( org . eclipse . xtext . xbase . lib . Procedures . Procedure1 . class ) ; err . apply ( "Bad<sp>command-line<sp>option:<sp>'-o'" ) ; java . lang . Object [ ] mocks = new java . lang . Object [ ] { err } ; replay ( mocks ) ; com . github . jknack . antlr4ide . generator . ToolOptions options = com . github . jknack . antlr4ide . generator . ToolOptions . parse ( "-o" , err ) ; "<AssertPlaceHolder>" ; verify ( mocks ) ; }
|
org . junit . Assert . assertNotNull ( options )
|
encodesGetRequestCorrectly ( ) { final byte [ ] exp = new byte [ ] { ( ( byte ) ( 131 ) ) , 104 , 4 , 100 , 0 , 8 , 116 , 115 , 103 , 101 , 116 , 114 , 101 , 113 , 109 , 0 , 0 , 0 , 10 , 116 , 101 , 115 , 116 , 95 , 116 , 97 , 98 , 108 , 101 , 108 , 0 , 0 , 0 , 3 , 109 , 0 , 0 , 0 , 6 , 115 , 101 , 114 , 105 , 101 , 115 , 109 , 0 , 0 , 0 , 6 , 102 , 97 , 109 , 105 , 108 , 121 , 98 , 0 , ( ( byte ) ( 188 ) ) , 97 , 78 , 106 , 98 , 0 , 0 , 19 , ( ( byte ) ( 136 ) ) } ; com . basho . riak . client . core . query . timeseries . Cell k1 = new com . basho . riak . client . core . query . timeseries . Cell ( "series" ) ; com . basho . riak . client . core . query . timeseries . Cell k2 = new com . basho . riak . client . core . query . timeseries . Cell ( "family" ) ; com . basho . riak . client . core . query . timeseries . Cell k3 = new com . basho . riak . client . core . query . timeseries . Cell ( 12345678 ) ; com . basho . riak . client . core . query . timeseries . Cell [ ] key = new com . basho . riak . client . core . query . timeseries . Cell [ ] { k1 , k2 , k3 } ; try { com . ericsson . otp . erlang . OtpOutputStream os = com . basho . riak . client . core . codec . TermToBinaryCodec . encodeTsGetRequest ( com . basho . riak . client . core . codec . TermToBinaryCodecTest . TABLE_NAME , java . util . Arrays . asList ( key ) , 5000 ) ; os . flush ( ) ; byte [ ] msg = os . toByteArray ( ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException ex ) { org . junit . Assert . fail ( ex . getMessage ( ) ) ; } } encodeTsGetRequest ( java . lang . String , com . basho . riak . client . core . codec . Collection , int ) { final com . basho . riak . client . core . codec . OtpOutputStream os = new com . basho . riak . client . core . codec . OtpOutputStream ( ) ; os . write ( OtpExternal . versionTag ) ; os . write_tuple_head ( 4 ) ; os . write_atom ( com . basho . riak . client . core . codec . TermToBinaryCodec . TS_GET_REQ ) ; os . write_binary ( tableName . getBytes ( StandardCharsets . UTF_8 ) ) ; os . write_list_head ( keyValues . size ( ) ) ; for ( com . basho . riak . client . core . query . timeseries . Cell cell : keyValues ) { com . basho . riak . client . core . codec . TermToBinaryCodec . writeTsCellToStream ( os , cell ) ; } os . write_nil ( ) ; if ( timeout != 0 ) { os . write_long ( timeout ) ; } else { os . write_atom ( com . basho . riak . client . core . codec . TermToBinaryCodec . UNDEFINED ) ; } return os ; }
|
org . junit . Assert . assertArrayEquals ( exp , msg )
|
test16_AafterB_CbeforeOthers ( ) { java . util . List < com . liferay . faces . util . config . internal . FacesConfigDescriptor > facesConfigDescriptors = new java . util . ArrayList < com . liferay . faces . util . config . internal . FacesConfigDescriptor > ( ) ; com . liferay . faces . util . xml . OrderingTest . parseConfigurationResources ( "ordering/AafterB_CbeforeOthers" , facesConfigDescriptors , com . liferay . faces . util . xml . OrderingTest . META_INF_FACES_CONFIG_XML ) ; java . util . Collections . shuffle ( facesConfigDescriptors ) ; java . lang . String [ ] originalOrder = com . liferay . faces . util . xml . OrderingTest . extractNames ( facesConfigDescriptors ) ; facesConfigDescriptors = com . liferay . faces . util . config . internal . OrderingUtil . getOrder ( facesConfigDescriptors ) ; java . lang . String [ ] orderedNames = com . liferay . faces . util . xml . OrderingTest . extractNames ( facesConfigDescriptors ) ; java . util . List < java . lang . String > original = java . util . Arrays . asList ( originalOrder ) ; java . util . List < java . lang . String > actually = java . util . Arrays . asList ( orderedNames ) ; java . util . List < java . lang . String > possibility1 = java . util . Arrays . asList ( "c" , "b" , "d" , "a" ) ; java . util . List < java . lang . String > possibility2 = java . util . Arrays . asList ( "c" , "d" , "b" , "a" ) ; boolean assertion = ( actually . equals ( possibility1 ) ) || ( actually . equals ( possibility2 ) ) ; java . lang . String message = ( ( ( ( ( ( ( "\n<sp>original:<sp>" + original ) + "a" 1 ) + possibility1 ) + "\n<sp>or:<sp>" ) + possibility2 ) + "\n<sp>actually:<sp>" ) + actually ) + "\n" ; "<AssertPlaceHolder>" ; com . liferay . faces . util . xml . OrderingTest . logger . info ( ( "a" 0 + message ) ) ; } equals ( java . lang . Object ) { boolean flag = false ; if ( ( obj != null ) && ( obj instanceof java . util . List < ? > ) ) { java . util . List < ? > objList = ( ( java . util . List < ? > ) ( obj ) ) ; if ( ( objList . size ( ) ) == ( this . size ( ) ) ) { flag = true ; int index = 0 ; for ( java . lang . Object listEntry : objList ) { if ( listEntry instanceof java . lang . String ) { java . lang . String listEntryAsString = ( ( java . lang . String ) ( listEntry ) ) ; java . lang . String thisEntry = this . get ( index ) ; if ( thisEntry . equals ( listEntryAsString ) ) { index ++ ; } else { flag = false ; break ; } } else { flag = false ; break ; } } } } return flag ; }
|
org . junit . Assert . assertTrue ( message , assertion )
|
testUpdateEnumField ( ) { com . jmethods . catatumbo . entities . EnumField entity = new com . jmethods . catatumbo . entities . EnumField ( ) ; entity . setSize ( EnumField . Size . LARGE ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . insert ( entity ) ; entity . setSize ( EnumField . Size . SMALL ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . update ( entity ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . load ( com . jmethods . catatumbo . entities . EnumField . class , entity . getId ( ) ) ; "<AssertPlaceHolder>" ; } getSize ( ) { return size ; }
|
org . junit . Assert . assertEquals ( EnumField . Size . SMALL , entity . getSize ( ) )
|
testNewWithVec4 ( ) { com . hackoeur . jglm . Vec4 v1 = new com . hackoeur . jglm . Vec4 ( 1.0F , 2.0F , 3.0F , 4.0F ) ; com . hackoeur . jglm . Vec4 v2 = new com . hackoeur . jglm . Vec4 ( 5.0F , 6.0F , 7.0F , 8.0F ) ; com . hackoeur . jglm . Vec4 v3 = new com . hackoeur . jglm . Vec4 ( 9.0F , 10.0F , 11.0F , 12.0F ) ; com . hackoeur . jglm . Vec4 v4 = new com . hackoeur . jglm . Vec4 ( 13.0F , 14.0F , 15.0F , 16.0F ) ; com . hackoeur . jglm . Mat4 m1 = new com . hackoeur . jglm . Mat4 ( v1 , v2 , v3 , v4 ) ; com . hackoeur . jglm . Mat4 m2 = new com . hackoeur . jglm . Mat4 ( 1.0F , 2.0F , 3.0F , 4.0F , 5.0F , 6.0F , 7.0F , 8.0F , 9.0F , 10.0F , 11.0F , 12.0F , 13.0F , 14.0F , 15.0F , 16.0F ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( m2 , m1 )
|
testFraudMoreThanOneOrderIn5Minutes ( ) { count . set ( 0 ) ; com . stratio . decision . unit . siddhi . query . OrdersQueriesValidationTest . LOGGER . debug ( "[Fraud]<sp>Checking<sp>if<sp>there<sp>are<sp>more<sp>than<sp>one<sp>order<sp>in<sp>5<sp>minutes" ) ; com . stratio . decision . unit . siddhi . query . OrdersQueriesValidationTest . LOGGER . debug ( "--><sp>Creating<sp>Order<sp>Queries<sp>and<sp>Loading<sp>dataset" ) ; com . stratio . decision . unit . siddhi . query . OrdersQueriesValidationTest . ORDER_QUERY1_ID = sm . addQuery ( OrdersQueries . QUERY_MORE_1ORDER_IN_5M ) ; sm . addCallback ( OrdersQueries . STREAM_FRAUD , new org . wso2 . siddhi . core . stream . output . StreamCallback ( ) { @ com . stratio . decision . unit . siddhi . query . Override public void receive ( org . wso2 . siddhi . core . event . Event [ ] events ) { for ( org . wso2 . siddhi . core . event . Event event : events ) { if ( ( event instanceof org . wso2 . siddhi . core . event . in . InEvent ) && ( event . getData ( 6 ) . toString ( ) . equals ( "orders-1" ) ) ) { count . getAndIncrement ( ) ; com . stratio . decision . unit . siddhi . query . OrdersQueriesValidationTest . LOGGER . debug ( ( "Found<sp>event:<sp>" + ( event . toString ( ) ) ) ) ; } } } } ) ; com . stratio . decision . unit . siddhi . query . OrdersQueriesValidationTest . loadOrders ( com . stratio . decision . unit . siddhi . query . OrdersQueriesValidationTest . DATASET_ORDERS1 ) ; java . lang . Thread . sleep ( 500 ) ; "<AssertPlaceHolder>" ; sm . removeQuery ( com . stratio . decision . unit . siddhi . query . OrdersQueriesValidationTest . ORDER_QUERY1_ID ) ; } loadOrders ( java . lang . String ) { com . stratio . decision . unit . siddhi . query . OrdersQueriesValidationTest . LOGGER . debug ( ( "Loading<sp>orders<sp>from<sp>file:<sp>" + dataSetPath ) ) ; java . util . List < java . lang . String [ ] > orders = com . stratio . decision . unit . siddhi . query . ResourcesLoader . loadData ( dataSetPath , ',' , '
|
org . junit . Assert . assertEquals ( 1 , count . get ( ) )
|
should_execute_function_for_each_element_of_seleniumQueryObject ( ) { org . openqa . selenium . WebElement someSpan = testinfrastructure . testdouble . org . openqa . selenium . WebElementMother . createWebElementWithTag ( "span" ) ; org . openqa . selenium . WebElement someDiv = testinfrastructure . testdouble . org . openqa . selenium . WebElementMother . createWebElementWithTag ( "div" ) ; io . github . seleniumquery . SeleniumQueryObject sqo = testinfrastructure . testdouble . io . github . seleniumquery . SeleniumQueryObjectMother . createStubSeleniumQueryObjectWithElements ( someSpan , someDiv ) ; java . util . List < java . lang . String > tagNames = sqo . map ( WebElement :: getTagName ) ; "<AssertPlaceHolder>" ; } createStubSeleniumQueryObjectWithElements ( org . openqa . selenium . WebDriver , org . openqa . selenium . WebElement [ ] ) { return testinfrastructure . testdouble . io . github . seleniumquery . SeleniumQueryObjectMother . createStubSeleniumQueryObject ( new io . github . seleniumquery . functions . SeleniumQueryFunctions ( ) , driver , asList ( elements ) ) ; }
|
org . junit . Assert . assertThat ( tagNames , org . hamcrest . Matchers . contains ( "span" , "div" ) )
|
testGetCurrentKey ( ) { org . apache . kylin . source . kafka . hadoop . KafkaInputRecordReader kafkaInputRecordReader = new org . apache . kylin . source . kafka . hadoop . KafkaInputRecordReader ( ) ; kafkaInputRecordReader . nextKeyValue ( ) ; "<AssertPlaceHolder>" ; } getCurrentKey ( ) { return key ; }
|
org . junit . Assert . assertEquals ( 0L , kafkaInputRecordReader . getCurrentKey ( ) . get ( ) )
|
testCompleteWithValues ( ) { org . axonframework . axonserver . connector . query . QueueBackedSpliterator < java . lang . String > queueBackedSpliterator = new org . axonframework . axonserver . connector . query . QueueBackedSpliterator ( 1000 , java . util . concurrent . TimeUnit . MILLISECONDS ) ; java . lang . Thread queueListener = new java . lang . Thread ( new java . lang . Runnable ( ) { @ org . axonframework . axonserver . connector . query . Override public void run ( ) { java . util . List < java . lang . String > items = java . util . stream . StreamSupport . stream ( queueBackedSpliterator , false ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } } ) ; queueListener . start ( ) ; queueBackedSpliterator . put ( "One" ) ; queueBackedSpliterator . put ( "Two" ) ; queueBackedSpliterator . cancel ( null ) ; } size ( ) { return values . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , items . size ( ) )
|
testReceiveOnly ( ) { final java . net . InetSocketAddress address = new java . net . InetSocketAddress ( "127.0.0.1" , 0 ) ; final org . restcomm . media . core . network . deprecated . channel . NetworkGuard guard = mock ( org . restcomm . media . core . network . deprecated . channel . NetworkGuard . class ) ; final org . restcomm . media . core . network . deprecated . channel . PacketHandler handler = mock ( org . restcomm . media . core . network . deprecated . channel . PacketHandler . class ) ; final org . restcomm . media . core . network . deprecated . channel . MultiplexedNetworkChannel channel = new org . restcomm . media . core . network . deprecated . channel . MultiplexedNetworkChannel ( guard , handler ) ; channel . open ( ) ; channel . bind ( address ) ; when ( handler . canHandle ( org . restcomm . media . core . network . deprecated . channel . RestrictedMultiplexedNetworkChannelTest . ping ) ) . thenReturn ( true ) ; when ( handler . handle ( org . restcomm . media . core . network . deprecated . channel . RestrictedMultiplexedNetworkChannelTest . ping , channel . getLocalAddress ( ) , ( ( java . net . InetSocketAddress ) ( callAgent . getLocalAddress ( ) ) ) ) ) . thenReturn ( null ) ; when ( guard . isSecure ( channel , ( ( java . net . InetSocketAddress ) ( callAgent . getLocalAddress ( ) ) ) ) ) . thenReturn ( true ) ; callAgent . send ( java . nio . ByteBuffer . wrap ( org . restcomm . media . core . network . deprecated . channel . RestrictedMultiplexedNetworkChannelTest . ping ) , channel . getLocalAddress ( ) ) ; channel . receive ( ) ; final java . net . SocketAddress remotePeer = callAgent . receive ( agentBuffer ) ; "<AssertPlaceHolder>" ; } receive ( java . nio . channels . DatagramChannel ) { }
|
org . junit . Assert . assertNull ( remotePeer )
|
testShapeFileWriterWithSelfCreatedContent_withMatsimFactory_Polyline ( ) { java . lang . String outFile = ( utils . getOutputDirectory ( ) ) + "test.shp" ; org . matsim . core . utils . gis . PolylineFeatureFactory ff = new org . matsim . core . utils . gis . PolylineFeatureFactory . Builder ( ) . setName ( "EvacuationArea" ) . setCrs ( DefaultGeographicCRS . WGS84 ) . addAttribute ( "name" , java . lang . String . class ) . create ( ) ; org . locationtech . jts . geom . Coordinate [ ] coordinates = new org . locationtech . jts . geom . Coordinate [ ] { new org . locationtech . jts . geom . Coordinate ( 0 , 0 ) , new org . locationtech . jts . geom . Coordinate ( 0 , 1 ) , new org . locationtech . jts . geom . Coordinate ( 1 , 1 ) , new org . locationtech . jts . geom . Coordinate ( 0 , 0 ) } ; org . opengis . feature . simple . SimpleFeature f = ff . createPolyline ( coordinates ) ; java . util . Collection < org . opengis . feature . simple . SimpleFeature > features = new java . util . ArrayList < org . opengis . feature . simple . SimpleFeature > ( ) ; features . add ( f ) ; org . locationtech . jts . geom . Geometry g0 = ( ( org . locationtech . jts . geom . Geometry ) ( f . getDefaultGeometry ( ) ) ) ; org . matsim . core . utils . gis . ShapeFileWriter . writeGeometries ( features , outFile ) ; org . geotools . data . simple . SimpleFeatureSource s1 = org . matsim . core . utils . gis . ShapeFileReader . readDataFile ( outFile ) ; org . geotools . data . simple . SimpleFeatureCollection fts1 = s1 . getFeatures ( ) ; org . geotools . data . simple . SimpleFeatureIterator it1 = fts1 . features ( ) ; org . opengis . feature . simple . SimpleFeature ft1 = it1 . next ( ) ; org . locationtech . jts . geom . Geometry g1 = ( ( org . locationtech . jts . geom . Geometry ) ( ft1 . getDefaultGeometry ( ) ) ) ; "<AssertPlaceHolder>" ; } getCoordinates ( ) { org . matsim . contrib . accessibility . utils . List < org . matsim . contrib . accessibility . utils . List < java . lang . Double > > result = new org . matsim . contrib . accessibility . utils . ArrayList ( ) ; for ( org . matsim . api . core . v01 . Coord coord : coordinates ) { result . add ( org . matsim . contrib . accessibility . utils . Arrays . asList ( coord . getX ( ) , coord . getY ( ) ) ) ; } return result ; }
|
org . junit . Assert . assertEquals ( g0 . getCoordinates ( ) . length , g1 . getCoordinates ( ) . length )
|
testValidity ( ) { java . io . InputStream in = getClass ( ) . getResourceAsStream ( "/org/jboss/metadata/ejb/test/txtimeout/jboss-ejb3.xml" ) ; org . w3c . dom . Document document = org . jboss . metadata . ejb . test . common . ValidationHelper . parse ( new org . xml . sax . InputSource ( in ) , getClass ( ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( document )
|
testMultivariateFactorization22 ( ) { cc . redberry . rings . poly . multivar . IntegersZp64 domain = new cc . redberry . rings . poly . multivar . IntegersZp64 ( 3 ) ; java . lang . String [ ] vars = new java . lang . String [ ] { "a" , "b" , "c" , "d" , "e" } ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 [ ] factors = new cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 [ ] { cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "1+a*b^2*c^2*d+a*b^3*c^3+a^2*b^2*c*d^2+2*a^2*b^3*c*d^2*e" , domain , vars ) , cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . parse ( "c^2*d+2*a^3*b^3*e" , domain , vars ) } ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 base = factors [ 0 ] . createOne ( ) . multiply ( factors ) ; assert cc . redberry . rings . poly . multivar . MultivariateSquareFreeFactorization . isSquareFree ( base ) ; for ( int i = 0 ; i < ( its ( 20 , 20 ) ) ; i ++ ) { cc . redberry . rings . poly . multivar . PolynomialFactorDecomposition < cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 > decomposition = cc . redberry . rings . poly . multivar . MultivariateFactorization . MultivariateFactorization . factorPrimitiveInGF ( base ) ; "<AssertPlaceHolder>" ; } } size ( ) { return ( cc . redberry . rings . poly . univar . IUnivariatePolynomial . degree ( ) ) + 1 ; }
|
org . junit . Assert . assertEquals ( 2 , decomposition . size ( ) )
|
updateStatusTest ( ) { me . xiezefan . easyim . server . model . Message msg = messageDao . findById ( Contact . MESSAGE_ID1 ) ; me . xiezefan . easyim . server . model . OfflineMessage offlineMsg = new me . xiezefan . easyim . server . model . OfflineMessage ( ) ; offlineMsg . setId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; offlineMsg . setUserId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; offlineMsg . setMessage ( msg ) ; offlineMsg . setStatus ( MessageStatus . SEND ) ; offlineMsg . setCreateTime ( new java . util . Date ( ) ) ; offlineMessageDao . save ( offlineMsg ) ; offlineMsg . setStatus ( MessageStatus . READ ) ; offlineMessageDao . updateStatus ( offlineMsg ) ; me . xiezefan . easyim . server . model . OfflineMessage offlineMsg2 = offlineMessageDao . findById ( offlineMsg . getId ( ) ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; }
|
org . junit . Assert . assertTrue ( ( ( offlineMsg2 . getStatus ( ) ) == ( me . xiezefan . easyim . server . model . MessageStatus . READ ) ) )
|
testCreateJSONTokenResponse ( ) { org . apache . oltu . oauth2 . client . response . OAuthClientResponse jsonTokenResponse = org . apache . oltu . oauth2 . client . response . OAuthClientResponseFactory . createJSONTokenResponse ( "{\"access_token\":\"123\"}" , OAuth . ContentType . JSON , 200 ) ; "<AssertPlaceHolder>" ; } createJSONTokenResponse ( java . lang . String , java . lang . String , int ) { org . apache . oltu . oauth2 . client . response . OAuthJSONAccessTokenResponse resp = new org . apache . oltu . oauth2 . client . response . OAuthJSONAccessTokenResponse ( ) ; resp . init ( body , contentType , responseCode ) ; return resp ; }
|
org . junit . Assert . assertNotNull ( jsonTokenResponse )
|
testRenewDelegationToken ( ) { org . apache . hadoop . security . UserGroupInformation currentUGI = org . apache . hive . minikdc . TestJdbcWithMiniKdc . miniHiveKdc . loginUser ( MiniHiveKdc . HIVE_TEST_SUPER_USER ) ; hs2Conn = java . sql . DriverManager . getConnection ( org . apache . hive . minikdc . TestJdbcWithMiniKdc . miniHS2 . getJdbcURL ( ) ) ; java . lang . String currentUser = currentUGI . getUserName ( ) ; java . lang . String token = ( ( org . apache . hive . jdbc . HiveConnection ) ( hs2Conn ) ) . getDelegationToken ( MiniHiveKdc . HIVE_TEST_USER_1 , org . apache . hive . minikdc . TestJdbcWithMiniKdc . miniHiveKdc . getFullyQualifiedServicePrincipal ( MiniHiveKdc . HIVE_TEST_SUPER_USER ) ) ; "<AssertPlaceHolder>" ; ( ( org . apache . hive . jdbc . HiveConnection ) ( hs2Conn ) ) . renewDelegationToken ( token ) ; hs2Conn . close ( ) ; } isEmpty ( ) { com . google . common . base . Preconditions . checkNotNull ( getPath ( ) ) ; try { org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . fs . FileSystem . get ( getPath ( ) . toUri ( ) , org . apache . hadoop . hive . ql . session . SessionState . getSessionConf ( ) ) ; return ( ! ( fs . exists ( getPath ( ) ) ) ) || ( ( fs . listStatus ( getPath ( ) , FileUtils . HIDDEN_FILES_PATH_FILTER ) . length ) == 0 ) ; } catch ( java . io . IOException e ) { throw new org . apache . hadoop . hive . ql . metadata . HiveException ( e ) ; } }
|
org . junit . Assert . assertTrue ( ( ( token != null ) && ( ! ( token . isEmpty ( ) ) ) ) )
|
testSetPageStepSize ( ) { replay ( view ) ; scrollbar . setPageStepSize ( 12.0F ) ; "<AssertPlaceHolder>" ; } getPageStepSize ( ) { return pageStepSize ; }
|
org . junit . Assert . assertEquals ( 12.0F , scrollbar . getPageStepSize ( ) )
|
testEnableDropletPrivateNetworking ( ) { com . myjeeva . digitalocean . pojo . Action action = apiClient . enableDropletPrivateNetworking ( 2258168 ) ; "<AssertPlaceHolder>" ; log . info ( action . toString ( ) ) ; } enableDropletPrivateNetworking ( java . lang . Integer ) { validateDropletId ( dropletId ) ; java . lang . Object [ ] params = new java . lang . Object [ ] { dropletId } ; return ( ( com . myjeeva . digitalocean . pojo . Action ) ( perform ( new com . myjeeva . digitalocean . impl . ApiRequest ( com . myjeeva . digitalocean . common . ApiAction . ENABLE_DROPLET_PRIVATE_NETWORKING , new com . myjeeva . digitalocean . pojo . DropletAction ( com . myjeeva . digitalocean . common . ActionType . ENABLE_PRIVATE_NETWORKING ) , params ) ) . getData ( ) ) ) ; }
|
org . junit . Assert . assertNotNull ( action )
|
nullReturnValue ( ) { expect ( mock . oneArg ( "Object" ) ) . andReturn ( null ) ; replay ( mock ) ; "<AssertPlaceHolder>" ; } replay ( java . lang . Object [ ] ) { for ( int i = 0 ; i < ( mocks . length ) ; i ++ ) { try { org . easymock . EasyMock . getControl ( mocks [ i ] ) . replay ( ) ; } catch ( java . lang . RuntimeException e ) { throw org . easymock . EasyMock . getRuntimeException ( mocks . length , i , e ) ; } catch ( java . lang . AssertionError e ) { throw org . easymock . EasyMock . getAssertionError ( mocks . length , i , e ) ; } } }
|
org . junit . Assert . assertNull ( mock . oneArg ( "Object" ) )
|
returns_result_of_context_resolve ( ) { java . lang . Object contextResult = new java . lang . Object ( ) ; when ( mockSpecimenContext . resolve ( anyObject ( ) ) ) . thenReturn ( contextResult ) ; java . lang . Object result = this . relay . create ( com . flextrade . jfixture . utility . SpecimenType . of ( testtypes . constructors . TwoConstructorType . class ) , mockSpecimenContext ) ; "<AssertPlaceHolder>" ; } of ( java . lang . reflect . Type ) { return new com . flextrade . jfixture . utility . SpecimenType < java . lang . Object > ( type ) { } ; }
|
org . junit . Assert . assertSame ( contextResult , result )
|
distributePortsOfGraph_GivenCrossOnBothSides_ShouldRemoveCrossin ( ) { org . eclipse . elk . alg . layered . graph . LNode [ ] leftNodes = addNodesToLayer ( 2 , makeLayer ( getGraph ( ) ) ) ; org . eclipse . elk . alg . layered . graph . LNode middleNode = addNodeToLayer ( makeLayer ( getGraph ( ) ) ) ; org . eclipse . elk . alg . layered . graph . LNode [ ] rightNodes = addNodesToLayer ( 2 , makeLayer ( getGraph ( ) ) ) ; eastWestEdgeFromTo ( middleNode , rightNodes [ 1 ] ) ; eastWestEdgeFromTo ( middleNode , rightNodes [ 0 ] ) ; eastWestEdgeFromTo ( leftNodes [ 0 ] , middleNode ) ; eastWestEdgeFromTo ( leftNodes [ 1 ] , middleNode ) ; setUpIds ( ) ; java . util . List < org . eclipse . elk . alg . layered . graph . LPort > expectedPortOrderMiddleNode = copyPortsInIndexOrder ( middleNode , 1 , 0 , 3 , 2 ) ; distributePortsInCompleteGraph ( 8 ) ; "<AssertPlaceHolder>" ; } getPorts ( ) { if ( ( ports ) == null ) { ports = new org . eclipse . emf . ecore . util . EObjectContainmentWithInverseEList < org . eclipse . elk . graph . ElkPort > ( org . eclipse . elk . graph . ElkPort . class , this , org . eclipse . elk . graph . ElkGraphPackage . ELK_NODE__PORTS , org . eclipse . elk . graph . ElkGraphPackage . ELK_PORT__PARENT ) ; } return ports ; }
|
org . junit . Assert . assertThat ( middleNode . getPorts ( ) , org . hamcrest . CoreMatchers . is ( expectedPortOrderMiddleNode ) )
|
testNullHyperLogLogSketchDeserialisedAsEmptySketch ( ) { final java . lang . String sketchAsString = "{}" ; com . clearspring . analytics . stream . cardinality . HyperLogLogPlus hllp = uk . gov . gchq . gaffer . jsonserialisation . JSONSerialiser . deserialise ( sketchAsString , com . clearspring . analytics . stream . cardinality . HyperLogLogPlus . class ) ; "<AssertPlaceHolder>" ; } deserialise ( java . lang . String , java . lang . Class ) { try { return uk . gov . gchq . gaffer . jsonserialisation . JSONSerialiser . getInstance ( ) . mapper . readValue ( json , clazz ) ; } catch ( final java . io . IOException e ) { throw new uk . gov . gchq . gaffer . exception . SerialisationException ( e . getMessage ( ) , e ) ; } }
|
org . junit . Assert . assertEquals ( 0 , hllp . cardinality ( ) )
|
testGetNameAndEmailNull ( ) { com . sonymobile . tools . gerrit . gerritevents . dto . attr . Account account = new com . sonymobile . tools . gerrit . gerritevents . dto . attr . Account ( ) ; account . setEmail ( null ) ; account . setName ( null ) ; java . lang . String expected = null ; "<AssertPlaceHolder>" ; } getNameAndEmail ( ) { if ( ( ( name ) == null ) || ( ( email ) == null ) ) { return null ; } else if ( ( email . isEmpty ( ) ) || ( name . isEmpty ( ) ) ) { return "" ; } else { java . lang . StringBuffer str = new java . lang . StringBuffer ( "\"" ) ; str . append ( name ) . append ( "\"<sp><" ) . append ( email ) . append ( ">" ) ; return str . toString ( ) ; } }
|
org . junit . Assert . assertEquals ( expected , account . getNameAndEmail ( ) )
|
cancelTwiceDifferentReasons ( ) { createStream ( ) ; cancelStream ( Status . DEADLINE_EXCEEDED ) ; verifyWrite ( ) . writeRstStream ( eq ( ctx ( ) ) , eq ( 3 ) , eq ( Http2Error . CANCEL . code ( ) ) , any ( io . netty . channel . ChannelPromise . class ) ) ; io . netty . channel . ChannelFuture future = cancelStream ( Status . CANCELLED ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return ( cause ) == null ; }
|
org . junit . Assert . assertTrue ( future . isSuccess ( ) )
|
testResourceStopExport ( ) { try { org . osgi . framework . ServiceRegistration reg = context . registerService ( org . ow2 . chameleon . rose . rest . JerseyExporterTest . DummyResource . class . getName ( ) , new org . ow2 . chameleon . rose . rest . JerseyExporterTest . DummyResource ( ) , null ) ; org . ow2 . chameleon . rose . api . OutConnection out = myMachine . out ( ( ( ( ( "(" + ( org . osgi . framework . Constants . OBJECTCLASS ) ) + "=" ) + ( org . ow2 . chameleon . rose . rest . JerseyExporterTest . DummyResource . class . getName ( ) ) ) + ")" ) ) . add ( ) ; reg . unregister ( ) ; "<AssertPlaceHolder>" ; out . close ( ) ; } catch ( org . osgi . framework . InvalidSyntaxException is ) { org . junit . Assert . fail ( is . getMessage ( ) ) ; } } size ( ) { return imptracker . getSize ( ) ; }
|
org . junit . Assert . assertTrue ( ( ( out . size ( ) ) == 0 ) )
|
testGetRESTSchemaMain ( ) { org . apache . avro . Schema s = org . talend . components . marketo . MarketoConstants . getListOperationRESTSchema ( ) ; "<AssertPlaceHolder>" ; } getFields ( ) { return this . fields ; }
|
org . junit . Assert . assertEquals ( 2 , s . getFields ( ) . size ( ) )
|
column_metadata_for_missing_index ( ) { { java . util . Map < java . lang . String , org . apache . metron . indexing . dao . search . FieldType > fieldTypes = getIndexDao ( ) . getColumnMetadata ( java . util . Collections . singletonList ( "someindex" ) ) ; "<AssertPlaceHolder>" ; } } size ( ) { int size = 0 ; for ( java . util . Map m : variableMappings ) { size += m . size ( ) ; } return size ; }
|
org . junit . Assert . assertEquals ( 0 , fieldTypes . size ( ) )
|
multiLevelHierarchy ( ) { java . lang . Class < ? > tapType = com . hotels . plunger . TapTypeUtil . getTapConfigClass ( new com . hotels . plunger . TapTypeUtilTest . TestHfs ( new cascading . scheme . hadoop . TextDelimited ( ) , "" ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( org . apache . hadoop . conf . Configuration . class , tapType )
|
testLinkedSpending ( ) { org . aksw . cubeqa . CubeSparql sparql = org . aksw . cubeqa . CubeSparql . getLinkedSpendingInstanceForName ( "finland-aid" ) ; java . lang . String query = "select<sp>count(distinct(?dim))<sp>as<sp>?count<sp>{?dim<sp>a<sp>qb:DimensionProperty}" ; int dimensions = sparql . select ( query ) . nextSolution ( ) . get ( "count" ) . asLiteral ( ) . getInt ( ) ; "<AssertPlaceHolder>" ; } select ( java . lang . String ) { de . konradhoeffner . commons . StopWatch watch = StopWatches . INSTANCE . getWatch ( "sparql" ) ; watch . start ( ) ; try ( org . apache . jena . sparql . engine . http . QueryEngineHTTP qe = new org . apache . jena . sparql . engine . http . QueryEngineHTTP ( endpoint , ( ( prefixes ) + query ) ) ) { qe . setDefaultGraphURIs ( defaultGraphs ) ; return org . aksw . cubeqa . ResultSetFactory . copyResults ( qe . execSelect ( ) ) ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( ( ( ( "Error<sp>on<sp>sparql<sp>select<sp>on<sp>endpoint<sp>" + ( endpoint ) ) + "<sp>with<sp>query:\n" ) + query ) , e ) ; } finally { watch . stop ( ) ; } }
|
org . junit . Assert . assertEquals ( 4 , dimensions )
|
getsLastModified ( ) { javax . ws . rs . core . MultivaluedMap < java . lang . String , java . lang . Object > headers = new javax . ws . rs . core . MultivaluedHashMap ( ) ; java . util . Date entityTag = new java . util . Date ( ) ; headers . putSingle ( org . everrest . core . impl . LAST_MODIFIED , entityTag ) ; org . everrest . core . impl . ResponseImpl response = new org . everrest . core . impl . ResponseImpl ( 200 , "foo" , null , headers ) ; "<AssertPlaceHolder>" ; } getLastModified ( ) { return getDateHeader ( javax . ws . rs . core . HttpHeaders . LAST_MODIFIED ) ; }
|
org . junit . Assert . assertSame ( entityTag , response . getLastModified ( ) )
|
sumLong ( ) { org . eclipse . collections . api . set . ImmutableSet < java . lang . Integer > objects = this . newSetWith ( 1 , 2 , 3 ) ; long actual = objects . sumOfLong ( Integer :: longValue ) ; "<AssertPlaceHolder>" ; } sumOfLong ( org . eclipse . collections . api . block . function . primitive . LongFunction ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 6 , actual )
|
construct_withFilledArgsAndNullCause ( ) { final net . sf . qualitycheck . exception . IllegalNotEqualException e = new net . sf . qualitycheck . exception . IllegalNotEqualException ( "a<sp>!=<sp>b" , 2 , ( ( java . lang . Throwable ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { final java . lang . String message = super . getMessage ( ) ; if ( ( session ) != null ) { final java . lang . String context = session . getContext ( ) ; if ( ! ( context . isEmpty ( ) ) ) { return ( message + "<sp>" ) + context ; } else { return message ; } } else { return message ; } }
|
org . junit . Assert . assertEquals ( "a<sp>!=<sp>b" , e . getMessage ( ) )
|
testShouldAlphaShareBecauseSameConstantDespiteDifferentSyntax ( ) { final java . lang . String drl1 = ( ( ( ( ( ( ( "rule<sp>fileBrule1<sp>when\n" 2 + "import<sp>" ) + ( org . drools . compiler . integrationtests . SharingTest . TestObject . class . getCanonicalName ( ) ) ) + "\n" ) + "rule<sp>fileBrule1<sp>when\n" 1 ) + "<sp>TestObject(value<sp>==<sp>1)\n" ) + "then\n" ) + "rule<sp>fileBrule1<sp>when\n" 3 ) + "" ; final java . lang . String drl2 = ( ( ( ( ( ( ( ( ( ( ( ( ( ( "package<sp>iTzXzx;\n" + "import<sp>" ) + ( org . drools . compiler . integrationtests . SharingTest . TestObject . class . getCanonicalName ( ) ) ) + "\n" ) + "import<sp>" ) + ( org . drools . compiler . integrationtests . SharingTest . TestStaticUtils . class . getCanonicalName ( ) ) ) + "\n" ) + "rule<sp>fileBrule1<sp>when\n" ) + "<sp>TestObject(value<sp>==<sp>TestStaticUtils.return1()<sp>)\n" ) + "then\n" ) + "rule<sp>fileBrule1<sp>when\n" 3 ) + "rule<sp>fileBrule2<sp>when\n" ) + "<sp>TestObject(value<sp>==<sp>0<sp>)\n" ) + "then\n" ) + "rule<sp>fileBrule1<sp>when\n" 3 ) + "" ; final org . kie . api . KieBase kbase = org . drools . testcoverage . common . util . KieBaseUtil . getKieBaseFromKieModuleFromDrl ( "rule<sp>fileBrule1<sp>when\n" 0 , kieBaseTestConfiguration , drl1 , drl2 ) ; final org . kie . api . runtime . KieSession kieSession = kbase . newKieSession ( ) ; try { kieSession . insert ( new org . drools . compiler . integrationtests . SharingTest . TestObject ( 1 ) ) ; "<AssertPlaceHolder>" ; } finally { kieSession . dispose ( ) ; } } fireAllRules ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 2 , kieSession . fireAllRules ( ) )
|
testCreateEndpointPolicyInfo ( ) { java . lang . reflect . Method m1 = org . apache . cxf . ws . policy . PolicyEngineImpl . class . getDeclaredMethod ( "createEndpointPolicyInfo" , new java . lang . Class [ ] { org . apache . cxf . service . model . EndpointInfo . class , boolean . class , org . apache . cxf . ws . policy . Assertor . class , org . apache . cxf . message . Message . class } ) ; engine = org . easymock . EasyMock . createMockBuilder ( org . apache . cxf . ws . policy . PolicyEngineImpl . class ) . addMockedMethod ( m1 ) . createMock ( control ) ; engine . init ( ) ; org . apache . cxf . service . model . EndpointInfo ei = createMockEndpointInfo ( ) ; org . apache . cxf . ws . policy . Assertor assertor = control . createMock ( org . apache . cxf . ws . policy . Assertor . class ) ; org . apache . cxf . ws . policy . EndpointPolicyImpl epi = control . createMock ( org . apache . cxf . ws . policy . EndpointPolicyImpl . class ) ; org . easymock . EasyMock . expect ( engine . createEndpointPolicyInfo ( ei , false , assertor , msg ) ) . andReturn ( epi ) ; control . replay ( ) ; "<AssertPlaceHolder>" ; control . verify ( ) ; } createEndpointPolicyInfo ( org . apache . cxf . service . model . EndpointInfo , boolean , org . apache . cxf . ws . policy . Assertor , org . apache . cxf . message . Message ) { org . apache . cxf . ws . policy . EndpointPolicy ep = ( ( org . apache . cxf . ws . policy . EndpointPolicy ) ( ei . getProperty ( ( isRequestor ? org . apache . cxf . ws . policy . PolicyEngineImpl . POLICY_INFO_ENDPOINT_CLIENT : org . apache . cxf . ws . policy . PolicyEngineImpl . POLICY_INFO_ENDPOINT_SERVER ) ) ) ) ; if ( ep == null ) { synchronized ( ei ) { ep = ( ( org . apache . cxf . ws . policy . EndpointPolicy ) ( ei . getProperty ( ( isRequestor ? org . apache . cxf . ws . policy . PolicyEngineImpl . POLICY_INFO_ENDPOINT_CLIENT : org . apache . cxf . ws . policy . PolicyEngineImpl . POLICY_INFO_ENDPOINT_SERVER ) ) ) ) ; if ( ep == null ) { org . apache . cxf . ws . policy . EndpointPolicyImpl epi = new org . apache . cxf . ws . policy . EndpointPolicyImpl ( ei , this , isRequestor , assertor ) ; epi . initialize ( m ) ; if ( m != null ) { ei . setProperty ( ( isRequestor ? org . apache . cxf . ws . policy . PolicyEngineImpl . POLICY_INFO_ENDPOINT_CLIENT : org . apache . cxf . ws . policy . PolicyEngineImpl . POLICY_INFO_ENDPOINT_SERVER ) , epi ) ; } ep = epi ; } } } return ep ; }
|
org . junit . Assert . assertSame ( epi , engine . createEndpointPolicyInfo ( ei , false , assertor , msg ) )
|
testGetEncodedSize ( ) { "<AssertPlaceHolder>" ; } getEncodedSize ( int ) { return numberOfItems * ( org . apache . poi . ss . util . CellRangeAddress . ENCODED_SIZE ) ; }
|
org . junit . Assert . assertEquals ( ( 2 * ( CellRangeAddress . ENCODED_SIZE ) ) , org . apache . poi . ss . util . CellRangeAddress . getEncodedSize ( 2 ) )
|
testWikiPageEvent ( ) { org . gitlab4j . api . webhook . Event event = makeFakeApiCall ( org . gitlab4j . api . webhook . WikiPageEvent . class , "wiki-page-event" ) ; "<AssertPlaceHolder>" ; } compareJson ( T , java . lang . String ) { java . io . InputStreamReader reader = new java . io . InputStreamReader ( org . gitlab4j . api . TestGitLabApiBeans . class . getResourceAsStream ( filename ) ) ; return org . gitlab4j . api . JsonUtils . compareJson ( apiObject , reader ) ; }
|
org . junit . Assert . assertTrue ( compareJson ( event , "wiki-page-event" ) )
|
descendantsOfAllMembersOfReferenceSet ( ) { final java . lang . String refSetId = com . b2international . snowowl . snomed . common . SnomedConstants . Concepts . REFSET_DESCRIPTION_TYPE ; final java . lang . String member1 = com . b2international . snowowl . snomed . datastore . id . RandomSnomedIdentiferGenerator . generateConceptId ( ) ; final java . lang . String member2 = com . b2international . snowowl . snomed . datastore . id . RandomSnomedIdentiferGenerator . generateConceptId ( ) ; indexRevision ( com . b2international . snowowl . snomed . core . ecl . MAIN , concept ( member1 ) . activeMemberOf ( com . google . common . collect . ImmutableSet . of ( refSetId ) ) . build ( ) , concept ( member2 ) . activeMemberOf ( com . google . common . collect . ImmutableSet . of ( refSetId ) ) . build ( ) ) ; final com . b2international . index . query . Expression actual = eval ( java . lang . String . format ( "<^%s" , refSetId ) ) ; final com . b2international . index . query . Expression expected = descendantsOf ( member1 , member2 ) ; "<AssertPlaceHolder>" ; } format ( java . lang . Object , java . lang . String ) { checkNotNull ( date , "Date<sp>object<sp>cannot<sp>not<sp>be<sp>null" ) ; checkNotNull ( datePattern , "Pattern<sp>cannot<sp>not<sp>be<sp>null" ) ; return getDateFormat ( datePattern ) . format ( date ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testFalseCond2 ( ) { java . lang . String template = "<if(name)>works<endif>" ; org . stringtemplate . v4 . ST st = new org . stringtemplate . v4 . ST ( template ) ; st . add ( "name" , null ) ; java . lang . String expected = "" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testReuse ( ) { final org . apache . nifi . wali . BlockingQueuePool < java . util . concurrent . atomic . AtomicBoolean > pool = new org . apache . nifi . wali . BlockingQueuePool ( 10 , AtomicBoolean :: new , AtomicBoolean :: get , org . apache . nifi . wali . TestBlockingQueuePool . DO_NOTHING ) ; final java . util . concurrent . atomic . AtomicBoolean firstObject = pool . borrowObject ( ) ; firstObject . set ( true ) ; pool . returnObject ( firstObject ) ; for ( int i = 0 ; i < 100 ; i ++ ) { final java . util . concurrent . atomic . AtomicBoolean value = pool . borrowObject ( ) ; "<AssertPlaceHolder>" ; pool . returnObject ( value ) ; } } borrowObject ( ) { final T existing = queue . poll ( ) ; if ( existing != null ) { return existing ; } return creationFunction . get ( ) ; }
|
org . junit . Assert . assertSame ( firstObject , value )
|
testGetListener ( ) { "<AssertPlaceHolder>" ; } getListener ( ) { return java . util . Optional . ofNullable ( listener ) ; }
|
org . junit . Assert . assertEquals ( listener , f . getListener ( ) . get ( ) )
|
getConceptDatatypeByUuid_shouldFindObjectGivenValidUuid ( ) { java . lang . String uuid = "8d4a4488-c2cc-11de-8d13-0010c6dffd0f" ; org . openmrs . ConceptDatatype conceptDatatype = org . openmrs . api . context . Context . getConceptService ( ) . getConceptDatatypeByUuid ( uuid ) ; "<AssertPlaceHolder>" ; } getConceptDatatypeId ( ) { return this . conceptDatatypeId ; }
|
org . junit . Assert . assertEquals ( 1 , ( ( int ) ( conceptDatatype . getConceptDatatypeId ( ) ) ) )
|
testGeneratePreviousValueLastDayDoWLessThanRequestedDoW ( ) { fieldValueGenerator = createFieldValueGeneratorInstanceLastDayDoWLessThanRequestedDoW ( ) ; "<AssertPlaceHolder>" ; fieldValueGenerator . generatePreviousValue ( com . cronutils . model . time . generator . OnDayOfWeekValueGeneratorLTest . LAST_DAY_DOW_LESS_THAN_REQUESTED_DOW_DAY ) ; } generatePreviousValue ( int ) { return 0 ; }
|
org . junit . Assert . assertEquals ( com . cronutils . model . time . generator . OnDayOfWeekValueGeneratorLTest . LAST_DAY_DOW_LESS_THAN_REQUESTED_DOW_DAY , fieldValueGenerator . generatePreviousValue ( ( ( com . cronutils . model . time . generator . OnDayOfWeekValueGeneratorLTest . LAST_DAY_DOW_LESS_THAN_REQUESTED_DOW_DAY ) + 1 ) ) )
|
testInterlockingCalls ( ) { int upto = 1000 ; for ( eu . javaspecialists . tjsn . concurrency . interlocker . Interlocker executor : executors ) { eu . javaspecialists . tjsn . concurrency . interlocker . InterlockTask < eu . javaspecialists . tjsn . concurrency . interlocker . VerifyResult > task = new eu . javaspecialists . tjsn . concurrency . interlocker . InterleavedNumberTestingStrategy ( upto ) ; System . out . printf ( "Testing<sp>%s(%d)<sp>with<sp>%s%n" , task . getClass ( ) . getSimpleName ( ) , upto , executor . getClass ( ) . getSimpleName ( ) ) ; eu . javaspecialists . tjsn . concurrency . interlocker . VerifyResult result = executor . execute ( task ) ; "<AssertPlaceHolder>" ; } } isSuccess ( ) { return success ; }
|
org . junit . Assert . assertTrue ( result . isSuccess ( ) )
|
test_extract_target_vars_missing_target ( ) { java . lang . String cmd = "SELECT<sp>*<sp>WHERE<sp>{<sp>VALUES<sp>?o<sp>{}<sp>?s<sp>?p<sp>?o<sp>}" ; java . lang . String valueName = "objs" ; java . lang . String [ ] res = org . apache . jena . query . ParameterizedSparqlString . extractTargetVars ( cmd , valueName ) ; java . lang . String [ ] exp = new java . lang . String [ ] { } ; "<AssertPlaceHolder>" ; } extractTargetVars ( java . lang . String , java . lang . String ) { java . lang . String [ ] targetVars = new java . lang . String [ ] { } ; int valueIndex = command . indexOf ( valueName ) ; if ( valueIndex > ( - 1 ) ) { java . lang . String subCmd = command . substring ( 0 , valueIndex ) . toLowerCase ( ) ; int valuesIndex = subCmd . lastIndexOf ( org . apache . jena . query . ParameterizedSparqlString . VALUES_KEYWORD ) ; int openBracesIndex = subCmd . lastIndexOf ( "{" ) ; int closeBracesIndex = subCmd . lastIndexOf ( "}" ) ; if ( ( ( valuesIndex > ( - 1 ) ) && ( valuesIndex < openBracesIndex ) ) && ( closeBracesIndex < valuesIndex ) ) { java . lang . String vars = command . substring ( ( valuesIndex + ( org . apache . jena . query . ParameterizedSparqlString . VALUES_KEYWORD . length ( ) ) ) , openBracesIndex ) ; targetVars = vars . replaceAll ( "[(?$)]" , "" ) . trim ( ) . split ( "<sp>" ) ; } } return targetVars ; }
|
org . junit . Assert . assertArrayEquals ( exp , res )
|
shouldReturnTrueWhenConnectionIsOpened ( ) { when ( connection . isOpen ( ) ) . thenReturn ( true ) ; final boolean opened = connectionManager . isConnectionOpen ( "url" ) ; "<AssertPlaceHolder>" ; } isConnectionOpen ( java . lang . String ) { final org . eclipse . che . ide . websocket . impl . WebSocketConnection webSocketConnection = connectionsRegistry . get ( url ) ; return ( webSocketConnection != null ) && ( webSocketConnection . isOpen ( ) ) ; }
|
org . junit . Assert . assertTrue ( opened )
|
deleteById_TodoEntryFound_ShouldDeleteTodoEntryAndReturnIt ( ) { net . petrikainulainen . spring . testmvc . todo . model . Todo model = new net . petrikainulainen . spring . testmvc . todo . model . TodoBuilder ( ) . id ( net . petrikainulainen . spring . testmvc . todo . service . RepositoryTodoServiceTest . ID ) . description ( net . petrikainulainen . spring . testmvc . todo . service . RepositoryTodoServiceTest . DESCRIPTION ) . title ( net . petrikainulainen . spring . testmvc . todo . service . RepositoryTodoServiceTest . TITLE ) . build ( ) ; when ( repositoryMock . findOne ( net . petrikainulainen . spring . testmvc . todo . service . RepositoryTodoServiceTest . ID ) ) . thenReturn ( model ) ; net . petrikainulainen . spring . testmvc . todo . model . Todo actual = service . deleteById ( net . petrikainulainen . spring . testmvc . todo . service . RepositoryTodoServiceTest . ID ) ; verify ( repositoryMock , times ( 1 ) ) . findOne ( net . petrikainulainen . spring . testmvc . todo . service . RepositoryTodoServiceTest . ID ) ; verify ( repositoryMock , times ( 1 ) ) . delete ( model ) ; verifyNoMoreInteractions ( repositoryMock ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( model ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.