input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
shouldPassSortAscendingToDataRows ( ) { this . uiPagedData . setSortAscending ( false ) ; this . uiPagedData . encodeEnd ( this . context ) ; org . springframework . springfaces . page . model . PagedDataRows rows = ( ( org . springframework . springfaces . page . model . PagedDataRows ) ( this . requestMap . get ( "pagedData" ) ) ) ; "<AssertPlaceHolder>" ; } isSortAscending ( ) { return this . sortAscending ; } | org . junit . Assert . assertThat ( rows . isSortAscending ( ) , org . hamcrest . CoreMatchers . is ( false ) ) |
testEmptyAdd ( ) { com . firefly . codec . http2 . hpack . HpackContext ctx = new com . firefly . codec . http2 . hpack . HpackContext ( 0 ) ; com . firefly . codec . http2 . model . HttpField field = new com . firefly . codec . http2 . model . HttpField ( "foo" , "bar" ) ; "<AssertPlaceHolder>" ; } add ( V ) { @ com . firefly . utils . collection . SuppressWarnings ( "unchecked" ) com . firefly . utils . collection . ConcurrentReferenceHashMap . Entry < K , V > newEntry = new com . firefly . utils . collection . ConcurrentReferenceHashMap . Entry < K , V > ( ( ( K ) ( key ) ) , value ) ; com . firefly . utils . collection . ConcurrentReferenceHashMap . Reference < K , V > newReference = this . referenceManager . createReference ( newEntry , hash , head ) ; this . references [ index ] = newReference ; ( this . count ) ++ ; } | org . junit . Assert . assertNull ( ctx . add ( field ) ) |
test21 ( ) { java . lang . System . out . println ( "getUser" ) ; token . setKey ( org . demoiselle . jee . security . jwt . impl . TokenManagerImplTest . localtoken ) ; token . setType ( TokenType . JWT ) ; dml . setName ( "Alterar" 3 ) ; dml . setIdentity ( "Alterar" 2 ) ; dml . addRole ( "Alterar" 6 ) ; dml . addRole ( "MANAGER" ) ; dml . addRole ( "MANAGER" ) ; dml . addPermission ( "Alterar" 1 , "Alterar" ) ; dml . addPermission ( "Alterar" 1 , "Excluir" ) ; dml . addPermission ( "Categoria" , "Consultar" ) ; dml . addPermission ( "Categoria" , "Alterar" ) ; dml . addPermission ( "Categoria" , "Alterar" 4 ) ; dml . addPermission ( "Alterar" 1 , "Alterar" ) ; dml . addParam ( "email" , "Alterar" 5 ) ; dml . addParam ( "endereco" , "rua<sp>carlos<sp>pioli,<sp>133" ) ; dml . addParam ( "fone" , "Alterar" 0 ) ; org . demoiselle . jee . core . api . security . DemoiselleUser expResult = dml ; org . demoiselle . jee . core . api . security . DemoiselleUser result = instance . getUser ( ) ; "<AssertPlaceHolder>" ; } getUser ( ) { return getUser ( null , null ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testGetReplyToFromMessageWithNoProperties ( ) { org . apache . qpid . proton . message . impl . MessageImpl protonMessage = ( ( org . apache . qpid . proton . message . impl . MessageImpl ) ( Message . Factory . create ( ) ) ) ; org . apache . activemq . artemis . protocol . amqp . broker . AMQPMessage decoded = encodeAndDecodeMessage ( protonMessage ) ; "<AssertPlaceHolder>" ; } getReplyTo ( ) { return null ; } | org . junit . Assert . assertNull ( decoded . getReplyTo ( ) ) |
test_with_non_matching_prefix_and_single_host ( ) { org . apache . sling . commons . testing . osgi . MockBundle bundle = new org . apache . sling . commons . testing . osgi . MockBundle ( ( - 1 ) ) ; org . apache . sling . commons . testing . osgi . MockComponentContext ctx = new org . apache . sling . commons . testing . osgi . MockComponentContext ( bundle ) ; ctx . setProperty ( "prefixes" , new java . lang . String [ ] { "/etc/clientlib" } ) ; ctx . setProperty ( "host.pattern" , "static.host.com" ) ; com . adobe . acs . commons . rewriter . impl . StaticReferenceRewriteTransformerFactory factory = new com . adobe . acs . commons . rewriter . impl . StaticReferenceRewriteTransformerFactory ( ) ; factory . activate ( ctx ) ; org . apache . sling . rewriter . Transformer transformer = factory . createTransformer ( ) ; transformer . setContentHandler ( handler ) ; org . xml . sax . helpers . AttributesImpl in = new org . xml . sax . helpers . AttributesImpl ( ) ; in . addAttribute ( null , "href" , null , "CDATA" , "/content/clientlib/test.css" ) ; transformer . startElement ( null , "link" , null , in ) ; verify ( handler , only ( ) ) . startElement ( isNull ( java . lang . String . class ) , eq ( "link" ) , isNull ( java . lang . String . class ) , attributesCaptor . capture ( ) ) ; org . xml . sax . Attributes out = attributesCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( java . lang . Object ) { org . apache . sling . api . resource . Resource resource = ( ( org . apache . sling . api . resource . Resource ) ( result ) ) ; com . day . cq . tagging . TagManager tagMgr = resource . getResourceResolver ( ) . adaptTo ( com . day . cq . tagging . TagManager . class ) ; com . adobe . acs . commons . reports . models . TagReportCellCSVExporter . log . debug ( "Loading<sp>tags<sp>from<sp>{}@{}" , resource . getPath ( ) , property ) ; java . util . List < java . lang . String > tags = new java . util . ArrayList < java . lang . String > ( ) ; java . lang . String [ ] values = resource . getValueMap ( ) . get ( property , java . lang . String [ ] . class ) ; if ( values != null ) { for ( java . lang . String value : values ) { tags . add ( tagMgr . resolve ( value ) . getTitle ( ) ) ; } } com . adobe . acs . commons . reports . models . TagReportCellCSVExporter . log . debug ( "Loaded<sp>{}<sp>tags" , tags ) ; return org . apache . commons . lang3 . StringUtils . join ( tags , ";" ) ; } | org . junit . Assert . assertEquals ( "/content/clientlib/test.css" , out . getValue ( 0 ) ) |
testContentTypeEvaluationNullMetadata ( ) { java . lang . String methodName = "testContentTypeEvaluationNullMetadata" ; ddf . catalog . pubsub . PredicateTest . LOGGER . debug ( "***************<sp>START:<sp>{}<sp>*****************" , methodName ) ; ddf . catalog . pubsub . predicate . ContentTypePredicate ctp = new ddf . catalog . pubsub . predicate . ContentTypePredicate ( "type1" , "version1" ) ; java . util . HashMap < java . lang . String , java . lang . Object > properties = new java . util . HashMap ( ) ; properties . put ( PubSubConstants . HEADER_CONTENT_TYPE_KEY , "type1,version1" ) ; properties . put ( PubSubConstants . HEADER_OPERATION_KEY , PubSubConstants . CREATE ) ; org . osgi . service . event . Event testEvent = new org . osgi . service . event . Event ( "topic" , properties ) ; "<AssertPlaceHolder>" ; ddf . catalog . pubsub . PredicateTest . LOGGER . debug ( "***************<sp>END:<sp>{}<sp>*****************" , methodName ) ; } matches ( java . lang . Object ) { if ( object instanceof org . codice . ddf . security . handler . api . UPAuthenticationToken ) { org . codice . ddf . security . handler . api . UPAuthenticationToken right = ( ( org . codice . ddf . security . handler . api . UPAuthenticationToken ) ( object ) ) ; return ( ( left . getUsername ( ) . equals ( right . getUsername ( ) ) ) && ( left . getPassword ( ) . equals ( right . getPassword ( ) ) ) ) && ( left . getRealm ( ) . equals ( right . getRealm ( ) ) ) ; } return false ; } | org . junit . Assert . assertTrue ( ctp . matches ( testEvent ) ) |
testUnion2 ( ) { fr . inria . corese . core . Graph g = fr . inria . corese . core . Graph . create ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; java . lang . String q = "us:test()" 1 + ( ( ( ( ( ( ( ( ( ( ( ( ( "us:test()" + "}" ) + "function<sp>us:test(){" ) + "let<sp>(?g<sp>=<sp>us:union()," ) + "?m<sp>=<sp>select<sp>*<sp>where<sp>{<sp>graph<sp>?g<sp>{?x<sp>foaf:knows+<sp>?y}})" ) + "{<sp>?m<sp>}" ) + "}" ) + "function<sp>us:union(){" ) + "let<sp>(" ) + "?g1<sp>=<sp>construct<sp>{us:John<sp>foaf:knows<sp>us:Jim}<sp>where<sp>{}," ) + "us:test()" 0 ) + "xt:union(?g1,<sp>?g2)" ) + "}" ) + "}" ) ; fr . inria . corese . sparql . api . IDatatype dt = exec . eval ( q ) ; fr . inria . corese . kgram . core . Mappings map = dt . getPointerObject ( ) . getMappings ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return tests . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , map . size ( ) ) |
testTraceDropFlag ( ) { b . traceEnter ( mi111 , ( 10 * ( com . jitlogic . zorka . core . test . spy . LTraceHandlerUnitTest . MS ) ) ) ; b . traceBegin ( t1 , 100L , TraceMarker . DROP_INTERIM ) ; b . markTraceFlags ( 0 , TraceMarker . DROP_TRACE ) ; b . traceReturn ( ( 20 * ( com . jitlogic . zorka . core . test . spy . LTraceHandlerUnitTest . MS ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return sequence . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , records . size ( ) ) |
testDiv ( ) { int theResult = ( ( int ) ( de . mirkosertic . bytecoder . core . DoubleMathTest . div ( 30 , 10 ) ) ) ; "<AssertPlaceHolder>" ; } div ( double , double ) { return a / b ; } | org . junit . Assert . assertEquals ( 3 , theResult , 0 ) |
testDropout ( ) { org . nd4j . autodiff . samediff . SameDiff sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; double p = 0.5 ; org . nd4j . linalg . api . ndarray . INDArray ia = org . nd4j . linalg . factory . Nd4j . create ( new long [ ] { 2 , 2 } ) ; org . nd4j . autodiff . samediff . SDVariable input = sd . var ( "input" , ia ) ; org . nd4j . autodiff . samediff . SDVariable res = sd . dropout ( input , p ) ; "<AssertPlaceHolder>" ; } getShape ( ) { long [ ] initialShape = sameDiff . getShapeForVarName ( getVarName ( ) ) ; if ( initialShape == null ) { org . nd4j . autodiff . samediff . val arr = getArr ( ) ; if ( arr != null ) return arr . shape ( ) ; } return initialShape ; } | org . junit . Assert . assertArrayEquals ( new long [ ] { 2 , 2 } , res . getShape ( ) ) |
shouldNotReturnTriggerTwice ( ) { com . gemserk . animation4j . gdx . Animation animation = new com . gemserk . animation4j . gdx . Animation ( new com . badlogic . gdx . graphics . g2d . Sprite [ ] { } , new com . gemserk . animation4j . FrameAnimationImpl ( true , 50.0F , 25.0F , 30.0F ) ) ; com . gemserk . animation4j . gdx . AnimationFrameMonitor animationMonitor = new com . gemserk . animation4j . gdx . AnimationFrameMonitor ( animation , 50.0F ) ; animation . update ( 51.0F ) ; animationMonitor . update ( ) ; animationMonitor . update ( ) ; "<AssertPlaceHolder>" ; } isTriggered ( ) { return triggered ; } | org . junit . Assert . assertFalse ( animationMonitor . isTriggered ( ) ) |
testFlushAfterClose ( ) { java . io . OutputStream os = makeObject ( ) ; os . close ( ) ; try { os . flush ( ) ; try { os . write ( 0 ) ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( "Inconsistent<sp>write/flush<sp>after<sp>close" ) ; } } catch ( java . io . IOException e ) { "<AssertPlaceHolder>" ; } } write ( int ) { out . write ( pByte ) ; ( bytesWritten ) ++ ; } | org . junit . Assert . assertNotNull ( e . getMessage ( ) ) |
whenCreatedWithString_isNotInteger ( ) { io . kubernetes . client . custom . IntOrString intOrString = new io . kubernetes . client . custom . IntOrString ( "17" ) ; "<AssertPlaceHolder>" ; } isInteger ( ) { return isInt ; } | org . junit . Assert . assertThat ( intOrString . isInteger ( ) , org . hamcrest . Matchers . is ( false ) ) |
testShowInternalInputDialog ( ) { org . evosuite . testsuite . TestSuiteChromosome suite = new org . evosuite . testsuite . TestSuiteChromosome ( ) ; org . evosuite . instrumentation . InstrumentingClassLoader cl = new org . evosuite . instrumentation . InstrumentingClassLoader ( ) ; org . evosuite . testcase . TestCase t1 = org . evosuite . runtime . mock . javax . swing . MockJOptionPaneShowInternalInputDialogTest . buildTestCase0 ( cl ) ; suite . addTest ( t1 ) ; org . evosuite . coverage . branch . BranchCoverageSuiteFitness ff = new org . evosuite . coverage . branch . BranchCoverageSuiteFitness ( cl ) ; ff . getFitness ( suite ) ; java . util . Set < org . evosuite . testcase . TestFitnessFunction > coveredGoals = suite . getCoveredGoals ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return theTest . size ( ) ; } | org . junit . Assert . assertEquals ( 4 , coveredGoals . size ( ) ) |
testFindAll ( ) { final com . example . domain . Books result0 = bookService . getBooks ( ) ; final java . util . List < com . example . domain . Book > bookList = result0 . getBookList ( ) ; if ( bookList != null ) { for ( final com . example . domain . Book book : bookList ) { com . example . sevice . TUMyServiceTest . LOGGER . debug ( book ) ; "<AssertPlaceHolder>" ; } } } getBookId ( ) { return bookId ; } | org . junit . Assert . assertNotNull ( book . getBookId ( ) ) |
testDelete ( ) { int deleteNum = dao . delete ( 1 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 1 , deleteNum ) |
remove_2arg_Existing_EqualValue ( ) { java . lang . Long key = java . lang . System . currentTimeMillis ( ) ; java . lang . String value = "value" + key ; cache . put ( key , value ) ; "<AssertPlaceHolder>" ; } remove ( K , V ) { return new Semantic . UpdateExisting < K , V , java . lang . Boolean > ( ) { @ java . lang . Override public void update ( Progress < org . cache2k . core . operation . K , org . cache2k . core . operation . V , java . lang . Boolean > c , ExaminationEntry < org . cache2k . core . operation . K , org . cache2k . core . operation . V > e ) { if ( ( c . isPresentOrMiss ( ) ) && ( ( ( value == null ) && ( ( e . getValueOrException ( ) ) == null ) ) || ( value . equals ( e . getValueOrException ( ) ) ) ) ) { c . result ( true ) ; c . remove ( ) ; return ; } c . result ( false ) ; } } ; } | org . junit . Assert . assertTrue ( cache . remove ( key , new java . lang . String ( value ) ) ) |
testSetupLayout ( ) { properties . connection . setupLayout ( ) ; properties . module . main . setupLayout ( ) ; properties . module . setupLayout ( ) ; properties . setupLayout ( ) ; org . talend . daikon . properties . presentation . Form mainForm = properties . getForm ( Form . MAIN ) ; "<AssertPlaceHolder>" ; } setupLayout ( ) { super . setupLayout ( ) ; org . talend . daikon . properties . presentation . Form form = org . talend . daikon . properties . presentation . Form . create ( this , Form . MAIN ) ; form . addRow ( clientId ) ; form . addColumn ( clientSecret ) ; form . addRow ( callbackHost ) ; form . addColumn ( callbackPort ) ; form . addRow ( widget ( tokenFile ) . setWidgetType ( Widget . FILE_WIDGET_TYPE ) ) ; } | org . junit . Assert . assertNotNull ( mainForm ) |
testTransportManagerInitSucc ( org . apache . servicecomb . core . Transport , org . apache . servicecomb . core . Endpoint , org . apache . servicecomb . serviceregistry . RegistryUtils , org . apache . servicecomb . serviceregistry . api . registry . MicroserviceInstance ) { new mockit . Expectations ( ) { { transport . getName ( ) ; result = "test" ; transport . canInit ( ) ; result = true ; transport . init ( ) ; result = true ; transport . getPublishEndpoint ( ) ; result = endpoint ; } } ; java . util . List < org . apache . servicecomb . core . Transport > transports = java . util . Arrays . asList ( transport ) ; org . apache . servicecomb . core . transport . TransportManager manager = new org . apache . servicecomb . core . transport . TransportManager ( ) ; manager . setTransports ( transports ) ; manager . init ( ) ; "<AssertPlaceHolder>" ; } findTransport ( java . lang . String ) { return restTransport ; } | org . junit . Assert . assertEquals ( manager . findTransport ( "test" ) , transport ) |
testOK ( ) { final byte [ ] encrypted = encrypter . encrypt ( org . pac4j . play . store . VALUE . getBytes ( StandardCharsets . UTF_8 ) ) ; final byte [ ] decrypted = encrypter . decrypt ( encrypted ) ; "<AssertPlaceHolder>" ; } decrypt ( byte [ ] ) { return encryptedBytes ; } | org . junit . Assert . assertEquals ( org . pac4j . play . store . VALUE , new java . lang . String ( decrypted , java . nio . charset . StandardCharsets . UTF_8 ) ) |
testProcessMediaDelete ( ) { org . easymock . EasyMock . replay ( responseMock ) ; org . easymock . EasyMock . expect ( requestMock . getMethod ( ) ) . andReturn ( "DELETE" ) ; org . easymock . EasyMock . replay ( requestMock ) ; org . easymock . EasyMock . expect ( adapterMock . deleteMedia ( requestMock ) ) . andReturn ( responseMock ) ; org . easymock . EasyMock . replay ( adapterMock ) ; org . apache . abdera . protocol . server . ResponseContext response = processor . processMedia ( requestMock , adapterMock ) ; "<AssertPlaceHolder>" ; } processMedia ( org . apache . abdera . protocol . server . RequestContext , org . apache . abdera . protocol . server . CollectionAdapter ) { java . lang . String method = context . getMethod ( ) ; if ( adapter instanceof org . apache . abdera . protocol . server . MediaCollectionAdapter ) { org . apache . abdera . protocol . server . MediaCollectionAdapter mcadapter = ( ( org . apache . abdera . protocol . server . MediaCollectionAdapter ) ( adapter ) ) ; if ( method . equalsIgnoreCase ( "GET" ) ) { return mcadapter . getMedia ( context ) ; } else if ( method . equalsIgnoreCase ( "POST" ) ) { return mcadapter . postMedia ( context ) ; } else if ( method . equalsIgnoreCase ( "PUT" ) ) { return mcadapter . putMedia ( context ) ; } else if ( method . equalsIgnoreCase ( "DELETE" ) ) { return mcadapter . deleteMedia ( context ) ; } else if ( method . equalsIgnoreCase ( "HEAD" ) ) { return mcadapter . headMedia ( context ) ; } else if ( method . equalsIgnoreCase ( "OPTIONS" ) ) { return mcadapter . optionsMedia ( context ) ; } else { return null ; } } else { return org . apache . abdera . protocol . server . ProviderHelper . notallowed ( context ) ; } } | org . junit . Assert . assertNotNull ( response ) |
findNoUserByContainingEmailAddresses ( ) { createUserForContainsTest ( ) ; org . springframework . data . neo4j . examples . movies . domain . User foundUser = userRepository . findByEmailAddressesContains ( java . util . Collections . singletonList ( org . springframework . data . neo4j . examples . movies . MoviesIntegrationTests . UNKNOWN_MAIL_ADDRESS ) ) ; "<AssertPlaceHolder>" ; } createUserForContainsTest ( ) { org . springframework . data . neo4j . examples . movies . domain . User user = new org . springframework . data . neo4j . examples . movies . domain . User ( "Somebody" ) ; java . util . Set < java . lang . String > emailAddresses = new java . util . HashSet ( ) ; emailAddresses . add ( org . springframework . data . neo4j . examples . movies . MoviesIntegrationTests . KNOWN_MAIL_ADDRESS_1 ) ; emailAddresses . add ( org . springframework . data . neo4j . examples . movies . MoviesIntegrationTests . KNOWN_MAIL_ADDRESS_2 ) ; user . setEmailAddresses ( emailAddresses ) ; userRepository . save ( user ) ; } | org . junit . Assert . assertNull ( foundUser ) |
convertPolygon_WithRedundantSpaces_ShouldConvert ( ) { java . lang . String wkt = "<sp>POLYGON<sp>(<sp>(30<sp>10,<sp>40<sp>40<sp>,<sp>20<sp>40,<sp>10<sp>20,<sp>30<sp>10<sp>)<sp>)<sp>" ; java . lang . String geoJson = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . toGeoJson ( wkt ) ; java . lang . String expectedGeoJson = "{\"type\":\"Polygon\",<sp>\"coordinates\":<sp>[[[30,10],[40,40],[20,40],[10,20],[30,10]]]}" ; "<AssertPlaceHolder>" ; } toGeoJson ( java . lang . String ) { wkt = wkt . toLowerCase ( ) ; int startOfCoordinates = wkt . indexOf ( "multilinestring" 2 ) ; if ( startOfCoordinates == ( - 1 ) ) throw new java . lang . IllegalArgumentException ( "multilinestring" 4 ) ; java . lang . String wktType = wkt . substring ( 0 , startOfCoordinates ) . trim ( ) ; wkt = wkt . substring ( startOfCoordinates ) ; java . lang . String type = "" ; java . lang . String coordinates = "" ; switch ( wktType ) { case "point" : type = "multilinestring" 3 ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . pointCoordinatesFromWkt ( wkt ) ; break ; case "polygon" : type = "multilinestring" 1 ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . polygonCoordinatesFromWkt ( wkt ) ; break ; case "linestring" : type = "LineString" ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . lineStringCoordinatesFromWkt ( wkt ) ; break ; case "multipolygon" : type = "MultiPolygon" ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . multiPolygonCoordinatesFromWkt ( wkt ) ; break ; case "multipoint" : type = "multilinestring" 0 ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . multiPointCoordinatesFromWkt ( wkt ) ; break ; case "multilinestring" : type = "MultiLineString" ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . multiLineStringCoordinatesFromWkt ( wkt ) ; break ; default : throw new java . lang . IllegalArgumentException ( "multilinestring" 5 ) ; } return org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . buildGeoJson ( type , coordinates ) ; } | org . junit . Assert . assertEquals ( expectedGeoJson , geoJson ) |
shouldImportCndForCars ( ) { importer . importFrom ( openCndFile ( "cars.cnd" ) , problems ) ; if ( ( problems . size ( ) ) != 0 ) printProblems ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return values . size ( ) ; } | org . junit . Assert . assertThat ( problems . size ( ) , org . hamcrest . core . Is . is ( 0 ) ) |
foldLeft_A$Object$Function2 ( ) { com . m3 . scalaflavor4j . Nil < java . lang . String > target = com . m3 . scalaflavor4j . Nil . < java . lang . String > apply ( ) ; java . lang . String z = "" ; com . m3 . scalaflavor4j . F2 < java . lang . String , java . lang . String , java . lang . String > op = new com . m3 . scalaflavor4j . F2 < java . lang . String , java . lang . String , java . lang . String > ( ) { public java . lang . String apply ( java . lang . String v1 , java . lang . String v2 ) { return v1 + v2 ; } } ; java . lang . String actual = target . foldLeft ( z , op ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( resource ) == null ) || ( ( resource . getResource ( ) ) == null ) ; } | org . junit . Assert . assertThat ( actual . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testThrehold ( ) { jCas . setDocumentText ( "This<sp>text<sp>isn't<sp>going<sp>to<sp>score<sp>above<sp>the<sp>threshold." ) ; processJCas ( DocumentType . PARAM_MODEL , getClass ( ) . getResource ( uk . gov . dstl . baleen . annotators . stats . DocumentTypeTest . DOCUMENTTYPE_BIN ) . getPath ( ) , DocumentType . PARAM_CONFIDENCE_THRESHOLD , "0.99" ) ; org . apache . uima . jcas . tcas . DocumentAnnotation da = getDocumentAnnotation ( ) ; "<AssertPlaceHolder>" ; } getDocType ( ) { if ( ( DocumentAnnotation_Type . featOkTst ) && ( ( ( ( org . apache . uima . jcas . tcas . DocumentAnnotation_Type ) ( jcasType ) ) . casFeat_docType ) == null ) ) jcasType . jcas . throwFeatMissing ( "docType" , "uima.tcas.DocumentAnnotation" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( org . apache . uima . jcas . tcas . DocumentAnnotation_Type ) ( jcasType ) ) . casFeatCode_docType ) ; } | org . junit . Assert . assertEquals ( null , da . getDocType ( ) ) |
testFindWorkItemDefinition ( ) { final org . drools . workbench . models . datamodel . workitems . PortableWorkDefinition workItem1 = getMock ( "workItem1" ) ; final org . drools . workbench . models . datamodel . workitems . PortableWorkDefinition workItem2 = getMock ( "workItem2" ) ; final java . util . HashSet < org . drools . workbench . models . datamodel . workitems . PortableWorkDefinition > fakeDefinitions = new java . util . HashSet < org . drools . workbench . models . datamodel . workitems . PortableWorkDefinition > ( ) { { add ( workItem1 ) ; add ( workItem2 ) ; } } ; when ( presenter . getWorkItemDefinitions ( ) ) . thenReturn ( fakeDefinitions ) ; final org . drools . workbench . models . datamodel . workitems . PortableWorkDefinition workItem = plugin . findWorkItemDefinition ( "workItem1" ) ; "<AssertPlaceHolder>" ; } findWorkItemDefinition ( java . lang . String ) { final java . util . List < org . drools . workbench . models . datamodel . workitems . PortableWorkDefinition > workItemDefinitions = new java . util . ArrayList ( presenter . getWorkItemDefinitions ( ) ) ; return workItemDefinitions . stream ( ) . filter ( ( a ) -> a . getName ( ) . equals ( workItem ) ) . findFirst ( ) . orElseThrow ( IllegalStateException :: new ) ; } | org . junit . Assert . assertEquals ( workItem1 , workItem ) |
uploadDirectoryWithRetries ( ) { final com . microsoft . azure . maven . FTPUploader uploaderSpy = spy ( ftpUploader ) ; org . apache . maven . plugin . MojoExecutionException exception = null ; doReturn ( false ) . when ( uploaderSpy ) . uploadDirectory ( anyString ( ) , anyString ( ) , anyString ( ) , anyString ( ) , anyString ( ) ) ; try { uploaderSpy . uploadDirectoryWithRetries ( "ftpServer" , "username" , "password" , "sourceDir" , "targetDir" , 1 ) ; } catch ( org . apache . maven . plugin . MojoExecutionException e ) { exception = e ; } finally { "<AssertPlaceHolder>" ; } doReturn ( true ) . when ( uploaderSpy ) . uploadDirectory ( anyString ( ) , anyString ( ) , anyString ( ) , anyString ( ) , anyString ( ) ) ; uploaderSpy . uploadDirectoryWithRetries ( "ftpServer" , "username" , "password" , "sourceDir" , "targetDir" , 1 ) ; } uploadDirectoryWithRetries ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , int ) { int retryCount = 0 ; while ( retryCount < maxRetryCount ) { retryCount ++ ; log . info ( ( ( com . microsoft . azure . maven . FTPUploader . UPLOAD_START ) + ftpServer ) ) ; if ( uploadDirectory ( ftpServer , username , password , sourceDirectory , targetDirectory ) ) { log . info ( ( ( com . microsoft . azure . maven . FTPUploader . UPLOAD_SUCCESS ) + ftpServer ) ) ; return ; } else { log . warn ( java . lang . String . format ( com . microsoft . azure . maven . FTPUploader . UPLOAD_FAILURE , retryCount , maxRetryCount ) ) ; } } throw new org . apache . maven . plugin . MojoExecutionException ( java . lang . String . format ( com . microsoft . azure . maven . FTPUploader . UPLOAD_RETRY_FAILURE , maxRetryCount ) ) ; } | org . junit . Assert . assertNotNull ( exception ) |
TestMultiFormatLoaderWithEmptyRecords ( ) { org . junit . Assume . assumeTrue ( ( ( com . twitter . elephantbird . pig . load . TestErrorsInInput . pigServer ) != null ) ) ; java . lang . String testDir = ( java . lang . System . getProperty ( "test.build.data" ) ) + "/TestEmptyRecords" ; final java . io . File inDir = new java . io . File ( testDir , "in" ) ; inDir . mkdirs ( ) ; com . twitter . elephantbird . mapreduce . io . RawBlockWriter blk_writer = new com . twitter . elephantbird . mapreduce . io . RawBlockWriter ( createLzoOut ( new java . io . File ( inDir , "1-block.lzo" ) , com . twitter . elephantbird . pig . load . TestErrorsInInput . conf ) ) ; java . io . OutputStream b64_writer = createLzoOut ( new java . io . File ( inDir , "2-b64.lzo" ) , com . twitter . elephantbird . pig . load . TestErrorsInInput . conf ) ; org . apache . commons . codec . binary . Base64 base64 = com . twitter . elephantbird . util . Codecs . createStandardBase64 ( ) ; for ( com . twitter . elephantbird . thrift . test . TestPerson rec : records ) { byte [ ] bytes = tConverter . toBytes ( rec ) ; blk_writer . write ( bytes ) ; blk_writer . write ( new byte [ 0 ] ) ; b64_writer . write ( base64 . encode ( bytes ) ) ; b64_writer . write ( Protobufs . NEWLINE_UTF8_BYTE ) ; b64_writer . write ( Protobufs . NEWLINE_UTF8_BYTE ) ; } blk_writer . close ( ) ; b64_writer . close ( ) ; com . twitter . elephantbird . pig . load . TestErrorsInInput . pigServer . registerQuery ( java . lang . String . format ( "A<sp>=<sp>load<sp>\'%s\'<sp>using<sp>%s(\'%s\');\n" , inDir . toURI ( ) . toString ( ) , com . twitter . elephantbird . pig . load . MultiFormatLoader . class . getName ( ) , com . twitter . elephantbird . thrift . test . TestPerson . class . getName ( ) ) ) ; java . util . Iterator < org . apache . pig . data . Tuple > rows = com . twitter . elephantbird . pig . load . TestErrorsInInput . pigServer . openIterator ( "A" ) ; for ( int i = 0 ; i < 2 ; i ++ ) { for ( com . twitter . elephantbird . thrift . test . TestPerson person : records ) { java . lang . String expected = personToString ( person ) ; "<AssertPlaceHolder>" ; } } org . apache . hadoop . fs . FileUtil . fullyDelete ( new java . io . File ( testDir ) ) ; } next ( ) { return pw . get ( ) ; } | org . junit . Assert . assertEquals ( expected , rows . next ( ) . toString ( ) ) |
testPostIndexesAreCreated ( ) { android . database . Cursor cursor = com . memtrip . sqlking . operation . function . Raw . getBuilder ( ) . query ( "PRAGMA<sp>INDEX_LIST('Post');" ) . execute ( getSQLProvider ( ) ) ; java . util . List < java . lang . String > indexes = getIndexes ( cursor ) ; "<AssertPlaceHolder>" ; } getIndexes ( android . database . Cursor ) { java . util . List < java . lang . String > indexes = new java . util . ArrayList ( ) ; try { while ( cursor . moveToNext ( ) ) { int index = cursor . getColumnIndex ( "name" ) ; if ( index != ( - 1 ) ) { java . lang . String indexName = cursor . getString ( index ) ; indexes . add ( indexName ) ; } } } finally { cursor . close ( ) ; } return indexes ; } | org . junit . Assert . assertEquals ( 1 , indexes . size ( ) ) |
getControllerInstanceStatus_VServerProvisioning ( ) { parameters . put ( PropertyHandler . SYSTEM_TEMPLATE_ID , new org . oscm . app . v2_0 . data . Setting ( PropertyHandler . SYSTEM_TEMPLATE_ID , "" ) ) ; paramHandler . setState ( FlowState . VSERVER_CREATED ) ; org . oscm . app . v2_0 . data . InstanceStatus result = processManagerBean . getControllerInstanceStatus ( "controllerId" , "instanceId" , paramHandler ) ; "<AssertPlaceHolder>" ; } getControllerInstanceStatus ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler ) { if ( paramHandler . isInstanceSuspended ( ) ) { return getInstanceStatusForSuspendedInstance ( ) ; } org . oscm . app . iaas . data . FlowState oldState = paramHandler . getState ( ) ; performProvisioningProcessing ( controllerId , instanceId , paramHandler ) ; org . oscm . app . iaas . data . FlowState state = paramHandler . getState ( ) ; if ( state == ( org . oscm . app . iaas . data . FlowState . FAILED ) ) { throw new org . oscm . app . v2_0 . exceptions . APPlatformException ( org . oscm . app . iaas . i18n . Messages . getAll ( "error_operation" ) ) ; } org . oscm . app . iaas . data . Operation operation = paramHandler . getOperation ( ) ; org . oscm . app . v2_0 . data . InstanceStatus result = new org . oscm . app . v2_0 . data . InstanceStatus ( ) ; result . setIsReady ( ( ( ( state == ( org . oscm . app . iaas . data . FlowState . FINISHED ) ) && ( ( operation != null ) && ( ! ( operation . isDeletion ( ) ) ) ) ) || ( state == ( org . oscm . app . iaas . data . FlowState . DESTROYED ) ) ) ) ; result . setRunWithTimer ( ( state != ( org . oscm . app . iaas . data . FlowState . MANUAL ) ) ) ; if ( state == ( org . oscm . app . iaas . data . FlowState . VSERVERS_STOPPING ) ) { result . setAccessInfo ( org . oscm . app . iaas . i18n . Messages . get ( paramHandler . getCustomerLocale ( ) , "accessInfo_NOT_AVAILABLE" ) ) ; } if ( result . isReady ( ) ) { if ( ( state != ( org . oscm . app . iaas . data . FlowState . DESTROYED ) ) && ( oldState != ( org . oscm . app . iaas . data . FlowState . VSERVERS_STOPPING ) ) ) { result . setAccessInfo ( getConnectionData ( instanceId , paramHandler ) ) ; } sendMailAboutModification ( instanceId , paramHandler ) ; } return result ; } | org . junit . Assert . assertNotNull ( result ) |
testConvertNullListOfJavaTypes ( ) { final java . util . List < org . springframework . roo . classpath . details . annotations . AnnotatedJavaType > annotatedTypes = org . springframework . roo . classpath . details . annotations . AnnotatedJavaType . convertFromJavaTypes ( ( ( java . util . List < org . springframework . roo . model . JavaType > ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return customData . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , annotatedTypes . size ( ) ) |
testVoerRegelUitMetOverlijdenNull ( ) { final nl . bzk . brp . model . hisvolledig . momentview . kern . PersoonView huidigeSituatie = maakHuidigeSituatie ( ) ; final nl . bzk . brp . model . bericht . kern . PersoonBericht nieuweSituatie = maakNieuweSituatie ( nl . bzk . brp . bijhouding . business . regels . impl . gegevenset . persoon . overlijden . BRBY0902Test . DATUM_OVERLIJDEN_NA_INSCHRIJVING ) ; nieuweSituatie . setOverlijden ( null ) ; final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > resultaat = brby0902 . voerRegelUit ( huidigeSituatie , nieuweSituatie , null , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , resultaat . size ( ) ) |
testSetLocalPhoneAutocomplete ( ) { com . github . bordertech . wcomponents . WPhoneNumberField field = new com . github . bordertech . wcomponents . WPhoneNumberField ( ) ; java . lang . String expected = Telephone . LOCAL . getValue ( ) ; field . setLocalPhoneAutocomplete ( ) ; "<AssertPlaceHolder>" ; } getAutocomplete ( ) { return getComponentModel ( ) . autocomplete ; } | org . junit . Assert . assertEquals ( expected , field . getAutocomplete ( ) ) |
testToString ( ) { org . apache . poi . ddf . UnknownEscherRecord r = new org . apache . poi . ddf . UnknownEscherRecord ( ) ; r . setOptions ( ( ( short ) ( 4660 ) ) ) ; r . setRecordId ( ( ( short ) ( 61714 ) ) ) ; byte [ ] data = new byte [ 8 ] ; r . serialize ( 0 , data , new org . apache . poi . ddf . NullEscherSerializationListener ( ) ) ; java . lang . String nl = java . lang . System . getProperty ( "line.separator" ) ; java . lang . String expected = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "org.apache.poi.ddf.UnknownEscherRecord<sp>(Unknown<sp>0xF112):" + nl ) + "<sp>RecordId:<sp>0xF112" ) + nl ) + "<sp>Version:<sp>0x0004" ) + nl ) + "<sp>Instance:<sp>0x0123" ) + nl ) + "<sp>Options:<sp>0x1234" ) + nl ) + "line.separator" 0 ) + nl ) + "<sp>isContainer:<sp>false" ) + nl ) + "<sp>children:<sp>0x00000000" ) + nl ) + "<sp>Extra<sp>Data:<sp>" ) + nl ) + "<sp>:<sp>0" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( "ExcelAntEvaluationResult<sp>[evaluationCompletedWithError=" + ( evaluationCompletedWithError ) ) + ",<sp>didPass=" ) + ( didPass ) ) + ",<sp>returnValue=" ) + ( returnValue ) ) + ",<sp>errorMessage=" ) + ( errorMessage ) ) + ",<sp>actualDelta=" ) + ( actualDelta ) ) + ",<sp>cellName=" ) + ( cellName ) ) + "]" ; } | org . junit . Assert . assertEquals ( expected , r . toString ( ) ) |
testReducerForIntWritableKeyAndValue ( ) { org . apache . hadoop . io . IntWritable key = new org . apache . hadoop . io . IntWritable ( 123 ) ; co . nubetech . hiho . dedup . HihoTuple hihoTuple = new co . nubetech . hiho . dedup . HihoTuple ( ) ; hihoTuple . setKey ( key ) ; org . apache . hadoop . io . IntWritable value1 = new org . apache . hadoop . io . IntWritable ( 456 ) ; java . util . ArrayList < org . apache . hadoop . io . IntWritable > values = new java . util . ArrayList < org . apache . hadoop . io . IntWritable > ( ) ; values . add ( value1 ) ; org . apache . hadoop . mapreduce . Reducer . Context context = mock ( Reducer . Context . class ) ; org . apache . hadoop . mapreduce . Counters counters = new org . apache . hadoop . mapreduce . Counters ( ) ; org . apache . hadoop . mapreduce . Counter counter = counters . findCounter ( DedupRecordCounter . OUTPUT ) ; when ( context . getCounter ( DedupRecordCounter . OUTPUT ) ) . thenReturn ( counter ) ; co . nubetech . hiho . dedup . DedupValueReducer dedupReducer = new co . nubetech . hiho . dedup . DedupValueReducer ( ) ; dedupReducer . reduce ( hihoTuple , values , context ) ; verify ( context ) . write ( value1 , key ) ; "<AssertPlaceHolder>" ; } write ( K , V ) { writeObject ( value ) ; out . write ( co . nubetech . hiho . mapreduce . lib . output . NoKeyOnlyValueOutputFormat . NoKeyRecordWriter . newline ) ; } | org . junit . Assert . assertEquals ( 1 , context . getCounter ( DedupRecordCounter . OUTPUT ) . getValue ( ) ) |
getSurroundingCellsNearLowerRight ( ) { com . fundynamic . d2tm . game . map . Cell cell = makeCell ( ( ( map . getWidth ( ) ) + 1 ) , ( ( map . getHeight ( ) ) + 1 ) ) ; java . util . List < com . fundynamic . d2tm . game . map . Cell > surroundingCells = cell . getSurroundingCells ( ) ; "<AssertPlaceHolder>" ; } getSurroundingCells ( ) { return java . util . Arrays . asList ( getNeighbouringCell ( ( - 1 ) , ( - 1 ) ) , getNeighbouringCell ( 0 , ( - 1 ) ) , getNeighbouringCell ( 1 , ( - 1 ) ) , getNeighbouringCell ( 1 , 0 ) , getNeighbouringCell ( 1 , 1 ) , getNeighbouringCell ( 0 , 1 ) , getNeighbouringCell ( ( - 1 ) , 1 ) , getNeighbouringCell ( ( - 1 ) , 0 ) ) . stream ( ) . filter ( ( el ) -> el != null ) . collect ( java . util . stream . Collectors . toList ( ) ) ; } | org . junit . Assert . assertEquals ( 3 , surroundingCells . size ( ) ) |
testGetTotalTimeMillis ( ) { frame . addElapsedTime ( 1 ) ; frame . addElapsedTime ( 2 ) ; "<AssertPlaceHolder>" ; } getTotalTimeMilis ( ) { return java . lang . Math . round ( this . elapsedTimeStatistics . getValueSum ( ) ) ; } | org . junit . Assert . assertEquals ( 3 , frame . getTotalTimeMilis ( ) ) |
select ( ) { org . qlrm . executor . JpaQueryExecutor queryExecutor = new org . qlrm . executor . JpaQueryExecutor ( ) ; java . util . List < org . qlrm . to . EmployeeTO > list = queryExecutor . executeSelect ( em , org . qlrm . to . EmployeeTO . class , "select.sql" ) ; "<AssertPlaceHolder>" ; for ( org . qlrm . to . EmployeeTO rec : list ) { org . qlrm . executor . JpaQueryExecutorTest . LOGGER . debug ( rec ) ; } } | org . junit . Assert . assertNotNull ( list ) |
testWithEmptyGraphWithoutVertices ( ) { org . apache . flink . api . java . DataSet < org . apache . flink . graph . Edge < org . apache . flink . types . LongValue , org . apache . flink . api . java . tuple . Tuple2 < org . apache . flink . types . NullValue , org . apache . flink . graph . asm . degree . annotate . directed . VertexDegrees . Degrees > > > targetDegrees = emptyGraphWithoutVertices . run ( new org . apache . flink . graph . asm . degree . annotate . directed . EdgeTargetDegrees ( ) ) ; "<AssertPlaceHolder>" ; } collect ( ) { final java . lang . String id = new org . apache . flink . util . AbstractID ( ) . toString ( ) ; final org . apache . flink . api . common . typeutils . TypeSerializer < T > serializer = getType ( ) . createSerializer ( getExecutionEnvironment ( ) . getConfig ( ) ) ; this . output ( new org . apache . flink . api . java . Utils . CollectHelper < > ( id , serializer ) ) . name ( "collect()" ) ; org . apache . flink . api . common . JobExecutionResult res = getExecutionEnvironment ( ) . execute ( ) ; java . util . ArrayList < byte [ ] > accResult = res . getAccumulatorResult ( id ) ; if ( accResult != null ) { try { return org . apache . flink . api . common . accumulators . SerializedListAccumulator . deserializeList ( accResult , serializer ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( "Cannot<sp>find<sp>type<sp>class<sp>of<sp>collected<sp>data<sp>type." , e ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( "Serialization<sp>error<sp>while<sp>deserializing<sp>collected<sp>data" , e ) ; } } else { throw new java . lang . RuntimeException ( "The<sp>call<sp>to<sp>collect()<sp>could<sp>not<sp>retrieve<sp>the<sp>DataSet." ) ; } } | org . junit . Assert . assertEquals ( 0 , targetDegrees . collect ( ) . size ( ) ) |
extractAssertionFromRespondingGatewayDSRequestType ( ) { gov . hhs . fha . nhinc . event . builder . AssertionDescriptionExtractor extractor = new gov . hhs . fha . nhinc . event . builder . AssertionDescriptionExtractor ( ) ; gov . hhs . fha . nhinc . common . nhinccommonentity . RespondingGatewayProvideAndRegisterDocumentSetRequestType request = new gov . hhs . fha . nhinc . common . nhinccommonentity . RespondingGatewayProvideAndRegisterDocumentSetRequestType ( ) ; gov . hhs . fha . nhinc . common . nhinccommon . AssertionType assertion = new gov . hhs . fha . nhinc . common . nhinccommon . AssertionType ( ) ; request . setAssertion ( assertion ) ; gov . hhs . fha . nhinc . common . nhinccommon . AssertionType returnAssertion = extractor . getAssertion ( ( ( java . lang . Object ) ( request ) ) ) ; "<AssertPlaceHolder>" ; } getAssertion ( java . lang . String ) { gov . hhs . fha . nhinc . common . nhinccommon . AssertionType assertion = new gov . hhs . fha . nhinc . common . nhinccommon . AssertionType ( ) ; assertion . setHomeCommunity ( new gov . hhs . fha . nhinc . common . nhinccommon . HomeCommunityType ( ) ) ; assertion . getHomeCommunity ( ) . setHomeCommunityId ( hcid ) ; return assertion ; } | org . junit . Assert . assertNotNull ( returnAssertion ) |
testLocalhostUnknownHostException ( ) { java . net . UnknownHostException unknownHostException = new java . net . UnknownHostException ( "X-TEST-UHE-X" ) ; try { org . powermock . api . mockito . PowerMockito . mockStatic ( java . net . InetAddress . class ) ; org . powermock . api . mockito . PowerMockito . when ( java . net . InetAddress . getLocalHost ( ) ) . thenThrow ( unknownHostException ) ; createWriter ( ) ; org . junit . Assert . fail ( "LifecycleException<sp>missing" ) ; } catch ( java . net . UnknownHostException ex ) { "<AssertPlaceHolder>" ; } } createWriter ( ) { return createWriter ( java . util . Collections . < java . lang . String , java . lang . Object > emptyMap ( ) ) ; } | org . junit . Assert . assertSame ( unknownHostException , ex ) |
testVisitFile ( ) { java . nio . file . Path file = tempPath . resolve ( "file" ) ; java . nio . file . Files . createFile ( file ) ; instance . visitFile ( file , fileAttributesForFile ( ) ) ; "<AssertPlaceHolder>" ; } fileAttributesForFile ( ) { return new java . nio . file . attribute . BasicFileAttributes ( ) { @ edu . illinois . library . cantaloupe . util . Override public java . nio . file . attribute . FileTime lastModifiedTime ( ) { return null ; } @ edu . illinois . library . cantaloupe . util . Override public java . nio . file . attribute . FileTime lastAccessTime ( ) { return null ; } @ edu . illinois . library . cantaloupe . util . Override public java . nio . file . attribute . FileTime creationTime ( ) { return null ; } @ edu . illinois . library . cantaloupe . util . Override public boolean isRegularFile ( ) { return true ; } @ edu . illinois . library . cantaloupe . util . Override public boolean isDirectory ( ) { return false ; } @ edu . illinois . library . cantaloupe . util . Override public boolean isSymbolicLink ( ) { return false ; } @ edu . illinois . library . cantaloupe . util . Override public boolean isOther ( ) { return false ; } @ edu . illinois . library . cantaloupe . util . Override public long size ( ) { return 0 ; } @ edu . illinois . library . cantaloupe . util . Override public java . lang . Object fileKey ( ) { return null ; } } ; } | org . junit . Assert . assertFalse ( java . nio . file . Files . exists ( file ) ) |
testSetFps ( ) { com . bixly . pastevid . recorders . VideoRecorderTest . log ( "setFps" ) ; int framesPerSecond = 0 ; com . bixly . pastevid . recorders . Recorder recorder = new com . bixly . pastevid . recorders . Recorder ( null ) ; com . bixly . pastevid . recorders . VideoRecorder instance = new com . bixly . pastevid . recorders . VideoRecorder ( recorder ) ; instance . setFps ( framesPerSecond ) ; "<AssertPlaceHolder>" ; } getFps ( ) { return this . fps ; } | org . junit . Assert . assertEquals ( framesPerSecond , instance . getFps ( ) ) |
testGetCalculateCRC32SqlFileAndTable ( ) { java . lang . String sql = org . sagebionetworks . table . cluster . SQLUtils . getCalculateCRC32Sql ( org . sagebionetworks . repo . model . table . ViewTypeMask . getMaskForDepricatedType ( ViewType . file_and_table ) ) ; java . lang . String expected = "SELECT<sp>SUM(CRC32(CONCAT(ID,<sp>'-',ETAG,<sp>'-',<sp>BENEFACTOR_ID)))" + "<sp>FROM<sp>ENTITY_REPLICATION<sp>WHERE<sp>TYPE<sp>IN<sp>('file',<sp>'table')<sp>AND<sp>PARENT_ID<sp>IN<sp>(:parentIds)" ; "<AssertPlaceHolder>" ; } getMaskForDepricatedType ( org . sagebionetworks . repo . model . table . ViewType ) { switch ( oldType ) { case file : return org . sagebionetworks . repo . model . table . ViewTypeMask . File . bitMask ; case project : return org . sagebionetworks . repo . model . table . ViewTypeMask . Project . bitMask ; case file_and_table : return ( org . sagebionetworks . repo . model . table . ViewTypeMask . File . bitMask ) | ( org . sagebionetworks . repo . model . table . ViewTypeMask . Table . bitMask ) ; default : throw new java . lang . IllegalArgumentException ( ( "Unknown<sp>type:<sp>" + oldType ) ) ; } } | org . junit . Assert . assertEquals ( expected , sql ) |
testNewFormatterNullNullNull ( ) { com . sun . mail . util . logging . CollectorFormatter f = new com . sun . mail . util . logging . CollectorFormatter ( ( ( java . lang . String ) ( null ) ) , ( ( 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 ( ) ) |
testWaitForAnswerError ( ) { jline . console . ConsoleReader consoleReader = mockConsoleReader ( "test-answer\n" ) ; consoleReader . getInput ( ) . close ( ) ; mockAbstractStep . setConsoleReader ( consoleReader ) ; java . lang . String answer = mockAbstractStep . waitForAnswer ( ) ; "<AssertPlaceHolder>" ; } waitForAnswer ( ) { try { jline . console . ConsoleReader consoleReader = getConsoleReader ( ) ; java . lang . String answer = consoleReader . readLine ( ) ; java . util . Optional < java . lang . String > defaultAnswer = getDefaultAnswer ( ) ; return ( answer . isEmpty ( ) ) && ( defaultAnswer . isPresent ( ) ) ? defaultAnswer . get ( ) : answer ; } catch ( java . lang . Exception e ) { logger . error ( java . lang . String . format ( "Error<sp>while<sp>getting<sp>input:<sp>%s" , e . getMessage ( ) ) ) ; return "" ; } } | org . junit . Assert . assertThat ( answer , org . hamcrest . Matchers . equalTo ( "" ) ) |
isImageReturnsFalseIfFileHasNoExtension ( ) { "<AssertPlaceHolder>" ; } isImage ( java . lang . String ) { if ( null == extension ) { return false ; } return ( java . util . Arrays . binarySearch ( com . buddycloud . mediaserver . business . util . ImageUtils . FORMATS , extension . toLowerCase ( ) ) ) >= 0 ; } | org . junit . Assert . assertFalse ( com . buddycloud . mediaserver . business . util . ImageUtils . isImage ( null ) ) |
testGetObjectInfoUsingBasicLookupStrategyWithoutPrefixOrSuffix ( ) { edu . illinois . library . cantaloupe . config . Configuration config = edu . illinois . library . cantaloupe . config . Configuration . getInstance ( ) ; config . setProperty ( Key . S3SOURCE_PATH_PREFIX , "" ) ; config . setProperty ( Key . S3SOURCE_PATH_SUFFIX , "" ) ; instance . setIdentifier ( new edu . illinois . library . cantaloupe . image . Identifier ( "id" ) ) ; "<AssertPlaceHolder>" ; } getObjectInfo ( ) { if ( ( objectInfo ) == null ) { switch ( edu . illinois . library . cantaloupe . source . LookupStrategy . from ( Key . S3SOURCE_LOOKUP_STRATEGY ) ) { case DELEGATE_SCRIPT : try { objectInfo = getObjectInfoUsingDelegateStrategy ( ) ; } catch ( javax . script . ScriptException e ) { throw new java . io . IOException ( e ) ; } break ; default : objectInfo = getObjectInfoUsingBasicStrategy ( ) ; break ; } } return objectInfo ; } | org . junit . Assert . assertEquals ( "id" , instance . getObjectInfo ( ) . getKey ( ) ) |
getLocalFunctionCoreToolsVersionFailed ( ) { final com . microsoft . azure . maven . function . AbstractFunctionMojo mojo = mock ( com . microsoft . azure . maven . function . AbstractFunctionMojo . class ) ; final com . microsoft . azure . maven . function . handlers . CommandHandler commandHandler = mock ( com . microsoft . azure . maven . function . handlers . CommandHandler . class ) ; final org . apache . maven . plugin . logging . Log log = mock ( org . apache . maven . plugin . logging . Log . class ) ; doReturn ( log ) . when ( mojo ) . getLog ( ) ; doNothing ( ) . when ( log ) . warn ( anyString ( ) ) ; final com . microsoft . azure . maven . function . handlers . FunctionCoreToolsHandlerImpl functionCoreToolsHandler = new com . microsoft . azure . maven . function . handlers . FunctionCoreToolsHandlerImpl ( mojo , commandHandler ) ; final com . microsoft . azure . maven . function . handlers . FunctionCoreToolsHandlerImpl functionCoreToolsHandlerSpy = spy ( functionCoreToolsHandler ) ; doReturn ( "unexpected<sp>output" ) . when ( commandHandler ) . runCommandAndGetOutput ( anyString ( ) , anyBoolean ( ) , any ( ) ) ; "<AssertPlaceHolder>" ; } getLocalFunctionCoreToolsVersion ( ) { try { final java . lang . String localVersion = commandHandler . runCommandAndGetOutput ( com . microsoft . azure . maven . function . handlers . FunctionCoreToolsHandlerImpl . GET_LOCAL_VERSION_CMD , false , null ) ; com . github . zafarkhaja . semver . Version . valueOf ( localVersion ) ; return localVersion ; } catch ( java . lang . Exception e ) { this . mojo . getLog ( ) . warn ( com . microsoft . azure . maven . function . handlers . FunctionCoreToolsHandlerImpl . GET_LOCAL_VERSION_FAIL ) ; return null ; } } | org . junit . Assert . assertNull ( functionCoreToolsHandlerSpy . getLocalFunctionCoreToolsVersion ( ) ) |
testSelectWithTableNameNowNotFindWithTableName ( ) { java . sql . ResultSet resultSet = stat . executeQuery ( "select<sp>test.id<sp>from<sp>test" ) ; "<AssertPlaceHolder>" ; resultSet . findColumn ( "test.id" ) ; } next ( ) { if ( ! ( open ) ) { return false ; } lastCol = - 1 ; if ( ( row ) == 0 ) { ( row ) ++ ; return true ; } if ( ( ( maxRows ) != 0 ) && ( ( row ) == ( maxRows ) ) ) { return false ; } int statusCode = getDatabase ( ) . step ( stmt . pointer ) ; switch ( statusCode ) { case SQLITE_DONE : close ( ) ; return false ; case SQLITE_ROW : ( row ) ++ ; return true ; case SQLITE_BUSY : default : getDatabase ( ) . throwex ( statusCode ) ; return false ; } } | org . junit . Assert . assertTrue ( resultSet . next ( ) ) |
testAddAllEmpty ( ) { "<AssertPlaceHolder>" ; } addAll ( java . lang . Object [ ] ) { assert elements != null ; if ( ( elements . length ) <= 0 ) { return false ; } int length = array . length ; int added = 0 ; for ( int i = 0 ; i < ( elements . length ) ; ++ i ) { java . lang . Object element = elements [ i ] ; if ( ( ( indexOf ( element , array , 0 , length ) ) < 0 ) && ( ( indexOf ( element , elements , 0 , added ) ) < 0 ) ) { elements [ ( added ++ ) ] = element ; } } if ( added <= 0 ) { return false ; } java . lang . Object [ ] newArray = java . util . Arrays . copyOf ( array , ( length + added ) ) ; java . lang . System . arraycopy ( elements , 0 , newArray , length , added ) ; array = newArray ; return true ; } | org . junit . Assert . assertFalse ( set . addAll ( java . util . Arrays . asList ( ) ) ) |
test_issue874 ( ) { try ( com . marklogic . client . eval . EvalResultIterator iterator = new com . marklogic . client . eval . EvalResultIterator ( ) { @ com . marklogic . client . test . Override public void close ( ) throws com . marklogic . client . test . RuntimeException { throw new java . lang . RuntimeException ( "test<sp>close()<sp>from<sp>try-with-resources" ) ; } public com . marklogic . client . test . java . util . Iterator < com . marklogic . client . eval . EvalResult > iterator ( ) { return this ; } @ com . marklogic . client . test . Override public boolean hasNext ( ) { return false ; } @ com . marklogic . client . test . Override public com . marklogic . client . eval . EvalResult next ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } } ) { "<AssertPlaceHolder>" ; } org . junit . Assert . fail ( "Should<sp>not<sp>get<sp>here.<sp>Close<sp>method<sp>should<sp>have<sp>been<sp>invoked,<sp>throwing<sp>an<sp>exception" ) ; } hasNext ( ) { if ( ( nextUri ) != null ) return true ; if ( ( finished ) == true ) return false ; try { nextUri = com . marklogic . client . example . cookbook . datamovement . IncrementalLoadFromJdbc . uriQueue . poll ( 600 , TimeUnit . SECONDS ) ; if ( " | org . junit . Assert . assertFalse ( iterator . hasNext ( ) ) |
KeyInConstructorSymmetricVerificationKeyShouldMatch ( ) { com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . SymmetricVerificationKey key = new com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . SymmetricVerificationKey ( ) ; byte [ ] keyValue = key . getKeyValue ( ) ; com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . SymmetricVerificationKey key2 = new com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . SymmetricVerificationKey ( keyValue ) ; byte [ ] resultsValue = key2 . getKeyValue ( ) ; "<AssertPlaceHolder>" ; } getKeyValue ( ) { return keyValue ; } | org . junit . Assert . assertArrayEquals ( keyValue , resultsValue ) |
testTeamMemberSystemHookEvent ( ) { org . gitlab4j . api . systemhooks . TeamMemberSystemHookEvent event = org . gitlab4j . api . JsonUtils . unmarshalResource ( org . gitlab4j . api . systemhooks . TeamMemberSystemHookEvent . class , "team-member-system-hook-event.json" ) ; "<AssertPlaceHolder>" ; } compareJson ( T , java . lang . String ) { java . io . InputStreamReader reader = new java . io . InputStreamReader ( org . gitlab4j . api . TestGitLabApiBeans . class . getResourceAsStream ( filename ) ) ; return org . gitlab4j . api . JsonUtils . compareJson ( apiObject , reader ) ; } | org . junit . Assert . assertTrue ( org . gitlab4j . api . JsonUtils . compareJson ( event , "team-member-system-hook-event.json" ) ) |
testGetAucomplete ( ) { java . lang . String testString = "foo" ; com . github . bordertech . wcomponents . autocomplete . AutocompleteablePhone_Test . MyAutocompleteable component = new com . github . bordertech . wcomponents . autocomplete . AutocompleteablePhone_Test . MyAutocompleteable ( ) ; component . setAutocompleteDirectly ( testString ) ; "<AssertPlaceHolder>" ; } getAutocomplete ( ) { return autocomplete ; } | org . junit . Assert . assertEquals ( testString , component . getAutocomplete ( ) ) |
testRemoveSpecialCharacters ( ) { com . ctrip . xpipe . redis . console . alert . AlertEntity alertEntity = new com . ctrip . xpipe . redis . console . alert . AlertEntity ( new com . ctrip . xpipe . endpoint . HostPort ( "" , 6379 ) , "dc" , "cluster" , "shard" , "message\nmessage1" , ALERT_TYPE . CLIENT_INCONSIS ) ; System . out . println ( alertEntity . getMessage ( ) ) ; alertEntity . removeSpecialCharacters ( ) ; System . out . println ( alertEntity . getMessage ( ) ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; } | org . junit . Assert . assertFalse ( alertEntity . getMessage ( ) . contains ( "\n" ) ) |
builder_copy ( ) { ezvcard . util . PartialDate orig = ezvcard . util . PartialDate . builder ( ) . year ( 2015 ) . month ( 3 ) . date ( 5 ) . hour ( 12 ) . minute ( 1 ) . second ( 20 ) . offset ( new ezvcard . util . UtcOffset ( false , ( - 5 ) , 0 ) ) . build ( ) ; ezvcard . util . PartialDate copy = ezvcard . util . PartialDate . builder ( orig ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return new ezvcard . util . GeoUri ( this ) ; } | org . junit . Assert . assertEquals ( orig , copy ) |
nativeTransformer_testXmlToXml_xsl ( ) { javax . xml . transform . TransformerFactory transformerFactory = org . apache . xalan . xsltc . trax . TransformerFactoryImpl . newInstance ( ) ; java . lang . String xslPath = ( org . ikasan . component . converter . xml . XsltConverterTest . CLASSPATH_URL_PREFIX ) + "testXmlToXml.xsl" ; java . lang . ClassLoader classLoader = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; java . io . InputStream xslInputStream = classLoader . getResourceAsStream ( this . stripClasspathScheme ( xslPath ) ) ; javax . xml . transform . stream . StreamSource xsltSource = new javax . xml . transform . stream . StreamSource ( xslInputStream ) ; javax . xml . transform . Transformer transformer = transformerFactory . newTransformer ( xsltSource ) ; java . lang . String inputXml = "<sourceRoot><sourceElement1>element1Value</sourceElement1><sourceElement2>element2Value</sourceElement2></sourceRoot>" ; java . lang . String expectedOutput = "<?xml<sp>version=\"1.0\"<sp>encoding=\"UTF-8\"?><targetRoot><targetElement1>element1Value</targetElement1><targetElement2>element2Value</targetElement2></targetRoot>" ; org . xml . sax . InputSource inputSource = new org . xml . sax . InputSource ( new java . io . ByteArrayInputStream ( inputXml . getBytes ( ) ) ) ; javax . xml . transform . Source source = new javax . xml . transform . sax . SAXSource ( inputSource ) ; java . io . ByteArrayOutputStream outputDataStream = new java . io . ByteArrayOutputStream ( ) ; transformer . transform ( source , new javax . xml . transform . stream . StreamResult ( outputDataStream ) ) ; byte [ ] outputBytes = outputDataStream . toByteArray ( ) ; "<AssertPlaceHolder>" ; } transform ( org . ikasan . filetransfer . xml . transform . Source , org . ikasan . filetransfer . xml . transform . Result ) { if ( in == null ) throw new java . lang . NullPointerException ( "XML<sp>source<sp>can't<sp>be<sp>null" ) ; if ( out == null ) throw new java . lang . NullPointerException ( "Output<sp>target<sp>can't<sp>be<sp>null" ) ; org . ikasan . filetransfer . xml . transform . DefaultXSLTransformer . logger . debug ( "Transforming..." ) ; this . transformer . transform ( in , out ) ; org . ikasan . filetransfer . xml . transform . DefaultXSLTransformer . logger . debug ( "Transformation<sp>completed." ) ; } | org . junit . Assert . assertEquals ( expectedOutput , new java . lang . String ( outputBytes ) ) |
testFromMessageFailsForMalformedReplyToAddress ( ) { final java . lang . String correlationId = "the-correlation-id" ; final org . apache . qpid . proton . message . Message message = mock ( org . apache . qpid . proton . message . Message . class ) ; when ( message . getSubject ( ) ) . thenReturn ( "doThis" ) ; when ( message . getCorrelationId ( ) ) . thenReturn ( correlationId ) ; when ( message . getReplyTo ( ) ) . thenReturn ( java . lang . String . format ( "%s/%s/%s" , CommandConstants . COMMAND_ENDPOINT , "4711" , Constants . DEFAULT_TENANT ) ) ; "<AssertPlaceHolder>" ; } from ( org . apache . qpid . proton . message . Message , java . lang . String , java . lang . String ) { java . util . Objects . requireNonNull ( message ) ; java . util . Objects . requireNonNull ( tenantId ) ; java . util . Objects . requireNonNull ( deviceId ) ; boolean valid = ( message . getSubject ( ) ) != null ; final java . lang . String correlationId = java . util . Optional . ofNullable ( message . getCorrelationId ( ) ) . map ( ( obj ) -> { if ( obj instanceof java . lang . String ) { return ( ( java . lang . String ) ( obj ) ) ; } else { return null ; } } ) . orElseGet ( ( ) -> { final java . lang . Object obj = message . getMessageId ( ) ; if ( obj instanceof java . lang . String ) { return ( ( java . lang . String ) ( obj ) ) ; } else { return null ; } } ) ; if ( correlationId == null ) { valid = false ; } java . lang . String replyToId = null ; if ( ( message . getReplyTo ( ) ) != null ) { try { final org . eclipse . hono . util . ResourceIdentifier replyTo = org . eclipse . hono . util . ResourceIdentifier . fromString ( message . getReplyTo ( ) ) ; if ( ! ( CommandConstants . COMMAND_ENDPOINT . equals ( replyTo . getEndpoint ( ) ) ) ) { valid = false ; } else if ( ! ( tenantId . equals ( replyTo . getTenantId ( ) ) ) ) { valid = false ; } else { replyToId = replyTo . getPathWithoutBase ( ) ; if ( replyToId == null ) { valid = false ; } else { message . setReplyTo ( java . lang . String . format ( "%s/%s" , replyTo . getBasePath ( ) , org . eclipse . hono . client . Command . processForDeviceId ( replyToId , deviceId ) ) ) ; } } } catch ( java . lang . IllegalArgumentException e ) { valid = false ; } } final org . eclipse . hono . client . Command result = new org . eclipse . hono . client . Command ( valid , message , tenantId , deviceId , correlationId , replyToId ) ; return result ; } | org . junit . Assert . assertFalse ( org . eclipse . hono . client . Command . from ( message , Constants . DEFAULT_TENANT , "4711" ) . isValid ( ) ) |
testfavorites ( ) { "<AssertPlaceHolder>" ; } favoriteResources ( ) { if ( ( favorites . get ( ) ) == null ) { favorites . compareAndSet ( null , new com . smartsheet . api . internal . FavoriteResourcesImpl ( this ) ) ; } return favorites . get ( ) ; } | org . junit . Assert . assertNotNull ( smartsheet . favoriteResources ( ) ) |
testRemoveToken ( ) { oAuthTokenCacheService . removeToken ( "access" ) ; "<AssertPlaceHolder>" ; } removeToken ( java . lang . String ) { if ( oauthToken == null ) { return ; } tokenCache . invalidate ( oauthToken ) ; } | org . junit . Assert . assertEquals ( 0 , oAuthTokenCacheService . tokenCache . size ( ) ) |
testVerbosePrintSelfReference ( ) { final java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; final java . io . PrintStream outPrint = new java . io . PrintStream ( out ) ; final java . lang . String LABEL = "B" 3 ; final java . lang . String INDENT = "<sp>" ; final java . util . Map < java . lang . Integer , java . lang . Object > grandfather = new java . util . TreeMap ( ) ; final java . util . Map < java . lang . Integer , java . lang . Object > father = new java . util . TreeMap ( ) ; final java . util . Map < java . lang . Integer , java . lang . Object > son = new java . util . TreeMap ( ) ; grandfather . put ( 0 , "A" ) ; grandfather . put ( 1 , father ) ; father . put ( 2 , "B" ) ; father . put ( 3 , grandfather ) ; father . put ( 4 , son ) ; son . put ( 5 , "B" 5 ) ; son . put ( 6 , grandfather ) ; son . put ( 7 , father ) ; outPrint . println ( ( LABEL + "B" 1 ) ) ; outPrint . println ( "{" ) ; outPrint . println ( ( INDENT + "B" 2 ) ) ; outPrint . println ( ( INDENT + "B" 4 ) ) ; outPrint . println ( ( INDENT + "{" ) ) ; outPrint . println ( ( ( INDENT + INDENT ) + "2<sp>=<sp>B" ) ) ; outPrint . println ( ( ( INDENT + INDENT ) + "3<sp>=<sp>(ancestor[0]<sp>Map)" ) ) ; outPrint . println ( ( ( INDENT + INDENT ) + "4<sp>=<sp>" ) ) ; outPrint . println ( ( ( INDENT + INDENT ) + "{" ) ) ; outPrint . println ( ( ( ( INDENT + INDENT ) + INDENT ) + "5<sp>=<sp>C" ) ) ; outPrint . println ( ( ( ( INDENT + INDENT ) + INDENT ) + "6<sp>=<sp>(ancestor[1]<sp>Map)" ) ) ; outPrint . println ( ( ( ( INDENT + INDENT ) + INDENT ) + "7<sp>=<sp>(ancestor[0]<sp>Map)" ) ) ; outPrint . println ( ( ( INDENT + INDENT ) + "B" 0 ) ) ; outPrint . println ( ( INDENT + "B" 0 ) ) ; outPrint . println ( "B" 0 ) ; final java . lang . String EXPECTED_OUT = out . toString ( ) ; out . reset ( ) ; org . apache . commons . collections4 . MapUtils . verbosePrint ( outPrint , "B" 3 , grandfather ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( ( last ) != null ) { return ( ( ( "MapIterator[" + ( getKey ( ) ) ) + "=" ) + ( getValue ( ) ) ) + "]" ; } return "MapIterator[]" ; } | org . junit . Assert . assertEquals ( EXPECTED_OUT , out . toString ( ) ) |
consumeUntilSuccessful ( ) { org . mule . runtime . core . api . util . func . OnceTestCase . CountingConsumer consumer = new org . mule . runtime . core . api . util . func . OnceTestCase . CountingConsumer ( ) ; org . mule . runtime . core . api . util . func . Once . ConsumeOnce < java . lang . String > once = org . mule . runtime . core . api . util . func . Once . of ( ( value ) -> { consumer . accept ( value ) ; int count = consumer . getInvokationCount ( ) ; if ( count < 3 ) { throw new java . lang . RuntimeException ( ) ; } } ) ; for ( int i = 0 ; i < 5 ; i ++ ) { try { once . consumeOnce ( "value" ) ; break ; } catch ( java . lang . Exception e ) { } } "<AssertPlaceHolder>" ; } consumeOnce ( T ) { consumer . accept ( value ) ; } | org . junit . Assert . assertThat ( consumer . getInvokationCount ( ) , org . hamcrest . CoreMatchers . is ( 3 ) ) |
testFindWithEmptyPathNonMatchingType ( ) { final com . allanbank . mongodb . bson . impl . RootDocument element = new com . allanbank . mongodb . bson . impl . RootDocument ( new com . allanbank . mongodb . bson . element . BooleanElement ( "1" , false ) ) ; final java . util . List < com . allanbank . mongodb . bson . element . BooleanElement > elements = element . find ( com . allanbank . mongodb . bson . element . BooleanElement . class ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = ( HEADER_SIZE ) + 10 ; size += com . allanbank . mongodb . bson . io . StringEncoder . utf8Size ( myDatabaseName ) ; size += com . allanbank . mongodb . bson . io . StringEncoder . utf8Size ( myCollectionName ) ; size += myQuery . size ( ) ; return size ; } | org . junit . Assert . assertEquals ( 0 , elements . size ( ) ) |
testEstimateJoinNodeCost ( ) { org . teiid . query . metadata . QueryMetadataInterface metadata = org . teiid . query . unittest . RealMetadataFactory . example4 ( ) ; org . teiid . query . optimizer . relational . plantree . PlanNode joinNode = org . teiid . query . optimizer . relational . rules . TestCalculateCostUtil . helpGetJoinNode ( NewCalculateCostUtil . UNKNOWN_VALUE , NewCalculateCostUtil . UNKNOWN_VALUE , JoinType . JOIN_CROSS ) ; float cost = org . teiid . query . optimizer . relational . rules . NewCalculateCostUtil . computeCostForTree ( joinNode , metadata ) ; "<AssertPlaceHolder>" ; } computeCostForTree ( org . teiid . query . optimizer . relational . plantree . PlanNode , org . teiid . query . metadata . QueryMetadataInterface ) { org . teiid . query . optimizer . relational . rules . NewCalculateCostUtil . updateCardinality ( node , metadata ) ; return node . getCardinality ( ) ; } | org . junit . Assert . assertTrue ( ( cost == ( NewCalculateCostUtil . UNKNOWN_VALUE ) ) ) |
testWordsSeparatedBySpacesCorrect ( ) { java . lang . String inputStringCorrect = "word<sp>wod2" ; java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( "[\\w+|\\s]" ) ; java . util . regex . Matcher matcher = pattern . matcher ( inputStringCorrect ) ; boolean isValid = matcher . matches ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertFalse ( isValid ) |
getWhenDisabledBySystemStringGivenDefaultsThenReturnsEmptyString ( ) { final com . nirima . jenkins . plugins . docker . DockerDisabledTest . TestClass i = new com . nirima . jenkins . plugins . docker . DockerDisabledTest . TestClass ( ) ; final java . lang . String actual = i . getWhenDisabledBySystemString ( ) ; "<AssertPlaceHolder>" ; } getWhenDisabledBySystemString ( ) { if ( ! ( getDisabledBySystem ( ) ) ) { return "" ; } final long now = readTimeNowInNanoseconds ( ) ; final long howLongAgoInNanoseconds = now - ( nanotimeWhenDisabledBySystem ) ; final long howLongAgoInMilliseconds = TimeUnit . NANOSECONDS . toMillis ( howLongAgoInNanoseconds ) ; return hudson . Util . getPastTimeString ( howLongAgoInMilliseconds ) ; } | org . junit . Assert . assertEquals ( "" , actual ) |
deleteIndex ( ) { try { db . createCollection ( com . arangodb . ArangoDatabaseTest . COLLECTION_NAME , null ) ; final java . util . Collection < java . lang . String > fields = new java . util . ArrayList < java . lang . String > ( ) ; fields . add ( "a" ) ; final com . arangodb . entity . IndexEntity createResult = db . collection ( com . arangodb . ArangoDatabaseTest . COLLECTION_NAME ) . ensureHashIndex ( fields , null ) ; final java . lang . String id = db . deleteIndex ( createResult . getId ( ) ) ; "<AssertPlaceHolder>" ; try { db . getIndex ( id ) ; org . junit . Assert . fail ( ) ; } catch ( final com . arangodb . ArangoDBException e ) { } } finally { db . collection ( com . arangodb . ArangoDatabaseTest . COLLECTION_NAME ) . drop ( ) ; } } getId ( ) { return id ; } | org . junit . Assert . assertThat ( id , org . hamcrest . Matchers . is ( createResult . getId ( ) ) ) |
shouldReturnCountForGivenCriteriaQueryWithGivenIndexUsingCriteriaQuery ( ) { java . lang . String documentId = java . lang . String . valueOf ( java . util . concurrent . ThreadLocalRandom . current ( ) . nextLong ( ) ) . substring ( 1 , 6 ) ; com . github . vanroy . springdata . jest . SampleEntity sampleEntity = com . github . vanroy . springdata . jest . SampleEntity . builder ( ) . id ( documentId ) . message ( "some<sp>message" ) . version ( java . lang . System . currentTimeMillis ( ) ) . build ( ) ; com . github . vanroy . springdata . jest . IndexQuery indexQuery = getIndexQuery ( sampleEntity ) ; elasticsearchTemplate . index ( indexQuery ) ; elasticsearchTemplate . refresh ( com . github . vanroy . springdata . jest . SampleEntity . class ) ; com . github . vanroy . springdata . jest . CriteriaQuery criteriaQuery = new com . github . vanroy . springdata . jest . CriteriaQuery ( new com . github . vanroy . springdata . jest . Criteria ( ) ) ; criteriaQuery . addIndices ( "test-index" ) ; long count = elasticsearchTemplate . count ( criteriaQuery ) ; "<AssertPlaceHolder>" ; } count ( com . github . vanroy . springdata . jest . SearchQuery ) { return count ( query , null ) ; } | org . junit . Assert . assertThat ( count , is ( equalTo ( 1L ) ) ) |
testProcessRuntime_overrideWithJava ( ) { setupSourceDirectory ( "<vm>true</vm>" ) ; when ( stageMojo . getCompileTargetVersion ( ) ) . thenReturn ( "1.8" ) ; java . lang . String processedRuntime = new com . google . cloud . tools . maven . stage . AppEngineWebXmlStager . ConfigBuilder ( stageMojo ) . processRuntime ( ) ; "<AssertPlaceHolder>" ; } processRuntime ( ) { java . nio . file . Path appengineWebXml = stageMojo . getAppEngineWebXml ( ) ; if ( ( ( java . lang . Float . parseFloat ( stageMojo . getCompileTargetVersion ( ) ) ) > 1.7F ) && ( isVm ( appengineWebXml ) ) ) { return "java" ; } return null ; } | org . junit . Assert . assertEquals ( "java" , processedRuntime ) |
testRound4 ( ) { long tsInMS = 0L ; long tsInDay = org . apache . eagle . common . DateTimeUtil . roundDown ( Calendar . DATE , tsInMS ) ; "<AssertPlaceHolder>" ; java . lang . String str = org . apache . eagle . common . DateTimeUtil . millisecondsToHumanDateWithSeconds ( tsInMS ) ; System . out . println ( str ) ; } roundDown ( int , long ) { switch ( field ) { case java . util . Calendar . DAY_OF_MONTH : case java . util . Calendar . DAY_OF_WEEK : case java . util . Calendar . DAY_OF_YEAR : return timeInMillis - ( timeInMillis % ( ( ( 24 * 60 ) * 60 ) * 1000 ) ) ; case java . util . Calendar . HOUR : return timeInMillis - ( timeInMillis % ( ( 60 * 60 ) * 1000 ) ) ; case java . util . Calendar . MINUTE : return timeInMillis - ( timeInMillis % ( 60 * 1000 ) ) ; case java . util . Calendar . SECOND : return timeInMillis - ( timeInMillis % 1000 ) ; default : return 0L ; } } | org . junit . Assert . assertEquals ( 0L , tsInDay ) |
shouldValidateAndReturnFalseWhenTimestampGroupByPropertyUsedInEntity ( ) { 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 ( ) . groupBy ( TestPropertyNames . PROP_1 , TestPropertyNames . PROP_2 ) . build ( ) ) . edge ( TestGroups . EDGE , new uk . gov . gchq . gaffer . data . elementdefinition . view . ViewElementDefinition . Builder ( ) . groupBy ( TestPropertyNames . PROP_1 , TestPropertyNames . PROP_2 ) . build ( ) ) . build ( ) ; final uk . gov . gchq . gaffer . store . schema . Schema schema = new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . type ( "vertex" , java . lang . String . class ) . type ( "string|Timestamp" , new uk . gov . gchq . gaffer . store . schema . TypeDefinition . Builder ( ) . clazz ( java . lang . String . class ) . build ( ) ) . type ( "string|Value" , new uk . gov . gchq . gaffer . store . schema . TypeDefinition . Builder ( ) . clazz ( java . lang . String . class ) . build ( ) ) . type ( "true" , uk . gov . gchq . gaffer . store . schema . Boolean . class ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . store . schema . SchemaEntityDefinition . Builder ( ) . vertex ( "vertex" ) . property ( TestPropertyNames . PROP_1 , "string|Timestamp" ) . property ( TestPropertyNames . PROP_2 , "string|Value" ) . build ( ) ) . edge ( TestGroups . EDGE , new uk . gov . gchq . gaffer . store . schema . SchemaEdgeDefinition . Builder ( ) . source ( "vertex" ) . destination ( "vertex" ) . directed ( "true" ) . property ( TestPropertyNames . PROP_2 , "string|Value" ) . 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 ( ) ) |
testValidateWhitespaces ( ) { boolean result = org . oscm . validator . ADMValidator . containsOnlyValidIdChars ( "<sp>" ) ; "<AssertPlaceHolder>" ; } containsOnlyValidIdChars ( java . lang . String ) { if ( value == null ) { return true ; } java . util . regex . Matcher matcher = org . oscm . validator . ADMValidator . INVALID_ID_CHARS . matcher ( value ) ; return ! ( matcher . find ( ) ) ; } | org . junit . Assert . assertTrue ( result ) |
shouldIgnoreWhenOutOfBoundsBottom ( ) { glass . drop ( new com . codenjoy . dojo . tetris . model . FigureImpl ( 0 , 0 , "#" , "#" ) , 0 , 0 ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { for ( int x = 0 ; x < ( size ) ; x ++ ) { for ( int y = 0 ; y < ( size ) ; y ++ ) { if ( ( isBusy ( x , y ) ) && ( ( data [ x ] [ y ] ) != ( com . codenjoy . dojo . a2048 . model . Numbers . BREAK ) ) ) return false ; } } return true ; } | org . junit . Assert . assertTrue ( glass . isEmpty ( ) ) |
testIndicatieOnderCurateleActueel ( ) { final java . util . Set < nl . bzk . brp . domain . algemeen . ZoekCriterium > zoekCriteria = new java . util . HashSet ( ) ; nl . bzk . brp . domain . algemeen . ZoekCriterium zoekCriteria1 = new nl . bzk . brp . domain . algemeen . ZoekCriterium ( getAttribuutElement ( Element . PERSOON_INDICATIE_ONDERCURATELE_WAARDE ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Zoekoptie . EXACT , true ) ; zoekCriteria . add ( zoekCriteria1 ) ; nl . bzk . brp . delivery . dataaccess . bevraging . SqlStamementZoekPersoon sql = new nl . bzk . brp . delivery . dataaccess . bevraging . SqlBepaler ( zoekCriteria , 10 , false , null , false ) . maakSql ( ) ; final java . util . List < java . lang . Long > ids = zoekPersoonRepository . zoekPersonen ( sql , postgres ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , ids . size ( ) ) |
testUserName ( ) { org . eclipse . orion . server . core . metastore . UserInfo userInfo = new org . eclipse . orion . server . core . metastore . UserInfo ( ) ; java . lang . String userName = "test" ; userInfo . setUserName ( userName ) ; "<AssertPlaceHolder>" ; } getUserName ( ) { return userName ; } | org . junit . Assert . assertEquals ( userName , userInfo . getUserName ( ) ) |
testAnotherBannedCommandsWithBannedCommandWithExtra ( ) { org . bukkit . event . player . PlayerCommandPreprocessEvent e = new org . bukkit . event . player . PlayerCommandPreprocessEvent ( player , "/another_banned_command<sp>with<sp>extra<sp>stuff" ) ; world . bentobox . bentobox . listeners . BannedVisitorCommands bvc = new world . bentobox . bentobox . listeners . BannedVisitorCommands ( plugin ) ; java . util . List < java . lang . String > banned = new java . util . ArrayList ( ) ; banned . add ( "banned_command" ) ; banned . add ( "another_banned_command" ) ; when ( iwm . getVisitorBannedCommands ( org . mockito . Mockito . any ( ) ) ) . thenReturn ( banned ) ; bvc . onVisitorCommand ( e ) ; org . mockito . Mockito . verify ( iwm ) . getVisitorBannedCommands ( org . mockito . Mockito . any ( ) ) ; "<AssertPlaceHolder>" ; } isCancelled ( ) { return cancelled ; } | org . junit . Assert . assertTrue ( e . isCancelled ( ) ) |
testSpecEnableCountingDefault ( ) { com . hp . hpl . jena . rdf . model . Model m = com . epimorphics . jsonrdf . utils . ModelIOUtils . modelFromTurtle ( ":my<sp>a<sp>api:API;<sp>api:sparqlEndpoint<sp>:spoo" ) ; com . hp . hpl . jena . rdf . model . Resource root = m . createResource ( m . expandPrefix ( ":my" ) ) ; com . epimorphics . lda . specs . APISpec s = com . epimorphics . lda . apispec . tests . SpecUtil . specFrom ( root ) ; "<AssertPlaceHolder>" ; } getEnableCounting ( ) { return Boolean . FALSE ; } | org . junit . Assert . assertEquals ( Boolean . FALSE , s . getEnableCounting ( ) ) |
testVrsHashing ( ) { final int numCols = 1 ; final int size = 1000 ; final double base = 1.1 ; final int range = 20 ; org . hillview . table . api . ITable data = org . hillview . utils . TestTables . getIntTable ( size , numCols ) ; org . hillview . table . rows . VirtualRowSnapshot vrs = new org . hillview . table . rows . VirtualRowSnapshot ( data , data . getSchema ( ) ) ; org . hillview . table . api . IRowIterator rowIt = data . getRowIterator ( ) ; int i = rowIt . getNextRow ( ) ; long vHash ; long hash ; org . hillview . table . rows . RowSnapshot rss ; int num = 10 ; while ( ( i != ( - 1 ) ) && ( i < num ) ) { rss = new org . hillview . table . rows . RowSnapshot ( data , i ) ; hash = rss . hashCode ( ) ; vrs . setRow ( i ) ; vHash = vrs . hashCode ( ) ; "<AssertPlaceHolder>" ; i = rowIt . getNextRow ( ) ; } } hashCode ( ) { return this . cachedHashcode ; } | org . junit . Assert . assertEquals ( hash , vHash ) |
testPropertyIsGreaterThanShortLiteral ( ) { net . opengis . filter . v_1_1_0 . FilterType filterType = cswFilterDelegate . propertyIsGreaterThan ( propertyName , shortLiteral ) ; java . lang . String cqlText = org . codice . ddf . spatial . ogc . csw . catalog . source . CswCqlTextFilter . getInstance ( ) . getCqlText ( filterType ) ; "<AssertPlaceHolder>" ; } getCqlText ( net . opengis . filter . v_1_1_0 . FilterType ) { org . geotools . xml . Parser parser = new org . geotools . xml . Parser ( new org . geotools . filter . v1_1 . OGCConfiguration ( ) ) ; try { java . io . StringReader reader = new java . io . StringReader ( marshalFilterType ( filterType ) ) ; java . lang . Object parsedFilter = parser . parse ( reader ) ; if ( parsedFilter instanceof org . opengis . filter . Filter ) { org . opengis . filter . Filter filterToCql = ( ( org . opengis . filter . Filter ) ( parsedFilter ) ) ; org . codice . ddf . spatial . ogc . csw . catalog . source . CswCqlTextFilter . LOGGER . debug ( "Filter<sp>to<sp>Convert<sp>to<sp>CQL<sp>=><sp>{}" , filterToCql ) ; java . lang . String cql = org . geotools . filter . text . ecql . ECQL . toCQL ( filterToCql ) ; org . codice . ddf . spatial . ogc . csw . catalog . source . CswCqlTextFilter . LOGGER . debug ( "Generated<sp>CQL<sp>from<sp>Filter<sp>=><sp>{}" , cql ) ; return cql ; } else { throw new ddf . catalog . source . UnsupportedQueryException ( "Query<sp>did<sp>not<sp>produce<sp>a<sp>valid<sp>filter." ) ; } } catch ( java . io . IOException e ) { throw new ddf . catalog . source . UnsupportedQueryException ( "Unable<sp>to<sp>create<sp>CQL<sp>Filter." , e ) ; } catch ( org . xml . sax . SAXException e ) { throw new ddf . catalog . source . UnsupportedQueryException ( "Unable<sp>to<sp>create<sp>CQL<sp>Filter." , e ) ; } catch ( javax . xml . parsers . ParserConfigurationException e ) { throw new ddf . catalog . source . UnsupportedQueryException ( "Unable<sp>to<sp>create<sp>CQL<sp>Filter." , e ) ; } catch ( javax . xml . bind . JAXBException e ) { throw new ddf . catalog . source . UnsupportedQueryException ( "Unable<sp>to<sp>create<sp>CQL<sp>Filter." , e ) ; } } | org . junit . Assert . assertEquals ( propertyIsGreaterThan , cqlText ) |
parseEmpty ( ) { java . lang . Character expected = null ; io . robe . convert . xml . parsers . ParseChar parseChar = new io . robe . convert . xml . parsers . ParseChar ( ) ; java . lang . Character actual = parseChar . parse ( io . robe . convert . xml . ParserUtil . getParser ( "<char></char>" ) , null ) ; "<AssertPlaceHolder>" ; } getParser ( java . lang . String ) { com . fasterxml . jackson . dataformat . xml . XmlFactory factory = new com . fasterxml . jackson . dataformat . xml . XmlFactory ( ) ; com . fasterxml . jackson . core . JsonParser parser = factory . createParser ( xml ) ; parser . nextToken ( ) ; parser . nextToken ( ) ; parser . nextToken ( ) ; return parser ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testMtoMString ( ) { org . apache . cxf . mime . TestMtom mtomPort = createPort ( org . apache . cxf . systest . mtom . ClientMtomXopTest . MTOM_SERVICE , org . apache . cxf . systest . mtom . ClientMtomXopTest . MTOM_PORT , org . apache . cxf . mime . TestMtom . class , true , false ) ; java . io . InputStream pre = this . getClass ( ) . getResourceAsStream ( "/wsdl/mtom_xop.wsdl" ) ; long fileSize = 0 ; for ( int i = pre . read ( ) ; i != ( - 1 ) ; i = pre . read ( ) ) { fileSize ++ ; } byte [ ] data = new byte [ ( ( int ) ( fileSize ) ) ] ; this . getClass ( ) . getResourceAsStream ( "/wsdl/mtom_xop.wsdl" ) . read ( data ) ; java . lang . String stringValue = new java . lang . String ( data , "utf-8" ) ; org . apache . cxf . mime . types . XopStringType xsv = new org . apache . cxf . mime . types . XopStringType ( ) ; xsv . setAttachinfo ( stringValue ) ; xsv . setName ( "eman" ) ; org . apache . cxf . mime . types . XopStringType r = mtomPort . testXopString ( xsv ) ; "<AssertPlaceHolder>" ; } testXopString ( org . apache . cxf . mime . types . XopStringType ) { org . apache . cxf . mime . types . XopStringType d2 = new org . apache . cxf . mime . types . XopStringType ( ) ; d2 . setAttachinfo ( ( "This<sp>is<sp>the<sp>cereal<sp>shot<sp>from<sp>guns" + ( data . getAttachinfo ( ) ) ) ) ; return d2 ; } | org . junit . Assert . assertNotNull ( r ) |
testLogin ( ) { try { indexPage . clickLogin ( ) ; loginPage . login ( "test-admin" , "password" ) ; "<AssertPlaceHolder>" ; profilePage . clickLogout ( ) ; } catch ( java . lang . Exception e ) { debugTest ( e ) ; org . junit . Assert . fail ( "Should<sp>display<sp>logged<sp>in<sp>user" ) ; } } getUsername ( ) { return username ; } | org . junit . Assert . assertEquals ( profilePage . getUsername ( ) , "test-admin" ) |
seriesVisibility_defaultVisibility_trueByDefault ( ) { @ com . vaadin . addon . charts . model . junittests . SuppressWarnings ( "serial" ) com . vaadin . addon . charts . model . AbstractSeries dataSeries = new com . vaadin . addon . charts . model . AbstractSeries ( ) { } ; "<AssertPlaceHolder>" ; } isVisible ( ) { if ( ( visible ) == null ) { return Boolean . TRUE ; } return visible ; } | org . junit . Assert . assertTrue ( dataSeries . isVisible ( ) ) |
testGetVerifier ( ) { System . out . println ( "getVerifier" ) ; xades4j . verification . XadesVerificationProfile instance = new xades4j . verification . XadesVerificationProfile ( VerifierTestBase . validationProviderMySigs ) ; xades4j . verification . XadesVerifier result = instance . newVerifier ( ) ; "<AssertPlaceHolder>" ; } newVerifier ( ) { xades4j . verification . XadesVerifierImpl v = profileCore . getInstance ( xades4j . verification . XadesVerifierImpl . class , xades4j . verification . XadesVerificationProfile . overridableModules , xades4j . verification . XadesVerificationProfile . sealedModules ) ; v . setAcceptUnknownProperties ( acceptUnknownProperties ) ; v . setSecureValidation ( secureValidation ) ; return v ; } | org . junit . Assert . assertNotNull ( result ) |
testTextWithLegalNumericCharacterReferences ( ) { final java . lang . String text = "The<sp>value<sp>	<sp>is<sp>a<sp>legal<sp>numeric<sp>character<sp>reference." ; final boolean result = org . jivesoftware . openfire . nio . XMLLightweightParser . hasIllegalCharacterReferences ( text ) ; "<AssertPlaceHolder>" ; } hasIllegalCharacterReferences ( java . lang . String ) { final java . util . regex . Matcher matcher = org . jivesoftware . openfire . nio . XMLLightweightParser . XML_HAS_CHARREF . matcher ( string ) ; while ( matcher . find ( ) ) { final java . lang . String decValue = matcher . group ( 2 ) ; if ( decValue != null ) { final int value = java . lang . Integer . parseInt ( decValue ) ; if ( ! ( org . jivesoftware . openfire . nio . XMLLightweightParser . isLegalXmlCharacter ( value ) ) ) { return true ; } else { continue ; } } final java . lang . String hexValue = matcher . group ( 3 ) ; if ( hexValue != null ) { final int value = java . lang . Integer . parseInt ( hexValue , 16 ) ; if ( ! ( org . jivesoftware . openfire . nio . XMLLightweightParser . isLegalXmlCharacter ( value ) ) ) { return true ; } else { continue ; } } throw new java . lang . IllegalStateException ( ( ( "An<sp>error<sp>occurred<sp>while<sp>searching<sp>for<sp>illegal<sp>character<sp>references<sp>in<sp>the<sp>value<sp>[" + string ) + "]." ) ) ; } return false ; } | org . junit . Assert . assertFalse ( result ) |
testShuffleOnAllEqual ( ) { me . prettyprint . cassandra . connection . DynamicLoadBalancingPolicy dbp = new me . prettyprint . cassandra . connection . DynamicLoadBalancingPolicy ( ) ; me . prettyprint . cassandra . connection . LatencyAwareHClientPool poolWithScore2_1 = org . mockito . Mockito . mock ( me . prettyprint . cassandra . connection . LatencyAwareHClientPool . class ) ; org . mockito . Mockito . when ( poolWithScore2_1 . score ( ) ) . thenReturn ( 2.0 ) ; org . mockito . Mockito . when ( poolWithScore2_1 . getNumActive ( ) ) . thenReturn ( 5 ) ; org . mockito . Mockito . when ( poolWithScore2_1 . getCassandraHost ( ) ) . thenReturn ( new me . prettyprint . cassandra . service . CassandraHost ( "127.0.0.4:9163" ) ) ; me . prettyprint . cassandra . connection . LatencyAwareHClientPool poolWithScore2_2 = org . mockito . Mockito . mock ( me . prettyprint . cassandra . connection . LatencyAwareHClientPool . class ) ; org . mockito . Mockito . when ( poolWithScore2_2 . score ( ) ) . thenReturn ( 2.0 ) ; org . mockito . Mockito . when ( poolWithScore2_2 . getNumActive ( ) ) . thenReturn ( 5 ) ; org . mockito . Mockito . when ( poolWithScore2_2 . getCassandraHost ( ) ) . thenReturn ( new me . prettyprint . cassandra . service . CassandraHost ( "127.0.0.5:9164" ) ) ; me . prettyprint . cassandra . connection . LatencyAwareHClientPool poolWithScore2_3 = org . mockito . Mockito . mock ( me . prettyprint . cassandra . connection . LatencyAwareHClientPool . class ) ; org . mockito . Mockito . when ( poolWithScore2_3 . score ( ) ) . thenReturn ( 2.0 ) ; org . mockito . Mockito . when ( poolWithScore2_3 . getNumActive ( ) ) . thenReturn ( 5 ) ; org . mockito . Mockito . when ( poolWithScore2_3 . getCassandraHost ( ) ) . thenReturn ( new me . prettyprint . cassandra . service . CassandraHost ( "127.0.0.6:9165" ) ) ; java . util . List < me . prettyprint . cassandra . connection . HClientPool > pool = new java . util . ArrayList < me . prettyprint . cassandra . connection . HClientPool > ( ) ; pool . add ( poolWithScore2_1 ) ; pool . add ( poolWithScore2_2 ) ; pool . add ( poolWithScore2_3 ) ; dbp . add ( poolWithScore2_1 ) ; dbp . add ( poolWithScore2_2 ) ; dbp . add ( poolWithScore2_3 ) ; dbp . updateScores ( ) ; java . util . Set < me . prettyprint . cassandra . service . CassandraHost > foundHosts = new java . util . HashSet < me . prettyprint . cassandra . service . CassandraHost > ( ) ; for ( int i = 0 ; i < 50 ; i ++ ) { me . prettyprint . cassandra . connection . HClientPool foundPool = dbp . getPool ( pool , null ) ; me . prettyprint . cassandra . service . CassandraHost p = foundPool . getCassandraHost ( ) ; foundHosts . add ( p ) ; assert 5 == ( foundPool . getNumActive ( ) ) ; } "<AssertPlaceHolder>" ; } size ( ) { return components . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , foundHosts . size ( ) ) |
testMakingOfChildContainer ( ) { final com . picocontainer . MutablePicoContainer parent = createPicoContainer ( null ) ; com . picocontainer . MutablePicoContainer child = parent . makeChildContainer ( ) ; "<AssertPlaceHolder>" ; } makeChildContainer ( ) { return null ; } | org . junit . Assert . assertNotNull ( child ) |
getShortTestWithIndex ( ) { short data = 32765 ; byte [ ] bytes = new byte [ ] { ( ( byte ) ( ( data > > 8 ) & 255 ) ) , ( ( byte ) ( data & 255 ) ) } ; final java . nio . file . Path path = nextTempFile ( bytes ) ; final java . nio . channels . FileChannel read = java . nio . channels . FileChannel . open ( path , StandardOpenOption . READ , StandardOpenOption . DELETE_ON_CLOSE ) ; final com . yandex . yoctodb . util . buf . Buffer buf = com . yandex . yoctodb . util . buf . Buffer . from ( read ) ; short result = buf . getShort ( 0 ) ; "<AssertPlaceHolder>" ; } getShort ( long ) { assert index <= ( Integer . MAX_VALUE ) ; return delegate . getShort ( ( ( int ) ( index ) ) ) ; } | org . junit . Assert . assertEquals ( data , result ) |
should_count_karma_if_vote_was_created_before_min_date ( ) { org . joda . time . DateTime antantonte = new org . joda . time . DateTime ( ) . minusDays ( 3 ) ; br . com . caelum . timemachine . TimeMachine . goTo ( antantonte ) . andExecute ( new br . com . caelum . timemachine . Block < org . mamute . model . Vote > ( ) { @ org . mamute . model . Override public org . mamute . model . Vote run ( ) { for ( int i = 0 ; i < ( massiveVote . getMaxVotesAllowed ( ) ) ; i ++ ) { massiveVote . shouldCountKarma ( massiveVoter , author , vote ( massiveVoter , VoteType . DOWN , 1L ) ) ; } return null ; } } ) ; org . mamute . model . Vote acceptedVote = vote ( massiveVoter , VoteType . DOWN , 1L ) ; "<AssertPlaceHolder>" ; } shouldCountKarma ( org . mamute . model . User , org . mamute . model . User , org . mamute . model . Vote ) { java . util . List < org . mamute . model . Vote > votes = getVotesWith ( current . getType ( ) ) . to ( target ) . from ( author ) ; if ( ( votes . size ( ) ) == ( org . mamute . model . vote . MassiveVote . MAX_VOTE_ALLOWED ) ) { org . mamute . model . Vote oldestVote = votes . get ( 0 ) ; if ( isExpired ( oldestVote ) ) { votes . remove ( 0 ) ; votes . add ( current ) ; return true ; } else { return false ; } } else if ( ( votes . size ( ) ) < ( org . mamute . model . vote . MassiveVote . MAX_VOTE_ALLOWED ) ) { votes . add ( current ) ; getVotesWith ( current . getType ( ) ) . put ( target , votes ) ; return true ; } throw new java . lang . IllegalArgumentException ( ( "massive<sp>vote<sp>size<sp>is<sp>bigger<sp>than<sp>" + ( org . mamute . model . vote . MassiveVote . MAX_VOTE_ALLOWED ) ) ) ; } | org . junit . Assert . assertTrue ( massiveVote . shouldCountKarma ( massiveVoter , author , acceptedVote ) ) |
testCreateUserNamespaceAuthorization ( ) { org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey key = new org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey ( USER_ID , NAMESPACE ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorizationCreateRequest request = new org . finra . herd . model . api . xml . UserNamespaceAuthorizationCreateRequest ( key , java . util . Arrays . asList ( NamespacePermissionEnum . READ , NamespacePermissionEnum . WRITE , NamespacePermissionEnum . EXECUTE , NamespacePermissionEnum . GRANT ) ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorization userNamespaceAuthorization = new org . finra . herd . model . api . xml . UserNamespaceAuthorization ( ID , key , SUPPORTED_NAMESPACE_PERMISSIONS ) ; when ( userNamespaceAuthorizationService . createUserNamespaceAuthorization ( request ) ) . thenReturn ( userNamespaceAuthorization ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorization response = userNamespaceAuthorizationRestController . createUserNamespaceAuthorization ( request ) ; verify ( userNamespaceAuthorizationService ) . createUserNamespaceAuthorization ( request ) ; verifyNoMoreInteractions ( userNamespaceAuthorizationService ) ; "<AssertPlaceHolder>" ; } createUserNamespaceAuthorization ( org . finra . herd . model . api . xml . UserNamespaceAuthorizationCreateRequest ) { validateUserNamespaceAuthorizationCreateRequest ( request ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey key = request . getUserNamespaceAuthorizationKey ( ) ; org . finra . herd . model . jpa . UserNamespaceAuthorizationEntity userNamespaceAuthorizationEntity = userNamespaceAuthorizationDao . getUserNamespaceAuthorizationByKey ( key ) ; if ( userNamespaceAuthorizationEntity != null ) { throw new org . finra . herd . model . AlreadyExistsException ( java . lang . String . format ( "Unable<sp>to<sp>create<sp>user<sp>namespace<sp>authorization<sp>with<sp>user<sp>id<sp>\"%s\"<sp>and<sp>namespace<sp>\"%s\"<sp>because<sp>it<sp>already<sp>exists." , key . getUserId ( ) , key . getNamespace ( ) ) ) ; } org . finra . herd . model . jpa . NamespaceEntity namespaceEntity = namespaceDaoHelper . getNamespaceEntity ( key . getNamespace ( ) ) ; userNamespaceAuthorizationEntity = createUserNamespaceAuthorizationEntity ( key . getUserId ( ) , namespaceEntity , request . getNamespacePermissions ( ) ) ; messageNotificationEventService . processUserNamespaceAuthorizationChangeNotificationEvent ( key ) ; return createUserNamespaceAuthorizationFromEntity ( userNamespaceAuthorizationEntity ) ; } | org . junit . Assert . assertEquals ( userNamespaceAuthorization , response ) |
createCredentialsProviderTest ( ) { com . aliyuncs . auth . CredentialsProviderFactory factory = new com . aliyuncs . auth . CredentialsProviderFactory ( ) ; com . aliyuncs . auth . SystemPropertiesCredentialsProvider provider = new com . aliyuncs . auth . SystemPropertiesCredentialsProvider ( ) ; "<AssertPlaceHolder>" ; } createCredentialsProvider ( T extends com . aliyuncs . auth . AlibabaCloudCredentialsProvider ) { return classInstance ; } | org . junit . Assert . assertTrue ( ( ( factory . createCredentialsProvider ( provider ) ) == provider ) ) |
testRegexMatchesSeussSpecial ( ) { java . util . List < java . lang . String > pattern = java . util . Arrays . asList ( "****" , "****" 0 , "li+e" ) ; java . util . List < java . lang . String > text = new java . util . ArrayList ( java . util . Arrays . asList ( "and" 2 , "****" , "****" 0 , "li+e" , "and" 1 , "in" , "****" 4 , "****" 7 , "." , "and" 2 , "****" , "****" 0 , "li+e" , "and" 1 , "with" , "****" 4 , "fox" , "." , "and" 2 , "****" , "****" 0 , "li+e" , "and" 1 , "in" , "****" 4 , "house" , "." , "and" 2 , "****" , "****" 0 , "li+e" , "and" 1 , "with" , "****" 4 , "****" 9 , "." , "and" 2 , "****" , "****" 0 , "lik" , "and" 1 , "here" , "and" 3 , "****" 1 , "." , "and" 2 , "****" , "****" 0 , "li+e" , "and" 1 , "****" 3 , "." , "and" 2 , "****" , "****" 0 , "li+e" , "****" 2 , "****" 8 , "and" , "and" 0 , "." , "and" 2 , "****" , "****" 0 , "li+e" , "****" 6 , "****" 5 , "." ) ) ; edu . illinois . cs . cogcomp . core . algorithms . ListMatch < java . lang . String > matcher = new edu . illinois . cs . cogcomp . core . algorithms . RegexBasedMatch ( pattern ) ; for ( int i : matcher . matches ( text ) ) { for ( int j = 0 ; j < ( pattern . size ( ) ) ; j ++ ) { "<AssertPlaceHolder>" ; } } } get ( java . lang . String ) { item = item . trim ( ) ; java . lang . String sql = "select<sp>value<sp>from<sp>counts<sp>where<sp>item<sp>=<sp>?" ; try { edu . illinois . cs . cogcomp . nlp . pmi . Connection c = edu . illinois . cs . cogcomp . nlp . pmi . CountsCache . getConnection ( dbFile ) ; edu . illinois . cs . cogcomp . nlp . pmi . PreparedStatement stmt = c . prepareStatement ( sql ) ; stmt . setString ( 1 , item ) ; edu . illinois . cs . cogcomp . nlp . pmi . ResultSet rs = stmt . executeQuery ( ) ; if ( rs . next ( ) ) { return rs . getLong ( 1 ) ; } else { return - 1 ; } } catch ( java . lang . Exception ex ) { throw new java . lang . RuntimeException ( ex ) ; } } | org . junit . Assert . assertEquals ( pattern . get ( j ) , text . get ( ( i + j ) ) ) |
testRMFAILcommit1PC ( ) { javax . transaction . xa . XAResource theResource = new javax . transaction . xa . XAResource ( ) { @ com . hp . mwtests . ts . jta . xa . Override public void start ( javax . transaction . xa . Xid xid , int flags ) throws javax . transaction . xa . XAException { } @ com . hp . mwtests . ts . jta . xa . Override public void end ( javax . transaction . xa . Xid xid , int flags ) throws javax . transaction . xa . XAException { } @ com . hp . mwtests . ts . jta . xa . Override public int prepare ( javax . transaction . xa . Xid xid ) throws javax . transaction . xa . XAException { return 0 ; } @ com . hp . mwtests . ts . jta . xa . Override public void commit ( javax . transaction . xa . Xid xid , boolean onePhase ) throws javax . transaction . xa . XAException { throw new javax . transaction . xa . XAException ( javax . transaction . xa . XAException . XAER_RMFAIL ) ; } @ com . hp . mwtests . ts . jta . xa . Override public void rollback ( javax . transaction . xa . Xid xid ) throws javax . transaction . xa . XAException { } @ com . hp . mwtests . ts . jta . xa . Override public void forget ( javax . transaction . xa . Xid xid ) throws javax . transaction . xa . XAException { } @ com . hp . mwtests . ts . jta . xa . Override public javax . transaction . xa . Xid [ ] recover ( int flag ) throws javax . transaction . xa . XAException { return null ; } @ com . hp . mwtests . ts . jta . xa . Override public boolean isSameRM ( javax . transaction . xa . XAResource xaRes ) throws javax . transaction . xa . XAException { return false ; } @ com . hp . mwtests . ts . jta . xa . Override public int getTransactionTimeout ( ) throws javax . transaction . xa . XAException { return 0 ; } @ com . hp . mwtests . ts . jta . xa . Override public boolean setTransactionTimeout ( int seconds ) throws javax . transaction . xa . XAException { return false ; } } ; javax . transaction . TransactionManager tm = com . arjuna . ats . jta . TransactionManager . transactionManager ( ) ; tm . begin ( ) ; javax . transaction . Transaction theTransaction = tm . getTransaction ( ) ; "<AssertPlaceHolder>" ; try { tm . commit ( ) ; org . junit . Assert . fail ( ) ; } catch ( com . hp . mwtests . ts . jta . xa . javax e ) { } } enlistResource ( javax . transaction . Transaction ) { if ( ( xaDataSource ) != null ) { if ( ( this . xaConnection . get ( ) ) == null ) { this . xaConnection . set ( xaDataSource . getXAConnection ( ) ) ; this . connection . set ( xaConnection . get ( ) . getConnection ( ) ) ; } javax . transaction . xa . XAResource xaResource = xaConnection . get ( ) . getXAResource ( ) ; transaction . enlistResource ( xaResource ) ; java . sql . Statement createStatement = connection . get ( ) . createStatement ( ) ; createStatement . execute ( ( ( "INSERT<sp>INTO<sp>" + ( com . hp . mwtests . ts . jta . commitmarkable . Utils . getXAFooTableName ( ) ) ) + "<sp>(bar)<sp>VALUES<sp>(1)" ) ) ; createStatement . close ( ) ; } else { if ( ( this . pooledConnection . get ( ) ) == null ) { this . pooledConnection . set ( dataSource . getPooledConnection ( ) ) ; } java . sql . Connection connection = this . pooledConnection . get ( ) . getConnection ( ) ; connection . setAutoCommit ( false ) ; javax . transaction . xa . XAResource nonXAResource = new com . hp . mwtests . ts . jta . commitmarkable . JDBCConnectableResource ( connection ) ; transaction . enlistResource ( nonXAResource ) ; java . sql . Statement createStatement = connection . createStatement ( ) ; createStatement . execute ( "INSERT<sp>INTO<sp>foo<sp>(bar)<sp>VALUES<sp>(1)" ) ; createStatement . close ( ) ; } } | org . junit . Assert . assertTrue ( theTransaction . enlistResource ( theResource ) ) |
testExpiresFail ( ) { org . jboss . resteasy . security . doseta . Verifier verifier = new org . jboss . resteasy . security . doseta . Verifier ( ) ; org . jboss . resteasy . security . doseta . Verification verification = verifier . addNew ( ) ; verification . setRepository ( org . jboss . resteasy . tests . signature . SigningTest . repository ) ; javax . ws . rs . client . WebTarget target = org . jboss . resteasy . tests . signature . SigningTest . client . target ( "http://localhost:9095/signed/expires-short" ) ; javax . ws . rs . client . Invocation . Builder request = target . request ( ) ; request . property ( org . jboss . resteasy . security . doseta . Verifier . class . getName ( ) , verifier ) ; javax . ws . rs . core . Response response = request . get ( ) ; System . out . println ( response . getHeaderString ( DKIMSignature . DKIM_SIGNATURE ) ) ; "<AssertPlaceHolder>" ; java . lang . Thread . sleep ( 1500 ) ; try { java . lang . String output = response . readEntity ( java . lang . String . class ) ; org . junit . Assert . fail ( ) ; } catch ( javax . ws . rs . ProcessingException pe ) { org . jboss . resteasy . security . doseta . UnauthorizedSignatureException e = ( ( org . jboss . resteasy . security . doseta . UnauthorizedSignatureException ) ( pe . getCause ( ) ) ) ; System . out . println ( ( "Verification<sp>failed:<sp>" + ( e . getMessage ( ) ) ) ) ; } response . close ( ) ; } get ( ) { return java . lang . Integer . toString ( org . jboss . resteasy . examples . asyncjob . MyResource . count ) ; } | org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) ) |
testMaxHeapify ( ) { int [ ] testData = new int [ ] { 16 , 4 , 10 , 14 , 7 , 9 , 3 , 2 , 8 , 1 } ; int [ ] expectedData = new int [ ] { 16 , 14 , 10 , 8 , 7 , 9 , 3 , 2 , 4 , 1 } ; org . intelligentjava . algos . trees . utils . HeapUtils . maxHeapify ( testData , 1 ) ; for ( int i = 0 ; i < ( testData . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } maxHeapify ( int [ ] , int ) { org . intelligentjava . algos . trees . utils . HeapUtils . maxHeapify ( data , index , data . length ) ; } | org . junit . Assert . assertTrue ( ( ( testData [ i ] ) == ( expectedData [ i ] ) ) ) |
toArray_ReturnsSetValue ( ) { java . util . List < org . pentaho . reporting . engine . classic . core . style . StyleKey > keys = org . pentaho . reporting . engine . classic . core . style . StyleKey . getDefinedStyleKeysList ( ) ; org . pentaho . reporting . engine . classic . core . style . StyleKey key = keys . get ( 0 ) ; org . pentaho . reporting . engine . classic . core . style . ElementStyleSheet sheet = new org . pentaho . reporting . engine . classic . core . style . ElementStyleSheet ( ) ; sheet . setStyleProperty ( key , org . pentaho . reporting . engine . classic . core . style . ElementStyleSheetTest . valueFor ( key ) ) ; java . lang . Object [ ] objects = sheet . toArray ( ) ; "<AssertPlaceHolder>" ; } valueFor ( org . pentaho . reporting . engine . classic . core . style . StyleKey ) { return org . pentaho . reporting . engine . classic . core . style . ElementStyleSheetTest . defaultValues . get ( key . getValueType ( ) ) ; } | org . junit . Assert . assertEquals ( org . pentaho . reporting . engine . classic . core . style . ElementStyleSheetTest . valueFor ( key ) , objects [ 0 ] ) |
loadPrivateKeyPKCS8 ( ) { java . security . PrivateKey privateKey = io . fabric8 . maven . docker . access . KeyStoreUtil . loadPrivateKey ( getFile ( "keys/pkcs8.pem" ) ) ; "<AssertPlaceHolder>" ; } getFile ( java . lang . String ) { return io . fabric8 . maven . docker . access . KeyStoreUtilTest . class . getResource ( path ) . getFile ( ) ; } | org . junit . Assert . assertNotNull ( privateKey ) |
loadOrganizationHistory_latestData ( ) { final org . oscm . domobjects . Organization org = runTX ( new java . util . concurrent . Callable < org . oscm . domobjects . Organization > ( ) { @ org . oscm . billingservice . dao . Override public org . oscm . domobjects . Organization call ( ) throws org . oscm . billingservice . dao . Exception { org . oscm . domobjects . Organization org = org . oscm . test . data . Organizations . createOrganization ( ds ) ; org . setEmail ( "email@server.com" ) ; ds . persist ( org ) ; org . setEmail ( "newEmail@server.com" ) ; ds . persist ( org ) ; org . oscm . test . data . Organizations . removeOrganization ( ds , org . getOrganizationId ( ) ) ; return org ; } } ) ; org . oscm . domobjects . OrganizationHistory organization = dao . loadLastOrganizationHistory ( org . getKey ( ) ) ; "<AssertPlaceHolder>" ; } getEmail ( ) { return voUserDetails . getEMail ( ) ; } | org . junit . Assert . assertEquals ( "newEmail@server.com" , organization . getEmail ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.