input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testGetPackageName_withoutPackage ( ) { java . lang . String packageName = org . eclipse . rap . rwt . internal . lifecycle . LifeCycleAdapterUtil . getPackageName ( "Button" ) ; "<AssertPlaceHolder>" ; } getPackageName ( java . lang . String ) { int index = className . lastIndexOf ( '.' ) ; return index == ( - 1 ) ? "" : className . substring ( 0 , index ) ; } | org . junit . Assert . assertEquals ( "" , packageName ) |
testSimpleInsertion ( ) { java . lang . String string = "Hello<sp>world!" ; for ( char elem : string . toCharArray ( ) ) { charQueue . put ( elem ) ; } charQueue . flushInputBuffer ( ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; while ( ! ( charQueue . isEmpty ( ) ) ) { sb . append ( charQueue . take ( ) ) ; } "<AssertPlaceHolder>" ; } toString ( ) { return fName ; } | org . junit . Assert . assertEquals ( string , sb . toString ( ) ) |
defaultConstructor ( ) { com . madgag . android . listviews . ReflectiveHolderFactory < java . lang . String > factory = com . madgag . android . listviews . ReflectiveHolderFactory . reflectiveFactoryFor ( com . madgag . android . listviews . ReflectiveHolderFactoryTest . StaticViewHolder . class , ( ( java . lang . Object [ ] ) ( null ) ) ) ; com . madgag . android . listviews . ViewHolder < java . lang . String > holder = factory . createViewHolderFor ( null ) ; "<AssertPlaceHolder>" ; } createViewHolderFor ( android . view . View ) { try { args [ 0 ] = view ; return constructor . newInstance ( args ) ; } catch ( java . lang . InstantiationException e ) { throw new java . lang . IllegalArgumentException ( e ) ; } catch ( java . lang . IllegalAccessException e ) { throw new java . lang . IllegalArgumentException ( e ) ; } catch ( java . lang . reflect . InvocationTargetException e ) { throw new java . lang . IllegalArgumentException ( e ) ; } } | org . junit . Assert . assertNotNull ( holder ) |
testSnippetContent ( ) { org . gitlab4j . api . models . Snippet snippet = createSnippet ( new org . gitlab4j . api . models . Snippet ( org . gitlab4j . api . TestSnippetsApi . TEST_SNIPPET_TITLE_1 , org . gitlab4j . api . TestSnippetsApi . TEST_SNIPPET_FILE_NAME_1 , org . gitlab4j . api . TestSnippetsApi . TEST_SNIPPET_CONTENT_1 ) ) ; org . gitlab4j . api . SnippetsApi api = org . gitlab4j . api . TestSnippetsApi . gitLabApi . getSnippetApi ( ) ; java . lang . String snippetContent = api . getSnippetContent ( snippet . getId ( ) ) ; "<AssertPlaceHolder>" ; deleteSnippet ( snippet ) ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( org . gitlab4j . api . TestSnippetsApi . TEST_SNIPPET_CONTENT_1 , snippetContent ) |
testStringObjectField ( ) { info . smart_tools . smartactors . iobject . ifield . IField field = info . smart_tools . smartactors . ioc . ioc . IOC . resolve ( info . smart_tools . smartactors . ioc . named_keys_storage . Keys . getOrAdd ( info . smart_tools . smartactors . iobject . ifield . IField . class . getCanonicalName ( ) ) , "name" ) ; info . smart_tools . smartactors . iobject . iobject . IObject object = info . smart_tools . smartactors . ioc . ioc . IOC . resolve ( info . smart_tools . smartactors . ioc . named_keys_storage . Keys . getOrAdd ( "info.smart_tools.smartactors.iobject.iobject.IObject" ) , "{<sp>\"name\":<sp>\"value\"<sp>}" ) ; java . lang . String value = field . in ( object ) ; "<AssertPlaceHolder>" ; } in ( info . smart_tools . smartactors . iobject . iobject . IObject ) { if ( null == obj ) { throw new info . smart_tools . smartactors . base . exception . invalid_argument_exception . InvalidArgumentException ( "Argument<sp>should<sp>not<sp>be<sp>null." ) ; } java . lang . Object value = obj . getValue ( fieldName ) ; if ( null == value ) { return null ; } return ( ( T ) ( value ) ) ; } | org . junit . Assert . assertEquals ( "value" , value ) |
testLengthNotImply ( ) { org . uberfire . security . authz . Permission p1 = new org . uberfire . security . impl . authz . DotNamedPermission ( "resource.read.r1" , true ) ; org . uberfire . security . authz . Permission p2 = new org . uberfire . security . impl . authz . DotNamedPermission ( "perspective.read.r2" , true ) ; "<AssertPlaceHolder>" ; } implies ( org . uberfire . security . authz . Permission ) { for ( org . uberfire . security . authz . Permission p : permissionSet ) { if ( p . implies ( permission ) ) { return true ; } } return false ; } | org . junit . Assert . assertFalse ( p1 . implies ( p2 ) ) |
testDerivativePipelineAggregation ( ) { com . liferay . portal . search . aggregation . pipeline . DerivativePipelineAggregation derivativePipelineAggregation = com . liferay . portal . search . aggregations . test . AggregationsInstantiationTest . _aggregations . derivative ( "name" , "bucketsPath" ) ; "<AssertPlaceHolder>" ; } derivative ( java . lang . String , java . lang . String ) { return new com . liferay . portal . search . internal . aggregation . pipeline . DerivativePipelineAggregationImpl ( name , bucketsPath ) ; } | org . junit . Assert . assertNotNull ( derivativePipelineAggregation ) |
testBatchAll ( ) { com . alibaba . otter . canal . meta . PeriodMixedMetaManager metaManager = new com . alibaba . otter . canal . meta . PeriodMixedMetaManager ( ) ; com . alibaba . otter . canal . meta . ZooKeeperMetaManager zooKeeperMetaManager = new com . alibaba . otter . canal . meta . ZooKeeperMetaManager ( ) ; zooKeeperMetaManager . setZkClientx ( zkclientx ) ; metaManager . setZooKeeperMetaManager ( zooKeeperMetaManager ) ; metaManager . start ( ) ; doBatchTest ( metaManager ) ; metaManager . clearAllBatchs ( clientIdentity ) ; java . util . Map < java . lang . Long , com . alibaba . otter . canal . protocol . position . PositionRange > ranges = metaManager . listAllBatchs ( clientIdentity ) ; "<AssertPlaceHolder>" ; metaManager . stop ( ) ; } size ( ) { return this . propertySourceList . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , ranges . size ( ) ) |
testShiftOffsetByWhenBetweenBeginningAndEndOffset ( ) { final java . util . Map < org . apache . kafka . common . TopicPartition , java . lang . Long > endOffsets = new java . util . HashMap ( ) ; endOffsets . put ( topicPartition , 4L ) ; consumer . updateEndOffsets ( endOffsets ) ; final java . util . Map < org . apache . kafka . common . TopicPartition , java . lang . Long > beginningOffsets = new java . util . HashMap ( ) ; beginningOffsets . put ( topicPartition , 0L ) ; consumer . updateBeginningOffsets ( beginningOffsets ) ; streamsResetter . shiftOffsetsBy ( consumer , inputTopicPartitions , 3L ) ; final org . apache . kafka . clients . consumer . ConsumerRecords < byte [ ] , byte [ ] > records = consumer . poll ( java . time . Duration . ofMillis ( 500 ) ) ; "<AssertPlaceHolder>" ; } count ( ) { return count ( org . apache . kafka . streams . kstream . Materialized . with ( keySerde , org . apache . kafka . common . serialization . Serdes . Long ( ) ) ) ; } | org . junit . Assert . assertEquals ( 2 , records . count ( ) ) |
testCanSerialiseEntity ( ) { final uk . gov . gchq . gaffer . data . element . Entity entity = new uk . gov . gchq . gaffer . data . element . Entity ( uk . gov . gchq . gaffer . commonutil . TestGroups . ENTITY , "testVertex" ) ; final byte [ ] serialisedEntity = serialiser . serialise ( entity ) ; final uk . gov . gchq . gaffer . data . element . Entity deserialisedEntity = serialiser . deserialise ( serialisedEntity ) ; "<AssertPlaceHolder>" ; } deserialise ( byte [ ] ) { final int [ ] lastDelimiter = new int [ ] { 0 } ; final java . lang . String group = uk . gov . gchq . gaffer . serialisation . util . LengthValueBytesSerialiserUtil . deserialise ( stringSerialiser , bytes , lastDelimiter ) ; if ( group . isEmpty ( ) ) { throw new java . lang . IllegalArgumentException ( ( "Group<sp>is<sp>required<sp>for<sp>deserialising<sp>" + ( uk . gov . gchq . gaffer . data . element . GroupedProperties . class . getSimpleName ( ) ) ) ) ; } final uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition elementDefinition = schema . getElement ( group ) ; if ( null == elementDefinition ) { throw new uk . gov . gchq . gaffer . exception . SerialisationException ( ( ( "No<sp>SchemaElementDefinition<sp>found<sp>for<sp>group<sp>" + group ) + ",<sp>is<sp>this<sp>group<sp>in<sp>your<sp>schema?" ) ) ; } final uk . gov . gchq . gaffer . data . element . GroupedProperties properties = new uk . gov . gchq . gaffer . data . element . GroupedProperties ( group ) ; deserialiseProperties ( bytes , properties , elementDefinition , lastDelimiter ) ; return properties ; } | org . junit . Assert . assertEquals ( entity , deserialisedEntity ) |
testGetDemographicByMyOscarUserName ( ) { org . oscarehr . common . model . Demographic entity = new org . oscarehr . common . model . Demographic ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . setDemographicNo ( null ) ; entity . setMyOscarUserName ( "marc" ) ; dao . save ( entity ) ; "<AssertPlaceHolder>" ; } getDemographicByMyOscarUserName ( java . lang . String ) { java . lang . String q = "From<sp>Demographic<sp>d<sp>where<sp>d.myOscarUserName<sp>=<sp>?<sp>" ; java . util . List < org . oscarehr . common . model . Demographic > rs = getHibernateTemplate ( ) . find ( q , new java . lang . Object [ ] { myOscarUserName } ) ; if ( ( rs . size ( ) ) > 0 ) return rs . get ( 0 ) ; else return null ; } | org . junit . Assert . assertNotNull ( dao . getDemographicByMyOscarUserName ( "marc" ) ) |
testPerLineParser ( ) { addPerLineDelimiter ( ) ; addSearch ( "text" , "(\\S*)" ) ; addValue ( "entry1" , 1 , "a<sp>line<sp>with<sp>some<sp>argy<sp>and<sp>bargy" 0 ) ; addValue ( "entry2" , 2 , "a<sp>line<sp>with<sp>some<sp>argy<sp>and<sp>bargy" 0 ) ; com . sonalake . utah . config . FileBuilder file = new com . sonalake . utah . config . FileBuilder ( ) ; file . addLine ( "a<sp>line<sp>with<sp>some<sp>cats<sp>and<sp>dogs" ) . addLine ( "a<sp>line<sp>with<sp>some<sp>argy<sp>and<sp>bargy" ) ; java . util . List < java . util . Map < java . lang . String , java . lang . String > > results = loadFile ( file ) ; java . util . List < java . util . Map < java . lang . String , java . lang . String > > expectedValues = new java . util . ArrayList < java . util . Map < java . lang . String , java . lang . String > > ( ) { { add ( new java . util . TreeMap < java . lang . String , java . lang . String > ( ) { { put ( "entry1" , "cats" ) ; put ( "entry2" , "dogs" ) ; } } ) ; add ( new java . util . TreeMap < java . lang . String , java . lang . String > ( ) { { put ( "entry1" , "argy" ) ; put ( "entry2" , "bargy" ) ; } } ) ; } } ; "<AssertPlaceHolder>" ; } put ( java . lang . String , java . lang . String ) { current ( ) . put ( key , value ) ; return this ; } | org . junit . Assert . assertEquals ( expectedValues , results ) |
workflowShouldBeDisabledByDefault ( ) { boolean enabled = storage . enabled ( com . spotify . styx . storage . DatastoreStorageTest . WORKFLOW_ID1 ) ; "<AssertPlaceHolder>" ; } enabled ( com . spotify . styx . model . WorkflowId ) { return com . spotify . styx . storage . DatastoreStorage . getWorkflowOpt ( datastore , datastore :: newKeyFactory , workflowId ) . filter ( ( w ) -> w . contains ( com . spotify . styx . storage . DatastoreStorage . PROPERTY_WORKFLOW_ENABLED ) ) . map ( ( workflow ) -> workflow . getBoolean ( com . spotify . styx . storage . DatastoreStorage . PROPERTY_WORKFLOW_ENABLED ) ) . orElse ( com . spotify . styx . storage . DatastoreStorage . DEFAULT_WORKFLOW_ENABLED ) ; } | org . junit . Assert . assertFalse ( enabled ) |
hashCodesFromSameAbsolutePath ( ) { com . beijunyi . parallelgit . filesystem . GitPath p1 = gfs . getPath ( "/a/b/c" ) ; com . beijunyi . parallelgit . filesystem . GitPath p2 = gfs . getPath ( "/a/b/c" ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return ( 31 * ( gfs . hashCode ( ) ) ) + ( java . util . Arrays . hashCode ( path ) ) ; } | org . junit . Assert . assertEquals ( p1 . hashCode ( ) , p2 . hashCode ( ) ) |
testJmsConnectionIdFromJmsConsumerId ( ) { org . apache . qpid . jms . meta . JmsConnectionId id1 = new org . apache . qpid . jms . meta . JmsConnectionId ( firstId ) ; org . apache . qpid . jms . meta . JmsSessionId sessionId = new org . apache . qpid . jms . meta . JmsSessionId ( id1 , 1 ) ; org . apache . qpid . jms . meta . JmsConsumerId consumerId = new org . apache . qpid . jms . meta . JmsConsumerId ( sessionId , 1 ) ; org . apache . qpid . jms . meta . JmsConnectionId id2 = new org . apache . qpid . jms . meta . JmsConnectionId ( consumerId ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertSame ( id1 . getValue ( ) , id2 . getValue ( ) ) |
shouldBeActiveWhenAnAcceptedParameterWithoutRequiredValueIsPresentAndItHasAValue ( ) { java . util . Map < java . lang . String , java . lang . String [ ] > parameters = new java . util . HashMap ( ) ; parameters . put ( "parameterWithoutValue" , ( ( java . lang . String [ ] ) ( java . util . Arrays . asList ( "anyVal" ) . toArray ( ) ) ) ) ; when ( request . getParameterMap ( ) ) . thenReturn ( parameters ) ; boolean isActive = strategy . isActive ( state , user ) ; "<AssertPlaceHolder>" ; } isActive ( org . togglz . core . repository . FeatureState , org . togglz . core . user . FeatureUser ) { return true ; } | org . junit . Assert . assertTrue ( isActive ) |
contains_shouldReturnFalseIfParameterIsLowerThanLow ( ) { org . openmrs . util . DoubleRange r1 = new org . openmrs . util . DoubleRange ( 1.0 , 1.0 ) ; java . lang . Double d = 0.0 ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return getSession ( ) . contains ( object ) ; } | org . junit . Assert . assertFalse ( r1 . contains ( d ) ) |
testNotEquals ( ) { org . jaitools . imageutils . ImageLayout2 il1 = new org . jaitools . imageutils . ImageLayout2 ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , null , null ) ; int [ ] z = new int [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ; for ( int i = 0 ; i < 8 ; i ++ ) { int oldz = z [ i ] ; z [ i ] = 99 ; org . jaitools . imageutils . ImageLayout2 il2 = new org . jaitools . imageutils . ImageLayout2 ( z [ 0 ] , z [ 1 ] , z [ 2 ] , z [ 3 ] , z [ 4 ] , z [ 5 ] , z [ 6 ] , z [ 7 ] , null , null ) ; "<AssertPlaceHolder>" ; z [ i ] = oldz ; } } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( org . jaitools . media . jai . rangelookup . LookupItem . getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } org . jaitools . media . jai . rangelookup . LookupItem other = ( ( org . jaitools . media . jai . rangelookup . LookupItem ) ( obj ) ) ; if ( ( value ) == null ) { if ( ( other . value ) != null ) { return false ; } } else if ( ! ( value . equals ( other . value ) ) ) { return false ; } if ( ( range ) == null ) { if ( ( other . range ) != null ) { return false ; } } else if ( ! ( range . equals ( other . range ) ) ) { return false ; } return true ; } | org . junit . Assert . assertFalse ( il1 . equals ( il2 ) ) |
writerTest ( ) { java . lang . String serOutFileName = "fixed.out.xml" ; java . lang . String serResultFileName = "fixed.res.xml" ; com . huawei . streaming . api . PhysicalPlan plan = create ( ) ; com . huawei . streaming . cql . LocalTaskCommons . write ( com . huawei . streaming . cql . executor . userdefined . FixedTest . BASICPATH , serResultFileName , create ( ) . getApploication ( ) ) ; boolean compareResult = com . huawei . streaming . cql . LocalTaskCommons . compare ( com . huawei . streaming . cql . executor . userdefined . FixedTest . BASICPATH , serResultFileName , serOutFileName ) ; "<AssertPlaceHolder>" ; com . huawei . streaming . cql . LocalTaskCommons . localSubmit ( plan . getApploication ( ) ) ; } compare ( java . lang . String , java . lang . String , java . lang . String ) { java . lang . String serDir = com . huawei . streaming . cql . LocalTaskCommons . setDir ( basepath ) ; java . io . File outFile = new java . io . File ( ( serDir + outputFileName ) ) ; java . io . File resultsFile = new java . io . File ( ( serDir + resultFileName ) ) ; return com . huawei . streaming . cql . CQLTestCommons . compareFileContent ( outFile , resultsFile ) ; } | org . junit . Assert . assertTrue ( compareResult ) |
testConstructor ( ) { @ com . j256 . ormlite . table . SuppressWarnings ( "rawtypes" ) java . lang . reflect . Constructor [ ] constructors = com . j256 . ormlite . table . TableUtils . class . getDeclaredConstructors ( ) ; "<AssertPlaceHolder>" ; constructors [ 0 ] . setAccessible ( true ) ; constructors [ 0 ] . newInstance ( ) ; } | org . junit . Assert . assertEquals ( 1 , constructors . length ) |
testToKafka ( ) { io . strimzi . operator . user . model . acl . SimpleAclRule strimzi = new io . strimzi . operator . user . model . acl . SimpleAclRule ( io . strimzi . api . kafka . model . AclRuleType . ALLOW , io . strimzi . operator . user . model . acl . SimpleAclRuleTest . resource , "127.0.0.1" , io . strimzi . api . kafka . model . AclOperation . READ ) ; kafka . security . auth . Acl kafka = new kafka . security . auth . Acl ( io . strimzi . operator . user . model . acl . SimpleAclRuleTest . kafkaPrincipal , kafka . security . auth . Allow$ . MODULE$ , "127.0.0.1" , kafka . security . auth . Read$ . MODULE$ ) ; "<AssertPlaceHolder>" ; } toKafkaAcl ( org . apache . kafka . common . security . auth . KafkaPrincipal ) { kafka . security . auth . PermissionType kafkaType ; kafka . security . auth . Operation kafkaOperation ; switch ( type ) { case DENY : kafkaType = kafka . security . auth . Deny$ . MODULE$ ; break ; case ALLOW : kafkaType = kafka . security . auth . Allow$ . MODULE$ ; break ; default : throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>Acl<sp>type:<sp>" + ( type ) ) ) ; } switch ( operation ) { case READ : kafkaOperation = kafka . security . auth . Read$ . MODULE$ ; break ; case WRITE : kafkaOperation = kafka . security . auth . Write$ . MODULE$ ; break ; case CREATE : kafkaOperation = kafka . security . auth . Create$ . MODULE$ ; break ; case DELETE : kafkaOperation = kafka . security . auth . Delete$ . MODULE$ ; break ; case ALTER : kafkaOperation = kafka . security . auth . Alter$ . MODULE$ ; break ; case DESCRIBE : kafkaOperation = kafka . security . auth . Describe$ . MODULE$ ; break ; case CLUSTERACTION : kafkaOperation = kafka . security . auth . ClusterAction$ . MODULE$ ; break ; case ALTERCONFIGS : kafkaOperation = kafka . security . auth . AlterConfigs$ . MODULE$ ; break ; case DESCRIBECONFIGS : kafkaOperation = kafka . security . auth . DescribeConfigs$ . MODULE$ ; break ; case IDEMPOTENTWRITE : kafkaOperation = kafka . security . auth . IdempotentWrite$ . MODULE$ ; break ; case ALL : kafkaOperation = kafka . security . auth . All$ . MODULE$ ; break ; default : throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>Acl<sp>operation:<sp>" + ( operation ) ) ) ; } return new kafka . security . auth . Acl ( principal , kafkaType , getHost ( ) , kafkaOperation ) ; } | org . junit . Assert . assertEquals ( kafka , strimzi . toKafkaAcl ( io . strimzi . operator . user . model . acl . SimpleAclRuleTest . kafkaPrincipal ) ) |
anySatisfy_executionException ( ) { try { this . classUnderTest ( ) . anySatisfy ( ( each ) -> { throw new java . lang . RuntimeException ( "Execution<sp>exception" ) ; } ) ; } catch ( java . lang . RuntimeException e ) { java . util . concurrent . ExecutionException executionException = ( ( java . util . concurrent . ExecutionException ) ( e . getCause ( ) ) ) ; java . lang . RuntimeException runtimeException = ( ( java . lang . RuntimeException ) ( executionException . getCause ( ) ) ) ; "<AssertPlaceHolder>" ; } } anySatisfy ( com . gs . collections . api . block . predicate . Predicate ) { synchronized ( this . lock ) { return this . iterable . anySatisfy ( predicate ) ; } } | org . junit . Assert . assertEquals ( "Execution<sp>exception" , runtimeException . getMessage ( ) ) |
testSynsetRemoveObjectNull ( ) { net . sf . extjwnl . data . Synset s = new net . sf . extjwnl . data . Synset ( null , POS . NOUN ) ; net . sf . extjwnl . data . IndexWord iw = new net . sf . extjwnl . data . IndexWord ( null , "test" , POS . NOUN , s ) ; iw . getSenses ( ) . remove ( s ) ; "<AssertPlaceHolder>" ; } getSenses ( ) { if ( null == ( synsets ) ) { synsets = new net . sf . extjwnl . data . IndexWord . SynsetList ( ) ; } return synsets ; } | org . junit . Assert . assertEquals ( 0 , iw . getSenses ( ) . size ( ) ) |
testMissingClosingBraceOnModify ( ) { final java . lang . String str = "package<sp>org.drools.compiler.test;\n" + ( ( ( ( ( ( "import<sp>org.drools.compiler.*\n" + "rule<sp>R1<sp>when\n" ) + "<sp>$p<sp>:<sp>Person(<sp>)" ) + "<sp>$c<sp>:<sp>Cheese(<sp>)" ) + "then\n" ) + "<sp>modify($p)<sp>{<sp>setCheese($c)<sp>;\n" ) + "end\n" ) ; final org . kie . internal . builder . KnowledgeBuilder kbuilder = org . kie . internal . builder . KnowledgeBuilderFactory . newKnowledgeBuilder ( ) ; kbuilder . add ( org . kie . internal . io . ResourceFactory . newByteArrayResource ( str . getBytes ( ) ) , ResourceType . DRL ) ; "<AssertPlaceHolder>" ; } hasErrors ( ) { return messages . stream ( ) . anyMatch ( ( m ) -> DMNMessage . Severity . ERROR . equals ( m . getSeverity ( ) ) ) ; } | org . junit . Assert . assertTrue ( kbuilder . hasErrors ( ) ) |
testSerialization ( ) { org . jfree . chart . axis . NumberTickUnit t1 = new org . jfree . chart . axis . NumberTickUnit ( 1.23 , new java . text . DecimalFormat ( "0.00" ) ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( t1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . axis . NumberTickUnit t2 = ( ( org . jfree . chart . axis . NumberTickUnit ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } } | org . junit . Assert . assertEquals ( t1 , t2 ) |
manageActivationProcess_VSERVER_DEACTIVATION_REQUESTED_Running ( ) { org . oscm . app . iaas . data . FlowState flowState = org . oscm . app . iaas . data . FlowState . VSERVER_DEACTIVATION_REQUESTED ; org . oscm . app . iaas . data . FlowState newState = null ; doReturn ( VServerStatus . RUNNING ) . when ( vServerProcessor . vserverComm ) . getVServerStatus ( paramHandler ) ; newState = vServerProcessor . manageActivationProcess ( "controllerId" , "instanceId" , paramHandler , flowState , newState ) ; "<AssertPlaceHolder>" ; verify ( vServerProcessor . vserverComm , times ( 1 ) ) . stopVServer ( eq ( paramHandler ) ) ; } manageActivationProcess ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState , org . oscm . app . iaas . data . FlowState ) { switch ( flowState ) { case VSERVER_ACTIVATION_REQUESTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTING , paramHandler ) ) { if ( vserverComm . startVServer ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } } break ; case VSERVER_STARTING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; case VSERVER_DEACTIVATION_REQUESTED : if ( ( paramHandler . getControllerWaitTime ( ) ) != 0 ) { paramHandler . suspendProcessInstanceFor ( paramHandler . getControllerWaitTime ( ) ) ; newState = org . oscm . app . iaas . data . FlowState . WAITING_BEFORE_STOP ; break ; } case WAITING_BEFORE_STOP : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STOP_FOR_DEACTIVATION , paramHandler ) ) { vserverComm . stopVServer ( paramHandler ) ; if ( VServerStatus . STOPPED . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STOP_FOR_DEACTIVATION ; } } break ; case VSERVER_STOP_FOR_DEACTIVATION : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; default : } return newState ; } | org . junit . Assert . assertNull ( newState ) |
encodesPutWithColumnsCorrectly ( ) { final byte [ ] exp = new byte [ ] { ( ( byte ) ( 131 ) ) , 104 , 4 , 100 , 0 , 8 , 116 , 115 , 112 , 117 , 116 , 114 , 101 , 113 , 109 , 0 , 0 , 0 , 10 , 116 , 101 , 115 , 116 , 95 , 116 , 97 , 98 , 108 , 101 , 108 , 0 , 0 , 0 , 7 , 109 , 0 , 0 , 0 , 1 , 97 , 109 , 0 , 0 , 0 , 1 , 98 , 109 , 0 , 0 , 0 , 1 , 99 , 109 , 0 , 0 , 0 , 1 , 100 , 109 , 0 , 0 , 0 , 1 , 101 , 109 , 0 , 0 , 0 , 1 , 102 , 109 , 0 , 0 , 0 , 1 , 103 , 106 , 108 , 0 , 0 , 0 , 1 , 104 , 8 , 109 , 0 , 0 , 0 , 6 , 115 , 101 , 114 , 105 , 101 , 115 , 109 , 0 , 0 , 0 , 6 , 102 , 97 , 109 , 105 , 108 , 121 , 98 , 0 , ( ( byte ) ( 188 ) ) , 97 , 78 , 97 , 1 , 100 , 0 , 4 , 116 , 114 , 117 , 101 , 70 , 64 , 65 , 38 , 102 , 102 , 102 , 102 , 102 , 106 , 109 , 0 , 0 , 0 , 8 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 106 } ; final java . util . List < java . lang . String > columns = java . util . Arrays . asList ( "a" , "b" , "c" , "d" , "e" , "f" , "g" ) ; final java . util . ArrayList < com . basho . riak . client . core . query . timeseries . Row > rows = new java . util . ArrayList ( 1 ) ; rows . add ( new com . basho . riak . client . core . query . timeseries . Row ( new com . basho . riak . client . core . query . timeseries . Cell ( "series" ) , new com . basho . riak . client . core . query . timeseries . Cell ( "family" ) , com . basho . riak . client . core . query . timeseries . Cell . newTimestamp ( 12345678 ) , new com . basho . riak . client . core . query . timeseries . Cell ( 1L ) , new com . basho . riak . client . core . query . timeseries . Cell ( true ) , new com . basho . riak . client . core . query . timeseries . Cell ( 34.3 ) , null , new com . basho . riak . client . core . query . timeseries . Cell ( new byte [ ] { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 } ) ) ) ; try { com . ericsson . otp . erlang . OtpOutputStream os = com . basho . riak . client . core . codec . TermToBinaryCodec . encodeTsPutRequest ( com . basho . riak . client . core . codec . TermToBinaryCodecTest . TABLE_NAME , columns , rows ) ; os . flush ( ) ; byte [ ] msg = os . toByteArray ( ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException ex ) { org . junit . Assert . fail ( ex . getMessage ( ) ) ; } } encodeTsPutRequest ( java . lang . String , com . basho . riak . client . core . codec . Collection , com . basho . riak . client . core . codec . Collection ) { final com . basho . riak . client . core . codec . OtpOutputStream os = new com . basho . riak . client . core . codec . OtpOutputStream ( ) ; os . write ( OtpExternal . versionTag ) ; os . write_tuple_head ( 4 ) ; os . write_atom ( com . basho . riak . client . core . codec . TermToBinaryCodec . TS_PUT_REQ ) ; os . write_binary ( tableName . getBytes ( StandardCharsets . UTF_8 ) ) ; if ( ( columns != null ) && ( ! ( columns . isEmpty ( ) ) ) ) { os . write_list_head ( columns . size ( ) ) ; for ( java . lang . String column : columns ) { os . write_binary ( column . getBytes ( StandardCharsets . UTF_8 ) ) ; } } os . write_nil ( ) ; os . write_list_head ( rows . size ( ) ) ; for ( com . basho . riak . client . core . query . timeseries . Row row : rows ) { os . write_tuple_head ( row . getCellsCount ( ) ) ; for ( com . basho . riak . client . core . query . timeseries . Cell cell : row ) { if ( cell == null ) { os . write_nil ( ) ; } else { com . basho . riak . client . core . codec . TermToBinaryCodec . writeTsCellToStream ( os , cell ) ; } } } os . write_nil ( ) ; return os ; } | org . junit . Assert . assertArrayEquals ( exp , msg ) |
getObjectWithAttr ( ) { org . json . JSONObject task = index . addObject ( new org . json . JSONObject ( ) . put ( "firstname" , "Jimmie" ) . put ( "lastname" , "Barninger" ) . put ( "followers" , 93 ) . put ( "company" , "California<sp>Paint" ) , "a/go/?" ) ; index . waitTask ( task . getLong ( "taskID" ) ) ; org . json . JSONObject object = index . getObject ( "a/go/?" , java . util . Arrays . asList ( "lastname" , "firstname" ) ) ; "<AssertPlaceHolder>" ; } getObject ( java . lang . String , com . algolia . search . saas . List , com . algolia . search . saas . RequestOptions ) { try { java . lang . String params = encodeAttributes ( attributesToRetrieve , true ) ; return client . getRequest ( ( ( ( ( "/1/indexes/" + ( encodedIndexName ) ) + "/" ) + ( java . net . URLEncoder . encode ( objectID , "UTF-8" ) ) ) + ( params . toString ( ) ) ) , false , requestOptions ) ; } catch ( java . io . UnsupportedEncodingException e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( "Barninger" , object . getString ( "lastname" ) ) |
t020_complete ( ) { final java . util . List < dom . todo . ToDoItem > completedItems = wrap ( toDoItems ) . complete ( ) ; "<AssertPlaceHolder>" ; } complete ( ) { java . util . List < dom . todo . ToDoItem > items = doComplete ( ) ; if ( items . isEmpty ( ) ) { getContainer ( ) . informUser ( "No<sp>to-do<sp>items<sp>have<sp>yet<sp>been<sp>completed<sp>:-(" ) ; } return items ; } | org . junit . Assert . assertThat ( completedItems . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) ) |
extract_DeleteBeforeUsageStartWithoutRole ( ) { createUsageLicenseHistory ( ModificationType . DELETE , org . oscm . test . DateTimeHandling . calculateDate ( "2013-03-31<sp>23:59:59" ) , org . oscm . billingservice . business . calculation . revenue . UserAssignmentExtractorTest . USER_KEY , org . oscm . billingservice . business . calculation . revenue . UserAssignmentExtractorTest . USER_ID , null ) ; org . oscm . billingservice . business . calculation . revenue . UserAssignmentExtractor extractor = new org . oscm . billingservice . business . calculation . revenue . UserAssignmentExtractor ( histories , org . oscm . test . DateTimeHandling . calculateMillis ( "2013-04-01<sp>00:00:00" ) , org . oscm . test . DateTimeHandling . calculateMillis ( "2013-05-01<sp>00:00:00" ) ) ; extractor . extract ( ) ; java . util . Set < java . lang . Long > userKeySet = extractor . getUserKeys ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , userKeySet . size ( ) ) |
testUiResponds ( ) { okhttp3 . Request request = new okhttp3 . Request . Builder ( ) . url ( queryUrl ) . get ( ) . build ( ) ; try ( okhttp3 . Response response = okHttpClient . newCall ( request ) . execute ( ) ) { "<AssertPlaceHolder>" ; } } | org . junit . Assert . assertEquals ( 200 , response . code ( ) ) |
testSetLocalValues ( ) { final java . lang . String key1 = "foo" ; final java . lang . String key2 = "bar" ; final java . util . Map < java . lang . String , java . lang . Object > table0 = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; table0 . put ( key1 , 1 ) ; table0 . put ( key2 , 2 ) ; final java . util . Map < java . lang . String , java . lang . Object > table1 = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; table1 . put ( key1 , 10 ) ; table1 . put ( key2 , 20 ) ; final java . util . List < java . util . Map < java . lang . String , java . lang . Object > > tables = new java . util . ArrayList < java . util . Map < java . lang . String , java . lang . Object > > ( ) ; tables . add ( table0 ) ; tables . add ( table1 ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 2 ) ; class Task implements java . lang . Runnable { private final int threadIndex ; public Task ( int threadIndex ) { this . threadIndex = threadIndex ; } public void run ( ) { org . geotools . filter . function . EnvFunction . setLocalValues ( tables . get ( threadIndex ) ) ; latch . countDown ( ) ; try { latch . await ( ) ; } catch ( java . lang . InterruptedException ex ) { throw new java . lang . IllegalStateException ( ex ) ; } java . util . Map < java . lang . String , java . lang . Object > table = tables . get ( threadIndex ) ; for ( java . lang . String name : table . keySet ( ) ) { java . lang . Object result = ff . function ( "env" , ff . literal ( name ) ) . evaluate ( null ) ; int value = ( ( java . lang . Number ) ( result ) ) . intValue ( ) ; "<AssertPlaceHolder>" ; } } } java . util . concurrent . Future f1 = executor . submit ( new Task ( 0 ) ) ; java . util . concurrent . Future f2 = executor . submit ( new Task ( 1 ) ) ; f1 . get ( ) ; f2 . get ( ) ; } get ( int ) { switch ( value ) { case net . opengis . wcs10 . InterpolationMethodType . NEAREST_NEIGHBOR : return net . opengis . wcs10 . InterpolationMethodType . NEAREST_NEIGHBOR_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BILINEAR : return net . opengis . wcs10 . InterpolationMethodType . BILINEAR_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BICUBIC : return net . opengis . wcs10 . InterpolationMethodType . BICUBIC_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . LOST_AREA : return net . opengis . wcs10 . InterpolationMethodType . LOST_AREA_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BARYCENTRIC : return net . opengis . wcs10 . InterpolationMethodType . BARYCENTRIC_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . NONE : return net . opengis . wcs10 . InterpolationMethodType . NONE_LITERAL ; } return null ; } | org . junit . Assert . assertEquals ( table . get ( name ) , value ) |
testSerialization ( ) { org . jfree . chart . block . EmptyBlock b1 = new org . jfree . chart . block . EmptyBlock ( 1.0 , 2.0 ) ; org . jfree . chart . block . EmptyBlock b2 = ( ( org . jfree . chart . block . EmptyBlock ) ( org . jfree . chart . TestUtilities . serialised ( b1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( b1 , b2 ) |
testNotExcludeAddedFile ( ) { instance . addClasses ( java . util . Arrays . asList ( de . unisb . cs . st . javalanche . mutation . javaagent . classFileTransfomer . mutationDecision . ExcludesTest . CLASS_2 ) ) ; "<AssertPlaceHolder>" ; } shouldExclude ( java . lang . String ) { return ( de . unisb . cs . st . javalanche . coverage . InstrumentExclude . shouldExcludeLines ( name ) ) || ( de . unisb . cs . st . javalanche . coverage . InstrumentExclude . shouldExcludeReturns ( name ) ) ; } | org . junit . Assert . assertFalse ( instance . shouldExclude ( de . unisb . cs . st . javalanche . mutation . javaagent . classFileTransfomer . mutationDecision . ExcludesTest . CLASS_2 ) ) |
testConvertInvalid ( ) { com . box . l10n . mojito . cli . command . AssetMappingConverter assetMappingConverter = new com . box . l10n . mojito . cli . command . AssetMappingConverter ( ) ; java . util . Map < java . lang . String , java . lang . String > convert = assetMappingConverter . convert ( "dsafdsf" ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { com . box . l10n . mojito . rest . entity . ExportDropConfig . Type type = null ; if ( string != null ) { try { type = ExportDropConfig . Type . valueOf ( string . toUpperCase ( ) ) ; } catch ( java . lang . IllegalArgumentException iae ) { throw new com . beust . jcommander . ParameterException ( ( ( "Invalid<sp>type<sp>[" + string ) + "]" ) ) ; } } return type ; } | org . junit . Assert . assertEquals ( 0 , convert . size ( ) ) |
testInvalidExampleMediaTypeValidator ( ) { com . ibm . ws . microprofile . openapi . impl . model . media . EncodingImpl encoding = new com . ibm . ws . microprofile . openapi . impl . model . media . EncodingImpl ( ) ; encoding . setContentType ( "text/plain" ) ; java . util . Map < java . lang . String , org . eclipse . microprofile . openapi . models . media . Encoding > encodingMap = new java . util . HashMap < java . lang . String , org . eclipse . microprofile . openapi . models . media . Encoding > ( ) ; encodingMap . put ( "name" , encoding ) ; mediaType . setEncoding ( encodingMap ) ; mediaType . setExample ( "example" ) ; java . util . Map < java . lang . String , org . eclipse . microprofile . openapi . models . examples . Example > examples = new java . util . HashMap < java . lang . String , org . eclipse . microprofile . openapi . models . examples . Example > ( ) ; examples . put ( "example" , new com . ibm . ws . microprofile . openapi . impl . model . examples . ExampleImpl ( ) ) ; mediaType . setExamples ( examples ) ; validator . validate ( validationHelper , context , mediaType ) ; "<AssertPlaceHolder>" ; } getEventsSize ( ) { return result . getEvents ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , validationHelper . getEventsSize ( ) ) |
testSetGetTrainingData ( ) { org . neuroph . core . data . DataSet trainingSet = new org . neuroph . core . data . DataSet ( 0 ) ; testableLearningRule . setTrainingSet ( trainingSet ) ; "<AssertPlaceHolder>" ; } getTrainingSet ( ) { return dataSet ; } | org . junit . Assert . assertEquals ( testableLearningRule . getTrainingSet ( ) , trainingSet ) |
signatureProfileShouldBeSetProperlyForBDocTS ( ) { org . digidoc4j . Signature signature = createBDocSignatureWithProfile ( SignatureProfile . LT ) ; "<AssertPlaceHolder>" ; } getProfile ( ) { return m_profile ; } | org . junit . Assert . assertEquals ( SignatureProfile . LT , signature . getProfile ( ) ) |
testDeleteID ( ) { handler . deleteID ( uuid . toString ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "Flag<sp>[id=" + ( id ) ) + ",<sp>icon=" ) + ( icon ) ) + ",<sp>listener=" ) + ( listener ) ) + ",<sp>type=" ) + ( type ) ) + ",<sp>defaultSetting=" ) + ( setting ) ) + ",<sp>defaultRank=" ) + ( defaultRank ) ) + ",<sp>clickHandler=" ) + ( clickHandler ) ) + ",<sp>subPanel=" ) + ( subPanel ) ) + "]" ; } | org . junit . Assert . assertTrue ( record . exists ( ) ) |
testIsProjectIdAvailable_emptyString ( ) { projectSelector . setProjects ( com . google . cloud . tools . eclipse . projectselector . ProjectSelectorTest . getUnsortedProjectList ( ) ) ; "<AssertPlaceHolder>" ; } isProjectIdAvailable ( java . lang . String ) { for ( java . lang . Object o : input ) { com . google . cloud . tools . eclipse . projectselector . model . GcpProject gcpProject = ( ( com . google . cloud . tools . eclipse . projectselector . model . GcpProject ) ( o ) ) ; if ( gcpProject . getId ( ) . equals ( projectId ) ) { return true ; } } return false ; } | org . junit . Assert . assertFalse ( projectSelector . isProjectIdAvailable ( "" ) ) |
purgeBranchWithSingleRevision ( ) { indexRevision ( com . b2international . index . revision . MAIN , new com . b2international . index . revision . RevisionFixtures . RevisionData ( STORAGE_KEY1 , "field1" , "field2" ) ) ; index ( ) . purge ( com . b2international . index . revision . MAIN , Purge . ALL ) ; "<AssertPlaceHolder>" ; } getRevision ( java . lang . String , java . lang . Class , java . lang . String ) { return index ( ) . read ( branch , ( index ) -> index . get ( type , key ) ) ; } | org . junit . Assert . assertNotNull ( getRevision ( com . b2international . index . revision . MAIN , com . b2international . index . revision . RevisionFixtures . RevisionData . class , com . b2international . index . revision . STORAGE_KEY1 ) ) |
shouldConnectCreateConnection ( ) { org . powermock . api . mockito . PowerMockito . mockStatic ( org . neo4j . driver . v1 . GraphDatabase . class ) ; org . mockito . Mockito . when ( org . neo4j . driver . v1 . GraphDatabase . driver ( org . mockito . Mockito . eq ( org . neo4j . jdbc . bolt . BoltNeo4jDriverTest . BOLT_URL ) , org . mockito . Mockito . eq ( org . neo4j . driver . v1 . AuthTokens . none ( ) ) , any ( org . neo4j . driver . v1 . Config . class ) ) ) . thenReturn ( org . neo4j . jdbc . bolt . BoltNeo4jDriverTest . mockedDriver ) ; org . neo4j . jdbc . Neo4jDriver driver = new org . neo4j . jdbc . bolt . BoltDriver ( ) ; java . sql . Connection connection = driver . connect ( org . neo4j . jdbc . bolt . BoltNeo4jDriverTest . COMPLETE_VALID_URL , null ) ; "<AssertPlaceHolder>" ; } connect ( java . lang . String , java . util . Properties ) { java . sql . Connection connection = null ; if ( ! ( java . util . Objects . isNull ( getDriver ( url ) ) ) ) { connection = getDriver ( url ) . connect ( url , info ) ; } return connection ; } | org . junit . Assert . assertNotNull ( connection ) |
testGetRootCause ( ) { org . pentaho . platform . api . util . PentahoCheckedChainedException exception = new org . pentaho . platform . api . util . PentahoCheckedChainedExceptionTest . CheckedException ( org . pentaho . platform . api . util . PentahoCheckedChainedExceptionTest . CAUSE ) ; java . lang . Throwable rootCause = exception . getRootCause ( ) ; "<AssertPlaceHolder>" ; } getRootCause ( ) { java . lang . Throwable aReason = this ; java . lang . Throwable lastReason = null ; while ( aReason != null ) { lastReason = aReason ; aReason = aReason . getCause ( ) ; } return lastReason ; } | org . junit . Assert . assertEquals ( org . pentaho . platform . api . util . PentahoCheckedChainedExceptionTest . CAUSE , rootCause ) |
equalsSelf ( ) { com . vaadin . flow . dom . Element e = com . vaadin . flow . dom . ElementFactory . createDiv ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj instanceof com . vaadin . flow . data . provider . DataCommunicatorTest . Item ) { com . vaadin . flow . data . provider . DataCommunicatorTest . Item that = ( ( com . vaadin . flow . data . provider . DataCommunicatorTest . Item ) ( obj ) ) ; return ( that . id ) == ( id ) ; } else { return false ; } } | org . junit . Assert . assertTrue ( e . equals ( e ) ) |
canExecute_normal_sim ( ) { com . asakusafw . runtime . core . context . RuntimeContext context = RuntimeContext . DEFAULT . mode ( ExecutionMode . SIMULATION ) ; "<AssertPlaceHolder>" ; } canExecute ( java . lang . Object ) { if ( object == null ) { throw new java . lang . IllegalArgumentException ( "object<sp>must<sp>not<sp>be<sp>null" ) ; } switch ( mode ) { case PRODUCTION : return true ; case SIMULATION : return isSimulationSupported ( object ) ; default : throw new java . lang . AssertionError ( mode ) ; } } | org . junit . Assert . assertThat ( context . canExecute ( new java . lang . Object ( ) ) , is ( false ) ) |
testToByteArray ( ) { byte [ ] in = "Hello<sp>World" . getBytes ( ) ; org . apache . mina . core . buffer . IoBuffer bb = org . apache . mina . core . buffer . IoBuffer . wrap ( in ) ; byte [ ] out = org . apache . camel . component . mina2 . Mina2Converter . toByteArray ( bb ) ; for ( int i = 0 ; i < ( out . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } toByteArray ( org . apache . mina . core . buffer . IoBuffer ) { byte [ ] answer = new byte [ buffer . remaining ( ) ] ; buffer . get ( answer ) ; return answer ; } | org . junit . Assert . assertEquals ( in [ i ] , out [ i ] ) |
hasDomainPermissions_emptyAsAuthenticated ( ) { final com . acciente . oacc . Resource accessorResource = generateUnauthenticatableResource ( ) ; final java . lang . String domainName = generateDomain ( ) ; generateResourceAndAuthenticate ( ) ; grantQueryPermission ( accessControlContext . getSessionResource ( ) , accessorResource ) ; final java . util . Map < java . lang . String , java . util . Set < com . acciente . oacc . DomainPermission > > allDomainPermissions = accessControlContext . getEffectiveDomainPermissionsMap ( accessorResource ) ; "<AssertPlaceHolder>" ; if ( accessControlContext . hasDomainPermissions ( accessorResource , domainName , com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . SUPER_USER ) ) ) { org . junit . Assert . fail ( "checking<sp>domain<sp>permission<sp>for<sp>authenticated<sp>accessor<sp>resource<sp>when<sp>none<sp>exist<sp>should<sp>have<sp>failed" ) ; } if ( accessControlContext . hasDomainPermissions ( accessorResource , domainName , setOf ( com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . SUPER_USER ) ) ) ) { org . junit . Assert . fail ( "checking<sp>domain<sp>permission<sp>for<sp>authenticated<sp>accessor<sp>resource<sp>when<sp>none<sp>exist<sp>should<sp>have<sp>failed" ) ; } if ( accessControlContext . hasDomainPermissions ( accessorResource , domainName , com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . CREATE_CHILD_DOMAIN ) ) ) { org . junit . Assert . fail ( "checking<sp>domain<sp>permission<sp>for<sp>authenticated<sp>accessor<sp>resource<sp>when<sp>none<sp>exist<sp>should<sp>have<sp>failed" ) ; } if ( accessControlContext . hasDomainPermissions ( accessorResource , domainName , setOf ( com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . CREATE_CHILD_DOMAIN ) ) ) ) { org . junit . Assert . fail ( "checking<sp>domain<sp>permission<sp>for<sp>authenticated<sp>accessor<sp>resource<sp>when<sp>none<sp>exist<sp>should<sp>have<sp>failed" ) ; } if ( accessControlContext . hasDomainPermissions ( accessorResource , domainName , com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . CREATE_CHILD_DOMAIN ) , com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . SUPER_USER ) ) ) { org . junit . Assert . fail ( "checking<sp>multiple<sp>domain<sp>permission<sp>for<sp>authenticated<sp>resource<sp>when<sp>none<sp>exist<sp>should<sp>have<sp>failed" ) ; } if ( accessControlContext . hasDomainPermissions ( accessorResource , domainName , setOf ( com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . CREATE_CHILD_DOMAIN ) , com . acciente . oacc . DomainPermissions . getInstance ( DomainPermissions . SUPER_USER ) ) ) ) { org . junit . Assert . fail ( "checking<sp>multiple<sp>domain<sp>permission<sp>for<sp>authenticated<sp>resource<sp>when<sp>none<sp>exist<sp>should<sp>have<sp>failed" ) ; } } getEffectiveDomainPermissionsMap ( com . acciente . oacc . Resource ) { com . acciente . oacc . sql . internal . persister . SQLConnection connection = null ; __assertAuthenticated ( ) ; __assertResourceSpecified ( accessorResource ) ; try { connection = __getConnection ( ) ; accessorResource = __resolveResource ( connection , accessorResource ) ; __assertQueryAuthorization ( connection , accessorResource ) ; return __getEffectiveDomainPermissionsMap ( connection , accessorResource ) ; } finally { __closeConnection ( connection ) ; } } | org . junit . Assert . assertThat ( allDomainPermissions . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
closeShouldWaitAllOperationToFinish ( ) { clientA . acquireShared ( LockTracer . NONE , org . neo4j . kernel . impl . locking . ResourceTypes . NODE , 1L ) ; clientA . acquireShared ( LockTracer . NONE , org . neo4j . kernel . impl . locking . ResourceTypes . NODE , 3L ) ; clientB . acquireShared ( LockTracer . NONE , org . neo4j . kernel . impl . locking . ResourceTypes . NODE , 1L ) ; acquireShared ( clientC , LockTracer . NONE , org . neo4j . kernel . impl . locking . ResourceTypes . NODE , 2L ) ; acquireExclusive ( clientB , LockTracer . NONE , org . neo4j . kernel . impl . locking . ResourceTypes . NODE , 1L ) . callAndAssertWaiting ( ) ; acquireExclusive ( clientC , LockTracer . NONE , org . neo4j . kernel . impl . locking . ResourceTypes . NODE , 1L ) . callAndAssertWaiting ( ) ; clientB . close ( ) ; clientC . close ( ) ; clientA . close ( ) ; org . neo4j . kernel . impl . locking . LockCountVisitor lockCountVisitor = new org . neo4j . kernel . impl . locking . LockCountVisitor ( ) ; locks . accept ( lockCountVisitor ) ; "<AssertPlaceHolder>" ; } getLockCount ( ) { return lockCount ; } | org . junit . Assert . assertEquals ( 0 , lockCountVisitor . getLockCount ( ) ) |
testRemoveAttribute_removesExistingAttribute ( ) { uiSession . setAttribute ( "name" , new java . lang . Object ( ) ) ; uiSession . removeAttribute ( "name" ) ; "<AssertPlaceHolder>" ; } getAttribute ( java . lang . String ) { org . eclipse . rap . rwt . internal . util . ParamCheck . notNull ( name , "name" ) ; return props . getProperty ( name ) ; } | org . junit . Assert . assertNull ( uiSession . getAttribute ( "name" ) ) |
testGetDirectAnnotationForMethod ( ) { io . joynr . util . AnnotationUtilTest . DirectAnnotation result = io . joynr . util . AnnotationUtil . getAnnotation ( getMethodWithAnnotation ( ) , io . joynr . util . AnnotationUtilTest . DirectAnnotation . class ) ; "<AssertPlaceHolder>" ; } getMethodWithAnnotation ( ) { return io . joynr . util . AnnotationUtilTest . MyTestStatelessAsyncCallback . class . getMethod ( "getEnumAttributeSuccess" , joynr . tests . testTypes . TestEnum . class , io . joynr . proxy . ReplyContext . class ) ; } | org . junit . Assert . assertNotNull ( result ) |
encryptDecryptString ( ) { final int ptSize = 1000000 ; final java . lang . String plaintextString = com . amazonaws . encryptionsdk . internal . TestIOUtils . generateRandomString ( ptSize ) ; final java . util . Map < java . lang . String , java . lang . String > encryptionContext = new java . util . HashMap < java . lang . String , java . lang . String > ( 1 ) ; encryptionContext . put ( "ENC1" , "Test<sp>Encryption<sp>Context" ) ; final java . lang . String ciphertext = encryptionClient_ . encryptString ( masterKeyProvider , plaintextString , encryptionContext ) . getResult ( ) ; final java . lang . String decryptedText = encryptionClient_ . decryptString ( masterKeyProvider , ciphertext ) . getResult ( ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result_ ; } | org . junit . Assert . assertEquals ( plaintextString , decryptedText ) |
test21 ( ) { byte [ ] expected = new byte [ ] { ( ( byte ) ( 97 ) ) , ( ( byte ) ( 98 ) ) , ( ( byte ) ( 99 ) ) } ; java . lang . String str = new java . lang . String ( "abc" ) ; "<AssertPlaceHolder>" ; } build_fixed_str ( long , java . lang . String ) { return com . github . mpjct . jmpjct . mysql . proto . Proto . build_fixed_str ( ( ( int ) ( size ) ) , str ) ; } | org . junit . Assert . assertArrayEquals ( expected , com . github . mpjct . jmpjct . mysql . proto . Proto . build_fixed_str ( 3 , str ) ) |
testWFS11Delete ( ) { org . geoserver . wfs . WFSException tmpEx = new org . geoserver . wfs . WFSException ( new org . geoserver . wfs . request . Delete . WFS11 ( deleteElementType1 ) , "test" ) ; "<AssertPlaceHolder>" ; } getLocator ( ) { return locator ; } | org . junit . Assert . assertNull ( tmpEx . getLocator ( ) ) |
testAutomaticallyDelete ( ) { this . hostnameRepository . addEntry ( kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_TRACE_ID , kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_HOSTNAME ) ; this . hostnameRepository . inc ( kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_TRACE_ID ) ; this . hostnameRepository . inc ( kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_TRACE_ID ) ; this . hostnameRepository . dec ( kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_TRACE_ID ) ; this . hostnameRepository . inc ( kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_TRACE_ID ) ; this . hostnameRepository . dec ( kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_TRACE_ID ) ; this . hostnameRepository . dec ( kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_TRACE_ID ) ; final java . lang . String hostname = this . hostnameRepository . getHostname ( kieker . test . analysisteetime . HostnameRepositoryTest . EXAMPLE_TRACE_ID ) ; "<AssertPlaceHolder>" ; } getHostname ( long ) { final kieker . analysisteetime . HostnameRepository . Entry entry = this . repository . get ( traceId ) ; if ( entry == null ) { return null ; } else { return entry . hostname ; } } | org . junit . Assert . assertNull ( hostname ) |
testCompareTo ( ) { com . alicloud . openservices . tablestore . model . PrimaryKey primaryKey = com . alicloud . openservices . tablestore . model . PrimaryKeyBuilder . createPrimaryKeyBuilder ( ) . addPrimaryKeyColumn ( "PK0" , com . alicloud . openservices . tablestore . model . PrimaryKeyValue . fromLong ( 1912 ) ) . build ( ) ; com . alicloud . openservices . tablestore . model . PrimaryKey primaryKey2 = com . alicloud . openservices . tablestore . model . PrimaryKeyBuilder . createPrimaryKeyBuilder ( ) . addPrimaryKeyColumn ( "PK0" , com . alicloud . openservices . tablestore . model . PrimaryKeyValue . fromLong ( 1912 ) ) . build ( ) ; com . alicloud . openservices . tablestore . model . RowPutChange rowChange = new com . alicloud . openservices . tablestore . model . RowPutChange ( "T" , primaryKey ) ; com . alicloud . openservices . tablestore . model . RowPutChange rowChange2 = new com . alicloud . openservices . tablestore . model . RowPutChange ( "T" , primaryKey2 ) ; "<AssertPlaceHolder>" ; } compareTo ( com . alicloud . openservices . tablestore . model . IRow ) { return this . primaryKey . compareTo ( o . getPrimaryKey ( ) ) ; } | org . junit . Assert . assertTrue ( ( ( rowChange . compareTo ( rowChange2 ) ) == 0 ) ) |
testIndentInFrontOfTwoExpr ( ) { java . lang . String templates = ( ( ( "list(a,b)<sp>::=<sp><<" + "<sp><a><b>" ) + ( newline ) ) + "a" 0 ) + ( newline ) ; writeFile ( tmpdir , "t.stg" , templates ) ; org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroupFile ( ( ( ( tmpdir ) + "/" ) + "t.stg" ) ) ; org . stringtemplate . v4 . ST t = group . getInstanceOf ( "list" ) ; t . impl . dump ( ) ; t . add ( "a" , "Terence" ) ; t . add ( "b" , "Jim" ) ; java . lang . String expecting = "<sp>TerenceJim" ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; } | org . junit . Assert . assertEquals ( expecting , t . render ( ) ) |
listUsers ( ) { java . util . List < java . lang . String > users = com . google . common . collect . Lists . newArrayList ( "u1" , "u2" , "u3" ) ; when ( userStore . listUsers ( ) ) . thenReturn ( users ) ; "<AssertPlaceHolder>" ; } listUsers ( ) { java . util . List < java . lang . String > users = com . google . common . collect . Lists . newArrayList ( "u1" , "u2" , "u3" ) ; when ( userStore . listUsers ( ) ) . thenReturn ( users ) ; org . junit . Assert . assertEquals ( users , de . blizzy . documentr . web . Functions . listUsers ( ) ) ; } | org . junit . Assert . assertEquals ( users , de . blizzy . documentr . web . Functions . listUsers ( ) ) |
getVirtualAidFlag ( ) { "<AssertPlaceHolder>" ; } getVirtualAidFlag ( ) { return fVirtualAidFlag ; } | org . junit . Assert . assertFalse ( msg . getVirtualAidFlag ( ) ) |
testWALRecordReaderActiveArchiveTolerance ( ) { final org . apache . hadoop . hbase . wal . WALFactory walfactory = new org . apache . hadoop . hbase . wal . WALFactory ( org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . conf , org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . getName ( ) ) ; org . apache . hadoop . hbase . wal . WAL log = walfactory . getWAL ( org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . info ) ; byte [ ] value = org . apache . hadoop . hbase . util . Bytes . toBytes ( "value" ) ; org . apache . hadoop . hbase . wal . WALEdit edit = new org . apache . hadoop . hbase . wal . WALEdit ( ) ; edit . add ( new org . apache . hadoop . hbase . KeyValue ( org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . rowName , org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . family , org . apache . hadoop . hbase . util . Bytes . toBytes ( "1" ) , java . lang . System . currentTimeMillis ( ) , value ) ) ; long txid = log . append ( org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . info , getWalKeyImpl ( java . lang . System . currentTimeMillis ( ) , org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . scopes ) , edit , true ) ; log . sync ( txid ) ; java . lang . Thread . sleep ( 10 ) ; edit = new org . apache . hadoop . hbase . wal . WALEdit ( ) ; edit . add ( new org . apache . hadoop . hbase . KeyValue ( org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . rowName , org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . family , org . apache . hadoop . hbase . util . Bytes . toBytes ( "2" ) , java . lang . System . currentTimeMillis ( ) , value ) ) ; txid = log . append ( org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . info , getWalKeyImpl ( java . lang . System . currentTimeMillis ( ) , org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . scopes ) , edit , true ) ; log . sync ( txid ) ; log . shutdown ( ) ; org . apache . hadoop . hbase . mapreduce . WALInputFormat input = new org . apache . hadoop . hbase . mapreduce . WALInputFormat ( ) ; org . apache . hadoop . conf . Configuration jobConf = new org . apache . hadoop . conf . Configuration ( org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . conf ) ; jobConf . set ( "mapreduce.input.fileinputformat.inputdir" , org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . logDir . toString ( ) ) ; java . util . List < org . apache . hadoop . mapreduce . InputSplit > splits = input . getSplits ( org . apache . hadoop . hbase . mapreduce . MapreduceTestingShim . createJobContext ( jobConf ) ) ; "<AssertPlaceHolder>" ; org . apache . hadoop . hbase . mapreduce . WALInputFormat . WALSplit split = ( ( org . apache . hadoop . hbase . mapreduce . WALInputFormat . WALSplit ) ( splits . get ( 0 ) ) ) ; org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . LOG . debug ( ( ( ( "log=" + ( org . apache . hadoop . hbase . mapreduce . TestWALRecordReader . logDir ) ) + "<sp>file=" ) + ( split . getLogFileName ( ) ) ) ) ; testSplitWithMovingWAL ( splits . get ( 0 ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "1" ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "2" ) ) ; } size ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 1 , splits . size ( ) ) |
testGetForSQLType ( ) { for ( org . geotools . geometry . jts . Geometries type : org . geotools . geometry . jts . Geometries . values ( ) ) { int sqlType = type . getSQLType ( ) ; "<AssertPlaceHolder>" ; } } getForSQLType ( int ) { for ( org . geotools . geometry . jts . Geometries gt : org . geotools . geometry . jts . Geometries . values ( ) ) { if ( ( gt . sqlType ) == sqlType ) { return gt ; } } return null ; } | org . junit . Assert . assertEquals ( type , org . geotools . geometry . jts . Geometries . getForSQLType ( sqlType ) ) |
testSerializeDeserialize ( ) { io . protostuff . runtime . RuntimeSchema < io . protostuff . runtime . RuntimeSchemaTagTest . A6 > schema = io . protostuff . runtime . RuntimeSchema . createFrom ( io . protostuff . runtime . RuntimeSchemaTagTest . A6 . class ) ; io . protostuff . runtime . RuntimeSchemaTagTest . A6 source = new io . protostuff . runtime . RuntimeSchemaTagTest . A6 ( 42 ) ; java . io . ByteArrayOutputStream outputStream = new java . io . ByteArrayOutputStream ( ) ; io . protostuff . LinkedBuffer buffer = io . protostuff . LinkedBuffer . allocate ( ) ; io . protostuff . ProtostuffIOUtil . writeTo ( outputStream , source , schema , buffer ) ; byte [ ] bytes = outputStream . toByteArray ( ) ; io . protostuff . runtime . RuntimeSchemaTagTest . A6 newMessage = schema . newMessage ( ) ; io . protostuff . ProtostuffIOUtil . mergeFrom ( bytes , newMessage , schema ) ; "<AssertPlaceHolder>" ; } mergeFrom ( byte [ ] , T , io . protostuff . Schema ) { io . protostuff . IOUtil . mergeFrom ( data , 0 , data . length , message , schema , true ) ; } | org . junit . Assert . assertEquals ( source , newMessage ) |
testImportDirectoryTool ( ) { org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( "" ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( "Setting<sp>up<sp>initial<sp>state<sp>of<sp>parent<sp>before<sp>importing<sp>directory<sp>to<sp>child..." ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( "Adding<sp>data<sp>to<sp>parent..." ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( ( "Starting<sp>import<sp>directory<sp>tool.<sp>Importing<sp>all<sp>data<sp>after<sp>the<sp>specified<sp>start<sp>time:<sp>" + ( YESTERDAY ) ) ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( "" ) ; isImporting = true ; copyToolRun ( org . apache . rya . accumulo . mr . merge . YESTERDAY ) ; final java . lang . String childUser = org . apache . rya . accumulo . mr . merge . CopyToolTest . accumuloDualInstanceDriver . getChildUser ( ) ; final org . apache . accumulo . core . client . Connector childConnector = org . apache . rya . indexing . accumulo . ConfigUtils . getConnector ( org . apache . rya . accumulo . mr . merge . CopyToolTest . childConfig ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . accumuloDualInstanceDriver . getChildAccumuloInstanceDriver ( ) . setConnector ( childConnector ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . accumuloDualInstanceDriver . getChildAccumuloInstanceDriver ( ) . setUpTables ( ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . accumuloDualInstanceDriver . getChildAccumuloInstanceDriver ( ) . setUpDao ( ) ; final org . apache . accumulo . core . client . admin . SecurityOperations childSecOps = org . apache . rya . accumulo . mr . merge . CopyToolTest . accumuloDualInstanceDriver . getChildSecOps ( ) ; final org . apache . accumulo . core . security . Authorizations newChildAuths = org . apache . rya . accumulo . mr . merge . util . AccumuloRyaUtils . addUserAuths ( childUser , childSecOps , org . apache . rya . accumulo . mr . merge . CopyToolTest . PARENT_AUTH ) ; childSecOps . changeUserAuthorizations ( childUser , newChildAuths ) ; final java . lang . String childAuthString = newChildAuths . toString ( ) ; final java . util . List < java . lang . String > duplicateKeys = MergeTool . DUPLICATE_KEY_MAP . get ( MRUtils . AC_AUTH_PROP ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . childConfig . set ( MRUtils . AC_AUTH_PROP , childAuthString ) ; for ( final java . lang . String key : duplicateKeys ) { org . apache . rya . accumulo . mr . merge . CopyToolTest . childConfig . set ( key , childAuthString ) ; } org . apache . rya . accumulo . mr . merge . util . AccumuloRyaUtils . printTablePretty ( ( ( org . apache . rya . accumulo . mr . merge . CopyToolTest . CHILD_TABLE_PREFIX ) + ( org . apache . rya . api . RdfCloudTripleStoreConstants . TBL_SPO_SUFFIX ) ) , org . apache . rya . accumulo . mr . merge . CopyToolTest . childConfig ) ; final org . apache . accumulo . core . client . Scanner scanner = org . apache . rya . accumulo . mr . merge . util . AccumuloRyaUtils . getScanner ( ( ( org . apache . rya . accumulo . mr . merge . CopyToolTest . CHILD_TABLE_PREFIX ) + ( org . apache . rya . api . RdfCloudTripleStoreConstants . TBL_SPO_SUFFIX ) ) , org . apache . rya . accumulo . mr . merge . CopyToolTest . childConfig ) ; final java . util . Iterator < java . util . Map . Entry < org . apache . accumulo . core . data . Key , org . apache . accumulo . core . data . Value > > iterator = scanner . iterator ( ) ; int count = 0 ; while ( iterator . hasNext ( ) ) { iterator . next ( ) ; count ++ ; } org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( "" ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( ( "Total<sp>rows<sp>imported:<sp>" + count ) ) ; org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( "" ) ; "<AssertPlaceHolder>" ; org . apache . rya . accumulo . mr . merge . CopyToolTest . log . info ( "DONE" ) ; } next ( ) { if ( hasNextCalled ) { hasNextCalled = false ; } else if ( isEmpty ) { throw new java . util . NoSuchElementException ( ) ; } else { if ( this . hasNext ( ) ) { hasNextCalled = false ; } else { throw new java . util . NoSuchElementException ( ) ; } } return next ; } | org . junit . Assert . assertEquals ( 20 , count ) |
testFail ( ) { com . alibaba . dubbo . common . URL url = com . alibaba . dubbo . common . URL . valueOf ( "test://test" ) ; url = url . addParameter ( Constants . INTERFACE_KEY , "com.alibaba.dubbo.rpc.file.TpsService" ) ; url = url . addParameter ( Constants . TPS_LIMIT_RATE_KEY , 5 ) ; com . alibaba . dubbo . rpc . Invoker < com . alibaba . dubbo . rpc . filter . TpsLimitFilterTest > invoker = new com . alibaba . dubbo . rpc . support . MyInvoker < com . alibaba . dubbo . rpc . filter . TpsLimitFilterTest > ( url ) ; com . alibaba . dubbo . rpc . Invocation invocation = new com . alibaba . dubbo . rpc . support . MockInvocation ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { try { filter . invoke ( invoker , invocation ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; throw e ; } } } invoke ( com . alibaba . dubbo . rpc . Invoker , com . alibaba . dubbo . rpc . Invocation ) { if ( ( ( ( validation ) != null ) && ( ! ( invocation . getMethodName ( ) . startsWith ( "$" ) ) ) ) && ( com . alibaba . dubbo . common . utils . ConfigUtils . isNotEmpty ( invoker . getUrl ( ) . getMethodParameter ( invocation . getMethodName ( ) , Constants . VALIDATION_KEY ) ) ) ) { try { com . alibaba . dubbo . validation . Validator validator = validation . getValidator ( invoker . getUrl ( ) ) ; if ( validator != null ) { validator . validate ( invocation . getMethodName ( ) , invocation . getParameterTypes ( ) , invocation . getArguments ( ) ) ; } } catch ( com . alibaba . dubbo . rpc . RpcException e ) { throw e ; } catch ( java . lang . Throwable t ) { throw new com . alibaba . dubbo . rpc . RpcException ( t . getMessage ( ) , t ) ; } } return invoker . invoke ( invocation ) ; } | org . junit . Assert . assertTrue ( ( i >= 5 ) ) |
testBuildWithDisabledDefaultConstraints ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . publicactivity . PublicActivity context = new org . lnu . is . domain . publicactivity . PublicActivity ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>PublicActivity<sp>e<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . publicactivity . PublicActivity > 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 ) |
testUnsubscribeWhileConnClosing ( ) { try ( io . nats . streaming . NatsStreamingTestServer srv = new io . nats . streaming . NatsStreamingTestServer ( io . nats . streaming . SubscribeTests . clusterName , false ) ) { io . nats . streaming . Options opts = new io . nats . streaming . Options . Builder ( ) . natsUrl ( srv . getURI ( ) ) . pubAckWait ( java . time . Duration . ofMillis ( 50 ) ) . build ( ) ; try ( io . nats . streaming . StreamingConnection sc = io . nats . streaming . NatsStreaming . connect ( io . nats . streaming . SubscribeTests . clusterName , io . nats . streaming . SubscribeTests . clientName , opts ) ) { "<AssertPlaceHolder>" ; io . nats . streaming . Subscription sub = sc . subscribe ( "foo" , null ) ; final java . util . concurrent . CountDownLatch wg = new java . util . concurrent . CountDownLatch ( 1 ) ; java . lang . Thread t = new java . lang . Thread ( ( ) -> { try { java . lang . Thread . sleep ( java . util . concurrent . ThreadLocalRandom . current ( ) . nextInt ( 0 , 50 ) ) ; } catch ( exp ) { } try { sc . close ( ) ; } catch ( e ) { System . err . println ( "CLOSE<sp>ERROR" ) ; io . nats . streaming . e . printStackTrace ( ) ; } wg . countDown ( ) ; } ) ; t . start ( ) ; sub . unsubscribe ( ) ; wg . await ( ) ; } } } connect ( java . lang . String , java . lang . String , io . nats . streaming . Options ) { try { io . nats . streaming . StreamingConnectionImpl conn = new io . nats . streaming . StreamingConnectionImpl ( clusterId , clientId , opts ) ; conn . connect ( ) ; return conn ; } catch ( java . lang . InterruptedException e ) { java . lang . Thread . currentThread ( ) . interrupt ( ) ; return null ; } } | org . junit . Assert . assertNotNull ( sc ) |
deserializeJsonObjectEmpty ( ) { org . spincast . core . json . JsonObject jsonObj = getJsonManager ( ) . fromString ( "{}" ) ; "<AssertPlaceHolder>" ; } fromString ( java . lang . String ) { if ( contentTypeString == null ) { return null ; } contentTypeString = contentTypeString . toLowerCase ( ) ; for ( org . spincast . core . utils . ContentTypeDefaults contentType : org . spincast . core . utils . ContentTypeDefaults . values ( ) ) { if ( contentType . getVariations ( ) . contains ( contentTypeString ) ) { return contentType ; } } return null ; } | org . junit . Assert . assertNotNull ( jsonObj ) |
testFindTypeFromRequestClass ( ) { for ( org . sagebionetworks . repo . model . dbo . asynch . AsynchJobType t : org . sagebionetworks . repo . model . dbo . asynch . AsynchJobType . values ( ) ) { org . sagebionetworks . repo . model . dbo . asynch . AsynchJobType type = org . sagebionetworks . repo . model . dbo . asynch . AsynchJobType . findTypeFromRequestClass ( t . getRequestClass ( ) ) ; "<AssertPlaceHolder>" ; } } getRequestClass ( ) { return this . requestClass ; } | org . junit . Assert . assertEquals ( t , type ) |
testMultipleTermsPerField ( ) { java . lang . String candidate = "Berlin" ; java . util . List < org . aksw . agdistis . util . Triple > type = index . search ( null , null , candidate ) ; "<AssertPlaceHolder>" ; for ( org . aksw . agdistis . util . Triple t : type ) { log . debug ( t . toString ( ) ) ; } } search ( java . lang . String , java . lang . String , java . lang . String ) { return search ( subject , predicate , object , defaultMaxNumberOfDocsRetrievedFromIndex ) ; } | org . junit . Assert . assertTrue ( ( ( type . size ( ) ) > 1 ) ) |
testAll ( ) { final java . util . Collection < org . drools . verifier . core . index . select . SelectExactMatcherTest . Item > all = select . all ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , all . size ( ) ) |
dialogShouldBeShow ( ) { com . google . gwt . user . client . rpc . AsyncCallback < org . eclipse . che . security . oauth . OAuthStatus > callback = getCallBack ( ) ; gitHubAuthenticator . authenticate ( null , callback ) ; verify ( view ) . showDialog ( ) ; "<AssertPlaceHolder>" ; } showDialog ( ) { show ( ) ; } | org . junit . Assert . assertThat ( gitHubAuthenticator . callback , org . hamcrest . core . Is . is ( callback ) ) |
testValidateLocalFilePath ( ) { properties . localFilePath . setValue ( "" ) ; testRuntime . initialize ( container , properties ) ; "<AssertPlaceHolder>" ; } validatePutProperties ( org . talend . components . google . drive . put . GoogleDrivePutProperties ) { org . talend . daikon . properties . ValidationResultMutable vr = new org . talend . daikon . properties . ValidationResultMutable ( org . talend . daikon . properties . ValidationResult . Result . OK ) ; if ( org . apache . commons . lang3 . StringUtils . isEmpty ( properties . fileName . getValue ( ) ) ) { vr . setStatus ( Result . ERROR ) ; vr . setMessage ( org . talend . components . google . drive . runtime . GoogleDriveValidator . messages . getMessage ( "error.validation.filename.empty" ) ) ; return vr ; } if ( ! ( org . talend . components . google . drive . runtime . UPLOAD_LOCAL_FILE . equals ( properties . uploadMode . getValue ( ) ) ) ) { vr . setStatus ( Result . ERROR ) ; vr . setMessage ( org . talend . components . google . drive . runtime . GoogleDriveValidator . messages . getMessage ( "error.validation.put.invalid.flow" ) ) ; return vr ; } if ( org . apache . commons . lang3 . StringUtils . isEmpty ( properties . destinationFolder . getValue ( ) ) ) { vr . setStatus ( Result . ERROR ) ; vr . setMessage ( org . talend . components . google . drive . runtime . GoogleDriveValidator . messages . getMessage ( "error.validation.parentfolder.empty" ) ) ; return vr ; } if ( org . apache . commons . lang3 . StringUtils . isEmpty ( properties . localFilePath . getValue ( ) ) ) { vr . setStatus ( Result . ERROR ) ; vr . setMessage ( org . talend . components . google . drive . runtime . GoogleDriveValidator . messages . getMessage ( "error.validation.local.filename.empty" ) ) ; return vr ; } return vr ; } | org . junit . Assert . assertEquals ( Result . ERROR , testRuntime . validatePutProperties ( properties ) . getStatus ( ) ) |
testSplitForQueue ( ) { org . apache . beam . sdk . io . jms . JmsIO . Read read = org . apache . beam . sdk . io . jms . JmsIO . read ( ) . withQueue ( org . apache . beam . sdk . io . jms . JmsIOTest . QUEUE ) ; org . apache . beam . sdk . options . PipelineOptions pipelineOptions = org . apache . beam . sdk . options . PipelineOptionsFactory . create ( ) ; int desiredNumSplits = 5 ; org . apache . beam . sdk . io . jms . JmsIO . UnboundedJmsSource initialSource = new org . apache . beam . sdk . io . jms . JmsIO . UnboundedJmsSource ( read ) ; java . util . List < org . apache . beam . sdk . io . jms . JmsIO . UnboundedJmsSource > splits = initialSource . split ( desiredNumSplits , pipelineOptions ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; } | org . junit . Assert . assertEquals ( desiredNumSplits , splits . size ( ) ) |
testBuildWithDisabledStautsConstaint ( ) { unit . setActive ( false ) ; org . lnu . is . domain . studyplan . cycle . StudyPlanCycle context = new org . lnu . is . domain . studyplan . cycle . StudyPlanCycle ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>StudyPlanCycle<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . studyplan . cycle . StudyPlanCycle > 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 ( expected , actualQuery ) |
testGetTimestampsForQuery ( ) { java . util . List < java . lang . Long > expectedTimestamps = new java . util . ArrayList < java . lang . Long > ( ) ; expectedTimestamps . add ( 1363707480L ) ; expectedTimestamps . add ( 1363707540L ) ; expectedTimestamps . add ( 1363707600L ) ; expectedTimestamps . add ( 1363707660L ) ; expectedTimestamps . add ( 1363707720L ) ; expectedTimestamps . add ( 1363707780L ) ; java . util . List < java . lang . Long > actualTimestamps = ds . getTimestampsForQuery ( 1363707480L , 1363707780L , 60L ) ; "<AssertPlaceHolder>" ; } getTimestampsForQuery ( java . lang . Long , java . lang . Long , java . lang . Long ) { java . util . List < java . lang . Long > timestamps = new java . util . ArrayList < java . lang . Long > ( ) ; final java . lang . Long roundedStartTimestamp = roundTimestampToResolution ( start , resolution ) ; final java . lang . Long roundedEndTimestamp = roundTimestampToResolution ( end , resolution ) ; for ( java . lang . Long timestamp = roundedStartTimestamp ; timestamp <= roundedEndTimestamp ; timestamp = timestamp + resolution ) { timestamps . add ( timestamp ) ; } return timestamps ; } | org . junit . Assert . assertEquals ( expectedTimestamps , actualTimestamps ) |
testFindPersonByName ( ) { org . junit . Assume . assumeTrue ( ( ! ( org . sculptor . framework . accessimpl . jpa . JpaHelper . isJpaProviderDataNucleus ( getEntityManager ( ) ) ) ) ) ; java . util . List < org . sculptor . examples . library . person . domain . Person > persons = personService . findPersonByName ( getServiceContext ( ) , "Skarsgrd" ) ; "<AssertPlaceHolder>" ; } getServiceContext ( ) { return org . sculptor . framework . test . AppEngineTestHelper . getServiceContext ( ) ; } | org . junit . Assert . assertEquals ( 2 , persons . size ( ) ) |
testShuffleAndBroadcast ( ) { for ( org . apache . flink . api . common . ExecutionMode mode : org . apache . flink . api . common . ExecutionMode . values ( ) ) { "<AssertPlaceHolder>" ; } } getForShuffleOrBroadcast ( org . apache . flink . api . common . ExecutionMode ) { return org . apache . flink . runtime . io . network . DataExchangeMode . SHUFFLE [ mode . ordinal ( ) ] ; } | org . junit . Assert . assertNotNull ( org . apache . flink . runtime . io . network . DataExchangeMode . getForShuffleOrBroadcast ( mode ) ) |
testMarkFailed ( ) { when ( cache . getDocumentById ( id1 ) ) . thenReturn ( doc1 ) ; when ( writer . markFailed ( doc1 , "tag" ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; verify ( cache , times ( 1 ) ) . remove ( id1 ) ; verify ( writer , times ( 1 ) ) . markFailed ( doc1 , "tag" ) ; verify ( doc1 , times ( 1 ) ) . putAll ( doc1 ) ; } markFailed ( com . findwise . hydra . local . LocalDocument , java . lang . Throwable ) { d . addError ( stageName , t ) ; return markFailed ( d ) ; } | org . junit . Assert . assertTrue ( io . markFailed ( doc1 , "tag" ) ) |
testMalformedToPublisher ( ) { com . netflix . hystrix . HystrixCommand < java . io . InputStream > command = new org . talend . dataprep . command . CommandHelperTest . MalformedInputStreamTestCommand ( ) ; final org . reactivestreams . Publisher < org . talend . dataprep . command . CommandHelperTestData > publisher = org . talend . dataprep . command . CommandHelper . toPublisher ( org . talend . dataprep . command . CommandHelperTestData . class , mapper , command ) ; final java . util . List < org . talend . dataprep . command . CommandHelperTestData > receivedData = new java . util . ArrayList ( ) ; try { reactor . core . publisher . Flux . from ( publisher ) . subscribe ( receivedData :: add ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } isEmpty ( ) { return ( ( ( ( org . apache . commons . lang3 . StringUtils . isEmpty ( title ) ) && ( org . apache . commons . lang3 . StringUtils . isEmpty ( mail ) ) ) && ( org . apache . commons . lang3 . StringUtils . isEmpty ( severity ) ) ) && ( org . apache . commons . lang3 . StringUtils . isEmpty ( type ) ) ) && ( org . apache . commons . lang3 . StringUtils . isEmpty ( description ) ) ; } | org . junit . Assert . assertTrue ( receivedData . isEmpty ( ) ) |
testUnique ( ) { org . nd4j . linalg . api . ndarray . INDArray in = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 3 , 4 , 3 , 1 , 3 , 0 , 2 , 4 , 2 , 4 } ) ; org . nd4j . linalg . api . ndarray . INDArray expUnique = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 3 , 4 , 1 , 0 , 2 } ) ; org . nd4j . linalg . api . ndarray . INDArray expUniqueIdxs = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 0 , 1 , 0 , 2 , 0 , 3 , 4 , 1 , 4 , 1 } ) . castTo ( DataType . LONG ) ; org . nd4j . linalg . api . ndarray . INDArray outUnique = org . nd4j . linalg . factory . Nd4j . create ( DataType . DOUBLE , expUnique . shape ( ) ) ; org . nd4j . linalg . api . ndarray . INDArray outUniqueIdxs = org . nd4j . linalg . factory . Nd4j . create ( DataType . LONG , expUniqueIdxs . shape ( ) ) ; org . nd4j . linalg . api . ops . DynamicCustomOp op = org . nd4j . linalg . api . ops . DynamicCustomOp . builder ( "unique" ) . addInputs ( in ) . addOutputs ( outUnique , outUniqueIdxs ) . build ( ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( new org . nd4j . autodiff . validation . OpTestCase ( op ) . expectedOutput ( 0 , expUnique ) . expectedOutput ( 1 , expUniqueIdxs ) ) ; "<AssertPlaceHolder>" ; } expectedOutput ( int , org . nd4j . linalg . api . ndarray . INDArray ) { testFns . put ( outputNum , new org . nd4j . autodiff . validation . functions . EqualityFn ( expected ) ) ; expShapes . put ( outputNum , expected . shapeDescriptor ( ) ) ; return this ; } | org . junit . Assert . assertNull ( err ) |
testStringVanafExact ( ) { final nl . bzk . brp . domain . element . AttribuutElement attribuutElement = getAttribuutElement ( Element . PERSOON_GESLACHTSNAAMCOMPONENT_STAM ) ; final nl . bzk . brp . service . bevraging . zoekpersoongeneriek . AbstractZoekPersoonVerzoek bevragingVerzoek = maakBevragingVerzoek ( attribuutElement , "van" , Zoekoptie . VANAF_EXACT ) ; final nl . bzk . brp . domain . algemeen . Autorisatiebundel autorisatieBundel = maakAutorisatiebundel ( false , attribuutElement ) ; final java . util . Set < nl . bzk . brp . domain . algemeen . Melding > meldingen = valideerZoekCriteriaService . valideerZoekCriteria ( bevragingVerzoek , autorisatieBundel ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( meldingen . isEmpty ( ) ) |
testConvert ( ) { java . lang . String name = "MarkScaleN" ; java . lang . String abbrName = "AN" ; org . lnu . is . domain . mark . scale . type . MarkScaleType source = new org . lnu . is . domain . mark . scale . type . MarkScaleType ( ) ; source . setName ( name ) ; source . setAbbrName ( abbrName ) ; org . lnu . is . resource . mark . scale . type . MarkScaleTypeResource expected = new org . lnu . is . resource . mark . scale . type . MarkScaleTypeResource ( ) ; expected . setName ( name ) ; expected . setAbbrName ( abbrName ) ; org . lnu . is . resource . mark . scale . type . MarkScaleTypeResource actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
loadFromSPI ( org . apache . servicecomb . serviceregistry . discovery . DiscoveryFilter , org . apache . servicecomb . serviceregistry . discovery . DiscoveryFilter ) { java . lang . Class < ? extends org . apache . servicecomb . serviceregistry . discovery . DiscoveryFilter > cls = org . apache . servicecomb . serviceregistry . discovery . DiscoveryFilter . class ; new mockit . Expectations ( org . apache . servicecomb . foundation . common . utils . SPIServiceUtils . class ) { { org . apache . servicecomb . foundation . common . utils . SPIServiceUtils . getSortedService ( cls ) ; result = java . util . Arrays . asList ( f1 , f2 ) ; } } ; discoveryTree . loadFromSPI ( cls ) ; "<AssertPlaceHolder>" ; } loadFromSPI ( java . lang . Class ) { filters . addAll ( org . apache . servicecomb . foundation . common . utils . SPIServiceUtils . getSortedService ( cls ) ) ; } | org . junit . Assert . assertThat ( filters , org . hamcrest . Matchers . contains ( f1 , f2 ) ) |
testExecuteGetFieldMappingIndexRequest ( ) { java . lang . String mappingName = "testGetFieldMapping" ; java . lang . String mappingSource = "{\"properties\":{\"testField\":{\"type\":\"keyword\"},<sp>" + "\"otherTestField\":{\"type\":\"keyword\"}}}" ; _putMapping ( mappingName , mappingSource ) ; java . lang . String [ ] fields = new java . lang . String [ ] { "otherTestField" } ; com . liferay . portal . search . engine . adapter . index . GetFieldMappingIndexRequest getFieldMappingIndexRequest = new com . liferay . portal . search . engine . adapter . index . GetFieldMappingIndexRequest ( new java . lang . String [ ] { com . liferay . portal . search . elasticsearch6 . internal . search . engine . adapter . ElasticsearchSearchEngineAdapterIndexRequestTest . _INDEX_NAME } , mappingName , fields ) ; com . liferay . portal . search . engine . adapter . index . GetFieldMappingIndexResponse getFieldMappingIndexResponse = _searchEngineAdapter . execute ( getFieldMappingIndexRequest ) ; java . lang . String fieldMappings = java . lang . String . valueOf ( getFieldMappingIndexResponse . getFieldMappings ( ) ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return com . liferay . segments . service . util . ServiceProps . _instance . _configuration . contains ( key ) ; } | org . junit . Assert . assertTrue ( fieldMappings . contains ( mappingSource ) ) |
floatValue ( ) { final org . jboss . msc . value . Value < java . lang . Class < ? extends java . lang . Float > > value = new org . jboss . msc . value . ClassOfValue < java . lang . Float > ( new org . jboss . msc . value . ImmediateValue < java . lang . Float > ( 0.4F ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return ( count ) ++ ; } | org . junit . Assert . assertSame ( org . jboss . msc . value . Float . class , value . getValue ( ) ) |
testServerStartInvalidPortHigh ( ) { int port = 65536 ; org . simplesockets . server . SimpleServer server = new org . simplesockets . server . SimpleServer ( port , org . simplesockets . unittests . SimpleSocketsTest . emptyProtocol ) ; server . startServer ( ) ; java . lang . Thread . sleep ( 200 ) ; "<AssertPlaceHolder>" ; } isAlive ( ) { return alive ; } | org . junit . Assert . assertFalse ( server . isAlive ( ) ) |
OneMessageTransferPosTest ( ) { java . nio . ByteBuffer byteBuffer = java . nio . ByteBuffer . allocate ( 20 ) ; byteBuffer . putInt ( 20 ) ; org . apache . rocketmq . store . SelectMappedBufferResult selectMappedBufferResult = new org . apache . rocketmq . store . SelectMappedBufferResult ( 0 , byteBuffer , 20 , new org . apache . rocketmq . store . MappedFile ( ) ) ; org . apache . rocketmq . broker . pagecache . OneMessageTransfer manyMessageTransfer = new org . apache . rocketmq . broker . pagecache . OneMessageTransfer ( byteBuffer , selectMappedBufferResult ) ; "<AssertPlaceHolder>" ; } position ( ) { int pos = byteBufferHeader . position ( ) ; java . util . List < java . nio . ByteBuffer > messageBufferList = this . getMessageResult . getMessageBufferList ( ) ; for ( java . nio . ByteBuffer bb : messageBufferList ) { pos += bb . position ( ) ; } return pos ; } | org . junit . Assert . assertEquals ( manyMessageTransfer . position ( ) , 8 ) |
unsetDefaultValueProperty ( ) { configure ( ( ( ch . qos . logback . classic . sift . SiftingAppenderTest . SIFT_FOLDER_PREFIX ) + "unsetDefaultValueProperty.xml" ) ) ; logger . debug ( "hello" ) ; ch . qos . logback . classic . sift . SiftingAppender sa = ( ( ch . qos . logback . classic . sift . SiftingAppender ) ( root . getAppender ( "SIFT" ) ) ) ; "<AssertPlaceHolder>" ; } isStarted ( ) { return started ; } | org . junit . Assert . assertFalse ( sa . isStarted ( ) ) |
testOkVerhuizendNaarGba ( ) { final nl . bzk . migratiebrp . bericht . model . sync . impl . BlokkeringInfoAntwoordBericht blokkeringInfoAntwoord = new nl . bzk . migratiebrp . bericht . model . sync . impl . BlokkeringInfoAntwoordBericht ( ) ; blokkeringInfoAntwoord . setStatus ( StatusType . OK ) ; blokkeringInfoAntwoord . setPersoonsaanduiding ( PersoonsaanduidingType . VERHUIZEND_VAN_BRP_NAAR_LO_3_GBA ) ; final java . util . Map < java . lang . String , java . lang . Object > parameters = new java . util . HashMap ( ) ; parameters . put ( "blokkeringInfoAntwoordBericht" , berichtenDao . bewaarBericht ( blokkeringInfoAntwoord ) ) ; final java . util . Map < java . lang . String , java . lang . Object > result = subject . execute ( parameters ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( result . isEmpty ( ) ) |
testStringCoercion ( ) { final java . lang . String drl = ( ( ( ( ( ( ( ( ( ( ( "package<sp>org.drools.compiler.test;\n" + "<sp>then\n<sp>end\n" 1 ) + ( org . drools . compiler . Person . class . getCanonicalName ( ) ) ) + "<sp>then\n<sp>end\n" 0 ) + "<sp>rule<sp>R1<sp>when\n" ) + "<sp>Person(name<sp>==<sp>\"12\")\n" ) + "<sp>then<sp>end\n" ) + "<sp>then\n<sp>end\n" 2 ) + "<sp>Person(name<sp>==<sp>11)\n<sp>" ) + "<sp>then\n<sp>end\n" ) + "<sp>rule<sp>R3<sp>when\n" ) + "<sp>Person(name<sp>==<sp>\"11\")\n" ) + "<sp>then<sp>end\n" ; org . kie . api . KieBase kieBase = loadKnowledgeBaseFromString ( drl ) ; org . kie . api . runtime . KieSession kieSession = kieBase . newKieSession ( ) ; kieSession . insert ( new org . drools . compiler . Person ( "11" ) ) ; "<AssertPlaceHolder>" ; } fireAllRules ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 2 , kieSession . fireAllRules ( ) ) |
testSimpleMembers ( ) { java . util . List < org . biopax . paxtools . pattern . Match > list = org . biopax . paxtools . pattern . Searcher . search ( model . getByID ( "http://pid.nci.nih.gov/biopaxpid_35409" ) , new org . biopax . paxtools . pattern . Pattern ( org . biopax . paxtools . pattern . constraint . Complex . class , org . biopax . paxtools . pattern . constraint . ConBox . simpleMembers ( ) , "Complex" , "SPE" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( lastIndex ) + 1 ; } | org . junit . Assert . assertTrue ( ( ( list . size ( ) ) == 4 ) ) |
testSetProfileConfiguration ( ) { subject . setProfileConfiguration ( "P1" , org . eclipse . tycho . core . ee . ExecutionEnvironmentConfigurationTest . DUMMY_ORIGIN ) ; subject . setProfileConfiguration ( "P2" , org . eclipse . tycho . core . ee . ExecutionEnvironmentConfigurationTest . DUMMY_ORIGIN ) ; "<AssertPlaceHolder>" ; } getProfileName ( ) { return profileName ; } | org . junit . Assert . assertThat ( subject . getProfileName ( ) , org . hamcrest . CoreMatchers . is ( "P2" ) ) |
testSetMeasurement ( ) { org . drugis . addis . entities . Study study = new org . drugis . addis . entities . Study ( "X" , new org . drugis . addis . entities . Indication ( 0L , "" ) ) ; org . drugis . addis . ExampleData . addDefaultEpochs ( study ) ; org . drugis . addis . entities . Endpoint endpoint = new org . drugis . addis . entities . Endpoint ( "e" , org . drugis . addis . entities . Endpoint . convertVarType ( Variable . Type . RATE ) ) ; study . getEndpoints ( ) . add ( new org . drugis . addis . entities . StudyOutcomeMeasure < org . drugis . addis . entities . Endpoint > ( endpoint ) ) ; org . drugis . addis . entities . Arm group = study . createAndAddArm ( "" , 100 , null , null ) ; org . drugis . addis . entities . BasicRateMeasurement m = new org . drugis . addis . entities . BasicRateMeasurement ( 0 , group . getSize ( ) ) ; m . setRate ( 12 ) ; study . setMeasurement ( study . findStudyOutcomeMeasure ( study . getOutcomeMeasures ( ) . iterator ( ) . next ( ) ) , study . getArms ( ) . get ( 0 ) , m ) ; "<AssertPlaceHolder>" ; } getMeasurement ( org . drugis . addis . entities . Variable , org . drugis . addis . entities . Arm ) { final org . drugis . addis . entities . WhenTaken mm = defaultMeasurementMoment ( ) ; return mm == null ? null : getMeasurement ( v , a , mm ) ; } | org . junit . Assert . assertEquals ( m , study . getMeasurement ( study . getOutcomeMeasures ( ) . iterator ( ) . next ( ) , study . getArms ( ) . get ( 0 ) ) ) |
uriTest ( ) { com . b2international . snowowl . fhir . core . model . dt . Uri uri = new com . b2international . snowowl . fhir . core . model . dt . Uri ( "value" ) ; printPrettyJson ( uri ) ; java . lang . String expectedJson = "\"value\"" ; "<AssertPlaceHolder>" ; } printPrettyJson ( java . lang . Object ) { java . lang . String result = com . b2international . snowowl . fhir . tests . FhirTest . objectMapper . writeValueAsString ( object ) ; java . lang . Object json = com . b2international . snowowl . fhir . tests . FhirTest . objectMapper . readValue ( result , java . lang . Object . class ) ; java . lang . String prettyPrint = com . b2international . snowowl . fhir . tests . FhirTest . objectMapper . writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( json ) ; System . out . println ( prettyPrint ) ; } | org . junit . Assert . assertEquals ( expectedJson , objectMapper . writeValueAsString ( uri ) ) |
getContext_wrong_context_to_lookfor ( ) { ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity r = new ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity ( ) ; r . setId ( java . lang . Integer . valueOf ( 1 ) ) ; ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity context = new ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity ( ) ; context . setId ( java . lang . Integer . valueOf ( 12 ) ) ; ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeContextEntity createdContext = r . createContext ( ) ; createdContext . setContext ( context ) ; java . util . Set < ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeContextEntity > contexts = new java . util . HashSet < ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeContextEntity > ( ) ; contexts . add ( createdContext ) ; r . setContexts ( contexts ) ; ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity contextToLookfor = new ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity ( ) ; contextToLookfor . setId ( java . lang . Integer . valueOf ( 1 ) ) ; ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeContextEntity contextResult = r . getContext ( contextToLookfor ) ; "<AssertPlaceHolder>" ; } getContext ( java . lang . Class ) { com . fasterxml . jackson . databind . ObjectMapper mapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; mapper . disable ( com . fasterxml . jackson . databind . DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES ) ; return mapper ; } | org . junit . Assert . assertNull ( contextResult ) |
constructorSetsFields ( ) { io . motown . domain . api . chargingstation . MakeChargingStationNotReservableCommand command = new io . motown . domain . api . chargingstation . MakeChargingStationNotReservableCommand ( CHARGING_STATION_ID , ROOT_IDENTITY_CONTEXT ) ; "<AssertPlaceHolder>" ; } getChargingStationId ( ) { return chargingStationId ; } | org . junit . Assert . assertEquals ( io . motown . domain . api . chargingstation . CHARGING_STATION_ID , command . getChargingStationId ( ) ) |
getOrderByUsername_shouldFindEmptyListForNonExistingUsername ( ) { java . util . List < org . mybatis . jpetstore . domain . Order > orders = orderDao . getOrdersByUsername ( "NON_EXISTING_USERNAME" ) ; "<AssertPlaceHolder>" ; } getOrdersByUsername ( java . lang . String ) { checkNotNull ( emptyToNull ( username ) , "Argument[username]<sp>must<sp>not<sp>be<sp>empty<sp>or<sp>null" ) ; java . util . List < org . mybatis . jpetstore . domain . Order > orders = new java . util . ArrayList ( ) ; com . mongodb . DBObject query = new com . mongodb . BasicDBObject ( "username" , username ) ; try ( com . mongodb . DBCursor cursor = collection . find ( query ) . sort ( new com . mongodb . BasicDBObject ( "order_id" , 1 ) ) ) { while ( cursor . hasNext ( ) ) { com . mongodb . DBObject orderObj = cursor . next ( ) ; orders . add ( org . mybatis . jpetstore . domain . Order . fromDBObject ( orderObj ) ) ; } } org . mybatis . jpetstore . persistence . mongodb . OrderDao . logger . info ( "Found<sp>for<sp>username<sp>[{}]<sp>[{}]<sp>order(s)" , username , orders . size ( ) ) ; return orders ; } | org . junit . Assert . assertThat ( orders . size ( ) , org . hamcrest . core . Is . is ( 0 ) ) |
testJAXBObjectRepresentation ( ) { initiateWebApplication ( com . sun . jersey . impl . entity . EntityTypesTest . JAXBObjectResolver . class , com . sun . jersey . impl . entity . EntityTypesTest . JAXBObjectResource . class ) ; com . sun . jersey . api . client . WebResource r = resource ( "/" ) ; java . lang . Object in = new com . sun . jersey . impl . entity . JAXBBean ( "CONTENT" ) ; com . sun . jersey . impl . entity . JAXBBean out = r . entity ( in , "application/xml" ) . post ( com . sun . jersey . impl . entity . JAXBBean . class ) ; "<AssertPlaceHolder>" ; } post ( java . lang . String ) { return content ; } | org . junit . Assert . assertEquals ( in , out ) |
TestIdsStr2Iterable ( ) { final java . lang . String ids = "1,2,3,4,5" ; java . util . List < java . lang . Long > expected = new java . util . ArrayList ( ) ; expected . add ( 1L ) ; expected . add ( 2L ) ; expected . add ( 3L ) ; expected . add ( 4L ) ; expected . add ( 5L ) ; java . util . List < java . lang . Long > actual = com . google . common . collect . Lists . newArrayList ( transformer . idsStr2List ( ids ) ) ; actual . forEach ( System . out :: println ) ; "<AssertPlaceHolder>" ; } idsStr2List ( java . lang . String ) { return com . google . common . collect . Lists . newArrayList ( niceCommaSplitter . split ( idsStr ) ) . stream ( ) . map ( Long :: valueOf ) . collect ( java . util . stream . Collectors . toList ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
combineUtf16 ( ) { java . lang . String letter = "A" ; java . lang . String [ ] accents = new java . lang . String [ ] { "acute" } ; java . lang . String expect = "́A"" ; java . lang . String actual = gov . uspto . patent . doc . xml . BraceCode2UnicodeTest . braceCodeUTF8 . combineUtf16 ( letter , accents ) ; ""<AssertPlaceHolder>"" ; } combineUtf16 ( java . lang . CharSequence , java . lang . String [ ] ) { java . util . List < java . lang . Character > before = new java . util . ArrayList < java . lang . Character > ( ) ; java . util . List < java . lang . Character > after = new java . util . ArrayList < java . lang . Character > ( ) ; for ( java . lang . String ac : accents ) { java . lang . Character unicode = getUnicode ( ac ) ; if ( ac . endsWith ( ""_under"" ) ) { before . add ( unicode ) ; } else { before . add ( unicode ) ; } } java . lang . StringBuilder accentUnicodeStb = new java . lang . StringBuilder ( ) ; for ( java . lang . Character unicode : before ) { accentUnicodeStb . append ( unicode ) ; } accentUnicodeStb . append ( letters ) ; for ( java . lang . Character unicode : after ) { accentUnicodeStb . append ( unicode ) ; } java . lang . String sequence = accentUnicodeStb . toString ( ) ; return ( accentUnicodeStb . length ( ) ) > ( letters . length ( ) ) ? sequence : null ; }" | org . junit . Assert . assertEquals ( expect , actual ) |
givenGeoShapeData_whenExecutedGeoShapeQuery_thenResultNonEmpty ( ) { java . lang . String jsonObject = "{\"name\":\"Agra\",\"region\":{\"type\":\"envelope\",\"coordinates\":[[75,30.2],[80.1,<sp>25]]}}" ; org . elasticsearch . action . index . IndexResponse response = client . prepareIndex ( com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS_OF_WORLD , com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS ) . setSource ( jsonObject , XContentType . JSON ) . get ( ) ; java . lang . String tajMahalId = response . getId ( ) ; client . admin ( ) . indices ( ) . prepareRefresh ( com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS_OF_WORLD ) . get ( ) ; com . vividsolutions . jts . geom . Coordinate topLeft = new com . vividsolutions . jts . geom . Coordinate ( 74 , 31.2 ) ; com . vividsolutions . jts . geom . Coordinate bottomRight = new com . vividsolutions . jts . geom . Coordinate ( 81.1 , 24 ) ; org . elasticsearch . index . query . QueryBuilder qb = org . elasticsearch . index . query . QueryBuilders . geoShapeQuery ( "region" , org . elasticsearch . common . geo . builders . ShapeBuilders . newEnvelope ( topLeft , bottomRight ) ) . relation ( ShapeRelation . WITHIN ) ; org . elasticsearch . action . search . SearchResponse searchResponse = client . prepareSearch ( com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS_OF_WORLD ) . setTypes ( com . baeldung . elasticsearch . GeoQueriesManualTest . WONDERS ) . setQuery ( qb ) . execute ( ) . actionGet ( ) ; java . util . List < java . lang . String > ids = java . util . Arrays . stream ( searchResponse . getHits ( ) . getHits ( ) ) . map ( SearchHit :: getId ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { if ( o instanceof java . lang . String ) { return cookieMap . containsKey ( o ) ; } if ( o instanceof javax . servlet . http . Cookie ) { return cookieMap . containsValue ( o ) ; } return false ; } | org . junit . Assert . assertTrue ( ids . contains ( tajMahalId ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.