input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testAllTechniques5 ( ) { reset ( 5 , Percentile . EstimationType . LEGACY ) ; final org . apache . commons . math4 . stat . descriptive . UnivariateStatistic percentile = getUnivariateStatistic ( ) ; "<AssertPlaceHolder>" ; testAssertMappedValues ( testArray , new java . lang . Object [ ] [ ] { new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . LEGACY , percentile5 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_1 , 8.8 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_2 , 8.8 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_3 , 8.2 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_4 , 8.26 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_5 , 8.56 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_6 , 8.29 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_7 , 8.81 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_8 , 8.47 } , new java . lang . Object [ ] { org . apache . commons . math4 . stat . descriptive . rank . Percentile . EstimationType . R_9 , 8.4925 } } , 5.0 , getTolerance ( ) ) ; } evaluate ( double [ ] ) { if ( values == null ) { throw new org . apache . commons . math4 . exception . NullArgumentException ( org . apache . commons . math4 . exception . util . LocalizedFormats . INPUT_ARRAY ) ; } return evaluate ( values , 0 , values . length ) ; } | org . junit . Assert . assertEquals ( this . percentile5 , percentile . evaluate ( testArray ) , getTolerance ( ) ) |
returnsNull_ifRequestedPathDoesNotExist ( ) { this . sensorContext . settings ( ) . setProperty ( "new<sp>path<sp>key" , "missing.ts" ) ; java . lang . String result = this . resolver . getPath ( this . sensorContext , "new<sp>path<sp>key" , "existing.ts" ) ; "<AssertPlaceHolder>" ; } getPath ( org . sonar . api . batch . sensor . SensorContext , java . lang . String , java . lang . String ) { java . lang . String toReturn = context . settings ( ) . getString ( settingKey ) ; if ( ( toReturn == null ) || ( toReturn . isEmpty ( ) ) ) { com . pablissimo . sonar . PathResolverImpl . LOG . debug ( "Path<sp>{}<sp>not<sp>specified,<sp>falling<sp>back<sp>to<sp>{}" , settingKey , defaultValue ) ; toReturn = defaultValue ; } else { com . pablissimo . sonar . PathResolverImpl . LOG . debug ( "Found<sp>{}<sp>path<sp>to<sp>be<sp>'{}'" , settingKey , toReturn ) ; } return getAbsolutePath ( context , toReturn ) ; } | org . junit . Assert . assertNull ( result ) |
sendWritesBodyToOutputStream ( ) { final com . microsoft . azure . sdk . iot . device . transport . https . HttpsMethod httpsMethod = com . microsoft . azure . sdk . iot . device . transport . https . HttpsMethod . POST ; final byte [ ] expectedBody = new byte [ ] { 1 , 2 , 3 } ; new tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . MockUp < com . microsoft . azure . sdk . iot . device . transport . https . HttpsConnection > ( ) { byte [ ] testBody ; @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public void $init ( java . net . URL url , com . microsoft . azure . sdk . iot . device . transport . https . HttpsMethod method ) { } @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public void connect ( ) { "<AssertPlaceHolder>" ; } @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public void writeOutput ( byte [ ] body ) { this . testBody = body ; } @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public void setRequestHeader ( java . lang . String field , java . lang . String value ) { } @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public void setRequestMethod ( com . microsoft . azure . sdk . iot . device . transport . https . HttpsMethod method ) { } @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public byte [ ] readInput ( ) { return new byte [ 0 ] ; } @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public byte [ ] readError ( ) { return new byte [ 0 ] ; } @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public int getResponseStatus ( ) { return 0 ; } @ tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Mock public tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . Map < java . lang . String , tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . List < java . lang . String > > getResponseHeaders ( ) { return new tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . HashMap ( ) ; } } ; java . net . URL mockUrl = new java . net . URL ( "https://www.microsoft.com" ) ; com . microsoft . azure . sdk . iot . device . transport . https . HttpsRequest request = new com . microsoft . azure . sdk . iot . device . transport . https . HttpsRequest ( mockUrl , httpsMethod , expectedBody , "" ) ; request . send ( ) ; } connect ( ) { if ( ( this . body . length ) > 0 ) { this . connection . setDoOutput ( true ) ; this . connection . getOutputStream ( ) . write ( this . body ) ; } this . connection . connect ( ) ; } | org . junit . Assert . assertThat ( testBody , org . hamcrest . CoreMatchers . is ( expectedBody ) ) |
shouldValidateAndReturnFalseWhenEntityTransientPropertyIsInSchema ( ) { final uk . gov . gchq . gaffer . store . schema . ViewValidator validator = new uk . gov . gchq . gaffer . store . schema . ViewValidator ( ) ; final uk . gov . gchq . gaffer . data . elementdefinition . view . View view = new uk . gov . gchq . gaffer . data . elementdefinition . view . View . Builder ( ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . data . elementdefinition . view . ViewElementDefinition . Builder ( ) . transientProperty ( TestPropertyNames . PROP_1 , java . lang . String . class ) . build ( ) ) . build ( ) ; final uk . gov . gchq . gaffer . store . schema . Schema schema = new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . type ( "prop1" , java . lang . Object . class ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . store . schema . SchemaEntityDefinition . Builder ( ) . property ( TestPropertyNames . PROP_1 , "prop1" ) . build ( ) ) . build ( ) ; final uk . gov . gchq . koryphe . ValidationResult result = validator . validate ( view , schema , uk . gov . gchq . gaffer . store . schema . ViewValidatorTest . ALL_STORE_TRAITS ) ; "<AssertPlaceHolder>" ; } validate ( uk . gov . gchq . gaffer . data . elementdefinition . view . View , uk . gov . gchq . gaffer . store . schema . Schema , java . util . Set ) { final boolean isStoreOrdered = storeTraits . contains ( StoreTrait . ORDERED ) ; final uk . gov . gchq . koryphe . ValidationResult result = new uk . gov . gchq . koryphe . ValidationResult ( ) ; if ( null != view ) { final uk . gov . gchq . koryphe . ValidationResult entitiesResult = new uk . gov . gchq . koryphe . ValidationResult ( ) ; validateEntities ( view , schema , storeTraits , isStoreOrdered , result ) ; if ( ! ( entitiesResult . isValid ( ) ) ) { result . add ( entitiesResult ) ; final uk . gov . gchq . koryphe . ValidationResult edgeResult = new uk . gov . gchq . koryphe . ValidationResult ( ) ; validateEdge ( view , schema , storeTraits , isStoreOrdered , result ) ; if ( ! ( edgeResult . isValid ( ) ) ) { result . add ( edgeResult ) ; } } } return result ; } | org . junit . Assert . assertFalse ( result . isValid ( ) ) |
testNptable ( ) { java . lang . String result = io . github . gitbucket . markedj . Marked . marked ( loadResourceAsString ( "nptable.md" ) , new io . github . gitbucket . markedj . Options ( ) ) ; java . lang . String expect = loadResourceAsString ( "nptable.html" ) ; "<AssertPlaceHolder>" ; } loadResourceAsString ( java . lang . String ) { java . io . InputStream in = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( path ) ; try { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; byte [ ] buf = new byte [ 1024 * 8 ] ; int length = 0 ; while ( ( length = in . read ( buf ) ) != ( - 1 ) ) { out . write ( buf , 0 , length ) ; } return new java . lang . String ( out . toByteArray ( ) , "UTF-8" ) ; } finally { in . close ( ) ; } } | org . junit . Assert . assertEquals ( expect , result ) |
testGetStyleForMetacardLongAttribute ( ) { java . lang . Long testLong = java . lang . Long . valueOf ( "2000000" ) ; ddf . catalog . data . Metacard metacard = new org . codice . ddf . spatial . kml . transformer . MockMetacard ( AttributeFormat . LONG . toString ( ) , testLong ) ; org . codice . ddf . spatial . kml . transformer . KmlStyleMap mapper = new org . codice . ddf . spatial . kml . transformer . KmlStyleMap ( ) ; mapper . addMapEntry ( new org . codice . ddf . spatial . kml . transformer . KmlStyleMapEntryImpl ( AttributeFormat . LONG . toString ( ) , java . lang . String . valueOf ( testLong ) , org . codice . ddf . spatial . kml . transformer . KmlStyleMapTest . DEFAULT_STYLE_URL ) ) ; "<AssertPlaceHolder>" ; } getStyleForMetacard ( ddf . catalog . data . Metacard ) { for ( org . codice . ddf . spatial . kml . transformer . KmlStyleMapEntry mapEntry : styleMap ) { if ( mapEntry . metacardMatch ( metacard ) ) { return mapEntry . getStyleUrl ( ) ; } } return "" ; } | org . junit . Assert . assertThat ( mapper . getStyleForMetacard ( metacard ) , org . hamcrest . Matchers . is ( org . codice . ddf . spatial . kml . transformer . KmlStyleMapTest . DEFAULT_STYLE_URL ) ) |
shouldReturnFalseIfNoNextKey ( ) { final org . apache . kafka . streams . state . internals . ThreadCache cache = new org . apache . kafka . streams . state . internals . ThreadCache ( logContext , 10000L , new org . apache . kafka . streams . processor . internals . MockStreamsMetrics ( new org . apache . kafka . common . metrics . Metrics ( ) ) ) ; final org . apache . kafka . streams . state . internals . ThreadCache . MemoryLRUCacheBytesIterator iterator = cache . range ( namespace , org . apache . kafka . common . utils . Bytes . wrap ( new byte [ ] { 0 } ) , org . apache . kafka . common . utils . Bytes . wrap ( new byte [ ] { 1 } ) ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return false ; } | org . junit . Assert . assertFalse ( iterator . hasNext ( ) ) |
testRSAPaulGray ( ) { org . tsugi . lti13 . KeyPair kp = org . tsugi . lti13 . LTI13Util . generateKeyPair ( ) ; org . tsugi . lti13 . Key publicKey = kp . getPublic ( ) ; java . security . interfaces . RSAPublicKey rsaPublicKey = ( ( java . security . interfaces . RSAPublicKey ) ( publicKey ) ) ; com . nimbusds . jose . jwk . RSAKey rsaKey = new com . nimbusds . jose . jwk . RSAKey . Builder ( rsaPublicKey ) . build ( ) ; java . lang . String keyStr = rsaKey . toJSONString ( ) ; boolean good = keyStr . contains ( "{\"kty\":\"RSA\",\"e\":\"AQAB\",\"n\":" ) ; if ( ! good ) { System . out . println ( ( "rsaKey\n" + keyStr ) ) ; } "<AssertPlaceHolder>" ; } println ( java . lang . String ) { try { write ( s . getBytes ( ) ) ; write ( "\n" . getBytes ( ) ) ; } catch ( java . io . IOException e ) { } } | org . junit . Assert . assertTrue ( good ) |
loadOtherImplAsSpecifiedInProperty ( ) { java . lang . System . setProperty ( org . odata4j . test . integration . consumer . CONSUMERIMPL_PROPERTY , org . odata4j . test . integration . consumer . ODataConsumersTest . OtherConsumer . class . getName ( ) ) ; useTestClassLoader ( ) ; org . odata4j . consumer . ODataConsumer consumer = org . odata4j . consumer . ODataConsumers . newBuilder ( "foo" ) . build ( ) ; "<AssertPlaceHolder>" ; } getConsumerClass ( ) { return org . odata4j . test . integration . consumer . ODataConsumersTest . otherConsumerMock . getClass ( ) ; } | org . junit . Assert . assertThat ( consumer , org . hamcrest . Matchers . is ( org . odata4j . test . integration . consumer . ODataConsumersTest . OtherConsumer . getConsumerClass ( ) ) ) |
runTestFieldSensitivity3 ( ) { soot . jimple . infoflow . results . InfoflowResults res = analyzeAPKFile ( "FieldAndObjectSensitivity/FieldSensitivity3.apk" ) ; "<AssertPlaceHolder>" ; } size ( ) { return set . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , res . size ( ) ) |
testStringArray ( ) { java . lang . String [ ] arr = new java . lang . String [ ] { "str1" , "str2" , "str3" } ; "<AssertPlaceHolder>" ; } marshalUnmarshal ( java . lang . Object ) { org . apache . ignite . internal . marshaller . optimized . OptimizedObjectOutputStream out = null ; org . apache . ignite . internal . marshaller . optimized . OptimizedObjectInputStream in = null ; try { out = org . apache . ignite . internal . marshaller . optimized . OptimizedObjectStreamRegistry . out ( ) ; out . context ( clsMap , org . apache . ignite . internal . marshaller . optimized . OptimizedObjectStreamSelfTest . CTX , null , true ) ; out . writeObject ( obj ) ; byte [ ] arr = out . out ( ) . array ( ) ; in = org . apache . ignite . internal . marshaller . optimized . OptimizedObjectStreamRegistry . in ( ) ; in . context ( clsMap , org . apache . ignite . internal . marshaller . optimized . OptimizedObjectStreamSelfTest . CTX , null , getClass ( ) . getClassLoader ( ) ) ; in . in ( ) . bytes ( arr , arr . length ) ; java . lang . Object obj0 = in . readObject ( ) ; checkHandles ( out , in ) ; return ( ( T ) ( obj0 ) ) ; } finally { org . apache . ignite . internal . marshaller . optimized . OptimizedObjectStreamRegistry . closeOut ( out ) ; org . apache . ignite . internal . marshaller . optimized . OptimizedObjectStreamRegistry . closeIn ( in ) ; } } | org . junit . Assert . assertArrayEquals ( arr , marshalUnmarshal ( arr ) ) |
testEmptyExtIsIgnored ( ) { c = b . ext ( "" ) . build ( ) ; "<AssertPlaceHolder>" ; } getExt ( ) { return ext ; } | org . junit . Assert . assertEquals ( null , c . getExt ( ) ) |
testPropertiesUsesUserIdHeader ( ) { org . apache . camel . component . rabbitmq . RabbitMQProducer producer = new org . apache . camel . component . rabbitmq . RabbitMQProducer ( endpoint ) ; message . setHeader ( RabbitMQConstants . USERID , "abcd" ) ; com . rabbitmq . client . AMQP . BasicProperties props = producer . buildProperties ( exchange ) . build ( ) ; "<AssertPlaceHolder>" ; } getUserId ( ) { return userId ; } | org . junit . Assert . assertEquals ( "abcd" , props . getUserId ( ) ) |
testGetPrincipalsFromPrincipalMissingProvider ( ) { 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 . AbstractLoginModuleTest . TestCallbackHandler ( ) ) ; java . util . Set < ? extends java . security . Principal > principals = loginModule . getPrincipals ( new org . apache . jackrabbit . oak . spi . security . principal . PrincipalImpl ( "principalName" ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ) == 0 ; } | org . junit . Assert . assertTrue ( principals . isEmpty ( ) ) |
testShow ( ) { final int size = 10 ; java . util . List < org . jboss . errai . security . shared . api . identity . User > users = buildUsersList ( size ) ; final boolean hasNextPage = false ; final int page = 1 ; final int pageSize = 50 ; final org . uberfire . ext . security . management . api . AbstractEntityManager . SearchResponse < org . jboss . errai . security . shared . api . identity . User > searchResponse = createSearchResponse ( users , size , hasNextPage , "" , page , pageSize ) ; final org . uberfire . ext . security . management . client . widgets . management . list . EntitiesList . Callback < org . jboss . errai . security . shared . api . identity . User > callback = createEntitiesListCallback ( users , true , true , true ) ; presenter . show ( searchResponse , callback ) ; "<AssertPlaceHolder>" ; verify ( view , times ( 0 ) ) . clear ( ) ; verify ( loadingBox , times ( 1 ) ) . show ( ) ; verify ( view , times ( 1 ) ) . configure ( anyString ( ) , any ( EntitiesList . PaginationConstraints . class ) ) ; for ( int x = 0 ; x < size ; x ++ ) { verify ( view , times ( 1 ) ) . add ( x , getUserIdentifier ( x ) , getUserIdentifier ( x ) , headingSize , true , true , true , false ) ; } verify ( loadingBox , times ( 1 ) ) . hide ( ) ; } show ( org . uberfire . workbench . events . NotificationEvent , com . google . gwt . user . client . Command ) { if ( ( container ) == null ) { throw new java . lang . IllegalStateException ( "The<sp>setContainer()<sp>method<sp>hasn't<sp>been<sp>called!" ) ; } final org . uberfire . client . views . pfly . notifications . NotificationPopupView view = new org . uberfire . client . views . pfly . notifications . NotificationPopupView ( ) ; final org . uberfire . client . views . pfly . notifications . NotificationPopupsManagerView . PopupHandle popupHandle = new org . uberfire . client . views . pfly . notifications . NotificationPopupsManagerView . PopupHandle ( view , event ) ; activeNotifications . add ( popupHandle ) ; int size = activeNotifications . size ( ) ; int topMargin = ( size == 1 ) ? initialSpacing : ( size * ( SPACING ) ) - ( ( SPACING ) - ( initialSpacing ) ) ; view . setPopupPosition ( ( ( getLeftPosition ( container . asWidget ( ) ) ) + ( getMargin ( ) ) ) , ( ( getTopPosition ( container . asWidget ( ) ) ) + topMargin ) ) ; view . setNotification ( event . getNotification ( ) ) ; view . setType ( event . getType ( ) ) ; view . setNotificationWidth ( ( ( getWidth ( ) ) + "px" ) ) ; view . show ( hideCommand ) ; return popupHandle ; } | org . junit . Assert . assertEquals ( presenter . callback , callback ) |
testDeleteWikiPage ( ) { java . lang . String title = ( org . gitlab4j . api . TestWikisApi . TEST_WIKI_TITLE_PREFIX ) + "Test<sp>listWikiPages()" ; org . gitlab4j . api . models . WikiPage createdWikiPage = createWikiPage ( title , org . gitlab4j . api . TestWikisApi . testContent ) ; "<AssertPlaceHolder>" ; java . lang . String wikiPageSlug = createdWikiPage . getSlug ( ) ; org . gitlab4j . api . TestWikisApi . gitLabApi . getWikisApi ( ) . deletePage ( org . gitlab4j . api . TestWikisApi . testProjectId , wikiPageSlug ) ; java . util . List < org . gitlab4j . api . models . WikiPage > wikiPages = org . gitlab4j . api . TestWikisApi . gitLabApi . getWikisApi ( ) . getPages ( org . gitlab4j . api . TestWikisApi . testProjectId ) ; if ( wikiPages . stream ( ) . anyMatch ( ( wp ) -> wp . getSlug ( ) . equals ( wikiPageSlug ) ) ) { org . junit . Assert . fail ( "WikiPage<sp>was<sp>not<sp>deleted." ) ; } } createWikiPage ( java . lang . String , java . lang . String ) { return org . gitlab4j . api . TestWikisApi . gitLabApi . getWikisApi ( ) . createPage ( org . gitlab4j . api . TestWikisApi . testProjectId , title , content ) ; } | org . junit . Assert . assertNotNull ( createdWikiPage ) |
testDateCompare ( ) { java . util . Date startTime = java . util . Calendar . getInstance ( ) . getTime ( ) ; java . util . Date usageTime = java . util . Calendar . getInstance ( ) . getTime ( ) ; "<AssertPlaceHolder>" ; } getTime ( ) { java . util . Date d = null ; if ( ( m_tsTinfo ) != null ) { d = m_tsTok . getTimeStampInfo ( ) . getGenTime ( ) ; } return d ; } | org . junit . Assert . assertTrue ( ( ( usageTime . compareTo ( startTime ) ) >= 0 ) ) |
testCombination5 ( ) { final de . ovgu . featureide . fm . core . base . IFeatureModel fm = loadXML ( ( "<or<sp>name=\"S\">" + ( ( ( "<feature<sp>name=\"A\"/>" + "<feature<sp>name=\"B\"/>" ) + "<feature<sp>abstract=\"true\"<sp>name=\"C\"/>" ) + "</or>" ) ) ) ; final de . ovgu . featureide . fm . core . configuration . Configuration c = new de . ovgu . featureide . fm . core . configuration . Configuration ( fm , true , false ) ; "<AssertPlaceHolder>" ; } number ( ) { return number ( 250 , false ) ; } | org . junit . Assert . assertEquals ( 4 , c . number ( ) ) |
internalTestGetCursorPos ( ) { final java . lang . String s = "|" ; "<AssertPlaceHolder>" ; } getCursorPos ( java . lang . String ) { org . junit . Assert . assertTrue ( s . contains ( "|" ) ) ; return s . indexOf ( "|" ) ; } | org . junit . Assert . assertEquals ( 0 , getCursorPos ( s ) ) |
testThatContainsTableMethodReturnsTrueWhenTableExists ( ) { io . quantumdb . core . schema . definitions . Table table = new io . quantumdb . core . schema . definitions . Table ( "users" ) . addColumn ( new io . quantumdb . core . schema . definitions . Column ( "id" , io . quantumdb . core . schema . definitions . TestTypes . bigint ( ) , Hint . IDENTITY , Hint . AUTO_INCREMENT ) ) ; io . quantumdb . core . schema . definitions . Catalog catalog = new io . quantumdb . core . schema . definitions . Catalog ( "test-db" ) . addTable ( table ) ; "<AssertPlaceHolder>" ; } containsTable ( java . lang . String ) { checkArgument ( ( ! ( com . google . common . base . Strings . isNullOrEmpty ( tableName ) ) ) , "You<sp>must<sp>specify<sp>a<sp>'tableName'" ) ; return tables . stream ( ) . filter ( ( t ) -> t . getName ( ) . equals ( tableName ) ) . findFirst ( ) . isPresent ( ) ; } | org . junit . Assert . assertTrue ( catalog . containsTable ( "users" ) ) |
testSerial ( ) { org . apache . commons . math4 . linear . BlockFieldMatrix < org . apache . commons . math4 . fraction . Fraction > m = new org . apache . commons . math4 . linear . BlockFieldMatrix ( testData ) ; "<AssertPlaceHolder>" ; } serializeAndRecover ( java . lang . Object ) { try { java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream so = new java . io . ObjectOutputStream ( bos ) ; so . writeObject ( o ) ; java . io . ByteArrayInputStream bis = new java . io . ByteArrayInputStream ( bos . toByteArray ( ) ) ; java . io . ObjectInputStream si = new java . io . ObjectInputStream ( bis ) ; return si . readObject ( ) ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( m , org . apache . commons . math4 . TestUtils . serializeAndRecover ( m ) ) |
shouldProcess_localhost ( ) { when ( message . getReplyTo ( ) ) . thenReturn ( "something@localhost" ) ; when ( message . getReplyToEmail ( ) ) . thenReturn ( "something@localhost" ) ; "<AssertPlaceHolder>" ; } shouldProcess ( net . ripe . db . whois . api . mail . MailMessage ) { java . lang . String replyToEmail = message . getReplyToEmail ( ) ; if ( replyToEmail == null ) { loggerContext . log ( new net . ripe . db . whois . common . Message ( Messages . Type . INFO , "Not<sp>processing<sp>message,<sp>missing<sp>reply<sp>address" ) ) ; return false ; } try { new javax . mail . internet . InternetAddress ( replyToEmail , true ) ; } catch ( final javax . mail . internet . AddressException e ) { loggerContext . log ( new net . ripe . db . whois . common . Message ( Messages . Type . INFO , "Not<sp>processing<sp>message,<sp>reply<sp>address<sp>invalid:<sp>%s" , replyToEmail ) ) ; return false ; } if ( ! ( org . apache . commons . validator . routines . EmailValidator . getInstance ( ) . isValid ( replyToEmail ) ) ) { loggerContext . log ( new net . ripe . db . whois . common . Message ( Messages . Type . INFO , "Not<sp>processing<sp>message,<sp>reply<sp>address<sp>invalid:<sp>%s" , replyToEmail ) ) ; return false ; } replyToEmail = replyToEmail . toLowerCase ( ) ; if ( ( replyToEmail . endsWith ( "localhost" ) ) || ( replyToEmail . endsWith ( "127.0.0.1" ) ) ) { loggerContext . log ( new net . ripe . db . whois . common . Message ( Messages . Type . INFO , "Not<sp>processing<sp>message,<sp>reply<sp>to<sp>localhost:<sp>%s" , replyToEmail ) ) ; return false ; } return true ; } | org . junit . Assert . assertThat ( subject . shouldProcess ( message ) , org . hamcrest . Matchers . is ( false ) ) |
emptyStringGivesWildcardContentType ( ) { "<AssertPlaceHolder>" ; } of ( java . lang . String ) { java . util . List < javax . mail . internet . ContentType > contentTypeList = new java . util . ArrayList < javax . mail . internet . ContentType > ( ) ; for ( java . lang . String ct : contentTypes . split ( "," ) ) { try { contentTypeList . add ( new javax . mail . internet . ContentType ( ct . trim ( ) ) ) ; } catch ( javax . mail . internet . ParseException ignore ) { } } return new com . eviware . soapui . impl . wsdl . monitor . ContentTypes ( contentTypeList ) ; } | org . junit . Assert . assertThat ( com . eviware . soapui . impl . wsdl . monitor . ContentTypes . of ( "" ) . toString ( ) , org . hamcrest . core . Is . is ( "" ) ) |
revisitZeroNodes ( ) { "<AssertPlaceHolder>" ; } getRevisitState ( org . apache . shindig . gadgets . rewrite . List ) { return new org . apache . shindig . gadgets . rewrite . ImageAttributeRewriter . ImageAttributeVisitor ( requestPipeline , executor ) . revisit ( gadget ( ) , nodes ) ; } | org . junit . Assert . assertEquals ( false , getRevisitState ( new org . apache . shindig . gadgets . rewrite . ArrayList < org . w3c . dom . Node > ( ) ) ) |
getRealm ( ) { com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . file . fat . WithRepoConfiguredWithoutIDTest . c , "getRealm" , "Checking<sp>expected<sp>realm" ) ; "<AssertPlaceHolder>" ; } getRealm ( ) { com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . file . fat . WithRepoConfiguredWithoutIDTest . c , "getRealm" , "Checking<sp>expected<sp>realm" ) ; org . junit . Assert . assertEquals ( "defaultWIMFileBasedRealm" , com . ibm . ws . security . wim . adapter . file . fat . WithRepoConfiguredWithoutIDTest . servlet . getRealm ( ) ) ; } | org . junit . Assert . assertEquals ( "defaultWIMFileBasedRealm" , com . ibm . ws . security . wim . adapter . file . fat . WithRepoConfiguredWithoutIDTest . servlet . getRealm ( ) ) |
validPlatformsAndApiLevels22 ( ) { final com . simpligility . maven . plugins . android . AndroidSdk sdk22 = new com . simpligility . maven . plugins . android . AndroidSdk ( new java . io . File ( sdkTestSupport . getEnv_ANDROID_HOME ( ) ) , "22" , null ) ; "<AssertPlaceHolder>" ; } getAaptPath ( ) { return getPathForBuildTool ( BuildToolInfo . PathId . AAPT ) ; } | org . junit . Assert . assertTrue ( ( ( ( sdk22 . getAaptPath ( ) ) != null ) && ( ! ( sdk22 . getAaptPath ( ) . equals ( "" ) ) ) ) ) |
testFailureGetNonExistentMetaBlock ( ) { if ( skip ) return ; writer . append ( "keyX" . getBytes ( ) , "valueX" . getBytes ( ) ) ; java . io . DataOutputStream outMeta = writer . prepareMetaBlock ( "testX" , Compression . Algorithm . GZ . getName ( ) ) ; outMeta . write ( 123 ) ; outMeta . write ( "foo" . getBytes ( ) ) ; outMeta . close ( ) ; closeOutput ( ) ; org . apache . hadoop . io . file . tfile . TFile . Reader reader = new org . apache . hadoop . io . file . tfile . TFile . Reader ( fs . open ( path ) , fs . getFileStatus ( path ) . getLen ( ) , conf ) ; java . io . DataInputStream mb = reader . getMetaBlock ( "testX" ) ; "<AssertPlaceHolder>" ; mb . close ( ) ; try { java . io . DataInputStream mbBad = reader . getMetaBlock ( "testY" ) ; org . junit . Assert . fail ( "Error<sp>on<sp>handling<sp>non-existent<sp>metablocks." ) ; } catch ( java . lang . Exception e ) { } reader . close ( ) ; } getMetaBlock ( java . lang . String ) { return readerBCF . getMetaBlock ( name ) ; } | org . junit . Assert . assertNotNull ( mb ) |
createsCenterWithCustomerAccount ( ) { org . mifos . customers . office . business . OfficeBO withOffice = new org . mifos . customers . office . business . OfficeBO ( new java . lang . Short ( "1" ) , "testOffice" , new java . lang . Integer ( "1" ) , new java . lang . Short ( "1" ) ) ; org . mifos . customers . center . business . CenterBO center = new org . mifos . domain . builders . CenterBuilder ( ) . withLoanOfficer ( anyLoanOfficer ( ) ) . with ( withOffice ) . build ( ) ; center . setCustomerDao ( customerDao ) ; java . util . List < org . mifos . accounts . business . AccountFeesEntity > accountFees = new java . util . ArrayList < org . mifos . accounts . business . AccountFeesEntity > ( ) ; org . mifos . calendar . CalendarEvent upcomingCalendarEvents = new org . mifos . domain . builders . CalendarEventBuilder ( ) . build ( ) ; when ( holidayDao . findCalendarEventsForThisYearAndNext ( ( ( short ) ( 1 ) ) ) ) . thenReturn ( upcomingCalendarEvents ) ; when ( customerAccountFactory . create ( center , accountFees , meeting , upcomingCalendarEvents ) ) . thenReturn ( customerAccount ) ; when ( customerAccount . getType ( ) ) . thenReturn ( AccountTypes . CUSTOMER_ACCOUNT ) ; customerService . createCenter ( center , meeting , accountFees ) ; "<AssertPlaceHolder>" ; } getCustomerAccount ( ) { org . mifos . customers . business . CustomerAccountBO customerAccount = null ; for ( org . mifos . accounts . business . AccountBO account : accounts ) { if ( ( account . getType ( ) ) == ( org . mifos . accounts . util . helpers . AccountTypes . CUSTOMER_ACCOUNT ) ) { customerAccount = ( ( org . mifos . customers . business . CustomerAccountBO ) ( account ) ) ; } } return customerAccount ; } | org . junit . Assert . assertThat ( center . getCustomerAccount ( ) , org . hamcrest . CoreMatchers . is ( customerAccount ) ) |
createCell_withNullValue_noException ( ) { com . vaadin . addon . spreadsheet . Spreadsheet spreadsheet = new com . vaadin . addon . spreadsheet . Spreadsheet ( ) ; org . apache . poi . ss . usermodel . Cell cell = spreadsheet . createCell ( 0 , 0 , null ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( cell ) |
testSelectAllUsers ( ) { org . apache . ibatis . session . SqlSession session = org . makersoft . shards . unit . session . ShardedSqlSessionTests . factory . openSession ( ) ; try { java . util . List < org . makersoft . shards . domain . shard0 . User > users = session . selectList ( "org.makersoft.shards.mapper.shard0.UserMapper.findAll" ) ; "<AssertPlaceHolder>" ; } finally { session . close ( ) ; } } selectList ( java . lang . String ) { return this . < E > selectList ( statement , null ) ; } | org . junit . Assert . assertEquals ( 0 , users . size ( ) ) |
shouldNotEvaluateExcludesWithMethodPattern ( ) { java . util . function . Predicate < java . lang . Class < ? > > inner = mock ( java . util . function . Predicate . class ) ; com . oracle . bedrock . testsupport . junit . options . TestClasses . TestMatcher exclude1 = mock ( TestClasses . TestMatcher . class ) ; java . util . Set < com . oracle . bedrock . testsupport . junit . options . TestClasses . TestMatcher > includes = new java . util . HashSet ( ) ; java . util . Set < com . oracle . bedrock . testsupport . junit . options . TestClasses . TestMatcher > excludes = java . util . Collections . singleton ( exclude1 ) ; com . oracle . bedrock . testsupport . junit . options . TestClasses . IncludeExcludePredicate predicate = new com . oracle . bedrock . testsupport . junit . options . TestClasses . IncludeExcludePredicate ( inner , includes , excludes ) ; when ( inner . test ( any ( java . lang . Class . class ) ) ) . thenReturn ( true ) ; when ( exclude1 . hasMethodPattern ( ) ) . thenReturn ( true ) ; when ( exclude1 . matches ( anyString ( ) ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; verify ( exclude1 , never ( ) ) . matches ( anyString ( ) ) ; } test ( T extends com . oracle . bedrock . predicate . Comparable ) { return value == null ? false : ( value . compareTo ( this . value ) ) < 0 ; } | org . junit . Assert . assertThat ( predicate . test ( com . oracle . bedrock . testsupport . junit . options . Integer . class ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testRequest_WithMultiTable ( ) { com . alicloud . openservices . tablestore . model . BatchGetRowRequest request = new com . alicloud . openservices . tablestore . model . BatchGetRowRequest ( ) ; java . lang . String tableName1 = "MyTable1" ; com . alicloud . openservices . tablestore . model . MultiRowQueryCriteria criteria1 = new com . alicloud . openservices . tablestore . model . MultiRowQueryCriteria ( tableName1 ) ; java . lang . String tableName2 = "MyTable2" ; com . alicloud . openservices . tablestore . model . MultiRowQueryCriteria criteria2 = new com . alicloud . openservices . tablestore . model . MultiRowQueryCriteria ( tableName2 ) ; { com . alicloud . openservices . tablestore . model . PrimaryKeySchema [ ] schema = com . alicloud . openservices . tablestore . common . TestUtil . randomPrimaryKeySchema ( 5 ) ; java . util . List < com . alicloud . openservices . tablestore . model . PrimaryKey > pks = new java . util . ArrayList < com . alicloud . openservices . tablestore . model . PrimaryKey > ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { pks . add ( com . alicloud . openservices . tablestore . common . TestUtil . randomPrimaryKey ( schema ) ) ; } for ( com . alicloud . openservices . tablestore . model . PrimaryKey pk : pks ) { criteria1 . addRow ( pk ) ; } request . addMultiRowQueryCriteria ( criteria1 ) ; } { com . alicloud . openservices . tablestore . model . PrimaryKeySchema [ ] schema = com . alicloud . openservices . tablestore . common . TestUtil . randomPrimaryKeySchema ( 5 ) ; java . util . List < com . alicloud . openservices . tablestore . model . PrimaryKey > pks = new java . util . ArrayList < com . alicloud . openservices . tablestore . model . PrimaryKey > ( ) ; for ( int i = 0 ; i < 50 ; i ++ ) { pks . add ( com . alicloud . openservices . tablestore . common . TestUtil . randomPrimaryKey ( schema ) ) ; } for ( com . alicloud . openservices . tablestore . model . PrimaryKey pk : pks ) { criteria2 . addRow ( pk ) ; } request . addMultiRowQueryCriteria ( criteria2 ) ; } "<AssertPlaceHolder>" ; checkTable ( request , criteria1 , tableName1 ) ; checkTable ( request , criteria2 , tableName2 ) ; } getCriteriasByTable ( ) { return criteriasGroupByTable ; } | org . junit . Assert . assertEquals ( request . getCriteriasByTable ( ) . size ( ) , 2 ) |
testInitiate_IAtomContainerSet_ArrayList_ArrayList ( ) { org . openscience . cdk . reaction . IReactionMechanism mechanism = new org . openscience . cdk . reaction . mechanism . TautomerizationMechanism ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( mechanism ) |
testTransformerObjectGroupSuccess ( ) { final com . fasterxml . jackson . databind . JsonNode sampleObjectGroup = fr . gouv . vitam . common . json . JsonHandler . getFromFile ( fr . gouv . vitam . common . PropertiesUtils . findFile ( "sample_objectGroup_document.json" ) ) ; "<AssertPlaceHolder>" ; } transformResultObjects ( com . fasterxml . jackson . databind . JsonNode ) { fr . gouv . vitam . common . ParametersChecker . checkParameter ( "Result<sp>cannot<sp>be<sp>empty" , searchResult ) ; final com . fasterxml . jackson . databind . node . ObjectNode resultNode = fr . gouv . vitam . common . json . JsonHandler . createObjectNode ( ) ; long nbObjects = 0 ; final com . fasterxml . jackson . databind . JsonNode result = searchResult . get ( "$results" ) . get ( 0 ) ; final com . fasterxml . jackson . databind . node . ArrayNode arrayNode = fr . gouv . vitam . common . json . JsonHandler . createArrayNode ( ) ; if ( result != null ) { final com . fasterxml . jackson . databind . JsonNode qualifiers = result . get ( "#qualifiers" ) ; final java . util . List < com . fasterxml . jackson . databind . JsonNode > versions = qualifiers . findValues ( "versions" ) ; final java . util . Map < java . lang . String , java . lang . Integer > usages = new java . util . HashMap ( ) ; for ( final com . fasterxml . jackson . databind . JsonNode version : versions ) { for ( final com . fasterxml . jackson . databind . JsonNode object : version ) { arrayNode . add ( fr . gouv . vitam . ihmdemo . core . JsonTransformer . getDataObject ( usages , object ) ) ; nbObjects ++ ; } } } resultNode . put ( "nbObjects" , nbObjects ) ; resultNode . set ( "versions" , arrayNode ) ; return resultNode ; } | org . junit . Assert . assertNotNull ( fr . gouv . vitam . ihmdemo . core . JsonTransformer . transformResultObjects ( sampleObjectGroup ) ) |
testSetFilter ( ) { java . util . ArrayList < java . lang . String > filter = new java . util . ArrayList ( ) ; filter . add ( "name=Alpha" ) ; io . magicthegathering . javasdk . resource . MtgSet alpha = io . magicthegathering . javasdk . api . SetAPI . getSet ( "LEA" ) ; "<AssertPlaceHolder>" ; } getAllSets ( java . util . List ) { return getList ( io . magicthegathering . javasdk . api . SetAPI . RESOURCE_PATH , "sets" , io . magicthegathering . javasdk . resource . MtgSet . class , filters ) ; } | org . junit . Assert . assertTrue ( io . magicthegathering . javasdk . api . SetAPI . getAllSets ( filter ) . contains ( alpha ) ) |
testEntrySet ( ) { java . util . Map < org . matsim . api . core . v01 . Id < org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO > , org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO > map = new org . matsim . core . utils . collections . IdentifiableArrayMap < org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO , org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO > ( ) ; org . matsim . api . core . v01 . Id < org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO > id1 = org . matsim . api . core . v01 . Id . create ( 1 , org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO . class ) ; org . matsim . api . core . v01 . Id < org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO > id2 = org . matsim . api . core . v01 . Id . create ( 2 , org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO . class ) ; org . matsim . api . core . v01 . Id < org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO > id3 = org . matsim . api . core . v01 . Id . create ( 3 , org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO . class ) ; org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO to1 = new org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO ( id1 ) ; org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO to2 = new org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO ( id2 ) ; org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO to3 = new org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO ( id3 ) ; map . put ( id1 , to1 ) ; map . put ( id2 , to2 ) ; map . put ( id3 , to3 ) ; java . util . Set < Map . Entry < org . matsim . api . core . v01 . Id < org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO > , org . matsim . core . utils . collections . IdentifiableArrayMapTest . TO > > entries = map . entrySet ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return hm . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , entries . size ( ) ) |
NewSubnetTest ( ) { final com . cloud . legacymodel . utils . Pair < java . lang . Boolean , com . cloud . legacymodel . utils . Pair < java . lang . String , java . lang . String > > sameSubnet = configurationMgr . validateIpRange ( "10.147.33.140" , "10.147.33.145" , "10.147.33.130" , "255.255.255.192" , vlanVOList , true , false , null , null , null , null , network ) ; "<AssertPlaceHolder>" ; } first ( ) { return t ; } | org . junit . Assert . assertTrue ( ( ! ( sameSubnet . first ( ) ) ) ) |
isValid ( ) { java . sql . Connection connection = mock ( java . sql . Connection . class ) ; when ( connection . isValid ( 0 ) ) . thenReturn ( true ) ; boolean result = this . dialect . isValid ( connection ) ; "<AssertPlaceHolder>" ; } isValid ( java . sql . Connection ) { return connection . isValid ( 0 ) ; } | org . junit . Assert . assertTrue ( result ) |
testCompareIm2ColImpl ( ) { int [ ] miniBatches = new int [ ] { 1 , 3 , 5 } ; int [ ] depths = new int [ ] { 1 , 3 , 5 } ; int [ ] inHeights = new int [ ] { 5 , 21 } ; int [ ] inWidths = new int [ ] { 5 , 21 } ; int [ ] strideH = new int [ ] { 1 , 2 } ; int [ ] strideW = new int [ ] { 1 , 2 } ; int [ ] sizeW = new int [ ] { 1 , 2 , 3 } ; int [ ] sizeH = new int [ ] { 1 , 2 , 3 } ; int [ ] padH = new int [ ] { 0 , 1 , 2 } ; int [ ] padW = new int [ ] { 0 , 1 , 2 } ; boolean [ ] coverall = new boolean [ ] { false , true } ; org . nd4j . linalg . api . buffer . DataType [ ] types = new org . nd4j . linalg . api . buffer . DataType [ ] { org . nd4j . linalg . api . buffer . DataType . FLOAT , org . nd4j . linalg . api . buffer . DataType . DOUBLE , org . nd4j . linalg . api . buffer . DataType . FLOAT , org . nd4j . linalg . api . buffer . DataType . DOUBLE } ; org . nd4j . linalg . api . buffer . DataBuffer [ ] modes = new org . nd4j . linalg . api . buffer . DataBuffer . AllocationMode [ ] { DataBuffer . AllocationMode . HEAP , DataBuffer . AllocationMode . HEAP , DataBuffer . AllocationMode . DIRECT , DataBuffer . AllocationMode . DIRECT } ; java . lang . String factoryClassName = org . nd4j . linalg . factory . Nd4j . factory ( ) . getClass ( ) . toString ( ) . toLowerCase ( ) ; if ( ( factoryClassName . contains ( "jcublas" ) ) || ( factoryClassName . contains ( "cuda" ) ) ) { types = new org . nd4j . linalg . api . buffer . DataType [ ] { org . nd4j . linalg . api . buffer . DataType . FLOAT , org . nd4j . linalg . api . buffer . DataType . DOUBLE } ; modes = new org . nd4j . linalg . api . buffer . DataBuffer . AllocationMode [ ] { DataBuffer . AllocationMode . DIRECT , DataBuffer . AllocationMode . DIRECT } ; } org . nd4j . linalg . api . buffer . DataType initialType = org . nd4j . linalg . factory . Nd4j . dataType ( ) ; for ( int i = 0 ; i < ( types . length ) ; i ++ ) { org . nd4j . linalg . api . buffer . DataType type = types [ i ] ; org . nd4j . linalg . api . buffer . DataBuffer . AllocationMode mode = modes [ i ] ; org . nd4j . linalg . api . buffer . util . DataTypeUtil . setDTypeForContext ( type ) ; org . nd4j . linalg . factory . Nd4j . alloc = mode ; org . nd4j . linalg . api . buffer . util . AllocUtil . setAllocationModeForContext ( mode ) ; for ( int m : miniBatches ) { for ( int d : depths ) { for ( int h : inHeights ) { for ( int w : inWidths ) { for ( int sh : strideH ) { for ( int sw : strideW ) { for ( int kh : sizeH ) { for ( int kw : sizeW ) { for ( int ph : padH ) { for ( int pw : padW ) { if ( ( ( ( ( w - kw ) + ( 2 * pw ) ) % sw ) != 0 ) || ( ( ( ( h - kh ) + ( 2 * ph ) ) % sh ) != 0 ) ) continue ; System . out . println ( ( ( ( ( ( ( ( "Running<sp>" + m ) + "<sp>" ) + d ) + "<sp>" ) + h ) + "<sp>" ) + w ) ) ; for ( boolean cAll : coverall ) { org . nd4j . linalg . api . ndarray . INDArray in = org . nd4j . linalg . factory . Nd4j . rand ( new int [ ] { m , d , h , w } ) ; org . nd4j . linalg . api . ndarray . INDArray outOrig = org . nd4j . linalg . convolution . OldConvolution . im2col ( in , kh , kw , sh , sw , ph , pw , ( - 1 ) , cAll ) ; org . nd4j . linalg . api . ndarray . INDArray outNew = org . nd4j . linalg . convolution . Convolution . im2col ( in , kh , kw , sh , sw , ph , pw , cAll ) ; "<AssertPlaceHolder>" ; } } } } } } } } } } } } org . nd4j . linalg . api . buffer . util . DataTypeUtil . setDTypeForContext ( initialType ) ; } im2col ( org . nd4j . linalg . api . ndarray . INDArray , int , int , int , int , int , int , boolean ) { return org . nd4j . linalg . convolution . Convolution . im2col ( img , kh , kw , sy , sx , ph , pw , 1 , 1 , isSameMode ) ; } | org . junit . Assert . assertEquals ( outOrig , outNew ) |
findActualBySchemaIdAndGroupIdWithNullEndpointSchema ( ) { org . kaaproject . kaa . common . dto . ServerProfileSchemaDto ss = generateServerProfileSchema ( null , null ) ; java . util . List < org . kaaproject . kaa . server . common . dao . model . sql . ProfileFilter > filters = generateFilterWithoutSchemaGeneration ( null , serverProfileSchemaDao . findById ( ss . getId ( ) ) , null , 1 , UpdateStatus . ACTIVE ) ; org . kaaproject . kaa . server . common . dao . model . sql . ProfileFilter first = filters . get ( 0 ) ; org . kaaproject . kaa . server . common . dao . model . sql . EndpointGroup group = first . getEndpointGroup ( ) ; org . kaaproject . kaa . server . common . dao . model . sql . ServerProfileSchema srv = first . getServerProfileSchema ( ) ; java . util . List < org . kaaproject . kaa . server . common . dao . model . sql . ProfileFilter > found = profileFilterDao . findActualBySchemaIdAndGroupId ( null , srv . getStringId ( ) , group . getStringId ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return rawSchema . isEmpty ( ) ; } | org . junit . Assert . assertFalse ( found . isEmpty ( ) ) |
runTest ( ) { boolean result = checkNoError ( "Social_Activities_Get_All_Tags" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; } | org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result ) |
testIsRetryEnabledWithGetpropertyReturnsStringChar ( ) { new mockit . MockUp < org . apache . servicecomb . loadbalance . Configuration > ( ) { @ mockit . Mock private java . lang . String getProperty ( java . lang . String defaultValue , java . lang . String ... keys ) { return "tyt" ; } } ; Configuration . INSTANCE . isRetryEnabled ( "test" ) ; "<AssertPlaceHolder>" ; } isRetryEnabled ( java . lang . String ) { java . lang . String p = org . apache . servicecomb . loadbalance . Configuration . getStringProperty ( "false" , ( ( ( ( org . apache . servicecomb . loadbalance . Configuration . PROP_ROOT ) + microservice ) + "." ) + ( org . apache . servicecomb . loadbalance . Configuration . PROP_RETRY_ENABLED ) ) , ( ( org . apache . servicecomb . loadbalance . Configuration . PROP_ROOT ) + ( org . apache . servicecomb . loadbalance . Configuration . PROP_RETRY_ENABLED ) ) ) ; return java . lang . Boolean . parseBoolean ( p ) ; } | org . junit . Assert . assertNotNull ( Configuration . INSTANCE . isRetryEnabled ( "test" ) ) |
testWhenParamListHasAnyMatchingCodingsForCodingList_doesCodingListMatch_shouldBeTrue ( ) { ca . uhn . fhir . rest . param . TokenOrListParam params = new ca . uhn . fhir . rest . param . TokenOrListParam ( ) ; params . add ( "http://foo.org" , "53" ) ; params . add ( "http://bar.org" , "52" ) ; java . util . List < ca . uhn . fhir . model . dstu2 . composite . CodingDt > codings = new java . util . ArrayList < ca . uhn . fhir . model . dstu2 . composite . CodingDt > ( ) ; codings . add ( new ca . uhn . fhir . model . dstu2 . composite . CodingDt ( "http://baz.org" , "53" ) ) ; codings . add ( new ca . uhn . fhir . model . dstu2 . composite . CodingDt ( "http://bar.org" , "52" ) ) ; "<AssertPlaceHolder>" ; } doesCodingListMatch ( java . util . List ) { java . util . List < ca . uhn . fhir . model . base . composite . BaseCodingDt > paramCodings = getListAsCodings ( ) ; for ( ca . uhn . fhir . model . base . composite . BaseCodingDt coding : theCodings ) { for ( ca . uhn . fhir . model . base . composite . BaseCodingDt paramCoding : paramCodings ) { if ( coding . matchesToken ( paramCoding ) ) { return true ; } } } return false ; } | org . junit . Assert . assertTrue ( params . doesCodingListMatch ( codings ) ) |
weakMatchAtEndShouldSkipAndAllowForStrongerMatchLater ( ) { dakara . eclipse . plugin . kavi . picklist . InputCommand inputCommand = dakara . eclipse . plugin . kavi . picklist . InputCommand . parse ( "en" ) ; java . util . List < dakara . eclipse . plugin . stringscore . RankedItem < dakara . eclipse . plugin . kavi . picklist . ListRankAndSelectorTest2 . TestItem > > listItems = rankSelectorMultiColumn . rankAndFilter ( inputCommand , itemList ) ; "<AssertPlaceHolder>" ; } rankAndFilter ( dakara . eclipse . plugin . kavi . picklist . InputCommand , java . util . List ) { if ( ( ! ( inputCommand . isColumnFiltering ) ) && ( ( inputCommand . getColumnFilterOptions ( 0 ) . rawInputText . length ( ) ) == 0 ) ) return makeRankedList ( items ) ; return items . parallelStream ( ) . map ( ( item ) -> new dakara . eclipse . plugin . stringscore . RankedItem < > ( item ) ) . map ( ( item ) -> setItemRank ( item , inputCommand ) ) . filter ( ( item ) -> ( item . totalScore ( ) ) > 0 ) . sorted ( java . util . Comparator . comparing ( ( dakara . eclipse . plugin . stringscore . RankedItem < T > item ) -> item . totalScore ( ) ) . reversed ( ) . thenComparing ( ( item ) -> sortFieldResolver . apply ( ( ( dakara . eclipse . plugin . stringscore . T ) ( item . dataItem ) ) ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; } | org . junit . Assert . assertEquals ( 1 , listItems . size ( ) ) |
serializationGetDocumentType ( ) { org . digidoc4j . impl . bdoc . Container container = this . createEmptyContainerBy ( Container . DocumentType . BDOC ) ; container . addDataFile ( "src/test/resources/testFiles/helper-files/test.txt" , "text/plain" ) ; this . createSignatureBy ( container , this . pkcs12SignatureToken ) ; this . serialize ( container , this . serializedContainerLocation ) ; org . digidoc4j . impl . bdoc . Container deserializedContainer = this . deserializer ( this . serializedContainerLocation ) ; "<AssertPlaceHolder>" ; } getType ( ) { return m_type ; } | org . junit . Assert . assertEquals ( container . getType ( ) , deserializedContainer . getType ( ) ) |
json ( ) { com . treasuredata . client . model . TDUser user = com . treasuredata . client . model . ObjectMappers . compactMapper ( ) . readValue ( com . treasuredata . client . model . TDUserTest . USER_JSON , com . treasuredata . client . model . TDUser . class ) ; java . lang . String serialized = com . treasuredata . client . model . ObjectMappers . compactMapper ( ) . writeValueAsString ( user ) ; com . treasuredata . client . model . TDUser parsed = com . treasuredata . client . model . ObjectMappers . compactMapper ( ) . readValue ( serialized , com . treasuredata . client . model . TDUser . class ) ; "<AssertPlaceHolder>" ; } compactMapper ( ) { return com . treasuredata . client . model . ObjectMappers . Lazy . COMPACT_MAPPER ; } | org . junit . Assert . assertThat ( parsed , org . hamcrest . Matchers . is ( user ) ) |
testBuilderMetGroepBuilder ( ) { final nl . bzk . brp . domain . leveringmodel . MetaObject persoon = nl . bzk . brp . domain . leveringmodel . helper . TestBuilders . maakLeegPersoon ( ) . metGroep ( new nl . bzk . brp . domain . leveringmodel . MetaGroep . Builder ( ) . metGroepElement ( nl . bzk . brp . domain . leveringmodel . PERSOON_GEBOORTE ) ) . build ( ) ; "<AssertPlaceHolder>" ; } getGroep ( nl . bzk . brp . model . basis . BrpObject ) { nl . bzk . brp . model . basis . Groep resultaat = null ; if ( brpObject instanceof nl . bzk . brp . model . logisch . kern . Persoon ) { final nl . bzk . brp . model . logisch . kern . Persoon v = ( ( nl . bzk . brp . model . logisch . kern . Persoon ) ( brpObject ) ) ; resultaat = v . getMigratie ( ) ; } return resultaat ; } | org . junit . Assert . assertNotNull ( persoon . getGroep ( nl . bzk . brp . domain . leveringmodel . PERSOON_GEBOORTE ) ) |
testSane ( ) { org . batfish . datamodel . IpAccessList denyAllSourcesAcl = org . batfish . datamodel . IpAccessList . builder ( ) . setName ( "srcAcl" ) . setLines ( com . google . common . collect . ImmutableList . of ( rejecting ( ) . setMatchCondition ( org . batfish . question . searchfilters . ORIGINATING_FROM_DEVICE ) . build ( ) , rejecting ( ) . setMatchCondition ( matchSrcInterface ( org . batfish . question . searchfilters . SearchFiltersTest . IFACE1 ) ) . build ( ) , rejecting ( ) . setMatchCondition ( matchSrcInterface ( org . batfish . question . searchfilters . SearchFiltersTest . IFACE2 ) ) . build ( ) , org . batfish . question . searchfilters . ACCEPT_ALL ) ) . build ( ) ; java . util . Optional < org . batfish . question . searchfilters . SearchFiltersResult > flow = org . batfish . question . searchfilters . SearchFiltersAnswerer . reachFilter ( org . batfish . question . searchfilters . SearchFiltersTest . _batfish , org . batfish . question . searchfilters . SearchFiltersTest . _config , denyAllSourcesAcl , org . batfish . question . searchfilters . SearchFiltersTest . _allLocationsParams ) ; "<AssertPlaceHolder>" ; } empty ( ) { return new org . batfish . datamodel . ospf . OspfTopology ( com . google . common . graph . ValueGraphBuilder . directed ( ) . build ( ) ) ; } | org . junit . Assert . assertThat ( flow , org . hamcrest . Matchers . equalTo ( java . util . Optional . empty ( ) ) ) |
testTri ( ) { org . nd4j . linalg . api . ndarray . INDArray assertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] [ ] { new double [ ] { 1 , 1 , 1 , 0 , 0 } , new double [ ] { 1 , 1 , 1 , 1 , 0 } , new double [ ] { 1 , 1 , 1 , 1 , 1 } } ) ; org . nd4j . linalg . api . ndarray . INDArray tri = org . nd4j . linalg . factory . Nd4j . tri ( 3 , 5 , 2 ) ; "<AssertPlaceHolder>" ; } tri ( int , int , int ) { org . nd4j . linalg . factory . INDArray ret = org . nd4j . linalg . factory . Nd4j . createUninitialized ( n , m ) ; lombok . val op = org . nd4j . linalg . api . ops . DynamicCustomOp . builder ( "tri" ) . addIntegerArguments ( n , m , k ) . addOutputs ( ret ) . build ( ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . execAndReturn ( op ) ; return ret ; } | org . junit . Assert . assertEquals ( assertion , tri ) |
testTextToFloat ( ) { com . dremio . dac . model . job . JobDataFragment data = testConvert ( "convert_to_float(c,<sp>1,<sp>1,<sp>0)<sp>as<sp>foo" , new com . dremio . dac . proto . model . dataset . FieldConvertToTypeIfPossible ( FLOAT , REPLACE_WITH_NULL ) , "c" , "cp.\"json/numbers.json\"" ) ; "<AssertPlaceHolder>" ; } getColumn ( java . lang . String ) { return nameToColumns . get ( name ) ; } | org . junit . Assert . assertEquals ( com . dremio . dac . server . FLOAT , data . getColumn ( "foo" ) . getType ( ) ) |
testSimple1 ( ) { org . apache . catalina . ssi . SSIMediator mediator = new org . apache . catalina . ssi . SSIMediator ( new org . apache . catalina . ssi . TestExpressionParseTree . TesterSSIExternalResolver ( ) , org . apache . catalina . ssi . TestExpressionParseTree . LAST_MODIFIED ) ; org . apache . catalina . ssi . ExpressionParseTree ept = new org . apache . catalina . ssi . ExpressionParseTree ( "a<sp>=<sp>a" , mediator ) ; "<AssertPlaceHolder>" ; } evaluateTree ( ) { return root . evaluate ( ) ; } | org . junit . Assert . assertTrue ( ept . evaluateTree ( ) ) |
testGetCursorY ( ) { System . out . println ( "getCursorY" ) ; mudmap2 . backend . World world = new mudmap2 . backend . World ( ) ; mudmap2 . frontend . GUIElement . WorldPanel . WorldPanel instance = new mudmap2 . frontend . GUIElement . WorldPanel . WorldPanel ( null , world , false ) ; instance . setCursor ( 4 , 6 ) ; int result = instance . getCursorY ( ) ; "<AssertPlaceHolder>" ; } getCursorY ( ) { return cursorY ; } | org . junit . Assert . assertEquals ( 6 , result ) |
testBrpPersoonslijstGetterZonderInhoud ( ) { final nl . moderniseringgba . isc . esb . message . brp . generated . OntkenningVaderschapDoorMoederVerzoekType oOntkenningVaderschapDoorMoederVerzoekType = new nl . moderniseringgba . isc . esb . message . brp . generated . OntkenningVaderschapDoorMoederVerzoekType ( ) ; final nl . moderniseringgba . isc . esb . message . brp . impl . OntkenningVaderschapDoorMoederVerzoekBericht ontkenningVaderschapDoorMoederVerzoek = new nl . moderniseringgba . isc . esb . message . brp . impl . OntkenningVaderschapDoorMoederVerzoekBericht ( oOntkenningVaderschapDoorMoederVerzoekType ) ; "<AssertPlaceHolder>" ; } getBrpPersoonslijst ( ) { return asBrpPersoonslijst ( leesUitBrpAntwoordType . getBrpPl ( ) ) ; } | org . junit . Assert . assertNull ( ontkenningVaderschapDoorMoederVerzoek . getBrpPersoonslijst ( ) ) |
testForVarCharArrayForOddNumberWithIndex6 ( ) { java . lang . String [ ] strArr = new java . lang . String [ 6 ] ; strArr [ 0 ] = "abx" ; strArr [ 1 ] = "ereref" ; strArr [ 2 ] = "random" ; strArr [ 3 ] = null ; strArr [ 4 ] = "random12" ; strArr [ 5 ] = "random17" ; org . apache . phoenix . schema . types . PhoenixArray arr = org . apache . phoenix . schema . types . PArrayDataType . instantiatePhoenixArray ( PVarchar . INSTANCE , strArr ) ; byte [ ] bytes = PVarcharArray . INSTANCE . toBytes ( arr ) ; org . apache . hadoop . hbase . io . ImmutableBytesWritable ptr = new org . apache . hadoop . hbase . io . ImmutableBytesWritable ( bytes ) ; org . apache . phoenix . schema . types . PArrayDataType . positionAtArrayElement ( ptr , 4 , PVarchar . INSTANCE , PVarchar . INSTANCE . getByteSize ( ) ) ; int offset = ptr . getOffset ( ) ; int length = ptr . getLength ( ) ; byte [ ] bs = ptr . get ( ) ; byte [ ] res = new byte [ length ] ; java . lang . System . arraycopy ( bs , offset , res , 0 , length ) ; "<AssertPlaceHolder>" ; } toString ( org . apache . hadoop . hbase . KeyValue ) { return ( ( kv . toString ( ) ) + "/value=" ) + ( org . apache . hadoop . hbase . util . Bytes . toString ( kv . getValueArray ( ) , kv . getValueOffset ( ) , kv . getValueLength ( ) ) ) ; } | org . junit . Assert . assertEquals ( "random12" , org . apache . hadoop . hbase . util . Bytes . toString ( res ) ) |
fairness ( ) { com . rabbitmq . client . QueueingConsumer c = new com . rabbitmq . client . QueueingConsumer ( channel ) ; final int queueCount = 3 ; final int messageCount = 100 ; java . util . List < java . lang . String > queues = configure ( c , 1 , queueCount , messageCount ) ; for ( int i = 0 ; i < ( messageCount - 1 ) ; i ++ ) { java . util . List < com . rabbitmq . client . QueueingConsumer . Delivery > d = com . rabbitmq . client . test . functional . QosTests . drain ( c , 1 ) ; ack ( d , false ) ; } for ( java . lang . String q : queues ) { com . rabbitmq . client . AMQP . Queue . DeclareOk ok = channel . queueDeclarePassive ( q ) ; "<AssertPlaceHolder>" ; } } getMessageCount ( ) { return messageCount ; } | org . junit . Assert . assertTrue ( ( ( ok . getMessageCount ( ) ) < messageCount ) ) |
test_hourOfDay_shouldReturnNull ( ) { java . lang . Integer actual = org . openl . util . DateTool . hourOfDay ( null ) ; "<AssertPlaceHolder>" ; } hourOfDay ( java . util . Date ) { if ( d == null ) { return null ; } java . util . Calendar c = java . util . Calendar . getInstance ( ) ; c . setTime ( d ) ; return c . get ( Calendar . HOUR_OF_DAY ) ; } | org . junit . Assert . assertNull ( actual ) |
testSetValue ( ) { java . lang . String value = "a,b,c" ; widget . setValue ( value ) ; verify ( view ) . clearList ( ) ; verify ( listItems ) . destroyAll ( ) ; verify ( listItems , times ( 3 ) ) . get ( ) ; verify ( view , times ( 3 ) ) . add ( any ( ) ) ; widget . doSave ( ) ; java . lang . String newValue = widget . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return view . getValue ( ) ; } | org . junit . Assert . assertEquals ( value , newValue ) |
testEmptyStudentParentAssociation ( ) { java . util . Set < java . lang . String > ids = new java . util . HashSet < java . lang . String > ( ) ; ids . add ( "invalidID" ) ; boolean valid = validator . validate ( EntityNames . STUDENT_PARENT_ASSOCIATION , ids ) . containsAll ( ids ) ; "<AssertPlaceHolder>" ; } validate ( java . lang . String , org . slc . sli . api . security . context . validator . Set ) { if ( ! ( areParametersValid ( EntityNames . STAFF , entityName , staffIds ) ) ) { return Collections . EMPTY_SET ; } org . slc . sli . api . security . context . validator . Set < java . lang . String > validIds = new org . slc . sli . api . security . context . validator . HashSet < java . lang . String > ( ) ; org . slc . sli . domain . NeutralQuery basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "staffReference" , org . slc . sli . domain . NeutralCriteria . CRITERIA_IN , staffIds ) ) ; basicQuery . setIncludeFields ( org . slc . sli . api . security . context . validator . Arrays . asList ( "educationOrganizationReference" , "staffReference" ) ) ; org . slc . sli . api . security . context . validator . TransitiveStaffToStaffValidator . LOG . info ( "Attempting<sp>to<sp>validate<sp>transitively<sp>from<sp>staff<sp>to<sp>staff<sp>with<sp>ids<sp>{}" , staffIds ) ; injectEndDateQuery ( basicQuery ) ; java . lang . Iterable < org . slc . sli . domain . Entity > edOrgAssoc = repo . findAll ( EntityNames . STAFF_ED_ORG_ASSOCIATION , basicQuery ) ; org . slc . sli . api . security . context . validator . Map < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > staffEdorgMap = new org . slc . sli . api . security . context . validator . HashMap < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > ( ) ; populateMapFromMongoResponse ( staffEdorgMap , edOrgAssoc ) ; org . slc . sli . api . security . context . validator . Set < java . lang . String > edOrgLineage = getStaffEdOrgLineage ( ) ; if ( ( edOrgLineage . isEmpty ( ) ) || ( staffEdorgMap . isEmpty ( ) ) ) { return Collections . EMPTY_SET ; } for ( java . util . Map . Entry < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > entry : staffEdorgMap . entrySet ( ) ) { org . slc . sli . api . security . context . validator . Set < java . lang . String > tmpSet = new org . slc . sli . api . security . context . validator . HashSet < java . lang . String > ( entry . getValue ( ) ) ; tmpSet . retainAll ( edOrgLineage ) ; if ( ( tmpSet . size ( ) ) != 0 ) { validIds . add ( entry . getKey ( ) ) ; } } validIds . addAll ( validateThrough ( EntityNames . STAFF_PROGRAM_ASSOCIATION , "programId" ) ) ; validIds . addAll ( validateThrough ( EntityNames . STAFF_COHORT_ASSOCIATION , "cohortId" ) ) ; basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "_id" , "in" , edOrgLineage ) ) ; java . lang . Iterable < org . slc . sli . domain . Entity > edorgs = repo . findAll ( EntityNames . EDUCATION_ORGANIZATION , basicQuery ) ; org . slc . sli . api . security . context . validator . List < java . lang . String > programs = new org . slc . sli . api . security . context . validator . ArrayList < java . lang . String > ( ) ; for ( org . slc . sli . domain . Entity e : edorgs ) { java . lang . Object value = e . getBody ( ) . get ( "programReference" ) ; if ( value != null ) { if ( org . slc . sli . api . security . context . validator . List . class . isAssignableFrom ( value . getClass ( ) ) ) { programs . addAll ( ( ( org . slc . sli . api . security . context . validator . List < java . lang . String > ) ( value ) ) ) ; } else if ( java . lang . String . class . isAssignableFrom ( value . getClass ( ) ) ) { programs . add ( ( ( java . lang . String ) ( value ) ) ) ; } } } validIds . addAll ( getIds ( EntityNames . STAFF_PROGRAM_ASSOCIATION , "programId" , programs ) ) ; basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "educationOrgId" , "in" , edOrgLineage ) ) ; org . slc . sli . api . security . context . validator . List < java . lang . String > cohorts = ( ( org . slc . sli . api . security . context . validator . List < java . lang . String > ) ( repo . findAllIds ( EntityNames . COHORT , basicQuery ) ) ) ; validIds . addAll ( getIds ( EntityNames . STAFF_COHORT_ASSOCIATION , | org . junit . Assert . assertTrue ( ( ! valid ) ) |
testCreateTokenFromInvalidUserId ( ) { org . apache . jackrabbit . oak . spi . security . authentication . token . TokenInfo info = tokenProvider . createToken ( "unknownUserId" , java . util . Collections . < java . lang . String , java . lang . Object > emptyMap ( ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNull ( info ) |
documentNameWithEmptyList ( ) { eu . europa . esig . dss . xades . validation . DetachedSignatureResolver resolver = new eu . europa . esig . dss . xades . validation . DetachedSignatureResolver ( java . util . Collections . < eu . europa . esig . dss . DSSDocument > emptyList ( ) , eu . europa . esig . dss . DigestAlgorithm . SHA256 ) ; org . w3c . dom . Attr attr = mock ( org . w3c . dom . Attr . class ) ; when ( attr . getNodeValue ( ) ) . thenReturn ( "sample.xml" ) ; org . apache . xml . security . utils . resolver . ResourceResolverContext context = new org . apache . xml . security . utils . resolver . ResourceResolverContext ( attr , null , false ) ; "<AssertPlaceHolder>" ; resolver . engineResolveURI ( context ) ; } engineCanResolveURI ( org . apache . xml . security . utils . resolver . ResourceResolverContext ) { return ( nullURI ( context ) ) || ( definedFilename ( context ) ) ; } | org . junit . Assert . assertTrue ( resolver . engineCanResolveURI ( context ) ) |
testLastHandleOffset ( ) { com . streamsets . pipeline . stage . origin . jdbc . cdc . sqlserver . SQLServerCDCSource source = new com . streamsets . pipeline . stage . origin . jdbc . cdc . sqlserver . SQLServerCDCSource ( null , null , null , null ) ; java . util . Map < java . lang . String , java . lang . String > initialOffset = new java . util . HashMap ( ) ; initialOffset . put ( Source . POLL_SOURCE_OFFSET_KEY , null ) ; initialOffset . put ( "cdc_table1" , "" ) ; initialOffset . put ( source . OFFSET_VERSION , source . OFFSET_VERSION_1 ) ; java . util . Map < java . lang . String , java . lang . String > cachedOffset = new java . util . HashMap ( ) ; com . streamsets . pipeline . stage . origin . jdbc . cdc . sqlserver . SQLServerCDCSource mockSource = org . mockito . Mockito . spy ( source ) ; org . mockito . Mockito . doReturn ( cachedOffset ) . when ( mockSource ) . getOffsets ( ) ; mockSource . handleLastOffset ( initialOffset ) ; "<AssertPlaceHolder>" ; } size ( ) { return delegate . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , cachedOffset . size ( ) ) |
testNewFormatterNonNullNullNull ( ) { com . sun . mail . util . logging . CollectorFormatter f = new com . sun . mail . util . logging . CollectorFormatter ( "Test<sp>{0}" , ( ( java . util . logging . Formatter ) ( null ) ) , ( ( com . sun . mail . util . logging . Comparator < com . sun . mail . util . logging . LogRecord > ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( com . sun . mail . util . logging . CollectorFormatter . class , f . getClass ( ) ) |
test ( ) { java . util . List < com . akkafun . product . api . dtos . ProductDto > productDtos = productGateway . findAllProducts ( ) ; "<AssertPlaceHolder>" ; } findAllProducts ( ) { java . net . URI uri = org . springframework . web . util . UriComponentsBuilder . fromHttpUrl ( com . akkafun . product . api . ProductUrl . buildUrl ( ProductUrl . ALL_PRODUCT_LIST_URL ) ) . build ( ) . encode ( ) . toUri ( ) ; com . akkafun . product . api . dtos . ProductDto [ ] productDtos = restTemplate . getForObject ( uri , com . akkafun . product . api . dtos . ProductDto [ ] . class ) ; return java . util . Arrays . asList ( productDtos ) ; } | org . junit . Assert . assertThat ( productDtos . isEmpty ( ) , org . hamcrest . Matchers . is ( false ) ) |
getMeetingsForFullWeekOf ( ) { bnymellon . codekatas . calendarkata10 . var fullWeek = this . calendar . getMeetingsForFullWeekOf ( java . time . LocalDate . of ( 2017 , 7 , 6 ) ) ; "<AssertPlaceHolder>" ; System . out . println ( fullWeek ) ; } getNumberOfMeetings ( ) { return this . meetings . size ( ) ; } | org . junit . Assert . assertEquals ( 6 , fullWeek . getNumberOfMeetings ( ) ) |
testPersoonMetIndicatieDerdeHeeftGezagBijEenOuderGeenOuderschap ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > berichtEntiteiten = brby2019 . voerRegelUit ( maakPersoon ( SoortIndicatie . INDICATIE_DERDE_HEEFT_GEZAG , 1 , nl . bzk . brp . bijhouding . business . regels . impl . gegevenset . persoon . gezagderde . BRBY2019Test . GEEN_OUDERLIJK_GEZAG , nl . bzk . brp . bijhouding . business . regels . impl . gegevenset . persoon . gezagderde . BRBY2019Test . HEEFT_OUDERSCHAP ) , maakPersoonBericht ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , berichtEntiteiten . size ( ) ) |
isEditableWhenTypeAndFocusOnResourceAndTestingWhenInTestingModeShouldReturnFalse ( ) { ch . puzzle . itc . mobiliar . business . property . entity . ResourceEditProperty . Origin propertyDescriptorOrigin = ResourceEditProperty . Origin . TYPE ; ch . puzzle . itc . mobiliar . business . property . entity . ResourceEditProperty propertyMock = mock ( ch . puzzle . itc . mobiliar . business . property . entity . ResourceEditProperty . class ) ; when ( propertyMock . getPropertyDescriptorOrigin ( ) ) . thenReturn ( propertyDescriptorOrigin ) ; when ( propertyMock . isTesting ( ) ) . thenReturn ( true ) ; editPropertiesTable . onChangedResource ( createResourceWithId ( 1 ) ) ; editPropertiesTable . onChangedTestingMode ( true ) ; boolean isEditable = editPropertiesTable . isEditable ( propertyMock ) ; "<AssertPlaceHolder>" ; } isEditable ( ch . puzzle . itc . mobiliar . business . property . entity . ResourceEditProperty ) { boolean isEditable = false ; ch . puzzle . itc . mobiliar . business . property . entity . ResourceEditProperty . Origin propertyDescriptorOrigin = property . getPropertyDescriptorOrigin ( ) ; switch ( propertyDescriptorOrigin ) { case INSTANCE : isEditable = isCurrentFocusOnResource ( ) ; break ; case TYPE : isEditable = ( isCurrentFocusOnResourceType ( ) ) && ( ! ( property . isDescriptorDefinedOnSuperResourceType ( ) ) ) ; break ; } if ( isTesting ( ) ) { return ( property . isTesting ( ) ) && isEditable ; } return isEditable ; } | org . junit . Assert . assertFalse ( isEditable ) |
showLogs_withLogConfigDisabled ( ) { final io . fabric8 . maven . docker . config . LogConfiguration logConfig = new io . fabric8 . maven . docker . config . LogConfiguration . Builder ( ) . enabled ( false ) . build ( ) ; final io . fabric8 . maven . docker . config . RunImageConfiguration runConfig = new io . fabric8 . maven . docker . config . RunImageConfiguration . Builder ( ) . exposedPropertyKey ( "key" ) . log ( logConfig ) . build ( ) ; final io . fabric8 . maven . docker . config . ImageConfiguration imageConfig = new io . fabric8 . maven . docker . config . ImageConfiguration . Builder ( ) . name ( "name" ) . alias ( "alias" ) . runConfig ( runConfig ) . build ( ) ; final io . fabric8 . maven . docker . service . helper . StartContainerExecutor executor = new io . fabric8 . maven . docker . service . helper . StartContainerExecutor . Builder ( ) . imageConfig ( imageConfig ) . build ( ) ; final boolean actual = executor . showLogs ( ) ; "<AssertPlaceHolder>" ; } showLogs ( ) { if ( ( showLogs ) != null ) { if ( showLogs . equalsIgnoreCase ( "true" ) ) { return true ; } else if ( showLogs . equalsIgnoreCase ( "false" ) ) { return false ; } else { return io . fabric8 . maven . docker . config . ConfigHelper . matchesConfiguredImages ( showLogs , imageConfig ) ; } } io . fabric8 . maven . docker . config . RunImageConfiguration runConfig = imageConfig . getRunConfiguration ( ) ; if ( runConfig != null ) { io . fabric8 . maven . docker . config . LogConfiguration logConfig = runConfig . getLogConfiguration ( ) ; if ( logConfig != null ) { return logConfig . isActivated ( ) ; } else { return follow ; } } return false ; } | org . junit . Assert . assertFalse ( actual ) |
get ( ) { final org . graylog . plugins . metrics . cloudwatch . MetricsCloudWatchReporterConfiguration configuration = new org . graylog . plugins . metrics . cloudwatch . MetricsCloudWatchReporterConfiguration ( ) ; final org . graylog . plugins . metrics . cloudwatch . providers . CloudWatchReporterProvider provider = new org . graylog . plugins . metrics . cloudwatch . providers . CloudWatchReporterProvider ( configuration , new com . codahale . metrics . MetricRegistry ( ) ) ; final com . blacklocus . metrics . CloudWatchReporter reporter = provider . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { final org . graylog . plugins . metrics . jmx . providers . JmxReporterProvider provider = new org . graylog . plugins . metrics . jmx . providers . JmxReporterProvider ( new org . graylog . plugins . metrics . jmx . MetricsJmxReporterConfiguration ( ) , new com . codahale . metrics . MetricRegistry ( ) ) ; final com . codahale . metrics . JmxReporter reporter = provider . get ( ) ; org . junit . Assert . assertNotNull ( reporter ) ; } | org . junit . Assert . assertNotNull ( reporter ) |
testIsMax2Of3d ( ) { double [ ] [ ] [ ] slices = new double [ 3 ] [ ] [ ] ; double [ ] [ ] [ ] isMax = new double [ 3 ] [ ] [ ] ; slices [ 0 ] = new double [ ] [ ] { new double [ ] { 1 , 10 , 2 } , new double [ ] { 3 , 4 , 5 } } ; slices [ 1 ] = new double [ ] [ ] { new double [ ] { - 10 , - 9 , - 8 } , new double [ ] { - 7 , - 6 , - 5 } } ; slices [ 2 ] = new double [ ] [ ] { new double [ ] { 4 , 3 , 2 } , new double [ ] { 1 , 0 , - 1 } } ; isMax [ 0 ] = new double [ ] [ ] { new double [ ] { 0 , 1 , 0 } , new double [ ] { 0 , 0 , 0 } } ; isMax [ 1 ] = new double [ ] [ ] { new double [ ] { 0 , 0 , 0 } , new double [ ] { 0 , 0 , 1 } } ; isMax [ 2 ] = new double [ ] [ ] { new double [ ] { 1 , 0 , 0 } , new double [ ] { 0 , 0 , 0 } } ; org . nd4j . linalg . api . ndarray . INDArray arr = org . nd4j . linalg . factory . Nd4j . create ( 3 , 2 , 3 ) ; org . nd4j . linalg . api . ndarray . INDArray expected = org . nd4j . linalg . factory . Nd4j . create ( 3 , 2 , 3 ) ; for ( int i = 0 ; i < 3 ; i ++ ) { arr . get ( org . nd4j . linalg . indexing . NDArrayIndex . point ( i ) , org . nd4j . linalg . indexing . NDArrayIndex . all ( ) , org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ) . assign ( org . nd4j . linalg . factory . Nd4j . create ( slices [ i ] ) ) ; expected . get ( org . nd4j . linalg . indexing . NDArrayIndex . point ( i ) , org . nd4j . linalg . indexing . NDArrayIndex . all ( ) , org . nd4j . linalg . indexing . NDArrayIndex . all ( ) ) . assign ( org . nd4j . linalg . factory . Nd4j . create ( isMax [ i ] ) ) ; } org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . IsMax ( arr , 1 , 2 ) ) ; "<AssertPlaceHolder>" ; } exec ( org . nd4j . linalg . api . ops . impl . accum . Variance , boolean , int [ ] ) { accumulation . setBiasCorrected ( biasCorrected ) ; return exec ( accumulation , dimension ) ; } | org . junit . Assert . assertEquals ( expected , arr ) |
registeredRuntimeShouldBeRetrieved2 ( ) { com . graphaware . runtime . GraphAwareRuntime runtime = com . graphaware . runtime . GraphAwareRuntimeFactory . createRuntime ( database ) ; runtime . start ( ) ; "<AssertPlaceHolder>" ; } getStartedRuntime ( org . neo4j . graphdb . GraphDatabaseService ) { com . graphaware . runtime . GraphAwareRuntime runtime = com . graphaware . runtime . RuntimeRegistry . getRuntime ( database ) ; if ( runtime == null ) { throw new java . lang . IllegalStateException ( "No<sp>GraphAware<sp>Runtime<sp>is<sp>registered<sp>with<sp>the<sp>given<sp>database" ) ; } runtime . waitUntilStarted ( ) ; return runtime ; } | org . junit . Assert . assertEquals ( runtime , com . graphaware . runtime . RuntimeRegistry . getStartedRuntime ( database ) ) |
testGetTheMean ( ) { java . lang . String [ ] args = new java . lang . String [ 2 ] ; args [ 0 ] = org . apache . hadoop . examples . TestWordStats . INPUT ; args [ 1 ] = org . apache . hadoop . examples . TestWordStats . MEAN_OUTPUT ; org . apache . hadoop . examples . WordMean wm = new org . apache . hadoop . examples . WordMean ( ) ; org . apache . hadoop . util . ToolRunner . run ( new org . apache . hadoop . conf . Configuration ( ) , wm , args ) ; double mean = wm . getMean ( ) ; org . apache . hadoop . examples . TestWordStats . WordMeanReader wr = new org . apache . hadoop . examples . TestWordStats . WordMeanReader ( ) ; "<AssertPlaceHolder>" ; } read ( java . nio . ByteBuffer ) { int nRead = 0 ; if ( verifyChecksum ) { if ( slowReadBuff . hasRemaining ( ) ) { int fromSlowReadBuff = java . lang . Math . min ( buf . remaining ( ) , slowReadBuff . remaining ( ) ) ; writeSlice ( slowReadBuff , buf , fromSlowReadBuff ) ; nRead += fromSlowReadBuff ; } if ( ( ( buf . remaining ( ) ) >= ( bytesPerChecksum ) ) && ( ( offsetFromChunkBoundary ) == 0 ) ) { int len = ( buf . remaining ( ) ) - ( ( buf . remaining ( ) ) % ( bytesPerChecksum ) ) ; len = java . lang . Math . min ( len , slowReadBuff . capacity ( ) ) ; int oldlimit = buf . limit ( ) ; buf . limit ( ( ( buf . position ( ) ) + len ) ) ; int readResult = 0 ; try { readResult = doByteBufferRead ( buf ) ; } finally { buf . limit ( oldlimit ) ; } if ( readResult == ( - 1 ) ) { return nRead ; } else { nRead += readResult ; buf . position ( ( ( buf . position ( ) ) + readResult ) ) ; } } if ( ( ( ( buf . remaining ( ) ) > 0 ) && ( ( buf . remaining ( ) ) < ( bytesPerChecksum ) ) ) || ( ( offsetFromChunkBoundary ) > 0 ) ) { int toRead = java . lang . Math . min ( buf . remaining ( ) , ( ( bytesPerChecksum ) - ( offsetFromChunkBoundary ) ) ) ; int readResult = fillSlowReadBuffer ( toRead ) ; if ( readResult == ( - 1 ) ) { return nRead ; } else { int fromSlowReadBuff = java . lang . Math . min ( readResult , buf . remaining ( ) ) ; writeSlice ( slowReadBuff , buf , fromSlowReadBuff ) ; nRead += fromSlowReadBuff ; } } } else { nRead = doByteBufferRead ( buf ) ; if ( nRead > 0 ) { buf . position ( ( ( buf . position ( ) ) + nRead ) ) ; } } return nRead ; } | org . junit . Assert . assertEquals ( mean , wr . read ( org . apache . hadoop . examples . TestWordStats . INPUT ) , 0.0 ) |
testGetGraphPanelChart ( ) { System . out . println ( "getGraphPanelChart" ) ; kg . apc . jmeter . vizualizers . SynthesisReportGui instance = new kg . apc . jmeter . vizualizers . SynthesisReportGui ( ) ; kg . apc . charting . GraphPanelChart result = instance . getGraphPanelChart ( ) ; "<AssertPlaceHolder>" ; } getGraphPanelChart ( ) { return new kg . apc . jmeter . vizualizers . AggregateReportGui . FakeGraphPanelChart ( ) ; } | org . junit . Assert . assertNotNull ( result ) |
whenCallSearchFunctionAndExist ( ) { java . lang . String searchedValue = "Any" ; entryList . add ( searchedValue ) ; entryList . add ( "Not<sp>Fou" ) ; com . stratio . explorer . functions . SearcherFunction function = new com . stratio . explorer . doubles . DoubleSearch ( searchedValue ) ; java . util . List < java . lang . String > resultList = functionalList . search ( function ) ; "<AssertPlaceHolder>" ; } search ( com . stratio . explorer . functions . SearcherFunction ) { java . util . List < EntryType > resultList = new java . util . ArrayList ( ) ; for ( int index = 0 ; index < ( entryList . size ( ) ) ; index ++ ) { if ( searchCondition . isValid ( entryList . get ( index ) ) ) { resultList . add ( entryList . get ( index ) ) ; } } return resultList ; } | org . junit . Assert . assertThat ( resultList , org . hamcrest . Matchers . is ( java . util . Arrays . asList ( searchedValue ) ) ) |
whenAddingInitialRoute_itShouldBeAddedCorrectly ( ) { com . graphhopper . jsprit . core . problem . vehicle . VehicleImpl vehicle = VehicleImpl . Builder . newInstance ( "v" ) . setStartLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "start" ) ) . setEndLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "end" ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute route = VehicleRoute . Builder . newInstance ( vehicle , com . graphhopper . jsprit . core . problem . driver . DriverImpl . noDriver ( ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . VehicleRoutingProblem . Builder vrpBuilder = VehicleRoutingProblem . Builder . newInstance ( ) ; vrpBuilder . addInitialVehicleRoute ( route ) ; com . graphhopper . jsprit . core . problem . VehicleRoutingProblem vrp = vrpBuilder . build ( ) ; "<AssertPlaceHolder>" ; } getInitialVehicleRoutes ( ) { com . graphhopper . jsprit . core . problem . Collection < com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute > copiedInitialRoutes = new com . graphhopper . jsprit . core . problem . ArrayList ( ) ; for ( com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute route : initialVehicleRoutes ) { copiedInitialRoutes . add ( com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute . copyOf ( route ) ) ; } return copiedInitialRoutes ; } | org . junit . Assert . assertTrue ( ( ! ( vrp . getInitialVehicleRoutes ( ) . isEmpty ( ) ) ) ) |
injectIntoWith ( ) { super . injectIntoWith ( ) ; org . eclipse . collections . api . list . MutableList < java . lang . Integer > objects = org . eclipse . collections . impl . list . fixed . ArrayAdapter . newArrayWith ( 1 , 2 , 3 ) ; java . lang . Integer result = objects . injectIntoWith ( 1 , ( injectedValued , item , parameter ) -> ( injectedValued + item ) + parameter , 0 ) ; "<AssertPlaceHolder>" ; } valueOf ( K ) { return this . multimap . get ( subject ) ; } | org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 7 ) , result ) |
testRun_accountDoesNotHavePermission ( ) { when ( projectRepository . getAppEngineApplication ( credential , "projectId" ) ) . thenThrow ( new com . google . cloud . tools . eclipse . projectselector . ApplicationPermissionsException ( "testException" , null ) ) ; queryJob . schedule ( ) ; queryJob . join ( ) ; verify ( isLatestQueryJob ) . test ( queryJob ) ; verify ( projectSelector ) . isDisposed ( ) ; verify ( projectSelector ) . setStatusLink ( "This<sp>account<sp>does<sp>not<sp>have<sp>permission<sp>for<sp>the<sp>App<sp>Engine<sp>application<sp>in<sp>project<sp>projectId." , null ) ; "<AssertPlaceHolder>" ; } getAppEngine ( ) { return appEngine . get ( ) ; } | org . junit . Assert . assertNull ( project . getAppEngine ( ) ) |
testProcess_MatchByRootId ( ) { io . agrest . protocol . CayenneExp exp = new io . agrest . protocol . CayenneExp ( "id=$i" , java . util . Collections . singletonMap ( "i" , 5 ) ) ; merger . merge ( e4Entity , exp ) ; org . apache . cayenne . exp . Expression e = e4Entity . getQualifier ( ) ; org . apache . cayenne . exp . Expression expected = exp ( "db:id=$i" , 5 ) ; "<AssertPlaceHolder>" ; } getQualifier ( ) { return qualifier ; } | org . junit . Assert . assertEquals ( expected , e ) |
testEither ( ) { org . apache . flink . api . common . functions . MapFunction < ? , ? > function = new org . apache . flink . api . common . functions . MapFunction < org . apache . flink . types . Either < java . lang . String , java . lang . Boolean > , org . apache . flink . types . Either < java . lang . String , java . lang . Boolean > > ( ) { @ org . apache . flink . api . java . typeutils . Override public org . apache . flink . types . Either < java . lang . String , java . lang . Boolean > map ( org . apache . flink . types . Either < java . lang . String , java . lang . Boolean > value ) throws org . apache . flink . api . java . typeutils . Exception { return null ; } } ; org . apache . flink . api . common . typeinfo . TypeInformation < ? > expected = new org . apache . flink . api . java . typeutils . EitherTypeInfo ( org . apache . flink . api . common . typeinfo . BasicTypeInfo . STRING_TYPE_INFO , org . apache . flink . api . common . typeinfo . BasicTypeInfo . BOOLEAN_TYPE_INFO ) ; org . apache . flink . api . common . typeinfo . TypeInformation < ? > ti = org . apache . flink . api . java . typeutils . TypeExtractor . getMapReturnTypes ( ( ( org . apache . flink . api . common . functions . MapFunction ) ( function ) ) , expected ) ; "<AssertPlaceHolder>" ; } getMapReturnTypes ( org . apache . flink . api . common . functions . MapFunction , org . apache . flink . api . common . typeinfo . TypeInformation ) { return org . apache . flink . api . java . typeutils . TypeExtractor . getMapReturnTypes ( mapInterface , inType , null , false ) ; } | org . junit . Assert . assertEquals ( expected , ti ) |
testWithUnknownState ( ) { newStateEvent . setState ( "Unknown<sp>(4)" ) ; "<AssertPlaceHolder>" ; } getChannelState ( ) { return ( channelState ) == null ? org . asteriskjava . util . AstState . str2state ( channelStateDesc ) : channelState ; } | org . junit . Assert . assertEquals ( new java . lang . Integer ( 4 ) , newStateEvent . getChannelState ( ) ) |
testLimit ( ) { com . orientechnologies . orient . core . sql . List < com . orientechnologies . orient . core . record . impl . ODocument > qResult = com . orientechnologies . orient . core . sql . OCommandExecutorSQLSelectTest . db . command ( new com . orientechnologies . orient . core . sql . OCommandSQL ( "select<sp>from<sp>foo<sp>limit<sp>3" ) ) . execute ( ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented<sp>yet" ) ; } | org . junit . Assert . assertEquals ( qResult . size ( ) , 3 ) |
testUnwatch ( ) { connection . set ( "testitnow" , "willdo" ) ; connection . watch ( "testitnow" . getBytes ( ) ) ; connection . unwatch ( ) ; connection . multi ( ) ; java . lang . Thread . sleep ( 100 ) ; org . springframework . data . redis . connection . DefaultStringRedisConnection conn2 = new org . springframework . data . redis . connection . DefaultStringRedisConnection ( connectionFactory . getConnection ( ) ) ; conn2 . set ( "testitnow" , "something" ) ; connection . set ( "testitnow" , "somethingelse" ) ; connection . get ( "testitnow" ) ; actual . add ( connection . exec ( ) ) ; java . util . List < java . lang . Object > results = getResults ( ) ; java . util . List < java . lang . Object > execResults = ( ( java . util . List < java . lang . Object > ) ( results . get ( 0 ) ) ) ; "<AssertPlaceHolder>" ; } asList ( redis . reply . MultiBulkReply ) { redis . reply . Reply < ? > [ ] replies = genericReply . data ( ) ; java . util . List < java . lang . Object > results = new java . util . ArrayList < java . lang . Object > ( ) ; for ( redis . reply . Reply < ? > reply : replies ) { results . add ( reply . data ( ) ) ; } return results ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( new java . lang . Object [ ] { "somethingelse" } ) , execResults ) |
testShellWithTextUnavailable ( ) { closeShell ( ) ; org . eclipse . reddeer . swt . condition . ShellIsAvailable shellAvailable = new org . eclipse . reddeer . swt . condition . ShellIsAvailable ( "shell" ) ; "<AssertPlaceHolder>" ; } test ( ) { return ( job . getState ( ) ) == ( state ) ; } | org . junit . Assert . assertFalse ( shellAvailable . test ( ) ) |
testCamelToUnderscorePassesThroughNull ( ) { java . lang . String input = null ; java . lang . String output = com . ocpsoft . socialpm . util . Strings . camelToUnderscore ( input ) ; "<AssertPlaceHolder>" ; } camelToUnderscore ( java . lang . String ) { java . lang . String result = input ; if ( input instanceof java . lang . String ) { result = input . replaceAll ( "([a-z])([A-Z])" , "$1_$2" ) . toLowerCase ( ) ; } return result ; } | org . junit . Assert . assertEquals ( input , output ) |
testGetConfig ( ) { when ( androidAppService . getAndroidConfig ( com . google . firebase . projectmanagement . AndroidAppTest . APP_ID ) ) . thenReturn ( com . google . firebase . projectmanagement . AndroidAppTest . ANDROID_CONFIG ) ; java . lang . String config = androidApp . getConfig ( ) ; "<AssertPlaceHolder>" ; } getConfig ( ) { return iosAppService . getIosConfig ( appId ) ; } | org . junit . Assert . assertEquals ( config , com . google . firebase . projectmanagement . AndroidAppTest . ANDROID_CONFIG ) |
testGetValue_SampleResult ( ) { System . out . println ( "getValue" ) ; org . apache . jmeter . samplers . SampleResult res = new org . apache . jmeter . samplers . SampleResult ( ) ; res . setResponseMessage ( "0" ) ; double expResult = 0.0 ; double result = kg . apc . jmeter . jmxmon . JMXMonSampleResult . getValue ( res ) ; "<AssertPlaceHolder>" ; } getValue ( org . apache . jmeter . samplers . SampleResult ) { return java . lang . Double . valueOf ( res . getResponseMessage ( ) ) ; } | org . junit . Assert . assertEquals ( expResult , result , 0.0 ) |
testListBySourceEntitlements ( ) { org . candlepin . model . Pool sourcePool = org . candlepin . test . TestUtil . createPool ( owner , product ) ; org . candlepin . model . Pool sourcePool2 = org . candlepin . test . TestUtil . createPool ( owner , product ) ; org . candlepin . model . Pool sourcePool3 = org . candlepin . test . TestUtil . createPool ( owner , product ) ; poolCurator . create ( sourcePool ) ; poolCurator . create ( sourcePool2 ) ; poolCurator . create ( sourcePool3 ) ; org . candlepin . model . Entitlement e = new org . candlepin . model . Entitlement ( sourcePool , consumer , owner , 1 ) ; e . setId ( org . candlepin . util . Util . generateDbUUID ( ) ) ; org . candlepin . model . Entitlement e2 = new org . candlepin . model . Entitlement ( sourcePool2 , consumer , owner , 1 ) ; e2 . setId ( org . candlepin . util . Util . generateDbUUID ( ) ) ; org . candlepin . model . Entitlement e3 = new org . candlepin . model . Entitlement ( sourcePool3 , consumer , owner , 1 ) ; e3 . setId ( org . candlepin . util . Util . generateDbUUID ( ) ) ; entitlementCurator . create ( e ) ; entitlementCurator . create ( e2 ) ; entitlementCurator . create ( e3 ) ; org . candlepin . model . Pool pool2 = org . candlepin . test . TestUtil . createPool ( owner , product ) ; pool2 . setSourceEntitlement ( e ) ; org . candlepin . model . Pool pool3 = org . candlepin . test . TestUtil . createPool ( owner , product ) ; pool3 . setSourceEntitlement ( e ) ; org . candlepin . model . Pool pool4 = org . candlepin . test . TestUtil . createPool ( owner , product ) ; pool4 . setSourceEntitlement ( e2 ) ; org . candlepin . model . Pool pool5 = org . candlepin . test . TestUtil . createPool ( owner , product ) ; pool5 . setSourceEntitlement ( e3 ) ; poolCurator . create ( pool2 ) ; poolCurator . create ( pool3 ) ; poolCurator . create ( pool4 ) ; poolCurator . create ( pool5 ) ; java . util . Set < org . candlepin . model . Pool > pools = poolCurator . listBySourceEntitlements ( java . util . Arrays . asList ( e , e2 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return virtUuidToConsumerMap . keySet ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , pools . size ( ) ) |
testWithQuote ( ) { final com . orangesignal . csv . CsvConfig cfg = new com . orangesignal . csv . CsvConfig ( ) ; cfg . withQuote ( ' | org . junit . Assert . assertThat ( cfg . getQuote ( ) , org . hamcrest . core . Is . is ( ' |
testParseDenyOnUser ( ) { int mask = org . dcache . acl . parser . ACEParserTest . toAccessMask ( org . dcache . acl . parser . WRITE_DATA ) ; org . dcache . acl . ACE ace = new org . dcache . acl . ACE ( ACCESS_DENIED_ACE_TYPE , 0 , mask , org . dcache . acl . enums . Who . USER , 123 ) ; org . dcache . acl . ACE parsed = parseLinuxAce ( "D::123:w" ) ; "<AssertPlaceHolder>" ; } parseLinuxAce ( java . lang . String ) { com . google . common . base . Splitter splitter = com . google . common . base . Splitter . on ( ':' ) ; java . util . List < java . lang . String > splitted = splitter . splitToList ( s ) ; checkArgument ( ( ( splitted . size ( ) ) == 4 ) , ( ( "Invalid<sp>ACE<sp>format:<sp>expected<sp><type:flags:principal:permissions><sp>got:<sp><" + s ) + ">" ) ) ; checkArgument ( ( ( splitted . get ( 0 ) . length ( ) ) == 1 ) , ( ( "Invalid<sp>ACE<sp>format:<sp>type<sp>must<sp>be<sp>a<sp>single<sp>character.<sp>Got<sp>:<sp><" + ( splitted . get ( 0 ) . length ( ) ) ) + ">" ) ) ; org . dcache . acl . enums . AceType type = org . dcache . acl . enums . AceType . fromAbbreviation ( splitted . get ( 0 ) . charAt ( 0 ) ) ; int flags = 0 ; int accessMask = 0 ; org . dcache . acl . enums . Who who ; int id = - 1 ; java . lang . String principal ; for ( char c : splitted . get ( 1 ) . toCharArray ( ) ) { flags |= org . dcache . acl . enums . AceFlags . fromAbbreviation ( c ) . getValue ( ) ; } principal = splitted . get ( 2 ) ; if ( ( principal . charAt ( ( ( principal . length ( ) ) - 1 ) ) ) == '@' ) { who = org . dcache . acl . enums . Who . fromAbbreviation ( principal ) ; } else { who = ( ( flags & ( AceFlags . IDENTIFIER_GROUP . getValue ( ) ) ) == 0 ) ? org . dcache . acl . enums . Who . USER : org . dcache . acl . enums . Who . GROUP ; id = java . lang . Integer . parseInt ( principal ) ; } for ( char c : splitted . get ( 3 ) . toCharArray ( ) ) { accessMask |= org . dcache . acl . enums . AccessMask . fromAbbreviation ( c ) . getValue ( ) ; } return new org . dcache . acl . ACE ( type , flags , accessMask , who , id ) ; } | org . junit . Assert . assertEquals ( ace , parsed ) |
adsDetailsPage_withClickOnMoPubLeaderboardSample_shouldNotLoadMoPubLeaderboard ( ) { final java . lang . String fakeAdUnit = "abc" ; final java . lang . String adUnitTitle = "Leaderboard<sp>Automation<sp>Test" ; final com . mopub . framework . pages . AdListPage adListPage = new com . mopub . framework . pages . AdListPage ( ) ; adListPage . addAdUnit ( com . mopub . tests . LeaderboardAdTests . AD_TYPE , fakeAdUnit , adUnitTitle ) ; final com . mopub . framework . pages . AdDetailPage adDetailPage = adListPage . clickCell ( adUnitTitle ) ; final android . support . test . espresso . ViewInteraction bannerElement = onView ( org . hamcrest . Matchers . allOf ( withId ( R . id . banner_mopubview ) , hasChildCount ( 1 ) ) ) ; "<AssertPlaceHolder>" ; adListPage . deleteAdUnit ( adUnitTitle ) ; } waitForElement ( android . support . test . espresso . ViewInteraction ) { return waitForElement ( element , com . mopub . framework . base . BasePage . DEFAULT_TIMEOUT_SECS ) ; } | org . junit . Assert . assertTrue ( ( ! ( adDetailPage . waitForElement ( bannerElement ) ) ) ) |
test10FilterOnGroup ( ) { raptorContext . setAllowFullTableScan ( true ) ; java . lang . String query = "ServiceInstance<@https,<sp>@activeManifestDiff>[@https=false]{<sp>@https,<sp>@activeManifestDiff}" ; com . ebay . cloud . cms . query . service . IQueryResult result = queryService . query ( query , raptorContext ) ; "<AssertPlaceHolder>" ; System . out . println ( result . getEntities ( ) . get ( 0 ) ) ; } getEntities ( ) { return entities ; } | org . junit . Assert . assertEquals ( 1 , result . getEntities ( ) . size ( ) ) |
testGetFallback ( ) { org . orbisgis . legend . thematic . categorize . CategorizedPoint ca = getCategorizedPoint ( ) ; org . orbisgis . legend . thematic . PointParameters ap = new org . orbisgis . legend . thematic . PointParameters ( org . orbisgis . legend . thematic . categorize . Color . decode ( "#111111" ) , 0.2 , 2.0 , "1<sp>1" , org . orbisgis . legend . thematic . categorize . Color . decode ( "#111111" ) , 0.5 , 5.0 , 5.0 , "CIRCLE" ) ; "<AssertPlaceHolder>" ; } getFallbackParameters ( ) { return new org . orbisgis . legend . thematic . LineParameters ( color . getFallbackValue ( ) , opacity . getFallbackValue ( ) , width . getFallbackValue ( ) , dash . getFallbackValue ( ) ) ; } | org . junit . Assert . assertTrue ( ca . getFallbackParameters ( ) . equals ( ap ) ) |
uniqueResultWithJpqlWhenSingleRow ( ) { javax . persistence . Query q = em . createNativeQuery ( "SELECT<sp>e.id,<sp>e.name<sp>FROM<sp>Employee<sp>e<sp>WHERE<sp>e.id<sp>=<sp>?" ) ; q . setParameter ( 1 , employeeId ) ; org . qlrm . to . EmployeeTO to = jpaResultMapper . uniqueResult ( q , org . qlrm . to . EmployeeTO . class ) ; "<AssertPlaceHolder>" ; org . qlrm . mapper . JpaResultMapperTest . LOGGER . debug ( to ) ; } uniqueResult ( java . sql . ResultSet , java . lang . Class ) { java . lang . reflect . Constructor < T > ctor = ( ( java . lang . reflect . Constructor < T > ) ( getConstructor ( rs , clazz ) ) ) ; rs . next ( ) ; java . lang . Object [ ] objs = convertToObjects ( rs , ctor ) ; return createInstance ( ctor , objs ) ; } | org . junit . Assert . assertNotNull ( to ) |
shouldSucceedWithValidMTLS ( ) { config . put ( TLSOptions . TLS_TRUSTSTORE , getResourcePath ( "2waytest/mutual_trust_via_ca/common_ts.jks" ) ) ; config . put ( TLSOptions . TLS_TRUSTSTOREPASSWORD , "password" ) ; config . put ( TLSOptions . TLS_KEYSTORE , getResourcePath ( "2waytest/mutual_trust_via_ca/gateway_ks.jks" ) ) ; config . put ( TLSOptions . TLS_KEYSTOREPASSWORD , "password" ) ; config . put ( TLSOptions . TLS_KEYPASSWORD , "password" ) ; config . put ( TLSOptions . TLS_ALLOWANYHOST , "true" ) ; config . put ( TLSOptions . TLS_ALLOWSELFSIGNED , "false" ) ; io . apiman . gateway . platforms . servlet . connectors . HttpConnectorFactory factory = new io . apiman . gateway . platforms . servlet . connectors . HttpConnectorFactory ( config ) ; io . apiman . gateway . engine . IApiConnector connector = factory . createConnector ( request , api , RequiredAuthType . MTLS , false , new io . apiman . gateway . platforms . servlet . connectors . ConnectorConfigImpl ( ) ) ; io . apiman . gateway . engine . IApiConnection connection = connector . connect ( request , new io . apiman . gateway . engine . async . IAsyncResultHandler < io . apiman . gateway . engine . IApiConnectionResponse > ( ) { @ io . apiman . gateway . platforms . servlet . auth . tls . Override public void handle ( io . apiman . gateway . engine . async . IAsyncResult < io . apiman . gateway . engine . IApiConnectionResponse > result ) { if ( result . isError ( ) ) throw new java . lang . RuntimeException ( result . getError ( ) ) ; "<AssertPlaceHolder>" ; } } ) ; connection . end ( ) ; } isSuccess ( ) { return io . apiman . gateway . engine . components . ldap . result . LdapResultCode . isSuccess ( this ) ; } | org . junit . Assert . assertTrue ( result . isSuccess ( ) ) |
getFilename ( ) { java . lang . String filename = new com . hotels . bdp . waggledance . spring . CommonVFSResource ( testResource . getAbsolutePath ( ) ) . getFilename ( ) ; "<AssertPlaceHolder>" ; } getFilename ( ) { java . lang . String filename = new com . hotels . bdp . waggledance . spring . CommonVFSResource ( testResource . getAbsolutePath ( ) ) . getFilename ( ) ; org . junit . Assert . assertThat ( filename , org . hamcrest . CoreMatchers . is ( com . hotels . bdp . waggledance . spring . CommonVFSResourceTest . TEST_RESOURCE_NAME ) ) ; } | org . junit . Assert . assertThat ( filename , org . hamcrest . CoreMatchers . is ( com . hotels . bdp . waggledance . spring . CommonVFSResourceTest . TEST_RESOURCE_NAME ) ) |
shouldValidateWithOne ( ) { br . com . caelum . vraptor . interceptor . InstanceContainer container = new br . com . caelum . vraptor . interceptor . InstanceContainer ( withAnnotationAcceptor ) ; br . com . caelum . vraptor . interceptor . CustomAcceptsVerifier verifier = new br . com . caelum . vraptor . interceptor . CustomAcceptsVerifier ( container ) ; "<AssertPlaceHolder>" ; } isValid ( java . lang . Object , br . com . caelum . vraptor . controller . ControllerMethod , br . com . caelum . vraptor . controller . ControllerInstance , java . util . List ) { for ( java . lang . annotation . Annotation annotation : constraints ) { br . com . caelum . vraptor . interceptor . AcceptsConstraint constraint = annotation . annotationType ( ) . getAnnotation ( br . com . caelum . vraptor . interceptor . AcceptsConstraint . class ) ; java . lang . Class < ? extends br . com . caelum . vraptor . interceptor . AcceptsValidator < ? > > validatorClass = constraint . value ( ) ; br . com . caelum . vraptor . interceptor . AcceptsValidator validator = container . instanceFor ( validatorClass ) ; validator . initialize ( annotation ) ; if ( ! ( validator . validate ( controllerMethod , controllerInstance ) ) ) { return false ; } } return true ; } | org . junit . Assert . assertTrue ( verifier . isValid ( interceptor , controllerMethod , controllerInstance , constraints ) ) |
noTx ( ) { "<AssertPlaceHolder>" ; } currentTransaction ( ) { return org . apache . openejb . OpenEJB . getTransactionManager ( ) . getTransaction ( ) ; } | org . junit . Assert . assertNull ( currentTransaction ( ) ) |
testIsAutoCommitSupported ( ) { com . j256 . ormlite . support . DatabaseConnection conn = createMock ( com . j256 . ormlite . support . DatabaseConnection . class ) ; boolean supported = true ; expect ( conn . isAutoCommitSupported ( ) ) . andReturn ( supported ) ; conn . close ( ) ; com . j256 . ormlite . support . DatabaseConnectionProxy proxy = new com . j256 . ormlite . support . DatabaseConnectionProxy ( conn ) ; replay ( conn ) ; "<AssertPlaceHolder>" ; proxy . close ( ) ; verify ( conn ) ; } isAutoCommitSupported ( ) { if ( ( proxy ) == null ) { return false ; } else { return proxy . isAutoCommitSupported ( ) ; } } | org . junit . Assert . assertEquals ( supported , proxy . isAutoCommitSupported ( ) ) |
testBasicOperation ( ) { org . apache . usergrid . persistence . qakka . core . CassandraClient cassandraClient = getInjector ( ) . getInstance ( org . apache . usergrid . persistence . qakka . core . CassandraClientImpl . class ) ; org . apache . usergrid . persistence . qakka . serialization . sharding . ShardSerialization shardSer = getInjector ( ) . getInstance ( org . apache . usergrid . persistence . qakka . serialization . sharding . ShardSerialization . class ) ; org . apache . usergrid . persistence . qakka . serialization . sharding . ShardStrategy shardStrategy = getInjector ( ) . getInstance ( org . apache . usergrid . persistence . qakka . serialization . sharding . ShardStrategy . class ) ; java . util . UUID messageIdToLocate = null ; long selectedShardId = 4L ; int numShards = 10 ; java . lang . String region = "default" ; java . lang . String queueName = "sst_queue_" + ( org . apache . commons . lang . RandomStringUtils . randomAlphanumeric ( 20 ) ) ; for ( long i = 0 ; i < numShards ; i ++ ) { shardSer . createShard ( new org . apache . usergrid . persistence . qakka . serialization . sharding . Shard ( queueName , region , Shard . Type . DEFAULT , i , org . apache . usergrid . persistence . qakka . core . QakkaUtils . getTimeUuid ( ) ) ) ; try { java . lang . Thread . sleep ( 10 ) ; } catch ( java . lang . Exception intentionallyIgnored ) { } if ( i == selectedShardId ) { messageIdToLocate = org . apache . usergrid . persistence . qakka . core . QakkaUtils . getTimeUuid ( ) ; } try { java . lang . Thread . sleep ( 10 ) ; } catch ( java . lang . Exception intentionallyIgnored ) { } } org . apache . usergrid . persistence . qakka . serialization . sharding . Shard selectedShard = shardStrategy . selectShard ( queueName , region , Shard . Type . DEFAULT , messageIdToLocate ) ; "<AssertPlaceHolder>" ; } getShardId ( ) { return shardId ; } | org . junit . Assert . assertEquals ( selectedShardId , selectedShard . getShardId ( ) ) |
testGetIconsOnlyIconsUrlstubSxt ( ) { net . yacy . kelondro . data . meta . URIMetadataNode metadataNode = new net . yacy . kelondro . data . meta . URIMetadataNode ( new net . yacy . cora . document . id . DigestURL ( "http://somehost.org" ) ) ; metadataNode . setField ( CollectionSchema . icons_urlstub_sxt . getSolrFieldName ( ) , new java . lang . String [ ] { "somehost.org/static/images/icon16.png" , "somehost.org/static/images/icon32.png" , "somehost.org/static/images/icon64.png" , "somehost.org/static/images/iconApple124.png" } ) ; java . util . Collection < net . yacy . document . parser . html . IconEntry > icons = metadataNode . getIcons ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return elt ; } | org . junit . Assert . assertEquals ( 4 , icons . size ( ) ) |
testCheckByte_Ok ( ) { byte b = net . sf . qualitycheck . NumberInRange . checkByte ( java . lang . Byte . valueOf ( ( ( byte ) ( 4 ) ) ) ) ; "<AssertPlaceHolder>" ; } checkByte ( java . lang . Number ) { net . sf . qualitycheck . Check . notNull ( number , "number" ) ; if ( ! ( net . sf . qualitycheck . NumberInRange . isInByteRange ( number ) ) ) { throw new net . sf . qualitycheck . exception . IllegalNumberRangeException ( number . toString ( ) , net . sf . qualitycheck . NumberInRange . BYTE_MIN , net . sf . qualitycheck . NumberInRange . BYTE_MAX ) ; } return number . byteValue ( ) ; } | org . junit . Assert . assertEquals ( ( ( byte ) ( 4 ) ) , b ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.