input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testNotSingleElement ( ) { org . antlr . misc . IntervalSet vocabulary = org . antlr . misc . IntervalSet . of ( 1 , 1000 ) ; vocabulary . add ( 2000 , 3000 ) ; org . antlr . misc . IntervalSet s = org . antlr . misc . IntervalSet . of ( 50 , 50 ) ; java . lang . String expecting = "{1..49,<sp>51..1000,<sp>2000..3000}" ; java . lang . String result = s . complement ( vocabulary ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return new java . lang . String ( data ) ; }
org . junit . Assert . assertEquals ( result , expecting )
testTokens_ignoreFormatSyntax___noPredicate ( ) { org . apache . ambari . server . api . predicate . QueryLexer lexer = new org . apache . ambari . server . api . predicate . QueryLexer ( ) ; org . apache . ambari . server . api . predicate . Token [ ] tokens = lexer . tokens ( "format=default" ) ; "<AssertPlaceHolder>" ; } tokens ( java . lang . String ) { return tokens ( exp , java . util . Collections . emptySet ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , tokens . length )
testMemCopy_diff_offset ( ) { a = create ( 2 , 5 , 0 , null ) ; int [ ] data = new int [ ] { 1 , 2 , 3 , 4 , 5 } ; int [ ] expected = new int [ ] { 0 , 1 , 2 , 3 , 4 } ; int [ ] out = new int [ 5 ] ; int p1 = a . malloc ( ) ; int p2 = a . malloc ( ) ; a . setInts ( p1 , 0 , data , 0 , a . blockSize ( ) ) ; a . memCopy ( p1 , 0 , p2 , 1 , ( ( a . blockSize ( ) ) - 1 ) ) ; a . getInts ( p2 , 0 , out , 0 , a . blockSize ( ) ) ; "<AssertPlaceHolder>" ; a . free ( p1 ) ; a . free ( p2 ) ; } blockSize ( ) { return m_blocks . blockSize ( ) ; }
org . junit . Assert . assertArrayEquals ( expected , out )
shouldAlignNonNumericValuesToRightIfSpecified1 ( ) { stubFieldType ( java . lang . String . class ) ; gridColumn . setAlign ( Alignment . RIGHT ) ; gridColumn . addField ( fieldDefinition ) ; "<AssertPlaceHolder>" ; } getAlign ( ) { return this . align ; }
org . junit . Assert . assertEquals ( Alignment . RIGHT , gridColumn . getAlign ( ) )
getGenericsAsString_A$ ( ) { org . junithelper . core . meta . ArgTypeMeta target = new org . junithelper . core . meta . ArgTypeMeta ( ) ; target . generics . add ( "String" ) ; target . generics . add ( "Object" ) ; java . lang . String actual = target . getGenericsAsString ( ) ; java . lang . String expected = "<String,<sp>Object>" ; "<AssertPlaceHolder>" ; } getGenericsAsString ( ) { java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; if ( ( generics . size ( ) ) > 0 ) { buf . append ( "<" ) ; buf . append ( generics . get ( 0 ) ) ; if ( ( generics . size ( ) ) > 1 ) { for ( int i = 1 ; i < ( generics . size ( ) ) ; i ++ ) { buf . append ( ",<sp>" ) ; buf . append ( generics . get ( i ) ) ; } } buf . append ( ">" ) ; } return buf . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
config_profile ( ) { com . asakusafw . yaess . bootstrap . YaessTest . ProfileBuilder builder = new com . asakusafw . yaess . bootstrap . YaessTest . ProfileBuilder ( folder . getRoot ( ) ) ; builder . override . put ( "core.version" , "CUSTOM" ) ; java . io . File profile = builder . getProfile ( ) ; java . io . File custom = new java . io . File ( profile . getParentFile ( ) , "custom.properties" ) ; org . junit . Assume . assumeTrue ( profile . renameTo ( custom ) ) ; builder . override . put ( "core.version" , "default" ) ; profile = builder . getProfile ( ) ; java . io . File script = builder . getScript ( ) ; java . util . List < java . lang . String > arguments = new java . util . ArrayList ( ) ; java . util . Collections . addAll ( arguments , "-profile" , profile . getAbsolutePath ( ) ) ; java . util . Collections . addAll ( arguments , "-script" , script . getAbsolutePath ( ) ) ; java . util . Collections . addAll ( arguments , "-batch" , "tbatch" ) ; java . util . Collections . addAll ( arguments , "-D" , "profile=custom" ) ; com . asakusafw . yaess . bootstrap . Yaess . Configuration conf = com . asakusafw . yaess . bootstrap . Yaess . parseConfiguration ( arguments . toArray ( new java . lang . String [ arguments . size ( ) ] ) ) ; com . asakusafw . yaess . core . CoreProfile core = conf . profile . getCore ( ) . newInstance ( ) ; "<AssertPlaceHolder>" ; } getVersion ( ) { return version ; }
org . junit . Assert . assertThat ( core . getVersion ( ) , is ( "CUSTOM" ) )
testResponseConnControlClientRequest2 ( ) { final org . apache . hc . core5 . http . protocol . HttpContext context = new org . apache . hc . core5 . http . protocol . BasicHttpContext ( null ) ; final org . apache . hc . core5 . http . message . BasicClassicHttpRequest request = new org . apache . hc . core5 . http . message . BasicClassicHttpRequest ( org . apache . hc . core5 . http . Methods . GET , "/" ) ; context . setAttribute ( HttpCoreContext . HTTP_REQUEST , request ) ; final org . apache . hc . core5 . http . ClassicHttpResponse response = new org . apache . hc . core5 . http . message . BasicClassicHttpResponse ( org . apache . hc . core5 . http . HttpStatus . SC_OK , "OK" ) ; response . setEntity ( new org . apache . hc . core5 . http . io . entity . StringEntity ( "whatever" ) ) ; final org . apache . hc . core5 . http . protocol . ResponseConnControl interceptor = new org . apache . hc . core5 . http . protocol . ResponseConnControl ( ) ; interceptor . process ( response , response . getEntity ( ) , context ) ; final org . apache . hc . core5 . http . Header header = response . getFirstHeader ( HttpHeaders . CONNECTION ) ; "<AssertPlaceHolder>" ; } getFirstHeader ( java . lang . String ) { return message . getFirstHeader ( name ) ; }
org . junit . Assert . assertNull ( header )
testNonSerializableInterfaceWithSerializableImplWorks ( ) { startContainer ( org . apache . webbeans . test . producer . ProducerPassivationTest . SerializableImplProducerOwner . class ) ; org . apache . webbeans . test . producer . ProducerPassivationTest . NonSerializableInterface instance = getInstance ( org . apache . webbeans . test . producer . ProducerPassivationTest . NonSerializableInterface . class ) ; "<AssertPlaceHolder>" ; } getInstance ( javax . enterprise . inject . spi . Bean ) { return ( ( T ) ( manager . getReference ( bean , null , manager . createCreationalContext ( bean ) ) ) ) ; }
org . junit . Assert . assertNotNull ( instance )
findAllRedenOntbindingHuwelijkPartnerschap ( ) { final java . util . List < nl . bzk . brp . model . algemeen . stamgegeven . conv . ConversieRedenOntbindingHuwelijkGeregistreerdPartnerschap > result = conversieTabelRepository . findAllRedenOntbindingHuwelijkPartnerschap ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 8 , result . size ( ) )
createsProducerForString ( ) { org . everrest . core . method . TypeProducer typeProducer = typeProducerFactory . createTypeProducer ( java . lang . String . class , null ) ; "<AssertPlaceHolder>" ; } createTypeProducer ( java . lang . Class , java . lang . reflect . Type ) { if ( ( ( aClass == ( java . util . List . class ) ) || ( aClass == ( java . util . Set . class ) ) ) || ( aClass == ( java . util . SortedSet . class ) ) ) { java . lang . Class < ? > actualTypeArgument = null ; if ( genericType != null ) { actualTypeArgument = getActualTypeArgument ( genericType ) ; } java . lang . reflect . Method methodValueOf ; java . lang . reflect . Constructor < ? > constructor ; if ( ( actualTypeArgument == ( org . everrest . core . impl . method . String . class ) ) || ( actualTypeArgument == null ) ) { return new org . everrest . core . impl . method . CollectionStringProducer ( aClass ) ; } else if ( ( methodValueOf = getStringValueOfMethod ( actualTypeArgument ) ) != null ) { return new org . everrest . core . impl . method . CollectionStringValueOfProducer ( aClass , methodValueOf ) ; } else if ( ( constructor = getStringConstructor ( actualTypeArgument ) ) != null ) { return new org . everrest . core . impl . method . CollectionStringConstructorProducer ( aClass , constructor ) ; } } else { java . lang . reflect . Method methodValueOf ; java . lang . reflect . Constructor < ? > constructor ; if ( aClass . isPrimitive ( ) ) { return new org . everrest . core . impl . method . PrimitiveTypeProducer ( aClass ) ; } else if ( aClass == ( org . everrest . core . impl . method . String . class ) ) { return new org . everrest . core . impl . method . StringProducer ( ) ; } else if ( ( methodValueOf = getStringValueOfMethod ( aClass ) ) != null ) { return new org . everrest . core . impl . method . StringValueOfProducer ( methodValueOf ) ; } else if ( ( constructor = getStringConstructor ( aClass ) ) != null ) { return new org . everrest . core . impl . method . StringConstructorProducer ( constructor ) ; } } throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "Unsupported<sp>type<sp>%s" , aClass ) ) ; }
org . junit . Assert . assertEquals ( org . everrest . core . impl . method . StringProducer . class , typeProducer . getClass ( ) )
testTreeRuleStopAttributeIsInvalid ( ) { java . lang . String action = "Java" 0 ; java . lang . String expecting = "(r!=null?((t.a_return)r).x:0);<sp>(r!=null?((CommonTree)r.start):null);<sp>$r.stop" ; org . antlr . test . ErrorQueue equeue = new org . antlr . test . ErrorQueue ( ) ; org . antlr . test . ErrorManager . setErrorListener ( equeue ) ; org . antlr . test . Grammar g = new org . antlr . test . Grammar ( ( ( ( ( "tree<sp>grammar<sp>t;\n" + ( ( ( ( "options<sp>{ASTLabelType=CommonTree;}\n" + "a<sp>returns<sp>[int<sp>x]\n" ) + "Java" 1 ) + "<sp>;\n" ) + "Java" 3 ) ) + action ) + "!!!}\n" ) + "Java" 2 ) ) ; System . out . println ( g . toString ( ) ) ; org . antlr . Tool antlr = newTool ( ) ; antlr . setOutputDirectory ( null ) ; org . antlr . codegen . CodeGenerator generator = new org . antlr . codegen . CodeGenerator ( antlr , g , "Java" ) ; g . setCodeGenerator ( generator ) ; generator . genRecognizer ( ) ; org . stringtemplate . v4 . ST codeST = generator . getRecognizerST ( ) ; java . lang . String code = codeST . render ( ) ; java . lang . String found = code . substring ( ( ( code . indexOf ( "###" ) ) + 3 ) , code . indexOf ( "Java" 5 ) ) ; "<AssertPlaceHolder>" ; int expectedMsgID = ErrorManager . MSG_UNKNOWN_RULE_ATTRIBUTE ; java . lang . Object expectedArg = "a" ; java . lang . Object expectedArg2 = "stop" ; org . antlr . test . GrammarSemanticsMessage expectedMessage = new org . antlr . test . GrammarSemanticsMessage ( expectedMsgID , g , null , expectedArg , expectedArg2 ) ; System . out . println ( ( "Java" 4 + equeue ) ) ; checkError ( equeue , expectedMessage ) ; } substring ( int , int ) { return new java . lang . String ( data , start , ( ( stop - start ) + 1 ) ) ; }
org . junit . Assert . assertEquals ( expecting , found )
testContainsPredicate12 ( ) { com . feilong . store . member . User guanyu30 = new com . feilong . store . member . User ( "" , 30 ) ; org . apache . commons . collections4 . Predicate < com . feilong . store . member . User > predicate = org . apache . commons . collections4 . PredicateUtils . andPredicate ( com . feilong . core . util . predicate . BeanPredicateUtil . containsPredicate ( "name" , toList ( "" , "" ) ) , com . feilong . core . util . predicate . BeanPredicateUtil . containsPredicate ( "age" , toList ( 30 ) ) ) ; "<AssertPlaceHolder>" ; } evaluate ( java . lang . String ) { return com . feilong . core . util . RegexUtil . matches ( regexPattern , value ) ; }
org . junit . Assert . assertEquals ( true , predicate . evaluate ( guanyu30 ) )
testCommentsIgnored3 ( ) { tokenizer . tokenize ( toSourceCode ( "class<sp>Foo<sp>{<sp>///<sp>class<sp>X<sp>/*<sp>aaa<sp>*/<sp>\n<sp>}" ) , tokens ) ; "<AssertPlaceHolder>" ; } size ( ) { return rules . size ( ) ; }
org . junit . Assert . assertEquals ( 5 , tokens . size ( ) )
testExecuteAbortWithoutStart ( ) { int retryInterval = 100 ; int maxHandshakeCount = 10 ; java . util . Map < java . lang . String , java . lang . Object > emptyMap = java . util . Collections . emptyMap ( ) ; com . navercorp . pinpoint . rpc . client . PinpointClientHandshaker handshaker = new com . navercorp . pinpoint . rpc . client . PinpointClientHandshaker ( emptyMap , com . navercorp . pinpoint . rpc . server . HandshakeTest . timer , retryInterval , maxHandshakeCount ) ; handshaker . handshakeAbort ( ) ; "<AssertPlaceHolder>" ; } isFinished ( ) { int currentState = currentState ( ) ; return isFinished ( currentState ) ; }
org . junit . Assert . assertTrue ( handshaker . isFinished ( ) )
testDeleteMseaRemoteMep ( ) { org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . maintenancedomain . MaintenanceAssociation ma1100 = new org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . maintenancedomain . DefaultMaintenanceAssociation ( ) ; org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . maintenancedomain . maintenanceassociation . manameandtypecombo . NamePrimaryVid pvid1100Name = new org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . maintenancedomain . maintenanceassociation . manameandtypecombo . DefaultNamePrimaryVid ( ) ; pvid1100Name . namePrimaryVid ( org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . maintenancedomain . maintenanceassociation . manameandtypecombo . nameprimaryvid . NamePrimaryVidUnion . fromString ( "1100" ) ) ; ma1100 . maNameAndTypeCombo ( pvid1100Name ) ; ma1100 . id ( ( ( short ) ( 1100 ) ) ) ; ma1100 . addToRemoteMeps ( org . onosproject . yang . gen . v1 . mseatypes . rev20160229 . mseatypes . MepIdType . of ( 100 ) ) ; ma1100 . addToRemoteMeps ( org . onosproject . yang . gen . v1 . mseatypes . rev20160229 . mseatypes . MepIdType . of ( 101 ) ) ; org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . MaintenanceDomain md = new org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . DefaultMaintenanceDomain ( ) ; org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . maintenancedomain . mdnameandtypecombo . NameCharacterString mdName = new org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . maintenancedomain . mdnameandtypecombo . DefaultNameCharacterString ( ) ; mdName . name ( new org . onosproject . yang . gen . v1 . mseatypes . rev20160229 . mseatypes . Identifier45 ( "md-1" ) ) ; md . mdNameAndTypeCombo ( mdName ) ; md . id ( ( ( short ) ( 1 ) ) ) ; md . addToMaintenanceAssociation ( ma1100 ) ; org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . MefCfm mefCfm = new org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . DefaultMefCfm ( ) ; mefCfm . addToMaintenanceDomain ( md ) ; org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . MseaCfmOpParam mseaCfm = new org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . MseaCfmOpParam ( ) ; mseaCfm . mefCfm ( mefCfm ) ; try { boolean deleted = mseaCfmService . deleteMseaMaRMep ( mseaCfm , session , DatastoreId . RUNNING ) ; "<AssertPlaceHolder>" ; } catch ( org . onosproject . netconf . NetconfException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ) ; } catch ( org . onosproject . incubator . net . l2monitoring . cfm . service . CfmConfigException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ) ; } } deleteMseaMaRMep ( org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . MseaCfmOpParam , org . onosproject . netconf . NetconfSession , org . onosproject . netconf . DatastoreId ) { if ( ( mseaCfm . mefCfm ( ) ) == null ) { throw new org . onosproject . incubator . net . l2monitoring . cfm . service . CfmConfigException ( "mefCfm<sp>object<sp>must<sp>be<sp>present<sp>before<sp>Meps<sp>can<sp>be<sp>added" ) ; } org . onosproject . yang . model . ModelObjectData mseCfmMepList = org . onosproject . yang . model . DefaultModelObjectData . builder ( ) . addModelObject ( ( ( org . onosproject . yang . model . ModelObject ) ( mseaCfm . mefCfm ( ) ) ) ) . build ( ) ; java . util . ArrayList < org . onosproject . yang . runtime . AnnotatedNodeInfo > anis = new java . util . ArrayList ( ) ; for ( org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . MaintenanceDomain md : mseaCfm . mefCfm ( ) . maintenanceDomain ( ) ) { if ( ( md . id ( ) ) == 0 ) { throw new org . onosproject . incubator . net . l2monitoring . cfm . service . CfmConfigException ( "An<sp>MD<sp>numeric<sp>ID<sp>must<sp>be<sp>given" ) ; } for ( org . onosproject . yang . gen . v1 . mseacfm . rev20160229 . mseacfm . mefcfm . maintenancedomain . MaintenanceAssociation ma : md . maintenanceAssociation ( ) ) { if ( ( ma . id ( ) ) == 0 ) { throw new org . onosproject . incubator . net . l2monitoring . cfm . service . CfmConfigException ( "An<sp>MA<sp>numeric<sp>ID<sp>must<sp>be<sp>given" ) ; } for ( org . onosproject . yang . gen . v1 . mseatypes . rev20160229 . mseatypes . MepIdType rmep : ma . remoteMeps ( ) ) { org . onosproject . yang . model . ResourceId . Builder ridBuilder = org . onosproject . yang . model . ResourceId . builder ( ) . addBranchPointSchema ( "/" , null ) . addBranchPointSchema ( org . onosproject . drivers . microsemi . yang . impl . MseaCfmManager . MEF_CFM , org . onosproject . drivers . microsemi . yang . impl . MseaCfmManager . MSEA_CFM_NS ) . addBranchPointSchema ( org . onosproject . drivers . microsemi . yang . impl . MseaCfmManager . MAINTENANCE_DOMAIN , org . onosproject . drivers . microsemi . yang . impl . MseaCfmManager . MSEA_CFM_NS ) . addKeyLeaf ( org . onosproject . drivers . microsemi . yang . impl . MseaCfmManager . ID , org . onosproject . drivers . microsemi . yang . impl .
org . junit . Assert . assertTrue ( deleted )
testFindAddressNotFound ( ) { java . util . List < io . fabric8 . kubernetes . api . model . NodeAddress > addresses = new java . util . ArrayList ( 3 ) ; addresses . add ( new io . fabric8 . kubernetes . api . model . NodeAddressBuilder ( ) . withType ( "SomeAddress" ) . withAddress ( "my.external.address" ) . build ( ) ) ; addresses . add ( new io . fabric8 . kubernetes . api . model . NodeAddressBuilder ( ) . withType ( "SomeOtherAddress" ) . withAddress ( "my.internal.address" ) . build ( ) ) ; addresses . add ( new io . fabric8 . kubernetes . api . model . NodeAddressBuilder ( ) . withType ( "YetAnotherAddress" ) . withAddress ( "192.168.2.94" ) . build ( ) ) ; io . strimzi . kafka . init . InitWriterConfig config = io . strimzi . kafka . init . InitWriterConfig . fromMap ( io . strimzi . kafka . init . InitWriterTest . envVars ) ; io . fabric8 . kubernetes . client . KubernetesClient client = mockKubernetesClient ( config . getNodeName ( ) , io . strimzi . kafka . init . InitWriterTest . labels , addresses ) ; io . strimzi . kafka . init . InitWriter writer = new io . strimzi . kafka . init . InitWriter ( client , config ) ; java . lang . String address = writer . findAddress ( addresses ) ; "<AssertPlaceHolder>" ; } findAddress ( java . util . List ) { if ( addresses == null ) { return null ; } java . util . Map < java . lang . String , java . lang . String > addressMap = addresses . stream ( ) . collect ( java . util . stream . Collectors . toMap ( NodeAddress :: getType , NodeAddress :: getAddress ) ) ; if ( addressMap . containsKey ( "ExternalDNS" ) ) { return addressMap . get ( "ExternalDNS" ) ; } else if ( addressMap . containsKey ( "ExternalIP" ) ) { return addressMap . get ( "ExternalIP" ) ; } else if ( addressMap . containsKey ( "InternalDNS" ) ) { return addressMap . get ( "InternalDNS" ) ; } else if ( addressMap . containsKey ( "InternalIP" ) ) { return addressMap . get ( "InternalIP" ) ; } else if ( addressMap . containsKey ( "Hostname" ) ) { return addressMap . get ( "Hostname" ) ; } return null ; }
org . junit . Assert . assertNull ( address )
testBootstrapThrowsIOError ( ) { final com . allanbank . mongodb . MongoClientConfiguration config = new com . allanbank . mongodb . MongoClientConfiguration ( ) ; config . addServer ( "localhost:6547" ) ; final com . allanbank . mongodb . client . connection . proxy . ProxiedConnectionFactory mockFactory = createMock ( com . allanbank . mongodb . client . connection . proxy . ProxiedConnectionFactory . class ) ; final com . allanbank . mongodb . client . connection . Connection mockConnection = createMock ( com . allanbank . mongodb . client . connection . Connection . class ) ; expect ( mockFactory . connect ( anyObject ( com . allanbank . mongodb . client . state . Server . class ) , eq ( config ) ) ) . andThrow ( new java . io . IOException ( "This<sp>is<sp>a<sp>test" ) ) . times ( 2 ) ; replay ( mockFactory , mockConnection ) ; myTestFactory = new com . allanbank . mongodb . client . connection . sharded . ShardedConnectionFactory ( mockFactory , config ) ; "<AssertPlaceHolder>" ; verify ( mockFactory , mockConnection ) ; reset ( mockFactory ) ; } connect ( com . allanbank . mongodb . client . state . Server , com . allanbank . mongodb . MongoClientConfiguration ) { final com . allanbank . mongodb . client . connection . socket . TransportConnection connection = new com . allanbank . mongodb . client . connection . socket . TransportConnection ( server , config , myMetrics . newConnection ( server . getCanonicalName ( ) ) ) ; final com . allanbank . mongodb . client . transport . Transport < com . allanbank . mongodb . client . transport . TransportOutputBuffer > transport = ( ( com . allanbank . mongodb . client . transport . Transport < com . allanbank . mongodb . client . transport . TransportOutputBuffer > ) ( config . getTransportFactory ( ) . createTransport ( server , config , myEncoderCache , myDecoderCache , connection ) ) ) ; connection . setTransport ( transport ) ; connection . start ( ) ; return connection ; }
org . junit . Assert . assertNotNull ( myTestFactory )
testEmptyBatch ( ) { com . streamsets . pipeline . api . Processor processor = getDefaultProcessor ( ) ; java . util . List < com . streamsets . pipeline . api . Record > records = new java . util . ArrayList ( ) ; com . streamsets . pipeline . sdk . ProcessorRunner runner = new com . streamsets . pipeline . sdk . ProcessorRunner . Builder ( com . streamsets . pipeline . stage . processor . kv . local . LocalLookupDProcessor . class , processor ) . addOutputLane ( "lane" ) . build ( ) ; runner . runInit ( ) ; runner . runProcess ( records ) ; "<AssertPlaceHolder>" ; } getErrorRecords ( ) { return errorRecords ; }
org . junit . Assert . assertTrue ( runner . getErrorRecords ( ) . isEmpty ( ) )
removeTenantIdpProperties ( ) { final org . oscm . internal . vo . VOTenant tenant = createTenant ( 123L ) ; tenant . setTenantSettings ( prepareIdpSettings ( "before" ) ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . tenant . bean . Override public org . oscm . tenant . bean . Void call ( ) throws org . oscm . internal . types . exception . NonUniqueBusinessKeyException { tenantService . addTenant ( tenant ) ; return null ; } } ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . tenant . bean . Override public org . oscm . tenant . bean . Void call ( ) throws org . oscm . internal . types . exception . ObjectNotFoundException { tenantService . removeTenantSettings ( 123L ) ; return null ; } } ) ; org . oscm . internal . vo . VOTenant resultTenant = runTX ( new java . util . concurrent . Callable < org . oscm . internal . vo . VOTenant > ( ) { @ org . oscm . tenant . bean . Override public org . oscm . internal . vo . VOTenant call ( ) throws org . oscm . internal . types . exception . ObjectNotFoundException { return tenantService . getTenantByTenantId ( "tenantID123" ) ; } } ) ; "<AssertPlaceHolder>" ; } getTenantSettings ( ) { return tenantSettings ; }
org . junit . Assert . assertTrue ( ( ( resultTenant != null ) && ( resultTenant . getTenantSettings ( ) . isEmpty ( ) ) ) )
handle_shouldUnsetThePersonDateVoided ( ) { org . openmrs . api . handler . UnvoidHandler < org . openmrs . Person > handler = new org . openmrs . api . handler . PersonUnvoidHandler ( ) ; org . openmrs . Person person = new org . openmrs . Person ( ) ; person . setPersonVoided ( true ) ; person . setPersonDateVoided ( new java . util . Date ( ) ) ; handler . handle ( person , null , null , null ) ; "<AssertPlaceHolder>" ; } getPersonDateVoided ( ) { return personDateVoided ; }
org . junit . Assert . assertNull ( person . getPersonDateVoided ( ) )
createUserExistingEmailFails ( ) { "<AssertPlaceHolder>" ; final cc . kune . core . shared . dto . UserDTO user = new cc . kune . core . shared . dto . UserDTO ( "test2" , "test2" , "123456" , properties . getAdminEmail ( ) , lang , country , timezone , null , true , cc . kune . core . shared . dto . SubscriptionMode . manual , "blue" ) ; userService . createUser ( user , false ) ; } getUser ( ) { return user ; }
org . junit . Assert . assertNull ( session . getUser ( ) . getId ( ) )
whenOptionalityIsDefault ( ) { class Customer { @ org . apache . isis . applib . annotation . Property ( optionality = org . apache . isis . applib . annotation . Optionality . DEFAULT ) public java . lang . String getName ( ) { return null ; } public void setName ( final java . lang . String name ) { } } final java . lang . Class < ? > cls = Customer . class ; propertyMethod = findMethod ( Customer . class , "getName" ) ; final org . apache . isis . core . metamodel . facets . FacetFactory . ProcessMethodContext processMethodContext = new org . apache . isis . core . metamodel . facets . FacetFactory . ProcessMethodContext ( cls , null , null , propertyMethod , mockMethodRemover , facetedMethod ) ; facetFactory . processOptional ( processMethodContext ) ; final org . apache . isis . core . metamodel . facets . objectvalue . mandatory . MandatoryFacet mandatoryFacet = facetedMethod . getFacet ( org . apache . isis . core . metamodel . facets . objectvalue . mandatory . MandatoryFacet . class ) ; "<AssertPlaceHolder>" ; } getFacet ( java . lang . Class ) { final org . apache . isis . core . metamodel . facetapi . FacetHolder facetHolder = getAction ( ) ; return facetHolder . getFacet ( facetType ) ; }
org . junit . Assert . assertNull ( mandatoryFacet )
protocolMismatchHeader ( ) { java . nio . ByteBuffer [ ] buffers = new java . nio . ByteBuffer [ ] { java . nio . ByteBuffer . wrap ( new byte [ ] { 'A' } ) , java . nio . ByteBuffer . wrap ( new byte [ ] { 'A' , 'M' , 'Q' } ) , java . nio . ByteBuffer . wrap ( new byte [ ] { 'A' , 'N' , 'Q' , 'P' } ) , java . nio . ByteBuffer . wrap ( new byte [ ] { 'A' , 'M' , 'Q' , 'P' } ) , java . nio . ByteBuffer . wrap ( new byte [ ] { 'A' , 'M' , 'Q' , 'P' , 1 , 1 , 8 } ) , java . nio . ByteBuffer . wrap ( new byte [ ] { 'A' , 'M' , 'Q' , 'P' , 1 , 1 , 8 , 0 } ) , java . nio . ByteBuffer . wrap ( new byte [ ] { 'A' , 'M' , 'Q' , 'P' , 1 , 1 , 9 , 1 } ) } ; java . lang . String [ ] messages = new java . lang . String [ ] { "Invalid<sp>AMQP<sp>protocol<sp>header<sp>from<sp>server:<sp>read<sp>only<sp>1<sp>byte(s)<sp>instead<sp>of<sp>4" , "Invalid<sp>AMQP<sp>protocol<sp>header<sp>from<sp>server:<sp>read<sp>only<sp>3<sp>byte(s)<sp>instead<sp>of<sp>4" , "Invalid<sp>AMQP<sp>protocol<sp>header<sp>from<sp>server:<sp>expected<sp>character<sp>77,<sp>got<sp>78" , "Invalid<sp>AMQP<sp>protocol<sp>header<sp>from<sp>server" , "Invalid<sp>AMQP<sp>protocol<sp>header<sp>from<sp>server" , "AMQP<sp>protocol<sp>version<sp>mismatch;<sp>we<sp>are<sp>version<sp>0-9-1,<sp>server<sp>is<sp>0-8" , "AMQP<sp>protocol<sp>version<sp>mismatch;<sp>we<sp>are<sp>version<sp>0-9-1,<sp>server<sp>sent<sp>signature<sp>1,1,9,1" } ; for ( int i = 0 ; i < ( buffers . length ) ; i ++ ) { builder = new com . rabbitmq . client . impl . nio . FrameBuilder ( channel , buffers [ i ] ) ; try { builder . readFrame ( ) ; org . junit . Assert . fail ( "protocol<sp>header<sp>not<sp>correct,<sp>exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( com . rabbitmq . client . MalformedFrameException e ) { "<AssertPlaceHolder>" ; } } } getMessage ( ) { return message ; }
org . junit . Assert . assertThat ( e . getMessage ( ) , org . hamcrest . Matchers . is ( messages [ i ] ) )
testTestVariances ( ) { logger . info ( "testVariances" ) ; double stdbarx = 65.54909 ; double stdbary = 61.85425 ; int n = 100 ; int m = 240 ; boolean is_twoTailed = true ; double aLevel = 0.05 ; boolean expResult = false ; boolean result = com . datumbox . framework . core . statistics . parametrics . independentsamples . FIndependentSamples . testVariances ( stdbarx , stdbary , n , m , is_twoTailed , aLevel ) ; "<AssertPlaceHolder>" ; } testVariances ( double , double , int , int , boolean , double ) { if ( ( ( ( n <= 1 ) || ( stdbarx <= 0 ) ) || ( m <= 1 ) ) || ( stdbary <= 0 ) ) { throw new java . lang . IllegalArgumentException ( "The<sp>values<sp>of<sp>the<sp>provided<sp>parameters<sp>are<sp>not<sp>within<sp>the<sp>permitted<sp>range." ) ; } double F = ( stdbarx * stdbarx ) / ( stdbary * stdbary ) ; boolean rejectH0 = com . datumbox . framework . core . statistics . parametrics . independentsamples . FIndependentSamples . checkCriticalValue ( F , n , m , is_twoTailed , aLevel ) ; return rejectH0 ; }
org . junit . Assert . assertEquals ( expResult , result )
testFindByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . ServiceComponent newServiceComponent = addServiceComponent ( ) ; com . liferay . portal . kernel . model . ServiceComponent existingServiceComponent = _persistence . findByPrimaryKey ( newServiceComponent . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertEquals ( existingServiceComponent , newServiceComponent )
listByPage ( ) { org . dromara . raincat . admin . page . PageParameter pageParameter = new org . dromara . raincat . admin . page . PageParameter ( 1 , 3 ) ; org . dromara . raincat . admin . query . TxTransactionQuery query = new org . dromara . raincat . admin . query . TxTransactionQuery ( ) ; query . setPageParameter ( pageParameter ) ; org . dromara . raincat . admin . service . TxTransactionGroupServiceTest . LOGGER . info ( query . toString ( ) ) ; final org . dromara . raincat . admin . page . CommonPager < org . dromara . raincat . admin . vo . TxTransactionGroupVO > commonPager = txTransactionGroupService . listByPage ( query ) ; final java . util . List < org . dromara . raincat . admin . vo . TxTransactionGroupVO > dataList = commonPager . getDataList ( ) ; "<AssertPlaceHolder>" ; } listByPage ( org . dromara . raincat . admin . query . RecoverTransactionQuery ) { org . dromara . raincat . admin . page . CommonPager < org . dromara . raincat . admin . vo . TransactionRecoverVO > voCommonPager = new org . dromara . raincat . admin . page . CommonPager ( ) ; final java . lang . String mongoTableName = org . dromara . raincat . common . holder . RepositoryPathUtils . buildMongoTableName ( query . getApplicationName ( ) ) ; final org . dromara . raincat . admin . page . PageParameter pageParameter = query . getPageParameter ( ) ; final int currentPage = pageParameter . getCurrentPage ( ) ; final int pageSize = pageParameter . getPageSize ( ) ; org . springframework . data . mongodb . core . query . Query baseQuery = new org . springframework . data . mongodb . core . query . Query ( ) ; if ( org . apache . commons . lang3 . StringUtils . isNoneBlank ( query . getTxGroupId ( ) ) ) { baseQuery . addCriteria ( new org . springframework . data . mongodb . core . query . Criteria ( "groupId" ) . is ( query . getTxGroupId ( ) ) ) ; } if ( java . util . Objects . nonNull ( query . getRetry ( ) ) ) { baseQuery . addCriteria ( new org . springframework . data . mongodb . core . query . Criteria ( "retriedCount" ) . lt ( query . getRetry ( ) ) ) ; } final long totalCount = mongoTemplate . count ( baseQuery , mongoTableName ) ; if ( totalCount <= 0 ) { return voCommonPager ; } int start = ( currentPage - 1 ) * pageSize ; voCommonPager . setPage ( org . dromara . raincat . admin . helper . PageHelper . buildPage ( query . getPageParameter ( ) , ( ( int ) ( totalCount ) ) ) ) ; baseQuery . skip ( start ) . limit ( pageSize ) ; final java . util . List < org . dromara . raincat . common . bean . adapter . MongoAdapter > mongoAdapters = mongoTemplate . find ( baseQuery , org . dromara . raincat . common . bean . adapter . MongoAdapter . class , mongoTableName ) ; if ( org . apache . commons . collections . CollectionUtils . isNotEmpty ( mongoAdapters ) ) { final java . util . List < org . dromara . raincat . admin . vo . TransactionRecoverVO > recoverVOS = mongoAdapters . stream ( ) . map ( ConvertHelper :: buildVO ) . collect ( java . util . stream . Collectors . toList ( ) ) ; voCommonPager . setDataList ( recoverVOS ) ; } return voCommonPager ; }
org . junit . Assert . assertNotNull ( dataList )
testAddReservedTypeBeforeFormatJavaTypeGeneratesCorrectFQNs ( ) { final java . lang . String baseType = "myType" ; final java . lang . String fullyQualifiedType = "org.myPackage." + baseType ; importUtils . addReservedType ( fullyQualifiedType ) ; "<AssertPlaceHolder>" ; } formatJavaType ( java . lang . String ) { if ( typeName != null ) { org . apache . cayenne . gen . StringUtils stringUtils = org . apache . cayenne . gen . StringUtils . getInstance ( ) ; java . lang . String typeClassName = stringUtils . stripPackageName ( typeName ) ; if ( ( ( ! ( reservedImportTypesMap . containsKey ( typeClassName ) ) ) && ( importTypesMap . containsKey ( typeClassName ) ) ) && ( typeName . equals ( importTypesMap . get ( typeClassName ) ) ) ) { return typeClassName ; } java . lang . String typePackageName = stringUtils . stripClass ( typeName ) ; if ( "java.lang" . equals ( typePackageName ) ) { return typeClassName ; } if ( ( null != ( packageName ) ) && ( packageName . equals ( typePackageName ) ) ) { return typeClassName ; } } return typeName ; }
org . junit . Assert . assertEquals ( fullyQualifiedType , importUtils . formatJavaType ( fullyQualifiedType ) )
testaQuePopupAbreCorretamente ( ) { final java . lang . String input = "teste" ; page . click ( "popup" ) ; final br . com . caelum . seleniumdsl . Page popupPage = browser . window ( "popup" ) ; final br . com . caelum . seleniumdsl . Form form = popupPage . form ( "form" ) ; final br . com . caelum . seleniumdsl . Field field = form . field ( "textinput" ) ; field . type ( input ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return false ; }
org . junit . Assert . assertTrue ( field . contains ( input ) )
testNumHistories ( ) { java . io . ByteArrayOutputStream os = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintStream ops = new java . io . PrintStream ( os ) ; org . apache . hive . beeline . BeeLine beeline = new org . apache . hive . beeline . BeeLine ( ) ; beeline . getOpts ( ) . setHistoryFile ( org . apache . hive . beeline . TestBeeLineHistory . fileName ) ; beeline . setOutputStream ( ops ) ; java . lang . reflect . Method method = beeline . getClass ( ) . getDeclaredMethod ( "setupHistory" ) ; method . setAccessible ( true ) ; method . invoke ( beeline ) ; beeline . initializeConsoleReader ( null ) ; beeline . dispatch ( "!history" ) ; java . lang . String output = os . toString ( "UTF-8" ) ; int numHistories = output . split ( "\n" ) . length ; "<AssertPlaceHolder>" ; beeline . close ( ) ; } split ( org . apache . hadoop . hive . ql . plan . ExprNodeDesc ) { return org . apache . hadoop . hive . ql . plan . ExprNodeDescUtils . split ( current , new java . util . ArrayList < org . apache . hadoop . hive . ql . plan . ExprNodeDesc > ( ) ) ; }
org . junit . Assert . assertEquals ( 10 , numHistories )
testHelp ( ) { org . apache . hadoop . yarn . client . cli . ClusterCLI cli = createAndGetClusterCLI ( ) ; int rc = cli . run ( new java . lang . String [ ] { "cluster" , "<sp>via<sp>RM).<sp>AND<sp>PLEASE<sp>NOTE:<sp>if" 4 } ) ; "<AssertPlaceHolder>" ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintWriter pw = new java . io . PrintWriter ( baos ) ; pw . println ( "usage:<sp>yarn<sp>cluster" ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 9 ) ; pw . println ( "<sp>removed<sp>in<sp>future<sp>releases." ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 8 ) ; pw . println ( "<sp>store,<sp>with<sp>this<sp>option,<sp>all" ) ; pw . println ( "<sp>via<sp>RM).<sp>AND<sp>PLEASE<sp>NOTE:<sp>if" 3 ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 5 ) ; pw . println ( "<sp>they<sp>will<sp>access/modify<sp>stored" ) ; pw . println ( "<sp>node<sp>labels<sp>directly.<sp>By" ) ; pw . println ( "<sp>via<sp>RM).<sp>AND<sp>PLEASE<sp>NOTE:<sp>if" 0 ) ; pw . println ( "<sp>via<sp>RM).<sp>AND<sp>PLEASE<sp>NOTE:<sp>if" ) ; pw . println ( "<sp>via<sp>RM).<sp>AND<sp>PLEASE<sp>NOTE:<sp>if" 5 ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 3 ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 6 ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 2 ) ; pw . println ( "<sp>command<sp>run<sp>on<sp>the<sp>machine" ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 1 ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 7 ) ; pw . println ( "<sp>removed<sp>in<sp>future<sp>releases." ) ; pw . println ( "<sp>-h,--help<sp>Displays<sp>help<sp>for<sp>all<sp>commands." ) ; pw . println ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 4 ) ; pw . println ( "<sp>via<sp>RM).<sp>AND<sp>PLEASE<sp>NOTE:<sp>if" 1 ) ; pw . println ( "<sp>via<sp>RM).<sp>AND<sp>PLEASE<sp>NOTE:<sp>if" 2 ) ; pw . println ( "<sp>via<sp>RM).<sp>AND<sp>PLEASE<sp>NOTE:<sp>if" 1 ) ; pw . close ( ) ; verify ( sysOut ) . println ( baos . toString ( "<sp>dir<sp>to<sp>a<sp>local<sp>directory" 0 ) ) ; } run ( java . lang . String [ ] , org . apache . hadoop . conf . Configuration ) { org . apache . hadoop . hdfs . server . namenode . ha . BootstrapStandby bs = new org . apache . hadoop . hdfs . server . namenode . ha . BootstrapStandby ( ) ; bs . setConf ( conf ) ; try { return org . apache . hadoop . util . ToolRunner . run ( bs , argv ) ; } catch ( java . lang . Exception e ) { if ( e instanceof java . io . IOException ) { throw ( ( java . io . IOException ) ( e ) ) ; } else { throw new java . io . IOException ( e ) ; } } }
org . junit . Assert . assertEquals ( 0 , rc )
matchRequiredVersions_shouldNotMatchWhenRevisionNumberIsAboveMaximumRevisionNumber ( ) { java . lang . Long revisionNumber = ( ( long ) ( Integer . MAX_VALUE ) ) + 2 ; java . lang . String openmrsVersion = "1.4." + revisionNumber ; java . lang . String requiredVersion = "1.4.*" ; "<AssertPlaceHolder>" ; } matchRequiredVersions ( java . lang . String , java . lang . String ) { if ( org . apache . commons . lang3 . StringUtils . isNotEmpty ( versionRange ) ) { java . lang . String [ ] ranges = versionRange . split ( "^\\s?\\d+[\\.\\d+\\*?|\\.\\*]+" 1 ) ; for ( java . lang . String range : ranges ) { java . lang . String separator = "-" ; if ( ( ( range . indexOf ( "*" ) ) > 0 ) || ( ( ( range . indexOf ( separator ) ) > 0 ) && ( ! ( org . openmrs . module . ModuleUtil . isVersionWithQualifier ( range ) ) ) ) ) { java . lang . String lowerBound = range ; java . lang . String upperBound = range ; int indexOfSeparator = range . indexOf ( separator ) ; while ( indexOfSeparator > 0 ) { lowerBound = range . substring ( 0 , indexOfSeparator ) ; upperBound = range . substring ( ( indexOfSeparator + 1 ) ) ; if ( upperBound . matches ( "^\\s?\\d+[\\.\\d+\\*?|\\.\\*]+" 0 ) ) { break ; } indexOfSeparator = range . indexOf ( separator , ( indexOfSeparator + 1 ) ) ; } lowerBound = org . apache . commons . lang3 . StringUtils . remove ( lowerBound , lowerBound . replaceAll ( "^\\s?\\d+[\\.\\d+\\*?|\\.\\*]+" , "" ) ) ; upperBound = org . apache . commons . lang3 . StringUtils . remove ( upperBound , upperBound . replaceAll ( "^\\s?\\d+[\\.\\d+\\*?|\\.\\*]+" , "" ) ) ; if ( ( lowerBound . indexOf ( "*" ) ) > 0 ) { lowerBound = lowerBound . replaceAll ( "\\*" , "0" ) ; } if ( ( upperBound . indexOf ( "*" ) ) > 0 ) { upperBound = upperBound . replaceAll ( "\\*" , java . lang . Integer . toString ( Integer . MAX_VALUE ) ) ; } int lowerReturn = org . openmrs . module . ModuleUtil . compareVersion ( version , lowerBound ) ; int upperReturn = org . openmrs . module . ModuleUtil . compareVersion ( version , upperBound ) ; if ( ( lowerReturn < 0 ) || ( upperReturn > 0 ) ) { org . openmrs . module . ModuleUtil . log . debug ( ( ( ( ( ( "Version<sp>" + version ) + "<sp>is<sp>not<sp>between<sp>" ) + lowerBound ) + "<sp>and<sp>" ) + upperBound ) ) ; } else { return true ; } } else { if ( ( org . openmrs . module . ModuleUtil . compareVersion ( version , range ) ) < 0 ) { org . openmrs . module . ModuleUtil . log . debug ( ( ( ( "Version<sp>" + version ) + "<sp>is<sp>below<sp>" ) + range ) ) ; } else { return true ; } } } } else { return true ; } return false ; }
org . junit . Assert . assertFalse ( org . openmrs . module . ModuleUtil . matchRequiredVersions ( openmrsVersion , requiredVersion ) )
testGetParametersWithDefaultEntityAndDisabledSecurity ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . person . type . PersonType entity = new org . lnu . is . domain . person . type . PersonType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
org . junit . Assert . assertEquals ( expected , actual )
test ( ) { org . zkoss . zats . mimic . DesktopAgent d = connect ( ) ; d . query ( "#btn" ) . click ( ) ; "<AssertPlaceHolder>" ; } click ( ) { System . out . println ( "click" ) ; }
org . junit . Assert . assertTrue ( true )
testContentRepositoryReuse ( ) { org . apache . jackrabbit . oak . Oak oak = new org . apache . jackrabbit . oak . Oak ( ) . with ( new org . apache . jackrabbit . oak . spi . security . OpenSecurityProvider ( ) ) ; org . apache . jackrabbit . oak . api . ContentRepository r0 = null ; org . apache . jackrabbit . oak . api . ContentRepository r1 = null ; try { r0 = oak . createContentRepository ( ) ; r1 = oak . createContentRepository ( ) ; "<AssertPlaceHolder>" ; } finally { if ( r0 != null ) { ( ( java . io . Closeable ) ( r0 ) ) . close ( ) ; } } } createContentRepository ( ) { if ( ( contentRepository ) == null ) { setUpOak ( ) ; contentRepository = oak . createContentRepository ( ) ; } return contentRepository ; }
org . junit . Assert . assertEquals ( r0 , r1 )
testExpression18 ( ) { java . lang . String expr = "-3" ; double expected = - 3 ; net . objecthunter . exp4j . Expression e = new net . objecthunter . exp4j . ExpressionBuilder ( expr ) . build ( ) ; "<AssertPlaceHolder>" ; } evaluate ( ) { final net . objecthunter . exp4j . ArrayStack output = new net . objecthunter . exp4j . ArrayStack ( ) ; for ( int i = 0 ; i < ( tokens . length ) ; i ++ ) { net . objecthunter . exp4j . tokenizer . Token t = tokens [ i ] ; else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_VARIABLE ) ) { final java . lang . String name = ( ( net . objecthunter . exp4j . tokenizer . VariableToken ) ( t ) ) . getName ( ) ; final java . lang . Double value = this . variables . get ( name ) ; if ( value == null ) { throw new java . lang . IllegalArgumentException ( ( ( "No<sp>value<sp>has<sp>been<sp>set<sp>for<sp>the<sp>setVariable<sp>'" + name ) + "'." ) ) ; } output . push ( value ) ; } else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_OPERATOR ) ) { net . objecthunter . exp4j . tokenizer . OperatorToken op = ( ( net . objecthunter . exp4j . tokenizer . OperatorToken ) ( t ) ) ; if ( ( output . size ( ) ) < ( op . getOperator ( ) . getNumOperands ( ) ) ) { throw new java . lang . IllegalArgumentException ( ( ( "Invalid<sp>number<sp>of<sp>operands<sp>available<sp>for<sp>'" + ( op . getOperator ( ) . getSymbol ( ) ) ) + "'<sp>operator" ) ) ; } if ( ( op . getOperator ( ) . getNumOperands ( ) ) == 2 ) { double rightArg = output . pop ( ) ; double leftArg = output . pop ( ) ; output . push ( op . getOperator ( ) . apply ( leftArg , rightArg ) ) ; } else if ( ( op . getOperator ( ) . getNumOperands ( ) ) == 1 ) { double arg = output . pop ( ) ; output . push ( op . getOperator ( ) . apply ( arg ) ) ; } } else if ( ( t . getType ( ) ) == ( net . objecthunter . exp4j . tokenizer . Token . TOKEN_FUNCTION ) ) { net . objecthunter . exp4j . tokenizer . FunctionToken func = ( ( net . objecthunter . exp4j . tokenizer . FunctionToken ) ( t ) ) ; final int numArguments = func . getFunction ( ) . getNumArguments ( ) ; if ( ( output . size ( ) ) < numArguments ) { throw new java . lang . IllegalArgumentException ( ( ( "Invalid<sp>number<sp>of<sp>arguments<sp>available<sp>for<sp>'" + ( func . getFunction ( ) . getName ( ) ) ) + "'<sp>function" ) ) ; } double [ ] args = new double [ numArguments ] ; for ( int j = numArguments - 1 ; j >= 0 ; j -- ) { args [ j ] = output . pop ( ) ; } output . push ( func . getFunction ( ) . apply ( args ) ) ; } } if ( ( output . size ( ) ) > 1 ) { throw new java . lang . IllegalArgumentException ( "Invalid<sp>number<sp>of<sp>items<sp>on<sp>the<sp>output<sp>queue.<sp>Might<sp>be<sp>caused<sp>by<sp>an<sp>invalid<sp>number<sp>of<sp>arguments<sp>for<sp>a<sp>function." ) ; } return output . pop ( ) ; }
org . junit . Assert . assertTrue ( ( expected == ( e . evaluate ( ) ) ) )
testName ( ) { java . lang . String strId = ( ( State . OK . name ( ) ) + "_" ) + "jay<sp>vyas" ; long id = org . apache . bigtop . bigpetstore . util . NumericalIdUtils . toId ( strId ) ; java . lang . String strId2 = ( ( State . CO . name ( ) ) + "_" ) + "jay<sp>vyas" ; long id2 = org . apache . bigtop . bigpetstore . util . NumericalIdUtils . toId ( strId2 ) ; System . out . println ( ( ( id + "<sp>" ) + id2 ) ) ; "<AssertPlaceHolder>" ; } toId ( java . lang . String ) { return org . apache . bigtop . bigpetstore . util . NumericalIdUtils . toId ( null , name ) ; }
org . junit . Assert . assertFalse ( ( id == id2 ) )
testParseNegativeY ( ) { java . lang . String source = ( ( ( ( ( "{1" + ( getDecimalCharacter ( ) ) ) + "2323;<sp>-1" ) + ( getDecimalCharacter ( ) ) ) + "4343;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "6333}" ; org . apache . commons . math4 . linear . ArrayRealVector expected = new org . apache . commons . math4 . linear . ArrayRealVector ( new double [ ] { 1.2323 , - 1.4343 , 1.6333 } ) ; org . apache . commons . math4 . linear . ArrayRealVector actual = realVectorFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . text . ParsePosition parsePosition = new java . text . ParsePosition ( 0 ) ; org . apache . commons . math4 . geometry . euclidean . twod . Vector2D result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { throw new org . apache . commons . math4 . exception . MathParseException ( source , parsePosition . getErrorIndex ( ) , org . apache . commons . math4 . geometry . euclidean . twod . Vector2D . class ) ; } return result ; }
org . junit . Assert . assertEquals ( expected , actual )
testStringInSwitch ( ) { int hitCount = net . sourceforge . cobertura . test . util . TestUtils . getTotalHitCount ( net . sourceforge . cobertura . jdk . JDK7Test . dom , "mypackage.Java7TestCase" , "string_in_switch" ) ; "<AssertPlaceHolder>" ; } getTotalHitCount ( groovy . util . Node , java . lang . String , java . lang . String ) { int sum = 0 ; for ( net . sourceforge . cobertura . test . util . Iterator < groovy . util . Node > packagesIterator = dom . iterator ( ) ; packagesIterator . hasNext ( ) ; ) { groovy . util . Node packagesNode = packagesIterator . next ( ) ; if ( "packages" . equals ( packagesNode . name ( ) ) ) { for ( net . sourceforge . cobertura . test . util . Iterator < groovy . util . Node > packageIterator = packagesNode . iterator ( ) ; packageIterator . hasNext ( ) ; ) { groovy . util . Node packageNode = packageIterator . next ( ) ; if ( "package" . equals ( packageNode . name ( ) ) ) { for ( net . sourceforge . cobertura . test . util . Iterator < groovy . util . Node > classesIterator = packageNode . iterator ( ) ; classesIterator . hasNext ( ) ; ) { groovy . util . Node classesNode = classesIterator . next ( ) ; if ( "classes" . equals ( classesNode . name ( ) ) ) { for ( net . sourceforge . cobertura . test . util . Iterator < groovy . util . Node > classIterator = classesNode . iterator ( ) ; classIterator . hasNext ( ) ; ) { groovy . util . Node classNode = classIterator . next ( ) ; if ( "class" . equals ( classNode . name ( ) ) ) { if ( className . equals ( classNode . attribute ( "name" ) ) ) { for ( net . sourceforge . cobertura . test . util . Iterator < groovy . util . Node > methodsIterator = classNode . iterator ( ) ; methodsIterator . hasNext ( ) ; ) { groovy . util . Node methodsNode = methodsIterator . next ( ) ; if ( "methods" . equals ( methodsNode . name ( ) ) ) { for ( net . sourceforge . cobertura . test . util . Iterator < groovy . util . Node > methodIterator = methodsNode . iterator ( ) ; methodIterator . hasNext ( ) ; ) { groovy . util . Node methodNode = methodIterator . next ( ) ; if ( "method" . equals ( methodNode . name ( ) ) ) { if ( methodName . equals ( methodNode . attribute ( "name" ) ) ) { for ( net . sourceforge . cobertura . test . util . Iterator < groovy . util . Node > linesIterator = methodNode . iterator ( ) ; linesIterator . hasNext ( ) ; ) { groovy . util . Node linesNode = linesIterator . next ( ) ; if ( "lines" . equals ( linesNode . name ( ) ) ) { for ( net . sourceforge . cobertura . test . util . Iterator < groovy . util . Node > lineIterator = linesNode . iterator ( ) ; lineIterator . hasNext ( ) ; ) { groovy . util . Node lineNode = lineIterator . next ( ) ; if ( "line" . equals ( lineNode . name ( ) ) ) { sum += java . lang . Integer . valueOf ( ( ( java . lang . String ) ( lineNode . attribute ( "hits" ) ) ) ) ; } } } } } } } } } } } } } } } } } } return sum ; }
org . junit . Assert . assertEquals ( 3 , hitCount )
testSAMLSLOParsing ( ) { java . lang . ClassLoader tcl = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; java . io . InputStream configStream = tcl . getResourceAsStream ( "parser/saml2/saml2-logout-request-2.xml" ) ; org . picketlink . identity . federation . core . util . JAXPValidationUtil . validate ( configStream ) ; configStream = tcl . getResourceAsStream ( "parser/saml2/saml2-logout-request-2.xml" ) ; org . picketlink . identity . federation . core . parsers . saml . SAMLParser parser = new org . picketlink . identity . federation . core . parsers . saml . SAMLParser ( ) ; org . picketlink . identity . federation . saml . v2 . protocol . LogoutRequestType lotRequest = ( ( org . picketlink . identity . federation . saml . v2 . protocol . LogoutRequestType ) ( parser . parse ( configStream ) ) ) ; "<AssertPlaceHolder>" ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; org . picketlink . identity . federation . core . saml . v2 . writers . SAMLRequestWriter writer = new org . picketlink . identity . federation . core . saml . v2 . writers . SAMLRequestWriter ( org . picketlink . common . util . StaxUtil . getXMLStreamWriter ( baos ) ) ; writer . write ( lotRequest ) ; java . io . ByteArrayInputStream bis = new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ; org . picketlink . common . util . DocumentUtil . getDocument ( bis ) ; baos = new java . io . ByteArrayOutputStream ( ) ; writer = new org . picketlink . identity . federation . core . saml . v2 . writers . SAMLRequestWriter ( org . picketlink . common . util . StaxUtil . getXMLStreamWriter ( baos ) ) ; writer . write ( lotRequest ) ; java . lang . String writtenString = new java . lang . String ( baos . toByteArray ( ) ) ; org . jboss . logging . Logger . getLogger ( org . picketlink . test . identity . federation . core . parser . saml . SAMLSloRequestParserTestCase . class ) . debug ( writtenString ) ; validateSchema ( writtenString ) ; } parse ( javax . xml . stream . XMLEventReader ) { javax . xml . stream . events . StartElement startElement = org . picketlink . common . util . StaxParserUtil . getNextStartElement ( xmlEventReader ) ; org . picketlink . common . util . StaxParserUtil . validate ( startElement , org . picketlink . config . idm . parsers . IDMConfigParser . ROOT_ELEMENT ) ; org . picketlink . config . idm . IDMType idmType = new org . picketlink . config . idm . IDMType ( ) ; while ( xmlEventReader . hasNext ( ) ) { javax . xml . stream . events . XMLEvent xmlEvent = org . picketlink . common . util . StaxParserUtil . peek ( xmlEventReader ) ; if ( xmlEvent == null ) break ; else if ( xmlEvent instanceof javax . xml . stream . events . StartElement ) { startElement = org . picketlink . common . util . StaxParserUtil . getNextStartElement ( xmlEventReader ) ; java . lang . String methodName = org . picketlink . common . util . StaxParserUtil . getStartElementName ( startElement ) ; java . util . Map < java . lang . String , java . lang . String > methodParams = new java . util . LinkedHashMap < java . lang . String , java . lang . String > ( ) ; java . util . Iterator attributes = startElement . getAttributes ( ) ; while ( attributes . hasNext ( ) ) { javax . xml . stream . events . Attribute attribute = ( ( javax . xml . stream . events . Attribute ) ( attributes . next ( ) ) ) ; java . lang . String attrName = attribute . getName ( ) . getLocalPart ( ) ; java . lang . String attrValue = org . picketlink . common . util . StaxParserUtil . getAttributeValue ( attribute ) ; methodParams . put ( attrName , attrValue ) ; } org . picketlink . config . idm . ConfigBuilderMethodType configBuilderMethod = new org . picketlink . config . idm . ConfigBuilderMethodType ( methodName , methodParams ) ; idmType . addConfigBuilderMethod ( configBuilderMethod ) ; } else if ( xmlEvent instanceof javax . xml . stream . events . EndElement ) { javax . xml . stream . events . EndElement endElement = ( ( javax . xml . stream . events . EndElement ) ( org . picketlink . common . util . StaxParserUtil . getNextEvent ( xmlEventReader ) ) ) ; java . lang . String endElementName = org . picketlink . common . util . StaxParserUtil . getEndElementName ( endElement ) ; if ( endElementName . equals ( org . picketlink . config . idm . parsers . IDMConfigParser . ROOT_ELEMENT ) ) break ; } else { org . picketlink . common . util . StaxParserUtil . getNextEvent ( xmlEventReader ) ; } } return idmType ; }
org . junit . Assert . assertNotNull ( lotRequest )
testImportDir ( ) { java . lang . String dir1 = ( getRandomDir ( ) ) + "a()<sp>::=<sp><<dir1<sp>a>>\n" 1 ; java . lang . String dir2 = ( getRandomDir ( ) ) + "/dir2" ; java . lang . String gstr = ( ( "import<sp>\"" + dir2 ) + "\"a()<sp>::=<sp><<dir1<sp>a>>\n" 0 ) + "a()<sp>::=<sp><<dir1<sp>a>>\n" ; writeFile ( dir1 , "a()<sp>::=<sp><<dir1<sp>a>>\n" 3 , gstr ) ; java . lang . String a = "a()<sp>::=<sp><<dir2<sp>a>>\n" ; java . lang . String b = "b()<sp>::=<sp><<dir2<sp>b>>\n" ; writeFile ( dir2 , "a.st" , a ) ; writeFile ( dir2 , "a()<sp>::=<sp><<dir1<sp>a>>\n" 2 , b ) ; org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroupFile ( ( dir1 + "/g.stg" ) ) ; org . stringtemplate . v4 . ST st = group . getInstanceOf ( "b" ) ; java . lang . String expected = "dir2<sp>b" ; java . lang . String result = ( st != null ) ? st . render ( ) : null ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
org . junit . Assert . assertEquals ( expected , result )
testProcessTemplateEmptyChain ( ) { java . lang . String template = "#chain('<sp>OR<sp>'<sp>'WHERE<sp>')" + ( ( ( "#chunk($a)$a#end" + "#chunk($b)$b#end" ) + "#chunk($c)$c#end" ) + "#end" ) ; org . apache . cayenne . access . jdbc . SQLStatement compiled = processor . processTemplate ( template , java . util . Collections . < java . lang . String , java . lang . Object > emptyMap ( ) ) ; "<AssertPlaceHolder>" ; } getSql ( ) { return delegateTranslator . getSql ( ) ; }
org . junit . Assert . assertEquals ( "" , compiled . getSql ( ) )
testBookKeeperCommon ( ) { java . lang . Class . forName ( "org.apache.bookkeeper.common.util.OrderedExecutor" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( true )
plControleHistorieAnummerGelijkNok ( ) { final nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst dbPersoonslijst = new nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijstBuilder ( ) . build ( ) ; setup ( java . util . Collections . singletonList ( dbPersoonslijst ) , java . util . Collections . singletonList ( dbPersoonslijst ) , true , true , true , true , true , false , true , true , true , true , true , true ) ; "<AssertPlaceHolder>" ; } setup ( java . util . List , java . util . List , boolean , boolean , boolean , boolean , boolean , boolean , boolean , boolean , boolean , boolean , boolean , boolean ) { org . mockito . Mockito . when ( plZoekerObvActueelAnummer . zoek ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) ) ) . thenReturn ( plZoekerObvActueelAnummerResult ) ; org . mockito . Mockito . when ( plZoekerObvActueelBsn . zoek ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) ) ) . thenReturn ( plZoekerObvActueelBsnResult ) ; org . mockito . Mockito . when ( lijstControleEen . controleer ( org . mockito . Matchers . anyListOf ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( lijstControleEenResult ) ; org . mockito . Mockito . when ( plControleGevondenBlokkeringssituatieIsJuist . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( resultControleBijhoudingssituatie ) ; org . mockito . Mockito . when ( plControleBijhoudingsPartijGelijkVerzendendeGemeente . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( resultControleVerzendendeGemeente ) ; org . mockito . Mockito . when ( plControleBijhoudingsPartijOngelijk . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( plControleBijhoudingsPartijOngelijkResult ) ; org . mockito . Mockito . when ( plControleBijhoudingsPartijOngelijkRni . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( plControleVorigAnummerGelijk . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( plControleVorigAnummerGelijkResult ) ; org . mockito . Mockito . when ( plControleHistorieAnummerGelijk . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( plControleHistorieAnummerGelijkResult ) ; org . mockito . Mockito . when ( plControleDezelfdePersoon . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( plControleDezelfdePersoonResult ) ; org . mockito . Mockito . when ( plControleActueelBsnGelijk . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( plControleActueelBsnGelijkResult ) ; org . mockito . Mockito . when ( lijstControleGeen . controleer ( org . mockito . Matchers . anyListOf ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( lijstControleGeenResult ) ; org . mockito . Mockito . when ( plControleGevondenAdressenKomenVoorInHistorieAangebodenAdressen . controleer ( org . mockito . Matchers . any ( nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext . class ) , org . mockito . Matchers . any ( nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst . class ) ) ) . thenReturn ( plControleGevondenAdressenKomenVoorInHistorieAangebodenAdressenResult ) ; org . mockito . Mockito
org . junit . Assert . assertFalse ( subject . controleer ( new nl . bzk . migratiebrp . synchronisatie . runtime . service . synchronisatie . verwerker . context . VerwerkingsContext ( null , null , null , null ) ) )
readRawTweet ( ) { java . io . InputStream stream = org . openimaj . twitter . USMFStatus . class . getResourceAsStream ( "/org/openimaj/twitter/tweets.txt" ) ; org . openimaj . twitter . USMFStatus status = org . openimaj . io . IOUtils . read ( stream , new org . openimaj . twitter . USMFStatus ( org . openimaj . twitter . GeneralJSONTwitter . class ) ) ; status . addAnalysis ( "someString" , "with<sp>a<sp>value" ) ; status . addAnalysis ( "someInt" , 1.0F ) ; java . io . ByteArrayOutputStream outStream = new java . io . ByteArrayOutputStream ( ) ; org . openimaj . io . IOUtils . writeASCII ( outStream , status ) ; byte [ ] arr = outStream . toByteArray ( ) ; org . openimaj . twitter . USMFStatus readStatus = org . openimaj . io . IOUtils . read ( new java . io . ByteArrayInputStream ( arr ) , org . openimaj . twitter . USMFStatus . class ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof org . openimaj . video . tracking . klt . Feature ) ) return false ; if ( ( ( ( ( ( org . openimaj . video . tracking . klt . Feature ) ( o ) ) . x ) == ( x ) ) && ( ( ( ( org . openimaj . video . tracking . klt . Feature ) ( o ) ) . y ) == ( y ) ) ) && ( ( ( ( org . openimaj . video . tracking . klt . Feature ) ( o ) ) . val ) == ( val ) ) ) return true ; return false ; }
org . junit . Assert . assertTrue ( status . equals ( readStatus ) )
testAutoFormat ( ) { System . out . println ( "autoFormat" ) ; de . waldheinz . fs . util . RamDisk rd = new de . waldheinz . fs . util . RamDisk ( ( 1024 * 1024 ) ) ; de . waldheinz . fs . fat . FatFileSystem fs = de . waldheinz . fs . fat . SuperFloppyFormatter . get ( rd ) . format ( ) ; "<AssertPlaceHolder>" ; } getRoot ( ) { checkClosed ( ) ; return rootDir ; }
org . junit . Assert . assertNotNull ( fs . getRoot ( ) )
should_run_as_second_test ( ) { ( org . arquillian . with . set . test . method . order . TestWithChangedTestMethodOrder . number ) ++ ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 2 , org . arquillian . with . set . test . method . order . TestWithChangedTestMethodOrder . number )
testClosePopupRetainText_selectingAValue ( ) { openTestURL ( ) ; com . vaadin . testbench . elements . ComboBoxElement cb = $ ( com . vaadin . testbench . elements . ComboBoxElement . class ) . first ( ) ; cb . selectByText ( "Item<sp>3" ) ; org . openqa . selenium . WebElement textbox = cb . findElement ( com . vaadin . testbench . By . vaadin ( "#textbox" ) ) ; textbox . clear ( ) ; textbox . sendKeys ( "I" ) ; clickElement ( cb . findElement ( com . vaadin . testbench . By . vaadin ( "#button" ) ) ) ; "<AssertPlaceHolder>" ; } getAttribute ( java . lang . String ) { return session . getAttribute ( name ) ; }
org . junit . Assert . assertEquals ( "I" , textbox . getAttribute ( "value" ) )
testLeafSetEntryNodePrunedWhenHasParentAndSchemaMissing ( ) { org . opendaylight . controller . cluster . datastore . node . utils . transformer . NormalizedNodePruner pruner = org . opendaylight . controller . cluster . datastore . node . utils . transformer . NormalizedNodePrunerTest . prunerFullSchema ( TestModel . TEST_PATH . node ( TestModel . INVALID_QNAME ) ) ; org . opendaylight . yangtools . yang . data . api . schema . LeafSetEntryNode < java . lang . Object > child = org . opendaylight . yangtools . yang . data . impl . schema . Builders . leafSetEntryBuilder ( ) . withValue ( "test" ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeWithValue ( org . opendaylight . controller . cluster . datastore . util . TestModel . INVALID_QNAME , "test" ) ) . build ( ) ; org . opendaylight . yangtools . yang . data . api . schema . NormalizedNode < ? , ? > input = org . opendaylight . yangtools . yang . data . impl . schema . Builders . leafSetBuilder ( ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( org . opendaylight . controller . cluster . datastore . util . TestModel . INVALID_QNAME ) ) . withChild ( child ) . build ( ) ; org . opendaylight . yangtools . yang . data . api . schema . stream . NormalizedNodeWriter . forStreamWriter ( pruner ) . write ( input ) ; org . opendaylight . yangtools . yang . data . api . schema . NormalizedNode < ? , ? > actual = pruner . normalizedNode ( ) ; "<AssertPlaceHolder>" ; } normalizedNode ( ) { return normalizedNode ; }
org . junit . Assert . assertNull ( actual )
testCarriageReturnEndings ( ) { final java . lang . String code = "foo\rbaar,\rhello,world\r,kanu" ; final leap . lang . csv . CSVParser parser = leap . lang . csv . CSVParser . parse ( code , CSVFormat . DEFAULT ) ; final java . util . List < leap . lang . csv . CSVRecord > records = parser . getRecords ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . resources . size ( ) ; }
org . junit . Assert . assertEquals ( 4 , records . size ( ) )
testDynamicDeleteException ( ) { org . apache . ibatis . session . SqlSession sqlSession = tk . mybatis . mapper . mapper . MybatisHelper . getSqlSession ( ) ; try { tk . mybatis . mapper . mapper . CountryMapper mapper = sqlSession . getMapper ( tk . mybatis . mapper . mapper . CountryMapper . class ) ; "<AssertPlaceHolder>" ; } finally { sqlSession . rollback ( ) ; sqlSession . close ( ) ; } } deleteByPrimaryKey ( org . apache . ibatis . mapping . MappedStatement ) { final java . lang . Class < ? > entityClass = getEntityClass ( ms ) ; java . lang . StringBuilder sql = new java . lang . StringBuilder ( ) ; sql . append ( tk . mybatis . mapper . mapperhelper . SqlHelper . deleteFromTable ( entityClass , tableName ( entityClass ) ) ) ; sql . append ( tk . mybatis . mapper . mapperhelper . SqlHelper . wherePKColumns ( entityClass ) ) ; return sql . toString ( ) ; }
org . junit . Assert . assertEquals ( 1 , mapper . deleteByPrimaryKey ( 100 ) )
testIsSatisfiedExtraPrincipals ( ) { org . osgi . framework . Bundle bundle = mock ( org . osgi . framework . Bundle . class ) ; java . util . HashSet emptySet = new java . util . HashSet ( ) ; java . util . HashSet < java . security . Principal > principalSet = new java . util . HashSet ( ) ; principalSet . add ( ( ) -> "role1" ) ; principalSet . add ( ( ) -> "role2" ) ; principalSet . add ( ( ) -> "role3" ) ; principalSet . add ( ( ) -> "role4" ) ; principalSet . add ( ( ) -> "role5" ) ; principalSet . add ( ( ) -> "role6" ) ; javax . security . auth . Subject javaSubject = new javax . security . auth . Subject ( true , principalSet , emptySet , emptySet ) ; org . codice . ddf . condition . PrincipalCondition principalCondition = new org . codice . ddf . condition . PrincipalCondition ( bundle , new org . osgi . service . condpermadmin . ConditionInfo ( org . codice . ddf . condition . PrincipalCondition . class . getName ( ) , new java . lang . String [ ] { "role1" , "role2" , "role3" } ) ) ; boolean satisfied = javax . security . auth . Subject . doAs ( javaSubject , ( ( java . security . PrivilegedAction < java . lang . Boolean > ) ( principalCondition :: isSatisfied ) ) ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertThat ( satisfied , org . hamcrest . core . Is . is ( true ) )
testSet ( ) { for ( short i : edu . harvard . iq . dataverse . util . BitSet . allIndices ( ) ) { sut . set ( i ) ; "<AssertPlaceHolder>" ; } } isSet ( int ) { return ( ( store ) & ( 1L << idx ) ) != 0 ; }
org . junit . Assert . assertTrue ( sut . isSet ( i ) )
scaleValue2 ( ) { org . diirt . graphene . ValueScale logScale = org . diirt . graphene . ValueScales . logScale ( ) ; "<AssertPlaceHolder>" ; } scaleValue ( double , double , double , double , double ) { double oldRange = maxValue - minValue ; double newRange = newMaxValue - newMinValue ; return newMinValue + ( ( ( value - minValue ) / oldRange ) * newRange ) ; }
org . junit . Assert . assertThat ( logScale . scaleValue ( 100 , 10 , 1000 , ( - 100 ) , 100 ) , equalTo ( 0.0 ) )
getRunningActivity ( ) { name . pehl . karaka . shared . model . Activities cut = td . newActivities ( name . pehl . karaka . shared . model . TimeUnit . WEEK ) ; "<AssertPlaceHolder>" ; internalGetRunningActivity ( td . month ( ) ) ; internalGetRunningActivity ( td . week ( ) ) ; internalGetRunningActivity ( td . day ( ) ) ; } getRunningActivity ( ) { for ( name . pehl . karaka . shared . model . Activity activity : activities ( ) ) { if ( activity . isRunning ( ) ) { return activity ; } } return null ; }
org . junit . Assert . assertNull ( cut . getRunningActivity ( ) )
asyncMethodCallReturnsErrorEnum ( ) { io . joynr . proxy . ProxyBuilder < joynr . tests . testProxy > proxyBuilder = consumerRuntime . getProxyBuilder ( domain , joynr . tests . testProxy . class ) ; joynr . tests . testProxy proxy = proxyBuilder . setMessagingQos ( messagingQos ) . setDiscoveryQos ( discoveryQos ) . build ( ) ; joynr . exceptions . ApplicationException expected = new joynr . exceptions . ApplicationException ( joynr . tests . testTypes . ErrorEnumBase . BASE_ERROR_TYPECOLLECTION ) ; io . joynr . proxy . Future < java . lang . Void > future = proxy . methodWithErrorEnum ( callbackWithApplicationExceptionErrorEnumBase ) ; try { future . get ( ) ; org . junit . Assert . fail ( "Should<sp>throw<sp>ApplicationException" ) ; } catch ( io . joynr . exceptions . JoynrRuntimeException | java . lang . InterruptedException e ) { org . junit . Assert . fail ( e . toString ( ) ) ; } catch ( joynr . exceptions . ApplicationException e ) { "<AssertPlaceHolder>" ; } verify ( callbackWithApplicationExceptionErrorEnumBase ) . onFailure ( ( ( joynr . tests . testTypes . ErrorEnumBase ) ( expected . getError ( ) ) ) ) ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "TestSuiteResult<sp>[" + "name=" ) + ( this . name ) ) + ",<sp>" ) + "time=" ) + ( this . time ) ) + ",<sp>" ) + "tests=" ) + ( this . tests ) ) + ",<sp>" ) + "errors=" ) + ( this . errors ) ) + ",<sp>" ) + "skipped=" ) + ( this . skipped ) ) + ",<sp>" ) + "failures=" ) + ( this . failures ) ) + ",<sp>" ) + "testCaseResults=" ) + ( java . util . Arrays . toString ( this . testCaseResults ) ) ) + "]" ; }
org . junit . Assert . assertEquals ( expected , e )
testPutIteration ( ) { org . apache . hadoop . hbase . client . Put p = new org . apache . hadoop . hbase . client . Put ( org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . ROW ) ; for ( int i = 0 ; i < ( org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . COUNT ) ; i ++ ) { byte [ ] bytes = org . apache . hadoop . hbase . util . Bytes . toBytes ( i ) ; p . addColumn ( bytes , bytes , org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . TIMESTAMP , bytes ) ; } int index = 0 ; for ( org . apache . hadoop . hbase . CellScanner cellScanner = p . cellScanner ( ) ; cellScanner . advance ( ) ; ) { org . apache . hadoop . hbase . Cell cell = cellScanner . current ( ) ; byte [ ] bytes = org . apache . hadoop . hbase . util . Bytes . toBytes ( ( index ++ ) ) ; cell . equals ( new org . apache . hadoop . hbase . KeyValue ( org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . ROW , bytes , bytes , org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . TIMESTAMP , bytes ) ) ; } "<AssertPlaceHolder>" ; } toBytes ( java . nio . ByteBuffer ) { java . nio . ByteBuffer dup = buf . duplicate ( ) ; dup . position ( 0 ) ; return org . apache . hadoop . hbase . util . Bytes . readBytes ( dup ) ; }
org . junit . Assert . assertEquals ( org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . COUNT , index )
testIsTemporaryTableNeededTrue ( ) { when ( tableEntityManager . isTemporaryTableNeededToValidate ( uploadRequest ) ) . thenReturn ( true ) ; boolean needed = manager . isTemporaryTableNeeded ( progressCallback , request ) ; "<AssertPlaceHolder>" ; } isTemporaryTableNeeded ( org . sagebionetworks . common . util . progress . ProgressCallback , org . sagebionetworks . repo . model . table . TableUpdateTransactionRequest ) { for ( org . sagebionetworks . repo . model . table . TableUpdateRequest change : request . getChanges ( ) ) { boolean tempNeeded = tableEntityManager . isTemporaryTableNeededToValidate ( change ) ; if ( tempNeeded ) { return true ; } } return false ; }
org . junit . Assert . assertTrue ( needed )
testRmLeftSide ( ) { org . antlr . v4 . runtime . misc . IntervalSet s = org . antlr . v4 . runtime . misc . IntervalSet . of ( 1 , 10 ) ; s . add ( ( - 3 ) , ( - 3 ) ) ; s . remove ( 1 ) ; java . lang . String expecting = "{-3,<sp>2..10}" ; java . lang . String result = s . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( a ) + ".." ) + ( b ) ; }
org . junit . Assert . assertEquals ( expecting , result )
containsTest ( ) { final com . conversantmedia . util . concurrent . ConcurrentStack < java . lang . Integer > iStack = new com . conversantmedia . util . concurrent . ConcurrentStack ( 128 ) ; for ( int i = 0 ; i < 128 ; i ++ ) { iStack . push ( i ) ; } for ( int i = 0 ; i < 128 ; i ++ ) { "<AssertPlaceHolder>" ; } } contains ( N ) { if ( n != null ) { for ( int i = 0 ; i < ( stackTop . get ( ) ) ; i ++ ) { if ( n . equals ( stack . get ( i ) ) ) return true ; } } return false ; }
org . junit . Assert . assertTrue ( iStack . contains ( i ) )
givenAMultiTypePropertyAttribute_whenResolve_thenAResolvedMultiTypePropertyViewAttributeShouldBeReturned ( ) { org . robobinding . viewattribute . property . MultiTypePropertyViewAttributeBinder viewAttributeBinder = org . mockito . Mockito . mock ( org . robobinding . viewattribute . property . MultiTypePropertyViewAttributeBinder . class ) ; org . robobinding . binder . ByBindingAttributeMappingsResolver byBindingAttributeMappingsResolver = newByBindingAttributeMappingsResolver ( org . robobinding . binder . MockInitializedBindingAttributeMappingsBuilder . aBindingAttributeMappings ( ) . withMultiTypePropertyAttribute ( "multiTypePropertyAttribute" , viewAttributeBinder ) . build ( ) ) ; java . util . Collection < org . robobinding . viewattribute . ViewAttributeBinder > viewAttributes = byBindingAttributeMappingsResolver . resolve ( pendingAttributesForView ) ; "<AssertPlaceHolder>" ; } newHashSet ( java . util . Iterator ) { java . util . HashSet < E > set = org . robobinding . util . Sets . newHashSet ( ) ; org . robobinding . util . Iterators . addAll ( set , elements ) ; return set ; }
org . junit . Assert . assertThat ( com . google . common . collect . Sets . newHashSet ( viewAttributes ) , org . hamcrest . CoreMatchers . equalTo ( com . google . common . collect . Sets . < org . robobinding . viewattribute . ViewAttributeBinder > newHashSet ( viewAttributeBinder ) ) )
testSiblingsWhenDataTypeHasParent ( ) { final org . kie . workbench . common . dmn . client . editors . types . common . DataType dataType = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; final org . kie . workbench . common . dmn . client . editors . types . common . DataType parent = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; final java . lang . String parentUUID = "parentUUID" ; final java . util . List < org . kie . workbench . common . dmn . client . editors . types . common . DataType > expectedSiblings = java . util . Collections . singletonList ( mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ) ; when ( dataType . getParentUUID ( ) ) . thenReturn ( parentUUID ) ; when ( parent . getSubDataTypes ( ) ) . thenReturn ( expectedSiblings ) ; when ( dataTypeStore . get ( parentUUID ) ) . thenReturn ( parent ) ; final java . util . List < org . kie . workbench . common . dmn . client . editors . types . common . DataType > actualSiblings = validator . siblings ( dataType ) ; "<AssertPlaceHolder>" ; } siblings ( org . kie . workbench . common . dmn . client . editors . types . common . DataType ) { final java . util . Optional < org . kie . workbench . common . dmn . client . editors . types . common . DataType > parent = java . util . Optional . ofNullable ( dataTypeStore . get ( dataType . getParentUUID ( ) ) ) ; if ( parent . isPresent ( ) ) { return parent . get ( ) . getSubDataTypes ( ) ; } else { return dataTypeStore . getTopLevelDataTypes ( ) ; } }
org . junit . Assert . assertEquals ( expectedSiblings , actualSiblings )
nodeTypeIndexDisabling_noop ( ) { builder . setProperty ( IndexConstants . DISABLE_INDEXES_ON_NEXT_CYCLE , true ) ; builder . setProperty ( IndexConstants . SUPERSEDED_INDEX_PATHS , asList ( "/oak:index/fooIndex/@bar" ) , Type . STRINGS ) ; refreshBuilder ( ) ; java . util . List < java . lang . String > disabledIndexes = disabler . disableOldIndexes ( "/oak:index/foo" , builder ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ) == 0 ; }
org . junit . Assert . assertTrue ( disabledIndexes . isEmpty ( ) )
testGetDriver ( ) { io . sniffy . Driver driver = io . sniffy . DriverManager . getDriver ( "sniffer:jdbc:h2:mem:" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( driver )
getAll ( ) { net . jforum . entities . BadWord w1 = new net . jforum . entities . BadWord ( ) ; w1 . setWord ( "w1" ) ; net . jforum . entities . BadWord w2 = new net . jforum . entities . BadWord ( ) ; w2 . setWord ( "w2" ) ; net . jforum . repository . BadWordRepository dao = this . newDao ( ) ; this . insert ( w1 , dao ) ; this . insert ( w2 , dao ) ; java . util . List < net . jforum . entities . BadWord > words = dao . getAll ( ) ; "<AssertPlaceHolder>" ; } getAll ( ) { return session . createCriteria ( this . persistClass ) . setCacheable ( true ) . setCacheRegion ( "avatarDAO" ) . setComment ( "avatarDAO.getAllAvatar" ) . list ( ) ; }
org . junit . Assert . assertEquals ( 2 , words . size ( ) )
testMultilineInfoBlock ( ) { org . apache . hadoop . yarn . webapp . test . WebAppTests . testBlock ( org . apache . hadoop . yarn . webapp . view . TestInfoBlock . MultilineInfoBlock . class ) ; org . apache . hadoop . yarn . webapp . view . TestInfoBlock . pw . flush ( ) ; java . lang . String output = org . apache . hadoop . yarn . webapp . view . TestInfoBlock . sw . toString ( ) . replaceAll ( "<sp>+" , "<sp>" ) ; java . lang . String expectedMultilineData1 = java . lang . String . format ( ( "<tr<sp>class=\"odd\">%n" + ( "<sp><th>%n<sp>Multiple_line_value%n<sp></th>%n" + "<sp><td>%n<sp>This<sp>is<sp>one<sp>line.%n<sp></td>%n" ) ) ) ; java . lang . String expectedMultilineData2 = java . lang . String . format ( ( "<tr<sp>class=\"even\">%n" + ( ( "<sp><th>%n<sp>Multiple_line_value%n<sp></th>%n<sp><td>%n<sp><div>%n" + "<sp>This<sp>is<sp>first<sp>line.%n<sp></div>%n<sp><div>%n" ) + "<sp>This<sp>is<sp>second<sp>line.%n<sp></div>%n" ) ) ) ; "<AssertPlaceHolder>" ; } contains ( java . util . List ) { for ( io . hops . metadata . hdfs . entity . INodeCandidatePrimaryKey pk : iNodeCandidatePKs ) { if ( ! ( contains ( pk . getInodeId ( ) ) ) ) { return false ; } } return true ; }
org . junit . Assert . assertTrue ( ( ( output . contains ( expectedMultilineData1 ) ) && ( output . contains ( expectedMultilineData2 ) ) ) )
test_Lang53 ( ) { if ( ! ( fr . inria . lille . repair . nopol . Defects4jUtils . testShouldBeRun ( ) ) ) { return ; } fr . inria . lille . repair . common . config . NopolContext nopolContext = fr . inria . lille . repair . nopol . Defects4jUtils . nopolConfigFor ( "Lang53" ) ; nopolContext . setComplianceLevel ( 4 ) ; fr . inria . lille . repair . nopol . NopolResult result = new fr . inria . lille . repair . nopol . NoPol ( nopolContext ) . build ( ) ; "<AssertPlaceHolder>" ; } getPatches ( ) { return patches ; }
org . junit . Assert . assertEquals ( 1 , result . getPatches ( ) . size ( ) )
testConcurrentWrites ( ) { int errCode = org . apache . hadoop . hbase . wal . WALPerformanceEvaluation . innerMain ( new org . apache . hadoop . conf . Configuration ( org . apache . hadoop . hbase . wal . TestFSHLogProvider . TEST_UTIL . getConfiguration ( ) ) , new java . lang . String [ ] { "-threads" , "3" , "-verify" , "-noclosefs" , "-iterations" , "3000" } ) ; "<AssertPlaceHolder>" ; } getConfiguration ( ) { return this . configuration ; }
org . junit . Assert . assertEquals ( 0 , errCode )
testMatchHdfsPolicy_NoResourceList ( ) { boolean bnlChk = rangerBizUtil . matchHbasePolicy ( resourceName , null , null , id , AppConstants . XA_PERM_TYPE_UNKNOWN ) ; "<AssertPlaceHolder>" ; } matchHbasePolicy ( java . lang . String , java . util . List , org . apache . ranger . view . VXResponse , java . lang . Long , int ) { if ( ( ( stringUtil . isEmpty ( resourceName ) ) || ( xResourceList == null ) ) || ( xUserId == null ) ) { return false ; } java . lang . String [ ] splittedResources = stringUtil . split ( resourceName , org . apache . ranger . biz . RangerBizUtil . fileSeparator ) ; if ( ( ( splittedResources . length ) < 1 ) || ( ( splittedResources . length ) > 3 ) ) { org . apache . ranger . biz . RangerBizUtil . logger . debug ( ( "Invalid<sp>resourceName<sp>name<sp>:<sp>" + resourceName ) ) ; return false ; } java . lang . String tblName = ( ( splittedResources . length ) > 0 ) ? splittedResources [ 0 ] : org . apache . ranger . common . StringUtil . WILDCARD_ASTERISK ; java . lang . String colFamName = ( ( splittedResources . length ) > 1 ) ? splittedResources [ 1 ] : org . apache . ranger . common . StringUtil . WILDCARD_ASTERISK ; java . lang . String colName = ( ( splittedResources . length ) > 2 ) ? splittedResources [ 2 ] : org . apache . ranger . common . StringUtil . WILDCARD_ASTERISK ; boolean policyMatched = false ; for ( org . apache . ranger . entity . XXResource xResource : xResourceList ) { if ( ( xResource . getResourceStatus ( ) ) != ( org . apache . ranger . common . AppConstants . STATUS_ENABLED ) ) { continue ; } java . lang . Long resourceId = xResource . getId ( ) ; boolean hasPermission = checkUsrPermForPolicy ( xUserId , permission , resourceId ) ; if ( ! hasPermission ) { continue ; } java . lang . String [ ] xTables = ( stringUtil . isEmpty ( xResource . getTables ( ) ) ) ? null : stringUtil . split ( xResource . getTables ( ) , "," ) ; boolean matchFound = ( ( xTables == null ) || ( ( xTables . length ) == 0 ) ) || ( matchPath ( tblName , xTables ) ) ; if ( matchFound ) { java . lang . String [ ] xColumnFamilies = ( stringUtil . isEmpty ( xResource . getColumnFamilies ( ) ) ) ? null : stringUtil . split ( xResource . getColumnFamilies ( ) , "," ) ; matchFound = ( ( xColumnFamilies == null ) || ( ( xColumnFamilies . length ) == 0 ) ) || ( matchPath ( colFamName , xColumnFamilies ) ) ; if ( matchFound ) { java . lang . String [ ] xColumns = ( stringUtil . isEmpty ( xResource . getColumns ( ) ) ) ? null : stringUtil . split ( xResource . getColumns ( ) , "," ) ; matchFound = ( ( xColumns == null ) || ( ( xColumns . length ) == 0 ) ) || ( matchPath ( colName , xColumns ) ) ; } } if ( matchFound ) { policyMatched = true ; break ; } } return policyMatched ; }
org . junit . Assert . assertFalse ( bnlChk )
invokeSendFail ( org . apache . servicecomb . swagger . invocation . exception . InvocationException ) { restProducerInvocation = new mockit . MockUp < org . apache . servicecomb . common . rest . RestProducerInvocation > ( ) { @ mockit . Mock void sendFailResponse ( java . lang . Throwable throwable ) { throwableOfSendFailResponse = throwable ; } @ mockit . Mock void findRestOperation ( ) { throw expected ; } @ mockit . Mock void scheduleInvocation ( ) { throw new java . lang . IllegalStateException ( "must<sp>not<sp>invoke<sp>scheduleInvocation" ) ; } } . getMockInstance ( ) ; restProducerInvocation . invoke ( transport , requestEx , responseEx , httpServerFilters ) ; "<AssertPlaceHolder>" ; } invoke ( org . apache . servicecomb . core . Transport , org . apache . servicecomb . foundation . vertx . http . HttpServletRequestEx , org . apache . servicecomb . foundation . vertx . http . HttpServletResponseEx , java . util . List ) { this . transport = transport ; this . requestEx = requestEx ; this . responseEx = responseEx ; this . httpServerFilters = httpServerFilters ; requestEx . setAttribute ( RestConst . REST_REQUEST , requestEx ) ; try { findRestOperation ( ) ; } catch ( org . apache . servicecomb . swagger . invocation . exception . InvocationException e ) { sendFailResponse ( e ) ; return ; } scheduleInvocation ( ) ; }
org . junit . Assert . assertSame ( expected , throwableOfSendFailResponse )
testClearWatchLeak ( ) { java . util . List < org . apache . hadoop . hbase . protobuf . generated . HBaseProtos . SnapshotDescription > snapshotDescriptions ; java . lang . String [ ] argsParam ; com . kakao . hbase . SnapshotArgs args ; com . kakao . hbase . snapshot . Snapshot app ; argsParam = new java . lang . String [ ] { "localhost" , ".*" , "--test" , "--clear-watch-leak" } ; args = new com . kakao . hbase . SnapshotArgs ( argsParam ) ; app = new com . kakao . hbase . snapshot . Snapshot ( admin , args ) ; app . run ( ) ; snapshotDescriptions = listSnapshots ( ( ( tableName ) + ".*" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , snapshotDescriptions . size ( ) )
test_getInt_on_BIGINT_thatFits_getsIt ( ) { final com . dremio . exec . vector . accessor . SqlAccessor uut = new com . dremio . jdbc . impl . TypeConvertingSqlAccessor ( new com . dremio . jdbc . impl . TypeConvertingSqlAccessorTest . BigIntStubAccessor ( 2147483647 ) ) ; "<AssertPlaceHolder>" ; } getInt ( int ) { final int result ; switch ( getType ( ) . getMinorType ( ) ) { case INT : result = innerAccessor . getInt ( rowOffset ) ; break ; case TINYINT : result = innerAccessor . getByte ( rowOffset ) ; break ; case SMALLINT : result = innerAccessor . getShort ( rowOffset ) ; break ; case BIGINT : result = com . dremio . jdbc . impl . TypeConvertingSqlAccessor . getIntValueOrThrow ( innerAccessor . getLong ( rowOffset ) , "Java<sp>long<sp>/<sp>SQL<sp>BIGINT" ) ; break ; case FLOAT4 : result = com . dremio . jdbc . impl . TypeConvertingSqlAccessor . getIntValueOrThrow ( innerAccessor . getFloat ( rowOffset ) , "Java<sp>float<sp>/<sp>SQL<sp>REAL/FLOAT" ) ; break ; case FLOAT8 : result = com . dremio . jdbc . impl . TypeConvertingSqlAccessor . getIntValueOrThrow ( innerAccessor . getDouble ( rowOffset ) , "Java<sp>double<sp>/<sp>SQL<sp>DOUBLE<sp>PRECISION" ) ; break ; default : result = innerAccessor . getInt ( rowOffset ) ; break ; } return result ; }
org . junit . Assert . assertThat ( uut . getInt ( 0 ) , org . hamcrest . CoreMatchers . equalTo ( 2147483647 ) )
equalsFalseWrongType ( ) { annis . model . TestDataObject . A a = new annis . model . TestDataObject . A ( annis . model . TestDataObject . S1 ) ; annis . model . TestDataObject . B b = new annis . model . TestDataObject . B ( annis . model . TestDataObject . S1 , annis . model . TestDataObject . C1 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final annis . dao . ResolverDaoHelper . RemoveIndexElement other = ( ( annis . dao . ResolverDaoHelper . RemoveIndexElement ) ( obj ) ) ; if ( ( this . namespace ) == null ? ( other . namespace ) != null : ! ( this . namespace . equals ( other . namespace ) ) ) { return false ; } if ( ( this . element ) != ( other . element ) ) { return false ; } if ( ( this . vis_type ) == null ? ( other . vis_type ) != null : ! ( this . vis_type . equals ( other . vis_type ) ) ) { return false ; } if ( ( this . display_name ) == null ? ( other . display_name ) != null : ! ( this . display_name . equals ( other . display_name ) ) ) { return false ; } return true ; }
org . junit . Assert . assertFalse ( a . equals ( b ) )
test_Filter4 ( ) { java . lang . String expected = "dcbabcd" ; java . lang . String actual ; org . osgi . framework . Bundle bundle = installBundle ( org . eclipse . equinox . http . servlet . tests . TEST_BUNDLE_1 ) ; try { bundle . start ( ) ; actual = requestAdvisor . request ( "TestFilter4/dcbabcd" ) ; } finally { uninstallBundle ( bundle ) ; } "<AssertPlaceHolder>" ; } uninstallBundle ( org . osgi . framework . Bundle ) { org . eclipse . equinox . internal . security . tests . storage . WaitingRegistryListener listener = new org . eclipse . equinox . internal . security . tests . storage . WaitingRegistryListener ( ) ; listener . register ( "org.eclipse.equinox.security.secureStorage" ) ; try { bundle . uninstall ( ) ; bundle = null ; org . junit . Assert . assertTrue ( ( ( listener . waitFor ( 1 , ( 10 * ( org . eclipse . equinox . internal . security . tests . storage . DynamicPreferencesTest . MAX_TIME_PER_BUNDLE ) ) ) ) == 1 ) ) ; return true ; } finally { listener . unregister ( ) ; if ( bundle != null ) bundle . uninstall ( ) ; } }
org . junit . Assert . assertEquals ( expected , actual )
testFillToHighMarkMulitpleBlocks ( ) { setup ( 258 ) ; list . fillTo ( 257 ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; }
org . junit . Assert . assertEquals ( 258 , list . size ( ) )
split_string_using_regular_expresion ( ) { java . util . List < java . lang . String > splitOnLetter = com . google . common . base . Splitter . onPattern ( "a|b" ) . splitToList ( "12312a31231b23123" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 3 , splitOnLetter . size ( ) )
testDomainMarkerIndices ( ) { org . jfree . data . xy . XYDataset dataset = new org . jfree . data . xy . XYSeriesCollection ( ) ; org . jfree . chart . axis . NumberAxis xAxis = new org . jfree . chart . axis . NumberAxis ( "X" ) ; org . jfree . chart . axis . NumberAxis yAxis = new org . jfree . chart . axis . NumberAxis ( "Y" ) ; org . jfree . chart . renderer . xy . XYItemRenderer renderer = new org . jfree . chart . renderer . xy . DefaultXYItemRenderer ( ) ; org . jfree . chart . plot . XYPlot plot = new org . jfree . chart . plot . XYPlot ( dataset , xAxis , yAxis , renderer ) ; org . jfree . data . xy . XYSeriesCollection dataset2 = new org . jfree . data . xy . XYSeriesCollection ( ) ; dataset2 . addSeries ( new org . jfree . data . xy . XYSeries ( "Series<sp>in<sp>dataset<sp>2" ) ) ; plot . setDataset ( 99 , dataset ) ; org . jfree . chart . axis . NumberAxis xAxis2 = new org . jfree . chart . axis . NumberAxis ( "X2" ) ; plot . setDomainAxis ( 1 , xAxis2 ) ; org . jfree . chart . renderer . xy . XYLineAndShapeRenderer renderer2 = new org . jfree . chart . renderer . xy . XYLineAndShapeRenderer ( ) ; plot . setRenderer ( 99 , renderer2 ) ; plot . mapDatasetToDomainAxis ( 99 , 1 ) ; org . jfree . chart . plot . ValueMarker xMarker1 = new org . jfree . chart . plot . ValueMarker ( 123 ) ; plot . addDomainMarker ( 99 , xMarker1 , Layer . FOREGROUND ) ; "<AssertPlaceHolder>" ; } getDomainMarkers ( int , org . jfree . ui . Layer ) { java . util . Collection result = null ; java . lang . Integer key = new java . lang . Integer ( index ) ; if ( layer == ( org . jfree . ui . Layer . FOREGROUND ) ) { result = ( ( java . util . Collection ) ( this . foregroundDomainMarkers . get ( key ) ) ) ; } else if ( layer == ( org . jfree . ui . Layer . BACKGROUND ) ) { result = ( ( java . util . Collection ) ( this . backgroundDomainMarkers . get ( key ) ) ) ; } if ( result != null ) { result = java . util . Collections . unmodifiableCollection ( result ) ; } return result ; }
org . junit . Assert . assertTrue ( plot . getDomainMarkers ( 99 , Layer . FOREGROUND ) . contains ( xMarker1 ) )
testGetTimeoutTimeOtherThread ( ) { final java . util . concurrent . atomic . AtomicReference < java . lang . RuntimeException > exception = new java . util . concurrent . atomic . AtomicReference < java . lang . RuntimeException > ( null ) ; final long time = txn . getTimeout ( ) ; java . lang . Thread thread = new java . lang . Thread ( ) { public void run ( ) { try { long t = txn . getTimeout ( ) ; if ( time != t ) { throw new java . lang . RuntimeException ( ( ( ( "Expected<sp>" + time ) + ",<sp>got<sp>" ) + t ) ) ; } } catch ( java . lang . RuntimeException e ) { e . printStackTrace ( ) ; exception . set ( e ) ; } } } ; thread . start ( ) ; thread . join ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return object ; }
org . junit . Assert . assertSame ( null , exception . get ( ) )
testCleanLast_byteArr_int ( ) { java . io . File tablefile = new java . io . File ( java . lang . System . getProperty ( "java.io.tmpdir" ) , "test1.stack" ) ; byte [ ] b = net . yacy . cora . document . encoding . ASCII . getBytes ( "testDataString" ) ; net . yacy . kelondro . io . Records rec = new net . yacy . kelondro . io . Records ( tablefile , b . length ) ; try { rec . add ( b , 0 ) ; for ( int i = 0 ; i < 5 ; i ++ ) { rec . cleanLast ( b , 0 ) ; } "<AssertPlaceHolder>" ; } finally { rec . close ( ) ; } } size ( ) { return elt ; }
org . junit . Assert . assertEquals ( 0 , rec . size ( ) )
testByteArrayStorage ( ) { final java . lang . String KEY_Z = "z" ; byte [ ] data = "data" . getBytes ( StandardCharsets . UTF_8 ) ; java . io . ByteArrayOutputStream bout = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream oo = new java . io . ObjectOutputStream ( bout ) ; oo . writeObject ( data ) ; oo . flush ( ) ; byte [ ] serializedData = bout . toByteArray ( ) ; rest . put ( rest . fullPathKey ( 0 , KEY_Z ) , serializedData , MediaType . APPLICATION_OCTET_STREAM_TYPE ) ; org . apache . http . HttpResponse resp = rest . get ( rest . fullPathKey ( 0 , KEY_Z ) , null , HttpStatus . SC_OK , false , "Accept" , org . infinispan . server . test . client . rest . APPLICATION_OCTET_STREAM_TYPE ) ; java . io . ObjectInputStream oin = new java . io . ObjectInputStream ( resp . getEntity ( ) . getContent ( ) ) ; byte [ ] dataBack = ( ( byte [ ] ) ( oin . readObject ( ) ) ) ; org . apache . http . util . EntityUtils . consume ( resp . getEntity ( ) ) ; "<AssertPlaceHolder>" ; } equals ( byte [ ] , java . lang . Object ) { return delegate . equals ( obj , otherObj ) ; }
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( data , dataBack ) )
toJsonForSymmetricKeySecuredDevice ( ) { tests . unit . com . microsoft . azure . sdk . iot . deps . serializer . DeviceParser parser = new tests . unit . com . microsoft . azure . sdk . iot . deps . serializer . DeviceParser ( ) ; parser . setAuthenticationParser ( new tests . unit . com . microsoft . azure . sdk . iot . deps . serializer . AuthenticationParser ( ) ) ; parser . getAuthenticationParser ( ) . setType ( AuthenticationTypeParser . SAS ) ; java . lang . String sampleKey = "000000000000000000000000" ; parser . getAuthenticationParser ( ) . setSymmetricKey ( new tests . unit . com . microsoft . azure . sdk . iot . deps . serializer . SymmetricKeyParser ( sampleKey , sampleKey ) ) ; java . lang . String symmetricKeySecuredDeviceAuthenticationJson = ( "\"type\":\"" + ( tests . unit . com . microsoft . azure . sdk . iot . deps . serializer . DeviceParserTest . SAS_JSON_VALUE ) ) + "\"" ; java . lang . String serializedDevice = parser . toJson ( ) ; "<AssertPlaceHolder>" ; } toJson ( ) { com . google . gson . Gson gson = new com . google . gson . GsonBuilder ( ) . disableHtmlEscaping ( ) . create ( ) ; return gson . toJson ( this ) ; }
org . junit . Assert . assertTrue ( serializedDevice . contains ( symmetricKeySecuredDeviceAuthenticationJson ) )
shouldStartOnZeroFloor ( ) { int floor = elevator . currentFloor ( ) ; "<AssertPlaceHolder>" ; } currentFloor ( ) { return currentFloor ; }
org . junit . Assert . assertEquals ( 0 , floor )
testFromExistingBuilder ( ) { final org . apache . oozie . fluentjob . api . action . ActionAttributesBuilder builder = getBuilderInstance ( ) ; builder . withNameNode ( org . apache . oozie . fluentjob . api . action . TestActionAttributesBuilder . NAME_NODE ) ; final org . apache . oozie . fluentjob . api . action . ActionAttributes fromExisting = org . apache . oozie . fluentjob . api . action . ActionAttributesBuilder . createFromExisting ( builder . build ( ) ) . build ( ) ; "<AssertPlaceHolder>" ; } getNameNode ( ) { return attributes . getNameNode ( ) ; }
org . junit . Assert . assertEquals ( org . apache . oozie . fluentjob . api . action . TestActionAttributesBuilder . NAME_NODE , fromExisting . getNameNode ( ) )
testNoAttributes ( ) { createUserTable ( ) ; insertUser ( "plainUser" , "plainPassword" , "John" , "Smith" , "jsmith@elytron.org" ) ; org . wildfly . security . auth . realm . jdbc . mapper . PasswordKeyMapper passwordKeyMapper = org . wildfly . security . auth . realm . jdbc . mapper . PasswordKeyMapper . builder ( ) . setDefaultAlgorithm ( ClearPassword . ALGORITHM_CLEAR ) . setHashColumn ( 1 ) . build ( ) ; org . wildfly . security . auth . realm . jdbc . JdbcSecurityRealm securityRealm = org . wildfly . security . auth . realm . jdbc . JdbcSecurityRealm . builder ( ) . principalQuery ( "SELECT<sp>password,<sp>firstName,<sp>lastName,<sp>email<sp>FROM<sp>user_table<sp>WHERE<sp>name<sp>=<sp>?" ) . withMapper ( passwordKeyMapper ) . from ( getDataSource ( ) ) . build ( ) ; org . wildfly . security . auth . server . RealmIdentity plainUser = securityRealm . getRealmIdentity ( new org . wildfly . security . auth . principal . NamePrincipal ( "plainUser" ) ) ; org . wildfly . security . authz . AuthorizationIdentity authorizationIdentity = plainUser . getAuthorizationIdentity ( ) ; org . wildfly . security . authz . Attributes attributes = authorizationIdentity . getAttributes ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ! ( attributes . containsKey ( key ) ) ; }
org . junit . Assert . assertTrue ( attributes . isEmpty ( ) )
testRt ( ) { io . craft . atom . rpc . api . RpcContext . getContext ( ) . setRpcTimeoutInMillis ( 5000 ) ; ds . echo ( "hi" ) ; long s = java . lang . System . nanoTime ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { ds . echo ( "hi" ) ; } long e = java . lang . System . nanoTime ( ) ; long rrt = e - s ; ds = new io . craft . atom . rpc . DemoServiceImpl1 ( ) ; s = java . lang . System . nanoTime ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { ds . echo ( "hi" ) ; } e = java . lang . System . nanoTime ( ) ; long lrt = e - s ; "<AssertPlaceHolder>" ; System . out . println ( java . lang . String . format ( "[CRAFT-ATOM-NIO]<sp>(^_^)<sp><%s><sp>Case<sp>-><sp>test<sp>rt<sp>|local=%s,<sp>remote=%s|<sp>ns.<sp>" , io . craft . atom . test . CaseCounter . incr ( 1 ) , lrt , rrt ) ) ; } echo ( java . lang . String ) { return master ( ) . echo ( message ) ; }
org . junit . Assert . assertTrue ( ( rrt > lrt ) )
verifyMaxClusterSizeIsSameAsNumberOfServers ( ) { oracle . kubernetes . operator . wlsconfig . WlsClusterConfig wlsClusterConfig = new oracle . kubernetes . operator . wlsconfig . WlsClusterConfig ( "cluster1" ) ; wlsClusterConfig . addServerConfig ( createWlsServerConfig ( "ms-0" , null , null ) ) ; wlsClusterConfig . addServerConfig ( createWlsServerConfig ( "ms-1" , 8011 , null ) ) ; "<AssertPlaceHolder>" ; } getMaxClusterSize ( ) { return hasDynamicServers ( ) ? ( getClusterSize ( ) ) + ( getMaxDynamicClusterSize ( ) ) : getClusterSize ( ) ; }
org . junit . Assert . assertEquals ( 2 , wlsClusterConfig . getMaxClusterSize ( ) )
testConfigHasNoErrors ( ) { org . apache . flume . conf . FlumeConfiguration configuration = new org . apache . flume . conf . FlumeConfiguration ( org . apache . flume . conf . TestAgentConfiguration . PROPERTIES ) ; "<AssertPlaceHolder>" ; } getConfigurationErrors ( ) { return errors ; }
org . junit . Assert . assertTrue ( configuration . getConfigurationErrors ( ) . isEmpty ( ) )
testCreationAndReopen ( ) { com . puresoltechnologies . ductiledb . storage . spi . StorageConfiguration configuration = com . puresoltechnologies . ductiledb . logstore . LogStructuredStoreTestUtils . createStorageConfiguration ( ) ; com . puresoltechnologies . ductiledb . storage . spi . Storage storage = com . puresoltechnologies . ductiledb . storage . api . StorageFactory . getStorageInstance ( configuration ) ; java . io . File directory = new java . io . File ( ( ( "/" + ( com . puresoltechnologies . ductiledb . engine . NamespaceCreateAndReopenIT . class . getSimpleName ( ) ) ) + ".testCreationAndReopen" ) ) ; if ( storage . exists ( directory ) ) { storage . removeDirectory ( directory , true ) ; } com . puresoltechnologies . ductiledb . engine . NamespaceDescriptor namespaceDescriptor = new com . puresoltechnologies . ductiledb . engine . NamespaceDescriptor ( directory ) ; try ( com . puresoltechnologies . ductiledb . engine . Namespace namespace = com . puresoltechnologies . ductiledb . engine . Namespace . create ( storage , namespaceDescriptor , new com . puresoltechnologies . ductiledb . bigtable . BigTableConfiguration ( ) ) ) { namespace . addTable ( "table" , "description" ) ; } try ( com . puresoltechnologies . ductiledb . engine . Namespace namespace = com . puresoltechnologies . ductiledb . engine . Namespace . reopen ( storage , directory ) ) { "<AssertPlaceHolder>" ; } } hasTable ( java . lang . String ) { return tableEngines . containsKey ( name ) ; }
org . junit . Assert . assertTrue ( namespace . hasTable ( "table" ) )
getWidth ( ) { int pos = 10 ; dw . setWidth ( pos ) ; "<AssertPlaceHolder>" ; } getWidth ( ) { return width ; }
org . junit . Assert . assertEquals ( pos , dw . getWidth ( ) , 0 )
xml ( ) { org . springframework . context . support . GenericXmlApplicationContext ctx = new org . springframework . context . support . GenericXmlApplicationContext ( ) ; ctx . load ( "classpath:module.xml" ) ; ctx . refresh ( ) ; org . springframework . issues . Foo foo = ctx . getBean ( org . springframework . issues . Foo . class ) ; "<AssertPlaceHolder>" ; ctx . close ( ) ; } load ( java . lang . String ) { try { java . io . InputStream fxmlStream = org . springframework . issues . javafx . SpringFxmlLoader . class . getResourceAsStream ( url ) ; System . err . println ( org . springframework . issues . javafx . SpringFxmlLoader . class . getResourceAsStream ( url ) ) ; javafx . fxml . FXMLLoader loader = new javafx . fxml . FXMLLoader ( ) ; loader . setControllerFactory ( new javafx . util . Callback < java . lang . Class < ? > , java . lang . Object > ( ) { @ org . springframework . issues . javafx . Override public java . lang . Object call ( java . lang . Class < ? > clazz ) { return org . springframework . issues . javafx . SpringFxmlLoader . applicationContext . getBean ( clazz ) ; } } ) ; return loader . load ( fxmlStream ) ; } catch ( java . io . IOException ioException ) { throw new java . lang . RuntimeException ( ioException ) ; } }
org . junit . Assert . assertNotNull ( foo )
wrapOnce ( ) { org . apache . http . conn . ClientConnectionRequest wrapped = com . amazonaws . http . conn . ClientConnectionRequestFactory . wrap ( noop ) ; "<AssertPlaceHolder>" ; } wrap ( org . apache . http . conn . ClientConnectionRequest ) { if ( orig instanceof com . amazonaws . http . conn . Wrapped ) throw new java . lang . IllegalArgumentException ( ) ; return ( ( org . apache . http . conn . ClientConnectionRequest ) ( java . lang . reflect . Proxy . newProxyInstance ( com . amazonaws . http . conn . ClientConnectionRequestFactory . class . getClassLoader ( ) , com . amazonaws . http . conn . ClientConnectionRequestFactory . INTERFACES , new com . amazonaws . http . conn . ClientConnectionRequestFactory . Handler ( orig ) ) ) ) ; }
org . junit . Assert . assertTrue ( ( wrapped instanceof com . amazonaws . http . conn . Wrapped ) )
testExecutdAsPlanned ( ) { "<AssertPlaceHolder>" ; } executedAsPlanned ( ) { return isExecuted ( ) ; }
org . junit . Assert . assertFalse ( action . executedAsPlanned ( ) )
testQuietPeriodMillis ( ) { heapDump . setEnabled ( true ) ; heapDump . setCurrentHeaps ( 0 ) ; heapDump . setMaxHeaps ( 1 ) ; heapDump . lastDumpMillis = 1 ; "<AssertPlaceHolder>" ; } createDumpIfAppropriate ( long ) { if ( ! ( isEnabled ( ) ) ) { return false ; } synchronized ( this ) { if ( ( maxHeaps ) <= ( currentHeaps ) ) { return false ; } if ( ( currentTimeMillis - ( lastDumpMillis ) ) < ( quietPeriodMillis ) ) { return false ; } currentHeaps += 1 ; lastDumpMillis = currentTimeMillis ; } try { createHeapDump ( ) ; return true ; } catch ( java . lang . Exception e ) { com . j_spaces . core . HeapDump . logger . log ( Level . WARNING , ( ( ( "Cmd<sp>" + ( java . util . Arrays . asList ( cmd ) ) ) + "<sp>throws:<sp>" ) + e ) , e ) ; } return false ; }
org . junit . Assert . assertThat ( heapDump . createDumpIfAppropriate ( 1 ) , org . hamcrest . core . Is . is ( false ) )
testCreateWithDuplicateClientIdFails ( ) { org . apache . qpid . jms . JmsConnectionFactory factory = new org . apache . qpid . jms . JmsConnectionFactory ( getBrokerAmqpConnectionURI ( ) ) ; org . apache . qpid . jms . JmsConnection connection1 = ( ( org . apache . qpid . jms . JmsConnection ) ( factory . createConnection ( ) ) ) ; connection1 . setClientID ( "Test" ) ; "<AssertPlaceHolder>" ; connection1 . start ( ) ; org . apache . qpid . jms . JmsConnection connection2 = ( ( org . apache . qpid . jms . JmsConnection ) ( factory . createConnection ( ) ) ) ; try { connection2 . setClientID ( "Test" ) ; org . junit . Assert . fail ( "should<sp>have<sp>thrown<sp>a<sp>JMSException" ) ; } catch ( javax . jms . InvalidClientIDException ex ) { org . apache . qpid . jms . LOG . info ( "Remote<sp>threw<sp>ex:<sp>{}" , ex ) ; } catch ( java . lang . Exception unexpected ) { org . junit . Assert . fail ( ( "Wrong<sp>exception<sp>type<sp>thrown:<sp>" + unexpected ) ) ; } connection1 . close ( ) ; connection2 . close ( ) ; } setClientID ( java . lang . String ) { try { connection . setClientID ( clientID ) ; } catch ( javax . jms . JMSException jmse ) { throw org . apache . qpid . jms . exceptions . JmsExceptionSupport . createRuntimeException ( jmse ) ; } }
org . junit . Assert . assertNotNull ( connection1 )
lastsave ( ) { java . util . Date start = new java . util . Date ( ( ( java . lang . System . currentTimeMillis ( ) ) / 1000 ) ) ; "<AssertPlaceHolder>" ; } lastsave ( ) { java . util . Date start = new java . util . Date ( ( ( java . lang . System . currentTimeMillis ( ) ) / 1000 ) ) ; org . junit . Assert . assertTrue ( ( ( start . compareTo ( redis . lastsave ( ) ) ) <= 0 ) ) ; }
org . junit . Assert . assertTrue ( ( ( start . compareTo ( redis . lastsave ( ) ) ) <= 0 ) )
executeProcessWithNotInitializedData ( ) { final org . bonitasoft . engine . bpm . process . impl . ProcessDefinitionBuilder processDefinitionBuilder = new org . bonitasoft . engine . bpm . process . impl . ProcessDefinitionBuilder ( ) . createNewInstance ( org . bonitasoft . engine . process . data . PROCESS_NAME , org . bonitasoft . engine . process . data . PROCESS_VERSION ) ; processDefinitionBuilder . addAutomaticTask ( "step1" ) ; processDefinitionBuilder . addIntegerData ( "intdata" , null ) ; processDefinitionBuilder . addShortTextData ( "stringData" , null ) ; processDefinitionBuilder . addDateData ( "stringData" 1 , null ) ; processDefinitionBuilder . addBlobData ( "blobData" , null ) ; processDefinitionBuilder . addBooleanData ( "booleanData" , null ) ; processDefinitionBuilder . addLongData ( "longData" , null ) ; processDefinitionBuilder . addDoubleData ( "stringData" 0 , null ) ; processDefinitionBuilder . addFloatData ( "floatData" , null ) ; processDefinitionBuilder . addXMLData ( "xmlData" , null ) ; processDefinitionBuilder . addData ( "javaData" , "java.util.List" , null ) ; final org . bonitasoft . engine . bpm . process . DesignProcessDefinition designProcessDefinition = processDefinitionBuilder . done ( ) ; final org . bonitasoft . engine . bpm . process . ProcessDefinition processDefinition = deployAndEnableProcess ( designProcessDefinition ) ; final java . util . List < org . bonitasoft . engine . bpm . data . DataDefinition > dataDefList = getProcessAPI ( ) . getProcessDataDefinitions ( processDefinition . getId ( ) , 0 , 15 ) ; "<AssertPlaceHolder>" ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance = getProcessAPI ( ) . startProcess ( processDefinition . getId ( ) ) ; waitForProcessToFinish ( processInstance ) ; disableAndDeleteProcess ( processDefinition ) ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( 10 , dataDefList . size ( ) )
testDdl_TYPE_BINARY_2 ( ) { java . lang . String ddl = ( "CREATE<sp>FOREIGN<sp>TABLE<sp>ONE_TYPE<sp>(" + ( org . teiid . designer . vdb . dynamic . TestModelToDdlGenerator . BQT2_TYPE_DDL . TYPE_BINARY_2 ) ) + ")<sp>OPTIONS(UPDATABLE<sp>'TRUE');" ; java . lang . String expectedDdl = ( "CREATE<sp>FOREIGN<sp>TABLE<sp>ONE_TYPE<sp>(" + ( org . teiid . designer . vdb . dynamic . TestModelToDdlGenerator . EXPECTED_BQT2_TYPE_DDL . TYPE_BINARY_2 ) ) + ")<sp>OPTIONS(UPDATABLE<sp>'TRUE');" ; java . lang . String generatedDdl = roundTrip ( ddl , false ) ; "<AssertPlaceHolder>" ; } roundTrip ( java . lang . String , boolean ) { org . teiid . designer . core . workspace . ModelResource modelResource = createModelResource ( ddl , isVirtual ) ; java . lang . String generatedDdl = generator . generate ( modelResource ) ; generatedDdl = removeWhitespace ( generatedDdl ) ; return generatedDdl ; }
org . junit . Assert . assertEquals ( expectedDdl , generatedDdl )
testSimple ( ) { java . util . Set < org . apache . fluo . api . data . Bytes > splits = java . util . stream . IntStream . iterate ( 0 , ( i ) -> i + 13 ) . limit ( 1000 ) . mapToObj ( ( i ) -> java . lang . String . format ( "%08x" , i ) ) . map ( Bytes :: of ) . collect ( toSet ( ) ) ; byte [ ] data = org . apache . fluo . core . worker . finder . hash . SerializedSplits . serialize ( splits ) ; java . util . HashSet < org . apache . fluo . api . data . Bytes > splits2 = new java . util . HashSet ( ) ; org . apache . fluo . core . worker . finder . hash . SerializedSplits . deserialize ( splits2 :: add , data ) ; "<AssertPlaceHolder>" ; } deserialize ( java . util . function . Consumer , byte [ ] ) { try { java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( serializedSplits ) ; java . util . zip . GZIPInputStream gzis = new java . util . zip . GZIPInputStream ( bais ) ; java . io . DataInputStream dis = new java . io . DataInputStream ( gzis ) ; int numSplits = dis . readInt ( ) ; org . apache . fluo . api . data . Bytes . BytesBuilder builder = org . apache . fluo . api . data . Bytes . builder ( ) ; for ( int i = 0 ; i < numSplits ; i ++ ) { int len = dis . readInt ( ) ; builder . setLength ( 0 ) ; builder . append ( dis , len ) ; splitConsumer . accept ( builder . toBytes ( ) ) ; } } catch ( java . io . IOException e ) { throw new java . io . UncheckedIOException ( e ) ; } }
org . junit . Assert . assertEquals ( splits , splits2 )
testAnnotateCreateAndLoad ( ) { org . opencb . opencga . storage . core . variant . dummy . DummyVariantDBAdaptor dbAdaptor = mockVariantDBAdaptor ( ) ; java . util . List < org . opencb . opencga . core . models . File > files = annotate ( new org . opencb . commons . datastore . core . Query ( ) , new org . opencb . commons . datastore . core . QueryOptions ( org . opencb . opencga . storage . core . variant . annotation . VariantAnnotationManager . CREATE , true ) ) ; verify ( dbAdaptor , atLeastOnce ( ) ) . iterator ( any ( org . opencb . commons . datastore . core . Query . class ) , any ( ) ) ; verify ( dbAdaptor , never ( ) ) . updateAnnotations ( any ( ) , anyLong ( ) , any ( ) ) ; verify ( dbAdaptor , never ( ) ) . updateCustomAnnotations ( any ( ) , any ( ) , any ( ) , anyLong ( ) , any ( ) ) ; "<AssertPlaceHolder>" ; checkAnnotation ( ( v ) -> false ) ; org . opencb . commons . datastore . core . QueryOptions config = new org . opencb . commons . datastore . core . QueryOptions ( org . opencb . opencga . storage . core . variant . annotation . VariantAnnotationManager . LOAD_FILE , files . get ( 0 ) . getId ( ) ) ; dbAdaptor = mockVariantDBAdaptor ( ) ; annotate ( new org . opencb . commons . datastore . core . Query ( ) , config ) ; verify ( dbAdaptor , atLeastOnce ( ) ) . updateAnnotations ( any ( ) , anyLong ( ) , any ( ) ) ; verify ( dbAdaptor , never ( ) ) . updateCustomAnnotations ( any ( ) , any ( ) , any ( ) , anyLong ( ) , any ( ) ) ; verify ( dbAdaptor , never ( ) ) . iterator ( any ( org . opencb . commons . datastore . core . Query . class ) , any ( ) ) ; checkAnnotation ( ( v ) -> true ) ; } size ( ) { return size ; }
org . junit . Assert . assertEquals ( 1 , files . size ( ) )
testRefereesClass ( ) { System . out . println ( "referees-class" ) ; java . lang . String query = "select<sp>referees(heap.findClass(\"java.io.File\"))" ; long [ ] refereesTest = new long [ ] { 1684106928 , 1684106888 , 1684106848 , 1684106408 } ; final java . util . List < java . lang . Long > referees = new java . util . ArrayList < java . lang . Long > ( ) ; instance . executeQuery ( query , new org . graalvm . visualvm . lib . profiler . oql . engine . api . OQLEngine . ObjectVisitor ( ) { public boolean visit ( java . lang . Object o ) { referees . add ( ( ( org . graalvm . visualvm . lib . jfluid . heap . Instance ) ( o ) ) . getInstanceId ( ) ) ; return false ; } } ) ; "<AssertPlaceHolder>" ; for ( long referee : refereesTest ) { if ( ! ( referees . contains ( referee ) ) ) org . junit . Assert . fail ( ) ; } } size ( ) { return size ; }
org . junit . Assert . assertEquals ( refereesTest . length , referees . size ( ) )
shouldWin_whenNoMoreMines ( ) { placeMineUpFromSapper ( ) ; board . useMineDetectorToGivenDirection ( Direction . UP ) ; "<AssertPlaceHolder>" ; } isWin ( ) { return name . equals ( com . codenjoy . dojo . reversi . services . Events . WIN ) ; }
org . junit . Assert . assertTrue ( board . isWin ( ) )