input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
paymentDateCannotBePriorToLastPaymentDate ( ) { accountApplyPaymentActionForm . setLastPaymentDate ( new org . joda . time . DateTime ( ) . withDate ( 2010 , 10 , 13 ) . toDate ( ) ) ; org . apache . struts . action . ActionErrors actionErrors = accountApplyPaymentActionForm . validatePaymentDate ( "12/10/2010" , "accounts.date_of_trxn" ) ; "<AssertPlaceHolder>" ; } size ( ) { return fieldErrors . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , actionErrors . size ( ) )
|
testParseArgsWithStringChoices ( ) { ap . addArgument ( "--foo" ) . choices ( "chocolate" , "icecream" , "froyo" ) ; net . sourceforge . argparse4j . inf . Namespace res = ap . parseArgs ( "--foo<sp>icecream" . split ( "<sp>" ) ) ; "<AssertPlaceHolder>" ; try { ap . parseArgs ( "--foo<sp>pudding" . split ( "<sp>" ) ) ; org . junit . Assert . fail ( "Exception<sp>must<sp>be<sp>thrown" ) ; } catch ( net . sourceforge . argparse4j . inf . ArgumentParserException e ) { } } get ( java . lang . String ) { return ( ( T ) ( attrs_ . get ( dest ) ) ) ; }
|
org . junit . Assert . assertEquals ( "icecream" , res . get ( "foo" ) )
|
video ( ) { java . lang . String para = "?signature=d919cc8a6361597afa536e906156262cc9cd93df×tamp=1433903433&nonce=518016546" ; xmlSb . delete ( 0 , xmlSb . length ( ) ) ; xmlSb . append ( "<xml>" ) ; xmlSb . append ( "<ToUserName><![CDATA[toUser]]></ToUserName>" ) ; xmlSb . append ( "<FromUserName><![CDATA[FromUser]]></FromUserName>" ) ; xmlSb . append ( "<CreateTime>123456789</CreateTime>" ) ; xmlSb . append ( "<MsgType><![CDATA[video]]></MsgType>" ) ; xmlSb . append ( "<MediaId><![CDATA[media_id]]></MediaId>" ) ; xmlSb . append ( "<ThumbMediaId><![CDATA[thumb_media_id]]></ThumbMediaId>" ) ; xmlSb . append ( "<MsgId>1234567890123456</MsgId>" ) ; xmlSb . append ( "</xml>" ) ; java . lang . String response = push ( para , xmlSb . toString ( ) ) ; "<AssertPlaceHolder>" ; System . out . println ( response ) ; } toString ( ) { return ( ( ( ( "statDate=" + ( statDate ) ) + ",<sp>targetUser=" ) + ( targetUser ) ) + ",<sp>" ) + ( super . toString ( ) ) ; }
|
org . junit . Assert . assertNotNull ( response )
|
testWithClasses3 ( ) { java . lang . reflect . Type selectedType = new javax . enterprise . util . TypeLiteral < org . jboss . weld . tests . unit . hierarchy . discovery . event . Alpha < java . lang . Comparable < java . util . List < java . lang . String > > > > ( ) { } . getType ( ) ; java . lang . reflect . Type type = org . jboss . weld . tests . unit . hierarchy . discovery . event . EventTypeResolutionTest . resolveType ( selectedType , org . jboss . weld . tests . unit . hierarchy . discovery . event . Foxtrot . class ) ; "<AssertPlaceHolder>" ; } getType ( ) { return type ; }
|
org . junit . Assert . assertEquals ( new javax . enterprise . util . TypeLiteral < org . jboss . weld . tests . unit . hierarchy . discovery . event . Foxtrot < java . lang . String > > ( ) { } . getType ( ) , type )
|
should_save ( ) { com . ctp . cdi . query . test . domain . Simple simple = new com . ctp . cdi . query . test . domain . Simple ( "test" ) ; simple = dao . save ( simple ) ; "<AssertPlaceHolder>" ; } getId ( ) { if ( ( isEmpty ( id ) ) && ( ( getParent ( ) ) != null ) ) { return getParent ( ) . getId ( ) ; } return super . getId ( ) ; }
|
org . junit . Assert . assertNotNull ( simple . getId ( ) )
|
processBytesFromPeerClientNext ( ) { java . nio . ByteBuffer transportBuffer = java . nio . ByteBuffer . allocate ( io . grpc . alts . internal . AltsTsiHandshakerTest . TRANSPORT_BUFFER_SIZE ) ; java . nio . ByteBuffer outputFrame = java . nio . ByteBuffer . allocate ( io . grpc . alts . internal . AltsTsiHandshakerTest . OUT_FRAME_SIZE ) ; verify ( mockClient , never ( ) ) . startServerHandshake ( org . mockito . ArgumentMatchers . < java . nio . ByteBuffer > any ( ) ) ; when ( mockClient . startClientHandshake ( ) ) . thenReturn ( outputFrame ) ; when ( mockClient . next ( transportBuffer ) ) . thenReturn ( outputFrame ) ; when ( mockClient . isFinished ( ) ) . thenReturn ( false ) ; handshakerClient . getBytesToSendToPeer ( transportBuffer ) ; transportBuffer . position ( transportBuffer . limit ( ) ) ; "<AssertPlaceHolder>" ; } processBytesFromPeer ( java . nio . ByteBuffer ) { if ( ( ( outputFrame ) == null ) && ( isClient ) ) { return true ; } if ( ( ( outputFrame ) != null ) && ( outputFrame . hasRemaining ( ) ) ) { return true ; } int remaining = bytes . remaining ( ) ; if ( ( outputFrame ) == null ) { checkState ( ( ! ( isClient ) ) , "Client<sp>handshaker<sp>should<sp>not<sp>process<sp>any<sp>frame<sp>at<sp>the<sp>beginning." ) ; outputFrame = handshaker . startServerHandshake ( bytes ) ; } else { outputFrame = handshaker . next ( bytes ) ; } if ( ( handshaker . isFinished ( ) ) || ( outputFrame . hasRemaining ( ) ) ) { return true ; } if ( ! ( bytes . hasRemaining ( ) ) ) { return false ; } checkState ( ( ( bytes . remaining ( ) ) < remaining ) , "Handshaker<sp>did<sp>not<sp>consume<sp>any<sp>bytes." ) ; return processBytesFromPeer ( bytes ) ; }
|
org . junit . Assert . assertFalse ( handshakerClient . processBytesFromPeer ( transportBuffer ) )
|
testManualRead ( ) { if ( ! ( isGDALAvailable ) ) { return ; } final java . lang . String fileName = "small_world.img.vrt" ; it . geosolutions . resources . TestData . unzipFile ( this , "small-world.zip" ) ; final java . io . File file = it . geosolutions . resources . TestData . file ( this , fileName ) ; javax . imageio . ImageReader reader = new it . geosolutions . imageio . plugins . vrt . VRTImageReaderSpi ( ) . createReaderInstance ( ) ; reader . setInput ( file ) ; final java . awt . image . RenderedImage image = reader . read ( 0 ) ; if ( it . geosolutions . resources . TestData . isInteractiveTest ( ) ) it . geosolutions . imageio . gdalframework . Viewer . visualizeAllInformation ( image , fileName ) ; else "<AssertPlaceHolder>" ; reader . dispose ( ) ; } visualizeAllInformation ( java . awt . image . RenderedImage , java . lang . String ) { it . geosolutions . imageio . gdalframework . Viewer . visualizeWithTextArea ( ri , title , MetadataChoice . EVERYTHING , 0 , true ) ; }
|
org . junit . Assert . assertNotNull ( image )
|
extractPPTFile ( ) { java . nio . file . Path pdfFile = java . nio . file . Paths . get ( "./index/test_tables/filesource/specialfiles/test.ppt" ) ; java . lang . String file = edu . uci . ics . texera . dataflow . source . file . FileExtractorUtils . extractPPTFile ( pdfFile ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( dictionaryEntries ) == null ) || ( dictionaryEntries . isEmpty ( ) ) ; }
|
org . junit . Assert . assertTrue ( file . isEmpty ( ) )
|
testSpyExecutedDeleteStatements ( ) { io . sniffy . Spy spy = io . sniffy . Sniffy . spy ( ) ; executeStatement ( ) ; executeStatement ( Query . DELETE ) ; "<AssertPlaceHolder>" ; } executedStatements ( io . sniffy . Threads , io . sniffy . Query ) { checkOpened ( ) ; int count = 0 ; io . sniffy . sql . SqlStatement sqlStatement = io . sniffy . LegacySpy . adapter ( query ) ; java . util . Map < io . sniffy . sql . StatementMetaData , io . sniffy . sql . SqlStats > executedStatements = getExecutedStatements ( threadMatcher , false ) ; if ( null != executedStatements ) for ( Map . Entry < io . sniffy . sql . StatementMetaData , io . sniffy . sql . SqlStats > entry : executedStatements . entrySet ( ) ) { io . sniffy . sql . StatementMetaData statementMetaData = entry . getKey ( ) ; io . sniffy . sql . SqlStats sqlStats = entry . getValue ( ) ; if ( ( ( sqlStatement == ( io . sniffy . sql . SqlStatement . ANY ) ) && ( ( statementMetaData . query ) != ( io . sniffy . sql . SqlStatement . SYSTEM ) ) ) || ( sqlStatement == ( statementMetaData . query ) ) ) { count += sqlStats . queries . intValue ( ) ; } } return count ; }
|
org . junit . Assert . assertEquals ( 1 , spy . executedStatements ( Threads . ANY , Query . DELETE ) )
|
getS3Endpoint ( ) { copierOptions . put ( S3S3CopierOptions . Keys . S3_ENDPOINT_URI . keyName ( ) , "http://s3.endpoint/" ) ; com . hotels . bdp . circustrain . s3s3copier . S3S3CopierOptions options = new com . hotels . bdp . circustrain . s3s3copier . S3S3CopierOptions ( copierOptions ) ; "<AssertPlaceHolder>" ; } getS3Endpoint ( ) { return s3Endpoint ( com . hotels . bdp . circustrain . s3s3copier . S3S3CopierOptions . Keys . S3_ENDPOINT_URI . keyName ( ) ) ; }
|
org . junit . Assert . assertThat ( options . getS3Endpoint ( ) , org . hamcrest . CoreMatchers . is ( java . net . URI . create ( "http://s3.endpoint/" ) ) )
|
simpleQueryWithoutBindingSetInvalidProperty ( ) { org . apache . rya . api . domain . StatementMetadata metadata = new org . apache . rya . api . domain . StatementMetadata ( ) ; metadata . addMetadata ( new org . apache . rya . api . domain . RyaIRI ( "http://createdBy" ) , new org . apache . rya . api . domain . RyaType ( "Doug" ) ) ; metadata . addMetadata ( new org . apache . rya . api . domain . RyaIRI ( "http://createdOn" ) , new org . apache . rya . api . domain . RyaType ( org . eclipse . rdf4j . model . vocabulary . XMLSchema . DATE , "2017-02-15" ) ) ; org . apache . rya . api . domain . RyaStatement statement = new org . apache . rya . api . domain . RyaStatement ( new org . apache . rya . api . domain . RyaIRI ( "http://Joe" ) , new org . apache . rya . api . domain . RyaIRI ( "http://worksAt" ) , new org . apache . rya . api . domain . RyaType ( "CoffeeShop" ) , new org . apache . rya . api . domain . RyaIRI ( "http://context" ) , "" , metadata ) ; dao . add ( statement ) ; org . eclipse . rdf4j . query . TupleQueryResult result = conn . prepareTupleQuery ( QueryLanguage . SPARQL , query1 ) . evaluate ( ) ; java . util . List < org . eclipse . rdf4j . query . BindingSet > bsList = new java . util . ArrayList ( ) ; while ( result . hasNext ( ) ) { bsList . add ( result . next ( ) ) ; } "<AssertPlaceHolder>" ; dao . delete ( statement , ( ( org . apache . rya . accumulo . AccumuloRdfConfiguration ) ( conf ) ) ) ; } size ( ) { if ( ! ( init ) ) { indexCache = org . apache . rya . indexing . pcj . matching . PCJOptimizerUtilities . getValidPCJs ( getIndices ( ) ) ; init = true ; } return indexCache . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , bsList . size ( ) )
|
testBuildWithParametersAndDisabledDefaultConstraints ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . department . Department parent = new org . lnu . is . domain . department . Department ( ) ; org . lnu . is . domain . department . type . DepartmentType departmentType = new org . lnu . is . domain . department . type . DepartmentType ( ) ; org . lnu . is . domain . order . Order order = new org . lnu . is . domain . order . Order ( ) ; java . lang . String name = "name" ; java . lang . String abbrName = "abbr<sp>name" ; java . lang . String manager = "manager" ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date endDate = new java . util . Date ( ) ; org . lnu . is . domain . department . Department context = new org . lnu . is . domain . department . Department ( ) ; context . setName ( name ) ; context . setParent ( parent ) ; context . setDepartmentType ( departmentType ) ; context . setOrder ( order ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; context . setManager ( manager ) ; context . setBegDate ( begDate ) ; context . setEndDate ( endDate ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>Department<sp>e<sp>WHERE<sp>(<sp>e.parent<sp>=<sp>:parent<sp>AND<sp>e.departmentType<sp>=<sp>:departmentType<sp>AND<sp>e.order<sp>=<sp>:order<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>AND<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.manager<sp>LIKE<sp>CONCAT('%',:manager,'%')<sp>AND<sp>e.begDate<sp><=<sp>:begDate<sp>AND<sp>e.endDate<sp>>=<sp>:endDate)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . department . Department > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testExpireAndGetExpireMillis ( ) { final K key1 = keyFactory . instance ( ) ; V value1 = valueFactory . instance ( ) ; redisTemplate . boundValueOps ( key1 ) . set ( value1 ) ; redisTemplate . expire ( key1 , 10 , TimeUnit . MILLISECONDS ) ; "<AssertPlaceHolder>" ; org . springframework . data . redis . core . RedisTemplateTests . waitFor ( new org . springframework . data . redis . TestCondition ( ) { @ org . springframework . data . redis . core . Override public boolean passes ( ) { return ! ( redisTemplate . hasKey ( key1 ) ) ; } } , 1500L ) ; } getExpire ( K , java . util . concurrent . TimeUnit ) { final byte [ ] rawKey = rawKey ( key ) ; return execute ( new org . springframework . data . redis . core . RedisCallback < java . lang . Long > ( ) { @ org . springframework . data . redis . core . Override public org . springframework . data . redis . core . Long doInRedis ( org . springframework . data . redis . connection . RedisConnection connection ) { try { return timeUnit . convert ( connection . pTtl ( rawKey ) , TimeUnit . MILLISECONDS ) ; } catch ( java . lang . Exception e ) { return timeUnit . convert ( connection . ttl ( rawKey ) , TimeUnit . SECONDS ) ; } } } , true ) ; }
|
org . junit . Assert . assertTrue ( ( ( redisTemplate . getExpire ( key1 , TimeUnit . MILLISECONDS ) ) > 0L ) )
|
yield_A$Function1 ( ) { com . m3 . scalaflavor4j . CollectionLike < java . lang . String > xs1 = com . m3 . scalaflavor4j . Seq . apply ( "a" , "b" ) ; com . m3 . scalaflavor4j . CollectionLike < java . lang . Integer > xs2 = com . m3 . scalaflavor4j . Seq . apply ( 1 , 2 , 3 , 4 , 5 ) ; com . m3 . scalaflavor4j . CollectionLike < java . lang . Long > xs3 = com . m3 . scalaflavor4j . Seq . apply ( 10L , 20L ) ; com . m3 . scalaflavor4j . CollectionLike < java . lang . Boolean > xs4 = com . m3 . scalaflavor4j . Option . apply ( false ) ; com . m3 . scalaflavor4j . Seq < java . lang . String > rs = com . m3 . scalaflavor4j . For . apply ( xs1 , xs2 , xs3 , xs4 ) . yield ( new com . m3 . scalaflavor4j . F1 < com . m3 . scalaflavor4j . Tuple4 < java . lang . String , java . lang . Integer , java . lang . Long , java . lang . Boolean > , java . lang . String > ( ) { public java . lang . String apply ( com . m3 . scalaflavor4j . Tuple4 < java . lang . String , java . lang . Integer , java . lang . Long , java . lang . Boolean > t ) throws com . m3 . scalaflavor4j . Exception { return ( ( ( t . _1 ( ) ) + ( t . _2 ( ) ) ) + ( t . _3 ( ) ) ) + ( t . _4 ( ) ) ; } } ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; }
|
org . junit . Assert . assertThat ( rs . size ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( 20 ) ) )
|
testTimeout ( ) { org . axonframework . axonserver . connector . query . QueueBackedSpliterator < java . lang . String > queueBackedSpliterator = new org . axonframework . axonserver . connector . query . QueueBackedSpliterator ( 1000 , java . util . concurrent . TimeUnit . MILLISECONDS ) ; "<AssertPlaceHolder>" ; } tryAdvance ( Consumer ) { try { action . accept ( messageStream . nextAvailable ( ) ) ; } catch ( e ) { java . lang . Thread . currentThread ( ) . interrupt ( ) ; return false ; } return true ; }
|
org . junit . Assert . assertFalse ( queueBackedSpliterator . tryAdvance ( ( s ) -> System . out . println ( s ) ) )
|
testFindByPrimaryKeyExisting ( ) { com . liferay . document . library . kernel . model . DLFileShortcut newDLFileShortcut = addDLFileShortcut ( ) ; com . liferay . document . library . kernel . model . DLFileShortcut existingDLFileShortcut = _persistence . findByPrimaryKey ( newDLFileShortcut . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertEquals ( existingDLFileShortcut , newDLFileShortcut )
|
c3p0DsTest ( ) { cn . hutool . db . ds . DSFactory . setCurrentDSFactory ( new cn . hutool . db . ds . c3p0 . C3p0DSFactory ( ) ) ; javax . sql . DataSource ds = cn . hutool . db . ds . DSFactory . get ( "test" ) ; cn . hutool . db . Db db = cn . hutool . db . Db . use ( ds ) ; java . util . List < cn . hutool . db . Entity > all = db . findAll ( "user" ) ; "<AssertPlaceHolder>" ; } isNotEmpty ( java . util . Collection ) { return false == ( cn . hutool . core . collection . CollUtil . isEmpty ( collection ) ) ; }
|
org . junit . Assert . assertTrue ( cn . hutool . core . collection . CollUtil . isNotEmpty ( all ) )
|
sumInteger ( ) { com . gs . collections . api . set . ImmutableSet < java . lang . Integer > objects = this . newSetWith ( 1 , 2 , 3 ) ; long actual = objects . sumOfInt ( ( integer ) -> integer ) ; "<AssertPlaceHolder>" ; } sumOfInt ( com . gs . collections . api . block . function . primitive . IntFunction ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 6 , actual )
|
testTooLargeDynamicTableSizeUpdate ( ) { hpackDecoder . setMaxHeaderTableSize ( 0 ) ; "<AssertPlaceHolder>" ; decode ( "21" ) ; } getMaxHeaderTableSize ( ) { return hpackDynamicTable . capacity ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , hpackDecoder . getMaxHeaderTableSize ( ) )
|
testTrainC_ClassificationDataSet ( ) { System . out . println ( "trainC" ) ; jsat . classifiers . linear . kernelized . DUOL instance = new jsat . classifiers . linear . kernelized . DUOL ( new jsat . distributions . kernels . RBFKernel ( 0.5 ) ) ; jsat . classifiers . ClassificationDataSet train = jsat . FixedProblems . getInnerOuterCircle ( 200 , jsat . utils . random . RandomUtil . getRandom ( ) ) ; jsat . classifiers . ClassificationDataSet test = jsat . FixedProblems . getInnerOuterCircle ( 100 , jsat . utils . random . RandomUtil . getRandom ( ) ) ; jsat . classifiers . ClassificationModelEvaluation cme = new jsat . classifiers . ClassificationModelEvaluation ( instance , train ) ; cme . evaluateTestSet ( test ) ; "<AssertPlaceHolder>" ; } getErrorRate ( ) { return 1.0 - ( ( getCorrectWeights ( ) ) / ( sumOfWeights ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , cme . getErrorRate ( ) , 0.0 )
|
testQueueNoRemove ( ) { org . antlr . runtime . misc . FastQueue < java . lang . String > q = new org . antlr . runtime . misc . FastQueue < java . lang . String > ( ) ; q . add ( "a" ) ; q . add ( "b" ) ; q . add ( "c" ) ; q . add ( "d" ) ; q . add ( "e" ) ; java . lang . String expecting = "a<sp>b<sp>c<sp>d<sp>e" ; java . lang . String found = q . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return java . lang . String . format ( "%s<sp>type=%s<sp>codePoint=%d<sp>propertyIntervalSet=%s<sp>parseLength=%d" , super . toString ( ) , type , codePoint , propertyIntervalSet , parseLength ) ; }
|
org . junit . Assert . assertEquals ( expecting , found )
|
testCapitalizeWords12 ( ) { java . lang . Object s = null ; java . lang . String result = org . thymeleaf . util . StringUtils . capitalizeWords ( s ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( result , null )
|
testWithMap ( ) { final java . lang . String map = "map" ; final org . apache . oozie . fluentjob . api . action . PipesBuilder builder = new org . apache . oozie . fluentjob . api . action . PipesBuilder ( ) ; builder . withMap ( map ) ; final org . apache . oozie . fluentjob . api . action . Pipes pipes = builder . build ( ) ; "<AssertPlaceHolder>" ; } getMap ( ) { return map ; }
|
org . junit . Assert . assertEquals ( map , pipes . getMap ( ) )
|
testAllOptions ( ) { org . apache . whirr . ClusterControllerFactory factory = mock ( org . apache . whirr . ClusterControllerFactory . class ) ; org . apache . whirr . ClusterController controller = mock ( org . apache . whirr . ClusterController . class ) ; when ( factory . create ( ( ( java . lang . String ) ( any ( ) ) ) ) ) . thenReturn ( controller ) ; org . apache . whirr . cli . command . DestroyClusterCommand command = new org . apache . whirr . cli . command . DestroyClusterCommand ( factory ) ; java . util . Map < java . lang . String , java . io . File > keys = org . apache . whirr . util . KeyPair . generateTemporaryFiles ( ) ; int rc = command . run ( null , out , null , com . google . common . collect . Lists . newArrayList ( "version-string" 2 , "version-string" 5 , "--service-name" , "version-string" 7 , "version-string" 3 , "test-cluster" , "version-string" 8 , "version-string" 0 , "version-string" 1 , "myusername" , "version-string" 4 , "mypassword" , "version-string" 6 , keys . get ( "private" ) . getAbsolutePath ( ) , "--version" , "version-string" ) ) ; "<AssertPlaceHolder>" ; org . apache . commons . configuration . Configuration conf = new org . apache . commons . configuration . PropertiesConfiguration ( ) ; conf . addProperty ( "whirr.version" , "version-string" ) ; conf . addProperty ( "whirr.instance-templates" , "version-string" 5 ) ; org . apache . whirr . ClusterSpec expectedClusterSpec = org . apache . whirr . ClusterSpec . withTemporaryKeys ( conf ) ; expectedClusterSpec . setServiceName ( "version-string" 7 ) ; expectedClusterSpec . setProvider ( "version-string" 0 ) ; expectedClusterSpec . setIdentity ( "myusername" ) ; expectedClusterSpec . setCredential ( "mypassword" ) ; expectedClusterSpec . setClusterName ( "test-cluster" ) ; expectedClusterSpec . setPrivateKey ( keys . get ( "private" ) ) ; expectedClusterSpec . setPublicKey ( keys . get ( "public" ) ) ; verify ( factory ) . create ( "version-string" 7 ) ; verify ( controller ) . destroyCluster ( expectedClusterSpec ) ; } get ( java . lang . String ) { org . apache . whirr . service . DryRunModule . LOG . info ( ( ( ( ( toString ( ) ) + "<sp>>><sp>get(" ) + path ) + ")" ) ) ; org . jclouds . io . Payload returnVal = contents . get ( path ) ; try { org . apache . whirr . service . DryRunModule . LOG . info ( ( ( ( ( toString ( ) ) + "<sp><<<sp>md5[" ) + ( org . apache . whirr . service . DryRunModule . md5Hex ( org . jclouds . util . Strings2 . toString ( returnVal ) ) ) ) + "]" ) ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } return returnVal ; }
|
org . junit . Assert . assertThat ( rc , org . hamcrest . Matchers . is ( 0 ) )
|
testRoundTrip ( ) { org . sagebionetworks . repo . model . file . UploadDaemonStatus dto = new org . sagebionetworks . repo . model . file . UploadDaemonStatus ( ) ; dto . setRunTimeMS ( 10L ) ; dto . setErrorMessage ( "error" ) ; dto . setFileHandleId ( "123" ) ; dto . setDaemonId ( "456" ) ; dto . setPercentComplete ( 15.0 ) ; dto . setStartedBy ( "987" ) ; dto . setStartedOn ( new java . util . Date ( ) ) ; dto . setState ( State . COMPLETED ) ; org . sagebionetworks . repo . model . dbo . persistence . DBOUploadDaemonStatus dbo = org . sagebionetworks . repo . model . dbo . dao . UploadDaemonStatusUtils . createDBOFromDTO ( dto ) ; org . sagebionetworks . repo . model . file . UploadDaemonStatus clone = org . sagebionetworks . repo . model . dbo . dao . UploadDaemonStatusUtils . createDTOFromDBO ( dbo ) ; "<AssertPlaceHolder>" ; } createDTOFromDBO ( org . sagebionetworks . repo . model . dbo . persistence . DBOUploadDaemonStatus ) { if ( dbo == null ) throw new java . lang . IllegalArgumentException ( "DBOUploadDaemonStatus<sp>cannot<sp>be<sp>null" ) ; org . sagebionetworks . repo . model . file . UploadDaemonStatus dto = new org . sagebionetworks . repo . model . file . UploadDaemonStatus ( ) ; dto . setRunTimeMS ( dbo . getRunTimeMS ( ) ) ; dto . setErrorMessage ( dbo . getErrorMessage ( ) ) ; if ( ( dbo . getFileHandleId ( ) ) != null ) { dto . setFileHandleId ( dbo . getFileHandleId ( ) . toString ( ) ) ; } if ( ( dbo . getId ( ) ) != null ) { dto . setDaemonId ( dbo . getId ( ) . toString ( ) ) ; } dto . setPercentComplete ( dbo . getPercentComplete ( ) ) ; if ( ( dbo . getStartedBy ( ) ) != null ) { dto . setStartedBy ( dbo . getStartedBy ( ) . toString ( ) ) ; } if ( ( dbo . getStartedOn ( ) ) != null ) { dto . setStartedOn ( new java . util . Date ( dbo . getStartedOn ( ) ) ) ; } if ( ( dbo . getState ( ) ) != null ) { dto . setState ( org . sagebionetworks . repo . model . file . State . valueOf ( dbo . getState ( ) ) ) ; } return dto ; }
|
org . junit . Assert . assertEquals ( dto , clone )
|
getAutomorphismGroup_StartingPartitionTest ( ) { org . openscience . cdk . group . Partition partition = org . openscience . cdk . group . Partition . fromString ( "0,1|2,3" ) ; java . lang . String acpString = "C0C1C2C3<sp>0:1(1),0:3(1),1:2(1),2:3(1)" ; org . openscience . cdk . interfaces . IAtomContainer ac = org . openscience . cdk . group . AtomContainerPrinter . fromString ( acpString , org . openscience . cdk . group . AtomDiscretePartitionRefinerTest . builder ) ; org . openscience . cdk . group . AtomDiscretePartitionRefiner refiner = new org . openscience . cdk . group . AtomDiscretePartitionRefiner ( ) ; org . openscience . cdk . group . PermutationGroup autG = refiner . getAutomorphismGroup ( ac , partition ) ; "<AssertPlaceHolder>" ; } order ( ) { java . util . Collections . sort ( cells , new java . util . Comparator < java . util . SortedSet < java . lang . Integer > > ( ) { @ org . openscience . cdk . group . Override public int compare ( java . util . SortedSet < java . lang . Integer > cellA , java . util . SortedSet < java . lang . Integer > cellB ) { return cellA . first ( ) . compareTo ( cellB . first ( ) ) ; } } ) ; }
|
org . junit . Assert . assertEquals ( 2 , autG . order ( ) )
|
longHash_4Test ( ) { long hash = greycat . utility . HashHelper . longHash ( CoreConstants . END_OF_TIME , 10000 ) ; "<AssertPlaceHolder>" ; } longHash ( long , long ) { long hash = number % max ; return hash < 0 ? hash * ( - 1 ) : hash ; }
|
org . junit . Assert . assertTrue ( ( hash < 10000 ) )
|
equalsSelf ( ) { final com . lightboxtechnologies . nsrl . HashData hd = new com . lightboxtechnologies . nsrl . HashData ( com . lightboxtechnologies . nsrl . HashDataTest . sha1 , com . lightboxtechnologies . nsrl . HashDataTest . md5 , com . lightboxtechnologies . nsrl . HashDataTest . crc32 , com . lightboxtechnologies . nsrl . HashDataTest . name , com . lightboxtechnologies . nsrl . HashDataTest . size , com . lightboxtechnologies . nsrl . HashDataTest . prod_code , com . lightboxtechnologies . nsrl . HashDataTest . os_code , com . lightboxtechnologies . nsrl . HashDataTest . special_code ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return false ; }
|
org . junit . Assert . assertTrue ( hd . equals ( hd ) )
|
testOkLeeg ( ) { final nl . bzk . migratiebrp . bericht . model . sync . impl . BlokkeringInfoAntwoordBericht blokkeringInfoAntwoord = new nl . bzk . migratiebrp . bericht . model . sync . impl . BlokkeringInfoAntwoordBericht ( ) ; blokkeringInfoAntwoord . setStatus ( StatusType . OK ) ; blokkeringInfoAntwoord . setPersoonsaanduiding ( null ) ; final java . util . Map < java . lang . String , java . lang . Object > parameters = new java . util . HashMap ( ) ; parameters . put ( "blokkeringInfoAntwoordBericht" , berichtenDao . bewaarBericht ( blokkeringInfoAntwoord ) ) ; final java . util . Map < java . lang . String , java . lang . Object > result = subject . execute ( parameters ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( result . isEmpty ( ) )
|
testConfigureEnableGrouping ( ) { System . out . println ( ( ( getTestTraceHead ( "[NGSIMySQLSink.configure]" ) ) + "--------<sp>enable_grouping<sp>can<sp>only<sp>be<sp>'true'<sp>or<sp>'false'" ) ) ; java . lang . String attrPersistence = null ; java . lang . String batchSize = null ; java . lang . String batchTime = null ; java . lang . String batchTTL = null ; java . lang . String dataModel = null ; java . lang . String enableEncoding = null ; java . lang . String enableGrouping = "falso" ; java . lang . String enableLowercase = null ; java . lang . String host = null ; java . lang . String password = null ; java . lang . String port = null ; java . lang . String username = null ; com . telefonica . iot . cygnus . sinks . NGSIMySQLSink sink = new com . telefonica . iot . cygnus . sinks . NGSIMySQLSink ( ) ; sink . configure ( createContext ( attrPersistence , batchSize , batchTime , batchTTL , dataModel , enableEncoding , enableGrouping , enableLowercase , host , password , port , username ) ) ; try { "<AssertPlaceHolder>" ; System . out . println ( ( ( getTestTraceHead ( "[NGSIMySQLSink.configure]" ) ) + "-<sp>OK<sp>-<sp>'enable_grouping=falso'<sp>was<sp>detected" ) ) ; } catch ( java . lang . AssertionError e ) { System . out . println ( ( ( getTestTraceHead ( "[NGSIMySQLSink.configure]" ) ) + "-<sp>FAIL<sp>-<sp>'enable_grouping=falso'<sp>was<sp>not<sp>detected" ) ) ; throw e ; } getInvalidConfiguration ( ) { return invalidConfiguration ; }
|
org . junit . Assert . assertTrue ( sink . getInvalidConfiguration ( ) )
|
databaseIs_operation_should_compare_all_Indexes ( ) { com . lordofthejars . nosqlunit . elasticsearch2 . ElasticsearchOperation elasticsearchOperation = new com . lordofthejars . nosqlunit . elasticsearch2 . ElasticsearchOperation ( client ) ; elasticsearchOperation . insert ( new java . io . ByteArrayInputStream ( com . lordofthejars . nosqlunit . elasticsearch2 . integration . WhenManagedElasticsearchOperationsAreRequired . ELASTICSEARCH_DATA . getBytes ( ) ) ) ; boolean isEqual = elasticsearchOperation . databaseIs ( new java . io . ByteArrayInputStream ( com . lordofthejars . nosqlunit . elasticsearch2 . integration . WhenManagedElasticsearchOperationsAreRequired . ELASTICSEARCH_DATA . getBytes ( ) ) ) ; "<AssertPlaceHolder>" ; } databaseIs ( java . io . InputStream ) { return compareData ( contentStream ) ; }
|
org . junit . Assert . assertThat ( isEqual , org . hamcrest . CoreMatchers . is ( true ) )
|
testSetProjectId ( ) { com . google . cloud . compute . deprecated . NetworkId networkId = com . google . cloud . compute . deprecated . NetworkId . of ( com . google . cloud . compute . deprecated . NetworkIdTest . PROJECT , com . google . cloud . compute . deprecated . NetworkIdTest . NETWORK ) ; "<AssertPlaceHolder>" ; compareNetworkId ( networkId , com . google . cloud . compute . deprecated . NetworkId . of ( com . google . cloud . compute . deprecated . NetworkIdTest . NETWORK ) . setProjectId ( com . google . cloud . compute . deprecated . NetworkIdTest . PROJECT ) ) ; } setProjectId ( java . lang . String ) { if ( ( getProject ( ) ) != null ) { return this ; } return com . google . cloud . compute . deprecated . SubnetworkId . of ( projectId , getRegion ( ) , subnetwork ) ; }
|
org . junit . Assert . assertSame ( networkId , networkId . setProjectId ( com . google . cloud . compute . deprecated . NetworkIdTest . PROJECT ) )
|
testProcessURL ( ) { java . net . HttpURLConnection connection = createNiceMock ( java . net . HttpURLConnection . class ) ; org . apache . ambari . server . controller . internal . AppCookieManager appCookieManager = createNiceMock ( org . apache . ambari . server . controller . internal . AppCookieManager . class ) ; org . apache . ambari . server . controller . internal . URLStreamProvider urlStreamProvider = createMockBuilder ( org . apache . ambari . server . controller . internal . URLStreamProvider . class ) . withConstructor ( Integer . TYPE , Integer . TYPE , java . lang . String . class , java . lang . String . class , java . lang . String . class ) . withArgs ( 1000 , 1000 , "path" , "Header1" 0 , "type" ) . addMockedMethod ( "getAppCookieManager" ) . addMockedMethod ( "getConnection" , java . lang . String . class ) . createMock ( ) ; expect ( urlStreamProvider . getAppCookieManager ( ) ) . andReturn ( appCookieManager ) . anyTimes ( ) ; expect ( urlStreamProvider . getConnection ( "Header1" 1 ) ) . andReturn ( connection ) ; java . util . Map < java . lang . String , java . util . List < java . lang . String > > headerMap = new java . util . HashMap ( ) ; headerMap . put ( "Header1" , java . util . Collections . singletonList ( "value" ) ) ; headerMap . put ( "Cookie" , java . util . Collections . singletonList ( "FOO=bar" ) ) ; expect ( appCookieManager . getCachedAppCookie ( "Header1" 1 ) ) . andReturn ( "APPCOOKIE=abcdef" ) ; connection . setConnectTimeout ( 1000 ) ; connection . setReadTimeout ( 1000 ) ; connection . setRequestMethod ( "GET" ) ; connection . setRequestProperty ( "Header1" , "value" ) ; connection . setRequestProperty ( "Cookie" , "Header1" 2 ) ; replay ( urlStreamProvider , connection , appCookieManager ) ; "<AssertPlaceHolder>" ; verify ( urlStreamProvider , connection , appCookieManager ) ; } processURL ( java . lang . String , java . lang . String , byte [ ] , java . util . Map ) { if ( org . apache . ambari . server . controller . internal . URLStreamProvider . LOG . isDebugEnabled ( ) ) { org . apache . ambari . server . controller . internal . URLStreamProvider . LOG . debug ( "readFrom<sp>spec:{}" , spec ) ; } java . net . HttpURLConnection connection = ( ( spec . startsWith ( "https" ) ) && ( setupTruststoreForHttps ) ) ? getSSLConnection ( spec ) : getConnection ( spec ) ; org . apache . ambari . server . controller . internal . AppCookieManager appCookieManager = getAppCookieManager ( ) ; java . lang . String appCookie = appCookieManager . getCachedAppCookie ( spec ) ; if ( appCookie != null ) { org . apache . ambari . server . controller . internal . URLStreamProvider . LOG . debug ( "Using<sp>cached<sp>app<sp>cookie<sp>for<sp>URL:{}" , spec ) ; if ( ( headers == null ) || ( headers . isEmpty ( ) ) ) { headers = java . util . Collections . singletonMap ( org . apache . ambari . server . controller . internal . URLStreamProvider . COOKIE , java . util . Collections . singletonList ( appCookie ) ) ; } else { headers = new java . util . HashMap ( headers ) ; java . util . List < java . lang . String > cookieList = headers . get ( org . apache . ambari . server . controller . internal . URLStreamProvider . COOKIE ) ; java . lang . String cookies = ( ( cookieList == null ) || ( cookieList . isEmpty ( ) ) ) ? null : cookieList . get ( 0 ) ; headers . put ( org . apache . ambari . server . controller . internal . URLStreamProvider . COOKIE , java . util . Collections . singletonList ( org . apache . ambari . server . controller . internal . URLStreamProvider . appendCookie ( cookies , appCookie ) ) ) ; } } connection . setConnectTimeout ( connTimeout ) ; connection . setReadTimeout ( readTimeout ) ; connection . setDoOutput ( true ) ; connection . setRequestMethod ( requestMethod ) ; if ( headers != null ) { for ( Map . Entry < java . lang . String , java . util . List < java . lang . String > > entry : headers . entrySet ( ) ) { java . lang . String paramValue = entry . getValue ( ) . toString ( ) ; connection . setRequestProperty ( entry . getKey ( ) , paramValue . substring ( 1 , ( ( paramValue . length ( ) ) - 1 ) ) ) ; } } if ( body != null ) { connection . getOutputStream ( ) . write ( body ) ; } int statusCode = connection . getResponseCode ( ) ; if ( statusCode == ( org . apache . http . HttpStatus . SC_UNAUTHORIZED ) ) { java . lang . String wwwAuthHeader = connection . getHeaderField ( org . apache . ambari . server . controller . internal . URLStreamProvider . WWW_AUTHENTICATE ) ; if ( org . apache . ambari . server . controller . internal . URLStreamProvider . LOG . isInfoEnabled ( ) ) { org . apache . ambari . server . controller . internal . URLStreamProvider . LOG . info ( ( ( ( "Received<sp>WWW-Authentication<sp>header:" + wwwAuthHeader ) + ",<sp>for<sp>URL:" ) + spec ) ) ; } if ( ( wwwAuthHeader != null ) && ( wwwAuthHeader . trim ( ) . startsWith ( org . apache . ambari . server . controller . internal . URLStreamProvider . NEGOTIATE ) ) ) { connection = ( spec . startsWith ( "https" ) ) ? getSSLConnection ( spec )
|
org . junit . Assert . assertEquals ( connection , urlStreamProvider . processURL ( "Header1" 1 , "GET" , ( ( java . lang . String ) ( null ) ) , headerMap ) )
|
testParsesArrayField ( ) { org . apache . beam . sdk . schemas . Schema schema = org . apache . beam . sdk . schemas . Schema . builder ( ) . addInt32Field ( "f_int32" ) . addArrayField ( "f_intArray" , FieldType . INT32 ) . build ( ) ; java . lang . String rowString = "{\n" + ( ( "\"f_int32\"<sp>:<sp>32,\n" + "\"f_intArray\"<sp>:<sp>[<sp>1,<sp>2,<sp>3,<sp>4,<sp>5]\n" ) + "}" ) ; org . apache . beam . sdk . util . RowJsonDeserializer deserializer = org . apache . beam . sdk . util . RowJsonDeserializer . forSchema ( schema ) ; org . apache . beam . sdk . values . Row parsedRow = newObjectMapperWith ( deserializer ) . readValue ( rowString , org . apache . beam . sdk . values . Row . class ) ; org . apache . beam . sdk . values . Row expectedRow = org . apache . beam . sdk . values . Row . withSchema ( schema ) . addValues ( 32 , java . util . Arrays . asList ( 1 , 2 , 3 , 4 , 5 ) ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return observer ; }
|
org . junit . Assert . assertEquals ( expectedRow , parsedRow )
|
testClone ( ) { when ( originalItem . getType ( ) ) . thenReturn ( "type" ) ; when ( originalItem . getName ( ) ) . thenReturn ( "name" ) ; when ( originalItem . getLabel ( ) ) . thenReturn ( "label" ) ; when ( originalItem . getCategory ( ) ) . thenReturn ( "category" ) ; when ( originalItem . getGroupNames ( ) ) . thenReturn ( java . util . Arrays . asList ( "a" , "b" ) ) ; when ( mockFactory . createItem ( anyString ( ) , anyString ( ) ) ) . thenReturn ( mockItem ) ; org . eclipse . smarthome . core . items . Item res = itemBuilderFactory . newItemBuilder ( originalItem ) . build ( ) ; "<AssertPlaceHolder>" ; verify ( mockFactory ) . createItem ( eq ( "type" ) , eq ( "name" ) ) ; verify ( mockItem ) . setCategory ( eq ( "category" ) ) ; verify ( mockItem ) . addGroupNames ( eq ( java . util . Arrays . asList ( "a" , "b" ) ) ) ; verify ( mockItem ) . setLabel ( eq ( "label" ) ) ; } build ( ) { return config ; }
|
org . junit . Assert . assertSame ( mockItem , res )
|
testReflection ( ) { io . netty . handler . ssl . SslHandler sslHandler = ( ( io . netty . handler . ssl . SslHandler ) ( factory . createSslHandler ( new io . netty . channel . socket . nio . NioSocketChannel ( ) ) ) ) ; try { java . lang . reflect . Field field = io . netty . handler . ssl . SslHandler . class . getDeclaredField ( "maxPacketBufferSize" ) ; field . setAccessible ( true ) ; field . set ( sslHandler , 8192 ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . NoSuchFieldException e ) { e . printStackTrace ( ) ; } catch ( java . lang . IllegalAccessException e ) { e . printStackTrace ( ) ; } } get ( java . lang . String ) { return config . getProperty ( key , null ) ; }
|
org . junit . Assert . assertEquals ( field . get ( sslHandler ) , 8192 )
|
factoryShouldReturnBasicNetwork ( ) { com . android . volley . toolbox . HttpStack httpStack = com . navercorp . volleyextensions . volleyer . factory . HttpStackFactory . createDefaultHttpStack ( ) ; com . android . volley . Network network = com . navercorp . volleyextensions . volleyer . factory . DefaultRequestQueueFactory . getDefaultNetwork ( httpStack ) ; "<AssertPlaceHolder>" ; } getDefaultNetwork ( com . android . volley . toolbox . HttpStack ) { com . navercorp . volleyextensions . volleyer . util . Assert . notNull ( httpStack , "HttpStack" ) ; return new com . android . volley . toolbox . BasicNetwork ( httpStack ) ; }
|
org . junit . Assert . assertEquals ( network . getClass ( ) , com . android . volley . toolbox . BasicNetwork . class )
|
testFromEbXMLNull ( ) { org . openehealth . ipf . commons . ihe . xds . core . requests . query . FindFoldersQuery result = new org . openehealth . ipf . commons . ihe . xds . core . requests . query . FindFoldersQuery ( ) ; transformer . fromEbXML ( result , null ) ; "<AssertPlaceHolder>" ; } fromEbXML ( org . openehealth . ipf . commons . ihe . xds . core . requests . query . GetAllQuery , org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLAdhocQueryRequest ) { if ( ( query == null ) || ( ebXML == null ) ) { return ; } org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper slots = new org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper ( ebXML ) ; java . lang . String patientId = slots . toString ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . PATIENT_ID ) ; query . setPatientId ( org . openehealth . ipf . commons . ihe . xds . core . metadata . Hl7v2Based . parse ( patientId , org . openehealth . ipf . commons . ihe . xds . core . metadata . Identifiable . class ) ) ; query . setStatusDocuments ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_STATUS ) ) ; query . setStatusFolders ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . FOLDER_STATUS ) ) ; query . setStatusSubmissionSets ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . SUBMISSION_SET_STATUS ) ) ; query . setConfidentialityCodes ( slots . toCodeQueryList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE , org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE_SCHEME ) ) ; query . setFormatCodes ( slots . toCodeList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_FORMAT_CODE ) ) ; query . setHomeCommunityId ( ebXML . getHome ( ) ) ; query . setDocumentEntryTypes ( slots . toDocumentEntryType ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_TYPE ) ) ; }
|
org . junit . Assert . assertEquals ( new org . openehealth . ipf . commons . ihe . xds . core . requests . query . FindFoldersQuery ( ) , result )
|
linearTest ( ) { "<AssertPlaceHolder>" ; } isLinear ( ) { return true ; }
|
org . junit . Assert . assertFalse ( converter . isLinear ( ) )
|
testAutorisatieCache ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . Dienst dienst = nl . bzk . brp . domain . algemeen . AutAutUtil . zoekDienst ( nl . bzk . brp . domain . algemeen . TestAutorisaties . metSoortDienst ( SoortDienst . SELECTIE ) , SoortDienst . SELECTIE ) ; final nl . bzk . brp . domain . algemeen . Autorisatiebundel autorisatiebundel = new nl . bzk . brp . domain . algemeen . Autorisatiebundel ( nl . bzk . brp . domain . algemeen . TestAutorisaties . maak ( Rol . AFNEMER , dienst ) , dienst ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangLeveringsAutorisatie toegang = autorisatiebundel . getToegangLeveringsautorisatie ( ) ; toegang . setId ( 1 ) ; org . mockito . Mockito . when ( leveringsautorisatieService . geefToegangLeveringsAutorisatie ( org . mockito . Mockito . anyInt ( ) ) ) . thenReturn ( toegang ) ; final nl . bzk . brp . domain . internbericht . selectie . SelectieAutorisatieBericht selectieAutorisatieBericht = new nl . bzk . brp . domain . internbericht . selectie . SelectieAutorisatieBericht ( ) ; selectieAutorisatieBericht . setToegangLeveringsAutorisatieId ( toegang . getId ( ) ) ; selectieAutorisatieBericht . setDienstId ( 1 ) ; selectieAutorisatieBericht . setSelectietaakId ( 1 ) ; final nl . bzk . brp . domain . algemeen . Autorisatiebundel autorisatiebundelUitCache = verwerkerAutorisatieCache . getAutorisatiebundel ( selectieAutorisatieBericht , 1 ) ; "<AssertPlaceHolder>" ; verwerkerAutorisatieCache . getAutorisatiebundel ( selectieAutorisatieBericht , 1 ) ; org . mockito . Mockito . verify ( leveringsautorisatieService , times ( 1 ) ) . geefToegangLeveringsAutorisatie ( org . mockito . Mockito . anyInt ( ) ) ; verwerkerAutorisatieCache . clear ( ) ; verwerkerAutorisatieCache . getAutorisatiebundel ( selectieAutorisatieBericht , 1 ) ; org . mockito . Mockito . verify ( leveringsautorisatieService , times ( 2 ) ) . geefToegangLeveringsAutorisatie ( org . mockito . Mockito . anyInt ( ) ) ; verwerkerAutorisatieCache . getAutorisatiebundel ( selectieAutorisatieBericht , 2 ) ; org . mockito . Mockito . verify ( leveringsautorisatieService , times ( 3 ) ) . geefToegangLeveringsAutorisatie ( org . mockito . Mockito . anyInt ( ) ) ; verwerkerAutorisatieCache . getAutorisatiebundel ( selectieAutorisatieBericht , 2 ) ; org . mockito . Mockito . verify ( leveringsautorisatieService , times ( 3 ) ) . geefToegangLeveringsAutorisatie ( org . mockito . Mockito . anyInt ( ) ) ; } getToegangLeveringsautorisatie ( ) { return this . toegangLeveringsautorisatie ; }
|
org . junit . Assert . assertEquals ( autorisatiebundel . getToegangLeveringsautorisatie ( ) , autorisatiebundelUitCache . getToegangLeveringsautorisatie ( ) )
|
testAsErrorReplyWithToManyDocs ( ) { final com . allanbank . mongodb . bson . builder . DocumentBuilder db = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . addInteger ( "ok" , 1 ) ; db . pushArray ( "n" ) ; final java . util . List < com . allanbank . mongodb . bson . Document > docs = java . util . Arrays . asList ( db . build ( ) , com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . build ( ) ) ; final com . allanbank . mongodb . client . message . Reply reply = new com . allanbank . mongodb . client . message . Reply ( 0 , 0 , 0 , docs , false , false , false , true ) ; final com . allanbank . mongodb . Callback < com . allanbank . mongodb . MongoIterator < com . allanbank . mongodb . bson . Element > > mockCallback = createMock ( com . allanbank . mongodb . Callback . class ) ; replay ( mockCallback ) ; final com . allanbank . mongodb . client . callback . ReplyArrayCallback callback = new com . allanbank . mongodb . client . callback . ReplyArrayCallback ( "n" , mockCallback ) ; "<AssertPlaceHolder>" ; verify ( mockCallback ) ; } asError ( com . allanbank . mongodb . client . message . Reply ) { com . allanbank . mongodb . MongoDbException error = super . asError ( reply ) ; if ( error == null ) { final java . util . List < com . allanbank . mongodb . bson . Document > results = reply . getResults ( ) ; if ( ( results . size ( ) ) != 1 ) { error = new com . allanbank . mongodb . error . ReplyException ( reply , "Should<sp>only<sp>be<sp>a<sp>single<sp>document<sp>in<sp>the<sp>reply." ) ; } } return error ; }
|
org . junit . Assert . assertNotNull ( callback . asError ( reply ) )
|
removeAllStatements ( ) { org . wikidata . wdtk . datamodel . implementation . Set < java . lang . String > toRemove = new org . wikidata . wdtk . datamodel . implementation . HashSet ( ) ; toRemove . add ( statementIdA ) ; toRemove . add ( statementIdB ) ; org . wikidata . wdtk . datamodel . implementation . Map < java . lang . String , org . wikidata . wdtk . datamodel . implementation . List < org . wikidata . wdtk . datamodel . implementation . Statement > > removed = org . wikidata . wdtk . datamodel . implementation . TermedStatementDocumentImpl . removeStatements ( toRemove , initialStatements ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return snaks . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( removed . isEmpty ( ) )
|
checkReceivedMailContent_SubscriptionLine ( ) { org . oscm . ws . base . WebserviceTestBase . getMailReader ( ) . deleteMails ( ) ; createdSubscription = subscribe ( ) ; org . oscm . ws . SubscriptionServiceWSTest . subscrServiceForCustomer . reportIssue ( subscriptionID , mailSubjectToSend , mailContentToSend ) ; mailContentReceived = readContentFromServiceTicketMail ( ) ; "<AssertPlaceHolder>" ; checkTag ( "[Subscription]" , createdSubscription . getSubscriptionId ( ) , createdSubscription . getServiceInstanceId ( ) ) ; } readContentFromServiceTicketMail ( ) { return org . oscm . ws . base . WebserviceTestBase . getMailReader ( ) . getLastMailContentWithSubject ( org . oscm . ws . SubscriptionServiceWSTest . MAIL_SUBJECT_SERVICE_TICKET_EN ) ; }
|
org . junit . Assert . assertNotNull ( mailContentReceived )
|
shouldReturnEndOfSingleCharacterString ( ) { int position = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . indexOfWordEnd ( "a" , 0 ) ; "<AssertPlaceHolder>" ; } indexOfWordEnd ( java . lang . String , int ) { checkNotNull ( entityName ) ; checkElementIndex ( startIndex , entityName . length ( ) ) ; final int firstWordChar = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . indexOfWordChar ( entityName , startIndex ) ; if ( firstWordChar == ( - 1 ) ) { return - 1 ; } int lastIndex = firstWordChar + 1 ; for ( int i = lastIndex ; i < ( entityName . length ( ) ) ; i ++ ) { if ( ( edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isWordStart ( entityName , i ) ) || ( ! ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , i ) . isWordLetter ( ) ) ) ) { break ; } lastIndex ++ ; } return lastIndex ; }
|
org . junit . Assert . assertEquals ( 1 , position )
|
compileImportDateWithAlias ( ) { me . tomassetti . turin . compiler . TurinFile turinFile = new me . tomassetti . turin . parser . Parser ( ) . parse ( this . getClass ( ) . getResourceAsStream ( "/import_date_with_alias.to" ) ) ; java . lang . Compiler instance = new java . lang . Compiler ( getResolverFor ( turinFile ) , new java . lang . Compiler . Options ( ) ) ; java . util . List < me . tomassetti . turin . classloading . ClassFileDefinition > classFileDefinitions = instance . compile ( turinFile , new me . tomassetti . turin . compiler . MyErrorCollector ( ) ) ; "<AssertPlaceHolder>" ; me . tomassetti . turin . classloading . TurinClassLoader turinClassLoader = new me . tomassetti . turin . classloading . TurinClassLoader ( ) ; java . lang . Class mangaCharacterClass = turinClassLoader . addClass ( classFileDefinitions . get ( 0 ) . getName ( ) , classFileDefinitions . get ( 0 ) . getBytecode ( ) ) ; } compile ( me . tomassetti . turin . compiler . TurinFile , me . tomassetti . turin . compiler . errorhandling . ErrorCollector ) { ResolverRegistry . INSTANCE . record ( turinFile , resolver ) ; return new me . tomassetti . turin . compiler . Compilation ( resolver , errorCollector ) . compile ( turinFile ) ; }
|
org . junit . Assert . assertEquals ( 1 , classFileDefinitions . size ( ) )
|
testAllWithClass ( ) { java . lang . String h = "<p<sp>class=first>One<p<sp>class=first>Two<p>Three" ; leap . lang . jsoup . nodes . Document doc = leap . lang . jsoup . Jsoup . parse ( h ) ; leap . lang . jsoup . select . Elements ps = doc . select ( "*.first" ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . resources . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , ps . size ( ) )
|
testEscapeJavaRightShiftAtRightEdge ( ) { java . lang . String dir = getRandomDir ( ) ; writeFile ( dir , "a.st" , "a(x)<sp>::=<sp><<\\>>>" ) ; org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroupDir ( dir ) ; org . stringtemplate . v4 . ST st = group . getInstanceOf ( "a" ) ; st . add ( "x" , "parrt" ) ; java . lang . String expected = "\\>" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testRemoveAll_virtual ( ) { shell . setSize ( 100 , 100 ) ; shell . setLayout ( new org . eclipse . swt . layout . FillLayout ( ) ) ; org . eclipse . swt . widgets . Table table = createTable ( ( ( org . eclipse . swt . SWT . MULTI ) | ( org . eclipse . swt . SWT . VIRTUAL ) ) , 1 ) ; table . addListener ( SWT . SetData , new org . eclipse . swt . widgets . Listener ( ) { @ org . eclipse . swt . widgets . Override public void handleEvent ( org . eclipse . swt . widgets . Event event ) { org . eclipse . swt . widgets . Item item = ( ( org . eclipse . swt . widgets . Item ) ( event . item ) ) ; item . setText ( ( "Item<sp>" + ( event . index ) ) ) ; } } ) ; shell . layout ( ) ; shell . open ( ) ; table . setItemCount ( 10 ) ; table . removeAll ( ) ; "<AssertPlaceHolder>" ; } getItemCount ( ) { checkWidget ( ) ; return hasChildren ? getItemData ( ) . getChildren ( ) . size ( ) : 0 ; }
|
org . junit . Assert . assertEquals ( 0 , table . getItemCount ( ) )
|
handleWhiteboardCallback ( ) { org . apache . jackrabbit . oak . spi . security . authentication . callback . WhiteboardCallback cb = new org . apache . jackrabbit . oak . spi . security . authentication . callback . WhiteboardCallback ( ) ; callbackHandler . handle ( new javax . security . auth . callback . Callback [ ] { cb } ) ; "<AssertPlaceHolder>" ; } getWhiteboard ( ) { return whiteboard ; }
|
org . junit . Assert . assertSame ( whiteboard , cb . getWhiteboard ( ) )
|
testDecodeMultiClass ( ) { java . util . List < java . lang . String > encoded = java . util . Arrays . asList ( opennlp . tools . namefind . BioCodecTest . OTHER , opennlp . tools . namefind . BioCodecTest . A_START , opennlp . tools . namefind . BioCodecTest . A_CONTINUE , opennlp . tools . namefind . BioCodecTest . A_CONTINUE , opennlp . tools . namefind . BioCodecTest . OTHER , opennlp . tools . namefind . BioCodecTest . B_START , opennlp . tools . namefind . BioCodecTest . B_CONTINUE , opennlp . tools . namefind . BioCodecTest . OTHER , opennlp . tools . namefind . BioCodecTest . C_START , opennlp . tools . namefind . BioCodecTest . OTHER ) ; opennlp . tools . util . Span [ ] expected = new opennlp . tools . util . Span [ ] { new opennlp . tools . util . Span ( 1 , 4 , opennlp . tools . namefind . BioCodecTest . A_TYPE ) , new opennlp . tools . util . Span ( 5 , 7 , opennlp . tools . namefind . BioCodecTest . B_TYPE ) , new opennlp . tools . util . Span ( 8 , 9 , opennlp . tools . namefind . BioCodecTest . C_TYPE ) } ; opennlp . tools . util . Span [ ] actual = opennlp . tools . namefind . BioCodecTest . codec . decode ( encoded ) ; "<AssertPlaceHolder>" ; } decode ( java . util . List ) { int start = - 1 ; int end = - 1 ; java . util . List < opennlp . tools . util . Span > spans = new java . util . ArrayList ( c . size ( ) ) ; for ( int li = 0 ; li < ( c . size ( ) ) ; li ++ ) { java . lang . String chunkTag = c . get ( li ) ; if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . START ) ) { if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( li - 1 ) ) ) ) ) ; } start = li ; end = li + 1 ; } else if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . CONTINUE ) ) { end = li + 1 ; } else if ( chunkTag . endsWith ( opennlp . tools . namefind . BioCodec . OTHER ) ) { if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( li - 1 ) ) ) ) ) ; start = - 1 ; end = - 1 ; } } } if ( start != ( - 1 ) ) { spans . add ( new opennlp . tools . util . Span ( start , end , opennlp . tools . namefind . BioCodec . extractNameType ( c . get ( ( ( c . size ( ) ) - 1 ) ) ) ) ) ; } return spans . toArray ( new opennlp . tools . util . Span [ spans . size ( ) ] ) ; }
|
org . junit . Assert . assertArrayEquals ( expected , actual )
|
testFindSQLExceptionNoMatch ( ) { java . lang . RuntimeException wrapped = new java . lang . RuntimeException ( new java . lang . RuntimeException ( "Just<sp>a<sp>runtime" ) ) ; java . sql . SQLException sqlException = org . sagebionetworks . repo . model . dbo . dao . table . TableExceptionTranslatorImpl . findSQLException ( wrapped ) ; "<AssertPlaceHolder>" ; } findSQLException ( java . lang . Throwable ) { java . lang . Throwable cause = exception ; while ( cause != null ) { if ( cause instanceof java . sql . SQLException ) { return ( ( java . sql . SQLException ) ( cause ) ) ; } else { cause = cause . getCause ( ) ; } } return null ; }
|
org . junit . Assert . assertEquals ( null , sqlException )
|
voteGetCurrentPollTest ( ) { int currentPollId = pollDao . getMostRecentPollId ( ) ; ru . org . linux . poll . Poll poll = pollDao . getMostRecentPoll ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( currentPollId , poll . getId ( ) )
|
testBatchDeleteCheckForData ( ) { int [ ] res ; java . util . List < com . ctrip . platform . dal . dao . unitbase . ClientTestModel > modelList = null ; try { res = dao . batchDelete ( new com . ctrip . platform . dal . dao . unittests . DalHints ( ) , modelList ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { } modelList = new java . util . ArrayList ( ) ; res = dao . batchDelete ( new com . ctrip . platform . dal . dao . unittests . DalHints ( ) , modelList ) ; "<AssertPlaceHolder>" ; } batchDelete ( com . ctrip . platform . dal . dao . DalHints , java . util . List ) { if ( ( null == daoPojos ) || ( ( daoPojos . size ( ) ) <= 0 ) ) { return new int [ 0 ] ; } hints = com . ctrip . platform . dal . dao . DalHints . createIfAbsent ( hints ) ; return client . batchDelete ( hints , daoPojos ) ; }
|
org . junit . Assert . assertArrayEquals ( new int [ 0 ] , res )
|
Static_getFirstType_notFirst ( ) { com . psddev . dari . util . List < com . psddev . dari . util . HtmlMicrodata > microdatas = HtmlMicrodata . Static . parseDocument ( com . psddev . dari . util . HtmlMicrodataTest . testUrl , com . psddev . dari . util . HtmlMicrodataTest . getDocument ( "simple-content.html" ) ) ; com . psddev . dari . util . HtmlMicrodata microdata = HtmlMicrodata . Static . getFirstType ( microdatas , com . psddev . dari . util . Arrays . asList ( new java . lang . String [ ] { "http://schema.org/NotRecipe" , "http://schema.org/Recipe" } ) ) ; "<AssertPlaceHolder>" ; } getFirstType ( ) { return ( ( types ) != null ) && ( ! ( types . isEmpty ( ) ) ) ? types . iterator ( ) . next ( ) : null ; }
|
org . junit . Assert . assertEquals ( "http://schema.org/Recipe" , microdata . getFirstType ( ) )
|
shouldHaveEquivalentHashCodesForEquivalentSequences ( ) { com . redhat . darcy . ui . By . BySequence thingSequence = com . redhat . darcy . ui . By . sequence ( new com . redhat . darcy . ui . BySequenceTest . IdCounter ( "thing_" ) , 1 ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return backingList ( ) . hashCode ( ) ; }
|
org . junit . Assert . assertThat ( thingSequence . hashCode ( ) , org . hamcrest . Matchers . equalTo ( com . redhat . darcy . ui . By . sequence ( new com . redhat . darcy . ui . BySequenceTest . IdCounter ( "thing_" ) , 1 ) . hashCode ( ) ) )
|
testLiveBackingList1 ( ) { long [ ] a = new long [ ] { 9L , 8L } ; java . util . List < java . lang . Integer > l = org . osgi . util . converter . Converters . standardConverter ( ) . convert ( a ) . view ( ) . to ( new org . osgi . util . converter . TypeReference < java . util . List < java . lang . Integer > > ( ) { } ) ; a [ 0 ] = 7L ; l . addAll ( java . util . Arrays . asList ( 7 , 6 ) ) ; a [ 0 ] = 1L ; "<AssertPlaceHolder>" ; } addAll ( int , java . util . Collection ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( 7 , 8 , 7 , 6 ) , l )
|
checkAbilityToStartServiceUsingNonLocalhostIP ( ) { service = new io . appium . java_client . service . local . AppiumServiceBuilder ( ) . withIPAddress ( io . appium . java_client . service . local . ServerBuilderTest . testIP ) . build ( ) ; service . start ( ) ; "<AssertPlaceHolder>" ; } isRunning ( ) { lock . lock ( ) ; try { if ( ( process ) == null ) { return false ; } if ( ! ( process . isRunning ( ) ) ) { return false ; } try { ping ( 1500 , TimeUnit . MILLISECONDS ) ; return true ; } catch ( org . openqa . selenium . net . UrlChecker e ) { return false ; } catch ( java . net . MalformedURLException e ) { throw new io . appium . java_client . service . local . AppiumServerHasNotBeenStartedLocallyException ( e . getMessage ( ) , e ) ; } } finally { lock . unlock ( ) ; } }
|
org . junit . Assert . assertTrue ( service . isRunning ( ) )
|
getColumnMetadataShouldHandle400Exception ( ) { solrColumnMetadataDao = spy ( new org . apache . metron . solr . dao . SolrColumnMetadataDao ( null ) ) ; org . apache . solr . common . SolrException solrException = new org . apache . solr . common . SolrException ( SolrException . ErrorCode . BAD_REQUEST , "solr<sp>exception" ) ; doThrow ( solrException ) . when ( solrColumnMetadataDao ) . getIndexFields ( "bro" ) ; java . util . Map < java . lang . String , org . apache . metron . indexing . dao . search . FieldType > columnMetadata = solrColumnMetadataDao . getColumnMetadata ( java . util . Collections . singletonList ( "bro" ) ) ; "<AssertPlaceHolder>" ; } getColumnMetadata ( java . util . List ) { try { if ( ( indices == null ) || ( indices . isEmpty ( ) ) ) { indices = getDefaultIndices ( ) ; indices . add ( org . apache . metron . rest . service . impl . METAALERT_TYPE ) ; org . apache . metron . rest . service . impl . SearchServiceImpl . LOG . debug ( java . lang . String . format ( "No<sp>indices<sp>provided<sp>for<sp>getColumnMetadata.<sp>Using<sp>default<sp>indices:<sp>%s" , java . lang . String . join ( "," , indices ) ) ) ; } return dao . getColumnMetadata ( indices ) ; } catch ( java . io . IOException ioe ) { throw new org . apache . metron . rest . RestException ( ioe . getMessage ( ) , ioe ) ; } }
|
org . junit . Assert . assertNotNull ( columnMetadata )
|
testOpenNewFileCompareEditor ( ) { editorReferences . add ( getMockFileCompareEditor ( ) ) ; item . setId ( "New<sp>File<sp>Item<sp>ID" ) ; org . eclipse . compare . CompareEditorInput newInput = org . eclipse . mylyn . internal . gerrit . ui . GerritCompareUi . getComparisonEditorInput ( editorReferences . toArray ( org . eclipse . mylyn . internal . gerrit . ui . GerritCompareUiTest . EMPTY_IEDITOR_REFERENCE_ARRAY ) , fileItemEditorInput , org . eclipse . mylyn . internal . gerrit . ui . GerritCompareUi . getFileComparePredicate ( item ) ) ; "<AssertPlaceHolder>" ; } getFileComparePredicate ( org . eclipse . mylyn . reviews . core . model . IFileItem ) { return new com . google . common . base . Predicate < org . eclipse . compare . CompareEditorInput > ( ) { @ org . eclipse . mylyn . internal . gerrit . ui . Override public boolean apply ( org . eclipse . compare . CompareEditorInput existingEditorInput ) { if ( existingEditorInput instanceof org . eclipse . mylyn . internal . reviews . ui . compare . FileItemCompareEditorInput ) { return ( ( org . eclipse . mylyn . internal . reviews . ui . compare . FileItemCompareEditorInput ) ( existingEditorInput ) ) . getFileItemId ( ) . equals ( item . getId ( ) ) ; } return false ; } } ; }
|
org . junit . Assert . assertEquals ( newInput , fileItemEditorInput )
|
metricsPublisherUnrouted ( ) { com . rabbitmq . client . impl . StandardMetricsCollector metrics = new com . rabbitmq . client . impl . StandardMetricsCollector ( ) ; connectionFactory . setMetricsCollector ( metrics ) ; com . rabbitmq . client . Connection connection = null ; try { connection = connectionFactory . newConnection ( ) ; com . rabbitmq . client . Channel channel = connection . createChannel ( ) ; channel . confirmSelect ( ) ; "<AssertPlaceHolder>" ; channel . basicPublish ( "amq.direct" , "any-unroutable-routing-key" , true , MessageProperties . MINIMAL_BASIC , "any-message" . getBytes ( ) ) ; waitAtMost ( timeout ( ) ) . until ( ( ) -> metrics . getPublishUnroutedMessages ( ) . getCount ( ) , org . hamcrest . Matchers . equalTo ( 1L ) ) ; } finally { safeClose ( connection ) ; } } getPublishUnroutedMessages ( ) { return publishUnroutedMessages ; }
|
org . junit . Assert . assertThat ( metrics . getPublishUnroutedMessages ( ) . getCount ( ) , org . hamcrest . Matchers . is ( 0L ) )
|
testDismissCache_removeIntRange ( ) { org . roaringbitmap . FastRankRoaringBitmap fast = prepareFastWithComputedCache ( ) ; fast . remove ( 0L , 2 ) ; "<AssertPlaceHolder>" ; } isCacheDismissed ( ) { return ! ( cumulatedCardinalitiesCacheIsValid ) ; }
|
org . junit . Assert . assertTrue ( fast . isCacheDismissed ( ) )
|
login_bad_credentials ( ) { oakbot . chat . Site site = new oakbot . chat . Site ( "domain.com" ) ; oakbot . util . Http http = new oakbot . util . Http ( new oakbot . chat . MockHttpClientBuilder ( ) . login ( "domain.com" , "0123456789abcdef0123456789abcdef" , "email@example.com" , "password" , false ) . build ( ) ) ; "<AssertPlaceHolder>" ; oakbot . chat . SiteTest . verifyNumberOfRequestsSent ( http , 2 ) ; } login ( java . lang . String , java . lang . String , oakbot . util . Http ) { oakbot . util . Http . Response response = http . get ( ( ( "https://" + ( getDomain ( ) ) ) + "/users/login" ) ) ; org . jsoup . nodes . Document loginPage = response . getBodyAsHtml ( ) ; org . jsoup . select . Elements elements = loginPage . select ( "input[name=fkey]" ) ; if ( elements . isEmpty ( ) ) { throw new java . io . IOException ( "\"fkey\"<sp>field<sp>not<sp>found<sp>on<sp>Stack<sp>Exchange<sp>login<sp>page,<sp>cannot<sp>login." ) ; } java . lang . String fkey = elements . first ( ) . attr ( "value" ) ; response = http . post ( ( ( "https://" + ( getDomain ( ) ) ) + "/users/login" ) , "email" , email , "password" , password , "fkey" , fkey ) ; int statusCode = response . getStatusCode ( ) ; return statusCode == 302 ; }
|
org . junit . Assert . assertFalse ( site . login ( "email@example.com" , "password" , http ) )
|
testGetAvailablePaymentTypesFromSupplier_WithRelationNoPaymentTypes ( ) { addPaymentTypesToOrganizationRef ( supplierIds . get ( 0 ) , OrganizationRoleType . SUPPLIER ) ; container . login ( java . lang . String . valueOf ( supplier1User . getKey ( ) ) , org . oscm . accountservice . bean . ROLE_SERVICE_MANAGER ) ; java . util . Set < org . oscm . internal . vo . VOPaymentType > orgPt = createVOPaymentTypes ( org . oscm . accountservice . bean . INVOICE , org . oscm . accountservice . bean . CREDIT_CARD ) ; java . util . List < org . oscm . internal . vo . VOOrganizationPaymentConfiguration > conf = new java . util . ArrayList ( ) ; accountMgmt . savePaymentConfiguration ( orgPt , conf , orgPt , null ) ; java . lang . Long userKey = runTX ( new java . util . concurrent . Callable < java . lang . Long > ( ) { @ org . oscm . accountservice . bean . Override public org . oscm . accountservice . bean . Long call ( ) throws org . oscm . accountservice . bean . Exception { org . oscm . domobjects . Organization supplier = org . oscm . test . data . Organizations . findOrganization ( mgr , supplierIds . get ( 0 ) ) ; org . oscm . domobjects . Organization cust = org . oscm . test . data . Organizations . createCustomer ( mgr , supplier ) ; org . oscm . domobjects . PlatformUser user = org . oscm . test . data . Organizations . createUserForOrg ( mgr , cust , true , "testAdmin" ) ; return java . lang . Long . valueOf ( user . getKey ( ) ) ; } } ) ; java . lang . Long [ ] productKeys = prepareProducts ( ServiceStatus . ACTIVE ) ; container . login ( userKey . longValue ( ) , org . oscm . accountservice . bean . ROLE_ORGANIZATION_ADMIN ) ; java . util . Set < org . oscm . internal . vo . VOPaymentType > actual = accountMgmt . getAvailablePaymentTypesFromOrganization ( productKeys [ 0 ] ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return false ; }
|
org . junit . Assert . assertTrue ( actual . isEmpty ( ) )
|
testEmptyTextBoxesShouldReturnAnEmptyStringNotNull ( ) { org . openqa . selenium . qtwebkit . nativetests . WebElement emptyTextBox = driver . findElement ( org . openqa . selenium . qtwebkit . nativetests . By . id ( "emptyInput" ) ) ; "<AssertPlaceHolder>" ; } getText ( ) { return stb . getText ( ) ; }
|
org . junit . Assert . assertEquals ( emptyTextBox . getText ( ) , "" )
|
testSerdeScanResultValueNonCompactedList ( ) { java . lang . String serialized = org . apache . druid . query . scan . ScanResultValueTest . JSON_MAPPER . writeValueAsString ( org . apache . druid . query . scan . ScanResultValueTest . listSRV ) ; org . apache . druid . query . scan . ScanResultValue deserialized = org . apache . druid . query . scan . ScanResultValueTest . JSON_MAPPER . readValue ( serialized , org . apache . druid . query . scan . ScanResultValue . class ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( org . apache . druid . query . scan . ScanResultValueTest . listSRV , deserialized )
|
shouldReturnEmptyQueryOnEmptyListOfSunion ( ) { when ( localParamsMock . get ( "command" ) ) . thenReturn ( "sunion" ) ; when ( localParamsMock . get ( "key" ) ) . thenReturn ( "key1" ) ; when ( localParamsMock . get ( "key1" ) ) . thenReturn ( "key2" ) ; when ( localParamsMock . getParameterNamesIterator ( ) ) . thenReturn ( com . sematext . solr . redis . Arrays . asList ( "command" , "key" , "key1" ) . iterator ( ) ) ; when ( localParamsMock . get ( QueryParsing . V ) ) . thenReturn ( "string_field" ) ; when ( jedisMock . sunion ( anyString ( ) , anyString ( ) ) ) . thenReturn ( new com . sematext . solr . redis . HashSet < java . lang . String > ( ) ) ; when ( requestMock . getSchema ( ) ) . thenReturn ( schema ) ; when ( schema . getQueryAnalyzer ( ) ) . thenReturn ( new org . apache . lucene . analysis . standard . StandardAnalyzer ( ) ) ; redisQParser = new com . sematext . solr . redis . RedisQParser ( "string_field" , localParamsMock , paramsMock , requestMock , commandHandler ) ; final org . apache . lucene . search . Query query = redisQParser . parse ( ) ; verify ( jedisMock ) . sunion ( "key1" , "key2" ) ; org . apache . lucene . search . IndexSearcher searcher = new org . apache . lucene . search . IndexSearcher ( new org . apache . lucene . index . MultiReader ( ) ) ; final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = com . sematext . solr . redis . TestRedisQParser . extractTerms ( searcher , query ) ; "<AssertPlaceHolder>" ; } extractTerms ( org . apache . lucene . search . IndexSearcher , org . apache . lucene . search . Query ) { final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = new com . sematext . solr . redis . HashSet ( ) ; org . apache . lucene . search . Query rewrittenQuery = searcher . rewrite ( query ) ; if ( rewrittenQuery instanceof org . apache . lucene . search . ConstantScoreQuery ) { org . apache . lucene . search . ConstantScoreQuery constantScoreQuery = ( ( org . apache . lucene . search . ConstantScoreQuery ) ( rewrittenQuery ) ) ; rewrittenQuery = constantScoreQuery . getQuery ( ) ; } searcher . createNormalizedWeight ( rewrittenQuery , true ) . extractTerms ( terms ) ; return terms ; }
|
org . junit . Assert . assertEquals ( 0 , terms . size ( ) )
|
count_booleans_arraylist_apachecommons ( ) { java . util . List < java . lang . Boolean > values = com . google . common . collect . Lists . newArrayList ( true , true , false , true , false ) ; int count = org . apache . commons . collections . CollectionUtils . countMatches ( values , new org . apache . commons . collections . Predicate ( ) { @ com . levelup . java . collections . Override public boolean evaluate ( java . lang . Object object ) { java . lang . Boolean val = ( ( java . lang . Boolean ) ( object ) ) ; return val . booleanValue ( ) ; } } ) ; "<AssertPlaceHolder>" ; } evaluate ( java . lang . Object ) { com . levelup . java . collections . ListContainsAll . Camera camera = ( ( com . levelup . java . collections . ListContainsAll . Camera ) ( object ) ) ; return ( camera . focalLength ) >= 80 ; }
|
org . junit . Assert . assertEquals ( 3 , count )
|
testSelect ( ) { final java . util . concurrent . atomic . AtomicLong counter = new java . util . concurrent . atomic . AtomicLong ( 0 ) ; select ( connection , org . github . lambatuples . SQLTest . SQL , ( java . sql . ResultSet rs , long cnt ) -> { counter . incrementAndGet ( ) ; } ) ; "<AssertPlaceHolder>" ; } select ( org . github . lambatuples . Connection , java . lang . String , org . github . lambatuples . ResultSetProcessor , java . lang . Object [ ] ) { try ( org . github . lambatuples . PreparedStatement ps = connection . prepareStatement ( sql ) ) { int cnt = 0 ; for ( java . lang . Object param : params ) { ps . setObject ( ( ++ cnt ) , param ) ; } try ( org . github . lambatuples . ResultSet rs = ps . executeQuery ( ) ) { long rowCnt = 0 ; while ( rs . next ( ) ) { processor . process ( rs , ( rowCnt ++ ) ) ; } } catch ( org . github . lambatuples . SQLException e ) { throw new org . github . lambatuples . DataAccessException ( e ) ; } } catch ( org . github . lambatuples . SQLException e ) { throw new org . github . lambatuples . DataAccessException ( e ) ; } }
|
org . junit . Assert . assertTrue ( ( ( counter . get ( ) ) > 0 ) )
|
setMeasurand_frequency_measurandIsSet ( ) { java . lang . String measurand = "Frequency" ; sampledValue . setMeasurand ( measurand ) ; "<AssertPlaceHolder>" ; } getMeasurand ( ) { return measurand ; }
|
org . junit . Assert . assertThat ( sampledValue . getMeasurand ( ) , org . hamcrest . CoreMatchers . equalTo ( measurand ) )
|
testConvertAllWithNoRelations ( ) { java . lang . String name = "first<sp>blood" ; java . lang . String abbrName = "fb" ; java . lang . Long id = 1L ; org . lnu . is . domain . specoffer . SpecOfferType source = new org . lnu . is . domain . specoffer . SpecOfferType ( ) ; source . setName ( name ) ; source . setAbbrName ( abbrName ) ; source . setId ( id ) ; org . lnu . is . resource . specoffer . type . SpecOfferTypeResource expected = new org . lnu . is . resource . specoffer . type . SpecOfferTypeResource ( ) ; expected . setName ( name ) ; expected . setAbbrName ( abbrName ) ; expected . setId ( id ) ; java . lang . String name1 = "first<sp>blood1" ; java . lang . String abbrName1 = "fb1" ; java . lang . Long id1 = 2L ; org . lnu . is . domain . specoffer . SpecOfferType source1 = new org . lnu . is . domain . specoffer . SpecOfferType ( ) ; source1 . setName ( name1 ) ; source1 . setAbbrName ( abbrName1 ) ; source1 . setId ( id1 ) ; org . lnu . is . resource . specoffer . type . SpecOfferTypeResource expected1 = new org . lnu . is . resource . specoffer . type . SpecOfferTypeResource ( ) ; expected1 . setName ( name1 ) ; expected1 . setAbbrName ( abbrName1 ) ; expected1 . setId ( id1 ) ; java . util . List < org . lnu . is . domain . specoffer . SpecOfferType > sources = java . util . Arrays . asList ( source , source1 ) ; java . util . List < org . lnu . is . resource . specoffer . type . SpecOfferTypeResource > expecteds = java . util . Arrays . asList ( expected , expected1 ) ; java . util . List < org . lnu . is . resource . specoffer . type . SpecOfferTypeResource > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( expecteds , actuals )
|
checkSettingExecutables ( ) { org . eclipse . ice . item . jobLauncher . SuiteLauncher launcher = new org . eclipse . ice . item . jobLauncher . SuiteLauncher ( null ) ; java . util . ArrayList < java . lang . String > execs = new java . util . ArrayList < java . lang . String > ( ) ; execs . add ( "conj_ht" ) ; execs . add ( "conj_ht_moab" ) ; execs . add ( "testExec" ) ; launcher . addExecutables ( execs ) ; org . eclipse . ice . datastructures . form . DataComponent execComp = ( ( org . eclipse . ice . datastructures . form . DataComponent ) ( launcher . getForm ( ) . getComponent ( ( ( org . eclipse . ice . item . jobLauncher . JobLauncherForm . parallelId ) + 2 ) ) ) ) ; org . eclipse . ice . datastructures . entry . IEntry execEntry = execComp . retrieveAllEntries ( ) . get ( 0 ) ; "<AssertPlaceHolder>" ; return ; } getAllowedValues ( ) { return null ; }
|
org . junit . Assert . assertEquals ( execs , execEntry . getAllowedValues ( ) )
|
testSelectNullElementValue ( ) { com . feilong . store . member . User zhangfei = new com . feilong . store . member . User ( "" , 23 ) ; com . feilong . store . member . User guanyu = new com . feilong . store . member . User ( "" , 30 ) ; com . feilong . store . member . User liubei = new com . feilong . store . member . User ( "" , 25 ) ; java . util . List < com . feilong . store . member . User > list = toList ( zhangfei , guanyu , liubei ) ; "<AssertPlaceHolder>" ; } select ( java . lang . Iterable , java . lang . String , V [ ] ) { return com . feilong . core . Validator . isNullOrEmpty ( beanIterable ) ? java . util . Collections . < O > emptyList ( ) : com . feilong . core . util . CollectionsUtil . select ( beanIterable , com . feilong . core . util . predicate . BeanPredicateUtil . < O , V > containsPredicate ( propertyName , propertyValues ) ) ; }
|
org . junit . Assert . assertEquals ( emptyList ( ) , com . feilong . core . util . CollectionsUtil . select ( list , "name" , ( ( java . lang . String ) ( null ) ) ) )
|
createSfTestEmptyNameFail ( ) { org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . sft . rev140701 . service . function . types . ServiceFunctionType sfType = new org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . sft . rev140701 . service . function . types . ServiceFunctionTypeBuilder ( ) . setType ( new org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . common . rev151017 . SftTypeName ( "" ) ) . build ( ) ; boolean result = org . opendaylight . sfc . tacker . api . TackerManagerTest . tackerManager . createSf ( sfType ) ; org . opendaylight . sfc . tacker . api . TackerManagerTest . LOG . debug ( ( "createSfTestEmptyNameFail<sp>passed:<sp>" + ( ! result ) ) ) ; "<AssertPlaceHolder>" ; } createSf ( org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . sft . rev140701 . service . function . types . ServiceFunctionType ) { org . opendaylight . sfc . tacker . dto . Token authToken = getToken ( ) ; if ( authToken == null ) { org . opendaylight . sfc . tacker . api . TackerManager . LOG . error ( "Failed<sp>to<sp>Acquire<sp>Authentication<sp>token!" ) ; return false ; } javax . ws . rs . client . WebTarget webTarget = client . target ( ( ( ( baseUri ) + ":" ) + ( tackerPort ) ) ) . path ( "/v1.0/vnfs" ) ; org . opendaylight . sfc . tacker . dto . TackerRequest tackerRequest = org . opendaylight . sfc . tacker . dto . TackerRequest . builder ( ) . setVnf ( org . opendaylight . sfc . tacker . dto . Vnf . builder ( ) . setName ( sfType . getType ( ) . getValue ( ) ) . setAttributes ( org . opendaylight . sfc . tacker . dto . Attributes . builder ( ) . setServiceType ( sfType . getType ( ) . getValue ( ) ) . build ( ) ) . build ( ) ) . build ( ) ; javax . ws . rs . core . Response response = webTarget . request ( MediaType . APPLICATION_JSON ) . header ( "X-Auth-Token" , authToken . getId ( ) ) . header ( "X-Auth-Project-Id" , authToken . getTenant ( ) . getName ( ) ) . post ( javax . ws . rs . client . Entity . entity ( org . opendaylight . sfc . tacker . api . TackerManager . GSON . toJson ( tackerRequest ) , MediaType . APPLICATION_JSON ) ) ; if ( response != null ) { switch ( response . getStatus ( ) ) { case 201 : java . lang . String json = response . readEntity ( java . lang . String . class ) ; org . opendaylight . sfc . tacker . dto . TackerResponse tackerResponse = org . opendaylight . sfc . tacker . api . TackerManager . GSON . fromJson ( json , org . opendaylight . sfc . tacker . dto . TackerResponse . class ) ; org . opendaylight . sfc . tacker . api . TackerManager . LOG . info ( "VNF<sp>successfully<sp>created." ) ; org . opendaylight . sfc . tacker . api . TackerManager . LOG . debug ( "Response<sp>{}" , org . opendaylight . sfc . tacker . api . TackerManager . GSON . toJson ( tackerResponse ) ) ; return true ; case 401 : org . opendaylight . sfc . tacker . api . TackerManager . LOG . debug ( "Unauthorized!<sp>Wrong<sp>username<sp>or<sp>password." ) ; break ; default : org . opendaylight . sfc . tacker . dto . TackerError error = org . opendaylight . sfc . tacker . api . TackerManager . GSON . fromJson ( response . readEntity ( java . lang . String . class ) , org . opendaylight . sfc . tacker . dto . TackerError . class ) ; org . opendaylight . sfc . tacker . api . TackerManager . LOG . debug ( "Error<sp>{}" , error . toString ( ) ) ; break ; } } return false ; }
|
org . junit . Assert . assertFalse ( result )
|
shouldConvert ( ) { br . com . uol . pagseguro . api . utils . RequestMap expectedMap = new br . com . uol . pagseguro . api . utils . RequestMap ( ) ; expectedMap . putMap ( new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( "extraAmount" , "10.00" ) ; put ( "paymentMode" , "paymentMode" ) ; put ( "currency" , "BRL" ) ; put ( "notificationURL" , "notificationURL" ) ; put ( "reference" , "reference" ) ; } } ) ; br . com . uol . pagseguro . api . utils . RequestMap map = mapConverter . convert ( transactionRegistration ) ; "<AssertPlaceHolder>" ; } convert ( br . com . uol . pagseguro . api . common . domain . AccountRegisterSuggestion ) { if ( account == null ) { return null ; } br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter convertedAccount = new br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter ( ) ; convertedAccount . setEmail ( account . getEmail ( ) ) ; convertedAccount . setType ( account . getType ( ) ) ; convertedAccount . setPerson ( br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter . PERSON_V_2_XML_CONVERTER . convert ( account . getPerson ( ) ) ) ; convertedAccount . setCompany ( br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter . COMPANY_V_2_XML_CONVERTER . convert ( account . getCompany ( ) ) ) ; return convertedAccount ; }
|
org . junit . Assert . assertEquals ( expectedMap , map )
|
testGetQueryStringRemovingParams ( ) { io . undertow . server . HttpServerExchange exchange = new io . undertow . server . HttpServerExchange ( ) ; exchange . setQueryString ( "a=1&b=2&c=3" ) ; exchange . addQueryParam ( "a" , "1" ) . addQueryParam ( "b" , "2" ) . addQueryParam ( "c" , "3" ) ; java . lang . String expResult = "a=1&c=3" ; java . lang . String result = org . restheart . utils . URLUtils . getQueryStringRemovingParams ( exchange , "b" ) ; "<AssertPlaceHolder>" ; } getQueryStringRemovingParams ( io . undertow . server . HttpServerExchange , java . lang . String [ ] ) { java . lang . String ret = exchange . getQueryString ( ) ; if ( ( ( ret == null ) || ( ret . isEmpty ( ) ) ) || ( paramsToRemove == null ) ) { return ret ; } for ( java . lang . String key : paramsToRemove ) { java . util . Deque < java . lang . String > values = exchange . getQueryParameters ( ) . get ( key ) ; if ( values != null ) { for ( java . lang . String value : values ) { ret = ret . replaceAll ( ( ( ( key + "=" ) + value ) + "&" ) , "" ) ; ret = ret . replaceAll ( ( ( ( key + "=" ) + value ) + "$" ) , "" ) ; } } } return ret ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testEdorg ( ) { org . slc . sli . domain . Entity edorg = helper . generateEdorgWithParent ( null ) ; "<AssertPlaceHolder>" ; } canAccess ( org . slc . sli . domain . Entity ) { return canAccess ( entity , true ) ; }
|
org . junit . Assert . assertTrue ( validator . canAccess ( edorg ) )
|
testWrongAnnotationEPL ( ) { java . lang . String EPL1 = "<sp>select<sp>*<sp>from<sp>TestEvent;<sp>" + ( "<sp>Select<sp>timemillis<sp>from<sp>TestEvent;<sp>" + "<sp>@testing(\"omc\")<sp>select<sp>*<sp>from<sp>TestEvent;<sp>" ) ; com . ebay . jetstream . event . processor . esper . EPL epl = new com . ebay . jetstream . event . processor . esper . EPL ( ) ; epl . setStatementBlock ( EPL1 ) ; com . ebay . jetstream . event . processor . esper . EsperProcessor proc = new com . ebay . jetstream . event . processor . esper . EsperProcessor ( ) ; com . ebay . jetstream . event . processor . esper . EsperConfiguration config = new com . ebay . jetstream . event . processor . esper . EsperConfiguration ( ) ; config . addEventType ( "TestEvent" , com . ebay . jetstream . epl . EPLCompileTest . TestEvents . class ) ; proc . setConfiguration ( config ) ; "<AssertPlaceHolder>" ; } compileEPL ( com . ebay . jetstream . event . processor . esper . EPL ) { com . ebay . jetstream . event . processor . esper . EsperProcessor . EsperInternals esperInternals = null ; try { if ( epl != null ) { esperInternals = new com . ebay . jetstream . event . processor . esper . EsperProcessor . EsperInternals ( "compileEngine" , epl ) ; esperInternals . compile ( false ) ; return true ; } return false ; } finally { if ( esperInternals != null ) { esperInternals . getEsperService ( ) . destroy ( ) ; esperInternals . clear ( ) ; } } }
|
org . junit . Assert . assertFalse ( proc . compileEPL ( epl ) )
|
testEncryptionDecryptionGFSBox ( ) { ch . bfh . unicrypt . crypto . schemes . encryption . classes . AESEncryptionScheme aes = ch . bfh . unicrypt . crypto . schemes . encryption . classes . AESEncryptionScheme . getInstance ( AESEncryptionScheme . KeyLength . KEY128 , AESEncryptionScheme . Mode . ECB , ch . bfh . unicrypt . helper . array . classes . ByteArray . getInstance ( "00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00" . toUpperCase ( ) ) ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element < ch . bfh . unicrypt . helper . array . classes . ByteArray > message = aes . getMessageSpace ( ) . getElement ( "F3|44|81|EC|3C|C6|27|BA|CD|5D|C3|FB|08|F2|73|E6|97|98|C4|64|0B|AD|75|C7|C3|22|7D|B9|10|17|4E|72|96|AB|5C|2F|F6|12|D9|DF|AA|E8|C3|1F|30|C4|21|68|6A|11|8A|87|45|19|E6|4E|99|63|79|8A|50|3F|1D|35|CB|9F|CE|EC|81|28|6C|A3|E9|89|BD|97|9B|0C|B2|84|B2|6A|EB|18|74|E4|7C|A8|35|8F|F2|23|78|F0|91|44|58|C8|E0|0B|26|31|68|6D|54|EA|B8|4B|91|F0|AC|A1" ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element < ch . bfh . unicrypt . helper . array . classes . ByteArray > key = aes . getSecretKeyGenerator ( ) . getSecretKeySpace ( ) . getElement ( "00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00" ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element < ch . bfh . unicrypt . helper . array . classes . ByteArray > encryptedMessage = aes . encrypt ( key , message ) ; ch . bfh . unicrypt . math . algebra . general . interfaces . Element < ch . bfh . unicrypt . helper . array . classes . ByteArray > expectedEncryption = aes . getEncryptionSpace ( ) . getElement ( "03|36|76|3E|96|6D|92|59|5A|56|7C|C9|CE|53|7F|5E|A9|A1|63|1B|F4|99|69|54|EB|C0|93|95|7B|23|45|89|FF|4F|83|91|A6|A4|0C|A5|B2|5D|23|BE|DD|44|A5|97|DC|43|BE|40|BE|0E|53|71|2F|7E|2B|F5|CA|70|72|09|92|BE|ED|AB|18|95|A9|4F|AA|69|B6|32|E5|CC|47|CE|45|92|64|F4|79|8F|6A|78|BA|CB|89|C1|5E|D3|D6|01|08|A4|E2|EF|EC|8A|8E|33|12|CA|74|60|B9|04|0B|BF" ) ; "<AssertPlaceHolder>" ; } getElement ( long ) { return this . getElement ( java . math . BigInteger . valueOf ( integerValue ) ) ; }
|
org . junit . Assert . assertEquals ( encryptedMessage , expectedEncryption )
|
toVOCategory_noLocalization ( ) { org . oscm . domobjects . Category categoryWithoutLocalization = new org . oscm . domobjects . Category ( ) ; categoryWithoutLocalization . setMarketplace ( new org . oscm . domobjects . Marketplace ( ) ) ; org . oscm . internal . vo . VOCategory resultingTransferObject = org . oscm . marketplace . assembler . CategoryAssembler . toVOCategory ( categoryWithoutLocalization , localizer ) ; "<AssertPlaceHolder>" ; } getName ( ) { return operation . getOperationName ( ) ; }
|
org . junit . Assert . assertNull ( resultingTransferObject . getName ( ) )
|
convertsNullToNull ( ) { com . sjl . dsl4xml . support . convert . IntegerStringConverter _c = new com . sjl . dsl4xml . support . convert . IntegerStringConverter ( ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { return ( aValue == null ) || ( "" . equals ( aValue ) ) ? 0 : new java . lang . Long ( aValue ) ; }
|
org . junit . Assert . assertEquals ( null , _c . convert ( null ) )
|
testNewBroadcastComparison1 ( ) { org . nd4j . linalg . api . ndarray . INDArray initial = org . nd4j . linalg . factory . Nd4j . create ( 3 , 5 ) ; org . nd4j . linalg . api . ndarray . INDArray mask = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 5 , 4 , 3 , 2 , 1 } ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 1 , 1 , 0 , 0 } ) ; for ( int i = 0 ; i < ( initial . columns ( ) ) ; i ++ ) { initial . getColumn ( i ) . assign ( i ) ; } org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . commit ( ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . BroadcastLessThan ( initial , mask , initial , 1 ) ) ; for ( int i = 0 ; i < ( initial . rows ( ) ) ; i ++ ) { "<AssertPlaceHolder>" ; } } getRow ( long ) { if ( ( isRowVector ( ) ) && ( r == 0 ) ) return this ; else if ( ( isRowVector ( ) ) && ( r > 0 ) ) throw new java . lang . IllegalArgumentException ( "Illegal<sp>index<sp>for<sp>row" ) ; org . nd4j . linalg . api . ndarray . INDArray result = get ( org . nd4j . linalg . api . ndarray . NDArrayIndex . point ( r ) , org . nd4j . linalg . api . ndarray . NDArrayIndex . all ( ) ) ; if ( ( ( ( ! ( this . isView ( ) ) ) && ( ( this . ordering ( ) ) == 'c' ) ) && ( ( result . elementWiseStride ( ) ) == 1 ) ) && ( ( result . ordering ( ) ) != 'c' ) ) { ( ( org . nd4j . linalg . api . ndarray . BaseNDArray ) ( result ) ) . setShapeInformation ( org . nd4j . linalg . factory . Nd4j . getShapeInfoProvider ( ) . createShapeInformation ( result . shape ( ) , result . stride ( ) , 0 , 1 , 'c' ) ) ; } return result ; }
|
org . junit . Assert . assertEquals ( exp , initial . getRow ( i ) )
|
empty ( ) { com . jnape . palatable . lambda . iteration . PrependingIterator < java . lang . Integer > iterator = new com . jnape . palatable . lambda . iteration . PrependingIterator ( 0 , emptyIterator ( ) ) ; "<AssertPlaceHolder>" ; thrown . expect ( java . util . NoSuchElementException . class ) ; iterator . next ( ) ; } hasNext ( ) { return iterator . hasNext ( ) ; }
|
org . junit . Assert . assertFalse ( iterator . hasNext ( ) )
|
testGetUserManagerUnsupportedCallbackException ( ) { org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModule loginModule = org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . initLoginModule ( org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . TestCredentials . class , new org . apache . jackrabbit . oak . spi . security . authentication . ThrowingCallbackHandler ( false ) ) ; "<AssertPlaceHolder>" ; } getUserManager ( ) { root . refresh ( ) ; return getUserManager ( root ) ; }
|
org . junit . Assert . assertNull ( loginModule . getUserManager ( ) )
|
testConvertDiscoveryEntryWithMetaInfoToDiscoveryEntry ( ) { boolean isLocal = true ; joynr . types . DiscoveryEntryWithMetaInfo discoveryEntry = new joynr . types . DiscoveryEntryWithMetaInfo ( new joynr . types . Version ( 42 , 23 ) , "testDomain" , "testInterfaceName" , "testParticipantId" , new joynr . types . ProviderQos ( ) , 4711L , 4712L , "testPublicKeyId" , isLocal ) ; joynr . types . DiscoveryEntry convertedEntry = io . joynr . capabilities . CapabilityUtils . convertToDiscoveryEntry ( discoveryEntry ) ; "<AssertPlaceHolder>" ; compareDiscoveryEntries ( isLocal , convertedEntry , discoveryEntry ) ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof io . joynr . messaging . info . PerformanceMeasures ) ) { return false ; } io . joynr . messaging . info . PerformanceMeasures p = ( ( io . joynr . messaging . info . PerformanceMeasures ) ( obj ) ) ; return p . measures . equals ( measures ) ; }
|
org . junit . Assert . assertTrue ( joynr . types . DiscoveryEntry . class . equals ( convertedEntry . getClass ( ) ) )
|
serializeRevenueShareDetails ( ) { org . oscm . billingservice . business . model . mpownershare . RevenueShareDetails revenueDetails = new org . oscm . billingservice . business . model . mpownershare . RevenueShareDetails ( ) ; java . lang . String xmlAsString = serialize ( revenueDetails ) ; System . out . println ( xmlAsString ) ; org . w3c . dom . Document doc = org . oscm . converter . XMLConverter . convertToDocument ( xmlAsString , false ) ; org . w3c . dom . Node revenueDetailsNode = org . oscm . converter . XMLConverter . getNodeByXPath ( doc , "/RevenueShareDetails" ) ; java . lang . String value = org . oscm . converter . XMLConverter . getStringAttValue ( revenueDetailsNode , "amountForSupplier" ) ; "<AssertPlaceHolder>" ; } getStringAttValue ( org . w3c . dom . Node , java . lang . String ) { java . lang . String result = null ; org . w3c . dom . Node attNode = node . getAttributes ( ) . getNamedItem ( attName ) ; if ( attNode != null ) { result = attNode . getNodeValue ( ) ; } return result ; }
|
org . junit . Assert . assertNull ( value )
|
testResolveIObjectFromJSON ( ) { info . smart_tools . smartactors . iobject . ifield_name . IFieldName fieldName = info . smart_tools . smartactors . ioc . ioc . IOC . resolve ( info . smart_tools . smartactors . ioc . named_keys_storage . Keys . getOrAdd ( "info.smart_tools.smartactors.iobject.ifield_name.IFieldName" ) , "name" ) ; info . smart_tools . smartactors . iobject . iobject . IObject object = info . smart_tools . smartactors . ioc . ioc . IOC . resolve ( info . smart_tools . smartactors . ioc . named_keys_storage . Keys . getOrAdd ( "info.smart_tools.smartactors.iobject.iobject.IObject" ) , "{<sp>\"name\":<sp>\"value\"<sp>}" ) ; "<AssertPlaceHolder>" ; } getValue ( info . smart_tools . smartactors . iobject . ifield_name . IFieldName ) { if ( null == name ) { throw new info . smart_tools . smartactors . base . exception . invalid_argument_exception . InvalidArgumentException ( "Name<sp>parameter<sp>should<sp>not<sp>be<sp>null." ) ; } return fieldSet . read ( initIObject , name ) ; }
|
org . junit . Assert . assertEquals ( "value" , object . getValue ( fieldName ) )
|
testDeletePrimaryIndexKey ( ) { insertKeys ( getHive ( ) ) ; org . hivedb . meta . directory . DbDirectory d = getDirectory ( ) ; for ( java . lang . String key : getPrimaryIndexOrResourceKeys ( ) ) { d . deletePrimaryIndexKey ( key ) ; "<AssertPlaceHolder>" ; } } getKeySemamphoresOfPrimaryIndexKey ( java . lang . Object ) { return doRead ( sql . selectKeySemaphoreOfPrimaryIndexKey ( partitionDimension ) , new java . lang . Object [ ] { primaryIndexKey } , new org . hivedb . meta . directory . KeySemaphoreRowMapper ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , d . getKeySemamphoresOfPrimaryIndexKey ( key ) . size ( ) )
|
testValidateTagKey ( ) { org . finra . herd . model . api . xml . TagKey tagKey = new org . finra . herd . model . api . xml . TagKey ( TAG_TYPE , TAG_CODE ) ; when ( alternateKeyHelper . validateStringParameter ( "tag<sp>type<sp>code" , org . finra . herd . service . helper . TAG_TYPE ) ) . thenReturn ( org . finra . herd . service . helper . TAG_TYPE ) ; when ( alternateKeyHelper . validateStringParameter ( "tag<sp>code" , org . finra . herd . service . helper . TAG_CODE ) ) . thenReturn ( org . finra . herd . service . helper . TAG_CODE ) ; tagHelper . validateTagKey ( tagKey ) ; verify ( alternateKeyHelper ) . validateStringParameter ( "tag<sp>type<sp>code" , org . finra . herd . service . helper . TAG_TYPE ) ; verify ( alternateKeyHelper ) . validateStringParameter ( "tag<sp>code" , org . finra . herd . service . helper . TAG_CODE ) ; verifyNoMoreInteractions ( alternateKeyHelper , jsonHelper ) ; "<AssertPlaceHolder>" ; } validateStringParameter ( java . lang . String , java . lang . String ) { return validateStringParameter ( "A" , parameterName , parameterValue ) ; }
|
org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . TagKey ( TAG_TYPE , TAG_CODE ) , tagKey )
|
testToArray01 ( ) { javax . el . ELProcessor processor = new javax . el . ELProcessor ( ) ; processor . defineBean ( "beans" , org . apache . el . stream . TestCollectionOperations . beans ) ; java . lang . Object result = processor . getValue ( "beans.stream().toArray()" , java . lang . Object . class ) ; java . lang . Object [ ] expected = new java . lang . Object [ 3 ] ; expected [ 0 ] = org . apache . el . stream . TestCollectionOperations . bean01 ; expected [ 1 ] = org . apache . el . stream . TestCollectionOperations . bean02 ; expected [ 2 ] = org . apache . el . stream . TestCollectionOperations . bean03 ; "<AssertPlaceHolder>" ; } getValue ( java . lang . String , java . lang . Class ) { javax . el . ValueExpression ve = factory . createValueExpression ( context , javax . el . ELProcessor . bracket ( expression ) , expectedType ) ; return ve . getValue ( context ) ; }
|
org . junit . Assert . assertArrayEquals ( expected , ( ( java . lang . Object [ ] ) ( result ) ) )
|
whenUsingTheSpyAnnotation_thenObjectIsSpied ( ) { aSpyList . add ( "one" ) ; aSpyList . add ( "two" ) ; org . mockito . Mockito . verify ( aSpyList ) . add ( "one" ) ; org . mockito . Mockito . verify ( aSpyList ) . add ( "two" ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , aSpyList . size ( ) )
|
indexGenAndQueryInsertOnB ( ) { com . google . appengine . api . datastore . Entity entity = new com . google . appengine . api . datastore . Entity ( "indexGen" ) ; entity . setProperty ( "text" , "B" ) ; getService ( ) . put ( entity ) ; waitForSync ( ) ; int count = getService ( ) . prepare ( new com . google . appengine . api . datastore . Query ( "indexGen" ) ) . countEntities ( com . google . appengine . api . datastore . FetchOptions . Builder . withDefaults ( ) ) ; "<AssertPlaceHolder>" ; } withDefaults ( ) { return FetchOptions . Builder . withDefaults ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , count )
|
withHelperRegistry ( ) { com . github . jknack . handlebars . HelperRegistry registry = createMock ( com . github . jknack . handlebars . HelperRegistry . class ) ; replay ( registry ) ; com . github . jknack . handlebars . Handlebars handlebars = new com . github . jknack . handlebars . Handlebars ( ) . with ( registry ) ; "<AssertPlaceHolder>" ; verify ( registry ) ; } with ( com . github . jknack . handlebars . io . TemplateLoader [ ] ) { org . apache . commons . lang3 . Validate . isTrue ( ( ( loader . length ) > 0 ) , "The<sp>template<sp>loader<sp>is<sp>required." ) ; this . loader = ( ( loader . length ) == 1 ) ? loader [ 0 ] : new com . github . jknack . handlebars . io . CompositeTemplateLoader ( loader ) ; return this ; }
|
org . junit . Assert . assertNotNull ( handlebars )
|
changeParameter ( ) { final org . apache . hc . core5 . testing . framework . ClientTestingAdapter adapter = new org . apache . hc . core5 . testing . framework . ClassicTestClientTestingAdapter ( ) { @ org . apache . hc . core5 . testing . framework . Override public java . util . Map < java . lang . String , java . lang . Object > execute ( final java . lang . String defaultURI , final java . util . Map < java . lang . String , java . lang . Object > request , final org . apache . hc . core5 . testing . framework . TestingFrameworkRequestHandler requestHandler , final java . util . Map < java . lang . String , java . lang . Object > responseExpectations ) throws org . apache . hc . core5 . testing . framework . TestingFrameworkException { @ org . apache . hc . core5 . testing . framework . SuppressWarnings ( "unchecked" ) final java . util . Map < java . lang . String , java . lang . String > query = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( request . get ( org . apache . hc . core5 . testing . framework . ClientPOJOAdapter . QUERY ) ) ) ; "<AssertPlaceHolder>" ; query . put ( "p1" , ( ( query . get ( "p1" ) ) + "junk" ) ) ; return super . execute ( defaultURI , request , requestHandler , responseExpectations ) ; } } ; final org . apache . hc . core5 . testing . framework . TestingFramework framework = newFrameworkAndSetAdapter ( adapter ) ; framework . addTest ( ) ; try { framework . runTests ( ) ; org . junit . Assert . fail ( "WebServerTestingFrameworkException<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( final org . apache . hc . core5 . testing . framework . TestingFrameworkException e ) { } } get ( int ) { int i = ( ( head ) - index ) - 1 ; if ( i < 0 ) { i = ( array . length ) + i ; } return array [ i ] ; }
|
org . junit . Assert . assertTrue ( query . containsKey ( "p1" ) )
|
runTest ( ) { boolean result = checkNoError ( "Social_Forums_Remove_Topic" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
|
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
|
testProjectStructureWithDuplicateBundle ( ) { com . facebook . buck . core . model . BuildTarget libraryTarget = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( rootPath , "//foo:lib" ) ; com . facebook . buck . core . model . BuildTarget bundleTarget = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( rootPath , "//foo:bundle" ) ; com . facebook . buck . core . model . BuildTarget libraryWithFlavorTarget = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( rootPath , "//foo:lib#iphonesimulator-x86_64" ) ; com . facebook . buck . core . model . BuildTarget bundleWithFlavorTarget = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( rootPath , "//foo:bundle#iphonesimulator-x86_64" ) ; com . facebook . buck . core . model . targetgraph . TargetNode < ? > libraryNode = com . facebook . buck . apple . AppleLibraryBuilder . createBuilder ( libraryTarget ) . setExportedHeaders ( com . google . common . collect . ImmutableSortedSet . of ( com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "foo.h" ) ) ) . build ( ) ; com . facebook . buck . core . model . targetgraph . TargetNode < ? > bundleNode = com . facebook . buck . apple . AppleBundleBuilder . createBuilder ( bundleTarget ) . setBinary ( libraryTarget ) . setExtension ( com . facebook . buck . util . types . Either . ofLeft ( AppleBundleExtension . FRAMEWORK ) ) . setInfoPlist ( com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "Info.plist" ) ) . build ( ) ; com . facebook . buck . core . model . targetgraph . TargetNode < ? > libraryWithFlavorNode = com . facebook . buck . apple . AppleLibraryBuilder . createBuilder ( libraryWithFlavorTarget ) . setExportedHeaders ( com . google . common . collect . ImmutableSortedSet . of ( com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "foo.h" ) ) ) . build ( ) ; com . facebook . buck . core . model . targetgraph . TargetNode < ? > bundleWithFlavorNode = com . facebook . buck . apple . AppleBundleBuilder . createBuilder ( bundleWithFlavorTarget ) . setBinary ( libraryTarget ) . setExtension ( com . facebook . buck . util . types . Either . ofLeft ( AppleBundleExtension . FRAMEWORK ) ) . setInfoPlist ( com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "Info.plist" ) ) . build ( ) ; com . google . common . collect . ImmutableSet < com . facebook . buck . core . model . targetgraph . TargetNode < ? > > nodes = com . google . common . collect . ImmutableSet . of ( libraryNode , bundleNode , libraryWithFlavorNode , bundleWithFlavorNode ) ; com . facebook . buck . features . apple . project . ProjectGenerator projectGenerator = createProjectGenerator ( nodes , nodes , com . facebook . buck . features . apple . project . ProjectGeneratorOptions . builder ( ) . build ( ) , com . google . common . collect . ImmutableSet . of ( com . facebook . buck . core . model . InternalFlavor . of ( "iphonesimulator-x86_64" ) , com . facebook . buck . core . model . InternalFlavor . of ( "macosx-x86_64" ) ) , java . util . Optional . empty ( ) ) ; projectGenerator . createXcodeProjects ( ) ; int count = 0 ; com . facebook . buck . apple . xcode . xcodeproj . PBXProject project = projectGenerator . getGeneratedProject ( ) ; for ( com . facebook . buck . apple . xcode . xcodeproj . PBXTarget target : project . getTargets ( ) ) { if ( target . getProductName ( ) . equals ( "bundle" ) ) { count ++ ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return ( obj instanceof com . facebook . buck . intellij . ideabuck . impl . BuckCellManagerImpl . CellImpl ) && ( getBuckCell ( ) . equals ( ( ( com . facebook . buck . intellij . ideabuck . impl . BuckCellManagerImpl . CellImpl ) ( obj ) ) . getBuckCell ( ) ) ) ; }
|
org . junit . Assert . assertSame ( count , 1 )
|
testGetTimeZoneWhenTimeZoneIsNotSet ( ) { doReturn ( "" ) . when ( loader ) . getSystemPropertyTimeZone ( ) ; final java . util . TimeZone timeZone = mock ( java . util . TimeZone . class ) ; final int expectedOffset = 36000000 ; mockStatic ( java . util . TimeZone . class ) ; when ( java . util . TimeZone . getDefault ( ) ) . thenReturn ( timeZone ) ; when ( timeZone . getOffset ( anyInt ( ) ) ) . thenReturn ( expectedOffset ) ; "<AssertPlaceHolder>" ; } getLoaderOffset ( ) { final java . util . Map < java . lang . String , java . lang . String > preferences = loader . load ( ) ; return preferences . get ( org . kie . workbench . common . services . backend . preferences . KIE_TIMEZONE_OFFSET ) ; }
|
org . junit . Assert . assertEquals ( java . lang . String . valueOf ( expectedOffset ) , getLoaderOffset ( ) )
|
testOffsetForFacetInstallerWithoutPrefix ( ) { net . roboconf . tooling . core . autocompletion . Couple couple = prepare ( "app2" , "edited2.graph" , 140 ) ; couple . text += "\nfacet<sp>myfacet<sp>{\n\tinstaller:<sp>" ; java . util . List < net . roboconf . tooling . core . autocompletion . ICompletionProposer . RoboconfCompletionProposal > proposals = couple . proposer . findProposals ( couple . text ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . map . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , proposals . size ( ) )
|
testUpdateLongField ( ) { com . jmethods . catatumbo . entities . LongField entity = new com . jmethods . catatumbo . entities . LongField ( ) ; entity . setDistanceFromEarth ( 9876543210L ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . insert ( entity ) ; entity . setDistanceFromEarth ( 987654321098765L ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . update ( entity ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . load ( com . jmethods . catatumbo . entities . LongField . class , entity . getId ( ) ) ; "<AssertPlaceHolder>" ; } getDistanceFromEarth ( ) { return distanceFromEarth ; }
|
org . junit . Assert . assertTrue ( ( ( entity . getDistanceFromEarth ( ) ) == 987654321098765L ) )
|
ensembleScoringTest_Audit_1 ( ) { org . apache . pig . impl . logicalLayer . schema . Schema inputSchema = buildAuditInputSchema ( ) ; org . apache . pig . data . Tuple inputTuple = tf . newTuple ( ) ; org . apache . pig . data . Tuple expected = tf . newTuple ( ) ; { inputTuple = this . buildAuditInputEvent ( 1038288L , 45 , "Private" , "Bachelor" , "Married" , "Repair" , 27743.82 , "Repair" 1 , 0 , 55 , "Repair" 0 , 7298 , 1 ) ; expected = this . buildAuditOutputEvent ( 1038288L , 45 , "Private" , "Bachelor" , "Married" , "Repair" , 27743.82 , "Repair" 1 , 0 , 55 , "Repair" 0 , 7298 , 1 , "0" ) ; } org . surus . pig . ScorePMML evalPMML = new org . surus . pig . ScorePMML ( this . ensembleAuditModelPath ) ; org . apache . pig . impl . logicalLayer . schema . Schema outputScheam = evalPMML . outputSchema ( inputSchema ) ; org . apache . pig . data . Tuple observed = evalPMML . exec ( inputTuple ) ; if ( expected . equals ( observed ) ) { System . out . println ( "ensembleScoringTest_Audit_1:<sp>PASS" ) ; } else { System . out . println ( "----------<sp>EPIC<sp>FAIL:<sp>ensembleScoringTest_Audit_1<sp>----------" ) ; System . out . println ( ( "Expected:<sp>" + ( expected . toString ( ) ) ) ) ; System . out . println ( ( "Observed:<sp>" + ( observed . toString ( ) ) ) ) ; System . out . println ( "--------<sp>END<sp>EPIC<sp>FAIL<sp>--------" ) ; } "<AssertPlaceHolder>" ; } exec ( org . apache . pig . data . Tuple ) { if ( ( this . dataBagSchema ) == null ) { this . dataBagSchema = getInputSchema ( ) . getField ( 0 ) . schema . getField ( 0 ) . schema ; } if ( ! ( ( ( ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . LONG ) ) || ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . INTEGER ) ) ) || ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . DOUBLE ) ) ) || ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . FLOAT ) ) ) ) { throw new java . lang . RuntimeException ( java . lang . String . format ( "Data<sp>type<sp>of<sp>%s<sp>(%s)<sp>is<sp>not<sp>supported," , this . colName , org . apache . pig . data . DataType . findTypeName ( this . dataBagSchema . getField ( this . colName ) . type ) ) ) ; } org . apache . pig . data . DataBag inputBag = ( ( org . apache . pig . data . DataBag ) ( input . get ( 0 ) ) ) ; org . apache . pig . data . TupleFactory tupleFactory = org . apache . pig . data . TupleFactory . getInstance ( ) ; org . apache . pig . data . BagFactory bagFactory = org . apache . pig . data . BagFactory . getInstance ( ) ; java . util . List < org . apache . pig . data . Tuple > tupleList = new java . util . ArrayList < org . apache . pig . data . Tuple > ( ) ; java . util . Iterator < org . apache . pig . data . Tuple > bagIter = inputBag . iterator ( ) ; while ( bagIter . hasNext ( ) ) { org . apache . pig . data . Tuple tuple = bagIter . next ( ) ; tupleList . add ( tuple ) ; } if ( ( tupleList . size ( ) ) != ( ( this . nRows ) * ( this . nCols ) ) ) { throw new java . lang . RuntimeException ( "ERROR:<sp>this.nRows<sp>*<sp>this.nCols<sp>!=<sp>tupleList.size()" ) ; } double [ ] inputArray = new double [ ( this . nRows ) * ( this . nCols ) ] ; java . lang . Integer numNonZeroRecords = 0 ; for ( int n = 0 ; n < ( inputArray . length ) ; n ++ ) { if ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . DOUBLE ) ) { inputArray [ n ] = ( ( java . lang . Double ) ( tupleList . get ( n ) . get ( this . dataBagSchema . getPosition ( this . colName ) ) ) ) ; } else if ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . FLOAT ) ) { inputArray [ n ] = ( ( java . lang . Float ) ( tupleList . get ( n ) . get ( this . dataBagSchema . getPosition ( this . colName ) ) ) ) ; } else if ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . LONG ) ) { inputArray [ n ] = ( ( java . lang . Long ) ( tupleList . get ( n ) . get ( this . dataBagSchema . getPosition ( this . colName ) ) ) ) ; } else if ( ( this . dataBagSchema . getField ( this . colName ) .
|
org . junit . Assert . assertEquals ( expected , observed )
|
encodeResponse ( ) { io . netty . channel . embedded . EmbeddedChannel channel = new io . netty . channel . embedded . EmbeddedChannel ( new org . apache . jackrabbit . oak . segment . standby . codec . GetReferencesResponseEncoder ( ) ) ; channel . writeOutbound ( new org . apache . jackrabbit . oak . segment . standby . codec . GetReferencesResponse ( "clientId" , "a" , asList ( "b" , "c" ) ) ) ; io . netty . buffer . ByteBuf buffer = ( ( io . netty . buffer . ByteBuf ) ( channel . readOutbound ( ) ) ) ; java . lang . String body = "a:b,c" ; byte [ ] data = body . getBytes ( Charsets . UTF_8 ) ; io . netty . buffer . ByteBuf expected = io . netty . buffer . Unpooled . buffer ( ) ; expected . writeInt ( ( ( data . length ) + 1 ) ) ; expected . writeByte ( Messages . HEADER_REFERENCES ) ; expected . writeBytes ( data ) ; "<AssertPlaceHolder>" ; } writeByte ( byte ) { position = org . apache . jackrabbit . oak . segment . BinaryUtils . writeByte ( buffer , position , value ) ; dirty = true ; }
|
org . junit . Assert . assertEquals ( expected , buffer )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.