input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testPrimitiveToBoxedCoercionInMethodArgument ( ) { final java . lang . String str = ( ( ( ( ( ( ( ( "package<sp>org.drools.compiler.test;\n" + "import<sp>" ) + ( org . drools . compiler . integrationtests . session . TypeCoercionTest . class . getName ( ) ) ) + "\n" ) + "import<sp>org.drools.compiler.*\n" ) + "rule<sp>R1<sp>when\n" ) + "<sp>Person(<sp>$ag1<sp>:<sp>age<sp>)" ) + "<sp>$p2<sp>:<sp>Person(<sp>name<sp>==<sp>TypeCoercionTest.integer2String($ag1)<sp>)" ) + "then\n" ) + "end\n" ; final org . kie . api . KieBase kbase = loadKnowledgeBaseFromString ( str ) ; final org . kie . api . runtime . KieSession ksession = kbase . newKieSession ( ) ; final org . drools . compiler . Person p = new org . drools . compiler . Person ( "42" , 42 ) ; ksession . insert ( p ) ; "<AssertPlaceHolder>" ; } fireAllRules ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 1 , ksession . fireAllRules ( ) )
|
reprocess_NoPendingStream ( ) { io . grpc . LoadBalancer . SubchannelPicker picker = mock ( io . grpc . LoadBalancer . SubchannelPicker . class ) ; io . grpc . internal . AbstractSubchannel subchannel = mock ( io . grpc . internal . AbstractSubchannel . class ) ; when ( subchannel . obtainActiveTransport ( ) ) . thenReturn ( mockRealTransport ) ; when ( picker . pickSubchannel ( any ( io . grpc . LoadBalancer . PickSubchannelArgs . class ) ) ) . thenReturn ( io . grpc . LoadBalancer . PickResult . withSubchannel ( subchannel ) ) ; when ( mockRealTransport . newStream ( any ( io . grpc . MethodDescriptor . class ) , any ( io . grpc . Metadata . class ) , any ( io . grpc . CallOptions . class ) ) ) . thenReturn ( mockRealStream ) ; delayedTransport . reprocess ( picker ) ; verifyNoMoreInteractions ( picker ) ; verifyNoMoreInteractions ( transportListener ) ; io . grpc . internal . ClientStream stream = delayedTransport . newStream ( method , headers , CallOptions . DEFAULT ) ; verify ( picker ) . pickSubchannel ( new io . grpc . internal . PickSubchannelArgsImpl ( method , headers , io . grpc . CallOptions . DEFAULT ) ) ; verify ( subchannel ) . obtainActiveTransport ( ) ; "<AssertPlaceHolder>" ; } obtainActiveTransport ( ) { io . grpc . internal . ClientTransport savedTransport = activeTransport ; if ( savedTransport != null ) { return savedTransport ; } try { synchronized ( lock ) { savedTransport = activeTransport ; if ( savedTransport != null ) { return savedTransport ; } if ( ( state . getState ( ) ) == ( io . grpc . ConnectivityState . IDLE ) ) { channelLogger . log ( ChannelLogLevel . INFO , "CONNECTING<sp>as<sp>requested" ) ; gotoNonErrorState ( io . grpc . ConnectivityState . CONNECTING ) ; startNewTransport ( ) ; } } } finally { syncContext . drain ( ) ; } return null ; }
|
org . junit . Assert . assertSame ( mockRealStream , stream )
|
testIsAdHocAutostart_true ( ) { java . lang . String id = java . util . UUID . randomUUID ( ) . toString ( ) ; org . eclipse . bpmn2 . CallActivity callActivity = bpmn2 . createCallActivity ( ) ; callActivity . setId ( id ) ; CustomElement . autoStart . of ( callActivity ) . set ( Boolean . TRUE ) ; tested = new org . kie . workbench . common . stunner . cm . backend . converters . tostunner . properties . CaseManagementActivityPropertyReader ( callActivity , definitionResolver . getDiagram ( ) , definitionResolver ) ; "<AssertPlaceHolder>" ; } isAdHocAutostart ( ) { return CustomElement . autoStart . of ( element ) . get ( ) ; }
|
org . junit . Assert . assertTrue ( tested . isAdHocAutostart ( ) )
|
loadInnerModel ( ) { org . apache . kylin . metadata . model . DataModelDesc model = org . apache . kylin . metadata . model . DataModelManager . getInstance ( getTestConfig ( ) ) . getDataModelDesc ( "ci_inner_join_model" ) ; "<AssertPlaceHolder>" ; } getDataModelDesc ( java . lang . String ) { try ( org . apache . kylin . common . util . AutoReadWriteLock . AutoLock lock = modelMapLock . lockForRead ( ) ) { return dataModelDescMap . get ( name ) ; } }
|
org . junit . Assert . assertNotNull ( model )
|
testColumnMajorDoubleArray1DConstructor ( ) { org . ujmp . core . Matrix m = new org . ujmp . core . doublematrix . impl . DefaultDenseDoubleMatrix2D ( 23 , 17 ) ; org . ujmp . core . implementations . AbstractMatrixTest . setAnnotation ( m ) ; m . randn ( Ret . ORIG ) ; org . ujmp . core . Matrix m2 = createMatrixWithAnnotation ( m ) ; "<AssertPlaceHolder>" ; if ( m2 instanceof org . ujmp . core . interfaces . Erasable ) { ( ( org . ujmp . core . interfaces . Erasable ) ( m2 ) ) . erase ( ) ; } } getLabel ( ) { java . lang . Object o = getLabelObject ( ) ; if ( o == null ) { return null ; } if ( o instanceof java . lang . String ) { return ( ( java . lang . String ) ( o ) ) ; } if ( o instanceof org . ujmp . core . interfaces . HasLabel ) { return ( ( org . ujmp . core . interfaces . HasLabel ) ( o ) ) . getLabel ( ) ; } return o . toString ( ) ; }
|
org . junit . Assert . assertEquals ( getLabel ( ) , m , m2 )
|
testWriteChar ( ) { com . liferay . portal . kernel . io . Serializer serializer = new com . liferay . portal . kernel . io . Serializer ( ) ; java . nio . ByteBuffer byteBuffer = java . nio . ByteBuffer . allocate ( ( ( com . liferay . portal . kernel . io . SerializerTest . _COUNT ) * 2 ) ) ; byteBuffer . order ( ByteOrder . BIG_ENDIAN ) ; java . nio . CharBuffer charBuffer = byteBuffer . asCharBuffer ( ) ; char [ ] chars = new char [ com . liferay . portal . kernel . io . SerializerTest . _COUNT ] ; for ( int i = 0 ; i < ( com . liferay . portal . kernel . io . SerializerTest . _COUNT ) ; i ++ ) { chars [ i ] = ( ( char ) ( _random . nextInt ( ) ) ) ; serializer . writeChar ( chars [ i ] ) ; charBuffer . put ( chars [ i ] ) ; } java . nio . ByteBuffer serializerByteBuffer = serializer . toByteBuffer ( ) ; "<AssertPlaceHolder>" ; } toByteBuffer ( ) { java . nio . ByteBuffer byteBuffer = java . nio . ByteBuffer . wrap ( java . util . Arrays . copyOf ( _buffer , _index ) ) ; if ( ( _buffer . length ) <= ( com . liferay . petra . io . Serializer . _THREADLOCAL_BUFFER_SIZE_LIMIT ) ) { com . liferay . petra . io . Serializer . BufferQueue bufferQueue = _getBufferQueue ( ) ; bufferQueue . enqueue ( _buffer ) ; } _buffer = null ; return byteBuffer ; }
|
org . junit . Assert . assertArrayEquals ( byteBuffer . array ( ) , serializerByteBuffer . array ( ) )
|
testNewProductCreated ( ) { org . candlepin . dto . manifest . v1 . ProductDTO product = new org . candlepin . dto . manifest . v1 . ProductDTO ( ) ; product . setId ( "test-id" ) ; product . setName ( "test-name" ) ; product . setAttribute ( "attr1" , "val1" ) ; product . setAttribute ( "attr2" , "val2" ) ; product . setMultiplier ( 1L ) ; java . util . Set < java . lang . String > dependentProdIDs = new java . util . HashSet ( ) ; dependentProdIDs . add ( "g23gh23h2" ) ; dependentProdIDs . add ( "353g823h" ) ; product . setDependentProductIds ( dependentProdIDs ) ; java . lang . String json = getJsonForProduct ( product ) ; java . io . Reader reader = new java . io . StringReader ( json ) ; org . candlepin . dto . manifest . v1 . ProductDTO created = importer . createObject ( mapper , reader , owner ) ; "<AssertPlaceHolder>" ; } createObject ( com . fasterxml . jackson . databind . ObjectMapper , java . io . Reader , org . candlepin . model . Owner ) { org . candlepin . dto . manifest . v1 . ProductDTO importedProduct = mapper . readValue ( reader , org . candlepin . dto . manifest . v1 . ProductDTO . class ) ; importedProduct . setUuid ( null ) ; importedProduct . setMultiplier ( 1L ) ; if ( ( importedProduct . getProductContent ( ) ) != null ) { for ( org . candlepin . dto . manifest . v1 . ProductDTO . ProductContentDTO pc : importedProduct . getProductContent ( ) ) { org . candlepin . dto . manifest . v1 . ContentDTO content = pc . getContent ( ) ; content . setUuid ( null ) ; if ( org . apache . commons . lang . StringUtils . isBlank ( content . getVendor ( ) ) ) { content . setVendor ( "unknown" ) ; } content . setMetadataExpiration ( 1L ) ; } } return importedProduct ; }
|
org . junit . Assert . assertEquals ( product , created )
|
testPrefetch ( ) { createPersonsDataSet ( ) ; java . util . List < ? > managers = context . performQuery ( new org . apache . cayenne . query . SelectQuery ( org . apache . cayenne . testdo . inheritance_people . Manager . class ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return neighbors . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , managers . size ( ) )
|
testNestedInlineViews ( ) { java . lang . String sql = "SELECT<sp>*<sp>FROM<sp>(SELECT<sp>*<sp>FROM<sp>(SELECT<sp>*<sp>FROM<sp>pm1.g1)<sp>AS<sp>Y)<sp>AS<sp>X" ; org . teiid . query . resolver . Command c = helpResolve ( sql ) ; "<AssertPlaceHolder>" ; verifyProjectedTypes ( c , new java . lang . Class [ ] { java . lang . String . class , org . teiid . query . resolver . Integer . class , org . teiid . query . resolver . Boolean . class , org . teiid . query . resolver . Double . class } ) ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( this . left ) ; sb . append ( this . type ) ; sb . append ( this . right ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( sql , c . toString ( ) )
|
empty_iteration ( ) { java . util . Iterator < java . lang . Integer > iter = new com . groupon . lex . metrics . lib . ForwardIterator ( java . util . Collections . emptyIterator ( ) ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( begin ) < ( end ) ; }
|
org . junit . Assert . assertFalse ( iter . hasNext ( ) )
|
getPersonAttributeTypes_shouldReturnEmptyListWithViewTypeListing ( ) { java . util . List < org . openmrs . PersonAttributeType > result = personService . getPersonAttributeTypes ( null , PersonService . ATTR_VIEW_TYPE . LISTING ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return true ; }
|
org . junit . Assert . assertTrue ( result . isEmpty ( ) )
|
determinePriceModelType_CustomerSubscription ( ) { org . oscm . domobjects . PriceModel pm = givenPriceModel ( ServiceType . CUSTOMER_SUBSCRIPTION ) ; org . oscm . serviceprovisioningservice . auditlog . PriceModelAuditLogOperation . PriceModelType type = logCollector . determinePriceModelType ( pm ) ; "<AssertPlaceHolder>" ; } determinePriceModelType ( org . oscm . domobjects . PriceModel ) { org . oscm . serviceprovisioningservice . auditlog . PriceModelAuditLogOperation . PriceModelType priceModelType = org . oscm . serviceprovisioningservice . auditlog . PriceModelAuditLogOperation . PriceModelType . SERVICE ; if ( org . oscm . internal . types . enumtypes . ServiceType . isSubscription ( priceModel . getProduct ( ) . getType ( ) ) ) { priceModelType = org . oscm . serviceprovisioningservice . auditlog . PriceModelAuditLogOperation . PriceModelType . SUBSCRIPTION ; } else if ( org . oscm . internal . types . enumtypes . ServiceType . isCustomerTemplate ( priceModel . getProduct ( ) . getType ( ) ) ) { priceModelType = org . oscm . serviceprovisioningservice . auditlog . PriceModelAuditLogOperation . PriceModelType . CUSTOMER_SERVICE ; } return priceModelType ; }
|
org . junit . Assert . assertEquals ( PriceModelType . SUBSCRIPTION , type )
|
testPropertyPlaceholderSystemOverride ( ) { java . lang . System . setProperty ( "id" , "35" ) ; org . springframework . context . ConfigurableApplicationContext ctx = new org . springframework . context . support . ClassPathXmlApplicationContext ( "spring.xml" , "loggers.xml" , "db.xml" ) ; com . yet . spring . core . beans . Client client = ctx . getBean ( com . yet . spring . core . beans . Client . class ) ; ctx . close ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( "35" , client . getId ( ) )
|
groupMembersSubGroupTest ( ) { System . out . println ( "VootManager.groupMembersSubGroupTest" ) ; cz . metacentrum . perun . voot . VOOT voot = new cz . metacentrum . perun . voot . VOOT ( ) ; cz . metacentrum . perun . voot . Response response = ( ( cz . metacentrum . perun . voot . Response ) ( voot . process ( session , "people/@me/vo1:group1:group2" , "" ) ) ) ; "<AssertPlaceHolder>" ; } getEntry ( ) { return entry ; }
|
org . junit . Assert . assertEquals ( 2 , response . getEntry ( ) . length )
|
asDouble ( ) { double result = new org . eclipse . rap . json . JsonNumber ( "23.05" ) . asDouble ( ) ; "<AssertPlaceHolder>" ; } asDouble ( ) { double result = new org . eclipse . rap . json . JsonNumber ( "23.05" ) . asDouble ( ) ; org . junit . Assert . assertEquals ( 23.05 , result , 0 ) ; }
|
org . junit . Assert . assertEquals ( 23.05 , result , 0 )
|
test_list_length ( ) { org . jerlang . type . Atom a = org . jerlang . type . Atom . of ( "a" ) ; org . jerlang . type . List params = org . jerlang . type . List . of ( org . jerlang . type . List . of ( a , a , a , a , a , a , a , a , a , a ) ) ; org . jerlang . type . Term result = org . jerlang . erts . Erlang . apply ( org . jerlang . type . Atom . of ( "example4" ) , org . jerlang . type . Atom . of ( "list_length" ) , params ) ; "<AssertPlaceHolder>" ; } of ( int ) { return new org . jerlang . type . Integer ( value ) ; }
|
org . junit . Assert . assertEquals ( org . jerlang . type . Integer . of ( 10 ) , result )
|
testUnion ( ) { org . evosuite . ga . metaheuristics . NSGAII < org . evosuite . ga . NSGAChromosome > ga = new org . evosuite . ga . metaheuristics . NSGAII < org . evosuite . ga . NSGAChromosome > ( null ) ; org . evosuite . ga . NSGAChromosome c1 = new org . evosuite . ga . NSGAChromosome ( ) ; org . evosuite . ga . NSGAChromosome c2 = new org . evosuite . ga . NSGAChromosome ( ) ; org . evosuite . ga . NSGAChromosome c3 = new org . evosuite . ga . NSGAChromosome ( ) ; java . util . List < org . evosuite . ga . NSGAChromosome > pop = new java . util . ArrayList < org . evosuite . ga . NSGAChromosome > ( ) ; pop . add ( c1 ) ; pop . add ( c2 ) ; java . util . List < org . evosuite . ga . NSGAChromosome > off = new java . util . ArrayList < org . evosuite . ga . NSGAChromosome > ( ) ; off . add ( c3 ) ; java . util . List < org . evosuite . ga . NSGAChromosome > union = ga . union ( pop , off ) ; "<AssertPlaceHolder>" ; } size ( ) { return theTest . size ( ) ; }
|
org . junit . Assert . assertEquals ( union . size ( ) , 3 )
|
nilHash ( ) { org . jaitools . imageutils . ImageLayout2 il = new org . jaitools . imageutils . ImageLayout2 ( ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { int hash = 3 ; hash = ( 31 * hash ) + ( this . startX ) ; hash = ( 31 * hash ) + ( this . endX ) ; hash = ( 31 * hash ) + ( this . y ) ; return hash ; }
|
org . junit . Assert . assertEquals ( 0 , il . hashCode ( ) )
|
testExpectTrueMultiple ( ) { evaluator . addURL ( expectedURL2 ) ; request . setRequestUri ( expectedURL2 ) ; ch . qos . logback . access . spi . IAccessEvent ae = new ch . qos . logback . access . spi . AccessEvent ( accessContext , request , response , serverAdapter ) ; "<AssertPlaceHolder>" ; } evaluate ( ch . qos . logback . access . spi . IAccessEvent ) { java . lang . String url = event . getRequestURL ( ) ; for ( java . lang . String expected : URLList ) { if ( url . contains ( expected ) ) { return true ; } } return false ; }
|
org . junit . Assert . assertTrue ( evaluator . evaluate ( ae ) )
|
testMakeBremserCompliant ( ) { java . lang . String [ ] startData = new java . lang . String [ ] { "O-1;=C(//)" , "CCC(//)" 2 , "C-2;CC(//)" , "C-2;CC(//)" , "CCC(//)" 3 , "C-2;CC(//)" , "C-2;CC(//)" , "CCC(//)" 3 , "CCC(//)" 3 , "C-2;CC(//)" , "C-2;CC(//)" , "C-2;CC(//)" , "C-2;CC(//)" , "C-3;CCO(//)" , "CCC(//)" 4 , "C-3;CCO(//)" , "C-3;CCO(//)" , "CCC(//)" 4 , "C-1;O(//)" , "C-2;CC(//)" , "CCC(//)" 3 , "CCC(//)" 3 , "CCC(//)" 3 } ; java . lang . String [ ] result = new java . lang . String [ ] { "CCC(//)" 0 , "=OCC(//)" , "CC(//)" , "CC(//)" , "CCC(//)" , "CC(//)" , "CC(//)" , "CCC(//)" , "CCC(//)" , "CC(//)" , "CC(//)" , "CC(//)" , "CC(//)" , "CCO(//)" , "CC(//)" , "CCO(//)" , "CCO(//)" , "CC(//)" , "CCC(//)" 1 , "CC(//)" , "CCC(//)" , "CCC(//)" , "CCC(//)" } ; java . lang . String s = null ; org . openscience . cdk . tools . HOSECodeGenerator hcg = new org . openscience . cdk . tools . HOSECodeGenerator ( ) ; for ( int f = 0 ; f < ( startData . length ) ; f ++ ) { s = hcg . makeBremserCompliant ( startData [ f ] ) ; if ( org . openscience . cdk . tools . HOSECodeGeneratorTest . standAlone ) System . out . print ( ( ( ( "|" + s ) + "|<sp>-><sp>" ) + ( result [ f ] ) ) ) ; "<AssertPlaceHolder>" ; if ( org . openscience . cdk . tools . HOSECodeGeneratorTest . standAlone ) System . out . println ( "CCC(//)" 5 ) ; } } print ( org . openscience . cdk . interfaces . IAtomContainer ) { System . out . println ( org . openscience . cdk . group . AtomContainerPrinter . toString ( atomContainer ) ) ; }
|
org . junit . Assert . assertEquals ( result [ f ] , s )
|
givenTwoGenericList_whenCheckIsAssignableFrom_thenReturnTrueDueToTypeErasure ( ) { java . util . ArrayList < java . lang . String > stringList = com . google . common . collect . Lists . newArrayList ( ) ; java . util . ArrayList < java . lang . Integer > intList = com . google . common . collect . Lists . newArrayList ( ) ; boolean result = stringList . getClass ( ) . isAssignableFrom ( intList . getClass ( ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( result )
|
testProbabilityCorrectTestOnNegativeProbability ( ) { for ( double p = - 10 ; p < ( - 0.05 ) ; p += 0.05 ) { for ( int k = - 50 ; k < 0 ; k ++ ) { java . lang . Double probabilityCorrect = com . datascience . gal . Pricing . probabilityCorrect ( new java . lang . Double ( p ) , new java . lang . Integer ( k ) ) ; "<AssertPlaceHolder>" ; } } } probabilityCorrect ( java . lang . Double , java . lang . Integer ) { if ( k < 0 ) return null ; if ( k == 0 ) return 0.5 ; if ( p > 1 ) return null ; if ( p < 0 ) return null ; if ( p == 0.5 ) return 0.5 ; if ( p < 0.5 ) { p = 1 - p ; } java . lang . Double result = 0.0 ; int low = ( ( int ) ( java . lang . Math . ceil ( ( ( 0.5 * k ) + 0.5 ) ) ) ) ; for ( int i = low ; i <= k ; i ++ ) { result += java . lang . Math . exp ( ( ( ( com . datascience . utils . Stat . logBinom ( k , i ) ) + ( i * ( java . lang . Math . log ( p ) ) ) ) + ( ( k - i ) * ( java . lang . Math . log ( ( 1 - p ) ) ) ) ) ) ; } if ( ( k % 2 ) == 0 ) { result += java . lang . Math . exp ( ( ( ( com . datascience . utils . Stat . logBinom ( k , ( k / 2 ) ) ) + ( ( k / 2 ) * ( java . lang . Math . log ( p ) ) ) ) + ( ( k / 2 ) * ( java . lang . Math . log ( ( 1 - p ) ) ) ) ) ) ; } return result ; }
|
org . junit . Assert . assertNull ( probabilityCorrect )
|
testLastRegionCompare ( ) { org . apache . hadoop . hbase . regionserver . HTableDescriptor tableDesc = new org . apache . hadoop . hbase . regionserver . HTableDescriptor ( "testtable" ) ; org . apache . hadoop . hbase . regionserver . HRegionInfo hrip = new org . apache . hadoop . hbase . regionserver . HRegionInfo ( tableDesc . getName ( ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "a" ) , new byte [ 0 ] ) ; org . apache . hadoop . hbase . regionserver . HRegionInfo hric = new org . apache . hadoop . hbase . regionserver . HRegionInfo ( tableDesc . getName ( ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "a" ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "b" ) ) ; "<AssertPlaceHolder>" ; } compareTo ( org . apache . hadoop . hbase . client . Row ) { return org . apache . hadoop . hbase . util . Bytes . compareTo ( this . getRow ( ) , other . getRow ( ) ) ; }
|
org . junit . Assert . assertTrue ( ( ( hrip . compareTo ( hric ) ) > 0 ) )
|
testKey ( ) { org . gitlab4j . api . models . Key key = org . gitlab4j . api . JsonUtils . unmarshalResource ( org . gitlab4j . api . models . Key . class , "key.json" ) ; "<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 ( org . gitlab4j . api . JsonUtils . compareJson ( key , "key.json" ) )
|
testHasAppEngineInfo_appEngineSetToNonExistent ( ) { com . google . cloud . tools . eclipse . projectselector . model . GcpProject gcpProject = new com . google . cloud . tools . eclipse . projectselector . model . GcpProject ( "name" , "id" ) ; gcpProject . setAppEngine ( AppEngine . NO_APPENGINE_APPLICATION ) ; "<AssertPlaceHolder>" ; } hasAppEngineInfo ( ) { return ( appEngine . get ( ) ) != null ; }
|
org . junit . Assert . assertTrue ( gcpProject . hasAppEngineInfo ( ) )
|
testOpen ( ) { java . io . InputStream is = org . apache . poi . hpbf . TestHPBFDocument . _samples . openResourceAsStream ( "Sample.pub" ) ; org . apache . poi . hpbf . HPBFDocument doc = new org . apache . poi . hpbf . HPBFDocument ( is ) ; is . close ( ) ; "<AssertPlaceHolder>" ; doc . close ( ) ; } close ( ) { container . close ( ) ; }
|
org . junit . Assert . assertNotNull ( doc )
|
testNodeFailoverWorkerCopyQueuesFromRSUsingMulti ( ) { org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . LOG . debug ( "testNodeFailoverWorkerCopyQueuesFromRSUsingMulti" ) ; org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . conf . setBoolean ( HConstants . ZOOKEEPER_USEMULTI , true ) ; final org . apache . hadoop . hbase . Server server = new org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyServer ( "hostname0.example.org" ) ; java . util . concurrent . atomic . AtomicBoolean replicating = new java . util . concurrent . atomic . AtomicBoolean ( true ) ; org . apache . hadoop . hbase . replication . ReplicationZookeeper rz = new org . apache . hadoop . hbase . replication . ReplicationZookeeper ( server , replicating ) ; org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . files . add ( "log1" ) ; org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . files . add ( "log2" ) ; for ( java . lang . String file : org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . files ) { rz . addLogToList ( file , "1" ) ; } org . apache . hadoop . hbase . Server s1 = new org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyServer ( "dummyserver1.example.org" ) ; org . apache . hadoop . hbase . Server s2 = new org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyServer ( "dummyserver2.example.org" ) ; org . apache . hadoop . hbase . Server s3 = new org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyServer ( "dummyserver3.example.org" ) ; org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyNodeFailoverWorker w1 = new org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyNodeFailoverWorker ( server . getServerName ( ) . getServerName ( ) , s1 ) ; org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyNodeFailoverWorker w2 = new org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyNodeFailoverWorker ( server . getServerName ( ) . getServerName ( ) , s2 ) ; org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyNodeFailoverWorker w3 = new org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . DummyNodeFailoverWorker ( server . getServerName ( ) . getServerName ( ) , s3 ) ; org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . latch = new java . util . concurrent . CountDownLatch ( 3 ) ; w1 . start ( ) ; w2 . start ( ) ; w3 . start ( ) ; int populatedMap = 0 ; org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . latch . await ( ) ; populatedMap += ( ( w1 . isLogZnodesMapPopulated ( ) ) + ( w2 . isLogZnodesMapPopulated ( ) ) ) + ( w3 . isLogZnodesMapPopulated ( ) ) ; "<AssertPlaceHolder>" ; server . abort ( "" , null ) ; } isLogZnodesMapPopulated ( ) { java . util . Collection < java . util . SortedSet < java . lang . String > > sets = logZnodesMap . values ( ) ; if ( ( sets . size ( ) ) > 1 ) { throw new java . lang . RuntimeException ( ( "unexpected<sp>size<sp>of<sp>logZnodesMap:<sp>" + ( sets . size ( ) ) ) ) ; } if ( ( sets . size ( ) ) == 1 ) { java . util . SortedSet < java . lang . String > s = sets . iterator ( ) . next ( ) ; for ( java . lang . String file : org . apache . hadoop . hbase . replication . regionserver . TestReplicationSourceManager . files ) { if ( ! ( s . contains ( file ) ) ) { return 0 ; } } return 1 ; } return 0 ; }
|
org . junit . Assert . assertEquals ( 1 , populatedMap )
|
testHandleOperations_processesOnlyDNDOperations ( ) { org . eclipse . rap . rwt . internal . protocol . ControlOperationHandler controlHandler = mock ( org . eclipse . rap . rwt . internal . protocol . ControlOperationHandler . class ) ; getRemoteObject ( sourceControl ) . setHandler ( controlHandler ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . fakeSetProperty ( getId ( display ) , "cursorLocation" , new org . eclipse . rap . json . JsonArray ( ) . add ( 1 ) . add ( 2 ) ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . fakeSetProperty ( getId ( sourceControl ) , "text" , "foo" ) ; org . eclipse . swt . internal . widgets . displaykit . DNDSupport . handleOperations ( ) ; "<AssertPlaceHolder>" ; verify ( controlHandler , never ( ) ) . handleSet ( new org . eclipse . rap . json . JsonObject ( ) . add ( "text" , "foo" ) ) ; } getCursorLocation ( ) { checkDevice ( ) ; return new org . eclipse . swt . graphics . Point ( cursorLocation . x , cursorLocation . y ) ; }
|
org . junit . Assert . assertEquals ( new org . eclipse . swt . graphics . Point ( 0 , 0 ) , display . getCursorLocation ( ) )
|
testPathIsDirectoryWhenPathIsFile ( ) { alluxio . client . file . FileSystemTestUtils . createByteFile ( mFileSystem , "/testFile" , WritePType . MUST_CACHE , 10 ) ; int ret = mFsShell . run ( "test" , "-d" , "/testFile" ) ; "<AssertPlaceHolder>" ; } run ( alluxio . job . JobConfig , int , alluxio . conf . AlluxioConfiguration ) { alluxio . retry . CountingRetry retryPolicy = new alluxio . retry . CountingRetry ( attempts ) ; while ( retryPolicy . attempt ( ) ) { long jobId ; try ( alluxio . client . job . JobMasterClient client = JobMasterClient . Factory . create ( alluxio . worker . job . JobMasterClientContext . newBuilder ( alluxio . ClientContext . create ( alluxioConf ) ) . build ( ) ) ) { jobId = client . run ( config ) ; } catch ( java . lang . Exception e ) { alluxio . client . job . JobGrpcClientUtils . LOG . warn ( "Exception<sp>encountered<sp>when<sp>starting<sp>a<sp>job." , e ) ; continue ; } alluxio . job . wire . JobInfo jobInfo = alluxio . client . job . JobGrpcClientUtils . waitFor ( jobId , alluxioConf ) ; if ( jobInfo == null ) { break ; } if ( ( ( jobInfo . getStatus ( ) ) == ( alluxio . job . wire . Status . COMPLETED ) ) || ( ( jobInfo . getStatus ( ) ) == ( alluxio . job . wire . Status . CANCELED ) ) ) { return ; } alluxio . client . job . JobGrpcClientUtils . LOG . warn ( "Job<sp>{}<sp>failed<sp>to<sp>complete:<sp>{}" , jobId , jobInfo . getErrorMessage ( ) ) ; } throw new java . lang . RuntimeException ( "Failed<sp>to<sp>successfully<sp>complete<sp>the<sp>job." ) ; }
|
org . junit . Assert . assertEquals ( 1 , ret )
|
testErrorOnConsumer ( ) { io . datakernel . stream . StreamSupplier < java . lang . Integer > source = io . datakernel . stream . StreamSupplier . of ( 3 , 1 , 3 , 2 , 5 , 1 , 4 , 3 , 2 ) ; java . util . concurrent . Executor executor = java . util . concurrent . Executors . newSingleThreadExecutor ( ) ; io . datakernel . stream . processor . StreamSorterStorage < java . lang . Integer > storage = io . datakernel . stream . processor . StreamSorterStorageImpl . create ( executor , io . datakernel . stream . processor . INT_SERIALIZER , tempFolder . newFolder ( ) . toPath ( ) ) ; io . datakernel . stream . processor . StreamSorter < java . lang . Integer , java . lang . Integer > sorter = io . datakernel . stream . processor . StreamSorter . create ( storage , java . util . function . Function . identity ( ) , Integer :: compareTo , true , 2 ) ; java . util . List < java . lang . Integer > list = new java . util . ArrayList ( ) ; io . datakernel . stream . StreamConsumerToList < java . lang . Integer > consumer = io . datakernel . stream . StreamConsumerToList . create ( list ) ; io . datakernel . exception . ExpectedException exception = new io . datakernel . exception . ExpectedException ( ) ; java . lang . Throwable e = awaitException ( source . streamTo ( sorter . getInput ( ) ) , sorter . getOutput ( ) . streamTo ( consumer . transformWith ( decorator ( ( context , dataAcceptor ) -> ( item ) -> { dataAcceptor . accept ( item ) ; if ( ( list . size ( ) ) == 2 ) { context . closeWithError ( exception ) ; } } ) ) ) ) ; "<AssertPlaceHolder>" ; } closeWithError ( java . lang . Throwable ) { endOfStream . trySetException ( e ) ; }
|
org . junit . Assert . assertSame ( exception , e )
|
testWithInputElement ( ) { java . util . List < java . lang . String > params = new java . util . ArrayList ( ) ; params . add ( "echo" ) ; params . add ( org . opencastproject . execute . impl . ExecuteServiceImplTest . pattern ) ; org . opencastproject . mediapackage . MediaPackageElement element = org . opencastproject . mediapackage . MediaPackageElementBuilderFactory . newInstance ( ) . newElementBuilder ( ) . elementFromURI ( org . opencastproject . execute . impl . ExecuteServiceImplTest . baseDirURI ) ; java . lang . String result = org . opencastproject . execute . impl . ExecuteServiceImplTest . executor . doProcess ( params , element , null , null ) ; "<AssertPlaceHolder>" ; } doProcess ( java . util . List , org . opencastproject . mediapackage . MediaPackageElement , java . lang . String , org . opencastproject . mediapackage . MediaPackageElement . Type ) { java . lang . String params = arguments . remove ( 1 ) ; arguments . addAll ( splitParameters ( params ) ) ; java . io . File outFile = null ; try { java . io . File trackFile = workspace . get ( element . getURI ( ) ) ; if ( outFileName != null ) outFile = new java . io . File ( trackFile . getParentFile ( ) , outFileName ) ; for ( int i = 1 ; i < ( arguments . size ( ) ) ; i ++ ) { if ( arguments . get ( i ) . contains ( org . opencastproject . execute . impl . INPUT_FILE_PATTERN ) ) { arguments . set ( i , arguments . get ( i ) . replace ( org . opencastproject . execute . impl . INPUT_FILE_PATTERN , trackFile . getAbsolutePath ( ) ) ) ; continue ; } if ( arguments . get ( i ) . contains ( org . opencastproject . execute . impl . OUTPUT_FILE_PATTERN ) ) { if ( outFile != null ) { arguments . set ( i , arguments . get ( i ) . replace ( org . opencastproject . execute . impl . OUTPUT_FILE_PATTERN , outFile . getAbsolutePath ( ) ) ) ; continue ; } else { org . opencastproject . execute . impl . ExecuteServiceImpl . logger . error ( "{}<sp>pattern<sp>found,<sp>but<sp>no<sp>valid<sp>output<sp>filename<sp>was<sp>specified" , org . opencastproject . execute . impl . OUTPUT_FILE_PATTERN ) ; throw new org . opencastproject . execute . api . ExecuteException ( ( ( OUTPUT_FILE_PATTERN ) + "<sp>pattern<sp>found,<sp>but<sp>no<sp>valid<sp>output<sp>filename<sp>was<sp>specified" ) ) ; } } } return runCommand ( arguments , outFile , expectedType ) ; } catch ( java . io . IOException e ) { org . opencastproject . execute . impl . ExecuteServiceImpl . logger . error ( "Error<sp>retrieving<sp>file<sp>from<sp>workspace:<sp>{}" , element . getURI ( ) ) ; throw new org . opencastproject . execute . api . ExecuteException ( ( "Error<sp>retrieving<sp>file<sp>from<sp>workspace:<sp>" + ( element . getURI ( ) ) ) , e ) ; } catch ( org . opencastproject . util . NotFoundException e ) { org . opencastproject . execute . impl . ExecuteServiceImpl . logger . error ( "Element<sp>'{}'<sp>cannot<sp>be<sp>found<sp>in<sp>the<sp>workspace." , element . getURI ( ) ) ; throw new org . opencastproject . execute . api . ExecuteException ( ( ( "Element<sp>" + ( element . getURI ( ) ) ) + "<sp>cannot<sp>be<sp>found<sp>in<sp>the<sp>workspace" ) ) ; } }
|
org . junit . Assert . assertEquals ( result , "" )
|
testGetSectionNonExistingNegativeIndex ( ) { relation . getColumn ( ) . add ( new org . kie . workbench . common . dmn . api . definition . v1_1 . InformationItem ( ) ) ; "<AssertPlaceHolder>" ; } getSection ( org . kie . workbench . common . dmn . api . definition . v1_1 . Relation , int ) { if ( columnIndex < 0 ) { return org . kie . workbench . common . dmn . client . editors . expressions . types . relation . RelationUIModelMapperHelper . RelationSection . NONE ; } final int iiColumnCount = relation . getColumn ( ) . size ( ) ; int _columnIndex = columnIndex ; if ( ( _columnIndex = _columnIndex - ( org . kie . workbench . common . dmn . client . editors . expressions . types . relation . RelationUIModelMapperHelper . ROW_INDEX_COLUMN_COUNT ) ) < 0 ) { return org . kie . workbench . common . dmn . client . editors . expressions . types . relation . RelationUIModelMapperHelper . RelationSection . ROW_INDEX ; } if ( ( _columnIndex - iiColumnCount ) < 0 ) { return org . kie . workbench . common . dmn . client . editors . expressions . types . relation . RelationUIModelMapperHelper . RelationSection . INFORMATION_ITEM ; } return org . kie . workbench . common . dmn . client . editors . expressions . types . relation . RelationUIModelMapperHelper . RelationSection . NONE ; }
|
org . junit . Assert . assertEquals ( RelationSection . NONE , org . kie . workbench . common . dmn . client . editors . expressions . types . relation . RelationUIModelMapperHelper . getSection ( relation , ( - 1 ) ) )
|
testXmlCalendarZ ( ) { java . lang . String NS = "http://example.org/rdf/" ; int OFFSET = ( ( java . util . TimeZone . getDefault ( ) . getOffset ( new java . sql . Date ( 2007 , java . util . Calendar . NOVEMBER , 6 ) . getTime ( ) ) ) / 1000 ) / 60 ; java . lang . String SELECT_BY_DATE = "SELECT<sp>?s<sp>?d<sp>WHERE<sp>{<sp>?s<sp><http://www.w3.org/1999/02/22-rdf-syntax-ns#value><sp>?d<sp>.<sp>FILTER<sp>(?d<sp><=<sp>?date)<sp>}" ; javax . xml . datatype . DatatypeFactory data = javax . xml . datatype . DatatypeFactory . newInstance ( ) ; for ( int i = 1 ; i < 5 ; i ++ ) { org . eclipse . rdf4j . model . IRI uri = vf . createIRI ( NS , ( "date" + i ) ) ; javax . xml . datatype . XMLGregorianCalendar xcal = data . newXMLGregorianCalendar ( ) ; xcal . setYear ( 2000 ) ; xcal . setMonth ( 11 ) ; xcal . setDay ( ( i * 2 ) ) ; testCon . add ( uri , RDF . VALUE , vf . createLiteral ( xcal ) ) ; org . eclipse . rdf4j . model . IRI uriz = vf . createIRI ( NS , ( "dateZ" + i ) ) ; xcal = data . newXMLGregorianCalendar ( ) ; xcal . setYear ( 2007 ) ; xcal . setMonth ( 11 ) ; xcal . setDay ( ( i * 2 ) ) ; xcal . setTimezone ( OFFSET ) ; testCon . add ( uriz , RDF . VALUE , vf . createLiteral ( xcal ) ) ; } javax . xml . datatype . XMLGregorianCalendar xcal = data . newXMLGregorianCalendar ( ) ; xcal . setYear ( 2007 ) ; xcal . setMonth ( 11 ) ; xcal . setDay ( 6 ) ; xcal . setTimezone ( OFFSET ) ; org . eclipse . rdf4j . query . TupleQuery query = testCon . prepareTupleQuery ( QueryLanguage . SPARQL , SELECT_BY_DATE ) ; query . setBinding ( "date" , vf . createLiteral ( xcal ) ) ; org . eclipse . rdf4j . query . TupleQueryResult result = query . evaluate ( ) ; java . util . List < org . eclipse . rdf4j . query . BindingSet > list = new java . util . ArrayList < org . eclipse . rdf4j . query . BindingSet > ( ) ; while ( result . hasNext ( ) ) { list . add ( result . next ( ) ) ; } "<AssertPlaceHolder>" ; } size ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 7 , list . size ( ) )
|
testBuildAndSerializePackagesWithGlobalMethodInLHS ( ) { java . lang . String drl = "package<sp>com.sample\n" + ( ( ( ( ( ( "import<sp>org.drools.compiler.Person\n" + "global<sp>org.drools.compiler.MyUtil<sp>myUtil\n" ) + "rule<sp>R1\n" ) + "when\n" ) + "<sp>Person(myUtil.transform(name)<sp>==<sp>\"John-san\")\n" ) + "then\n" ) + ")\n" 0 ) ; org . kie . internal . builder . KnowledgeBuilder builder1 = org . kie . internal . builder . KnowledgeBuilderFactory . newKnowledgeBuilder ( ) ; builder1 . add ( org . kie . internal . io . ResourceFactory . newByteArrayResource ( drl . getBytes ( ) ) , ResourceType . DRL ) ; java . util . Collection < org . kie . api . definition . KiePackage > knowledgePackages = builder1 . getKnowledgePackages ( ) ; byte [ ] pkgBin = null ; try ( java . io . ByteArrayOutputStream byteOutStream = new java . io . ByteArrayOutputStream ( ) ; org . drools . core . common . DroolsObjectOutputStream out = new org . drools . core . common . DroolsObjectOutputStream ( byteOutStream ) ) { out . writeObject ( knowledgePackages ) ; out . flush ( ) ; pkgBin = byteOutStream . toByteArray ( ) ; } org . kie . internal . builder . KnowledgeBuilder builder2 = org . kie . internal . builder . KnowledgeBuilderFactory . newKnowledgeBuilder ( ) ; builder2 . add ( org . kie . internal . io . ResourceFactory . newByteArrayResource ( pkgBin ) , ResourceType . PKG ) ; org . kie . api . KieBase kbase = builder2 . newKieBase ( ) ; org . kie . api . runtime . KieSession ksession = kbase . newKieSession ( ) ; try { ksession . setGlobal ( "myUtil" , new org . drools . compiler . integrationtests . org . drools . compiler . MyUtil ( ) ) ; ksession . insert ( new org . drools . compiler . integrationtests . org . drools . compiler . Person ( "John" ) ) ; int fired = ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } finally { ksession . dispose ( ) ; } } fireAllRules ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 1 , fired )
|
isAllowed_hasOnlyWanAndWanNotAllowed_policyIsFalse ( ) { setupConnectivity ( true , false , true ) ; com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . delivery . policy . ConnectivityPolicy target = new com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . delivery . policy . ConnectivityPolicy ( mockContext , false ) ; "<AssertPlaceHolder>" ; } isAllowed ( ) { boolean allowed = false ; boolean canTrasmitOnWAN = ( context . getConfiguration ( ) . optBoolean ( com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . delivery . policy . ConnectivityPolicy . ALLOW_WAN_KEY , com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . delivery . policy . ConnectivityPolicy . ALLOW_WAN_DEFAULT ) ) && ( isWanAllowed ) ; if ( connectivity . isConnected ( ) ) { allowed = ( ( connectivity . hasWifi ( ) ) || ( connectivity . hasWired ( ) ) ) || ( ( connectivity . hasWAN ( ) ) && canTrasmitOnWAN ) ; } return allowed ; }
|
org . junit . Assert . assertThat ( target . isAllowed ( ) , org . hamcrest . Matchers . is ( false ) )
|
testGetBusinessObjectDefinitionNotIncludeUpdateHistory ( ) { org . finra . herd . model . api . xml . BusinessObjectDefinitionKey businessObjectDefinitionKey = new org . finra . herd . model . api . xml . BusinessObjectDefinitionKey ( BDEF_NAMESPACE , BDEF_NAME ) ; org . finra . herd . model . api . xml . BusinessObjectDefinition businessObjectDefinition = new org . finra . herd . model . api . xml . BusinessObjectDefinition ( ID , BDEF_NAMESPACE , BDEF_NAME , DATA_PROVIDER_NAME , BDEF_DESCRIPTION , SHORT_DESCRIPTION , BDEF_DISPLAY_NAME , java . util . Arrays . asList ( new org . finra . herd . model . api . xml . Attribute ( ATTRIBUTE_NAME_1_MIXED_CASE , ATTRIBUTE_VALUE_1 ) ) , new org . finra . herd . model . api . xml . DescriptiveBusinessObjectFormat ( FORMAT_USAGE_CODE , FORMAT_FILE_TYPE_CODE , FORMAT_VERSION ) , java . util . Arrays . asList ( new org . finra . herd . model . api . xml . SampleDataFile ( DIRECTORY_PATH , FILE_NAME ) ) , CREATED_BY , UPDATED_BY , UPDATED_ON , NO_BUSINESS_OBJECT_DEFINITION_CHANGE_EVENTS ) ; when ( businessObjectDefinitionService . getBusinessObjectDefinition ( businessObjectDefinitionKey , org . finra . herd . rest . NOT_INCLUDE_BUSINESS_OBJECT_DEFINITION_UPDATE_HISTORY ) ) . thenReturn ( businessObjectDefinition ) ; org . finra . herd . model . api . xml . BusinessObjectDefinition result = businessObjectDefinitionRestController . getBusinessObjectDefinition ( org . finra . herd . rest . BDEF_NAMESPACE , org . finra . herd . rest . BDEF_NAME , org . finra . herd . rest . NOT_INCLUDE_BUSINESS_OBJECT_DEFINITION_UPDATE_HISTORY ) ; verify ( businessObjectDefinitionService ) . getBusinessObjectDefinition ( businessObjectDefinitionKey , org . finra . herd . rest . NOT_INCLUDE_BUSINESS_OBJECT_DEFINITION_UPDATE_HISTORY ) ; verifyNoMoreInteractions ( businessObjectDefinitionService ) ; "<AssertPlaceHolder>" ; } getBusinessObjectDefinition ( org . finra . herd . model . api . xml . BusinessObjectDefinitionKey , java . lang . Boolean ) { return getBusinessObjectDefinitionImpl ( businessObjectDefinitionKey , includeBusinessObjectDefinitionUpdateHistory ) ; }
|
org . junit . Assert . assertEquals ( businessObjectDefinition , result )
|
testGetImplementation ( org . apache . servicecomb . provider . pojo . schema . PojoProducers ) { lPojoSchemaMeta . setImplementation ( "implementation" ) ; mockit . Deencapsulation . setField ( lPojoSchemaMeta , "pojoProducers" , producers ) ; lPojoSchemaMeta . afterPropertiesSet ( ) ; "<AssertPlaceHolder>" ; } getImplementation ( ) { return implementation ; }
|
org . junit . Assert . assertEquals ( "implementation" , lPojoSchemaMeta . getImplementation ( ) )
|
testComplete ( ) { com . yahoo . hive . udf . funnel . Merge udaf = new com . yahoo . hive . udf . funnel . Merge ( ) ; org . apache . hadoop . hive . serde2 . objectinspector . ObjectInspector [ ] inputObjectInspectorList = new org . apache . hadoop . hive . serde2 . objectinspector . ObjectInspector [ ] { org . apache . hadoop . hive . serde2 . objectinspector . ObjectInspectorFactory . getStandardListObjectInspector ( PrimitiveObjectInspectorFactory . javaLongObjectInspector ) } ; org . apache . hadoop . hive . ql . udf . generic . GenericUDAFParameterInfo paramInfo = new org . apache . hadoop . hive . ql . udf . generic . SimpleGenericUDAFParameterInfo ( inputObjectInspectorList , false , false ) ; org . apache . hadoop . hive . ql . udf . generic . GenericUDAFEvaluator udafEvaluator = udaf . getEvaluator ( paramInfo ) ; org . apache . hadoop . hive . serde2 . objectinspector . ObjectInspector outputObjectInspector = udafEvaluator . init ( Mode . COMPLETE , inputObjectInspectorList ) ; java . util . List < java . lang . Long > funnel1 = new java . util . ArrayList ( ) ; funnel1 . add ( 1L ) ; funnel1 . add ( 1L ) ; funnel1 . add ( 0L ) ; java . util . List < java . lang . Long > funnel2 = new java . util . ArrayList ( ) ; funnel2 . add ( 1L ) ; funnel2 . add ( 0L ) ; funnel2 . add ( 0L ) ; java . lang . Object [ ] parameters1 = new java . lang . Object [ ] { null } ; java . lang . Object [ ] parameters2 = new java . lang . Object [ ] { funnel1 } ; java . lang . Object [ ] parameters3 = new java . lang . Object [ ] { funnel2 } ; org . apache . hadoop . hive . ql . udf . generic . GenericUDAFEvaluator . AggregationBuffer agg = udafEvaluator . getNewAggregationBuffer ( ) ; udafEvaluator . reset ( agg ) ; udafEvaluator . iterate ( agg , parameters1 ) ; udafEvaluator . iterate ( agg , parameters2 ) ; udafEvaluator . iterate ( agg , parameters3 ) ; java . lang . Object result = udafEvaluator . terminate ( agg ) ; java . util . List < java . lang . Long > expected = new java . util . ArrayList ( ) ; expected . add ( 2L ) ; expected . add ( 1L ) ; expected . add ( 0L ) ; "<AssertPlaceHolder>" ; } terminate ( com . yahoo . hive . udf . funnel . AggregationBuffer ) { com . yahoo . hive . udf . funnel . FunnelAggregateBuffer funnelAggregate = ( ( com . yahoo . hive . udf . funnel . FunnelAggregateBuffer ) ( aggregate ) ) ; return funnelAggregate . computeFunnel ( ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testEquality ( ) { org . nzbhydra . mapping . SemanticVersion v1 = new org . nzbhydra . mapping . SemanticVersion ( "1.2.3-alpha.1+build.2" ) ; org . nzbhydra . mapping . SemanticVersion v2 = new org . nzbhydra . mapping . SemanticVersion ( "1.2.3-alpha.1+build.2" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( v1 , v2 )
|
test_openOutputStream_notExists ( ) { final java . io . File file = new java . io . File ( getTestDirectory ( ) , "a/test.txt" ) ; try ( java . io . FileOutputStream out = org . apache . commons . io . FileUtils . openOutputStream ( file ) ) { out . write ( 0 ) ; } "<AssertPlaceHolder>" ; } write ( char [ ] ) { throw new java . io . UnsupportedEncodingException ( "Bah" ) ; }
|
org . junit . Assert . assertTrue ( file . exists ( ) )
|
testSetupLayout ( ) { org . talend . daikon . properties . presentation . Form mainForm = properties . getForm ( Form . MAIN ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( mainForm )
|
testCreateSnapshot ( ) { try { com . fit2cloud . aliyun . ecs . model . request . CreateSnapshotRequest r = new com . fit2cloud . aliyun . ecs . model . request . CreateSnapshotRequest ( "d-25p39du6w" ) ; r . setDescription ( "test<sp>snapshots" ) ; r . setSnapshotName ( "TestSnapshot" ) ; com . fit2cloud . aliyun . ecs . model . response . CreateSnapshotResponse response = client . createSnapshot ( r ) ; System . out . println ( ( "testCreateSnapshot<sp>::<sp>" + response ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } createSnapshot ( com . fit2cloud . aliyun . ecs . model . request . CreateSnapshotRequest ) { return gson . fromJson ( request . execute ( "CreateSnapshot" , createSnapshotRequest . toMap ( ) ) , com . fit2cloud . aliyun . ecs . model . response . CreateSnapshotResponse . class ) ; }
|
org . junit . Assert . assertTrue ( true )
|
testNotDuplicatedDisplayedMnemonic ( ) { es . gob . afirma . ui . wizardcifradoclave . PanelClaveCifradoAccessibilityTest . logger . info ( "testNotDuplicatedDisplayedMnemonic" ) ; final es . gob . afirma . ui . wizardcifradoclave . PanelClaveCifrado panelClaveCifrado = new es . gob . afirma . ui . wizardcifradoclave . PanelClaveCifrado ( "" , "" ) ; final java . util . List < java . lang . Integer > keyCodes = new java . util . ArrayList ( ) ; java . util . Set < java . lang . Integer > keyCodesSet = null ; final java . awt . Component [ ] components = panelClaveCifrado . getComponents ( ) ; for ( final java . awt . Component componentWizard : components ) { if ( componentWizard instanceof javax . swing . JRootPane ) { final java . awt . Component [ ] componentsRootPane = ( ( javax . swing . JRootPane ) ( componentWizard ) ) . getComponents ( ) ; for ( final java . awt . Component componentRootPane : componentsRootPane ) { if ( componentRootPane instanceof javax . swing . JPanel ) { getKeyCodeList ( ( ( javax . swing . JPanel ) ( componentRootPane ) ) , keyCodes ) ; } else if ( componentRootPane instanceof javax . swing . JLayeredPane ) { final java . awt . Component [ ] componentsLayeredPane = ( ( javax . swing . JLayeredPane ) ( componentRootPane ) ) . getComponents ( ) ; for ( final java . awt . Component componentLayeredPane : componentsLayeredPane ) { if ( componentLayeredPane instanceof javax . swing . JPanel ) { getKeyCodeList ( ( ( javax . swing . JPanel ) ( componentLayeredPane ) ) , keyCodes ) ; } } } } } } keyCodesSet = new java . util . HashSet ( keyCodes ) ; "<AssertPlaceHolder>" ; } getKeyCodeList ( javax . swing . JPanel , java . util . List ) { final java . awt . Component [ ] components = panel . getComponents ( ) ; int keyCode = 0 ; for ( int i = 0 ; i < ( components . length ) ; i ++ ) { final java . awt . Component component = panel . getComponent ( i ) ; if ( ! ( component instanceof javax . swing . JPanel ) ) { if ( component instanceof javax . swing . JLabel ) { final javax . swing . JLabel label = ( ( javax . swing . JLabel ) ( component ) ) ; keyCode = label . getDisplayedMnemonic ( ) ; if ( keyCode != 0 ) { keyCodeList . add ( new java . lang . Integer ( keyCode ) ) ; } } else if ( component instanceof javax . swing . JButton ) { final javax . swing . JButton button = ( ( javax . swing . JButton ) ( component ) ) ; keyCode = button . getMnemonic ( ) ; if ( keyCode != 0 ) { keyCodeList . add ( new java . lang . Integer ( keyCode ) ) ; } } else if ( component instanceof javax . swing . JCheckBox ) { final javax . swing . JCheckBox checkBox = ( ( javax . swing . JCheckBox ) ( component ) ) ; keyCode = checkBox . getMnemonic ( ) ; if ( keyCode != 0 ) { keyCodeList . add ( new java . lang . Integer ( keyCode ) ) ; } } } else { getKeyCodeList ( ( ( javax . swing . JPanel ) ( component ) ) , keyCodeList ) ; } }
|
org . junit . Assert . assertTrue ( ( ( keyCodesSet . size ( ) ) == ( keyCodes . size ( ) ) ) )
|
testMultipleSegments_Version23 ( ) { ca . uhn . hl7v2 . model . v23 . message . ACK response = new ca . uhn . hl7v2 . model . v23 . message . ACK ( ) ; ca . uhn . hl7v2 . util . Terser t = new ca . uhn . hl7v2 . util . Terser ( response ) ; t . set ( "MSH-1" , "|" ) ; t . set ( "MSH-2" , "MSH-4" 4 ) ; t . set ( "MSH-3" , "X" ) ; t . set ( "MSH-4" , "Y" ) ; t . set ( "MSH-9-1" , "MSH-4" 0 ) ; t . set ( "MSH-9-2" , "MSH-4" 7 ) ; t . set ( "MSH-4" 6 , "MSH-4" 1 ) ; t . set ( "MSH-12" , "MSH-4" 2 ) ; org . openehealth . ipf . modules . hl7 . CompositeHL7v2Exception ex0 = new org . openehealth . ipf . modules . hl7 . CompositeHL7v2Exception ( "MSH-4" 5 , new org . openehealth . ipf . modules . hl7 . HL7v2Exception [ ] { ex1 , ex2 , ex3 } ) ; ex0 . populateMessage ( response , AckTypeCode . AE ) ; java . lang . String result = p . encode ( response ) ; "<AssertPlaceHolder>" ; } encode ( ca . uhn . hl7v2 . model . Composite ) { return org . openehealth . ipf . commons . ihe . xds . core . metadata . XdsHl7v2Renderer . encodeComposite ( composite , org . openehealth . ipf . commons . ihe . xds . core . metadata . XdsHl7v2Renderer . ENCODING_CHARACTERS . getComponentSeparator ( ) ) ; }
|
org . junit . Assert . assertTrue ( result . contains ( "MSH-4" 3 ) )
|
testInplaceOp1 ( ) { lombok . val arrayX = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) ; lombok . val arrayY = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) ; arrayX . assign ( 4.0 ) ; arrayY . assign ( 2.0 ) ; lombok . val exp = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) . assign ( 6.0 ) ; org . nd4j . linalg . api . ops . CustomOp op = org . nd4j . linalg . api . ops . DynamicCustomOp . builder ( "add" ) . addInputs ( arrayX , arrayY ) . callInplace ( true ) . build ( ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( op ) ; "<AssertPlaceHolder>" ; } exec ( java . lang . String ) { code = org . datavec . python . PythonExecutioner . getFunctionalCode ( ( "__f_" + ( java . lang . Thread . currentThread ( ) . getId ( ) ) ) , code ) ; org . datavec . python . PythonExecutioner . acquireGIL ( ) ; log . info ( "CPython:<sp>PyRun_SimpleStringFlag()" ) ; log . info ( code ) ; int result = PyRun_SimpleStringFlags ( code , null ) ; if ( result != 0 ) { PyErr_Print ( ) ; throw new java . lang . RuntimeException ( "exec<sp>failed" ) ; } log . info ( "Exec<sp>done" ) ; org . datavec . python . PythonExecutioner . releaseGIL ( ) ; }
|
org . junit . Assert . assertEquals ( exp , arrayX )
|
update ( ) { int size = 100 ; byte [ ] bytes = new byte [ size ] ; random . nextBytes ( bytes ) ; com . cetsoft . imcache . offheap . bytebuffer . Pointer pointer = bufferStore . store ( bytes ) ; byte [ ] expectedBytes = new byte [ size ] ; random . nextBytes ( expectedBytes ) ; pointer = bufferStore . update ( pointer , expectedBytes ) ; byte [ ] actualBytes = bufferStore . retrieve ( pointer ) ; "<AssertPlaceHolder>" ; } retrieve ( com . cetsoft . imcache . offheap . bytebuffer . Pointer ) { return pointer . getOffHeapByteBuffer ( ) . retrieve ( pointer ) ; }
|
org . junit . Assert . assertArrayEquals ( expectedBytes , actualBytes )
|
test01 ( ) { int v ; org . fnlp . app . num . Loc loc = new org . fnlp . app . num . Loc ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { v = ( ( int ) ( ( java . lang . Math . random ( ) ) * 2147483647 ) ) ; loc . v = 0 ; "<AssertPlaceHolder>" ; System . out . println ( ( ( ( v + "\n" ) + ( expr . num2Chn ( v ) ) ) + "\n" ) ) ; } } chn2Num ( java . lang . String , org . fnlp . app . num . Loc ) { int tempNum ; int num = 0 ; int init = loc . v ; int init2 = loc . v ; int flag = 63 ; int len = str . length ( ) ; int chr ; while ( init < len ) { if ( ( ( flag & 2 ) > 0 ) && ( ( str . charAt ( init ) ) == '' ) ) { flag &= 63 - 14 ; tempNum = 10 ; init ++ ; } else { if ( ( flag & 1 ) == 0 ) { loc . v = init ; break ; } flag -= 1 ; tempNum = chn2Num ( str . charAt ( init ) ) ; if ( tempNum < 0 ) { loc . v = init ; break ; } init ++ ; if ( tempNum == 0 ) { flag |= 1 ; continue ; } if ( init >= len ) { loc . v = init ; num += tempNum ; break ; } chr = str . charAt ( init ) ; if ( ( ( flag & 2 ) > 0 ) && ( chr == '' ) ) { flag &= 63 - 14 ; flag |= 1 ; tempNum *= 10 ; init ++ ; } else if ( ( ( flag & 4 ) > 0 ) && ( chr == '' ) ) { flag &= 63 - 12 ; flag |= 1 ; tempNum *= 100 ; init ++ ; } else if ( ( ( flag & 8 ) > 0 ) && ( chr == '' ) ) { flag &= 63 - 8 ; flag |= 1 ; tempNum *= 1000 ; init ++ ; } } num += tempNum ; if ( init < len ) { chr = str . charAt ( init ) ; if ( ( ( flag & 16 ) > 0 ) && ( chr == '' ) ) { flag = 15 ; num *= 10000 ; init ++ ; loc . v = init ; int numNext = this . chn2Num ( str , loc ) ; if ( numNext > 0 ) num += numNext ; break ; } else if ( ( ( flag & 32 ) > 0 ) && ( chr == '' ) ) { flag = 31 ; num *= 100000000 ; init ++ ; loc . v = init ; int numNext = this . chn2Num ( str , loc ) ; if ( numNext > 0 ) num += numNext ; break ; } } continue ; } if ( init2 != init ) return num ; else return - 1 ; }
|
org . junit . Assert . assertTrue ( ( ( expr . chn2Num ( expr . num2Chn ( v ) , loc ) ) == v ) )
|
normalUsageCase003 ( ) { processedUsages = usageRollupProcessor . processRecords ( allUsageRecordsInOrder , hourToRollup , lbsActiveDuringHour ) ; "<AssertPlaceHolder>" ; org . openstack . atlas . service . domain . entities . Usage actualUsage = processedUsages . get ( 0 ) ; org . openstack . atlas . usagerefactor . junit . AssertUsage . hasValues ( null , 1234 , 1234 , 50L , 0L , 100L , 0L , 0.5 , 0.0 , "2013-04-10<sp>20:23:59" , "2013-04-10<sp>20:24:59" , 2 , 1 , 0 , org . openstack . atlas . usagerefactor . CREATE_LOADBALANCER . name ( ) , 0 , true , null , actualUsage ) ; actualUsage = processedUsages . get ( 1 ) ; org . openstack . atlas . usagerefactor . junit . AssertUsage . hasValues ( null , 1234 , 1234 , 350L , 350L , 700L , 700L , 1.0 , 1.0 , "2013-04-10<sp>20:24:59" , "2013-04-10<sp>21:00:00" , 7 , 1 , 5 , org . openstack . atlas . usagerefactor . SSL_MIXED_ON . name ( ) , 0 , true , null , actualUsage ) ; } size ( ) { return size ; }
|
org . junit . Assert . assertEquals ( 2 , processedUsages . size ( ) )
|
testGetRoom ( ) { com . github . hipchat . api . HipChat hipchat = new com . github . hipchat . api . HipChat ( com . github . hipchat . test . HipchatTests . HIPCHAT_KEY ) ; com . github . hipchat . api . Room room = hipchat . getRoom ( com . github . hipchat . test . HipchatTests . TEST_ROOM_ID ) ; "<AssertPlaceHolder>" ; } getRoom ( java . lang . String ) { java . lang . String query = java . lang . String . format ( HipChatConstants . ROOMS_SHOW_QUERY_FORMAT , roomId , HipChatConstants . JSON_FORMAT , authToken ) ; java . io . InputStream input = null ; com . github . hipchat . api . Room result = null ; java . net . HttpURLConnection connection = null ; try { java . net . URL requestUrl = new java . net . URL ( ( ( ( HipChatConstants . API_BASE ) + ( HipChatConstants . ROOMS_SHOW ) ) + query ) ) ; connection = ( ( java . net . HttpURLConnection ) ( requestUrl . openConnection ( ) ) ) ; connection . setDoInput ( true ) ; input = connection . getInputStream ( ) ; result = com . github . hipchat . api . RoomParser . parseRoom ( this , input ) ; } catch ( java . net . MalformedURLException e ) { e . printStackTrace ( ) ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } finally { org . apache . commons . io . IOUtils . closeQuietly ( input ) ; connection . disconnect ( ) ; } return result ; }
|
org . junit . Assert . assertNotNull ( room )
|
testEquals ( ) { ast . Let reference = new ast . Let ( new ast . Variable ( "z" ) , new ast . Variable ( "x" ) , new ast . Variable ( "y" ) ) ; ast . Let toTest = new ast . Let ( new ast . Variable ( "z" ) , new ast . Variable ( "x" ) , new ast . Variable ( "y" ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( reference , toTest )
|
testGetStartChainID ( ) { org . openscience . cdk . interfaces . IPDBStructure structure = org . openscience . cdk . interfaces . AbstractPDBStructureTest . getBuilder ( ) . newInstance ( org . openscience . cdk . interfaces . IPDBStructure . class ) ; "<AssertPlaceHolder>" ; } getStartChainID ( ) { return startChainID ; }
|
org . junit . Assert . assertNull ( structure . getStartChainID ( ) )
|
testList ( ) { java . lang . String displayname = "XXXStuff2" ; java . lang . String vocabtype = "languages" ; java . lang . String testfield = "displayName" ; org . json . JSONObject data = new org . json . JSONObject ( ( ( ( ( "{'fields':{'" + testfield ) + "':'" ) + displayname ) + "XXXStuff2" 1 ) ) ; org . mortbay . jetty . testing . HttpTester out = org . collectionspace . chain . csp . persistence . services . vocab . TestVocabThroughWebapp . tester . POSTData ( ( ( "/vocabularies/" + vocabtype ) + "/" ) , data , org . collectionspace . chain . csp . persistence . services . vocab . TestVocabThroughWebapp . jetty ) ; java . lang . String url = out . getHeader ( "XXXStuff2" 0 ) ; int resultsize = 1 ; int pagenum = 0 ; java . lang . String checkpagination = "" ; boolean found = false ; while ( resultsize > 0 ) { out = org . collectionspace . chain . csp . persistence . services . vocab . TestVocabThroughWebapp . tester . GETData ( ( ( ( "/vocabularies/" + vocabtype ) + "XXXStuff2" 2 ) + pagenum ) , org . collectionspace . chain . csp . persistence . services . vocab . TestVocabThroughWebapp . jetty ) ; pagenum ++ ; org . json . JSONArray results = new org . json . JSONObject ( out . getContent ( ) ) . getJSONArray ( "items" ) ; if ( ( ( results . length ( ) ) == 0 ) || ( checkpagination . equals ( results . getJSONObject ( 0 ) . getString ( "csid" ) ) ) ) { resultsize = 0 ; break ; } checkpagination = results . getJSONObject ( 0 ) . getString ( "csid" ) ; for ( int i = 0 ; i < ( results . length ( ) ) ; i ++ ) { org . json . JSONObject entry = results . getJSONObject ( i ) ; if ( entry . getString ( testfield ) . toLowerCase ( ) . contains ( displayname . toLowerCase ( ) ) ) { found = true ; resultsize = 0 ; } } } "<AssertPlaceHolder>" ; org . collectionspace . chain . csp . persistence . services . vocab . TestVocabThroughWebapp . tester . DELETEData ( ( "/vocabularies/" + url ) , org . collectionspace . chain . csp . persistence . services . vocab . TestVocabThroughWebapp . jetty ) ; } getString ( java . lang . String ) { if ( allStrings . containsKey ( name ) ) { return allStrings . get ( name ) ; } return null ; }
|
org . junit . Assert . assertTrue ( found )
|
shouldProvidemtpyListForInvalidURI ( ) { java . util . Collection < org . eclipse . smarthome . config . core . ParameterOption > parameterOptions = magicService . getParameterOptions ( java . net . URI . create ( "system.audio" ) , org . eclipse . smarthome . magic . binding . internal . MagicServiceImplTest . PARAMETER_NAME , null , null ) ; "<AssertPlaceHolder>" ; } create ( org . eclipse . smarthome . automation . Module ) { if ( module instanceof org . eclipse . smarthome . automation . Action ) { return ( ( org . eclipse . smarthome . automation . core . util . ModuleBuilder < B , T > ) ( org . eclipse . smarthome . automation . core . util . ModuleBuilder . createAction ( ( ( org . eclipse . smarthome . automation . Action ) ( module ) ) ) ) ) ; } else if ( module instanceof org . eclipse . smarthome . automation . Condition ) { return ( ( org . eclipse . smarthome . automation . core . util . ModuleBuilder < B , T > ) ( org . eclipse . smarthome . automation . core . util . ModuleBuilder . createCondition ( ( ( org . eclipse . smarthome . automation . Condition ) ( module ) ) ) ) ) ; } else if ( module instanceof org . eclipse . smarthome . automation . Trigger ) { return ( ( org . eclipse . smarthome . automation . core . util . ModuleBuilder < B , T > ) ( org . eclipse . smarthome . automation . core . util . ModuleBuilder . createTrigger ( ( ( org . eclipse . smarthome . automation . Trigger ) ( module ) ) ) ) ) ; } else { throw new java . lang . IllegalArgumentException ( "Parameter<sp>must<sp>be<sp>an<sp>instance<sp>of<sp>Action,<sp>Condition<sp>or<sp>Trigger." ) ; } }
|
org . junit . Assert . assertNull ( parameterOptions )
|
testCurrentTime ( ) { com . navercorp . pinpoint . common . buffer . Buffer buffer = new com . navercorp . pinpoint . common . buffer . AutomaticBuffer ( 32 ) ; long l = java . lang . System . currentTimeMillis ( ) ; buffer . putSVLong ( l ) ; logger . trace ( "currentTime<sp>size:{}" , buffer . getOffset ( ) ) ; buffer . setOffset ( 0 ) ; "<AssertPlaceHolder>" ; } readSVLong ( ) { return com . navercorp . pinpoint . common . util . BytesUtils . zigzagToLong ( readVLong ( ) ) ; }
|
org . junit . Assert . assertEquals ( buffer . readSVLong ( ) , l )
|
testReadPeerReviewSchemaValidate ( ) { org . orcid . jaxb . test . utils . OrcidTranslator < org . orcid . jaxb . model . v3 . rc1 . record . PeerReview > t = org . orcid . jaxb . test . utils . OrcidTranslator . forSchema ( SchemaVersion . V3_0RC1_PEER_REVIEW ) ; java . io . Reader reader = new java . io . InputStreamReader ( getClass ( ) . getResourceAsStream ( "/record_3.0_rc1/samples/read_samples/peer-review-3.0_rc1.xml" ) ) ; org . orcid . jaxb . model . v3 . rc1 . record . PeerReview p = t . readXmlRecord ( reader ) ; "<AssertPlaceHolder>" ; } readXmlRecord ( java . io . Reader ) { return ( ( T ) ( unmarshaller . unmarshal ( reader ) ) ) ; }
|
org . junit . Assert . assertNotNull ( p )
|
matrixFromListTest ( ) { java . lang . String matrixString = "1<sp>2\n3<sp>4\n5<sp>6" ; org . languagetool . rules . neuralnetwork . Matrix expectedMatrix = new org . languagetool . rules . neuralnetwork . Matrix ( new float [ ] [ ] { new float [ ] { 1 , 2 } , new float [ ] { 3 , 4 } , new float [ ] { 5 , 6 } } ) ; org . languagetool . rules . neuralnetwork . Matrix matrix = new org . languagetool . rules . neuralnetwork . Matrix ( java . util . Arrays . asList ( matrixString . split ( "\n" ) ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( expectedMatrix , matrix )
|
writeServiceFunction ( ) { org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunction data = buildTestServiceFunction ( ) ; iosXeDataStoreAPI = new org . opendaylight . sfc . renderers . iosxe . utils . IosXeDataStoreAPI ( mountpoint , data , WRITE_FUNCTION , org . opendaylight . controller . md . sal . common . api . data . LogicalDatastoreType . CONFIGURATION ) ; boolean result = ( ( boolean ) ( iosXeDataStoreAPI . call ( ) ) ) ; "<AssertPlaceHolder>" ; } call ( ) { switch ( currentTransaction ) { case WRITE_FUNCTION : { try { com . google . common . base . Preconditions . checkNotNull ( data ) ; org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunction serviceFunction = ( ( org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunction ) ( data ) ) ; org . opendaylight . yangtools . yang . binding . InstanceIdentifier < org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunction > serviceFunctionIid = org . opendaylight . sfc . renderers . iosxe . utils . SfcIosXeUtils . createSfIid ( serviceFunction . key ( ) ) ; return writeMergeTransaction ( serviceFunctionIid , serviceFunction ) ; } catch ( java . lang . ClassCastException e ) { org . opendaylight . sfc . renderers . iosxe . utils . IosXeDataStoreAPI . LOG . error ( "Argument<sp>data<sp>{}<sp>is<sp>not<sp>an<sp>instance<sp>of<sp>ServiceFunction" , data , e ) ; } break ; } case READ_FUNCTION : { try { com . google . common . base . Preconditions . checkNotNull ( data ) ; org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . common . rev151017 . SfName serviceFunction = ( ( org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . common . rev151017 . SfName ) ( data ) ) ; org . opendaylight . yangtools . yang . binding . InstanceIdentifier < org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunction > serviceFunctionIid = org . opendaylight . sfc . renderers . iosxe . utils . SfcIosXeUtils . createSfIid ( new org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunctionKey ( serviceFunction . getValue ( ) ) ) ; return readTransaction ( serviceFunctionIid ) ; } catch ( java . lang . ClassCastException e ) { org . opendaylight . sfc . renderers . iosxe . utils . IosXeDataStoreAPI . LOG . error ( "Argument<sp>data<sp>{}<sp>is<sp>not<sp>an<sp>instance<sp>of<sp>ServiceFunction" , data , e ) ; } break ; } case DELETE_FUNCTION : { try { com . google . common . base . Preconditions . checkNotNull ( data ) ; org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunctionKey serviceFunctionKey = ( ( org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunctionKey ) ( data ) ) ; org . opendaylight . yangtools . yang . binding . InstanceIdentifier < org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . ServiceFunction > serviceFunctionIid = org . opendaylight . sfc . renderers . iosxe . utils . SfcIosXeUtils . createSfIid ( serviceFunctionKey ) ; return deleteTransaction ( serviceFunctionIid ) ; } catch ( java . lang . ClassCastException e ) { org . opendaylight . sfc . renderers . iosxe . utils . IosXeDataStoreAPI . LOG . error ( "Argument<sp>data<sp>{}<sp>is<sp>not<sp>an<sp>instance<sp>of<sp>ServiceFunction" , data , e ) ; } break ; } case WRITE_LOCAL : { try { com . google . common . base . Preconditions . checkNotNull ( data ) ; org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . service . function . forwarder . Local localSff = ( ( org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . service . function . forwarder . Local ) ( data ) ) ; org . opendaylight . yangtools . yang . binding . InstanceIdentifier < org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . service . function . forwarder . Local > localIid = org . opendaylight . sfc . renderers . iosxe . utils . SfcIosXeUtils . createLocalSffIid ( ) ; return writeMergeTransaction ( localIid , localSff ) ; } catch ( java . lang . ClassCastException e ) { org . opendaylight . sfc . renderers . iosxe . utils . IosXeDataStoreAPI . LOG . error ( "Argument<sp>data<sp>{}<sp>is<sp>not<sp>an<sp>instance<sp>of<sp>Local" , data , e ) ; } break ; } case READ_LOCAL : { org . opendaylight . yangtools . yang . binding . InstanceIdentifier < org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service . chain . service . function . forwarder . Local > localIid = org . opendaylight . sfc . renderers . iosxe . utils . SfcIosXeUtils . createLocalSffIid ( ) ; return readTransaction ( localIid ) ; } case DELETE_LOCAL : { org . opendaylight . yangtools . yang . binding . InstanceIdentifier < org . opendaylight . yang . gen . v1 . urn . ios . rev160308 . _native . service
|
org . junit . Assert . assertTrue ( result )
|
testImportedGrammarWithEmptyOptions ( ) { java . lang . String slave = "parser<sp>grammar<sp>S;\n" + ( "options<sp>{}\n" + "parser<sp>grammar<sp>S;\n" 2 ) ; mkdir ( tmpdir ) ; writeFile ( tmpdir , "S.g4" , slave ) ; java . lang . String master = "grammar<sp>M;\n" + ( ( ( "import<sp>S;\n" + "parser<sp>grammar<sp>S;\n" 3 ) + "B<sp>:<sp>'b'<sp>;" ) + "WS<sp>:<sp>(\'<sp>\'|\'\\n\')<sp>-><sp>skip<sp>;\n" ) ; java . lang . String found = execParser ( "M.g4" , master , "parser<sp>grammar<sp>S;\n" 4 , "parser<sp>grammar<sp>S;\n" 0 , "parser<sp>grammar<sp>S;\n" 1 , "b" , debug ) ; "<AssertPlaceHolder>" ; } execParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean ) { return execParser ( grammarFileName , grammarStr , parserName , lexerName , startRuleName , input , debug , false ) ; }
|
org . junit . Assert . assertEquals ( "" , found )
|
prepared_statement_setters_68 ( ) { org . apache . jena . jdbc . connections . JenaConnection conn = this . getConnection ( ) ; org . apache . jena . jdbc . statements . JenaPreparedStatement stmt = ( ( org . apache . jena . jdbc . statements . JenaPreparedStatement ) ( conn . prepareStatement ( "SELECT<sp>*<sp>WHERE<sp>{<sp>?s<sp>?p<sp>?<sp>}" ) ) ) ; stmt . setObject ( 1 , "test" , Types . JAVA_OBJECT ) ; org . apache . jena . query . ParameterizedSparqlString pss = stmt . getParameterizedString ( ) ; "<AssertPlaceHolder>" ; stmt . close ( ) ; conn . close ( ) ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( "ESSettings{" + "hostToPortMapping=" ) + ( hostToPortMapping ) ) + ",<sp>clusterName='" ) + ( clusterName ) ) + '\'' ) + ",<sp>shards=" ) + ( shards ) ) + ",<sp>replicas=" ) + ( replicas ) ) + ",<sp>indexName='" ) + ( indexName ) ) + '}' ; }
|
org . junit . Assert . assertTrue ( pss . toString ( ) . contains ( "test" ) )
|
testJobReExecutionAfterTaskExecutorTermination ( ) { final org . apache . flink . runtime . jobgraph . JobGraph jobGraph = createJobGraph ( org . apache . flink . runtime . taskexecutor . TaskExecutorITCase . PARALLELISM ) ; final java . util . concurrent . CompletableFuture < org . apache . flink . runtime . jobmaster . JobResult > jobResultFuture = submitJobAndWaitUntilRunning ( jobGraph ) ; miniCluster . terminateTaskExecutor ( 0 ) ; final org . apache . flink . runtime . jobmaster . JobResult jobResult = jobResultFuture . get ( ) ; "<AssertPlaceHolder>" ; miniCluster . startTaskExecutor ( ) ; org . apache . flink . runtime . taskexecutor . TaskExecutorITCase . BlockingOperator . unblock ( ) ; miniCluster . submitJob ( jobGraph ) . get ( ) ; miniCluster . requestJobResult ( jobGraph . getJobID ( ) ) . get ( ) ; } isSuccess ( ) { return ( failureCause ) == null ; }
|
org . junit . Assert . assertThat ( jobResult . isSuccess ( ) , org . hamcrest . Matchers . is ( false ) )
|
testSplit2 ( ) { final java . io . File dictFile = de . tudarmstadt . ukp . dkpro . core . api . resources . ResourceUtils . getUrlAsFile ( getClass ( ) . getResource ( "/de/tudarmstadt/ukp/dkpro/core/decompounding/lib/spelling-de-igerman98.dic" ) , false ) ; de . tudarmstadt . ukp . dkpro . core . decompounding . dictionary . SimpleDictionary dict = new de . tudarmstadt . ukp . dkpro . core . decompounding . dictionary . SimpleDictionary ( dictFile , "UTF-8" ) ; final java . io . File morphemesFile = de . tudarmstadt . ukp . dkpro . core . api . resources . ResourceUtils . getUrlAsFile ( getClass ( ) . getResource ( "/de/tudarmstadt/ukp/dkpro/core/decompounding/lib/spelling-de-linking.linking" ) , false ) ; de . tudarmstadt . ukp . dkpro . core . decompounding . dictionary . LinkingMorphemes morphemes = new de . tudarmstadt . ukp . dkpro . core . decompounding . dictionary . LinkingMorphemes ( morphemesFile ) ; de . tudarmstadt . ukp . dkpro . core . decompounding . splitter . DataDrivenSplitterAlgorithm splitter = new de . tudarmstadt . ukp . dkpro . core . decompounding . splitter . DataDrivenSplitterAlgorithm ( dict , morphemes ) ; java . util . List < de . tudarmstadt . ukp . dkpro . core . decompounding . splitter . DecompoundedWord > result = splitter . split ( "gerteelektronik" ) . getAllSplits ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return _size ; }
|
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
|
nullEmptyValues ( ) { java . util . Map < java . lang . String , java . lang . Object > requested = new java . util . HashMap ( ) ; requested . put ( CapabilityType . BROWSER_NAME , BrowserType . FIREFOX ) ; requested . put ( CapabilityType . PLATFORM_NAME , null ) ; requested . put ( CapabilityType . VERSION , "" ) ; java . util . Map < java . lang . String , java . lang . Object > node = new java . util . HashMap ( ) ; node . put ( CapabilityType . BROWSER_NAME , BrowserType . FIREFOX ) ; node . put ( CapabilityType . PLATFORM_NAME , Platform . LINUX ) ; node . put ( CapabilityType . VERSION , "3.6" ) ; "<AssertPlaceHolder>" ; } matches ( org . openqa . selenium . testing . drivers . Browser , org . openqa . selenium . testing . drivers . Browser [ ] ) { for ( org . openqa . selenium . testing . drivers . Browser item : drivers ) { if ( item == ( org . openqa . selenium . testing . drivers . Browser . ALL ) ) { return true ; } if ( item == current ) { return true ; } } return false ; }
|
org . junit . Assert . assertTrue ( matcher . matches ( node , requested ) )
|
test_addNullExclude_Ignored ( ) { includeExcludeList = de . metas . util . collections . IncludeExcludeListPredicate . < java . lang . String > builder ( ) . exclude ( null ) . build ( ) ; "<AssertPlaceHolder>" ; } empty ( ) { @ de . metas . util . collections . SuppressWarnings ( "unchecked" ) final de . metas . util . collections . IncludeExcludeListPredicate < T > emptyCasted = ( ( de . metas . util . collections . IncludeExcludeListPredicate < T > ) ( de . metas . util . collections . IncludeExcludeListPredicate . EMPTY ) ) ; return emptyCasted ; }
|
org . junit . Assert . assertSame ( de . metas . util . collections . IncludeExcludeListPredicate . empty ( ) , includeExcludeList )
|
testWriteIntegerValueThenChangeToDoubleWithDifferentPriority ( ) { java . util . List < com . google . firebase . database . DatabaseReference > refs = com . google . firebase . testing . IntegrationTestUtils . getRandomNode ( com . google . firebase . database . integration . EventTestIT . masterApp , 1 ) ; com . google . firebase . database . DatabaseReference node = refs . get ( 0 ) ; final com . google . firebase . database . integration . EventHelper readHelper = new com . google . firebase . database . integration . EventHelper ( ) . addValueExpectation ( node , 1337 ) . addValueExpectation ( node , 1337 ) . startListening ( true ) ; com . google . firebase . database . core . ZombieVerifier . verifyRepoZombies ( refs ) ; node . setValueAsync ( 1337 ) ; node . setValueAsync ( 1337.0 , 1337 ) ; com . google . firebase . database . TestHelpers . waitForRoundtrip ( node ) ; "<AssertPlaceHolder>" ; com . google . firebase . database . core . ZombieVerifier . verifyRepoZombies ( refs ) ; readHelper . cleanup ( ) ; } waitForEvents ( ) { com . google . firebase . database . TestHelpers . waitFor ( semaphore , count ) ; java . util . Iterator < com . google . firebase . database . ValueExpectationHelper . QueryAndListener > iter = expectations . iterator ( ) ; while ( iter . hasNext ( ) ) { com . google . firebase . database . ValueExpectationHelper . QueryAndListener pair = iter . next ( ) ; pair . query . removeEventListener ( pair . listener ) ; } expectations . clear ( ) ; }
|
org . junit . Assert . assertTrue ( readHelper . waitForEvents ( ) )
|
createFromNullStringUrl ( ) { "<AssertPlaceHolder>" ; } createFromUrl ( java . net . URL ) { return url != null ? org . eclipse . egit . github . core . RepositoryId . createFromId ( url . getPath ( ) ) : null ; }
|
org . junit . Assert . assertNull ( org . eclipse . egit . github . core . RepositoryId . createFromUrl ( ( ( java . lang . String ) ( null ) ) ) )
|
testStyleTagRemoving ( ) { java . lang . String html = ( "<html><head><title>Title</title>" + ( "<style<sp>type=\"text/css\">h1<sp>{color:red}<sp>p<sp>{color:blue}<sp></style>" + "</head><body>" ) ) + ( footer ) ; org . w3c . dom . Document doc = officeHTMLCleaner . clean ( new java . io . StringReader ( html ) ) ; org . w3c . dom . NodeList nodes = doc . getElementsByTagName ( "style" ) ; "<AssertPlaceHolder>" ; } getLength ( ) { return org . xwiki . extension . script . internal . safe . SafeExtensionFile . getWrapped ( ) . getLength ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , nodes . getLength ( ) )
|
testScheduleParser ( ) { com . urbanairship . api . client . ResponseParser responseParser = new com . urbanairship . api . client . ResponseParser < java . lang . String > ( ) { @ com . urbanairship . api . staticlists . Override public java . lang . String parse ( java . lang . String response ) throws java . io . IOException { return response ; } } ; "<AssertPlaceHolder>" ; } getResponseParser ( ) { return new com . urbanairship . api . client . ResponseParser < com . urbanairship . api . reports . model . ResponseReport > ( ) { @ com . urbanairship . api . reports . Override public com . urbanairship . api . reports . model . ResponseReport parse ( java . lang . String response ) throws java . io . IOException { return com . urbanairship . api . reports . parse . ReportsObjectMapper . getInstance ( ) . readValue ( response , com . urbanairship . api . reports . model . ResponseReport . class ) ; } } ; }
|
org . junit . Assert . assertEquals ( request . getResponseParser ( ) . parse ( null ) , responseParser . parse ( null ) )
|
testComplexRow ( ) { org . apache . accumulo . core . client . summary . SummarizerConfiguration sc = org . apache . accumulo . core . client . summary . SummarizerConfiguration . builder ( org . apache . accumulo . core . client . summary . summarizers . EntryLengthSummarizer . class ) . build ( ) ; org . apache . accumulo . core . client . summary . summarizers . EntryLengthSummarizer entrySum = new org . apache . accumulo . core . client . summary . summarizers . EntryLengthSummarizer ( ) ; org . apache . accumulo . core . data . Key k1 = new org . apache . accumulo . core . data . Key ( "r1" ) ; org . apache . accumulo . core . data . Key k2 = new org . apache . accumulo . core . data . Key ( "columnRow3" 5 ) ; org . apache . accumulo . core . data . Key k3 = new org . apache . accumulo . core . data . Key ( "columnRow3" ) ; org . apache . accumulo . core . client . summary . Summarizer . Collector collector = entrySum . collector ( sc ) ; collector . accept ( k1 , new org . apache . accumulo . core . data . Value ( "columnRow3" 1 ) ) ; collector . accept ( k2 , new org . apache . accumulo . core . data . Value ( "columnRow3" 1 ) ) ; collector . accept ( k3 , new org . apache . accumulo . core . data . Value ( "columnRow3" 1 ) ) ; java . util . HashMap < java . lang . String , java . lang . Long > stats = new java . util . HashMap ( ) ; collector . summarize ( stats :: put ) ; java . util . HashMap < java . lang . String , java . lang . Long > expected = new java . util . HashMap ( ) ; expected . put ( "key.min" , 2L ) ; expected . put ( "columnRow3" 4 , 10L ) ; expected . put ( "row.sum" 6 , 16L ) ; expected . put ( "row.sum" 4 , 1L ) ; expected . put ( "row.sum" 0 , 1L ) ; expected . put ( "value.min" 1 , 1L ) ; expected . put ( "columnRow3" 6 , 2L ) ; expected . put ( "row.sum" 5 , 10L ) ; expected . put ( "row.sum" , 16L ) ; expected . put ( "value.min" 0 , 1L ) ; expected . put ( "row.sum" 2 , 1L ) ; expected . put ( "columnRow3" 7 , 1L ) ; expected . put ( "columnRow3" 2 , 0L ) ; expected . put ( "row.sum" 7 , 0L ) ; expected . put ( "family.sum" , 0L ) ; expected . put ( "row.sum" 1 , 3L ) ; expected . put ( "qualifier.min" , 0L ) ; expected . put ( "row.sum" 3 , 0L ) ; expected . put ( "row.sum" 9 , 0L ) ; expected . put ( "columnRow3" 3 , 3L ) ; expected . put ( "value.min" 2 , 0L ) ; expected . put ( "columnRow3" 8 , 0L ) ; expected . put ( "columnRow3" 9 , 0L ) ; expected . put ( "visibility.logHist.0" , 3L ) ; expected . put ( "value.min" , 0L ) ; expected . put ( "row.sum" 8 , 0L ) ; expected . put ( "columnRow3" 0 , 0L ) ; expected . put ( "value.logHist.0" , 3L ) ; expected . put ( "total" , 3L ) ; "<AssertPlaceHolder>" ; } put ( java . lang . Long , org . apache . accumulo . server . tabletserver . LargestFirstMemoryManager$TabletInfo ) { if ( ( map . size ( ) ) == ( max ) ) { if ( ( key . compareTo ( map . firstKey ( ) ) ) < 0 ) return false ; try { add ( key , value ) ; return true ; } finally { map . remove ( map . firstKey ( ) ) ; } } else { add ( key , value ) ; return true ; } }
|
org . junit . Assert . assertEquals ( expected , stats )
|
and ( ) { io . robe . hibernate . criteria . api . criterion . Restriction r1 = new io . robe . hibernate . criteria . api . criterion . Restriction ( io . robe . hibernate . criteria . query . Operator . EQUALS , "name" , "Gol<sp>D.<sp>Roger" ) ; io . robe . hibernate . criteria . api . criterion . Restriction r2 = new io . robe . hibernate . criteria . api . criterion . Restriction ( io . robe . hibernate . criteria . query . Operator . IN , "age" , "3,4" ) ; io . robe . hibernate . criteria . api . criterion . Restriction expectedRestriction = new io . robe . hibernate . criteria . api . criterion . RestrictionList ( io . robe . hibernate . criteria . query . Operator . AND , new io . robe . hibernate . criteria . api . criterion . Restriction [ ] { r1 , r2 } ) ; io . robe . hibernate . criteria . api . criterion . Restriction restriction = io . robe . hibernate . criteria . api . criterion . Restrictions . and ( r1 , r2 ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( expectedRestriction , restriction )
|
isNullOrWhiteSpaceInputNull ( ) { java . lang . String value = null ; java . lang . Boolean expResult = true ; java . lang . Boolean result = com . microsoft . azure . sdk . iot . deps . util . Tools . isNullOrWhiteSpace ( value ) ; "<AssertPlaceHolder>" ; } isNullOrWhiteSpace ( java . lang . String ) { java . lang . Boolean retVal ; if ( value == null ) { retVal = true ; } else { retVal = com . microsoft . azure . sdk . iot . deps . util . Tools . isNullOrEmpty ( value . trim ( ) ) ; } return retVal ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testDeleteSafeDetail ( ) { org . linagora . linshare . mongo . entities . SafeDetail safeDetail = new org . linagora . linshare . mongo . entities . SafeDetail ( ) ; safeDetail . setContainerUuid ( workGroup . getLsUuid ( ) ) ; org . linagora . linshare . mongo . entities . SafeDetail exist = safeDetailService . create ( technicalAccount , actor , safeDetail ) ; safeDetailService . delete ( technicalAccount , actor , exist . getUuid ( ) ) ; "<AssertPlaceHolder>" ; } findAll ( boolean , java . lang . String ) { if ( all ) { return guestFacade . findAll ( null , pattern ) ; } return guestFacade . findAll ( true , pattern ) ; }
|
org . junit . Assert . assertTrue ( safeDetailService . findAll ( technicalAccount , actor ) . isEmpty ( ) )
|
testCarArray ( ) { com . baidu . unbiz . fluentvalidator . dto . Car [ ] cars = getValidCars ( ) . toArray ( new com . baidu . unbiz . fluentvalidator . dto . Car [ ] { } ) ; com . baidu . unbiz . fluentvalidator . Result ret = com . baidu . unbiz . fluentvalidator . FluentValidator . checkAll ( ) . onEach ( cars , new com . baidu . unbiz . fluentvalidator . validator . CarValidator ( ) ) . onEach ( cars , new com . baidu . unbiz . fluentvalidator . validator . CarValidator2 ( ) ) . onEach ( cars , new com . baidu . unbiz . fluentvalidator . validator . CarValidator3 ( ) ) . doValidate ( ) . result ( com . baidu . unbiz . fluentvalidator . ResultCollectors . toSimple ( ) ) ; System . out . println ( ret ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return isSuccess ; }
|
org . junit . Assert . assertThat ( ret . isSuccess ( ) , org . hamcrest . core . Is . is ( true ) )
|
setBaseListOfMixed ( ) { graphics . setBase ( listOfNumbersAndListsOfNumbers ) ; "<AssertPlaceHolder>" ; } getBases ( ) { return null ; }
|
org . junit . Assert . assertEquals ( listOfNumbersAndListsOfNumbers , graphics . getBases ( ) )
|
testGetLocation_01 ( ) { org . eclipse . n4js . projectModel . IN4JSProject project = getN4JSCore ( ) . create ( myProjectURI ) ; "<AssertPlaceHolder>" ; } getLocation ( ) { return new org . eclipse . core . runtime . Path ( file . toPath ( ) . toString ( ) ) ; }
|
org . junit . Assert . assertEquals ( myProjectURI , project . getLocation ( ) )
|
testSkipsWhenNoJsLoad ( ) { org . easymock . EasyMock . expect ( jsUri . isJsload ( ) ) . andReturn ( false ) ; response = control . createMock ( org . apache . shindig . gadgets . js . JsResponseBuilder . class ) ; control . replay ( ) ; "<AssertPlaceHolder>" ; control . verify ( ) ; } process ( org . apache . http . HttpResponse , org . apache . http . protocol . HttpContext ) { org . apache . http . HttpEntity entity = response . getEntity ( ) ; if ( entity != null ) { org . apache . http . Header ceheader = entity . getContentEncoding ( ) ; if ( ceheader != null ) { for ( org . apache . http . HeaderElement codec : ceheader . getElements ( ) ) { java . lang . String codecname = codec . getName ( ) ; if ( "gzip" . equalsIgnoreCase ( codecname ) ) { response . setEntity ( new org . apache . shindig . gadgets . http . BasicHttpFetcher . GzipDecompressingEntity ( response . getEntity ( ) ) ) ; return ; } else if ( "deflate" . equals ( codecname ) ) { response . setEntity ( new org . apache . shindig . gadgets . http . BasicHttpFetcher . DeflateDecompressingEntity ( response . getEntity ( ) ) ) ; return ; } } } } }
|
org . junit . Assert . assertTrue ( processor . process ( request , response ) )
|
testUnmarshalStructuredBean ( ) { java . lang . ClassLoader cl = getClass ( ) . getClassLoader ( ) ; java . net . URI standardPbufURI = cl . getResource ( "standard.pbuf" ) . toURI ( ) ; org . glassfish . hk2 . api . ServiceLocator locator = org . glassfish . hk2 . pbuf . test . utilities . Utilities . enableLocator ( ) ; org . glassfish . hk2 . xml . api . XmlService xmlService = locator . getService ( org . glassfish . hk2 . xml . api . XmlService . class , PBufUtilities . PBUF_SERVICE_NAME ) ; "<AssertPlaceHolder>" ; org . glassfish . hk2 . xml . api . XmlRootHandle < org . glassfish . hk2 . pbuf . test . beans . ServiceRecordBlockBean > handle = xmlService . unmarshal ( standardPbufURI , org . glassfish . hk2 . pbuf . test . beans . ServiceRecordBlockBean . class ) ; org . glassfish . hk2 . pbuf . test . basic . PBufParserTest . validateStandardBean ( handle , 0 ) ; } getService ( java . lang . reflect . Type , java . lang . annotation . Annotation [ ] ) { return internalGetService ( contractOrImpl , null , null , qualifiers ) ; }
|
org . junit . Assert . assertNotNull ( xmlService )
|
testUnsupportedType ( ) { eu . dime . ps . semantic . model . ncal . AlarmAction alarmAction = factory . getNCALFactory ( ) . createAlarmAction ( ) ; "<AssertPlaceHolder>" ; } get ( org . ontoware . rdfreactor . schema . rdfs . Resource ) { eu . dime . ps . dto . Type resultType = null ; org . ontoware . aifbcommons . collection . ClosableIterator < org . ontoware . rdf2go . model . Statement > typeIt = resource . getModel ( ) . findStatements ( resource , RDF . type , Variable . ANY ) ; while ( typeIt . hasNext ( ) ) { org . ontoware . rdf2go . model . node . Node rdfType = typeIt . next ( ) . getObject ( ) ; if ( ( rdfType instanceof org . ontoware . rdf2go . model . node . URI ) && ( ! ( rdfType . equals ( RDFS . Resource ) ) ) ) { org . ontoware . rdf2go . model . node . URI resourceType = rdfType . asURI ( ) ; if ( PPO . PrivacyPreference . equals ( resourceType ) ) { java . lang . String subtype = eu . dime . ps . dto . Type . getPrivacyPreferenceType ( resource ) ; if ( subtype != null ) { resultType = eu . dime . ps . dto . Type . lookup . get ( subtype ) ; } } else { resultType = eu . dime . ps . dto . Type . lookup . get ( resourceType . toString ( ) ) ; } if ( resultType != null ) { return resultType ; } } } typeIt . close ( ) ; return null ; }
|
org . junit . Assert . assertNull ( eu . dime . ps . dto . Type . get ( alarmAction ) )
|
testAdditive ( ) { listAppender . start ( ) ; root . addAppender ( listAppender ) ; loggerTest . addAppender ( listAppender ) ; loggerTest . setAdditive ( false ) ; loggerTest . debug ( "hello" ) ; "<AssertPlaceHolder>" ; } size ( ) { return partList . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , listAppender . list . size ( ) )
|
testGetDurabilityFromDatabase ( ) { final com . allanbank . mongodb . Durability defaultDurability = com . allanbank . mongodb . Durability . journalDurable ( 1234 ) ; expect ( myMockDatabase . getDurability ( ) ) . andReturn ( defaultDurability ) ; replay ( ) ; final com . allanbank . mongodb . Durability result = myTestInstance . getDurability ( ) ; "<AssertPlaceHolder>" ; verify ( ) ; } getDurability ( ) { com . allanbank . mongodb . Durability result = myDurability ; if ( result == null ) { result = myDatabase . getDurability ( ) ; } return result ; }
|
org . junit . Assert . assertSame ( defaultDurability , result )
|
testSetFrom2 ( ) { final java . lang . String [ ] testEmailNames = new java . lang . String [ ] { "Name1" , "" , null } ; final java . util . List < javax . mail . internet . InternetAddress > arrExpected = new java . util . ArrayList < javax . mail . internet . InternetAddress > ( ) ; arrExpected . add ( new javax . mail . internet . InternetAddress ( "me@home.com" , "Name1" ) ) ; arrExpected . add ( new javax . mail . internet . InternetAddress ( "joe.doe@apache.org" , "joe.doe@apache.org" ) ) ; arrExpected . add ( new javax . mail . internet . InternetAddress ( "someone_here@work-address.com.au" , "someone_here@work-address.com.au" ) ) ; for ( int i = 0 ; i < ( org . apache . commons . mail . EmailTest . VALID_EMAILS . length ) ; i ++ ) { email . setFrom ( org . apache . commons . mail . EmailTest . VALID_EMAILS [ i ] , testEmailNames [ i ] ) ; "<AssertPlaceHolder>" ; } } getFromAddress ( ) { return this . fromAddress ; }
|
org . junit . Assert . assertEquals ( arrExpected . get ( i ) , email . getFromAddress ( ) )
|
testCaseInvalid ( ) { tested . setIsCase ( new org . kie . workbench . common . stunner . cm . definition . property . subprocess . IsCase ( org . kie . workbench . common . stunner . cm . definition . property . task . ProcessReusableSubprocessTaskExecutionSetTest . CASE_INVALID ) ) ; java . util . Set < javax . validation . ConstraintViolation < org . kie . workbench . common . stunner . cm . definition . property . task . ProcessReusableSubprocessTaskExecutionSet > > violations = this . validator . validate ( tested ) ; "<AssertPlaceHolder>" ; } size ( ) { return index . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , violations . size ( ) )
|
testIsInhoudelijkGelijkAanZichzelf ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonSamengesteldeNaamHistorie voorkomen1 = maakTemplateVoorkomen ( ) ; "<AssertPlaceHolder>" ; } isInhoudelijkGelijkAan ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . LandOfGebied ) { if ( ( this ) == anderLandOfGebied ) { return true ; } if ( anderLandOfGebied == null ) { return false ; } return ( getCode ( ) ) == ( anderLandOfGebied . getCode ( ) ) ; }
|
org . junit . Assert . assertTrue ( voorkomen1 . isInhoudelijkGelijkAan ( voorkomen1 ) )
|
testGetLastPublishedVersionsPublicationStatus ( ) { org . gbif . ipt . model . Resource r = getResource ( ) ; "<AssertPlaceHolder>" ; } getLastPublishedVersionsPublicationStatus ( ) { org . gbif . ipt . model . VersionHistory last = getLastPublishedVersion ( ) ; if ( last != null ) { return last . getPublicationStatus ( ) ; } else if ( status . equals ( PublicationStatus . REGISTERED ) ) { return org . gbif . ipt . model . voc . PublicationStatus . REGISTERED ; } else { return org . gbif . ipt . model . voc . PublicationStatus . PRIVATE ; } }
|
org . junit . Assert . assertEquals ( PublicationStatus . PRIVATE , r . getLastPublishedVersionsPublicationStatus ( ) )
|
testDateTimeChannelCalendarDefaultTimeZoneUpdate ( ) { org . eclipse . smarthome . config . core . Configuration configuration = new org . eclipse . smarthome . config . core . Configuration ( ) ; initialize ( configuration , NtpBindingConstants . CHANNEL_DATE_TIME , org . openhab . binding . ntp . test . NtpOSGiTest . ACCEPTED_ITEM_TYPE_DATE_TIME , null , null ) ; java . time . ZonedDateTime timeZoneIdFromItemRegistry = ( ( org . eclipse . smarthome . core . library . types . DateTimeType ) ( getItemState ( org . openhab . binding . ntp . test . NtpOSGiTest . ACCEPTED_ITEM_TYPE_DATE_TIME ) ) ) . getZonedDateTime ( ) ; java . time . ZoneOffset expectedOffset = java . time . ZoneId . systemDefault ( ) . getRules ( ) . getOffset ( timeZoneIdFromItemRegistry . toInstant ( ) ) ; "<AssertPlaceHolder>" ; } getOffset ( ) { return offset ; }
|
org . junit . Assert . assertEquals ( expectedOffset , timeZoneIdFromItemRegistry . getOffset ( ) )
|
testOutAttributesAsElements ( ) { org . apache . cxf . jaxrs . provider . JAXBElementProvider < org . apache . cxf . jaxrs . provider . JAXBElementProviderTest . TagVO2Holder > provider = new org . apache . cxf . jaxrs . provider . JAXBElementProvider ( ) ; java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap ( ) ; map . put ( "{http://tags}thetag" , "thetag" ) ; map . put ( "{http://tags}tagholder" , "tagholder" ) ; provider . setOutTransformElements ( map ) ; provider . setAttributesToElements ( true ) ; org . apache . cxf . jaxrs . resources . TagVO2 tag = new org . apache . cxf . jaxrs . resources . TagVO2 ( "A" , "B" ) ; org . apache . cxf . jaxrs . provider . JAXBElementProviderTest . TagVO2Holder holder = new org . apache . cxf . jaxrs . provider . JAXBElementProviderTest . TagVO2Holder ( ) ; holder . setTag ( tag ) ; java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; provider . writeTo ( holder , org . apache . cxf . jaxrs . provider . JAXBElementProviderTest . TagVO2Holder . class , org . apache . cxf . jaxrs . provider . JAXBElementProviderTest . TagVO2Holder . class , new java . lang . annotation . Annotation [ 0 ] , MediaType . TEXT_XML_TYPE , new org . apache . cxf . jaxrs . impl . MetadataMap < java . lang . String , java . lang . Object > ( ) , bos ) ; java . lang . String expected = "<?xml<sp>version='1.0'<sp>encoding='UTF-8'?><tagholder><attr>attribute</attr>" + "<thetag><group>B</group><name>A</name></thetag></tagholder>" ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( 128 ) ; builder . append ( "ProcessedClaim<sp>[" ) ; builder . append ( super . toString ( ) ) ; builder . append ( ",<sp>issuer=" ) ; builder . append ( issuer ) ; builder . append ( ",<sp>originalIssuer=" ) ; builder . append ( originalIssuer ) ; builder . append ( ",<sp>principal=" ) ; builder . append ( principal ) ; builder . append ( ']' ) ; return builder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , bos . toString ( ) )
|
simple ( ) { final org . glassfish . tyrus . core . TyrusExtension test = new org . glassfish . tyrus . core . TyrusExtension ( "test" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return "MaskingKeyCheckingExtension" ; }
|
org . junit . Assert . assertEquals ( "test" , test . getName ( ) )
|
testAuroraWithEFSProvisionedThroughput ( ) { final java . lang . String zoneStackName = "vpc-3azs-" 5 + ( this . random8String ( ) ) ; final java . lang . String vpcStackName = "vpc-3azs-" + ( this . random8String ( ) ) ; final java . lang . String stackName = "CloudFrontAcmCertificate" 2 + ( this . random8String ( ) ) ; final java . lang . String classB = "vpc-3azs-" 3 ; final java . lang . String keyName = "key-" + ( this . random8String ( ) ) ; final java . lang . String subDomainName = stackName ; final java . lang . String blogTitle = "Stay-AWSome" ; final java . lang . String blogPassword = this . random8String ( ) ; try { this . createKey ( keyName ) ; try { this . createStack ( zoneStackName , "vpc/zone-legacy.yaml" , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "vpc-3azs-" 2 ) . withParameterValue ( de . widdix . awscftemplates . Config . get ( Config . Key . DOMAIN_SUFFIX ) ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "vpc-3azs-" 7 ) . withParameterValue ( de . widdix . awscftemplates . Config . get ( Config . Key . HOSTED_ZONE_ID ) ) ) ; try { this . createStack ( vpcStackName , "CloudFrontAcmCertificate" 4 , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "CloudFrontAcmCertificate" 6 ) . withParameterValue ( classB ) ) ; try { this . createStack ( stackName , "CloudFrontAcmCertificate" 7 , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "ParentVPCStack" ) . withParameterValue ( vpcStackName ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "CloudFrontAcmCertificate" 3 ) . withParameterValue ( zoneStackName ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "vpc-3azs-" 6 ) . withParameterValue ( keyName ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "CloudFrontAcmCertificate" 0 ) . withParameterValue ( ( subDomainName + "." ) ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "CloudFrontAcmCertificate" ) . withParameterValue ( de . widdix . awscftemplates . Config . get ( Config . Key . CLOUDFRONT_ACM_CERTIFICATE_ARN ) ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "vpc-3azs-" 1 ) . withParameterValue ( de . widdix . awscftemplates . Config . get ( Config . Key . ACM_CERTIFICATE_ARN ) ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "CloudFrontAcmCertificate" 9 ) . withParameterValue ( blogTitle ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "CloudFrontAcmCertificate" 8 ) . withParameterValue ( "admin" ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "vpc-3azs-" 8 ) . withParameterValue ( blogPassword ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "CloudFrontAcmCertificate" 1 ) . withParameterValue ( "no-reply@widdix.de" ) , new com . amazonaws . services . cloudformation . model . Parameter ( ) . withParameterKey ( "CloudFrontAcmCertificate" 5 ) . withParameterValue ( "vpc-3azs-" 0 ) ) ; final java . lang . String url = ( ( "https://" + subDomainName ) + "." ) + ( de . widdix . awscftemplates . Config . get ( Config . Key . DOMAIN_SUFFIX ) ) ; final java . util . concurrent . Callable < java . lang . String > callable = ( ) -> { final org . apache . http . HttpResponse response = de . taimos . httputils . WS . url ( url ) . timeout ( 10000 ) . get ( ) ; if ( ( de . taimos . httputils . WS . getStatus ( response ) ) != 200 ) { throw new java . lang . RuntimeException ( ( "vpc-3azs-" 4 + ( de . taimos . httputils . WS . getStatus ( response ) ) ) ) ; } return de . taimos . httputils . WS . getResponseAsString ( response ) ; } ; final java . lang . String response = this . retry ( callable ) ; "<AssertPlaceHolder>" ; } finally { this . deleteStackAndRetryOnFailure ( stackName ) ; } } finally { this . deleteStack ( vpcStackName ) ; } } finally { this . deleteStack ( zoneStackName ) ; } } finally { this . deleteKey ( keyName ) ; } } retry ( java . util . concurrent . Callable ) { final java . util . concurrent . Callable < T > wrapper = ( ) -> { try { return callable . call ( ) ; } catch ( final e ) { System . out . println ( ( "retry[]<sp>exception:<sp>" + ( de . widdix . awscftemplates . e . getMessage ( ) ) ) ) ; de . widdix . awscftemplates . e . printStackTrace ( ) ; throw de . widdix . awscftemplates . e ; } } ; final com . evanlennick . retry4j . RetryConfig config = new com . evanlennick . retry4j . RetryConfigBuilder ( ) . retryOnAnyException ( ) . withMaxNumberOfTries ( 30 ) . withDelayBetweenTries ( 10 , ChronoUnit . SECONDS ) . withFixedBackoff ( ) . build ( ) ; final com . evanlennick . retry4j . CallResults < java . lang . Object > results = new com . evanlennick . retry4j . CallExecutor ( config ) . execute ( wrapper ) ; return ( ( T ) ( results . getResult ( ) ) ) ;
|
org . junit . Assert . assertTrue ( response . contains ( blogTitle ) )
|
testGetParametersWithDefaultEntity ( ) { org . lnu . is . domain . contact . type . ContactType entity = new org . lnu . is . domain . contact . type . ContactType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; expected . put ( "userGroups" , groups ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testFetchByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . ResourceAction newResourceAction = addResourceAction ( ) ; com . liferay . portal . kernel . model . ResourceAction existingResourceAction = _persistence . fetchByPrimaryKey ( newResourceAction . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertEquals ( existingResourceAction , newResourceAction )
|
shouldBeLessThen ( ) { org . jboss . arquillian . container . jetty . embedded_7 . VersionUtil . Version less = org . jboss . arquillian . container . jetty . embedded_7 . VersionUtil . extract ( "7.1" ) ; org . jboss . arquillian . container . jetty . embedded_7 . VersionUtil . Version then = org . jboss . arquillian . container . jetty . embedded_7 . VersionUtil . extract ( "7.2" ) ; "<AssertPlaceHolder>" ; } isLessThenOrEqual ( java . lang . String , java . lang . String ) { return org . jboss . arquillian . container . jetty . embedded_7 . VersionUtil . isLessThenOrEqual ( org . jboss . arquillian . container . jetty . embedded_7 . VersionUtil . extract ( less ) , org . jboss . arquillian . container . jetty . embedded_7 . VersionUtil . extract ( then ) ) ; }
|
org . junit . Assert . assertTrue ( org . jboss . arquillian . container . jetty . embedded_7 . VersionUtil . isLessThenOrEqual ( less , then ) )
|
testSliceConstructor ( ) { org . nd4j . linalg . List < org . nd4j . linalg . api . ndarray . INDArray > testList = new org . nd4j . linalg . ArrayList ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) testList . add ( org . nd4j . linalg . factory . Nd4j . scalar ( ( i + 1.0F ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray test = org . nd4j . linalg . factory . Nd4j . create ( testList , new long [ ] { 1 , testList . size ( ) } ) . reshape ( 1 , 5 ) ; org . nd4j . linalg . api . ndarray . INDArray expected = org . nd4j . linalg . factory . Nd4j . create ( new float [ ] { 1 , 2 , 3 , 4 , 5 } , new long [ ] { 1 , 5 } ) ; "<AssertPlaceHolder>" ; } reshape ( char , int [ ] ) { return null ; }
|
org . junit . Assert . assertEquals ( expected , test )
|
append_toEmptyPath_removeReturnsElement ( ) { java . lang . String element = "element" ; path . append ( element ) ; "<AssertPlaceHolder>" ; } removeEnd ( ) { return path . pop ( ) ; }
|
org . junit . Assert . assertSame ( element , path . removeEnd ( ) )
|
toTimestamp ( ) { java . lang . String format = "yyyy/MM/dd<sp>HH:mm:ss.SSS" ; java . lang . String source = "2014/06/24<sp>12:13:14.123" ; java . text . DateFormat formatter = new java . text . SimpleDateFormat ( "MM/dd/yy<sp>HH:mm:ss.SSS" ) ; java . sql . Timestamp date = new java . sql . Timestamp ( formatter . parse ( "06/24/2014<sp>12:13:14.123" ) . getTime ( ) ) ; "<AssertPlaceHolder>" ; } TO_TIMESTAMP ( java . lang . String , java . lang . String ) { if ( source == null ) return null ; java . lang . String microTest = ( format == null ) ? null : format . toUpperCase ( ) ; try { if ( ( microTest == null ) || ( ( format . startsWith ( "yyyy-MM-dd<sp>HH:mm:ss" ) ) && ( ! ( microTest . endsWith ( "Z" ) ) ) ) ) { return java . sql . Timestamp . valueOf ( source ) ; } } catch ( java . lang . IllegalArgumentException e ) { } org . joda . time . DateTime dt = com . splicemachine . derby . utils . SpliceDateFunctions . stringWithFormatToDateTime ( source , format ) ; if ( ( microTest != null ) && ( microTest . endsWith ( "Z" ) ) ) return new java . sql . Timestamp ( dt . getMillis ( ) ) ; else { return new java . sql . Timestamp ( ( ( dt . getYear ( ) ) - 1900 ) , ( ( dt . getMonthOfYear ( ) ) - 1 ) , dt . getDayOfMonth ( ) , dt . getHourOfDay ( ) , dt . getMinuteOfHour ( ) , dt . getSecondOfMinute ( ) , ( ( dt . getMillisOfSecond ( ) ) * 1000000 ) ) ; } }
|
org . junit . Assert . assertEquals ( date , com . splicemachine . derby . utils . SpliceDateFunctions . TO_TIMESTAMP ( source , format ) )
|
testIgnoreIgnomreCommonsBacktrace ( ) { final java . lang . Iterable < java . lang . String > backtrace = new airbrake . QuietRubyBacktrace ( airbrake . BacktraceTest . backtrace ( ) ) ; final java . lang . Iterable < java . lang . String > filteredBacktrace = new airbrake . QuietRubyBacktrace ( filteredBacktrace ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return stringBuilder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( filteredBacktrace . toString ( ) , backtrace . toString ( ) )
|
testLocalIntermodesThreshold ( ) { ops . run ( net . imagej . ops . Ops . Threshold . Intermodes . class , out , in , new net . imglib2 . algorithm . neighborhood . RectangleShape ( 1 , false ) , new net . imglib2 . outofbounds . OutOfBoundsMirrorFactory < net . imglib2 . type . numeric . integer . ByteType , net . imglib2 . img . Img < net . imglib2 . type . numeric . integer . ByteType > > ( net . imglib2 . outofbounds . OutOfBoundsMirrorFactory . Boundary . SINGLE ) ) ; "<AssertPlaceHolder>" ; } firstElement ( ) { return cursor ( ) . next ( ) ; }
|
org . junit . Assert . assertEquals ( false , out . firstElement ( ) . get ( ) )
|
customDateFormatParamWithOptionalShouldHandleEmpty ( ) { create ( "dateParamWithOptional" , ninja . params . ControllerMethodInvokerWithDeprecatedValidationTest . DateParamParser . class ) . invoke ( mockController , context ) ; verify ( mockController ) . dateParamWithOptional ( java . util . Optional . empty ( ) ) ; "<AssertPlaceHolder>" ; } hasViolations ( ) { return ! ( this . violations . isEmpty ( ) ) ; }
|
org . junit . Assert . assertFalse ( validation . hasViolations ( ) )
|
testFindCampaignById ( ) { com . mongodb . BasicDBObject camp = new com . mongodb . BasicDBObject ( ) ; camp . put ( "title" , "test-title" ) ; com . mongodb . DBCollection campaigns = database . getCollection ( "campaigns" ) ; campaigns . insert ( camp ) ; org . offlike . server . data . Campaign campaign = mongoDbService . findCampaignById ( camp . getString ( "_id" ) ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return title ; }
|
org . junit . Assert . assertEquals ( "test-title" , campaign . getTitle ( ) )
|
test ( ) { me . geso . routes . PathRoute < java . lang . String > route = new me . geso . routes . PathRoute ( "/" , "Root" ) ; java . util . LinkedHashMap < java . lang . String , java . lang . String > captured = new java . util . LinkedHashMap ( ) ; boolean matched = route . match ( "/" , captured ) ; "<AssertPlaceHolder>" ; } match ( java . lang . String , java . lang . String ) { me . geso . routes . RoutingResult < T > routingResult = null ; for ( me . geso . routes . HttpRoute < T > route : getPatterns ( ) ) { me . geso . routes . RoutingResult < T > result = route . match ( method , path ) ; if ( result != null ) { routingResult = result ; if ( routingResult . methodAllowed ( ) ) { return routingResult ; } } } return routingResult ; }
|
org . junit . Assert . assertThat ( matched , org . hamcrest . CoreMatchers . is ( true ) )
|
testEmbeddedItemInString ( ) { java . lang . String questionnaireRef = "http://example.com/Questionnaire/q1" ; org . hl7 . fhir . r4 . model . Questionnaire . QuestionnaireItemComponent item1 = new org . hl7 . fhir . r4 . model . Questionnaire . QuestionnaireItemComponent ( ) ; item1 . setLinkId ( "link1" ) . setType ( QuestionnaireItemType . TEXT ) ; item1 . addItem ( ) . setLinkId ( "link11" ) . setType ( QuestionnaireItemType . TEXT ) ; org . hl7 . fhir . r4 . validation . Questionnaire q = new org . hl7 . fhir . r4 . validation . Questionnaire ( ) ; q . addItem ( item1 ) ; when ( myValSupport . fetchResource ( any ( ca . uhn . fhir . context . FhirContext . class ) , eq ( org . hl7 . fhir . r4 . validation . Questionnaire . class ) , eq ( questionnaireRef ) ) ) . thenReturn ( q ) ; ca . uhn . fhir . parser . IParser xmlParser = org . hl7 . fhir . r4 . validation . QuestionnaireResponseValidatorR4Test . ourCtx . newXmlParser ( ) . setPrettyPrint ( true ) ; java . lang . String qXml = xmlParser . encodeResourceToString ( q ) ; org . hl7 . fhir . r4 . validation . QuestionnaireResponseValidatorR4Test . ourLog . info ( qXml ) ; org . hl7 . fhir . r4 . validation . QuestionnaireResponse qa = new org . hl7 . fhir . r4 . validation . QuestionnaireResponse ( ) ; qa . getText ( ) . setDiv ( new org . hl7 . fhir . utilities . xhtml . XhtmlNode ( ) . setValue ( "<div>AA</div>" ) ) . setStatus ( Narrative . NarrativeStatus . GENERATED ) ; qa . setStatus ( QuestionnaireResponseStatus . INPROGRESS ) ; qa . setQuestionnaire ( questionnaireRef ) ; qa . addItem ( ) . setLinkId ( "link1" ) . addAnswer ( ) . addItem ( ) . setLinkId ( "link11" ) ; java . lang . String rXml = xmlParser . encodeResourceToString ( qa ) ; org . hl7 . fhir . r4 . validation . QuestionnaireResponseValidatorR4Test . ourLog . info ( rXml ) ; ca . uhn . fhir . validation . ValidationResult errors = myVal . validateWithResult ( qa ) ; org . hl7 . fhir . r4 . validation . QuestionnaireResponseValidatorR4Test . ourLog . info ( errors . toString ( ) ) ; "<AssertPlaceHolder>" ; } getMessages ( ) { return java . util . Collections . unmodifiableList ( myMessages ) ; }
|
org . junit . Assert . assertThat ( errors . getMessages ( ) , empty ( ) )
|
testShouldTryVerifyingAllSignaturesForSignedKeyInECV2SigningOnly ( ) { com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipient recipient = new com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipient . Builder ( ) . protocolVersion ( PaymentMethodTokenConstants . PROTOCOL_VERSION_EC_V2_SIGNING_ONLY ) . senderVerifyingKeys ( com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipientTest . GOOGLE_VERIFYING_PUBLIC_KEYS_JSON ) . recipientId ( com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipientTest . RECIPIENT_ID ) . build ( ) ; org . json . JSONObject payload = new org . json . JSONObject ( com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipientTest . signECV2SigningOnly ( com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipientTest . PLAINTEXT ) ) ; org . json . JSONArray signatures = payload . getJSONObject ( "intermediateSigningKey" ) . getJSONArray ( "signatures" ) ; java . lang . String correctSignature = signatures . getString ( 0 ) ; byte [ ] wrongSignatureBytes = com . google . crypto . tink . subtle . Base64 . decode ( correctSignature ) ; wrongSignatureBytes [ 0 ] = ( ( byte ) ( ~ ( wrongSignatureBytes [ 0 ] ) ) ) ; payload . getJSONObject ( "intermediateSigningKey" ) . put ( "signatures" , new org . json . JSONArray ( ) . put ( com . google . crypto . tink . subtle . Base64 . encode ( wrongSignatureBytes ) ) . put ( correctSignature ) ) ; "<AssertPlaceHolder>" ; } unseal ( java . lang . String ) { try { if ( protocolVersion . equals ( PaymentMethodTokenConstants . PROTOCOL_VERSION_EC_V1 ) ) { return unsealECV1 ( sealedMessage ) ; } else if ( protocolVersion . equals ( PaymentMethodTokenConstants . PROTOCOL_VERSION_EC_V2 ) ) { return unsealECV2 ( sealedMessage ) ; } else if ( protocolVersion . equals ( PaymentMethodTokenConstants . PROTOCOL_VERSION_EC_V2_SIGNING_ONLY ) ) { return unsealECV2SigningOnly ( sealedMessage ) ; } throw new java . lang . IllegalArgumentException ( ( "unsupported<sp>version:<sp>" + ( protocolVersion ) ) ) ; } catch ( org . json . JSONException e ) { throw new java . security . GeneralSecurityException ( "cannot<sp>unseal;<sp>invalid<sp>JSON<sp>message" ) ; } }
|
org . junit . Assert . assertEquals ( com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipientTest . PLAINTEXT , recipient . unseal ( com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipientTest . signECV2SigningOnly ( com . google . crypto . tink . apps . paymentmethodtoken . PaymentMethodTokenRecipientTest . PLAINTEXT ) ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.