input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testSingletonAnnotationResultsInCacheProperty ( ) { com . picocontainer . MutablePicoContainer mpc = new com . picocontainer . containers . JSR330PicoContainer ( ) . addComponent ( com . picocontainer . containers . JSR330PicoContainerTestCase . TestSingletonAnnotation . class ) ; "<AssertPlaceHolder>" ; } getComponent ( com . googlecode . jtype . Generic ) { return null ; } | org . junit . Assert . assertSame ( mpc . getComponent ( com . picocontainer . containers . JSR330PicoContainerTestCase . TestSingletonAnnotation . class ) , mpc . getComponent ( com . picocontainer . containers . JSR330PicoContainerTestCase . TestSingletonAnnotation . class ) ) |
getStatementByShortName ( ) { org . apache . ibatis . session . Configuration configuration = getConfiguration ( ) ; org . apache . ibatis . mapping . MappedStatement selectPet = configuration . getMappedStatement ( "selectPet" ) ; "<AssertPlaceHolder>" ; } getMappedStatement ( java . lang . String ) { return this . getMappedStatement ( id , true ) ; } | org . junit . Assert . assertNotNull ( selectPet ) |
testScanFilterAndTrue ( ) { final org . apache . calcite . tools . RelBuilder builder = org . apache . calcite . tools . RelBuilder . create ( org . apache . calcite . test . RelBuilderTest . config ( ) . build ( ) ) ; org . apache . calcite . rel . RelNode root = builder . scan ( "EMP" ) . filter ( builder . call ( SqlStdOperatorTable . GREATER_THAN , builder . field ( "DEPTNO" ) , builder . literal ( 20 ) ) , builder . literal ( true ) ) . build ( ) ; final java . lang . String expected = "LogicalFilter(condition=[>($7,<sp>20)])\n" + "<sp>LogicalTableScan(table=[[scott,<sp>EMP]])\n" ; "<AssertPlaceHolder>" ; } hasTree ( java . lang . String ) { return org . apache . calcite . test . Matchers . compose ( org . hamcrest . core . Is . is ( value ) , ( input ) -> { return org . apache . calcite . util . Util . toLinux ( org . apache . calcite . plan . RelOptUtil . toString ( input ) ) ; } ) ; } | org . junit . Assert . assertThat ( root , org . apache . calcite . test . Matchers . hasTree ( expected ) ) |
testDelegateIsAccessible ( ) { com . picocontainer . behaviors . AbstractBehavior . AbstractChangedBehavior componentAdapter = ( ( com . picocontainer . behaviors . AbstractBehavior . AbstractChangedBehavior ) ( createComponentFactory ( ) . createComponentAdapter ( new com . picocontainer . monitors . NullComponentMonitor ( ) , new com . picocontainer . lifecycle . NullLifecycleStrategy ( ) , new java . util . Properties ( com . picocontainer . Characteristics . CDI ) , com . picocontainer . testmodel . Touchable . class , com . picocontainer . testmodel . SimpleTouchable . class , null , null , null ) ) ) ; "<AssertPlaceHolder>" ; } getDelegate ( ) { return realComponentAdapter . getDelegate ( ) ; } | org . junit . Assert . assertNotNull ( componentAdapter . getDelegate ( ) ) |
testFormatCount ( ) { "<AssertPlaceHolder>" ; } formatCount ( ) { if ( ( org . openscience . cdk . io . WriterFactory . formats ) == null ) loadFormats ( ) ; return org . openscience . cdk . io . WriterFactory . formats . size ( ) ; } | org . junit . Assert . assertTrue ( ( ( factory . formatCount ( ) ) > 0 ) ) |
testPolicyCtorByteArray ( ) { byte [ ] testInput = "this<sp>is<sp>a<sp>test" . getBytes ( org . hyperledger . fabric . sdk . UTF_8 ) ; org . hyperledger . fabric . sdk . ChaincodeEndorsementPolicy fakePolicy = new org . hyperledger . fabric . sdk . ChaincodeEndorsementPolicy ( ) ; fakePolicy . fromBytes ( testInput ) ; "<AssertPlaceHolder>" ; } getChaincodeEndorsementPolicyAsBytes ( ) { return policyBytes ; } | org . junit . Assert . assertEquals ( fakePolicy . getChaincodeEndorsementPolicyAsBytes ( ) , testInput ) |
testConnection ( ) { org . eclipse . birt . report . data . oda . jdbc . Connection conn = new org . eclipse . birt . report . data . oda . jdbc . Connection ( ) ; "<AssertPlaceHolder>" ; } isOpen ( ) { return isOpen ; } | org . junit . Assert . assertFalse ( conn . isOpen ( ) ) |
testVarAndArgs_Disabled ( ) { final java . lang . String cfcSrc = "<cfcomponent>\r\n" + ( ( ( ( ( "<cffunction<sp>name=\"test\">\r\n" + "<sp>" ) + "<!---CFLINT-DISABLE<sp>ARG_DEFAULT_MISSING<sp>--->" ) + "<cfargument<sp>name=\"xyz\">\r\n" ) + "</cffunction>\r\n" ) + "</cfcomponent>" ) ; com . cflint . api . CFLintResult lintresult = cfBugs . scan ( cfcSrc , "test" ) ; final java . util . Map < java . lang . String , java . util . List < com . cflint . BugInfo > > result = lintresult . getIssues ( ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( final java . util . List < ? > list : bugs . values ( ) ) { size += list . size ( ) ; } return size ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
shouldBuildGlobalTableWithQueryaIbleStoreName ( ) { final org . apache . kafka . streams . kstream . internals . MaterializedInternal < java . lang . String , java . lang . String , org . apache . kafka . streams . state . KeyValueStore < org . apache . kafka . common . utils . Bytes , byte [ ] > > materializedInternal = new org . apache . kafka . streams . kstream . internals . MaterializedInternal ( org . apache . kafka . streams . kstream . Materialized . as ( "globalTable" ) , builder , storePrefix ) ; final org . apache . kafka . streams . kstream . GlobalKTable < java . lang . String , java . lang . String > table1 = builder . globalTable ( "topic2" , consumed , materializedInternal ) ; "<AssertPlaceHolder>" ; } queryableStoreName ( ) { return queriable ? storeName ( ) : null ; } | org . junit . Assert . assertEquals ( "globalTable" , table1 . queryableStoreName ( ) ) |
getOrNull_A$ ( ) { com . m3 . scalaflavor4j . None < java . lang . Object > none = new com . m3 . scalaflavor4j . None < java . lang . Object > ( ) ; java . lang . Object actual = none . getOrNull ( ) ; java . lang . Object expected = null ; "<AssertPlaceHolder>" ; } getOrNull ( ) { return null ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) ) |
testExtraConfig ( ) { java . lang . String key = "test.extra.config" ; java . lang . String oldValue = "old<sp>value" ; java . lang . String newValue = "new<sp>value" ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . set ( ( ( org . apache . hadoop . tracing . TestTraceUtils . TEST_PREFIX ) + key ) , oldValue ) ; java . util . LinkedList < org . apache . hadoop . tracing . SpanReceiverInfo . ConfigurationPair > extraConfig = new java . util . LinkedList < org . apache . hadoop . tracing . SpanReceiverInfo . ConfigurationPair > ( ) ; extraConfig . add ( new org . apache . hadoop . tracing . SpanReceiverInfo . ConfigurationPair ( ( ( org . apache . hadoop . tracing . TestTraceUtils . TEST_PREFIX ) + key ) , newValue ) ) ; org . apache . htrace . core . HTraceConfiguration wrapped = org . apache . hadoop . tracing . TraceUtils . wrapHadoopConf ( org . apache . hadoop . tracing . TestTraceUtils . TEST_PREFIX , conf , extraConfig ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Class ) { verifyDriverReady ( ) ; long start = monotonicNow ( ) ; java . util . List < T > ret = new java . util . ArrayList ( ) ; java . lang . String znode = getZNodeForClass ( clazz ) ; try { java . util . List < java . lang . String > children = zkManager . getChildren ( znode ) ; for ( java . lang . String child : children ) { try { java . lang . String path = getNodePath ( znode , child ) ; org . apache . zookeeper . data . Stat stat = new org . apache . zookeeper . data . Stat ( ) ; java . lang . String data = zkManager . getStringData ( path , stat ) ; boolean corrupted = false ; if ( ( data == null ) || ( data . equals ( "" ) ) ) { corrupted = true ; } else { try { T record = createRecord ( data , stat , clazz ) ; ret . add ( record ) ; } catch ( java . io . IOException e ) { org . apache . hadoop . hdfs . server . federation . store . driver . impl . StateStoreZooKeeperImpl . LOG . error ( "Cannot<sp>create<sp>record<sp>type<sp>\"{}\"<sp>from<sp>\"{}\":<sp>{}" , clazz . getSimpleName ( ) , data , e . getMessage ( ) ) ; corrupted = true ; } } if ( corrupted ) { org . apache . hadoop . hdfs . server . federation . store . driver . impl . StateStoreZooKeeperImpl . LOG . error ( "Cannot<sp>get<sp>data<sp>for<sp>{}<sp>at<sp>{},<sp>cleaning<sp>corrupted<sp>data" , child , path ) ; zkManager . delete ( path ) ; } } catch ( java . lang . Exception e ) { org . apache . hadoop . hdfs . server . federation . store . driver . impl . StateStoreZooKeeperImpl . LOG . error ( "Cannot<sp>get<sp>data<sp>for<sp>{}:<sp>{}" , child , e . getMessage ( ) ) ; } } } catch ( java . lang . Exception e ) { getMetrics ( ) . addFailure ( ( ( monotonicNow ( ) ) - start ) ) ; java . lang . String msg = ( ( "Cannot<sp>get<sp>children<sp>for<sp>\"" + znode ) + "\":<sp>" ) + ( e . getMessage ( ) ) ; org . apache . hadoop . hdfs . server . federation . store . driver . impl . StateStoreZooKeeperImpl . LOG . error ( msg ) ; throw new java . io . IOException ( msg ) ; } long end = monotonicNow ( ) ; getMetrics ( ) . addRead ( ( end - start ) ) ; return new org . apache . hadoop . hdfs . server . federation . store . records . QueryResult < T > ( ret , getTime ( ) ) ; } | org . junit . Assert . assertEquals ( newValue , wrapped . get ( key ) ) |
testStatisticsPairOnEmptyStream ( ) { io . reactivex . Flowable < java . lang . Integer > nums = io . reactivex . Flowable . empty ( ) ; boolean isEmpty = nums . compose ( com . github . davidmoten . rx2 . flowable . Transformers . collectStats ( com . github . davidmoten . rx2 . Functions . < java . lang . Integer > identity ( ) ) ) . isEmpty ( ) . blockingGet ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( start ) == ( finish ) ; } | org . junit . Assert . assertTrue ( isEmpty ) |
testEvaluates ( ) { org . pentaho . big . data . kettle . plugins . job . AbstractJobEntryTest . TestJobEntry jobEntry = new org . pentaho . big . data . kettle . plugins . job . AbstractJobEntryTest . TestJobEntry ( ) ; "<AssertPlaceHolder>" ; } evaluates ( ) { return true ; } | org . junit . Assert . assertTrue ( jobEntry . evaluates ( ) ) |
testConvertFoo ( ) { java . sql . Timestamp result = underTest . convert ( "foo" ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { if ( "S" . equalsIgnoreCase ( value ) ) { return Size . TINY ; } else if ( "M" . equalsIgnoreCase ( value ) ) { return Size . NORMAL ; } else if ( "L" . equalsIgnoreCase ( value ) ) { return Size . HUGE ; } else { return null ; } } | org . junit . Assert . assertNull ( result ) |
topicPolicyIsCorrectlyRetrieved ( ) { java . lang . String topicName = com . google . cloud . examples . pubsub . snippets . ITTopicAdminClientSnippets . topics [ 0 ] ; com . google . cloud . examples . pubsub . snippets . ITTopicAdminClientSnippets . topicAdminClientSnippets . createTopic ( topicName ) ; com . google . iam . v1 . Policy policy = com . google . cloud . examples . pubsub . snippets . ITTopicAdminClientSnippets . topicAdminClientSnippets . getTopicPolicy ( topicName ) ; "<AssertPlaceHolder>" ; } getTopicPolicy ( java . lang . String ) { try ( com . google . cloud . pubsub . v1 . TopicAdminClient topicAdminClient = com . google . cloud . pubsub . v1 . TopicAdminClient . create ( ) ) { com . google . pubsub . v1 . ProjectTopicName topicName = com . google . pubsub . v1 . ProjectTopicName . of ( projectId , topicId ) ; com . google . iam . v1 . Policy policy = topicAdminClient . getIamPolicy ( topicName . toString ( ) ) ; if ( policy == null ) { } return policy ; } | org . junit . Assert . assertNotNull ( policy ) |
testDataSourceIsBound ( ) { javax . sql . DataSource ds = ( ( javax . sql . DataSource ) ( context . lookup ( "java:jboss/datasources/MyDS" ) ) ) ; "<AssertPlaceHolder>" ; } lookup ( java . lang . String ) { return new org . wildfly . swarm . microprofile . faulttolerance . deployment . MicroProfileFaultToleranceExtension . ResourceLiteral ( null , lookup , null , null , null , null , null ) ; } | org . junit . Assert . assertNotNull ( ds ) |
testUsesSecure_True ( ) { com . eclipsesource . jaxrs . provider . security . impl . SecurityContextImpl context = new com . eclipsesource . jaxrs . provider . security . impl . SecurityContextImpl ( javax . ws . rs . core . SecurityContext . BASIC_AUTH , mock ( java . security . Principal . class ) , true , null ) ; boolean secure = context . isSecure ( ) ; "<AssertPlaceHolder>" ; } isSecure ( ) { return secure ; } | org . junit . Assert . assertTrue ( secure ) |
testLeeg ( ) { final nl . bzk . brp . util . hisvolledig . kern . PersoonHisVolledigImplBuilder builder = new nl . bzk . brp . util . hisvolledig . kern . PersoonHisVolledigImplBuilder ( nl . bzk . brp . model . algemeen . stamgegeven . kern . SoortPersoon . INGESCHREVENE ) ; final nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView persoonHisVolledig = new nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView ( builder . build ( ) , null ) ; final java . util . List < nl . bzk . migratiebrp . conversie . model . brp . BrpStapel < nl . bzk . migratiebrp . conversie . model . brp . groep . BrpVerificatieInhoud > > brpInhoud = mapper . map ( persoonHisVolledig , new nl . bzk . brp . levering . lo3 . mapper . OnderzoekMapper ( persoonHisVolledig ) , new nl . bzk . brp . levering . lo3 . mapper . TestActieHisVolledigLocator ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertTrue ( ( ( brpInhoud . size ( ) ) == 0 ) ) |
testSignDataOnToken ( ) { final java . lang . String pkcs11ProvName = org . nhindirect . common . util . TestUtils . setupSafeNetToken ( ) ; if ( ! ( org . apache . commons . lang . StringUtils . isEmpty ( pkcs11ProvName ) ) ) { final java . security . KeyStore ks = java . security . KeyStore . getInstance ( "PKCS11" ) ; ks . load ( null , "1Kingpuff" . toCharArray ( ) ) ; final java . util . Enumeration < java . lang . String > aliases = ks . aliases ( ) ; while ( aliases . hasMoreElements ( ) ) { final java . lang . String alias = aliases . nextElement ( ) ; System . out . println ( ( "\r\nAlias<sp>Name:<sp>" + alias ) ) ; final java . security . KeyStore . Entry entry = ks . getEntry ( alias , null ) ; System . out . println ( ( "Key<sp>Type:<sp>" + ( entry . getClass ( ) ) ) ) ; if ( entry instanceof java . security . KeyStore . PrivateKeyEntry ) { final java . security . KeyStore . PrivateKeyEntry pEntry = ( ( java . security . KeyStore . PrivateKeyEntry ) ( entry ) ) ; final java . security . Signature sig = java . security . Signature . getInstance ( "SHA256withRSA" , pkcs11ProvName ) ; sig . initSign ( pEntry . getPrivateKey ( ) ) ; java . lang . String starttext = "Some<sp>Text<sp>to<sp>Encrypt<sp>and<sp>Sign<sp>as<sp>an<sp>Example" ; final byte [ ] bytes = starttext . getBytes ( ) ; sig . update ( bytes ) ; final byte [ ] theSignature = sig . sign ( ) ; "<AssertPlaceHolder>" ; System . out . println ( "Data<sp>Signed" ) ; break ; } } } } | org . junit . Assert . assertNotNull ( theSignature ) |
shouldFailIfCmsObjectDoesNotContainAnyCACertificate ( ) { net . ripe . rpki . commons . validation . ValidationResult validationResult = net . ripe . rpki . commons . validation . ValidationResult . withLocation ( "n/a" ) ; net . ripe . rpki . commons . provisioning . cms . ProvisioningCmsObjectBuilder builder = new net . ripe . rpki . commons . provisioning . cms . ProvisioningCmsObjectBuilder ( ) . withCmsCertificate ( ProvisioningCmsCertificateBuilderTest . TEST_CMS_CERT . getCertificate ( ) ) . withCrl ( net . ripe . rpki . commons . provisioning . cms . CRL ) ; subject = new net . ripe . rpki . commons . provisioning . cms . ProvisioningCmsObjectValidator ( options , builder . build ( ProvisioningCmsCertificateBuilderTest . EE_KEYPAIR . getPrivate ( ) ) , net . ripe . rpki . commons . provisioning . x509 . ProvisioningIdentityCertificateBuilderTest . TEST_IDENTITY_CERT ) ; subject . validate ( validationResult ) ; "<AssertPlaceHolder>" ; } hasFailures ( ) { for ( java . util . Map < net . ripe . rpki . commons . validation . ValidationStatus , java . util . List < net . ripe . rpki . commons . validation . ValidationCheck > > checks : this . results . values ( ) ) { java . util . List < net . ripe . rpki . commons . validation . ValidationCheck > errors = checks . get ( ValidationStatus . ERROR ) ; if ( ( errors != null ) && ( ! ( errors . isEmpty ( ) ) ) ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( validationResult . hasFailures ( ) ) |
multiThreadedInitialization ( ) { org . slf4j . impl . MultithreadedInitializationTest . LoggerAccessingThread [ ] accessors = org . slf4j . impl . MultithreadedInitializationTest . harness ( ) ; for ( org . slf4j . impl . MultithreadedInitializationTest . LoggerAccessingThread accessor : accessors ) { org . slf4j . impl . MultithreadedInitializationTest . EVENT_COUNT . getAndIncrement ( ) ; accessor . logger . info ( "post<sp>harness" ) ; } org . slf4j . Logger logger = org . slf4j . LoggerFactory . getLogger ( ( ( ( loggerName ) + ".slowInitialization-" ) + ( diff ) ) ) ; logger . info ( "hello" ) ; org . slf4j . impl . MultithreadedInitializationTest . EVENT_COUNT . getAndIncrement ( ) ; java . util . List < ch . qos . logback . classic . spi . ILoggingEvent > events = getRecordedEvents ( ) ; "<AssertPlaceHolder>" ; } get ( ) { E r = null ; if ( ( numElems ) > 0 ) { ( numElems ) -- ; r = ea [ first ] ; ea [ first ] = null ; if ( ( ++ ( first ) ) == ( maxSize ) ) first = 0 ; } return r ; } | org . junit . Assert . assertEquals ( org . slf4j . impl . MultithreadedInitializationTest . EVENT_COUNT . get ( ) , events . size ( ) ) |
isValid ( ) { final java . time . LocalDate beginDatum = java . time . LocalDate . of ( 2010 , 1 , 1 ) ; final java . time . LocalDate eindDatum = java . time . LocalDate . of ( 2015 , 1 , 1 ) ; final nl . bzk . brp . beheer . service . selectie . SelectiePeriodeDTO selectiePeriodeDTO = new nl . bzk . brp . beheer . service . selectie . SelectiePeriodeDTO ( beginDatum , eindDatum ) ; "<AssertPlaceHolder>" ; } isValid ( ) { return validatieResultaat ; } | org . junit . Assert . assertTrue ( selectiePeriodeDTO . isValid ( ) ) |
test15_BafterC_CbeforeB ( ) { java . util . List < com . liferay . faces . util . config . internal . FacesConfigDescriptor > facesConfigDescriptors = new java . util . ArrayList < com . liferay . faces . util . config . internal . FacesConfigDescriptor > ( ) ; com . liferay . faces . util . xml . OrderingTest . parseConfigurationResources ( "ordering/BafterC_CbeforeB" , facesConfigDescriptors , com . liferay . faces . util . xml . OrderingTest . META_INF_FACES_CONFIG_XML ) ; java . util . Collections . shuffle ( facesConfigDescriptors ) ; java . lang . String [ ] originalOrder = com . liferay . faces . util . xml . OrderingTest . extractNames ( facesConfigDescriptors ) ; facesConfigDescriptors = com . liferay . faces . util . config . internal . OrderingUtil . getOrder ( facesConfigDescriptors ) ; java . lang . String [ ] orderedNames = com . liferay . faces . util . xml . OrderingTest . extractNames ( facesConfigDescriptors ) ; java . util . List < java . lang . String > original = java . util . Arrays . asList ( originalOrder ) ; java . util . List < java . lang . String > actually = java . util . Arrays . asList ( orderedNames ) ; java . util . List < java . lang . String > possibility1 = java . util . Arrays . asList ( "a" , "c" , "d" , "b" ) ; java . util . List < java . lang . String > possibility2 = java . util . Arrays . asList ( "c" , "d" , "a" , "b" ) ; java . util . List < java . lang . String > possibility3 = java . util . Arrays . asList ( "c" , "a" , "d" , "b" ) ; boolean assertion = ( ( actually . equals ( possibility1 ) ) || ( actually . equals ( possibility2 ) ) ) || ( actually . equals ( possibility3 ) ) ; java . lang . String message = ( ( ( ( ( ( ( ( ( "\n<sp>original:<sp>" + original ) + "a" 0 ) + possibility1 ) + "\n<sp>or:<sp>" ) + possibility2 ) + "\n<sp>or:<sp>" ) + possibility3 ) + "\n<sp>actually:<sp>" ) + actually ) + "\n" ; "<AssertPlaceHolder>" ; com . liferay . faces . util . xml . OrderingTest . logger . info ( ( "test15_BafterC_CbeforeB:<sp>Passed" + message ) ) ; } equals ( java . lang . Object ) { boolean flag = false ; if ( ( obj != null ) && ( obj instanceof java . util . List < ? > ) ) { java . util . List < ? > objList = ( ( java . util . List < ? > ) ( obj ) ) ; if ( ( objList . size ( ) ) == ( this . size ( ) ) ) { flag = true ; int index = 0 ; for ( java . lang . Object listEntry : objList ) { if ( listEntry instanceof java . lang . String ) { java . lang . String listEntryAsString = ( ( java . lang . String ) ( listEntry ) ) ; java . lang . String thisEntry = this . get ( index ) ; if ( thisEntry . equals ( listEntryAsString ) ) { index ++ ; } else { flag = false ; break ; } } else { flag = false ; break ; } } } } return flag ; } | org . junit . Assert . assertTrue ( message , assertion ) |
testEmptyValidators ( ) { setupComponentValidator ( ) ; setupBeanValidator ( ) ; "<AssertPlaceHolder>" ; controller . verify ( ) ; } checkValidator ( ) { controller . replay ( ) ; java . util . Collection < org . richfaces . validator . ValidatorDescriptor > validators = behavior . getValidators ( behaviorContext ) ; return validators ; } | org . junit . Assert . assertTrue ( checkValidator ( ) . isEmpty ( ) ) |
shouldAcceptGoodIpv4Address ( ) { host = new org . openstack . atlas . docs . loadbalancers . api . management . v1 . Host ( ) ; host . setIpv4Public ( "1.2.3.4" ) ; res = hv . validate ( host , org . openstack . atlas . api . mgmt . validation . validators . PUT ) ; "<AssertPlaceHolder>" ; } resultMessage ( org . openstack . atlas . api . validation . results . ValidatorResult , java . lang . Enum ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ! ( result . passedValidation ( ) ) ) { java . util . List < org . openstack . atlas . api . validation . results . ExpectationResult > ers = result . getValidationResults ( ) ; sb . append ( java . lang . String . format ( "ON<sp>%s<sp>result.withMessage([" , ctx . toString ( ) ) ) ; for ( org . openstack . atlas . api . validation . results . ExpectationResult er : ers ) { sb . append ( java . lang . String . format ( "%s" , er . getMessage ( ) ) ) ; sb . append ( "])" ) ; } } else { sb . append ( java . lang . String . format ( "On<sp>%s<sp>All<sp>Expectations<sp>PASSED\n" , ctx . toString ( ) ) ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertTrue ( resultMessage ( res , org . openstack . atlas . api . mgmt . validation . validators . PUT ) , res . passedValidation ( ) ) |
compareTo_shouldReturnPositiveIfStartDatesEqualAndThisEndDateNull ( ) { org . openmrs . PatientState patientState = new org . openmrs . PatientState ( ) ; patientState . setStartDate ( leftRange ) ; patientState . setEndDate ( null ) ; patientState . setVoided ( false ) ; org . openmrs . PatientState patientState2 = new org . openmrs . PatientState ( ) ; patientState2 . setStartDate ( leftRange ) ; patientState2 . setEndDate ( rightRange ) ; patientState2 . setVoided ( false ) ; int result = patientState . compareTo ( patientState2 ) ; "<AssertPlaceHolder>" ; } compareTo ( org . openmrs . ConceptSet ) { int value = org . openmrs . util . OpenmrsUtil . compareWithNullAsLowest ( concept . getRetired ( ) , cs . concept . getRetired ( ) ) ; if ( value == 0 ) { value = org . openmrs . util . OpenmrsUtil . compareWithNullAsLowest ( this . getSortWeight ( ) , cs . getSortWeight ( ) ) ; } return value ; } | org . junit . Assert . assertTrue ( ( result > 0 ) ) |
testGetElement ( ) { final elemental2 . dom . HTMLElement expectedElement = mock ( elemental2 . dom . HTMLElement . class ) ; when ( view . getElement ( ) ) . thenReturn ( expectedElement ) ; final elemental2 . dom . HTMLElement actualElement = cardsGrid . getElement ( ) ; "<AssertPlaceHolder>" ; } getElement ( ) { return view . getElement ( ) ; } | org . junit . Assert . assertEquals ( expectedElement , actualElement ) |
testJsPay ( ) { me . hao0 . wepay . model . pay . JsPayRequest request = new me . hao0 . wepay . model . pay . JsPayRequest ( ) ; request . setBody ( "" ) ; request . setClientIp ( "127.0.0.1" ) ; request . setTotalFee ( 1 ) ; request . setNotifyUrl ( "http://www.xxx.com/notify" ) ; request . setOpenId ( openId ) ; request . setOutTradeNo ( "TEST12345678js" ) ; request . setTimeStart ( me . hao0 . common . date . Dates . now ( "yyyyMMddHHmmss" ) ) ; me . hao0 . wepay . model . pay . JsPayResponse resp = wepay . pay ( ) . jsPay ( request ) ; "<AssertPlaceHolder>" ; System . out . println ( resp ) ; } jsPay ( me . hao0 . wepay . model . pay . JsPayRequest ) { checkJsPayParams ( request ) ; java . util . Map < java . lang . String , java . lang . Object > respData = doJsPay ( request , TradeType . JSAPI ) ; return buildJsPayResp ( respData ) ; } | org . junit . Assert . assertNotNull ( resp ) |
testGetInstance ( ) { System . out . println ( "getInstance" ) ; java . lang . String mime = "image/gif" ; org . krysalis . barcode4j . output . bitmap . BitmapEncoder result = org . krysalis . barcode4j . output . bitmap . BitmapEncoderRegistry . getInstance ( mime ) ; "<AssertPlaceHolder>" ; try { org . krysalis . barcode4j . output . bitmap . BitmapEncoderRegistry . getInstance ( "foo/app" ) ; org . junit . Assert . fail ( "no<sp>instance<sp>should<sp>beavailable" ) ; } catch ( java . lang . UnsupportedOperationException e ) { } } getInstance ( java . lang . String ) { for ( final org . krysalis . barcode4j . output . bitmap . BitmapEncoderRegistry . Entry entry : org . krysalis . barcode4j . output . bitmap . BitmapEncoderRegistry . encoders ) { final org . krysalis . barcode4j . output . bitmap . BitmapEncoder encoder = entry . encoder ; if ( org . krysalis . barcode4j . output . bitmap . BitmapEncoderRegistry . supports ( encoder , mime ) ) { return encoder ; } } throw new java . lang . UnsupportedOperationException ( ( "No<sp>BitmapEncoder<sp>available<sp>for<sp>" + mime ) ) ; } | org . junit . Assert . assertNotNull ( result ) |
testRemovalOfNonJoinCritWithReference ( ) { java . lang . String proc = "" ; java . lang . String sql = "" ; sql += "SELECT<sp>" + ( ( ( ( ( ( ( ( "<sp>pm1.g1.e1<sp>AS<sp>pm1g1e1,<sp>" + "<sp>pm2.g2.e1<sp>AS<sp>pm2g2e1,<sp>" ) + "First" 7 ) + "SELECT<sp>" 2 ) + "FROM<sp>" ) + "First" 3 ) + "First" 8 ) + "SELECT<sp>" 5 ) + "First" 2 ) ; proc += ( ( ( "SELECT<sp>" 3 + ( ( "SELECT<sp>" 4 + "First" 6 ) + "<sp>" ) ) + sql ) + "First" 9 ) + "END" ; org . teiid . query . metadata . TransformationMetadata metadata = org . teiid . query . unittest . RealMetadataFactory . example1 ( ) ; addProc ( metadata , "First" 1 , proc , new java . lang . String [ ] { "First" 4 , "e2" , "SELECT<sp>" 1 , "First" 0 } , new java . lang . String [ ] { DataTypeManager . DefaultDataTypes . STRING , DataTypeManager . DefaultDataTypes . STRING , DataTypeManager . DefaultDataTypes . INTEGER , DataTypeManager . DefaultDataTypes . INTEGER } , new java . lang . String [ 0 ] , new java . lang . String [ 0 ] ) ; java . lang . String userQuery = "SELECT<sp>*<sp>FROM<sp>(EXEC<sp>pm1.sq1())<sp>as<sp>proc" ; org . teiid . query . processor . FakeDataManager dataMgr = exampleDataManager2 ( metadata ) ; org . teiid . query . processor . ProcessorPlan plan = org . teiid . query . processor . proc . TestProcedureProcessor . getProcedurePlan ( userQuery , metadata ) ; java . util . List [ ] expected = new java . util . List [ ] { java . util . Arrays . asList ( new java . lang . Object [ ] { "First" , "First" , java . lang . Integer . valueOf ( 5 ) , java . lang . Integer . valueOf ( 5 ) } ) , java . util . Arrays . asList ( new java . lang . Object [ ] { "SELECT<sp>" 0 , null , java . lang . Integer . valueOf ( 15 ) , null } ) , java . util . Arrays . asList ( new java . lang . Object [ ] { "First" 5 , null , java . lang . Integer . valueOf ( 51 ) , null } ) } ; org . teiid . query . processor . proc . TestProcedureProcessor . helpTestProcess ( plan , expected , dataMgr , metadata ) ; "<AssertPlaceHolder>" ; } requiresTransaction ( boolean ) { if ( ! ( singleResult ) ) { for ( int i = 0 ; i < ( updatePlans . length ) ; i ++ ) { java . lang . Boolean requires = updatePlans [ i ] . requiresTransaction ( transactionalReads ) ; if ( ( requires != null ) && requires ) { startTxn [ i ] = true ; } } return false ; } boolean possible = false ; for ( int i = 0 ; i < ( updatePlans . length ) ; i ++ ) { java . lang . Boolean requires = updatePlans [ i ] . requiresTransaction ( transactionalReads ) ; if ( requires != null ) { if ( requires ) { return true ; } } else { if ( possible ) { return true ; } possible = true ; } } if ( possible ) { return null ; } return false ; } | org . junit . Assert . assertTrue ( ( ! ( plan . requiresTransaction ( false ) ) ) ) |
testCreate_uuid ( ) { org . mitre . uma . model . PermissionTicket perm = permissionService . createTicket ( rs1 , scopes1 ) ; java . util . UUID uuid = java . util . UUID . fromString ( perm . getTicket ( ) ) ; "<AssertPlaceHolder>" ; } getTicket ( ) { return ticket ; } | org . junit . Assert . assertNotNull ( uuid ) |
testSetValue ( ) { root . addChild ( "foo" , org . kaazing . netx . http . internal . auth . NodeTest . NodeType . TEST ) ; DefaultDispatchChallengeHandler . Node < java . lang . String , org . kaazing . netx . http . internal . auth . NodeTest . NodeType > foo = root . getChild ( "foo" ) ; foo . appendValues ( "VALUE" ) ; "<AssertPlaceHolder>" ; } getValues ( ) { return values ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "VALUE" ) , foo . getValues ( ) ) |
testUnsettableAttributeUnset ( ) { org . eclipselabs . mongoemf . junit . model . PrimaryObject primaryObject = ModelFactory . eINSTANCE . createPrimaryObject ( ) ; saveObject ( primaryObject ) ; org . eclipse . emf . ecore . resource . ResourceSet resourceSet = createResourceSet ( ) ; org . eclipse . emf . ecore . resource . Resource resource = resourceSet . getResource ( primaryObject . eResource ( ) . getURI ( ) , true ) ; org . eclipselabs . mongoemf . junit . model . PrimaryObject object = ( ( org . eclipselabs . mongoemf . junit . model . PrimaryObject ) ( resource . getContents ( ) . get ( 0 ) ) ) ; "<AssertPlaceHolder>" ; } isSetUnsettableAttribute ( ) { return unsettableAttributeESet ; } | org . junit . Assert . assertFalse ( object . isSetUnsettableAttribute ( ) ) |
testRetryFailOverDisabled ( ) { com . ctrip . platform . dal . dao . ha . HATest . hints = new com . ctrip . platform . dal . dao . ha . DalHints ( ) ; try { com . ctrip . platform . dal . dao . ha . HATest . database2 . query ( sql , new com . ctrip . platform . dal . dao . ha . StatementParameters ( ) , com . ctrip . platform . dal . dao . ha . HATest . hints , new com . ctrip . platform . dal . dao . ha . DalResultSetExtractor < java . lang . String > ( ) { @ com . ctrip . platform . dal . dao . ha . Override public java . lang . String extract ( java . sql . ResultSet rs ) throws java . sql . SQLException { mockFailOverThrow ( com . ctrip . platform . dal . dao . ha . HATest . hints . getHA ( ) ) ; return "" ; } } ) ; } catch ( java . sql . SQLException e ) { "<AssertPlaceHolder>" ; } } getHA ( ) { return ( ( com . ctrip . platform . dal . dao . client . DalHA ) ( hints . get ( DalHintEnum . heighAvaliable ) ) ) ; } | org . junit . Assert . assertTrue ( true ) |
testLoadGeoIpDatabase ( ) { java . io . File dbPlainTextFile = new java . io . File ( ( ( remoteDir . getAbsolutePath ( ) ) + "/MaxmindDbEnrichmentLoaderTest.mmdb" ) ) ; org . apache . metron . integration . utils . TestUtils . write ( dbPlainTextFile , "hello<sp>world" ) ; java . io . File dbFile = new java . io . File ( ( ( remoteDir . getAbsolutePath ( ) ) + "/MaxmindDbEnrichmentLoaderTest.mmdb.gz" ) ) ; CompressionStrategies . GZIP . compress ( dbPlainTextFile , dbFile ) ; java . lang . String [ ] argv = new java . lang . String [ ] { "--geo_url" , "file://" + ( dbFile . getAbsolutePath ( ) ) , "--remote_dir" , remoteDir . getAbsolutePath ( ) , "--remote_asn_dir" , remoteDir . getAbsolutePath ( ) , "--zk_quorum" 0 , tmpDir . getAbsolutePath ( ) , "--zk_quorum" , "test:2181" } ; java . lang . String [ ] otherArgs = new org . apache . hadoop . util . GenericOptionsParser ( argv ) . getRemainingArgs ( ) ; org . apache . commons . cli . CommandLine cli = MaxmindDbEnrichmentLoader . GeoEnrichmentOptions . parse ( new org . apache . commons . cli . PosixParser ( ) , otherArgs ) ; org . apache . metron . dataloads . nonbulk . geo . MaxmindDbEnrichmentLoader loader = new org . apache . metron . dataloads . nonbulk . geo . MaxmindDbEnrichmentLoaderTest . MockMaxmindDbEnrichmentLoader ( ) ; loader . loadGeoLiteDatabase ( cli ) ; org . apache . hadoop . conf . Configuration config = new org . apache . hadoop . conf . Configuration ( ) ; org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . fs . FileSystem . get ( config ) ; "<AssertPlaceHolder>" ; } exists ( java . lang . String ) { return true ; } | org . junit . Assert . assertTrue ( fs . exists ( new org . apache . hadoop . fs . Path ( ( ( ( remoteDir ) + "/" ) + ( dbFile . getName ( ) ) ) ) ) ) |
changeAwayShouldShowPrivateSystemMessageWhenAway ( ) { me . setAwayMsg ( "monkey" ) ; final net . usikkert . kouchat . misc . User user1 = new net . usikkert . kouchat . misc . User ( "User1" , 1 ) ; final net . usikkert . kouchat . misc . User user2 = new net . usikkert . kouchat . misc . User ( "User2" , 2 ) ; final net . usikkert . kouchat . misc . User user3 = new net . usikkert . kouchat . misc . User ( "User3" , 3 ) ; user1 . setPrivchat ( mock ( net . usikkert . kouchat . ui . PrivateChatWindow . class ) ) ; user3 . setPrivchat ( mock ( net . usikkert . kouchat . ui . PrivateChatWindow . class ) ) ; "<AssertPlaceHolder>" ; userList . add ( user1 ) ; userList . add ( user2 ) ; userList . add ( user3 ) ; mediator . changeAway ( true ) ; verify ( msgController ) . showPrivateSystemMessage ( user1 , "You<sp>went<sp>away:<sp>monkey" ) ; verify ( msgController ) . showPrivateSystemMessage ( user3 , "You<sp>went<sp>away:<sp>monkey" ) ; verifyNoMoreInteractions ( msgController ) ; } getPrivchat ( ) { return privchat ; } | org . junit . Assert . assertNull ( user2 . getPrivchat ( ) ) |
testProcessAckPerResponder ( ) { int timeoutMs = 5000 ; org . mockito . ArgumentCaptor < java . lang . Integer > timeoutCaptor = org . mockito . ArgumentCaptor . forClass ( io . github . tcdl . msb . collector . Integer . class ) ; io . github . tcdl . msb . collector . Collector < io . github . tcdl . msb . api . message . payload . RestPayload > collector = createCollector ( ) ; collector . processAck ( new io . github . tcdl . msb . api . message . Acknowledge . Builder ( ) . withResponderId ( "a" ) . withTimeoutMs ( timeoutMs ) . build ( ) ) ; verify ( timeoutManagerMock ) . enableResponseTimeout ( timeoutCaptor . capture ( ) , any ( ) ) ; "<AssertPlaceHolder>" . isBetween ( 1 , timeoutMs ) ; } enableResponseTimeout ( int , io . github . tcdl . msb . collector . Collector ) { io . github . tcdl . msb . collector . TimeoutManager . LOG . debug ( "[correlation<sp>id:<sp>{}]<sp>Enabling<sp>response<sp>timeout<sp>for<sp>{}<sp>ms" , collector . getRequestMessage ( ) . getCorrelationId ( ) , timeoutMs ) ; if ( timeoutMs <= 0 ) { io . github . tcdl . msb . collector . TimeoutManager . LOG . debug ( "[correlation<sp>id:<sp>{}]<sp>Unable<sp>to<sp>schedule<sp>timeout<sp>with<sp>negative<sp>delay<sp>:<sp>{}" , collector . getRequestMessage ( ) . getCorrelationId ( ) , timeoutMs ) ; return null ; } try { return timeoutExecutorDecorator . schedule ( ( ) -> { io . github . tcdl . msb . collector . TimeoutManager . LOG . debug ( "[correlation<sp>id:<sp>{}]<sp>Response<sp>timeout<sp>expired." , collector . getRequestMessage ( ) . getCorrelationId ( ) ) ; collector . end ( ) ; } , timeoutMs , TimeUnit . MILLISECONDS ) ; } catch ( java . util . concurrent . RejectedExecutionException e ) { io . github . tcdl . msb . collector . TimeoutManager . LOG . warn ( "[correlation<sp>id:<sp>{}]<sp>Unable<sp>to<sp>schedule<sp>task<sp>for<sp>execution" , collector . getRequestMessage ( ) . getCorrelationId ( ) , e ) ; return null ; } } | org . junit . Assert . assertThat ( timeoutCaptor . getValue ( ) ) |
equalsWithNullReturnsFalse ( ) { com . rackspacecloud . blueflood . types . BluefloodTimerRollup . Percentile value = new com . rackspacecloud . blueflood . types . BluefloodTimerRollup . Percentile ( ( ( java . lang . Number ) ( 123L ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( other instanceof com . rackspacecloud . blueflood . service . SlotState ) ) { return false ; } com . rackspacecloud . blueflood . service . SlotState that = ( ( com . rackspacecloud . blueflood . service . SlotState ) ( other ) ) ; return this . toString ( ) . equals ( that . toString ( ) ) ; } | org . junit . Assert . assertFalse ( value . equals ( null ) ) |
whenCalculateDistanceBetweenTwoPointsResultTen ( ) { vkaretko . Task_3_1 . Point a = new vkaretko . Task_3_1 . Point ( 0.0 , 5.0 ) ; vkaretko . Task_3_1 . Point b = new vkaretko . Task_3_1 . Point ( 10.0 , 5.0 ) ; "<AssertPlaceHolder>" ; } distanceTo ( vkaretko . Task_3_1 . Point ) { return java . lang . Math . sqrt ( ( ( java . lang . Math . pow ( ( ( point . x ) - ( this . x ) ) , 2 ) ) + ( java . lang . Math . pow ( ( ( point . y ) - ( this . y ) ) , 2 ) ) ) ) ; } | org . junit . Assert . assertThat ( a . distanceTo ( b ) , org . hamcrest . core . Is . is ( 10.0 ) ) |
shouldDetectBothUberJars ( ) { org . infinispan . commons . util . uberjar . ManifestUberJarDuplicatedJarsWarner scanner = new org . infinispan . commons . util . uberjar . ManifestUberJarDuplicatedJarsWarner ( ) { @ org . infinispan . commons . util . uberjar . Override java . util . List < java . lang . String > getBundleSymbolicNames ( ) { return java . util . Arrays . asList ( "org.infinispan.embedded" , "org.infinispan.remote" ) ; } } ; java . lang . Boolean isClasspathCorrect = scanner . isClasspathCorrect ( ) ; "<AssertPlaceHolder>" ; } isClasspathCorrect ( ) { java . util . List < java . lang . String > bundleNames = getBundleSymbolicNames ( ) ; long numberOfMatches = bundleNames . stream ( ) . filter ( hasRemoteUberJar ( ) . or ( hasEmbeddedUberJar ( ) ) . or ( hasCommons ( ) ) ) . count ( ) ; return numberOfMatches < 2 ; } | org . junit . Assert . assertFalse ( isClasspathCorrect ) |
testTaskStartTimes ( ) { org . apache . hadoop . mapreduce . v2 . api . records . TaskId taskId = mock ( org . apache . hadoop . mapreduce . v2 . api . records . TaskId . class ) ; org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskInfo taskInfo = mock ( org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskInfo . class ) ; java . util . Map < org . apache . hadoop . mapreduce . TaskAttemptID , org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo > taskAttempts = new java . util . TreeMap < org . apache . hadoop . mapreduce . TaskAttemptID , org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo > ( ) ; org . apache . hadoop . mapreduce . TaskAttemptID id = new org . apache . hadoop . mapreduce . TaskAttemptID ( "0" , 0 , org . apache . hadoop . mapreduce . TaskType . MAP , 0 , 0 ) ; org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo info = mock ( org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo . class ) ; when ( info . getAttemptId ( ) ) . thenReturn ( id ) ; when ( info . getStartTime ( ) ) . thenReturn ( 10L ) ; taskAttempts . put ( id , info ) ; id = new org . apache . hadoop . mapreduce . TaskAttemptID ( "1" , 0 , org . apache . hadoop . mapreduce . TaskType . MAP , 1 , 1 ) ; info = mock ( org . apache . hadoop . mapreduce . jobhistory . JobHistoryParser . TaskAttemptInfo . class ) ; when ( info . getAttemptId ( ) ) . thenReturn ( id ) ; when ( info . getStartTime ( ) ) . thenReturn ( 20L ) ; taskAttempts . put ( id , info ) ; when ( taskInfo . getAllTaskAttempts ( ) ) . thenReturn ( taskAttempts ) ; org . apache . hadoop . mapreduce . v2 . hs . CompletedTask task = new org . apache . hadoop . mapreduce . v2 . hs . CompletedTask ( taskId , taskInfo ) ; org . apache . hadoop . mapreduce . v2 . api . records . TaskReport report = task . getReport ( ) ; "<AssertPlaceHolder>" ; } getStartTime ( ) { if ( ( isDecommissionInProgress ( ) ) == false ) { return 0 ; } return startTime ; } | org . junit . Assert . assertTrue ( ( ( report . getStartTime ( ) ) == 10 ) ) |
throwsIfClosedOnPublish ( ) { try ( io . nats . client . NatsTestServer ts = new io . nats . client . NatsTestServer ( false ) ; io . nats . client . Connection nc = io . nats . client . Nats . connect ( ts . getURI ( ) ) ) { nc . close ( ) ; nc . publish ( "subject" , "replyto" , null ) ; "<AssertPlaceHolder>" ; } } publish ( java . lang . String , java . lang . String , byte [ ] ) { if ( isClosed ( ) ) { throw new java . lang . IllegalStateException ( "Connection<sp>is<sp>Closed" ) ; } else if ( blockPublishForDrain . get ( ) ) { throw new java . lang . IllegalStateException ( "Connection<sp>is<sp>Draining" ) ; } if ( ( subject == null ) || ( ( subject . length ( ) ) == 0 ) ) { throw new java . lang . IllegalArgumentException ( "Subject<sp>is<sp>required<sp>in<sp>publish" ) ; } if ( ( replyTo != null ) && ( ( replyTo . length ( ) ) == 0 ) ) { throw new java . lang . IllegalArgumentException ( "ReplyTo<sp>cannot<sp>be<sp>the<sp>empty<sp>string" ) ; } if ( body == null ) { body = io . nats . client . impl . NatsConnection . EMPTY_BODY ; } else if ( ( ( body . length ) > ( this . getMaxPayload ( ) ) ) && ( ( this . getMaxPayload ( ) ) > 0 ) ) { throw new java . lang . IllegalArgumentException ( ( ( ( "Message<sp>payload<sp>size<sp>exceed<sp>server<sp>configuration<sp>" + ( body . length ) ) + "<sp>vs<sp>" ) + ( this . getMaxPayload ( ) ) ) ) ; } io . nats . client . impl . NatsMessage msg = new io . nats . client . impl . NatsMessage ( subject , replyTo , body , options . supportUTF8Subjects ( ) ) ; if ( ( ( ( this . status ) == ( Status . RECONNECTING ) ) || ( ( this . status ) == ( Status . DISCONNECTED ) ) ) && ( ! ( this . writer . canQueue ( msg , options . getReconnectBufferSize ( ) ) ) ) ) { throw new java . lang . IllegalStateException ( ( "Unable<sp>to<sp>queue<sp>any<sp>more<sp>messages<sp>during<sp>reconnect,<sp>max<sp>buffer<sp>is<sp>" + ( options . getReconnectBufferSize ( ) ) ) ) ; } queueOutgoing ( msg ) ; } | org . junit . Assert . assertFalse ( true ) |
testGetNodeUrl ( ) { net . holmes . core . business . configuration . ConfigurationManager configurationManager = new net . holmes . core . business . configuration . ConfigurationManagerImpl ( new net . holmes . core . test . TestConfigurationDao ( ) ) ; net . holmes . core . business . media . ResourceBundle resourceBundle = net . holmes . core . business . media . ResourceBundle . getBundle ( "message" ) ; net . holmes . core . business . media . dao . MediaDao mediaDao = createMock ( net . holmes . core . business . media . dao . MediaDao . class ) ; net . holmes . core . business . mimetype . MimeTypeManager mimeTypeManager = createMock ( net . holmes . core . business . mimetype . MimeTypeManager . class ) ; java . net . InetAddress localAddress = createMock ( java . net . InetAddress . class ) ; expect ( localAddress . getHostAddress ( ) ) . andReturn ( "localHost" ) ; replay ( mediaDao , mimeTypeManager , localAddress ) ; net . holmes . core . business . media . MediaManagerImpl mediaManager = new net . holmes . core . business . media . MediaManagerImpl ( configurationManager , resourceBundle , mediaDao , mimeTypeManager , localAddress ) ; net . holmes . core . business . media . model . FolderNode node = new net . holmes . core . business . media . model . FolderNode ( "id" , "parentId" , "name" ) ; java . lang . String result = mediaManager . getNodeUrl ( node ) ; "<AssertPlaceHolder>" ; verify ( mediaDao , mimeTypeManager , localAddress ) ; } getNodeUrl ( net . holmes . core . business . media . model . MediaNode ) { return ( ( ( ( ( ( ( "http://" + ( localAddress . getHostAddress ( ) ) ) + ":" ) + ( httpServerPort ) ) + ( HTTP_CONTENT_REQUEST_PATH ) ) + "?" ) + ( HTTP_CONTENT_ID ) ) + "=" ) + ( node . getId ( ) ) ; } | org . junit . Assert . assertNotNull ( result ) |
testSimpleWithListener ( ) { try ( org . datavec . api . records . reader . impl . jdbc . JDBCRecordReader reader = getInitializedReader ( "SELECT<sp>*<sp>FROM<sp>Coffee" ) ) { org . datavec . api . records . listener . RecordListener recordListener = new org . datavec . api . records . listener . impl . LogRecordListener ( ) ; reader . setListeners ( recordListener ) ; reader . next ( ) ; "<AssertPlaceHolder>" ; } } invoked ( ) { return this . listener . invoked ( ) ; } | org . junit . Assert . assertTrue ( recordListener . invoked ( ) ) |
createTableSelectAllWithMultiPartitionTest ( ) { org . verdictdb . core . sqlobject . BaseTable base = new org . verdictdb . core . sqlobject . BaseTable ( "tpch" , "nation" , "t" ) ; org . verdictdb . core . sqlobject . SelectQuery relation = org . verdictdb . core . sqlobject . SelectQuery . create ( java . util . Arrays . < org . verdictdb . core . sqlobject . SelectItem > asList ( new org . verdictdb . core . sqlobject . AsteriskColumn ( ) ) , base ) ; org . verdictdb . core . sqlobject . CreateTableAsSelectQuery create = new org . verdictdb . core . sqlobject . CreateTableAsSelectQuery ( "tpch" , "newtable" , relation ) ; create . addPartitionColumn ( "n_nationkey" ) ; create . addPartitionColumn ( "n_name" ) ; java . lang . String expected = "create<sp>table<sp>`tpch`.`newtable`<sp>using<sp>parquet<sp>partitioned<sp>by<sp>(`n_nationkey`,<sp>`n_name`)<sp>as<sp>select<sp>*<sp>from<sp>`tpch`.`nation`<sp>as<sp>t" ; org . verdictdb . sqlwriter . CreateTableToSql queryToSql = new org . verdictdb . sqlwriter . CreateTableToSql ( new org . verdictdb . sqlsyntax . SparkSyntax ( ) ) ; java . lang . String actual = queryToSql . toSql ( create ) ; "<AssertPlaceHolder>" ; org . verdictdb . sqlwriter . CreateTableToSqlSparkTest . spark . sql ( "drop<sp>table<sp>if<sp>exists<sp>tpch.newtable" ) ; org . verdictdb . sqlwriter . CreateTableToSqlSparkTest . spark . sql ( actual ) ; } toSql ( org . verdictdb . core . sqlobject . InsertValuesQuery ) { java . lang . StringBuilder sql = new java . lang . StringBuilder ( ) ; java . lang . String schemaName = query . getSchemaName ( ) ; java . lang . String tableName = query . getTableName ( ) ; java . util . List < java . lang . Object > values = query . getValues ( ) ; sql . append ( "insert<sp>into<sp>" ) ; sql . append ( quoteName ( schemaName ) ) ; sql . append ( "." ) ; sql . append ( quoteName ( tableName ) ) ; sql . append ( "<sp>values<sp>(" ) ; boolean isFirst = true ; for ( java . lang . Object v : values ) { if ( isFirst == false ) { sql . append ( ",<sp>" ) ; } if ( v instanceof org . verdictdb . commons . VerdictTimestamp ) { if ( ( syntax ) instanceof org . verdictdb . sqlsyntax . PrestoSyntax ) { sql . append ( ( ( "timestamp<sp>'" + ( v . toString ( ) ) ) + "'" ) ) ; } else { sql . append ( ( ( "'" + ( v . toString ( ) ) ) + "'" ) ) ; } } else if ( v instanceof java . lang . String ) { sql . append ( ( ( "'" + v ) + "'" ) ) ; } else { sql . append ( v . toString ( ) ) ; } isFirst = false ; } sql . append ( ")" ) ; return sql . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testCoreRowTypeSet ( ) { org . gbif . ipt . model . Resource resource = new org . gbif . ipt . model . Resource ( ) ; org . gbif . ipt . model . ExtensionMapping mapping = new org . gbif . ipt . model . ExtensionMapping ( ) ; org . gbif . ipt . model . Extension ext = new org . gbif . ipt . model . Extension ( ) ; ext . setRowType ( Constants . DWC_ROWTYPE_TAXON ) ; mapping . setExtension ( ext ) ; resource . addMapping ( mapping ) ; "<AssertPlaceHolder>" ; } getCoreRowType ( ) { for ( org . gbif . ipt . model . ExtensionMapping m : mappings ) { if ( m . isCore ( ) ) { return m . getExtension ( ) . getRowType ( ) ; } } return null ; } | org . junit . Assert . assertEquals ( Constants . DWC_ROWTYPE_TAXON , resource . getCoreRowType ( ) ) |
expiredLicenseTest ( ) { com . emc . vipr . model . sys . licensing . LicenseFeature license = new com . emc . vipr . model . sys . licensing . LicenseFeature ( ) ; java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . add ( Calendar . DATE , ( - 1 ) ) ; java . util . Date nowMinusOneDay = cal . getTime ( ) ; java . text . SimpleDateFormat sdf = new java . text . SimpleDateFormat ( LicenseManager . EXPIRE_DATE_FORMAT ) ; license . setDateExpires ( sdf . format ( nowMinusOneDay ) ) ; license . setExpired ( com . emc . storageos . systemservices . impl . licensing . LicenseManagerImpl . isExpired ( license . getDateExpires ( ) ) ) ; "<AssertPlaceHolder>" ; } isExpired ( ) { return expired ; } | org . junit . Assert . assertTrue ( license . isExpired ( ) ) |
testBackpressureFastPathNotInitiatedTwice ( ) { com . github . davidmoten . rtree3d . Entry < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > e3 = com . github . davidmoten . rtree3d . RTreeTest . e ( 3 ) ; com . github . davidmoten . rtree3d . RTree < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > tree = com . github . davidmoten . rtree3d . RTree . star ( ) . maxChildren ( 4 ) . < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > create ( ) . add ( com . github . davidmoten . rtree3d . RTreeTest . e ( 1 ) ) . add ( e3 ) ; java . util . Set < com . github . davidmoten . rtree3d . Entry < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > > expected = java . util . Collections . singleton ( e3 ) ; final java . util . Set < com . github . davidmoten . rtree3d . Entry < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > > found = new java . util . HashSet < com . github . davidmoten . rtree3d . Entry < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > > ( ) ; tree . search ( e3 . geometry ( ) ) . subscribe ( new rx . Subscriber < com . github . davidmoten . rtree3d . Entry < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > > ( ) { @ com . github . davidmoten . rtree3d . Override public void onCompleted ( ) { } @ com . github . davidmoten . rtree3d . Override public void onError ( java . lang . Throwable e ) { } @ com . github . davidmoten . rtree3d . Override public void onNext ( com . github . davidmoten . rtree3d . Entry < java . lang . Object , com . github . davidmoten . rtree3d . geometry . Box > t ) { found . add ( t ) ; request ( Long . MAX_VALUE ) ; } } ) ; "<AssertPlaceHolder>" ; } request ( long ) { try { if ( ( n <= 0 ) || ( ( requested . get ( ) ) == ( Long . MAX_VALUE ) ) ) return ; else if ( ( n == ( Long . MAX_VALUE ) ) && ( requested . compareAndSet ( 0 , Long . MAX_VALUE ) ) ) { requestAll ( ) ; } else requestSome ( n ) ; } catch ( java . lang . RuntimeException e ) { subscriber . onError ( e ) ; } } | org . junit . Assert . assertEquals ( expected , found ) |
testVisitConcatFunction ( ) { es . ieci . tecdoc . fwktd . sql . node . expression . StringValue value1 = new es . ieci . tecdoc . fwktd . sql . node . expression . StringValue ( "String1<sp>con<sp>'<sp>simple" ) ; es . ieci . tecdoc . fwktd . sql . node . expression . StringValue value2 = new es . ieci . tecdoc . fwktd . sql . node . expression . StringValue ( "String2<sp>con<sp>'<sp>simple" ) ; es . ieci . tecdoc . fwktd . sql . node . expression . functions . character . ConcatFunction concat = new es . ieci . tecdoc . fwktd . sql . node . expression . functions . character . ConcatFunction ( value1 , value2 ) ; expressionRenderer . visit ( concat ) ; "<AssertPlaceHolder>" ; } getSqlString ( ) { return sqlString ; } | org . junit . Assert . assertNotNull ( concat . getSqlString ( ) ) |
testFormatStringBuilderObjectArrayIso8601 ( ) { final org . apache . logging . log4j . core . pattern . DatePatternConverter converter = org . apache . logging . log4j . core . pattern . DatePatternConverter . newInstance ( org . apache . logging . log4j . core . pattern . DatePatternConverterTest . ISO8601_FORMAT_OPTIONS ) ; final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; converter . format ( sb , date ( 2001 , 1 , 1 ) , date ( 2002 , 2 , 2 ) , date ( 2003 , 3 , 3 ) ) ; final java . lang . String expected = "2001-02-01T14:15:16,123" ; "<AssertPlaceHolder>" ; } toString ( ) { return this . internal ; } | org . junit . Assert . assertEquals ( expected , sb . toString ( ) ) |
test271c ( ) { org . apache . commons . jexl3 . JexlEngine jexl = createEngine ( ) ; org . apache . commons . jexl3 . JexlScript base = jexl . createScript ( "(x,<sp>y,<sp>z)->{<sp>2<sp>+<sp>x<sp>+<sp>y<sp>+<sp>z<sp>};" ) ; org . apache . commons . jexl3 . JexlScript y = base . curry ( 1 ) ; java . lang . Object result = y . execute ( null , 2 , 3 ) ; "<AssertPlaceHolder>" ; } curry ( java . lang . Object [ ] ) { java . lang . String [ ] parms = script . getParameters ( ) ; if ( ( parms == null ) || ( ( parms . length ) == 0 ) ) { return this ; } return new org . apache . commons . jexl3 . internal . Closure ( this , args ) ; } | org . junit . Assert . assertEquals ( 8 , result ) |
testSetInternalEntryCurrentDirectoryWithFilename ( ) { org . pentaho . di . trans . TransMeta transMetaTest = new org . pentaho . di . trans . TransMeta ( ) ; transMetaTest . setFilename ( "hasFilename" ) ; transMetaTest . setVariable ( Const . INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY , "Original<sp>value<sp>defined<sp>at<sp>run<sp>execution" ) ; transMetaTest . setVariable ( Const . INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY , "file:///C:/SomeFilenameDirectory" ) ; transMetaTest . setVariable ( Const . INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY , "/SomeRepDirectory" ) ; transMetaTest . setInternalEntryCurrentDirectory ( ) ; "<AssertPlaceHolder>" ; } getVariable ( java . lang . String ) { return variables . getVariable ( variableName ) ; } | org . junit . Assert . assertEquals ( "file:///C:/SomeFilenameDirectory" , transMetaTest . getVariable ( Const . INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY ) ) |
testGetSampleStructuredContent ( ) { java . lang . String xml = com . liferay . dynamic . data . mapping . test . util . DDMStructureTestUtil . getSampleStructuredContent ( "name" , "Joe<sp>Bloggs" ) ; java . lang . String content = ( ( java . lang . String ) ( _transformMethod . invoke ( null , null , getTokens ( ) , Constants . VIEW , "en_US" , com . liferay . portal . kernel . xml . UnsecureSAXReaderUtil . read ( xml ) , null , com . liferay . journal . test . util . JournalTestUtil . getSampleTemplateXSL ( ) , TemplateConstants . LANG_TYPE_VM ) ) ) ; "<AssertPlaceHolder>" ; } getSampleTemplateXSL ( ) { return "$name.getData()" ; } | org . junit . Assert . assertEquals ( "Joe<sp>Bloggs" , content ) |
testCrashBetweenSyncLogAndPersistPaxosData ( ) { org . apache . hadoop . hdfs . qjournal . server . JournalFaultInjector faultInjector = org . apache . hadoop . hdfs . qjournal . server . JournalFaultInjector . instance = org . mockito . Mockito . mock ( org . apache . hadoop . hdfs . qjournal . server . JournalFaultInjector . class ) ; setupLoggers345 ( ) ; qjm = createSpyingQJM ( ) ; spies = qjm . getLoggerSetForTests ( ) . getLoggersForTests ( ) ; cluster . getJournalNode ( 2 ) . stopAndJoin ( 0 ) ; injectIOE ( ) . when ( spies . get ( 1 ) ) . acceptRecovery ( org . mockito . Mockito . < org . apache . hadoop . hdfs . qjournal . protocol . QJournalProtocolProtos . SegmentStateProto > any ( ) , org . mockito . Mockito . < java . net . URL > any ( ) ) ; tryRecoveryExpectingFailure ( ) ; cluster . restartJournalNode ( 2 ) ; qjm = createSpyingQJM ( ) ; spies = qjm . getLoggerSetForTests ( ) . getLoggersForTests ( ) ; injectIOE ( ) . when ( spies . get ( 0 ) ) . prepareRecovery ( org . mockito . Mockito . eq ( 1L ) ) ; org . mockito . Mockito . doThrow ( new java . io . IOException ( "Injected" ) ) . when ( faultInjector ) . beforePersistPaxosData ( ) ; tryRecoveryExpectingFailure ( ) ; org . mockito . Mockito . reset ( faultInjector ) ; cluster . getJournalNode ( 2 ) . stopAndJoin ( 0 ) ; qjm = createSpyingQJM ( ) ; try { long recovered = org . apache . hadoop . hdfs . qjournal . QJMTestUtil . recoverAndReturnLastTxn ( qjm ) ; "<AssertPlaceHolder>" ; } finally { qjm . close ( ) ; } } recoverAndReturnLastTxn ( org . apache . hadoop . hdfs . qjournal . client . QuorumJournalManager ) { qjm . recoverUnfinalizedSegments ( ) ; long lastRecoveredTxn = 0 ; java . util . List < org . apache . hadoop . hdfs . server . namenode . EditLogInputStream > streams = com . google . common . collect . Lists . newArrayList ( ) ; try { qjm . selectInputStreams ( streams , 0 , false ) ; for ( org . apache . hadoop . hdfs . server . namenode . EditLogInputStream elis : streams ) { org . junit . Assert . assertTrue ( ( ( elis . getFirstTxId ( ) ) > lastRecoveredTxn ) ) ; lastRecoveredTxn = elis . getLastTxId ( ) ; } } finally { org . apache . hadoop . io . IOUtils . cleanup ( null , streams . toArray ( new java . io . Closeable [ 0 ] ) ) ; } return lastRecoveredTxn ; } | org . junit . Assert . assertTrue ( ( recovered >= 4 ) ) |
testVideoClassification ( ) { java . lang . Class klass = org . apache . streams . youtube . serializer . YoutubeEventClassifier . detectClass ( testVideo ) ; "<AssertPlaceHolder>" ; } detectClass ( java . lang . String ) { java . util . Objects . requireNonNull ( json ) ; com . google . common . base . Preconditions . checkArgument ( org . apache . commons . lang3 . StringUtils . isNotEmpty ( json ) ) ; com . fasterxml . jackson . databind . node . ObjectNode objectNode ; try { objectNode = ( ( com . fasterxml . jackson . databind . node . ObjectNode ) ( org . apache . streams . youtube . serializer . YoutubeEventClassifier . mapper . readTree ( json ) ) ) ; } catch ( java . io . IOException ex ) { ex . printStackTrace ( ) ; return null ; } if ( ( ( objectNode . findValue ( "kind" ) ) != null ) && ( objectNode . get ( "kind" ) . toString ( ) . equals ( org . apache . streams . youtube . serializer . YoutubeEventClassifier . VIDEO_IDENTIFIER ) ) ) { return com . google . api . services . youtube . model . Video . class ; } else if ( ( ( objectNode . findValue ( "kind" ) ) != null ) && ( objectNode . get ( "kind" ) . toString ( ) . contains ( org . apache . streams . youtube . serializer . YoutubeEventClassifier . CHANNEL_IDENTIFIER ) ) ) { return com . google . api . services . youtube . model . Channel . class ; } else { return com . fasterxml . jackson . databind . node . ObjectNode . class ; } } | org . junit . Assert . assertEquals ( klass , com . google . api . services . youtube . model . Video . class ) |
testNoAuthBearerOnly ( ) { org . keycloak . representations . adapters . config . AdapterConfig aConfig = config . readAdapterConfig ( ) ; aConfig . setBearerOnly ( true ) ; config . writeAdapterConfig ( aConfig ) ; org . geoserver . security . keycloak . GeoServerKeycloakFilter filter = new org . geoserver . security . keycloak . GeoServerKeycloakFilter ( ) ; filter . initializeFromConfig ( config ) ; when ( response . getStatus ( ) ) . thenReturn ( HttpStatus . FORBIDDEN . value ( ) ) ; filter . doFilter ( request , response , chain ) ; org . mockito . ArgumentCaptor < org . springframework . security . web . AuthenticationEntryPoint > aep = org . mockito . ArgumentCaptor . forClass ( org . springframework . security . web . AuthenticationEntryPoint . class ) ; verify ( request ) . setAttribute ( eq ( org . geoserver . security . keycloak . GeoServerKeycloakFilterTest . AEP_HEADER ) , aep . capture ( ) ) ; aep . getValue ( ) . commence ( request , response , null ) ; verify ( chain ) . doFilter ( request , response ) ; verify ( response ) . setStatus ( HttpStatus . FORBIDDEN . value ( ) ) ; org . springframework . security . core . Authentication authn = org . springframework . security . core . context . SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; "<AssertPlaceHolder>" ; } getAuthentication ( ) { org . springframework . security . core . Authentication auth = org . springframework . security . core . context . SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; if ( ( ( auth != null ) && ( ( auth . getAuthorities ( ) . size ( ) ) == 1 ) ) && ( "ROLE_ANONYMOUS" . equals ( auth . getAuthorities ( ) . iterator ( ) . next ( ) . getAuthority ( ) ) ) ) return null ; return auth ; } | org . junit . Assert . assertNull ( authn ) |
testGetProviderGroups ( ) { java . util . List < org . oscarehr . common . model . MyGroup > groups = dao . getProviderGroups ( "1" ) ; "<AssertPlaceHolder>" ; } getProviderGroups ( java . lang . String ) { javax . persistence . Query query = entityManager . createQuery ( "SELECT<sp>g<sp>FROM<sp>MyGroup<sp>g<sp>WHERE<sp>g.id.providerNo<sp>=<sp>?" ) ; query . setParameter ( 1 , providerNo ) ; @ org . oscarehr . common . dao . SuppressWarnings ( "unchecked" ) java . util . List < org . oscarehr . common . model . MyGroup > dList = query . getResultList ( ) ; return dList ; } | org . junit . Assert . assertNotNull ( groups ) |
testMatch03 ( ) { boolean matchResult = simpleNamePatternMatcher . matchesEndToEnd ( "a" ) ; "<AssertPlaceHolder>" ; } matchesEndToEnd ( java . lang . String ) { return pattern . matcher ( input ) . matches ( ) ; } | org . junit . Assert . assertTrue ( matchResult ) |
noEventsShouldBeFetchedWhenThereAreNoEventsInTheRange ( ) { com . graphaware . module . timetree . domain . TimeInstant timeInstant1 = com . graphaware . module . timetree . domain . TimeInstant . instant ( dateToMillis ( 2012 , 11 , 2 ) ) . with ( Resolution . MILLISECOND ) ; com . graphaware . module . timetree . domain . TimeInstant zero = com . graphaware . module . timetree . domain . TimeInstant . instant ( 0L ) . with ( Resolution . MILLISECOND ) ; com . graphaware . module . timetree . domain . TimeInstant beforeTimeInstant1 = com . graphaware . module . timetree . domain . TimeInstant . instant ( dateToMillis ( 2012 , 11 , 1 ) ) . with ( Resolution . MILLISECOND ) ; org . neo4j . graphdb . Node event1 ; try ( org . neo4j . graphdb . Transaction tx = getDatabase ( ) . beginTx ( ) ) { event1 = getDatabase ( ) . createNode ( ) ; event1 . setProperty ( "name" , "eventA" ) ; tx . success ( ) ; } try ( org . neo4j . graphdb . Transaction tx = getDatabase ( ) . beginTx ( ) ) { timedEvents . attachEvent ( event1 , com . graphaware . module . timetree . TimeTreeBackedEventsTest . AT_TIME , timeInstant1 ) ; tx . success ( ) ; } try ( org . neo4j . graphdb . Transaction tx = getDatabase ( ) . beginTx ( ) ) { com . graphaware . module . timetree . List < com . graphaware . module . timetree . domain . Event > events = timedEvents . getEvents ( zero , beforeTimeInstant1 ) ; "<AssertPlaceHolder>" ; tx . success ( ) ; } } getEvents ( com . graphaware . module . timetree . domain . TimeInstant , com . graphaware . module . timetree . Set ) { return getEvents ( timeInstant , types , com . graphaware . module . timetree . INCOMING ) ; } | org . junit . Assert . assertEquals ( 0 , events . size ( ) ) |
unmarshallsRootElementToDynamicallyImplementedRootType ( ) { com . sjl . dsl4xml . LegacyDocumentReader < com . sjl . dsl4xml . sax . DynamicImplementationTestBase . Root > _r = newRootOnlyUnmarshaller ( ) ; com . sjl . dsl4xml . sax . DynamicImplementationTestBase . Root _root = _r . read ( get ( "root-1.xml" ) , "utf-8" ) ; "<AssertPlaceHolder>" ; } get ( int ) { return tweets . get ( anIndex ) ; } | org . junit . Assert . assertNotNull ( _root ) |
shouldReadErrorEvent ( ) { org . kaazing . k3po . control . internal . event . ErrorEvent expectedError = new org . kaazing . k3po . control . internal . event . ErrorEvent ( ) ; expectedError . setSummary ( "summary<sp>text" ) ; expectedError . setDescription ( "description<sp>text" ) ; mockery . checking ( new org . jmock . Expectations ( ) { { oneOf ( input ) . read ( with ( any ( byte [ ] . class ) ) , with ( equal ( 0 ) ) , with ( any ( int . class ) ) ) ; will ( org . kaazing . k3po . control . internal . ControlTest . readInitialBytes ( 0 , ( "ERROR\n" + ( ( ( ( "summary:summary<sp>text\n" + "content-length:16\n" ) + "future-header:future-value\n" ) + "\n" ) + "description<sp>text" ) ) . getBytes ( org . kaazing . k3po . control . internal . ControlTest . UTF_8 ) ) ) ; allowing ( input ) . available ( ) ; will ( returnValue ( 0 ) ) ; } } ) ; control . connect ( ) ; org . kaazing . k3po . control . internal . event . CommandEvent error = control . readEvent ( ) ; "<AssertPlaceHolder>" ; } readEvent ( ) { return readEvent ( 0 , org . kaazing . k3po . control . internal . MILLISECONDS ) ; } | org . junit . Assert . assertEquals ( expectedError , error ) |
userPermissionCheck_UserRemote ( ) { pUser . getOrganization ( ) . setRemoteLdapActive ( true ) ; passwordRecoverybean . verifyUserPermission ( pUser , marketplaceId ) ; verify ( passwordRecoverybean , times ( 1 ) ) . sendPasswordRecoveryMails ( eq ( pUser ) , eq ( EmailType . RECOVERPASSWORD_FAILED_LDAP ) , urlCaptor . capture ( ) , any ( java . lang . Object [ ] . class ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( marketplaceId , urlCaptor . getValue ( ) ) |
testSnsapiUserInfo ( ) { java . lang . String accessToken = java . lang . System . getProperty ( "weixin.atoken" ) ; java . lang . String openId = java . lang . System . getProperty ( "weixin.openid" ) ; com . belerweb . social . bean . Result < com . belerweb . social . weixin . bean . User > result = weixin . getUser ( ) . snsapiUserInfo ( accessToken , openId ) ; "<AssertPlaceHolder>" ; com . belerweb . social . weixin . api . UserTest . logger . info ( result . getResult ( ) . getJsonObject ( ) . toString ( ) ) ; } success ( ) { return ( error ) == null ; } | org . junit . Assert . assertTrue ( result . success ( ) ) |
app_simulateWindowsFailure ( ) { final java . util . concurrent . atomic . AtomicReference < java . lang . String > path = new java . util . concurrent . atomic . AtomicReference < java . lang . String > ( ) ; final java . lang . String envpath = "c:/Windows;c:/Windows/System32;c:/Java" ; @ com . microsoft . alm . authentication . SuppressWarnings ( "unchecked" ) final com . microsoft . alm . helpers . Func < java . lang . String , java . lang . Boolean > existenceChecker = ( ( com . microsoft . alm . helpers . Func < java . lang . String , java . lang . Boolean > ) ( mock ( com . microsoft . alm . helpers . Func . class ) ) ) ; when ( existenceChecker . call ( "c:/Java/java.exe" ) ) . thenReturn ( false ) ; final boolean result = com . microsoft . alm . authentication . Where . app ( "java" , path , ".exe" , envpath , ";" , existenceChecker ) ; "<AssertPlaceHolder>" ; verify ( existenceChecker , times ( 3 ) ) . call ( anyString ( ) ) ; } app ( java . lang . String , java . util . concurrent . atomic . AtomicReference , java . lang . String , java . lang . String , java . lang . String , com . microsoft . alm . helpers . Func ) { final java . lang . String [ ] exts = pathext . split ( pathSeparator ) ; final java . lang . String [ ] paths = envpath . split ( pathSeparator ) ; for ( int i = 0 ; i < ( paths . length ) ; i ++ ) { if ( com . microsoft . alm . helpers . StringHelper . isNullOrWhiteSpace ( paths [ i ] ) ) continue ; for ( int j = 0 ; j < ( exts . length ) ; j ++ ) { final java . lang . String value = java . lang . String . format ( "%1$s/%2$s%3$s" , paths [ i ] , name , exts [ j ] ) ; final java . lang . Boolean result = existenceChecker . call ( value ) ; if ( ( result != null ) && ( ( boolean ) ( result ) ) ) { path . set ( value ) ; return true ; } } } return false ; } | org . junit . Assert . assertEquals ( false , result ) |
testNaturalInnerJoin ( ) { org . meridor . perspective . sql . impl . parser . DataSource dataSource = prepareJoinDataSource ( ( ds ) -> { ds . setJoinType ( JoinType . INNER ) ; ds . setNaturalJoin ( true ) ; return ds ; } ) ; org . meridor . perspective . sql . impl . task . strategy . DataSourceStrategy strategy = getStrategy ( ) ; org . meridor . perspective . sql . DataContainer dataContainer = strategy . process ( dataSource , org . meridor . perspective . sql . impl . task . strategy . TWO_TABLE_ALIASES ) ; doCommonAssertions ( dataContainer , 3 ) ; java . util . List < org . meridor . perspective . sql . DataRow > rows = dataContainer . getRows ( ) ; java . util . List < java . util . List < java . lang . Object > > correctData = java . util . Arrays . asList ( java . util . Arrays . asList ( "1" , "first" , "2" , "1" , "first_project" ) , java . util . Arrays . asList ( "2" , "second" , "1" , "2" , "second_project" ) , java . util . Arrays . asList ( "3" , "third" , "2" , "3" , "third_project" ) ) ; "<AssertPlaceHolder>" ; } rowsAsValues ( org . meridor . perspective . sql . impl . task . strategy . List ) { return rows . stream ( ) . map ( DataRow :: getValues ) . collect ( java . util . stream . Collectors . toList ( ) ) ; } | org . junit . Assert . assertThat ( rowsAsValues ( rows ) , equalTo ( correctData ) ) |
cascadeFromGenericMethodDefinedTwoLevelsDeepInInheritanceHierarchy ( mockit . CascadingWithGenericsTest$NonGenericInterface ) { mockit . CascadingWithGenericsTest . Bar cascadedResult = mock . genericMethod ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( cascadedResult ) |
testReduction ( ) { eu . stamp_project . Utils . getInputConfiguration ( ) . setMaxTestAmplified ( 2 ) ; final spoon . reflect . declaration . CtMethod methodString = eu . stamp_project . Utils . findMethod ( "fr.inria.amp.LiteralMutation" , "methodString" ) ; final spoon . reflect . declaration . CtMethod methodInteger = eu . stamp_project . Utils . findMethod ( "fr.inria.amp.LiteralMutation" , "methodInteger" ) ; java . util . List < spoon . reflect . declaration . CtMethod < ? > > methods = new java . util . ArrayList ( ) ; methods . add ( methodString ) ; methods . add ( methodString ) ; methods . add ( methodString ) ; methods . add ( methodString ) ; methods . add ( methodString ) ; methods . add ( methodString ) ; methods . add ( methodString ) ; methods . add ( methodString ) ; final spoon . reflect . declaration . CtMethod clone = methodString . clone ( ) ; final spoon . reflect . code . CtLiteral originalLiteral = clone . getElements ( new spoon . reflect . visitor . filter . TypeFilter ( spoon . reflect . code . CtLiteral . class ) ) . get ( 0 ) ; originalLiteral . replace ( eu . stamp_project . Utils . getFactory ( ) . createLiteral ( ( ( originalLiteral . getValue ( ) ) + "a" ) ) ) ; methods . add ( clone ) ; methods . add ( clone ) ; methods . add ( clone ) ; methods . add ( methodInteger ) ; final java . util . List < spoon . reflect . declaration . CtMethod < ? > > reduce = new eu . stamp_project . dspot . budget . NoBudgetizer ( ) . reduce ( methods ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 2 , reduce . size ( ) ) |
collectLongParallel ( ) { org . eclipse . collections . api . list . primitive . LongList expected = org . eclipse . collections . impl . collector . Collectors2AdditionalTest . LARGE_INTERVAL . collectLong ( Integer :: longValue , LongLists . mutable . empty ( ) ) ; org . eclipse . collections . api . list . primitive . LongList actual = this . bigData . parallelStream ( ) . collect ( org . eclipse . collections . impl . collector . Collectors2 . collectLong ( ( each ) -> ( ( long ) ( each ) ) , org . eclipse . collections . impl . factory . primitive . LongLists . mutable :: empty ) ) ; "<AssertPlaceHolder>" ; } collectLong ( org . eclipse . collections . api . block . function . primitive . LongFunction , java . util . function . Supplier ) { return java . util . stream . Collector . of ( supplier , ( collection , each ) -> collection . add ( function . longValueOf ( each ) ) , ( collection1 , collection2 ) -> { collection1 . addAll ( collection2 ) ; return collection1 ; } , org . eclipse . collections . impl . collector . Collectors2 . EMPTY_CHARACTERISTICS ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testFailingInstanciation ( ) { org . orbisgis . coremap . renderer . se . parameter . real . RealParameter vf = new org . orbisgis . coremap . renderer . se . parameter . real . Recode2Real ( new org . orbisgis . coremap . renderer . se . parameter . real . RealLiteral ( 2.0 ) , new org . orbisgis . coremap . renderer . se . parameter . string . StringAttribute ( "potato" ) ) ; org . orbisgis . coremap . renderer . se . parameter . string . Categorize2String c2s = new org . orbisgis . coremap . renderer . se . parameter . string . Categorize2String ( new org . orbisgis . coremap . renderer . se . parameter . string . StringLiteral ( "youhou" ) , new org . orbisgis . coremap . renderer . se . parameter . string . StringLiteral ( "fallback" ) , vf ) ; try { org . orbisgis . legend . structure . categorize . CategorizedString cs = new org . orbisgis . legend . structure . categorize . CategorizedString ( c2s ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . IllegalArgumentException iae ) { "<AssertPlaceHolder>" ; } } | org . junit . Assert . assertTrue ( true ) |
testGetAllAtomMapping ( ) { org . openscience . cdk . interfaces . IAtom atomSource = new org . openscience . cdk . Atom ( "R" ) ; org . openscience . cdk . interfaces . IAtom atomTarget = new org . openscience . cdk . Atom ( "R" ) ; org . openscience . cdk . interfaces . IAtomContainer source = new org . openscience . cdk . AtomContainer ( ) ; source . addAtom ( atomSource ) ; org . openscience . cdk . interfaces . IAtomContainer target = new org . openscience . cdk . AtomContainer ( ) ; target . addAtom ( atomTarget ) ; boolean removeHydrogen = false ; org . openscience . cdk . smsd . algorithm . single . SingleMappingHandler instance = new org . openscience . cdk . smsd . algorithm . single . SingleMappingHandler ( removeHydrogen ) ; org . openscience . cdk . smsd . tools . MolHandler mol1 = new org . openscience . cdk . smsd . tools . MolHandler ( source , true , true ) ; org . openscience . cdk . smsd . tools . MolHandler mol2 = new org . openscience . cdk . smsd . tools . MolHandler ( target , true , true ) ; instance . set ( mol1 , mol2 ) ; instance . searchMCS ( true ) ; "<AssertPlaceHolder>" ; } getAllAtomMapping ( ) { return allAtomMCS . isEmpty ( ) ? null : allAtomMCS ; } | org . junit . Assert . assertNotNull ( instance . getAllAtomMapping ( ) ) |
testNonInvertible ( ) { org . hipparchus . optim . nonlinear . vector . leastsquares . LinearProblem problem = new org . hipparchus . optim . nonlinear . vector . leastsquares . LinearProblem ( new double [ ] [ ] { new double [ ] { 1 , 2 , - 3 } , new double [ ] { 2 , 1 , 3 } , new double [ ] { - 3 , 0 , - 9 } } , new double [ ] { 1 , 1 , 1 } ) ; org . hipparchus . optim . nonlinear . vector . leastsquares . LeastSquaresOptimizer . Optimum optimum = optimizer . optimize ( problem . getBuilder ( ) . build ( ) ) ; org . hipparchus . geometry . euclidean . threed . Plane span = new org . hipparchus . geometry . euclidean . threed . Plane ( org . hipparchus . geometry . euclidean . threed . Vector3D . ZERO , new org . hipparchus . geometry . euclidean . threed . Vector3D ( 1 , 2 , ( - 3 ) ) , new org . hipparchus . geometry . euclidean . threed . Vector3D ( 2 , 1 , 0 ) , TOl ) ; double expected = org . hipparchus . util . FastMath . abs ( span . getOffset ( new org . hipparchus . geometry . euclidean . threed . Vector3D ( 1 , 1 , 1 ) ) ) ; double actual = optimum . getResiduals ( ) . getNorm ( ) ; "<AssertPlaceHolder>" ; } getNorm ( ) { return org . hipparchus . util . FastMath . sqrt ( ( ( ( ( ( q0 ) * ( q0 ) ) + ( ( q1 ) * ( q1 ) ) ) + ( ( q2 ) * ( q2 ) ) ) + ( ( q3 ) * ( q3 ) ) ) ) ; } | org . junit . Assert . assertEquals ( expected , actual , org . hipparchus . optim . nonlinear . vector . leastsquares . TOl ) |
testDivFunction ( ) { com . googlecode . aviator . runtime . function . system . BinaryFunction fun = new com . googlecode . aviator . runtime . function . system . BinaryFunction ( com . googlecode . aviator . lexer . token . OperatorType . DIV ) ; com . googlecode . aviator . runtime . type . AviatorObject result = fun . call ( env , com . googlecode . aviator . runtime . type . AviatorLong . valueOf ( 10L ) , com . googlecode . aviator . runtime . type . AviatorLong . valueOf ( 11L ) ) ; "<AssertPlaceHolder>" ; } getValue ( java . util . Map ) { return ( "/" + ( this . pattern . pattern ( ) ) ) + "/" ; } | org . junit . Assert . assertEquals ( 0 , ( ( java . lang . Long ) ( result . getValue ( null ) ) ) , 0.0 ) |
testDelete ( ) { final net . violet . platform . datamodel . VObject myRecord = Factories . VOBJECT . find ( 31 ) ; try { final long event_id = Factories . EVENT . insert ( myRecord . getId ( ) . intValue ( ) , 100 , 100 , 100 ) ; net . violet . platform . datamodel . Event theEvent = Factories . EVENT . find ( event_id ) ; theEvent . delete ( ) ; theEvent = Factories . EVENT . find ( event_id ) ; "<AssertPlaceHolder>" ; } catch ( final java . sql . SQLException e ) { e . printStackTrace ( ) ; } } find ( java . util . regex . Matcher ) { int nbFind = 0 ; while ( myMatcher . find ( ) ) { nbFind ++ ; } return nbFind ; } | org . junit . Assert . assertNull ( theEvent ) |
testProxyBaseURLFlagSetWithTemplateNoHeaders ( ) { createAppContext ( "http://${X-Forwarded-Host}/${X-Forwarded-Path}/geoserver" , true , null , null , null , null , null , null ) ; java . lang . StringBuilder baseURL = new java . lang . StringBuilder ( ) ; this . mangler . mangleURL ( baseURL , new java . lang . StringBuilder ( ) , new java . util . HashMap < java . lang . String , java . lang . String > ( ) , URLMangler . URLType . SERVICE ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "StyleWriterConverter<sp>[version=" + ( version ) ) + ",<sp>handler=" ) + ( handler ) ) + "]" ; } | org . junit . Assert . assertEquals ( "" , baseURL . toString ( ) ) |
testTwoConditions ( ) { org . apache . uima . jcas . JCas jcas = makeJCasOneSentence ( ) ; org . apache . uima . cas . CAS cas = jcas . getCas ( ) ; java . util . List < de . tudarmstadt . ukp . dkpro . core . api . segmentation . type . Token > tokens = new java . util . ArrayList ( select ( jcas , de . tudarmstadt . ukp . dkpro . core . api . segmentation . type . Token . class ) ) ; de . tudarmstadt . ukp . dkpro . core . api . segmentation . type . Token t1 = tokens . get ( 0 ) ; de . tudarmstadt . ukp . dkpro . core . api . segmentation . type . Token t2 = tokens . get ( ( ( tokens . size ( ) ) - 1 ) ) ; de . tudarmstadt . ukp . dkpro . core . api . ner . type . NamedEntity gov = new de . tudarmstadt . ukp . dkpro . core . api . ner . type . NamedEntity ( jcas , t1 . getBegin ( ) , t1 . getEnd ( ) ) ; gov . setValue ( "Animal" ) ; gov . addToIndexes ( ) ; de . tudarmstadt . ukp . dkpro . core . api . ner . type . NamedEntity dep = new de . tudarmstadt . ukp . dkpro . core . api . ner . type . NamedEntity ( jcas , t2 . getBegin ( ) , t2 . getEnd ( ) ) ; dep . setValue ( "NotWeight" ) ; dep . addToIndexes ( ) ; org . apache . uima . cas . Type relationType = cas . getTypeSystem ( ) . getType ( "webanno.custom.Relation" ) ; org . apache . uima . cas . text . AnnotationFS fs1 = cas . createAnnotation ( relationType , dep . getBegin ( ) , dep . getEnd ( ) ) ; org . apache . uima . fit . util . FSUtil . setFeature ( fs1 , "Governor" , gov ) ; org . apache . uima . fit . util . FSUtil . setFeature ( fs1 , "Dependent" , dep ) ; cas . addFsToIndexes ( fs1 ) ; de . tudarmstadt . ukp . clarin . webanno . constraints . grammar . ConstraintsGrammar parser = new de . tudarmstadt . ukp . clarin . webanno . constraints . grammar . ConstraintsGrammar ( new java . io . FileInputStream ( "src/test/resources/rules/twoConditions.rules" ) ) ; de . tudarmstadt . ukp . clarin . webanno . constraints . grammar . syntaxtree . Parse p = parser . Parse ( ) ; de . tudarmstadt . ukp . clarin . webanno . constraints . model . ParsedConstraints constraints = p . accept ( new de . tudarmstadt . ukp . clarin . webanno . constraints . visitor . ParserVisitor ( ) ) ; de . tudarmstadt . ukp . clarin . webanno . constraints . evaluator . Evaluator constraintsEvaluator = new de . tudarmstadt . ukp . clarin . webanno . constraints . evaluator . ValuesGenerator ( ) ; java . util . List < de . tudarmstadt . ukp . clarin . webanno . constraints . evaluator . PossibleValue > possibleValues = constraintsEvaluator . generatePossibleValues ( fs1 , "label" , constraints ) ; System . out . println ( possibleValues ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; } | org . junit . Assert . assertEquals ( 0 , possibleValues . size ( ) ) |
createDirectoryNotExitingTest ( ) { com . github . hermannpencole . nifi . config . service . List < java . lang . String > branch = com . github . hermannpencole . nifi . config . service . Arrays . asList ( "root" , "elt2" ) ; com . github . hermannpencole . nifi . config . service . ProcessGroupFlowEntity responseRoot = com . github . hermannpencole . nifi . config . service . TestUtils . createProcessGroupFlowEntity ( "root" , "root" ) ; responseRoot . getProcessGroupFlow ( ) . getFlow ( ) . getProcessGroups ( ) . add ( com . github . hermannpencole . nifi . config . service . TestUtils . createProcessGroupEntity ( "idElt1" , "elt1" ) ) ; when ( flowApiMock . getFlow ( responseRoot . getProcessGroupFlow ( ) . getId ( ) ) ) . thenReturn ( responseRoot ) ; com . github . hermannpencole . nifi . config . service . ProcessGroupFlowEntity responseElt = com . github . hermannpencole . nifi . config . service . TestUtils . createProcessGroupFlowEntity ( "idElt2" , "elt2" ) ; when ( processGroupsApiMock . createProcessGroup ( any ( ) , any ( ) ) ) . thenReturn ( com . github . hermannpencole . nifi . config . service . TestUtils . createProcessGroupEntity ( "idElt2" , "elt2" ) ) ; when ( flowApiMock . getFlow ( responseElt . getProcessGroupFlow ( ) . getId ( ) ) ) . thenReturn ( responseElt ) ; com . google . inject . Injector injector = com . google . inject . Guice . createInjector ( new com . google . inject . AbstractModule ( ) { protected void configure ( ) { bind ( com . github . hermannpencole . nifi . config . service . ProcessGroupService . class ) . toInstance ( processGroupService ) ; bind ( com . github . hermannpencole . nifi . swagger . client . ProcessGroupsApi . class ) . toInstance ( processGroupsApiMock ) ; bind ( com . github . hermannpencole . nifi . config . service . ProcessorService . class ) . toInstance ( processorServiceMock ) ; bind ( com . github . hermannpencole . nifi . config . service . ConnectionService . class ) . toInstance ( connectionServiceMock ) ; bind ( com . github . hermannpencole . nifi . swagger . client . FlowApi . class ) . toInstance ( flowApiMock ) ; bind ( com . github . hermannpencole . nifi . config . service . Integer . class ) . annotatedWith ( com . google . inject . name . Names . named ( "timeout" ) ) . toInstance ( 1 ) ; bind ( com . github . hermannpencole . nifi . config . service . Integer . class ) . annotatedWith ( com . google . inject . name . Names . named ( "interval" ) ) . toInstance ( 1 ) ; bind ( com . github . hermannpencole . nifi . config . service . Boolean . class ) . annotatedWith ( com . google . inject . name . Names . named ( "forceMode" ) ) . toInstance ( false ) ; bind ( com . github . hermannpencole . nifi . config . service . Double . class ) . annotatedWith ( com . google . inject . name . Names . named ( "placeWidth" ) ) . toInstance ( 1200.0 ) ; bind ( com . github . hermannpencole . nifi . config . service . PositionDTO . class ) . annotatedWith ( com . google . inject . name . Names . named ( "timeout" 0 ) ) . toInstance ( com . github . hermannpencole . nifi . config . Main . createPosition ( "0,0" ) ) ; } } ) ; com . github . hermannpencole . nifi . config . service . ProcessGroupFlowEntity response = injector . getInstance ( com . github . hermannpencole . nifi . config . service . ProcessGroupService . class ) . createDirectory ( branch ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( "idElt2" , response . getProcessGroupFlow ( ) . getId ( ) ) |
isDefinedAt_A$int_Nil ( ) { com . m3 . scalaflavor4j . Seq < java . lang . Integer > seq = com . m3 . scalaflavor4j . Seq . apply ( ) ; for ( int i = - 3 ; i < 3 ; i ++ ) { boolean actual = seq . isDefinedAt ( i ) ; boolean expected = false ; "<AssertPlaceHolder>" ; } } isDefinedAt ( java . lang . Object ) { return getCaseClauses ( ) . foldLeft ( false , new com . m3 . scalaflavor4j . F2 < java . lang . Boolean , com . m3 . scalaflavor4j . CaseClause < ? , R > , java . lang . Boolean > ( ) { public com . m3 . scalaflavor4j . Boolean apply ( java . lang . Boolean isDefinedAt , com . m3 . scalaflavor4j . CaseClause < ? , R > caseClause ) throws com . m3 . scalaflavor4j . Exception { if ( isDefinedAt ) { return true ; } return caseClause . isDefinedAt ( v ) ; } } ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) ) |
testEquals_differentOpenInterest ( ) { com . sumzerotrading . data . BarData [ ] bars = getEqualBars ( ) ; bars [ 0 ] . setOpenInterest ( 0 ) ; "<AssertPlaceHolder>" ; } getEqualBars ( ) { java . time . LocalDateTime cal = java . time . LocalDateTime . now ( ) ; java . math . BigDecimal open = new java . math . BigDecimal ( 1 ) ; java . math . BigDecimal high = new java . math . BigDecimal ( 2 ) ; java . math . BigDecimal low = new java . math . BigDecimal ( 3 ) ; java . math . BigDecimal close = new java . math . BigDecimal ( 4 ) ; java . math . BigDecimal volume = new java . math . BigDecimal ( 5 ) ; long openInterest = 6 ; com . sumzerotrading . data . BarData [ ] bars = new com . sumzerotrading . data . BarData [ 2 ] ; bars [ 0 ] = new com . sumzerotrading . data . BarData ( cal , open , high , low , close , volume , openInterest ) ; bars [ 1 ] = new com . sumzerotrading . data . BarData ( cal , open , high , low , close , volume , openInterest ) ; return bars ; } | org . junit . Assert . assertFalse ( bars [ 0 ] . equals ( bars [ 1 ] ) ) |
get_returnsValue ( ) { array . add ( 23 ) ; org . eclipse . rap . json . JsonValue value = array . get ( 0 ) ; "<AssertPlaceHolder>" ; } valueOf ( int ) { return new org . eclipse . rap . json . JsonNumber ( java . lang . Integer . toString ( value , 10 ) ) ; } | org . junit . Assert . assertEquals ( org . eclipse . rap . json . JsonValue . valueOf ( 23 ) , value ) |
should_set_reason_in_flag_with_type_other ( ) { org . mamute . model . Flag flag = flag ( FlagType . OTHER , user ( "author" , "author@brutal.com" ) ) ; java . lang . String reason = "blabla" ; flag . setReason ( reason ) ; "<AssertPlaceHolder>" ; } getReason ( ) { return reason ; } | org . junit . Assert . assertEquals ( reason , flag . getReason ( ) ) |
testDeleteOrganizationSiteOnlyRemovesSiteRoles ( ) { com . liferay . portal . kernel . model . Organization organization = com . liferay . portal . kernel . service . OrganizationLocalServiceUtil . addOrganization ( com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) , OrganizationConstants . DEFAULT_PARENT_ORGANIZATION_ID , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , true ) ; com . liferay . portal . kernel . model . Group organizationSite = com . liferay . portal . kernel . service . GroupLocalServiceUtil . getOrganizationGroup ( com . liferay . portal . kernel . test . util . TestPropsValues . getCompanyId ( ) , organization . getOrganizationId ( ) ) ; organizationSite . setManualMembership ( true ) ; com . liferay . portal . kernel . model . User user = com . liferay . portal . kernel . test . util . UserTestUtil . addOrganizationOwnerUser ( organization ) ; com . liferay . portal . kernel . service . UserLocalServiceUtil . addGroupUser ( organizationSite . getGroupId ( ) , user . getUserId ( ) ) ; com . liferay . portal . kernel . service . UserLocalServiceUtil . addOrganizationUsers ( organization . getOrganizationId ( ) , new long [ ] { user . getUserId ( ) } ) ; com . liferay . portal . kernel . model . Role siteRole = com . liferay . portal . kernel . test . util . RoleTestUtil . addRole ( RoleConstants . TYPE_SITE ) ; com . liferay . portal . kernel . service . UserGroupRoleLocalServiceUtil . addUserGroupRoles ( user . getUserId ( ) , organizationSite . getGroupId ( ) , new long [ ] { siteRole . getRoleId ( ) } ) ; com . liferay . portal . kernel . service . GroupLocalServiceUtil . deleteGroup ( organizationSite ) ; "<AssertPlaceHolder>" ; com . liferay . portal . kernel . service . UserLocalServiceUtil . deleteUser ( user ) ; com . liferay . portal . kernel . service . OrganizationLocalServiceUtil . deleteOrganization ( organization ) ; } getUserGroupRolesCount ( long , long ) { return com . liferay . portal . kernel . service . UserGroupRoleLocalServiceUtil . getService ( ) . getUserGroupRolesCount ( userId , groupId ) ; } | org . junit . Assert . assertEquals ( 1 , com . liferay . portal . kernel . service . UserGroupRoleLocalServiceUtil . getUserGroupRolesCount ( user . getUserId ( ) , organizationSite . getGroupId ( ) ) ) |
isValidLoraGatewayReturnsFalseForTooBigLoraPort ( ) { final io . vertx . core . json . JsonObject gateway = getValidGateway ( ) ; final io . vertx . core . json . JsonObject loraConfig = org . eclipse . hono . adapter . lora . providers . LoraUtils . getLoraConfigFromLoraGatewayDevice ( gateway ) ; loraConfig . put ( "lora-port" , 65536 ) ; "<AssertPlaceHolder>" ; } isValidLoraGateway ( io . vertx . core . json . JsonObject ) { final io . vertx . core . json . JsonObject data = gateway . getJsonObject ( RegistrationConstants . FIELD_DATA ) ; if ( data == null ) { return false ; } final io . vertx . core . json . JsonObject loraConfig = data . getJsonObject ( LoraConstants . FIELD_LORA_CONFIG ) ; if ( loraConfig == null ) { return false ; } try { final java . lang . String provider = loraConfig . getString ( LoraConstants . FIELD_LORA_PROVIDER ) ; if ( org . eclipse . hono . adapter . lora . providers . LoraUtils . isBlank ( provider ) ) { return false ; } final java . lang . String authId = loraConfig . getString ( LoraConstants . FIELD_AUTH_ID ) ; if ( org . eclipse . hono . adapter . lora . providers . LoraUtils . isBlank ( authId ) ) { return false ; } final int port = loraConfig . getInteger ( LoraConstants . FIELD_LORA_DEVICE_PORT ) ; if ( ( port < 0 ) || ( port > 65535 ) ) { return false ; } final java . lang . String url = loraConfig . getString ( LoraConstants . FIELD_LORA_URL ) ; if ( org . eclipse . hono . adapter . lora . providers . LoraUtils . isBlank ( url ) ) { return false ; } } catch ( java . lang . ClassCastException | io . vertx . core . json . DecodeException e ) { return false ; } return true ; } | org . junit . Assert . assertFalse ( org . eclipse . hono . adapter . lora . providers . LoraUtils . isValidLoraGateway ( gateway ) ) |
testIsIntersectsSphere ( ) { org . parallax3d . parallax . math . Sphere a = new org . parallax3d . parallax . math . Sphere ( org . parallax3d . parallax . math . SphereTest . one3 , 1 ) ; org . parallax3d . parallax . math . Sphere b = new org . parallax3d . parallax . math . Sphere ( org . parallax3d . parallax . math . SphereTest . zero3 , 1 ) ; org . parallax3d . parallax . math . Sphere c = new org . parallax3d . parallax . math . Sphere ( org . parallax3d . parallax . math . SphereTest . zero3 , 0.25 ) ; "<AssertPlaceHolder>" ; } isIntersectsSphere ( org . parallax3d . parallax . math . Sphere ) { org . parallax3d . parallax . math . Vector3 center = sphere . getCenter ( ) ; double negRadius = - ( sphere . getRadius ( ) ) ; for ( int i = 0 ; i < 6 ; i ++ ) { double distance = planes . get ( i ) . distanceToPoint ( center ) ; if ( distance < negRadius ) { return false ; } } return true ; } | org . junit . Assert . assertTrue ( a . isIntersectsSphere ( b ) ) |
convertToLongNull ( ) { java . lang . Long out = converter . toLong ( null ) ; "<AssertPlaceHolder>" ; } toLong ( java . lang . Long ) { return value != null ? new java . lang . Long ( value ) : null ; } | org . junit . Assert . assertNull ( out ) |
testNormalizeNone ( ) { ch . cyberduck . core . transfer . normalizer . CopyRootPathsNormalizer normalizer = new ch . cyberduck . core . transfer . normalizer . CopyRootPathsNormalizer ( ) ; final java . util . HashMap < ch . cyberduck . core . Path , ch . cyberduck . core . Path > files = new java . util . HashMap < ch . cyberduck . core . Path , ch . cyberduck . core . Path > ( ) ; files . put ( new ch . cyberduck . core . Path ( "/p" , java . util . EnumSet . of ( Path . Type . directory ) ) , new ch . cyberduck . core . Path ( "/d" , java . util . EnumSet . of ( Path . Type . directory ) ) ) ; "<AssertPlaceHolder>" ; } normalize ( java . util . List ) { final java . util . List < ch . cyberduck . core . transfer . TransferItem > normalized = new java . util . ArrayList < ch . cyberduck . core . transfer . TransferItem > ( ) ; for ( ch . cyberduck . core . transfer . TransferItem upload : roots ) { boolean duplicate = false ; for ( java . util . Iterator < ch . cyberduck . core . transfer . TransferItem > iter = normalized . iterator ( ) ; iter . hasNext ( ) ; ) { ch . cyberduck . core . transfer . TransferItem n = iter . next ( ) ; if ( upload . local . isChild ( n . local ) ) { duplicate = true ; break ; } if ( n . local . isChild ( upload . local ) ) { iter . remove ( ) ; } if ( upload . remote . equals ( n . remote ) ) { final ch . cyberduck . core . Path parent = upload . remote . getParent ( ) ; final java . lang . String filename = upload . remote . getName ( ) ; java . lang . String proposal ; int no = 0 ; int index = filename . lastIndexOf ( '.' ) ; ch . cyberduck . core . Path remote ; do { if ( ( index != ( - 1 ) ) && ( index != 0 ) ) { proposal = java . lang . String . format ( "%s-%d%s" , filename . substring ( 0 , index ) , ( ++ no ) , filename . substring ( index ) ) ; } else { proposal = java . lang . String . format ( "%s-%d" , filename , ( ++ no ) ) ; } remote = new ch . cyberduck . core . Path ( parent , proposal , upload . remote . getType ( ) ) ; } while ( false ) ; if ( ch . cyberduck . core . transfer . normalizer . UploadRootPathsNormalizer . log . isInfoEnabled ( ) ) { ch . cyberduck . core . transfer . normalizer . UploadRootPathsNormalizer . log . info ( java . lang . String . format ( "Changed<sp>name<sp>from<sp>%s<sp>to<sp>%s" , filename , remote . getName ( ) ) ) ; } upload . remote = remote ; } } if ( ! duplicate ) { normalized . add ( new ch . cyberduck . core . transfer . TransferItem ( upload . remote , upload . local ) ) ; } } return normalized ; } | org . junit . Assert . assertEquals ( files , normalizer . normalize ( files ) ) |
testBuildWithParameters ( ) { org . lnu . is . domain . person . Person person = new org . lnu . is . domain . person . Person ( ) ; org . lnu . is . domain . education . type . EducationType addressType = new org . lnu . is . domain . education . type . EducationType ( ) ; org . lnu . is . domain . person . paper . PersonPaper personPaper = new org . lnu . is . domain . person . paper . PersonPaper ( ) ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date endDate = new java . util . Date ( ) ; org . lnu . is . domain . person . education . PersonEducation context = new org . lnu . is . domain . person . education . PersonEducation ( ) ; context . setPerson ( person ) ; context . setEducationType ( addressType ) ; context . setPersonPaper ( personPaper ) ; context . setBegDate ( begDate ) ; context . setEndDate ( endDate ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>PersonEducation<sp>e<sp>WHERE<sp>(<sp>e.person<sp>=<sp>:person<sp>AND<sp>e.educationType<sp>=<sp>:educationType<sp>AND<sp>e.person<sp>=<sp>:person<sp>AND<sp>e.begDate<sp><=<sp>:begDate<sp>AND<sp>e.endDate<sp>>=<sp>:endDate)<sp>AND<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . person . education . PersonEducation > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
testItself ( ) { java . lang . String smiles = "C1CCCCCCC1CC" ; org . openscience . cdk . isomorphism . matchers . QueryAtomContainer query = org . openscience . cdk . isomorphism . matchers . QueryAtomContainerCreator . createAnyAtomContainer ( new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) . parseSmiles ( smiles ) , true ) ; org . openscience . cdk . interfaces . IAtomContainer ac = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) . parseSmiles ( smiles ) ; if ( standAlone ) { System . out . println ( ( "AtomCount<sp>of<sp>query:<sp>" + ( query . getAtomCount ( ) ) ) ) ; System . out . println ( ( "AtomCount<sp>of<sp>target:<sp>" + ( ac . getAtomCount ( ) ) ) ) ; } boolean matched = uiTester . isSubgraph ( ac , query ) ; if ( standAlone ) System . out . println ( ( "QueryAtomContainer<sp>matched:<sp>" + matched ) ) ; if ( ! ( standAlone ) ) "<AssertPlaceHolder>" ; } isSubgraph ( org . openscience . cdk . interfaces . IAtomContainer , org . openscience . cdk . interfaces . IAtomContainer ) { if ( g1 instanceof org . openscience . cdk . isomorphism . matchers . IQueryAtomContainer ) throw new org . openscience . cdk . exception . CDKException ( "The<sp>first<sp>IAtomContainer<sp>must<sp>not<sp>be<sp>an<sp>IQueryAtomContainer" ) ; if ( ( g2 . getAtomCount ( ) ) > ( g1 . getAtomCount ( ) ) ) return false ; if ( ( g2 . getAtomCount ( ) ) == 1 ) { org . openscience . cdk . interfaces . IAtom atom = g2 . getAtom ( 0 ) ; for ( int i = 0 ; i < ( g1 . getAtomCount ( ) ) ; i ++ ) { org . openscience . cdk . interfaces . IAtom atom2 = g1 . getAtom ( i ) ; if ( atom instanceof org . openscience . cdk . isomorphism . matchers . IQueryAtom ) { org . openscience . cdk . isomorphism . matchers . IQueryAtom qAtom = ( ( org . openscience . cdk . isomorphism . matchers . IQueryAtom ) ( atom ) ) ; if ( qAtom . matches ( atom2 ) ) return true ; } else if ( atom2 instanceof org . openscience . cdk . isomorphism . matchers . IQueryAtom ) { org . openscience . cdk . isomorphism . matchers . IQueryAtom qAtom = ( ( org . openscience . cdk . isomorphism . matchers . IQueryAtom ) ( atom2 ) ) ; if ( qAtom . matches ( atom ) ) return true ; } else { if ( atom2 . getSymbol ( ) . equals ( atom . getSymbol ( ) ) ) return true ; } } return false ; } if ( ! ( org . openscience . cdk . isomorphism . UniversalIsomorphismTester . testSubgraphHeuristics ( g1 , g2 ) ) ) return false ; return ( getSubgraphMap ( g1 , g2 ) ) != null ; } | org . junit . Assert . assertTrue ( matched ) |
loadCert ( ) { java . io . InputStream is = null ; try { is = io . grpc . testing . TlsTesting . loadCert ( "ca.key" ) ; "<AssertPlaceHolder>" ; } finally { if ( is != null ) { is . close ( ) ; } } } loadCert ( java . lang . String ) { return io . grpc . testing . TestUtils . class . getResourceAsStream ( ( "/certs/" + name ) ) ; } | org . junit . Assert . assertNotNull ( is ) |
setIpAddressAsHostOption2 ( ) { java . net . URI webserviceURI = new java . net . URI ( ( ( ( ( "coap://" + ( de . uzl . itm . ncoap . communication . codec . AllowDefaultOptionValues . HOST ) ) + ":" ) + ( de . uzl . itm . ncoap . message . options . OptionValue . URI_PORT_DEFAULT ) ) + "/registry" ) ) ; de . uzl . itm . ncoap . message . CoapRequest coapRequest = new de . uzl . itm . ncoap . message . CoapRequest ( de . uzl . itm . ncoap . message . MessageType . CON , de . uzl . itm . ncoap . message . MessageCode . POST , webserviceURI , false ) ; coapRequest . addOption ( Option . URI_HOST , new de . uzl . itm . ncoap . message . options . StringOptionValue ( de . uzl . itm . ncoap . message . options . Option . URI_HOST , de . uzl . itm . ncoap . communication . codec . AllowDefaultOptionValues . HOST_ENCODED ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( false ) |
validFloatGreaterThanConstraintShouldNotCreateViolations ( ) { java . util . Set < javax . validation . ConstraintViolation < org . alien4cloud . tosca . model . definitions . PropertyDefinition > > violations = validator . validate ( createGreaterThanDefinition ( ToscaTypes . FLOAT . toString ( ) , 42.456F ) , alien4cloud . tosca . container . validation . ToscaSequence . class ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "name:<sp>[" + ( name ) ) + "],<sp>value:<sp>[" ) + ( value ) ) + "]" ; } | org . junit . Assert . assertEquals ( 0 , violations . size ( ) ) |
testGetOrientation_onPopupMenu ( ) { org . eclipse . swt . widgets . Menu menu = new org . eclipse . swt . widgets . Menu ( shell , org . eclipse . swt . SWT . POP_UP ) ; menu . setOrientation ( SWT . RIGHT_TO_LEFT ) ; "<AssertPlaceHolder>" ; } getOrientation ( ) { if ( ( ( getCurSide ( ) ) == ( org . eclipse . swt . SWT . LEFT ) ) || ( ( getCurSide ( ) ) == ( org . eclipse . swt . SWT . RIGHT ) ) ) return org . eclipse . swt . SWT . VERTICAL ; return org . eclipse . swt . SWT . HORIZONTAL ; } | org . junit . Assert . assertEquals ( SWT . RIGHT_TO_LEFT , menu . getOrientation ( ) ) |
testIndexTwo ( ) { java . lang . String regex = "^/([^/]+)/([^/]+)" ; org . apache . druid . query . extraction . ExtractionFn extractionFn = new org . apache . druid . query . extraction . RegexDimExtractionFn ( regex , 2 , true , null ) ; java . util . Set < java . lang . String > extracted = new java . util . LinkedHashSet ( ) ; for ( java . lang . String path : org . apache . druid . query . extraction . RegexDimExtractionFnTest . paths ) { extracted . add ( extractionFn . apply ( path ) ) ; } java . util . Set < java . lang . String > expected = com . google . common . collect . Sets . newLinkedHashSet ( com . google . common . collect . ImmutableList . of ( "prod" , "demo" , "aloe" , "baloo" ) ) ; "<AssertPlaceHolder>" ; } of ( java . lang . String , org . joda . time . Interval , java . lang . String , org . apache . druid . timeline . partition . ShardSpec ) { return org . apache . druid . timeline . SegmentId . of ( dataSource , interval , version , ( shardSpec != null ? shardSpec . getPartitionNum ( ) : 0 ) ) ; } | org . junit . Assert . assertEquals ( expected , extracted ) |
testSecuredFeatureTypeInfoMetadata ( ) { org . geoserver . security . decorators . SecuredFeatureTypeInfo ro = new org . geoserver . security . decorators . SecuredFeatureTypeInfo ( states , org . geoserver . security . WrapperPolicy . metadata ( null ) ) ; try { ro . getFeatureSource ( null , null ) ; org . junit . Assert . fail ( "This<sp>should<sp>have<sp>failed<sp>with<sp>a<sp>security<sp>exception" ) ; } catch ( java . lang . Exception e ) { if ( ( org . geoserver . security . decorators . ReadOnlyDataStoreTest . isSpringSecurityException ( e ) ) == false ) org . junit . Assert . fail ( "Should<sp>have<sp>failed<sp>with<sp>a<sp>security<sp>exception" ) ; } org . geoserver . security . decorators . SecuredDataStoreInfo store = ( ( org . geoserver . security . decorators . SecuredDataStoreInfo ) ( ro . getStore ( ) ) ) ; "<AssertPlaceHolder>" ; } isMetadata ( ) { return ( ( level ) == ( AccessLevel . METADATA ) ) && ( ( response ) == ( Response . CHALLENGE ) ) ; } | org . junit . Assert . assertTrue ( ( ( org . geoserver . security . decorators . SecuredDataStoreInfo ) ( store ) ) . policy . isMetadata ( ) ) |
testCsvDoesNotExist ( ) { java . util . List < java . util . List < java . lang . String > > data = org . pentaho . platform . dataaccess . datasource . wizard . service . impl . utils . DatasourceServiceHelper . getCsvDataSample ( "target/test-classes/doesnotexist.csv" , true , "," , "\"" , 10 ) ; "<AssertPlaceHolder>" ; } getCsvDataSample ( java . lang . String , boolean , java . lang . String , java . lang . String , int ) { org . pentaho . metadata . query . model . util . CsvDataReader reader = new org . pentaho . metadata . query . model . util . CsvDataReader ( fileLocation , headerPresent , delimiter , enclosure , rowLimit ) ; return reader . loadData ( ) ; } | org . junit . Assert . assertEquals ( 0 , data . size ( ) ) |
testInvertedNullFieldShouldMatch ( ) { final java . lang . String fieldName = "nullfield" ; final org . graylog2 . plugin . streams . StreamRule rule = getSampleRule ( ) ; rule . setField ( fieldName ) ; rule . setInverted ( true ) ; final org . graylog2 . plugin . Message msg = getSampleMessage ( ) ; msg . addField ( fieldName , null ) ; final org . graylog2 . streams . matchers . StreamRuleMatcher matcher = getMatcher ( rule ) ; "<AssertPlaceHolder>" ; } match ( org . graylog2 . plugin . Message , org . graylog2 . plugin . streams . StreamRule ) { java . lang . Double msgVal = getDouble ( msg . getField ( rule . getField ( ) ) ) ; if ( msgVal == null ) { return false ; } java . lang . Double ruleVal = getDouble ( rule . getValue ( ) ) ; if ( ruleVal == null ) { return false ; } return ( rule . getInverted ( ) ) ^ ( msgVal > ruleVal ) ; } | org . junit . Assert . assertTrue ( matcher . match ( msg , rule ) ) |
findsLongestNameByReduce ( ) { com . insightfullogic . java8 . examples . chapter1 . Artist artist = com . insightfullogic . java8 . exercises . chapter5 . LongestName . byReduce ( com . insightfullogic . java8 . examples . chapter1 . SampleData . getThreeArtists ( ) ) ; "<AssertPlaceHolder>" ; } getThreeArtists ( ) { return java . util . Arrays . asList ( com . insightfullogic . java8 . examples . chapter1 . SampleData . johnColtrane , com . insightfullogic . java8 . examples . chapter1 . SampleData . johnLennon , com . insightfullogic . java8 . examples . chapter1 . SampleData . theBeatles ) ; } | org . junit . Assert . assertEquals ( SampleData . johnColtrane , artist ) |
userInfoTableUpdatesOperatorStatus ( ) { saveUserOne ( ) ; com . djrapitops . plan . db . CommonDBTest . db . executeTransaction ( new com . djrapitops . plan . db . OperatorStatusTransaction ( playerUUID , true ) ) ; com . djrapitops . plan . db . List < com . djrapitops . plan . db . UserInfo > userInfo = com . djrapitops . plan . db . CommonDBTest . db . query ( com . djrapitops . plan . db . UserInfoQueries . fetchUserInformationOfUser ( playerUUID ) ) ; com . djrapitops . plan . db . List < com . djrapitops . plan . db . UserInfo > expected = com . djrapitops . plan . db . Collections . singletonList ( new com . djrapitops . plan . db . UserInfo ( playerUUID , com . djrapitops . plan . db . CommonDBTest . serverUUID , 1000L , true , false ) ) ; "<AssertPlaceHolder>" ; } fetchUserInformationOfUser ( com . djrapitops . plan . db . access . queries . objects . UUID ) { java . lang . String sql = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( SELECT ) + ( com . djrapitops . plan . db . sql . tables . UserInfoTable . TABLE_NAME ) ) + "." ) + ( com . djrapitops . plan . db . sql . tables . UserInfoTable . REGISTERED ) ) + ",<sp>" ) + ( com . djrapitops . plan . db . sql . tables . UserInfoTable . BANNED ) ) + ",<sp>" ) + ( com . djrapitops . plan . db . sql . tables . UserInfoTable . OP ) ) + ",<sp>" ) + ( com . djrapitops . plan . db . sql . tables . UserInfoTable . SERVER_UUID ) ) + ( FROM ) ) + ( com . djrapitops . plan . db . sql . tables . UserInfoTable . TABLE_NAME ) ) + ( WHERE ) ) + ( com . djrapitops . plan . db . sql . tables . UserInfoTable . TABLE_NAME ) ) + "." ) + ( com . djrapitops . plan . db . sql . tables . UserInfoTable . USER_UUID ) ) + "=?" ; return new com . djrapitops . plan . db . access . QueryStatement < com . djrapitops . plan . db . access . queries . objects . List < com . djrapitops . plan . data . container . UserInfo > > ( sql ) { @ com . djrapitops . plan . db . access . queries . objects . Override public void prepare ( java . sql . PreparedStatement statement ) throws java . sql . SQLException { statement . setString ( 1 , playerUUID . toString ( ) ) ; } @ com . djrapitops . plan . db . access . queries . objects . Override public com . djrapitops . plan . db . access . queries . objects . List < com . djrapitops . plan . data . container . UserInfo > processResults ( java . sql . ResultSet set ) throws java . sql . SQLException { com . djrapitops . plan . db . access . queries . objects . List < com . djrapitops . plan . data . container . UserInfo > userInformation = new com . djrapitops . plan . db . access . queries . objects . ArrayList ( ) ; while ( set . next ( ) ) { long registered = set . getLong ( UserInfoTable . REGISTERED ) ; boolean op = set . getBoolean ( UserInfoTable . OP ) ; boolean banned = set . getBoolean ( UserInfoTable . BANNED ) ; com . djrapitops . plan . db . access . queries . objects . UUID serverUUID = com . djrapitops . plan . db . access . queries . objects . UUID . fromString ( set . getString ( UserInfoTable . SERVER_UUID ) ) ; userInformation . add ( new com . djrapitops . plan . data . container . UserInfo ( playerUUID , serverUUID , registered , op , banned ) ) ; } return userInformation ; } } ; } | org . junit . Assert . assertEquals ( expected , userInfo ) |
testNoCommonReturnTypeFails ( ) { try { final org . apache . calcite . rex . RexNode node = coalesce ( vVarchar ( 1 ) , vInt ( 2 ) ) ; org . junit . Assert . fail ( ( "expected<sp>exception,<sp>got<sp>" + node ) ) ; } catch ( java . lang . IllegalArgumentException e ) { final java . lang . String expected = "Cannot<sp>infer<sp>return<sp>type<sp>for<sp>COALESCE;" + "<sp>operand<sp>types:<sp>[VARCHAR,<sp>INTEGER]" ; "<AssertPlaceHolder>" ; } } getMessage ( ) { return ( ( super . getMessage ( ) ) + ":<sp>" ) + ( getCause ( ) . getMessage ( ) ) ; } | org . junit . Assert . assertThat ( e . getMessage ( ) , org . hamcrest . CoreMatchers . is ( expected ) ) |
testJson ( ) { org . nd4j . shade . jackson . databind . ObjectMapper om = new org . nd4j . shade . jackson . databind . ObjectMapper ( ) ; om . configure ( DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , false ) ; om . configure ( SerializationFeature . FAIL_ON_EMPTY_BEANS , false ) ; om . configure ( MapperFeature . SORT_PROPERTIES_ALPHABETICALLY , true ) ; om . enable ( SerializationFeature . INDENT_OUTPUT ) ; org . nd4j . linalg . schedule . ISchedule [ ] schedules = new org . nd4j . linalg . schedule . ISchedule [ ] { new org . nd4j . linalg . schedule . ExponentialSchedule ( ScheduleType . ITERATION , 1.0 , 0.5 ) , new org . nd4j . linalg . schedule . InverseSchedule ( ScheduleType . ITERATION , 1.0 , 0.5 , 2 ) , new org . nd4j . linalg . schedule . MapSchedule . Builder ( ScheduleType . ITERATION ) . add ( 0 , 1.0 ) . add ( 10 , 0.5 ) . build ( ) , new org . nd4j . linalg . schedule . PolySchedule ( ScheduleType . ITERATION , 1.0 , 2 , 100 ) , new org . nd4j . linalg . schedule . SigmoidSchedule ( ScheduleType . ITERATION , 1.0 , 0.5 , 10 ) , new org . nd4j . linalg . schedule . StepSchedule ( ScheduleType . ITERATION , 1.0 , 0.9 , 100 ) , new org . nd4j . linalg . schedule . CycleSchedule ( ScheduleType . ITERATION , 1.5 , 100 ) } ; for ( org . nd4j . linalg . schedule . ISchedule s : schedules ) { java . lang . String json = om . writeValueAsString ( s ) ; org . nd4j . linalg . schedule . ISchedule fromJson = om . readValue ( json , org . nd4j . linalg . schedule . ISchedule . class ) ; "<AssertPlaceHolder>" ; } } readValue ( java . lang . String , java . lang . Class ) { try { return jacksonObjectMapper . readValue ( value , valueType ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( s , fromJson ) |
testQueryTopAllShardsWithSorter ( ) { try { com . ctrip . platform . dal . dao . shard . DalHints hints = new com . ctrip . platform . dal . dao . shard . DalHints ( ) ; java . util . List < java . lang . Short > result = queryTopInAllShard ( hints . sortBy ( new com . ctrip . platform . dal . dao . shard . DalQueryDaoTest . TestComparator ( ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ) ; } } size ( ) { return allKeys . size ( ) ; } | org . junit . Assert . assertEquals ( 4 , result . size ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.