input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
should_query_with_att_from_mapped_super ( ) { final java . lang . String name = "should_create_date_criteria" ; final java . lang . String superName = "super_should_create_date_criteria" ; final org . apache . deltaspike . data . test . domain . Simple simple = new org . apache . deltaspike . data . test . domain . Simple ( name ) ; simple . setSuperName ( superName ) ; getEntityManager ( ) . persist ( simple ) ; getEntityManager ( ) . flush ( ) ; final org . apache . deltaspike . data . test . domain . Simple result = repo . findBySuperName ( superName ) ; "<AssertPlaceHolder>" ; } getSuperName ( ) { return superName ; } | org . junit . Assert . assertEquals ( superName , result . getSuperName ( ) ) |
testSerializeServerEntry ( ) { org . apache . directory . api . ldap . model . entry . Entry entry = new org . apache . directory . api . ldap . model . entry . DefaultEntry ( org . apache . directory . server . core . partition . impl . btree . jdbm . ServerEntrySerializerTest . schemaManager , "" , "objectClass:<sp>top" , "objectClass:<sp>person" , "objectClass:<sp>inetOrgPerson" , "objectClass:<sp>organizationalPerson" , "cn:<sp>text" , "cn:<sp>test" , "SN:<sp>Test" , "userPassword" , org . apache . directory . api . util . Strings . getBytesUtf8 ( "password" ) ) ; org . apache . directory . server . core . partition . impl . btree . jdbm . EntrySerializer ses = new org . apache . directory . server . core . partition . impl . btree . jdbm . EntrySerializer ( org . apache . directory . server . core . partition . impl . btree . jdbm . ServerEntrySerializerTest . schemaManager ) ; byte [ ] data = ses . serialize ( entry ) ; org . apache . directory . api . ldap . model . entry . Entry result = ( ( org . apache . directory . api . ldap . model . entry . Entry ) ( ses . deserialize ( data ) ) ) ; "<AssertPlaceHolder>" ; } deserialize ( byte [ ] ) { if ( ( ( bytes == null ) || ( ( bytes . length ) != ( org . apache . directory . server . core . partition . impl . btree . jdbm . BTreeRedirectMarshaller . SIZE ) ) ) || ( ( bytes [ 0 ] ) != 1 ) ) { if ( bytes != null ) { throw new java . io . IOException ( org . apache . directory . server . i18n . I18n . err ( I18n . ERR_568 , org . apache . directory . api . util . Strings . dumpBytes ( bytes ) ) ) ; } else { throw new java . io . IOException ( org . apache . directory . server . i18n . I18n . err ( I18n . ERR_569 ) ) ; } } long recId = ( ( ( ( ( ( ( ( ( long ) ( ( bytes [ 1 ] ) & 255 ) ) << 56 ) | ( ( ( long ) ( ( bytes [ 2 ] ) & 255 ) ) << 48 ) ) | ( ( ( long ) ( ( bytes [ 3 ] ) & 255 ) ) << 40 ) ) | ( ( ( long ) ( ( bytes [ 4 ] ) & 255 ) ) << 32 ) ) | ( ( ( long ) ( ( bytes [ 5 ] ) & 255 ) ) << 24 ) ) | ( ( ( long ) ( ( bytes [ 6 ] ) & 255 ) ) << 16 ) ) | ( ( ( long ) ( ( bytes [ 7 ] ) & 255 ) ) << 8 ) ) | ( ( long ) ( ( bytes [ 8 ] ) & 255 ) ) ; return new org . apache . directory . server . core . partition . impl . btree . jdbm . BTreeRedirect ( recId ) ; } | org . junit . Assert . assertEquals ( entry , result ) |
getColorThemeFromSkinFileWithException ( ) { java . lang . Exception exception = new org . xwiki . lesscss . compiler . LESSCompilerException ( "Exception<sp>with<sp>LESS" , null ) ; when ( lessColorThemeConverter . getColorThemeFromSkinFile ( "style.less" , false ) ) . thenThrow ( exception ) ; org . xwiki . lesscss . internal . colortheme . ColorTheme result = mocker . getComponentUnderTest ( ) . getColorThemeFromSkinFile ( "style.less" ) ; "<AssertPlaceHolder>" ; } size ( ) { return groupNames . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testProcessStatusReady ( ) { when ( mockEvent . getBody ( ) ) . thenReturn ( "frank" . getBytes ( ) ) ; org . apache . flume . Sink . Status status = mockKafkaSink . process ( ) ; verify ( mockChannel , times ( 1 ) ) . getTransaction ( ) ; verify ( mockChannel , times ( 1 ) ) . take ( ) ; verify ( mockProducer , times ( 1 ) ) . send ( ( ( kafka . producer . KeyedMessage < byte [ ] , byte [ ] > ) ( any ( ) ) ) ) ; verify ( mockTx , times ( 1 ) ) . commit ( ) ; verify ( mockTx , times ( 0 ) ) . rollback ( ) ; verify ( mockTx , times ( 1 ) ) . close ( ) ; "<AssertPlaceHolder>" ; } process ( ) { org . apache . flume . Channel channel = getChannel ( ) ; org . apache . flume . Transaction tx = channel . getTransaction ( ) ; try { tx . begin ( ) ; org . apache . flume . Event event = channel . take ( ) ; if ( event == null ) { tx . commit ( ) ; return Status . READY ; } java . lang . String line = new java . lang . String ( event . getBody ( ) ) ; java . util . HashMap < java . lang . String , java . lang . Object > map = org . redoop . flume . sink . avro . kafka . KafkaAvroSinkUtil . parseMessage ( props , line ) ; org . apache . avro . generic . GenericData . Record record = org . redoop . flume . sink . avro . kafka . KafkaAvroSinkUtil . fillRecord ( org . redoop . flume . sink . avro . kafka . KafkaAvroSinkUtil . fillAvroTestSchema ( avroSchemaFile ) , map ) ; byte [ ] avroRecord = org . redoop . flume . sink . avro . kafka . KafkaAvroSinkUtil . encodeMessage ( topic , record , props ) ; producer . send ( new kafka . producer . KeyedMessage < byte [ ] , byte [ ] > ( this . topic , avroRecord ) ) ; tx . commit ( ) ; return Status . READY ; } catch ( java . lang . Exception e ) { try { tx . rollback ( ) ; return Status . BACKOFF ; } catch ( java . lang . Exception e2 ) { org . redoop . flume . sink . avro . kafka . KafkaAvroSink . log . error ( "Rollback<sp>Exception:{}" , e2 ) ; } org . redoop . flume . sink . avro . kafka . KafkaAvroSink . log . error ( "KafkaAvroSink<sp>Exception:{}" , e ) ; return Status . BACKOFF ; } finally { tx . close ( ) ; } } | org . junit . Assert . assertEquals ( Status . READY , status ) |
checkMessageMethod ( ) { java . lang . String str = "test" ; info . smart_tools . smartactors . endpoint . interfaces . ideserialize_strategy . exceptions . DeserializationException exception = new info . smart_tools . smartactors . endpoint . interfaces . ideserialize_strategy . exceptions . DeserializationException ( str ) ; "<AssertPlaceHolder>" ; throw exception ; } getMessage ( ) { return message ; } | org . junit . Assert . assertEquals ( exception . getMessage ( ) , str ) |
testNN_AtmCorrCheckOutputNode ( ) { int numNodesInput = 18 ; int numNodesOutput = 10 ; int checkOutputNode = org . esa . s3tbx . fub . wew . util . NN_YellowSubstance . compute ( in , numNodesInput , out , numNodesOutput , width , mask , 0 , a ) ; "<AssertPlaceHolder>" ; } compute ( float [ ] [ ] , int , float [ ] [ ] , int , int , int [ ] , int , float [ ] ) { final int [ ] rcheck ; final int nodes_input = 18 ; final int nodes_output = 1 ; final int nodes_input_bias = 1 ; final int nodes_input_pca = 1 ; final int nodes_hidden = 40 ; final int nodes_hidden_bias = 1 ; final double nodes_hidden_temperature = 1.0 ; final double t_input = nodes_hidden_temperature / ( ( double ) ( nodes_input ) ) ; final double t_hidden = nodes_hidden_temperature / ( ( double ) ( nodes_hidden ) ) ; final double [ ] vt ; final double [ ] vt1 ; if ( getNumNodesInput <= 0 ) { return nodes_input ; } if ( getNumNodesOutput <= 0 ) { return nodes_output ; } if ( getNumNodesInput != nodes_input ) { return - 1 ; } if ( getNumNodesOutput != nodes_output ) { return - 2 ; } vt = new double [ nodes_input + nodes_input_bias ] ; vt1 = new double [ nodes_hidden + nodes_hidden_bias ] ; rcheck = new int [ width ] ; for ( int x = 0 ; x < width ; x ++ ) { rcheck [ x ] = 0 ; if ( ( a [ x ] ) < 0.0F ) { rcheck [ x ] = 1 ; } a [ x ] = 1.0F ; } for ( int x = 0 ; x < width ; x ++ ) { if ( ( mask [ x ] ) == 0 ) { if ( ( rcheck [ x ] ) != 0 ) { for ( int i = 0 ; ( i < nodes_input ) && ( ( a [ x ] ) > 0.0F ) ; i ++ ) { if ( ( ( in [ i ] [ x ] ) < ( ( float ) ( NN_General . NODES_INPUT_SCALE_LIMITS [ i ] [ 0 ] ) ) ) || ( ( in [ i ] [ x ] ) > ( ( float ) ( NN_General . NODES_INPUT_SCALE_LIMITS [ i ] [ 1 ] ) ) ) ) { a [ x ] -= 3.0F ; } } if ( ( a [ x ] ) < 0.0F ) { mask [ x ] |= errmask ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == ( - 1 ) ) { in [ i ] [ x ] = ( ( float ) ( java . lang . Math . log ( ( ( double ) ( in [ i ] [ x ] ) ) ) ) ) ; } if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == ( - 2 ) ) { in [ i ] [ x ] = ( ( float ) ( java . lang . Math . exp ( ( ( double ) ( in [ i ] [ x ] ) ) ) ) ) ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { in [ i ] [ x ] = ( ( float ) ( NN_General . NODES_INPUT_SCALE_OFF [ i ] ) ) + ( ( ( in [ i ] [ x ] ) - ( ( float ) ( org . esa . s3tbx . fub . wew . util . NN_YellowSubstance . nodes_input_scale_run38 [ i ] [ 0 ] ) ) ) / ( ( float ) ( org . esa . s3tbx . fub . wew . util . NN_YellowSubstance . nodes_input_scale_run38 [ i ] [ 1 ] ) ) ) ; } if ( nodes_input_pca != 0 ) { for ( int i = 0 ; i < nodes_input ; i ++ ) { vt [ i ] = ( ( double ) ( in [ i ] [ x ] ) ) ; if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == 1 ) { vt [ i ] = 0.0 ; for ( int j = 0 ; j < nodes_input ; j ++ ) { if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ j ] ) == 1 ) { vt [ i ] += ( ( double ) ( in [ j ] [ x ] ) ) * ( org . esa . s3tbx . fub . wew . util . NN_YellowSubstance . nodes_input_pca_evec_run38 [ j ] [ i ] ) ; } } } } for ( int i = 0 ; i < nodes_input ; i ++ ) { in [ i ] [ x ] = ( ( float ) ( vt [ i ] ) ) ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { vt [ i ] = ( ( double ) ( in [ i ] [ x ] ) ) ; } for ( int i = nodes_input ; i < ( nodes_input + nodes_input_bias ) ; i ++ ) { vt [ i ] = 1.0 ; } for ( int i = 0 ; i < nodes_hidden ; i ++ ) { vt1 [ i ] = 0.0 ; for ( int j = 0 ; j < ( nodes_input + nodes_input_bias ) ; j ++ ) { vt1 [ i ] += ( vt [ j ] ) * ( org . esa . s3tbx . fub . wew . | org . junit . Assert . assertEquals ( ( - 2 ) , checkOutputNode ) |
testAddNotification_nonNotificationTx_assertTxNotAdded ( ) { org . nhindirect . monitor . processor . impl . DefaultDuplicateNotificationStateManager mgr = new org . nhindirect . monitor . processor . impl . DefaultDuplicateNotificationStateManager ( ) ; mgr . setDao ( notifDao ) ; org . nhindirect . common . tx . model . Tx tx = org . nhindirect . monitor . util . TestUtils . makeMessage ( TxMessageType . IMF , "1234" , "" , "" , "" , "gm2552@cerner.com" ) ; mgr . addNotification ( tx ) ; java . util . Set < java . lang . String > addedAddr = notifDao . getReceivedAddresses ( "1234" , java . util . Arrays . asList ( "gm2552@cerner.com" ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 0 , addedAddr . size ( ) ) |
scriptBodyWithoutReplName ( ) { java . lang . String text = "12345678" ; "<AssertPlaceHolder>" ; } getScriptBody ( java . lang . String ) { if ( text == null ) { return null ; } java . lang . String magic = org . apache . zeppelin . notebook . Paragraph . getRequiredReplName ( text ) ; if ( magic == null ) { return text ; } java . lang . String trimmed = text . trim ( ) ; if ( ( ( magic . length ( ) ) + 1 ) >= ( trimmed . length ( ) ) ) { return "" ; } return trimmed . substring ( ( ( magic . length ( ) ) + 1 ) ) . trim ( ) ; } | org . junit . Assert . assertEquals ( text , org . apache . zeppelin . notebook . Paragraph . getScriptBody ( text ) ) |
testDeactivateExistingActivation ( ) { java . lang . String id = "id" ; serverPushActivationTracker . activate ( id ) ; serverPushActivationTracker . deactivate ( id ) ; "<AssertPlaceHolder>" ; } isActive ( ) { return this . equals ( editor . getActivePageInstance ( ) ) ; } | org . junit . Assert . assertFalse ( serverPushActivationTracker . isActive ( ) ) |
testDiaptchWithWsaDisable ( ) { javax . xml . namespace . QName port = new javax . xml . namespace . QName ( "http://apache.org/cxf/systest/ws/addr_feature/" , "AddNumbersPort" ) ; javax . xml . ws . Dispatch < javax . xml . soap . SOAPMessage > disptch = getService ( ) . createDispatch ( port , javax . xml . soap . SOAPMessage . class , javax . xml . ws . Service . Mode . MESSAGE , new javax . xml . ws . soap . AddressingFeature ( false ) ) ; ( ( javax . xml . ws . BindingProvider ) ( disptch ) ) . getRequestContext ( ) . put ( BindingProvider . ENDPOINT_ADDRESS_PROPERTY , ( ( "http://localhost:" + ( org . apache . cxf . systest . ws . addr_disable . WSADisableTest . PORT ) ) + "/jaxws/add" ) ) ; java . io . InputStream is = getClass ( ) . getResourceAsStream ( "resources/AddNumbersDispatchReq.xml" ) ; javax . xml . soap . SOAPMessage soapReqMsg = javax . xml . soap . MessageFactory . newInstance ( ) . createMessage ( null , is ) ; "<AssertPlaceHolder>" ; try { disptch . invoke ( soapReqMsg ) ; org . junit . Assert . fail ( "The<sp>MAPcodec<sp>ate<sp>the<sp>SOAPFaultException" ) ; } catch ( org . apache . cxf . systest . ws . addr_disable . javax e ) { } } createMessage ( java . lang . StringBuilder , org . apache . cxf . tools . common . ToolErrorListener$ErrorInfo ) { if ( ( e . file ) != null ) { b . append ( e . file ) . append ( "<sp>[" ) . append ( e . line ) . append ( ',' ) . append ( e . col ) . append ( "]:<sp>" ) . append ( e . message ) ; } else if ( ( ( e . message ) == null ) && ( ( e . cause ) != null ) ) { b . append ( e . cause . getLocalizedMessage ( ) ) ; } else { b . append ( e . message ) ; } return b ; } | org . junit . Assert . assertNotNull ( soapReqMsg ) |
loadRep_num_map_tasks_variable ( ) { when ( org . pentaho . big . data . kettle . plugins . mapreduce . JobEntryHadoopTransJobExecutorTest . rep . getJobEntryAttributeString ( org . pentaho . big . data . kettle . plugins . mapreduce . JobEntryHadoopTransJobExecutorTest . oid , "num_map_tasks" ) ) . thenReturn ( "${test}" ) ; org . pentaho . big . data . kettle . plugins . mapreduce . JobEntryHadoopTransJobExecutorTest . exec . loadRep ( org . pentaho . big . data . kettle . plugins . mapreduce . JobEntryHadoopTransJobExecutorTest . rep , org . pentaho . big . data . kettle . plugins . mapreduce . JobEntryHadoopTransJobExecutorTest . metaStore , org . pentaho . big . data . kettle . plugins . mapreduce . JobEntryHadoopTransJobExecutorTest . oid , null , null ) ; "<AssertPlaceHolder>" ; } getNumMapTasks ( ) { return numMapTasks ; } | org . junit . Assert . assertEquals ( "${test}" , org . pentaho . big . data . kettle . plugins . mapreduce . JobEntryHadoopTransJobExecutorTest . exec . getNumMapTasks ( ) ) |
testLoadPredefinedRules ( ) { org . apache . tajo . rule . SelfDiagnosisRuleEngine ruleEngine = org . apache . tajo . rule . SelfDiagnosisRuleEngine . getInstance ( ) ; ruleEngine . loadPredefinedRules ( ) ; "<AssertPlaceHolder>" ; } getRules ( ) { return wrapperMap ; } | org . junit . Assert . assertThat ( ( ( ruleEngine . getRules ( ) . size ( ) ) > 0 ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testUnLoadAllStrategies ( ) { strategyService . loadAllStrategies ( ) ; reset ( instrumentSubscriptionListener ) ; strategyService . unLoadAllStrategies ( ) ; "<AssertPlaceHolder>" ; for ( java . lang . String instrumentId : INSTRUMENT_IDS ) { verify ( instrumentSubscriptionListener , never ( ) ) . onInstrumentSubscriptionRequest ( instrumentId ) ; } for ( java . lang . String instrumentId : INSTRUMENT_IDS ) { verify ( instrumentSubscriptionListener , times ( 1 ) ) . onInstrumentUnSubscriptionRequest ( instrumentId ) ; } } getStrategies ( ) { return com . google . common . collect . ImmutableList . copyOf ( registeredStrategies ) ; } | org . junit . Assert . assertTrue ( strategyService . getStrategies ( ) . isEmpty ( ) ) |
testGenerateName_withOneLength ( ) { final java . lang . String result = nameGenerator . generateName ( 1 ) ; "<AssertPlaceHolder>" ; } generateName ( int ) { if ( length < 2 ) { length = 2 ; } final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; final java . util . concurrent . ThreadLocalRandom rand = java . util . concurrent . ThreadLocalRandom . current ( ) ; while ( ( sb . length ( ) ) < length ) { if ( ( length % 2 ) == 0 ) { sb . append ( vowels [ rand . nextInt ( vowels . length ) ] ) ; } else { sb . append ( consonants [ rand . nextInt ( consonants . length ) ] ) ; } } if ( ( sb . length ( ) ) > length ) { sb . deleteCharAt ( ( ( sb . length ( ) ) - ( ( sb . length ( ) ) - length ) ) ) ; } return capitalizeFirstCharacter ( sb . toString ( ) ) ; } | org . junit . Assert . assertEquals ( 2 , result . length ( ) ) |
emptyStringPropertyHasCorrectDefaultValue ( ) { java . lang . Object instance = org . jsonschema2pojo . integration . DefaultIT . classWithDefaults . newInstance ( ) ; java . lang . reflect . Method getter = org . jsonschema2pojo . integration . DefaultIT . classWithDefaults . getMethod ( "getEmptyStringWithDefault" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( ( ( java . lang . String ) ( getter . invoke ( instance ) ) ) , is ( equalTo ( "" ) ) ) |
testInsertRetrieveAllEmpty ( ) { org . mongojack . mock . MockObject object = new org . mongojack . mock . MockObject ( ) ; object . _id = "1" ; coll . insert ( object ) ; org . mongojack . mock . MockObject result = coll . findOne ( ) ; "<AssertPlaceHolder>" ; } findOne ( ) { return findOne ( new org . bson . Document ( ) ) ; } | org . junit . Assert . assertEquals ( object , result ) |
encodeContentGzippedZeroCopy ( ) { org . kaazing . mina . filter . codec . ProtocolCodecSessionEx session = new org . kaazing . mina . filter . codec . ProtocolCodecSessionEx ( ) ; org . kaazing . mina . core . buffer . IoBufferAllocatorEx < ? > allocator = session . getBufferAllocator ( ) ; org . apache . mina . filter . codec . ProtocolEncoder encoder = new org . kaazing . gateway . transport . http . bridge . filter . HttpResponseEncoder ( allocator ) ; org . apache . mina . filter . codec . ProtocolEncoderOutput encoderOut = session . getEncoderOutput ( ) ; org . kaazing . gateway . transport . http . bridge . filter . HttpBufferAllocator httpAllocator = new org . kaazing . gateway . transport . http . bridge . filter . HttpBufferAllocator ( allocator ) ; byte [ ] textBytes = "Hello,<sp>world" . getBytes ( ) ; org . kaazing . mina . core . buffer . IoBufferEx data = httpAllocator . wrap ( httpAllocator . allocate ( textBytes . length , org . kaazing . gateway . transport . http . bridge . filter . FLAG_ZERO_COPY ) ) ; int pos = data . position ( ) ; data . put ( textBytes ) ; data . position ( pos ) ; org . kaazing . gateway . transport . http . bridge . HttpContentMessage httpContent = new org . kaazing . gateway . transport . http . bridge . HttpContentMessage ( data , false , false , true ) ; encoder . encode ( session , httpContent , encoderOut ) ; encoderOut . mergeAll ( ) ; org . kaazing . mina . core . buffer . IoBufferEx buf = ( ( org . kaazing . mina . core . buffer . IoBufferEx ) ( session . getEncoderOutputQueue ( ) . poll ( ) ) ) ; org . kaazing . mina . core . buffer . IoBufferEx expected = allocator . wrap ( allocator . allocate ( 17 ) ) ; expected . put ( new byte [ ] { 0 , ( ( byte ) ( 12 ) ) , 0 , ( ( byte ) ( ~ 12 ) ) , ( ( byte ) ( ~ 0 ) ) } ) ; expected . put ( "Hello,<sp>world" . getBytes ( ) ) ; expected . flip ( ) ; "<AssertPlaceHolder>" ; } flip ( ) { buf . flip ( ) ; return this ; } | org . junit . Assert . assertEquals ( expected , buf ) |
testBusThroughput ( ) { class TestCallback implements org . jboss . errai . bus . client . api . messaging . MessageCallback { int calls ; @ org . jboss . errai . bus . server . Override public void callback ( org . jboss . errai . bus . client . api . messaging . Message message ) { ( calls ) ++ ; } } TestCallback callback = new TestCallback ( ) ; org . jboss . errai . bus . server . ServerMessageBusImpl bus = new org . jboss . errai . bus . server . ServerMessageBusImpl ( new org . jboss . errai . bus . server . mock . MockErraiService ( ) , new org . jboss . errai . bus . server . mock . MockErraiServiceConfigurator ( ) ) ; bus . subscribe ( "Foo" , callback ) ; int iterations = 25000000 ; long start = java . lang . System . currentTimeMillis ( ) ; for ( int i = 0 ; i < iterations ; i ++ ) { org . jboss . errai . bus . client . api . base . MessageBuilder . createMessage ( ) . toSubject ( "Foo" ) . done ( ) . sendNowWith ( bus ) ; } long time = ( java . lang . System . currentTimeMillis ( ) ) - start ; java . text . NumberFormat nf = new java . text . DecimalFormat ( "###,###.###" ) ; System . out . println ( ( ( "Total<sp>Test<sp>Time<sp>:<sp>" + ( nf . format ( ( time / 1000.0 ) ) ) ) + "<sp>seconds." ) ) ; System . out . println ( ( "Total<sp>Messages<sp>Sent:<sp>" + ( nf . format ( iterations ) ) ) ) ; System . out . println ( ( "Total<sp>Messages<sp>Rcvd:<sp>" + ( nf . format ( callback . calls ) ) ) ) ; System . out . println ( ( ( "Transaction<sp>Rate<sp>:<sp>" + ( nf . format ( ( iterations / ( time / 1000.0 ) ) ) ) ) + "<sp>per<sp>second." ) ) ; "<AssertPlaceHolder>" ; } format ( java . util . logging . LogRecord ) { date . setTime ( record . getMillis ( ) ) ; java . lang . String name = record . getLoggerName ( ) . substring ( java . lang . Math . max ( ( ( record . getLoggerName ( ) . lastIndexOf ( "." ) ) + 1 ) , 0 ) ) ; java . lang . Object thrown = ( ( record . getThrown ( ) ) != null ) ? record . getThrown ( ) : "" ; return org . jboss . errai . common . client . logging . util . StringFormat . format ( getSimpleFormatString ( customFormat ) , date , record . getLoggerName ( ) , name , record . getLevel ( ) . getName ( ) , record . getMessage ( ) , thrown ) ; } | org . junit . Assert . assertEquals ( iterations , callback . calls ) |
testFloat2 ( ) { java . lang . Float positiveFloat = 345.4F ; java . lang . Float convertedFloat = _converter . convertType ( ExpandoColumnConstants . FLOAT , positiveFloat . toString ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( positiveFloat , convertedFloat ) |
testGetParametersWithDefaultEntityAndDisabledSecurity ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . paper . type . PaperType entity = new org . lnu . is . domain . paper . type . PaperType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testGetDateStringByte_IncompleteMonthRoundUp ( ) { java . util . Date dateReceived = de . persosim . simulator . utils . Utils . getDate ( "1964XX29" , ( ( byte ) ( 1 ) ) ) ; java . util . Calendar calendar = java . util . Calendar . getInstance ( ) ; calendar . set ( Calendar . YEAR , 1964 ) ; calendar . set ( Calendar . MONTH , Calendar . DECEMBER ) ; calendar . set ( Calendar . DATE , 29 ) ; calendar . set ( Calendar . HOUR_OF_DAY , 0 ) ; calendar . set ( Calendar . MINUTE , 0 ) ; calendar . set ( Calendar . SECOND , 0 ) ; calendar . set ( Calendar . MILLISECOND , 0 ) ; java . util . Date dateExpected = calendar . getTime ( ) ; "<AssertPlaceHolder>" ; } set ( java . lang . String , java . lang . String ) { org . globaltester . base . PreferenceHelper . setPreferenceValue ( "de.persosim.simulator" , key , value ) ; org . globaltester . base . PreferenceHelper . flush ( "de.persosim.simulator" ) ; } | org . junit . Assert . assertEquals ( dateExpected , dateReceived ) |
testPrefixVerification ( java . lang . String , boolean ) { com . practicalunittesting . chp11 . refactoring . PhoneSearch ps = new com . practicalunittesting . chp11 . refactoring . PhoneSearch ( prefix ) ; "<AssertPlaceHolder>" ; } isValid ( ) { return valid ; } | org . junit . Assert . assertEquals ( expected , ps . isValid ( ) ) |
deleteTopicExpectSuccess ( ) { final net . jforum . entities . Topic topic = this . newTopic ( ) ; net . jforum . entities . Post post = new net . jforum . entities . Post ( ) ; post . setId ( 11 ) ; when ( repository . getLastPost ( topic . getForum ( ) ) ) . thenReturn ( post ) ; topic . getLastPost ( ) . getTopic ( ) . setId ( topic . getId ( ) ) ; event . deleted ( topic ) ; net . jforum . entities . Post expected = new net . jforum . entities . Post ( ) ; expected . setId ( 11 ) ; "<AssertPlaceHolder>" ; } getForum ( ) { return this . forum ; } | org . junit . Assert . assertEquals ( expected , topic . getForum ( ) . getLastPost ( ) ) |
testUnbalancedLeftBrace ( ) { try { x ( "" , "a+b(5,c(x,y)" ) ; org . junit . Assert . fail ( "Expected<sp>exception" ) ; } catch ( com . questdb . ex . ParserException e ) { "<AssertPlaceHolder>" ; } } getPosition ( ) { return com . questdb . parser . sql . QueryError . INSTANCE . tl . get ( ) . position ; } | org . junit . Assert . assertEquals ( 3 , com . questdb . parser . sql . QueryError . getPosition ( ) ) |
testOnErrorWhenFileAlreadyExists ( ) { final org . jboss . errai . bus . client . api . messaging . Message message = mock ( org . jboss . errai . bus . client . api . messaging . Message . class ) ; final java . lang . Throwable throwable = mock ( java . lang . Throwable . class ) ; doReturn ( "FileAlreadyExistsException" ) . when ( throwable ) . getMessage ( ) ; final boolean error = builder . addErrorCallback ( onError ) . onError ( ) . error ( message , throwable ) ; verify ( busyIndicatorView ) . hideBusyIndicator ( ) ; verify ( builder ) . handleDuplicatedFileName ( ) ; verify ( onError , never ( ) ) . execute ( ) ; verify ( builder , never ( ) ) . hideRenamePopup ( ) ; "<AssertPlaceHolder>" ; } hideRenamePopup ( ) { renamePopUpView ( ) . hide ( ) ; } | org . junit . Assert . assertFalse ( error ) |
testRedisMasterRoleCorrect ( ) { result = new java . util . function . Supplier < java . lang . String > ( ) { @ com . ctrip . xpipe . redis . console . healthcheck . actions . redismaster . Override public java . lang . String get ( ) { return com . ctrip . xpipe . redis . console . healthcheck . actions . redismaster . RedisMasterCheckActionTest . ROLE_MASTER ; } } ; instance . getRedisInstanceInfo ( ) . isMaster ( true ) ; action . doTask ( ) ; waitConditionUntilTimeOut ( ( ) -> ( server . getConnected ( ) ) == 1 , 200 ) ; waitConditionUntilTimeOut ( ( ) -> instance . getRedisInstanceInfo ( ) . isMaster ( ) , 50 ) ; "<AssertPlaceHolder>" ; verify ( redisService , never ( ) ) . updateBatchMaster ( anyList ( ) ) ; verify ( redisService , never ( ) ) . findRedisesByDcClusterShard ( anyString ( ) , anyString ( ) , anyString ( ) ) ; } getRedisInstanceInfo ( ) { return redisInstanceInfo ; } | org . junit . Assert . assertTrue ( instance . getRedisInstanceInfo ( ) . isMaster ( ) ) |
testLastFieldOptionalTrueWhenSet ( ) { final java . util . List < com . cronutils . model . field . definition . FieldDefinition > fields = new java . util . ArrayList ( ) ; fields . add ( mockFieldDefinition1 ) ; fields . add ( mockFieldDefinition2 ) ; fields . add ( mockFieldDefinition3optional ) ; final java . util . Set < com . cronutils . model . field . definition . FieldDefinition > fieldDefinitions = new com . cronutils . model . definition . CronDefinition ( fields , new java . util . HashSet ( ) , enforceStrictRange , matchDayOfWeekAndDayOfMonth ) . getFieldDefinitions ( ) ; final java . util . List < com . cronutils . model . field . definition . FieldDefinition > sortedFieldDefinitions = new java . util . ArrayList ( fieldDefinitions ) ; sortedFieldDefinitions . sort ( com . cronutils . model . field . definition . FieldDefinition . createFieldDefinitionComparator ( ) ) ; "<AssertPlaceHolder>" ; } isOptional ( ) { return optional ; } | org . junit . Assert . assertTrue ( sortedFieldDefinitions . get ( ( ( fields . size ( ) ) - 1 ) ) . isOptional ( ) ) |
testFindByRoleUserGroupAndObjectName ( ) { java . lang . String objectName1 = "alphaName1" ; java . lang . String roleUserGroup1 = "sigmaGroup1" ; java . lang . String objectName2 = "alphaName2" ; java . lang . String roleUserGroup2 = "sigmaGroup2" ; org . oscarehr . common . model . SecObjPrivilege secObjPrivilege1 = new org . oscarehr . common . model . SecObjPrivilege ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( secObjPrivilege1 ) ; org . oscarehr . common . model . SecObjPrivilegePrimaryKey secObjPrivilegePrimaryKey1 = new org . oscarehr . common . model . SecObjPrivilegePrimaryKey ( ) ; secObjPrivilegePrimaryKey1 . setObjectName ( objectName1 ) ; secObjPrivilegePrimaryKey1 . setRoleUserGroup ( roleUserGroup1 ) ; secObjPrivilege1 . setId ( secObjPrivilegePrimaryKey1 ) ; dao . persist ( secObjPrivilege1 ) ; org . oscarehr . common . model . SecObjPrivilege secObjPrivilege2 = new org . oscarehr . common . model . SecObjPrivilege ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( secObjPrivilege2 ) ; org . oscarehr . common . model . SecObjPrivilegePrimaryKey secObjPrivilegePrimaryKey2 = new org . oscarehr . common . model . SecObjPrivilegePrimaryKey ( ) ; secObjPrivilegePrimaryKey2 . setObjectName ( objectName2 ) ; secObjPrivilegePrimaryKey2 . setRoleUserGroup ( roleUserGroup2 ) ; secObjPrivilege2 . setId ( secObjPrivilegePrimaryKey2 ) ; dao . persist ( secObjPrivilege2 ) ; org . oscarehr . common . model . SecObjPrivilege secObjPrivilege3 = new org . oscarehr . common . model . SecObjPrivilege ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( secObjPrivilege3 ) ; org . oscarehr . common . model . SecObjPrivilegePrimaryKey secObjPrivilegePrimaryKey3 = new org . oscarehr . common . model . SecObjPrivilegePrimaryKey ( ) ; secObjPrivilegePrimaryKey3 . setObjectName ( objectName1 ) ; secObjPrivilegePrimaryKey3 . setRoleUserGroup ( roleUserGroup2 ) ; secObjPrivilege3 . setId ( secObjPrivilegePrimaryKey3 ) ; dao . persist ( secObjPrivilege3 ) ; org . oscarehr . common . model . SecObjPrivilege secObjPrivilege4 = new org . oscarehr . common . model . SecObjPrivilege ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( secObjPrivilege4 ) ; org . oscarehr . common . model . SecObjPrivilegePrimaryKey secObjPrivilegePrimaryKey4 = new org . oscarehr . common . model . SecObjPrivilegePrimaryKey ( ) ; secObjPrivilegePrimaryKey4 . setObjectName ( objectName2 ) ; secObjPrivilegePrimaryKey4 . setRoleUserGroup ( roleUserGroup1 ) ; secObjPrivilege4 . setId ( secObjPrivilegePrimaryKey4 ) ; dao . persist ( secObjPrivilege4 ) ; java . util . List < org . oscarehr . common . model . SecObjPrivilege > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . SecObjPrivilege > ( java . util . Arrays . asList ( secObjPrivilege1 ) ) ; java . util . List < org . oscarehr . common . model . SecObjPrivilege > result = dao . findByRoleUserGroupAndObjectName ( roleUserGroup1 , objectName1 ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } } | org . junit . Assert . assertTrue ( true ) |
testToDMNModelLiteralExpressionsEmptyValue ( ) { for ( int uiRowIndex = 0 ; uiRowIndex < ( uiModel . getRowCount ( ) ) ; uiRowIndex ++ ) { for ( int uiColumnIndex = 1 ; uiColumnIndex < ( uiModel . getColumnCount ( ) ) ; uiColumnIndex ++ ) { mapper . toDMNModel ( uiRowIndex , uiColumnIndex , cellValueSupplier ) ; final org . kie . workbench . common . dmn . api . definition . v1_1 . LiteralExpression le = ( ( org . kie . workbench . common . dmn . api . definition . v1_1 . LiteralExpression ) ( relation . getRow ( ) . get ( uiRowIndex ) . getExpression ( ) . get ( ( uiColumnIndex - ( RelationUIModelMapperHelper . ROW_INDEX_COLUMN_COUNT ) ) ) ) ) ; "<AssertPlaceHolder>" ; } } } getText ( ) { return text ; } | org . junit . Assert . assertEquals ( "" , le . getText ( ) . getValue ( ) ) |
testExecuteAction ( ) { org . pentaho . platform . plugin . action . openflashchart . OpenFlashChartComponent fcc = spy ( flashChartComponent ) ; doReturn ( resultSet ) . when ( fcc ) . getInputValue ( "chart-data" ) ; when ( resultSet . isScrollable ( ) ) . thenReturn ( false ) ; when ( resultSet . memoryCopy ( ) ) . thenReturn ( memoryResultSet ) ; doReturn ( "ofc_url" 0 ) . when ( fcc ) . getInputStringValue ( "width" ) ; doReturn ( "30" ) . when ( fcc ) . getInputStringValue ( "height" ) ; doReturn ( "http://localhost:8080/openflashchart" ) . when ( fcc ) . getInputStringValue ( "ofc_url" ) ; doReturn ( "open-flash-chart-full-embedded-font.swf" ) . when ( fcc ) . getInputStringValue ( "ofc_lib_name" ) ; doReturn ( null ) . when ( fcc ) . getInputStringValue ( "chart-attributes" ) ; doReturn ( componentDefinitionNode ) . when ( fcc ) . getComponentDefinition ( true ) ; when ( componentDefinitionNode . selectSingleNode ( "chart-attributes" ) ) . thenReturn ( chartAttributesNode ) ; doReturn ( "" ) . when ( fcc ) . generateChartJson ( memoryResultSet , chartAttributesNode , false ) ; boolean action = fcc . executeAction ( ) ; "<AssertPlaceHolder>" ; verify ( resultSet ) . close ( ) ; } executeAction ( ) { java . lang . String mimeType = getInputStringValue ( org . pentaho . platform . plugin . action . deprecated . ContentOutputComponent . COMPONENT_SETTING_MIME_TYPE ) ; java . lang . Object dataToOutput = getInputValue ( org . pentaho . platform . plugin . action . deprecated . ContentOutputComponent . INPUT_NAME_EXPECTED ) ; if ( dataToOutput != null ) { org . pentaho . platform . api . repository . IContentItem outputContentItem = getOutputContentItem ( org . pentaho . platform . plugin . action . deprecated . ContentOutputComponent . OUTPUT_NAME , mimeType ) ; if ( outputContentItem != null ) { outputContentItem . setMimeType ( mimeType ) ; java . io . OutputStream outputStream = null ; if ( dataToOutput instanceof java . lang . String ) { java . lang . String theOutput = ( ( java . lang . String ) ( dataToOutput ) ) ; if ( ( theOutput . length ( ) ) > 0 ) { try { outputStream = outputContentItem . getOutputStream ( getActionName ( ) ) ; outputStream . write ( theOutput . getBytes ( org . pentaho . platform . util . messages . LocaleHelper . getSystemEncoding ( ) ) ) ; outputStream . flush ( ) ; outputStream . close ( ) ; outputContentItem . closeOutputStream ( ) ; } catch ( java . lang . Exception e ) { error ( org . pentaho . platform . plugin . action . messages . Messages . getInstance ( ) . getErrorString ( "ContentOutputComponent.ERROR_0003_WRITING_OUTPUT" ) , e ) ; return false ; } trace ( theOutput ) ; return true ; } else { error ( org . pentaho . platform . plugin . action . messages . Messages . getInstance ( ) . getErrorString ( "ContentOutputComponent.ERROR_0002_EMPTY_OUTPUT" ) ) ; return false ; } } else if ( dataToOutput instanceof java . io . InputStream ) { java . io . InputStream is = ( ( java . io . InputStream ) ( dataToOutput ) ) ; byte [ ] buff = new byte [ 1024 ] ; int len ; outputStream = outputContentItem . getOutputStream ( null ) ; while ( ( len = is . read ( buff ) ) >= 0 ) { outputStream . write ( buff , 0 , len ) ; } outputStream . flush ( ) ; outputStream . close ( ) ; outputContentItem . closeOutputStream ( ) ; return true ; } else if ( dataToOutput instanceof java . io . ByteArrayOutputStream ) { java . io . ByteArrayOutputStream baos = ( ( java . io . ByteArrayOutputStream ) ( dataToOutput ) ) ; outputStream = outputContentItem . getOutputStream ( null ) ; outputStream . write ( baos . toByteArray ( ) ) ; outputStream . flush ( ) ; outputStream . close ( ) ; outputContentItem . closeOutputStream ( ) ; return true ; } else { error ( org . pentaho . platform . plugin . action . messages . Messages . getInstance ( ) . getErrorString ( "ContentOutputComponent.ERROR_0007_UNKNOWN_TYPE" , dataToOutput . getClass ( ) . getName ( ) ) ) ; return false ; } } else { error ( org . pentaho . platform . plugin . action . messages . Messages . getInstance ( ) . getErrorString ( "ContentOutputComponent.ERROR_0005_OUTPUT_CONTENT_ITEM" ) ) ; return false ; } } error ( org . pentaho . platform . plugin . action . messages . Messages . getInstance ( ) . getErrorString ( "ContentOutputComponent.ERROR_0004_CONTENTOUTPUT_NULL" ) ) ; return false ; } | org . junit . Assert . assertTrue ( action ) |
getModelInGtx ( ) { org . slim3 . datastore . model . Hoge hoge = new org . slim3 . datastore . model . Hoge ( ) ; org . slim3 . datastore . Datastore . putWithoutTx ( hoge ) ; org . slim3 . datastore . GlobalTransaction gtx = org . slim3 . datastore . Datastore . beginGlobalTransaction ( ) ; org . slim3 . datastore . model . Hoge hoge2 = new org . slim3 . datastore . model . Hoge ( ) ; gtx . put ( hoge2 ) ; ref . setKey ( hoge . getKey ( ) ) ; "<AssertPlaceHolder>" ; } getModel ( ) { org . junit . Assert . assertThat ( ref . getModel ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . nullValue ( ) ) ) ; org . slim3 . datastore . model . Hoge hoge = new org . slim3 . datastore . model . Hoge ( ) ; org . slim3 . datastore . Datastore . put ( hoge ) ; ref . setKey ( hoge . getKey ( ) ) ; org . slim3 . datastore . model . Hoge hoge2 = ref . getModel ( ) ; org . junit . Assert . assertThat ( hoge2 , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . notNullValue ( ) ) ) ; org . junit . Assert . assertThat ( hoge2 , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . sameInstance ( ref . getModel ( ) ) ) ) ; } | org . junit . Assert . assertThat ( ref . getModel ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . notNullValue ( ) ) ) |
shouldNotBeInstalledUsingExternalContext ( ) { javax . faces . context . ExternalContext externalContext = mock ( javax . faces . context . ExternalContext . class ) ; "<AssertPlaceHolder>" ; } isInstalled ( javax . servlet . ServletContext ) { org . springframework . util . Assert . notNull ( servletContext , "ServletContext<sp>must<sp>not<sp>be<sp>null" ) ; return org . springframework . springfaces . SpringFacesIntegration . isInstalled ( servletContext . getAttribute ( org . springframework . springfaces . SpringFacesIntegration . ATTRIBUTE ) ) ; } | org . junit . Assert . assertThat ( org . springframework . springfaces . SpringFacesIntegration . isInstalled ( externalContext ) , org . hamcrest . CoreMatchers . is ( false ) ) |
test2PCSendRollback ( ) { javax . jms . XAConnection conn = null ; javax . jms . Connection conn2 = null ; try { conn = xacf . createXAConnection ( ) ; tm . begin ( ) ; javax . jms . XASession sess = conn . createXASession ( ) ; javax . transaction . xa . XAResource res = sess . getXAResource ( ) ; javax . transaction . xa . XAResource res2 = new org . apache . activemq . artemis . tests . extras . jms . xa . XATest . DummyXAResource ( ) ; javax . transaction . Transaction tx = tm . getTransaction ( ) ; tx . enlistResource ( res ) ; tx . enlistResource ( res2 ) ; javax . jms . MessageProducer prod = sess . createProducer ( null ) ; prod . setDeliveryMode ( DeliveryMode . NON_PERSISTENT ) ; javax . jms . Message m = sess . createTextMessage ( "XATest1" ) ; prod . send ( queue1 , m ) ; m = sess . createTextMessage ( "XATest2" ) ; prod . send ( queue1 , m ) ; tx . delistResource ( res , XAResource . TMSUCCESS ) ; tx . delistResource ( res2 , XAResource . TMSUCCESS ) ; tm . rollback ( ) ; conn2 = cf . createConnection ( ) ; conn2 . start ( ) ; javax . jms . Session sessReceiver = conn2 . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; javax . jms . MessageConsumer cons = sessReceiver . createConsumer ( queue1 ) ; javax . jms . Message m2 = cons . receive ( 100 ) ; "<AssertPlaceHolder>" ; } finally { if ( conn != null ) { conn . close ( ) ; } if ( conn2 != null ) { conn2 . close ( ) ; } } } receive ( long ) { session . lock ( ) ; try { if ( ActiveMQRALogger . LOGGER . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ( ( ( "receive<sp>" + ( this ) ) + "<sp>timeout=" ) + timeout ) ) ; } checkState ( ) ; javax . jms . Message message = consumer . receive ( timeout ) ; if ( ActiveMQRALogger . LOGGER . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ( ( ( "received<sp>" + ( this ) ) + "<sp>result=" ) + message ) ) ; } if ( message == null ) { return null ; } else { return wrapMessage ( message ) ; } } finally { session . unlock ( ) ; } } | org . junit . Assert . assertNull ( m2 ) |
testRegionEquals ( ) { final com . amazonaws . regions . Region usWest2 = com . amazonaws . regions . RegionUtils . getRegion ( "us-west-2" ) ; final com . amazonaws . regions . Region other = com . amazonaws . regions . RegionUtils . getRegionByEndpoint ( "s3.us-west-2.amazonaws.com" ) ; "<AssertPlaceHolder>" ; } getRegionByEndpoint ( java . lang . String ) { java . net . URI targetEndpointUri = com . amazonaws . regions . RegionUtils . getUriByEndpoint ( endpoint ) ; java . lang . String targetHost = targetEndpointUri . getHost ( ) ; for ( com . amazonaws . regions . Region region : com . amazonaws . regions . RegionUtils . getRegions ( ) ) { for ( java . lang . String serviceEndpoint : region . getServiceEndpoints ( ) . values ( ) ) { java . net . URI serviceEndpointUrl = com . amazonaws . regions . RegionUtils . getUriByEndpoint ( serviceEndpoint ) ; if ( serviceEndpointUrl . getHost ( ) . equals ( targetHost ) ) return region ; } } throw new java . lang . IllegalArgumentException ( ( "No<sp>region<sp>found<sp>with<sp>any<sp>service<sp>for<sp>endpoint<sp>" + endpoint ) ) ; } | org . junit . Assert . assertEquals ( usWest2 , other ) |
testOneOne ( ) { java . lang . String numA = "1" ; java . lang . String numB = "1" ; java . lang . String res = "0" ; java . math . BigInteger aNumber = new java . math . BigInteger ( numA ) ; java . math . BigInteger bNumber = new java . math . BigInteger ( numB ) ; java . math . BigInteger result = aNumber . xor ( bNumber ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( object instanceof org . teavm . classlib . java . text . TParsePosition ) ) { return false ; } org . teavm . classlib . java . text . TParsePosition pos = ( ( org . teavm . classlib . java . text . TParsePosition ) ( object ) ) ; return ( ( currentPosition ) == ( pos . currentPosition ) ) && ( ( errorIndex ) == ( pos . errorIndex ) ) ; } | org . junit . Assert . assertTrue ( res . equals ( result . toString ( ) ) ) |
testBug47371long ( ) { "<AssertPlaceHolder>" ; } add ( java . lang . Object , java . lang . Object ) { if ( ( obj0 == null ) && ( obj1 == null ) ) { return java . lang . Long . valueOf ( 0 ) ; } final org . apache . el . lang . ELArithmetic delegate ; if ( org . apache . el . lang . ELArithmetic . BIGDECIMAL . matches ( obj0 , obj1 ) ) delegate = org . apache . el . lang . ELArithmetic . BIGDECIMAL ; else if ( org . apache . el . lang . ELArithmetic . DOUBLE . matches ( obj0 , obj1 ) ) { if ( org . apache . el . lang . ELArithmetic . BIGINTEGER . matches ( obj0 , obj1 ) ) delegate = org . apache . el . lang . ELArithmetic . BIGDECIMAL ; else delegate = org . apache . el . lang . ELArithmetic . DOUBLE ; } else if ( org . apache . el . lang . ELArithmetic . BIGINTEGER . matches ( obj0 , obj1 ) ) delegate = org . apache . el . lang . ELArithmetic . BIGINTEGER ; else delegate = org . apache . el . lang . ELArithmetic . LONG ; java . lang . Number num0 = delegate . coerce ( obj0 ) ; java . lang . Number num1 = delegate . coerce ( obj1 ) ; return delegate . add ( num0 , num1 ) ; } | org . junit . Assert . assertEquals ( java . lang . Long . valueOf ( 1 ) , org . apache . el . lang . ELArithmetic . add ( "" , java . lang . Integer . valueOf ( 1 ) ) ) |
shouldReturnFalseForInvalidMatch ( ) { int every = 2 ; monthlyEvent = new org . mifos . accounts . savings . interest . schedule . internal . MonthlyOnLastDayOfMonthInterestScheduledEvent ( every ) ; boolean isMatch = monthlyEvent . isAMatchingDate ( jan1st , jan31st ) ; "<AssertPlaceHolder>" ; } isAMatchingDate ( org . joda . time . LocalDate , org . joda . time . LocalDate ) { java . util . List < org . joda . time . LocalDate > allMatchingDates = findAllMatchingDatesFromBaseDateUpToAndIncludingNearestMatchingEndDate ( baseDate , date ) ; return allMatchingDates . contains ( date ) ; } | org . junit . Assert . assertFalse ( isMatch ) |
testDoNotWriteDuringDecorateLogger ( ) { org . jenkinsci . plugins . envinject . FreeStyleProject project = jenkins . createFreeStyleProject ( ) ; org . jenkinsci . plugins . envinject . FreeStyleBuild build = new org . jenkinsci . plugins . envinject . FreeStyleBuild ( project ) ; org . jenkinsci . plugins . envinject . EnvInjectPasswordWrapper passwordWrapper = new org . jenkinsci . plugins . envinject . EnvInjectPasswordWrapper ( ) ; passwordWrapper . setInjectGlobalPasswords ( true ) ; passwordWrapper . setMaskPasswordParameters ( true ) ; java . io . ByteArrayOutputStream outputStream = new java . io . ByteArrayOutputStream ( ) ; passwordWrapper . decorateLogger ( build , outputStream ) ; "<AssertPlaceHolder>" ; } decorateLogger ( hudson . model . AbstractBuild , java . io . OutputStream ) { return super . decorateLogger ( build , logger ) ; } | org . junit . Assert . assertThat ( outputStream . toByteArray ( ) , org . hamcrest . Matchers . is ( new byte [ 0 ] ) ) |
testMethodAnnotationPlain ( ) { "<AssertPlaceHolder>" ; } monitoringLocationsExists ( ) { final java . sql . Connection connection = getDataSource ( ) . getConnection ( ) ; boolean exists = false ; try { connection . prepareStatement ( "SELECT<sp>id<sp>FROM<sp>monitoringlocations" ) . execute ( ) ; exists = true ; } catch ( java . sql . SQLException e ) { } finally { connection . close ( ) ; } return exists ; } | org . junit . Assert . assertTrue ( monitoringLocationsExists ( ) ) |
testPlainTextSizeGreaterThanBlockSize ( ) { javax . security . auth . kerberos . KerberosKey key = new javax . security . auth . kerberos . KerberosKey ( new javax . security . auth . kerberos . KerberosPrincipal ( "hnelson@EXAMPLE.COM" ) , org . apache . directory . server . kerberos . shared . crypto . encryption . DesCbcCrcEncryptionTest . PASSWORD , "DES" ) ; byte [ ] keyBytes = key . getEncoded ( ) ; org . apache . directory . shared . kerberos . components . EncryptionKey encryptionKey = new org . apache . directory . shared . kerberos . components . EncryptionKey ( org . apache . directory . shared . kerberos . codec . types . EncryptionType . DES_CBC_CRC , keyBytes ) ; byte [ ] plainText = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ; org . apache . directory . server . kerberos . shared . crypto . encryption . DesCbcCrcEncryption encryption = new org . apache . directory . server . kerberos . shared . crypto . encryption . DesCbcCrcEncryption ( ) ; org . apache . directory . shared . kerberos . components . EncryptedData encryptedData = encryption . getEncryptedData ( encryptionKey , plainText , null ) ; byte [ ] recoveredText = encryption . getDecryptedData ( encryptionKey , encryptedData , null ) ; "<AssertPlaceHolder>" ; } beginsWith ( byte [ ] , byte [ ] ) { for ( int i = 0 ; i < ( plainText . length ) ; i ++ ) { if ( ( plainText [ i ] ) != ( recoveredText [ i ] ) ) { return false ; } } return true ; } | org . junit . Assert . assertTrue ( beginsWith ( plainText , recoveredText ) ) |
testGetGroupsToUpper ( ) { org . apache . hadoop . security . RuleBasedLdapGroupsMapping groupsMapping = org . mockito . Mockito . spy ( new org . apache . hadoop . security . RuleBasedLdapGroupsMapping ( ) ) ; java . util . List < java . lang . String > groups = new java . util . ArrayList ( ) ; groups . add ( "group1" ) ; groups . add ( "group2" ) ; org . mockito . Mockito . doReturn ( groups ) . when ( ( ( org . apache . hadoop . security . LdapGroupsMapping ) ( groupsMapping ) ) ) . doGetGroups ( eq ( "admin" ) , anyInt ( ) ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; conf . set ( LdapGroupsMapping . LDAP_URL_KEY , "ldap://test" ) ; conf . set ( org . apache . hadoop . security . RuleBasedLdapGroupsMapping . CONVERSION_RULE_KEY , "to_upper" ) ; groupsMapping . setConf ( conf ) ; java . util . List < java . lang . String > groupsUpper = new java . util . ArrayList ( ) ; groupsUpper . add ( "GROUP1" ) ; groupsUpper . add ( "GROUP2" ) ; "<AssertPlaceHolder>" ; } getGroups ( org . apache . hadoop . ozone . web . handlers . UserArgs ) { return null ; } | org . junit . Assert . assertEquals ( groupsUpper , groupsMapping . getGroups ( "admin" ) ) |
getTotalNumberOfPetsUsingStreams ( ) { int numberOfPetsStream = this . people . stream ( ) . mapToInt ( com . gs . collections . impl . PersonAndPetKataTest . Person :: getNumberOfPets ) . sum ( ) ; "<AssertPlaceHolder>" ; } sum ( ) { org . junit . Assert . assertEquals ( 10L , com . gs . collections . impl . list . primitive . IntInterval . oneTo ( 4 ) . sum ( ) ) ; } | org . junit . Assert . assertEquals ( 9 , numberOfPetsStream ) |
non_interface_iterable_type_returns_no_specimen ( ) { java . lang . Object result = this . iterableBuilder . create ( java . util . Stack . class , null ) ; "<AssertPlaceHolder>" ; } create ( java . lang . Object , com . flextrade . jfixture . SpecimenContext ) { if ( ! ( request instanceof com . flextrade . jfixture . utility . SpecimenType ) ) { return new com . flextrade . jfixture . NoSpecimen ( ) ; } com . flextrade . jfixture . utility . SpecimenType type = ( ( com . flextrade . jfixture . utility . SpecimenType ) ( request ) ) ; if ( ! ( org . joda . time . base . BaseDateTime . class . isAssignableFrom ( type . getRawType ( ) ) ) ) { return new com . flextrade . jfixture . NoSpecimen ( ) ; } try { java . util . Date date = ( ( java . util . Date ) ( context . resolve ( java . util . Date . class ) ) ) ; long instant = date . getTime ( ) ; org . joda . time . DateTimeZone timeZone = ( ( org . joda . time . DateTimeZone ) ( context . resolve ( org . joda . time . DateTimeZone . class ) ) ) ; return type . getRawType ( ) . getDeclaredConstructor ( long . class , org . joda . time . DateTimeZone . class ) . newInstance ( instant , timeZone ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; return new com . flextrade . jfixture . NoSpecimen ( ) ; } } | org . junit . Assert . assertEquals ( new com . flextrade . jfixture . NoSpecimen ( ) , result ) |
testTimeOutWithHostNull ( ) { org . apache . ambari . server . actionmanager . Stage s = getStageWithServerAction ( 1 , 977 , null , "test" , 2 , false , false ) ; s . setHostRoleStatus ( null , Role . AMBARI_SERVER_ACTION . toString ( ) , HostRoleStatus . IN_PROGRESS ) ; org . apache . ambari . server . actionmanager . ActionScheduler scheduler = org . easymock . EasyMock . createMockBuilder ( org . apache . ambari . server . actionmanager . ActionScheduler . class ) . withConstructor ( long . class , long . class , org . apache . ambari . server . actionmanager . ActionDBAccessor . class , org . apache . ambari . server . state . Clusters . class , int . class , org . apache . ambari . server . controller . HostsMap . class , com . google . inject . persist . UnitOfWork . class , org . apache . ambari . server . events . publishers . AmbariEventPublisher . class , org . apache . ambari . server . configuration . Configuration . class , com . google . inject . Provider . class , org . apache . ambari . server . orm . dao . HostRoleCommandDAO . class , org . apache . ambari . server . actionmanager . HostRoleCommandFactory . class , org . apache . ambari . server . events . publishers . AgentCommandsPublisher . class ) . withArgs ( 100L , 50L , null , null , ( - 1 ) , null , null , null , null , entityManagerProviderMock , mock ( org . apache . ambari . server . orm . dao . HostRoleCommandDAO . class ) , mock ( org . apache . ambari . server . actionmanager . HostRoleCommandFactory . class ) , mock ( org . apache . ambari . server . events . publishers . AgentCommandsPublisher . class ) ) . createNiceMock ( ) ; org . easymock . EasyMock . replay ( scheduler ) ; "<AssertPlaceHolder>" ; org . easymock . EasyMock . verify ( scheduler ) ; } timeOutActionNeeded ( org . apache . ambari . server . actionmanager . HostRoleStatus , org . apache . ambari . server . actionmanager . Stage , org . apache . ambari . server . state . Host , java . lang . String , long , long ) { if ( ( ! ( status . equals ( HostRoleStatus . QUEUED ) ) ) && ( ! ( status . equals ( HostRoleStatus . IN_PROGRESS ) ) ) ) { return false ; } java . lang . String hostName = ( null == host ) ? null : host . getHostName ( ) ; if ( ( hasCommandInProgress ( stage , hostName ) ) && ( ! ( status . equals ( HostRoleStatus . IN_PROGRESS ) ) ) ) { return false ; } if ( currentTime >= ( ( stage . getLastAttemptTime ( hostName , role ) ) + taskTimeout ) ) { return true ; } return false ; } | org . junit . Assert . assertEquals ( false , scheduler . timeOutActionNeeded ( HostRoleStatus . IN_PROGRESS , s , null , Role . AMBARI_SERVER_ACTION . toString ( ) , ( - 1L ) , 1L ) ) |
testHasEffect ( ) { "<AssertPlaceHolder>" ; } hasEffect ( ) { return ( rational . getNumerator ( ) ) != ( rational . getDenominator ( ) ) ; } | org . junit . Assert . assertTrue ( instance . hasEffect ( ) ) |
longstream_generate ( ) { java . util . OptionalLong one = java . util . stream . LongStream . generate ( ( ) -> 1 ) . limit ( 10 ) . distinct ( ) . findFirst ( ) ; "<AssertPlaceHolder>" ; } getAsLong ( ) { return 10 ; } | org . junit . Assert . assertEquals ( 1 , one . getAsLong ( ) , 0 ) |
testNewPacket ( ) { try { org . pcap4j . packet . IcmpV6RouterSolicitationPacket p = org . pcap4j . packet . IcmpV6RouterSolicitationPacket . newPacket ( packet . getRawData ( ) , 0 , packet . getRawData ( ) . length ) ; "<AssertPlaceHolder>" ; } catch ( org . pcap4j . packet . IllegalRawDataException e ) { throw new java . lang . AssertionError ( e ) ; } } getRawData ( ) { byte [ ] rawData = new byte [ length ( ) ] ; rawData [ 0 ] = getType ( ) . value ( ) ; rawData [ 1 ] = length ; rawData [ 2 ] = pointer ; rawData [ 3 ] = flag . value ( ) ; rawData [ 3 ] = ( ( byte ) ( ( rawData [ 3 ] ) | ( ( overflow ) << 4 ) ) ) ; if ( ( data ) != null ) { java . lang . System . arraycopy ( data . getRawData ( ) , 0 , rawData , 4 , data . length ( ) ) ; } return rawData ; } | org . junit . Assert . assertEquals ( packet , p ) |
defaultValue ( ) { factory = new com . alibaba . citrus . springext . support . context . XmlApplicationContext ( new org . springframework . core . io . FileSystemResource ( new java . io . File ( srcdir , "property-placeholder.xml" ) ) ) ; conf = ( ( com . alibaba . citrus . service . configuration . Configuration ) ( factory . getBean ( "simpleConfiguration" ) ) ) ; "<AssertPlaceHolder>" ; } isProductionMode ( ) { return getProperty ( "productionMode" , Boolean . TRUE ) ; } | org . junit . Assert . assertEquals ( false , conf . isProductionMode ( ) ) |
testAddToAll ( ) { float [ ] da = new float [ ] { 1 , 2 , 0 , - 1 , - 3 } ; float [ ] expected = new float [ ] { 2 , 3 , 1 , 0 , - 2 } ; zemberek . core . math . FloatArrays . addToAll ( da , 1 ) ; "<AssertPlaceHolder>" ; } addToAll ( float [ ] , float ) { zemberek . core . math . FloatArrays . validateArray ( data ) ; for ( int i = 0 ; i < ( data . length ) ; i ++ ) { data [ i ] += valueToAdd ; } } | org . junit . Assert . assertTrue ( java . util . Arrays . equals ( expected , da ) ) |
testContainsMappeableRunContainer_ExcludeShiftedSet ( ) { org . roaringbitmap . buffer . MappeableContainer rc = new org . roaringbitmap . buffer . MappeableRunContainer ( ) . add ( 0 , 10 ) ; org . roaringbitmap . buffer . MappeableContainer subset = new org . roaringbitmap . buffer . MappeableRunContainer ( ) . add ( 2 , 12 ) ; "<AssertPlaceHolder>" ; } contains ( int ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented<sp>in<sp>ImmutableConciseSet" ) ; } | org . junit . Assert . assertFalse ( rc . contains ( subset ) ) |
testQueryGatewayCorrectlyReturnsOnSubscriptionQuery ( ) { org . axonframework . queryhandling . QueryGateway queryGateway = org . axonframework . queryhandling . DefaultQueryGateway . builder ( ) . queryBus ( queryBus ) . build ( ) ; java . lang . String result = queryGateway . subscriptionQuery ( new org . axonframework . queryhandling . SubscriptionQueryTest . SomeQuery ( org . axonframework . queryhandling . SubscriptionQueryTest . FOUND ) , java . lang . String . class , java . lang . String . class ) . initialResult ( ) . toFuture ( ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { if ( ( metaData ) == null ) { this . metaData = grpcMetaDataConverter . convert ( metaDataValues ) ; } return metaData ; } | org . junit . Assert . assertEquals ( org . axonframework . queryhandling . SubscriptionQueryTest . FOUND , result ) |
testRunSerializationDeserialization ( ) { final int [ ] data = org . roaringbitmap . TestSerialization . takeSortedAndDistinct ( new java . util . Random ( 4060 ) , 100000 ) ; org . roaringbitmap . RoaringBitmap bitmap_a = org . roaringbitmap . RoaringBitmap . bitmapOf ( data ) ; org . roaringbitmap . RoaringBitmap bitmap_ar = org . roaringbitmap . RoaringBitmap . bitmapOf ( data ) ; for ( int k = 100000 ; k < 200000 ; ++ k ) { bitmap_a . add ( ( 3 * k ) ) ; bitmap_ar . add ( ( 3 * k ) ) ; } for ( int k = 700000 ; k < 800000 ; ++ k ) { bitmap_a . add ( k ) ; bitmap_ar . add ( k ) ; } bitmap_a . runOptimize ( ) ; java . nio . ByteBuffer outbuf = java . nio . ByteBuffer . allocate ( bitmap_a . serializedSizeInBytes ( ) ) ; org . roaringbitmap . ByteBufferBackedOutputStream out = new org . roaringbitmap . ByteBufferBackedOutputStream ( outbuf ) ; try { bitmap_a . serialize ( new java . io . DataOutputStream ( out ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } outbuf . flip ( ) ; org . roaringbitmap . RoaringBitmap bitmap_c = new org . roaringbitmap . RoaringBitmap ( ) ; org . roaringbitmap . ByteBufferBackedInputStream in = new org . roaringbitmap . ByteBufferBackedInputStream ( outbuf ) ; bitmap_c . deserialize ( new java . io . DataInputStream ( in ) ) ; "<AssertPlaceHolder>" ; } deserialize ( java . lang . String ) { final java . io . DataInputStream dos = new java . io . DataInputStream ( new java . util . zip . GZIPInputStream ( this . getClass ( ) . getResourceAsStream ( bitsetResource ) ) ) ; try { final long [ ] [ ] bitset = new long [ dos . readInt ( ) ] [ ] ; for ( int i = 0 ; i < ( bitset . length ) ; i ++ ) { final int wordSize = dos . readInt ( ) ; final int clone = 0 ; final long [ ] words = new long [ wordSize * ( clone + 1 ) ] ; for ( int j = 0 ; j < wordSize ; j ++ ) { words [ j ] = dos . readLong ( ) ; } for ( int j = 0 ; j < clone ; j ++ ) { java . lang . System . arraycopy ( words , 0 , words , ( ( j + 1 ) * wordSize ) , wordSize ) ; } bitset [ i ] = words ; } return bitset ; } finally { if ( dos != null ) { dos . close ( ) ; } } } | org . junit . Assert . assertEquals ( bitmap_a , bitmap_c ) |
canCommitTestWithUnknownException ( ) { doThrow ( new java . lang . UnsupportedOperationException ( "testException" ) ) . when ( org . opendaylight . mdsal . dom . store . inmemory . InMemoryDOMStoreThreePhaseCommitCohortTest . IN_MEMORY_DOM_DATA_STORE ) . validate ( any ( ) ) ; try { org . opendaylight . mdsal . dom . store . inmemory . InMemoryDOMStoreThreePhaseCommitCohortTest . inMemoryDOMStoreThreePhaseCommitCohort . canCommit ( ) . get ( ) ; org . junit . Assert . fail ( "Expected<sp>exception" ) ; } catch ( java . util . concurrent . ExecutionException e ) { "<AssertPlaceHolder>" ; throw e . getCause ( ) ; } } get ( ) { return generator . generate ( type ) ; } | org . junit . Assert . assertTrue ( ( ( e . getCause ( ) ) instanceof java . lang . UnsupportedOperationException ) ) |
testArrays ( ) { ff4j . setAuthorizationsManager ( new org . ff4j . security . AuthorizationsManager ( ) { public java . lang . String toJson ( ) { return "dummy" ; } public java . util . Set < java . lang . String > listAllPermissions ( ) { return new java . util . HashSet ( ) ; } public java . util . Set < java . lang . String > getCurrentUserPermissions ( ) { return new java . util . HashSet ( ) ; } public java . lang . String getCurrentUserName ( ) { return "dummy" ; } } ) ; java . util . Map < java . lang . String , org . ff4j . audit . Event > events = new java . util . HashMap ( ) ; events . put ( "e1" , new org . ff4j . audit . EventBuilder ( ff4j ) . name ( "f1" ) . build ( ) ) ; events . put ( "e2" , new org . ff4j . audit . EventBuilder ( ff4j ) . name ( "f2" ) . build ( ) ) ; int idx = 0 ; org . ff4j . audit . Event [ ] e = new org . ff4j . audit . Event [ events . size ( ) ] ; for ( java . lang . String event : events . keySet ( ) ) { e [ idx ] = events . get ( event ) ; idx ++ ; } java . lang . String eventsArrayAsJson = org . ff4j . utils . json . EventJsonParser . eventArrayToJson ( e ) ; org . ff4j . audit . Event [ ] ee = org . ff4j . utils . json . EventJsonParser . parseEventArray ( eventsArrayAsJson ) ; "<AssertPlaceHolder>" ; } size ( ) { return value ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( events . size ( ) , ee . length ) |
testEqualBytesWithSecondStoreBeingLonger ( ) { net . openhft . chronicle . bytes . BytesStore store1 = alloc1 . elasticBytes ( 64 ) . append ( "TW-TRSY-20181217-NY572677_3256N1" ) ; net . openhft . chronicle . bytes . BytesStore store2 = alloc1 . elasticBytes ( 64 ) . append ( "TW-TRSY-20181217-NY572677_3256N15" ) ; "<AssertPlaceHolder>" ; store1 . release ( ) ; store2 . release ( ) ; } equalBytes ( net . openhft . chronicle . bytes . BytesStore , long ) { return length == 0 ; } | org . junit . Assert . assertThat ( store1 . equalBytes ( store2 , store2 . length ( ) ) , org . hamcrest . CoreMatchers . is ( false ) ) |
limit1Test ( ) { when ( transformerConfig . getProperty ( "property.name" ) ) . thenReturn ( "3" ) ; log . debug ( "one" ) ; log . debug ( "two" ) ; log . debug ( "three" ) ; "<AssertPlaceHolder>" ; } getEntries ( org . alfresco . service . cmr . repository . NodeRef ) { return org . alfresco . repo . download . DownloadServiceIntegrationTest . TRANSACTION_HELPER . doInTransaction ( new org . alfresco . repo . transaction . RetryingTransactionHelper . RetryingTransactionCallback < java . util . Set < java . lang . String > > ( ) { @ org . alfresco . repo . download . Override public java . util . Set < java . lang . String > execute ( ) throws java . lang . Throwable { java . util . Set < java . lang . String > entryNames = new java . util . TreeSet < java . lang . String > ( ) ; org . alfresco . service . cmr . repository . ContentReader reader = org . alfresco . repo . download . DownloadServiceIntegrationTest . CONTENT_SERVICE . getReader ( downloadNode , ContentModel . PROP_CONTENT ) ; org . apache . commons . compress . archivers . zip . ZipArchiveInputStream zipInputStream = new org . apache . commons . compress . archivers . zip . ZipArchiveInputStream ( reader . getContentInputStream ( ) ) ; try { org . apache . commons . compress . archivers . zip . ZipArchiveEntry zipEntry = zipInputStream . getNextZipEntry ( ) ; while ( zipEntry != null ) { java . lang . String name = zipEntry . getName ( ) ; entryNames . add ( name ) ; zipEntry = zipInputStream . getNextZipEntry ( ) ; } } finally { zipInputStream . close ( ) ; } return entryNames ; } } ) ; } | org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "three" } , log . getEntries ( 1 ) ) |
testGetConfigurationSetting_ForNonNullContext ( ) { final org . oscm . domobjects . ConfigurationSetting initSetting = new org . oscm . domobjects . ConfigurationSetting ( org . oscm . internal . types . enumtypes . ConfigurationKey . BASE_URL , "context2" , "anotherValue" ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . configurationservice . bean . Override public org . oscm . configurationservice . bean . Void call ( ) throws org . oscm . configurationservice . bean . Exception { confSvcLocal . setConfigurationSetting ( initSetting ) ; return null ; } } ) ; org . oscm . internal . vo . VOConfigurationSetting setting = confSvc . getVOConfigurationSetting ( ConfigurationKey . BASE_URL , "context2" ) ; "<AssertPlaceHolder>" ; } getVOConfigurationSetting ( org . oscm . internal . types . enumtypes . ConfigurationKey , java . lang . String ) { org . oscm . domobjects . ConfigurationSetting setting = getConfigurationSetting ( informationId , contextId ) ; return org . oscm . configurationservice . assembler . ConfigurationSettingAssembler . toValueObject ( setting ) ; } | org . junit . Assert . assertNotNull ( setting ) |
testNegativeInteger ( ) { com . mictale . jsonite . JsonNumber n = com . mictale . jsonite . JsonNumber . of ( ( - 345543 ) ) . asNumber ( ) ; "<AssertPlaceHolder>" ; } intValue ( ) { return intValue ; } | org . junit . Assert . assertEquals ( ( - 345543 ) , n . intValue ( ) ) |
testAvailablePoolsDoesNotIncludeUeberPool ( ) { org . candlepin . model . Owner owner = this . createOwner ( ) ; org . candlepin . model . Product product = this . createProduct ( owner ) ; org . candlepin . model . Consumer consumer = this . createMockConsumer ( owner , false ) ; consumer . setFact ( "cpu_cores" , "4" ) ; consumer = consumerCurator . merge ( consumer ) ; org . candlepin . model . Pool pool = createPool ( owner , product , 100L , org . candlepin . test . TestUtil . createDate ( 2000 , 3 , 2 ) , org . candlepin . test . TestUtil . createDate ( 2005 , 3 , 2 ) ) ; poolCurator . create ( pool ) ; ueberCertGenerator . generate ( owner . getKey ( ) , new org . candlepin . auth . NoAuthPrincipal ( ) ) ; java . util . List < org . candlepin . model . Pool > results = poolCurator . listAvailableEntitlementPools ( consumer , consumer . getOwnerId ( ) , ( ( java . util . Collection < java . lang . String > ) ( null ) ) , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return virtUuidToConsumerMap . keySet ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , results . size ( ) ) |
test02 ( ) { com . itextpdf . kernel . pdf . PdfDocument pdfDocument = new com . itextpdf . kernel . pdf . PdfDocument ( new com . itextpdf . kernel . pdf . PdfReader ( ( ( com . itextpdf . kernel . pdf . canvas . parser . SimpleFontToUnicodeExtractionTest . sourceFolder ) + "simpleFontToUnicode02.pdf" ) ) ) ; java . lang . String expected = "ffaast" ; java . lang . String actualText = com . itextpdf . kernel . pdf . canvas . parser . PdfTextExtractor . getTextFromPage ( pdfDocument . getPage ( 1 ) , new com . itextpdf . kernel . pdf . canvas . parser . listener . LocationTextExtractionStrategy ( ) ) ; "<AssertPlaceHolder>" ; } getPage ( com . itextpdf . kernel . pdf . PdfDictionary ) { int pageNum = getPageNumber ( pageDictionary ) ; if ( pageNum > 0 ) { return getPage ( pageNum ) ; } return null ; } | org . junit . Assert . assertEquals ( expected , actualText ) |
shouldReturnPropertyValueAsBlankStringGivenAnnotationAttributesDoesNotContainProperty ( ) { java . util . Map < java . lang . String , java . lang . Object > attributes = new java . util . HashMap ( ) ; org . flips . model . FlipAnnotationAttributes annotationAttributes = new org . flips . model . FlipAnnotationAttributes . Builder ( ) . addAll ( attributes ) . build ( ) ; java . lang . String propertyValue = annotationAttributes . getAttributeValue ( "cutoffDateTimeProperty" , "" ) ; "<AssertPlaceHolder>" ; } getAttributeValue ( java . lang . String , T ) { return ( ( T ) ( getAttributeValue ( attributeName ) . orElse ( defaultValue ) ) ) ; } | org . junit . Assert . assertEquals ( "" , propertyValue ) |
shouldFailFindOrCreateNodeSessionPathTypeNullPath ( ) { try { tools . findOrCreateNode ( session , NULL_STRING , org . modeshape . jcr . JcrToolsTest . DEF_TYPE ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } findOrCreateNode ( javax . jcr . Session , java . lang . String , java . lang . String ) { return findOrCreateNode ( session , path , nodeType , nodeType ) ; } | org . junit . Assert . assertTrue ( ( e instanceof java . lang . IllegalArgumentException ) ) |
testSerialization ( ) { org . jfree . chart . renderer . category . DefaultCategoryItemRenderer r1 = new org . jfree . chart . renderer . category . DefaultCategoryItemRenderer ( ) ; org . jfree . chart . renderer . category . DefaultCategoryItemRenderer r2 = ( ( org . jfree . chart . renderer . category . DefaultCategoryItemRenderer ) ( org . jfree . chart . TestUtils . serialised ( r1 ) ) ) ; "<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 ( r1 , r2 ) |
testFindSetterWithMethodOfSameName ( ) { org . supercsv . util . ReflectionUtils . findSetter ( bean , "primitiveBoolean" , boolean . class ) . invoke ( bean , true ) ; "<AssertPlaceHolder>" ; } isPrimitiveBoolean ( ) { return primitiveBoolean ; } | org . junit . Assert . assertTrue ( bean . isPrimitiveBoolean ( ) ) |
doNotCreateCenterWhenSouthIsMissing ( ) { org . openscience . cdk . interfaces . IAtom focus = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "C" , 0 , 0.8 , 0.42 ) ; org . openscience . cdk . interfaces . IAtom north = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "C" , 0 , 0.8 , 1.24 ) ; org . openscience . cdk . interfaces . IAtom east = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "O" , 1 , 1.63 , 0.42 ) ; org . openscience . cdk . interfaces . IAtom west = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "H" , 0 , ( - 0.02 ) , 0.42 ) ; org . openscience . cdk . interfaces . IBond [ ] bonds = new org . openscience . cdk . interfaces . IBond [ ] { new org . openscience . cdk . silent . Bond ( focus , north ) , new org . openscience . cdk . silent . Bond ( focus , west ) , new org . openscience . cdk . silent . Bond ( focus , east ) } ; org . openscience . cdk . interfaces . ITetrahedralChirality element = org . openscience . cdk . stereo . FischerRecognition . newTetrahedralCenter ( focus , bonds ) ; "<AssertPlaceHolder>" ; } newTetrahedralCenter ( org . openscience . cdk . interfaces . IAtom , org . openscience . cdk . interfaces . IBond [ ] ) { org . openscience . cdk . interfaces . IBond [ ] cardinalBonds = org . openscience . cdk . stereo . FischerRecognition . cardinalBonds ( focus , bonds ) ; if ( cardinalBonds == null ) return null ; if ( ( ! ( org . openscience . cdk . stereo . FischerRecognition . isPlanarSigmaBond ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . NORTH ] ) ) ) || ( ! ( org . openscience . cdk . stereo . FischerRecognition . isPlanarSigmaBond ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . SOUTH ] ) ) ) ) return null ; if ( ( ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . EAST ] ) == null ) && ( ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . WEST ] ) == null ) ) return null ; org . openscience . cdk . interfaces . IAtom [ ] neighbors = new org . openscience . cdk . interfaces . IAtom [ ] { cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . NORTH ] . getOther ( focus ) , focus , cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . SOUTH ] . getOther ( focus ) , focus } ; if ( org . openscience . cdk . stereo . FischerRecognition . isPlanarSigmaBond ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . EAST ] ) ) { neighbors [ org . openscience . cdk . stereo . FischerRecognition . EAST ] = cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . EAST ] . getOther ( focus ) ; } else if ( ( ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . EAST ] ) != null ) || ( ( bonds . length ) == 4 ) ) { return null ; } if ( org . openscience . cdk . stereo . FischerRecognition . isPlanarSigmaBond ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . WEST ] ) ) { neighbors [ org . openscience . cdk . stereo . FischerRecognition . WEST ] = cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . WEST ] . getOther ( focus ) ; } else if ( ( ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . WEST ] ) != null ) || ( ( bonds . length ) == 4 ) ) { return null ; } return new org . openscience . cdk . stereo . TetrahedralChirality ( focus , neighbors , Stereo . ANTI_CLOCKWISE ) ; } | org . junit . Assert . assertNull ( element ) |
lockWhenOtherIsNotTimeout ( ) { com . google . appengine . api . datastore . Key globalTransactionKey = org . slim3 . datastore . DatastoreUtil . allocateId ( ds , GlobalTransaction . KIND ) ; com . google . appengine . api . datastore . Key globalTransactionKey2 = org . slim3 . datastore . DatastoreUtil . allocateId ( ds , GlobalTransaction . KIND ) ; com . google . appengine . api . datastore . Key rootKey = com . google . appengine . api . datastore . KeyFactory . createKey ( "Hoge" , 1 ) ; long timestamp = java . lang . System . currentTimeMillis ( ) ; org . slim3 . datastore . Lock lock = new org . slim3 . datastore . Lock ( ds , globalTransactionKey , rootKey , timestamp ) ; org . slim3 . datastore . Lock other = new org . slim3 . datastore . Lock ( ds , globalTransactionKey2 , rootKey , timestamp ) ; other . lock ( ) ; try { lock . lock ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . util . ConcurrentModificationException e ) { System . out . println ( e . getMessage ( ) ) ; } "<AssertPlaceHolder>" ; } getActiveTransactions ( ) { return com . google . appengine . api . datastore . DatastoreServiceFactory . getDatastoreService ( ) . getActiveTransactions ( ) ; } | org . junit . Assert . assertThat ( ds . getActiveTransactions ( ) . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) ) |
testBase64Encode ( ) { try { java . lang . String encodeStr = com . qcloud . cos . common_utils . CommonCodecUtils . Base64Encode ( com . qcloud . cos . common_utils . CommonCodecUtilsTest . plainText . getBytes ( "UTF-8" ) ) ; java . lang . String expectEncodeStr = "NjgxODA1ZDlmN2M2YWI5ODhhMDBjMDJmMTA5NmIxYjY4YTc3YWFlZA==" ; boolean cmpResult = encodeStr . equals ( expectEncodeStr ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ) ; } } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( ( ( ( ( com . qcloud . cos . meta . FileStat ) ( obj ) ) . getFileSize ( ) ) == ( this . fileSize ) ) && ( ( ( ( com . qcloud . cos . meta . FileStat ) ( obj ) ) . getLastModifiedTime ( ) ) == ( this . lastModifiedTime ) ) ) { return true ; } else { return false ; } } | org . junit . Assert . assertTrue ( cmpResult ) |
basicExample ( ) { uk . co . rockstable . experiements . codegen . reflection . extractors . ExtractorFactory factory = uk . co . rockstable . experiements . codegen . reflection . extractors . ExtractorFactory . newInstance ( ExtractorFactory . Type . MAGIC ) ; uk . co . rockstable . experiements . codegen . reflection . extractors . Extractor < uk . co . rockstable . experiements . codegen . reflection . func . domain . DomainObject > nameExtractor = factory . create ( uk . co . rockstable . experiements . codegen . reflection . func . domain . DomainObject . class , "name" ) ; uk . co . rockstable . experiements . codegen . reflection . func . domain . DomainObject domainObject = new uk . co . rockstable . experiements . codegen . reflection . func . domain . DomainObject ( "hello<sp>world" , 0 ) ; java . lang . String extractedString = nameExtractor . extract ( domainObject ) ; "<AssertPlaceHolder>" ; } extract ( java . lang . Object ) { try { return field . get ( o ) ; } catch ( java . lang . IllegalAccessException e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( "hello<sp>world" , extractedString ) |
testBuild ( ) { org . lnu . is . domain . duty . type . DutyType context = new org . lnu . is . domain . duty . type . DutyType ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>DutyType<sp>e<sp>WHERE<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . duty . type . DutyType > 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 ) |
buildingFromVariableLengthByteArrayIndexedListTestIntUnsafe ( ) { final java . util . List < com . yandex . yoctodb . util . UnsignedByteArray > elements = new java . util . ArrayList ( ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 0 ) ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 1 ) ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 2 ) ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 3 ) ) ; elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( 4 ) ) ; final com . yandex . yoctodb . util . buf . Buffer bb = prepareDataFromVariableLengthByteArrayIndexedLength ( elements ) ; final com . yandex . yoctodb . util . immutable . ByteArrayIndexedList list = com . yandex . yoctodb . util . immutable . impl . VariableLengthByteArrayIndexedList . from ( bb ) ; for ( int i = 0 ; i < ( elements . size ( ) ) ; i ++ ) { final long puttedValue = ( elements . get ( i ) . toByteBuffer ( ) . getInt ( ) ) ^ ( Integer . MIN_VALUE ) ; "<AssertPlaceHolder>" ; } } getIntUnsafe ( int ) { assert ( 0 <= docId ) && ( docId < ( elementCount ) ) ; final long offsetIndex = ( getOffsetIndex . apply ( docId ) ) * ( Long . BYTES ) ; final long start = offsets . getLong ( offsetIndex ) ; return ( elements . getInt ( start ) ) ^ ( Integer . MIN_VALUE ) ; } | org . junit . Assert . assertEquals ( puttedValue , list . getIntUnsafe ( i ) ) |
testHasRelationshipsWithOutgoingDirectionWithMultipleRelationshipTypes ( ) { boolean hasRelationship = neo . hasRelationship ( org . neo4j . rest . graphdb . OUTGOING , RelTypes . KNOWS , RelTypes . FIGHTS ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( hasRelationship ) |
testNonTokenQop ( ) { java . lang . String header = "Digest<sp>qop=au{th" ; java . io . StringReader input = new java . io . StringReader ( header ) ; java . util . Map < java . lang . String , java . lang . String > result = org . apache . tomcat . util . http . parser . HttpParser . parseAuthorizationDigest ( input ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNull ( result ) |
testSixtyFourByteStreamWithGoodFileTypeAndCloseHeader ( ) { java . io . InputStream dbf = new java . io . ByteArrayInputStream ( new byte [ ] { 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , net . iryndin . jdbf . util . JdbfUtils . HEADER_TERMINATOR } ) ; try ( net . iryndin . jdbf . reader . DbfReader reader = new net . iryndin . jdbf . reader . DbfReader ( dbf ) ) { "<AssertPlaceHolder>" ; } } read ( ) { java . util . Arrays . fill ( oneRecordBuffer , ( ( byte ) ( 0 ) ) ) ; int readLength = net . iryndin . jdbf . util . IOUtils . readFully ( dbfInputStream , oneRecordBuffer ) ; if ( readLength < ( metadata . getOneRecordLength ( ) ) ) { return null ; } return createDbfRecord ( ) ; } | org . junit . Assert . assertNull ( reader . read ( ) ) |
testFilter ( ) { org . meridor . perspective . beans . Instance firstInstance = org . meridor . perspective . backend . EntityGenerator . getInstance ( ) ; java . util . List < org . meridor . perspective . beans . Instance > instances = new java . util . ArrayList < org . meridor . perspective . beans . Instance > ( ) { { add ( firstInstance ) ; org . meridor . perspective . beans . Instance secondInstance = org . meridor . perspective . backend . EntityGenerator . getInstance ( ) ; secondInstance . setCloudType ( org . meridor . perspective . shell . common . misc . impl . DOCKER ) ; } } ; java . util . Collection < org . meridor . perspective . beans . Instance > filteredInstances = operationSupportChecker . filter ( instances , Instance :: getCloudType , org . meridor . perspective . shell . common . misc . impl . ADD_IMAGE ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { for ( org . meridor . perspective . shell . common . validator . Field c : org . meridor . perspective . shell . common . validator . Field . values ( ) ) { if ( c . name ( ) . equals ( name ) ) { return true ; } } return false ; } | org . junit . Assert . assertThat ( filteredInstances , org . hamcrest . Matchers . contains ( firstInstance ) ) |
willReturnOnePageIfthereWasNoPaging ( ) { kong . unirest . PagedList < BehaviorTests . RequestCapture > result = kong . unirest . Unirest . get ( MockServer . PAGED ) . asPaged ( ( r ) -> r . asObject ( . class ) , ( r ) -> null ) ; "<AssertPlaceHolder>" ; } size ( ) { return headers . stream ( ) . map ( Header :: getName ) . collect ( toSet ( ) ) . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , result . size ( ) ) |
rememberWindowSizeUsesCorrectPropertiesKey ( ) { java . util . Properties properties = new java . util . Properties ( ) ; properties . put ( "rememberWindowSize" , "true" ) ; com . github . marabou . properties . UserProperties userProperties = userProperties ( properties ) ; boolean result = userProperties . rememberWindowSize ( ) ; "<AssertPlaceHolder>" ; } rememberWindowSize ( ) { return java . lang . Boolean . valueOf ( properties . getProperty ( "rememberWindowSize" , "false" ) ) ; } | org . junit . Assert . assertTrue ( result ) |
testDeadEvent ( ) { com . voxelplugineering . voxelsniper . service . eventbus . EventBus bus = new com . voxelplugineering . voxelsniper . service . eventbus . AsyncEventBus ( com . voxelplugineering . voxelsniper . util . ContextTestUtil . create ( new com . voxelplugineering . voxelsniper . service . config . ConfigurationService ( com . voxelplugineering . voxelsniper . util . ContextTestUtil . create ( ) ) ) ) ; bus . start ( ) ; com . voxelplugineering . voxelsniper . EventBusTest . DeadEventHandler handler = new com . voxelplugineering . voxelsniper . EventBusTest . DeadEventHandler ( ) ; bus . register ( handler ) ; bus . post ( new com . voxelplugineering . voxelsniper . EventBusTest . TestEvent ( ) ) ; long timeout = 1000 ; while ( ( timeout > 0 ) && ( ! ( handler . dead ) ) ) { java . lang . Thread . sleep ( 50 ) ; timeout -= 50 ; } "<AssertPlaceHolder>" ; bus . unregister ( handler ) ; } post ( com . voxelplugineering . voxelsniper . service . event . Event ) { checkNotNull ( event ) ; if ( ( event . getThreadingPolicy ( ) ) == ( com . voxelplugineering . voxelsniper . service . eventbus . EventThreadingPolicy . Policy . ASYNCHRONOUS ) ) { return postAsync ( event ) ; } else if ( ( event . getThreadingPolicy ( ) ) == ( com . voxelplugineering . voxelsniper . service . eventbus . EventThreadingPolicy . Policy . SYNCHRONIZED ) ) { return postSync ( event ) ; } else { return postAsyncSeq ( event ) ; } } | org . junit . Assert . assertEquals ( true , handler . dead ) |
getAllRoles_shouldReturnAllRolesInTheSystem ( ) { executeDataSet ( org . openmrs . api . UserServiceTest . XML_FILENAME ) ; java . util . List < org . openmrs . Role > roles = userService . getAllRoles ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return getMemberships ( ) . stream ( ) . filter ( ( m ) -> ! ( m . getVoided ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) . size ( ) ; } | org . junit . Assert . assertEquals ( 7 , roles . size ( ) ) |
lifecycleStopStopsClientOnlyOnce ( ) { org . appenders . log4j2 . elasticsearch . jest . JestHttpObjectFactory objectFactory = spy ( org . appenders . log4j2 . elasticsearch . jest . JestHttpObjectFactoryTest . createTestObjectFactoryBuilder ( ) . build ( ) ) ; io . searchbox . client . JestClient client = mock ( io . searchbox . client . JestClient . class ) ; org . appenders . log4j2 . elasticsearch . ClientProvider < io . searchbox . client . JestClient > clientProvider = ( ) -> client ; when ( objectFactory . getClientProvider ( any ( ) ) ) . thenReturn ( clientProvider ) ; objectFactory . start ( ) ; objectFactory . createClient ( ) ; int expectedInteractions = mockingDetails ( client ) . getInvocations ( ) . size ( ) ; objectFactory . stop ( ) ; objectFactory . stop ( ) ; verify ( client ) . shutdownClient ( ) ; "<AssertPlaceHolder>" ; } stop ( ) { if ( isStopped ( ) ) { return ; } org . appenders . log4j2 . elasticsearch . jest . JestHttpObjectFactory . LOG . debug ( "Stopping<sp>{}" , getClass ( ) . getSimpleName ( ) ) ; if ( ( client ) != null ) { client . shutdownClient ( ) ; } state = State . STOPPED ; org . appenders . log4j2 . elasticsearch . jest . JestHttpObjectFactory . LOG . debug ( "{}<sp>stopped" , getClass ( ) . getSimpleName ( ) ) ; } | org . junit . Assert . assertEquals ( ( expectedInteractions + 1 ) , mockingDetails ( client ) . getInvocations ( ) . size ( ) ) |
invoke_mutateWithImmediateExpiry ( ) { cache . invoke ( org . cache2k . test . core . BasicCacheOperationsWithoutCustomizationsTest . KEY , new org . cache2k . processor . EntryProcessor < java . lang . Integer , java . lang . Integer , java . lang . Object > ( ) { @ org . cache2k . test . core . Override public org . cache2k . test . core . Boolean process ( final org . cache2k . processor . MutableCacheEntry < java . lang . Integer , java . lang . Integer > e ) throws java . lang . Exception { e . setValue ( org . cache2k . test . core . BasicCacheOperationsWithoutCustomizationsTest . VALUE ) ; e . setExpiryTime ( ExpiryTimeValues . NOW ) ; return null ; } } ) ; "<AssertPlaceHolder>" ; } containsKey ( K ) { org . cache2k . processor . EntryProcessor < K , V , java . lang . Boolean > p = new org . cache2k . processor . EntryProcessor < K , V , java . lang . Boolean > ( ) { @ org . cache2k . test . core . Override public org . cache2k . test . core . Boolean process ( org . cache2k . processor . MutableCacheEntry < K , V > e ) throws org . cache2k . test . core . Exception { if ( ! ( e . exists ( ) ) ) { return false ; } return true ; } } ; return invoke ( key , p ) ; } | org . junit . Assert . assertFalse ( cache . containsKey ( org . cache2k . test . core . BasicCacheOperationsWithoutCustomizationsTest . KEY ) ) |
testContainerStateShouldBeRemovedAfterFailure ( ) { com . vmware . photon . controller . model . resources . ResourcePoolService . ResourcePoolState resourcePool = createResourcePool ( ) ; com . vmware . admiral . compute . container . ContainerDescriptionService . ContainerDescription containerDescription = createContainerDescription ( ) ; com . vmware . admiral . compute . container . GroupResourcePlacementService . GroupResourcePlacementState groupPlacementState = createGroupResourcePlacement ( resourcePool ) ; com . vmware . admiral . service . test . MockDockerAdapterService service = new com . vmware . admiral . service . test . MockDockerAdapterService ( ) ; service . setSelfLink ( MockDockerAdapterService . SELF_LINK ) ; host . stopService ( service ) ; com . vmware . admiral . request . RequestBrokerService . RequestBrokerState request = new com . vmware . admiral . request . RequestBrokerService . RequestBrokerState ( ) ; request . resourceType = ResourceType . CONTAINER_TYPE . getName ( ) ; request . resourceDescriptionLink = containerDescription . documentSelfLink ; request . tenantLinks = groupPlacementState . tenantLinks ; request = startRequest ( request ) ; request = waitForRequestToFail ( request ) ; com . vmware . admiral . compute . container . ContainerService . ContainerState containerState = searchForDocument ( com . vmware . admiral . compute . container . ContainerService . ContainerState . class , request . resourceLinks . iterator ( ) . next ( ) ) ; "<AssertPlaceHolder>" ; } waitForRequestToFail ( com . vmware . admiral . request . RequestBrokerService . RequestBrokerState ) { host . log ( ( "wait<sp>for<sp>request<sp>to<sp>fail:<sp>" + ( requestState . documentSelfLink ) ) ) ; com . vmware . admiral . request . RequestBrokerService . RequestBrokerState rbState = waitForTaskError ( requestState . documentSelfLink , com . vmware . admiral . request . RequestBrokerService . RequestBrokerState . class ) ; com . vmware . admiral . request . RequestStatusService . RequestStatus rs = getDocument ( com . vmware . admiral . request . RequestStatusService . RequestStatus . class , rbState . requestTrackerLink ) ; org . junit . Assert . assertNotNull ( rs ) ; waitForPropertyValue ( rs . documentSelfLink , com . vmware . admiral . request . RequestStatusService . RequestStatus . class , RequestStatus . FIELD_NAME_TASK_INFO_STAGE , TaskStage . FAILED ) ; waitForPropertyValue ( rs . documentSelfLink , com . vmware . admiral . request . RequestStatusService . RequestStatus . class , RequestStatus . FIELD_NAME_SUB_STAGE , SubStage . ERROR . name ( ) ) ; return rbState ; } | org . junit . Assert . assertNull ( containerState ) |
testSwitch3 ( ) { instrument ( org . jacoco . core . test . validation . java5 . CyclomaticComplexityTest . Switch . class ) ; target . test ( 0 ) ; target . test ( 1 ) ; final org . jacoco . core . analysis . ICounter complexity = analyze ( ) ; "<AssertPlaceHolder>" ; } getInstance ( int , int ) { if ( ( missed <= ( org . jacoco . core . internal . analysis . CounterImpl . SINGLETON_LIMIT ) ) && ( covered <= ( org . jacoco . core . internal . analysis . CounterImpl . SINGLETON_LIMIT ) ) ) { return org . jacoco . core . internal . analysis . CounterImpl . SINGLETONS [ missed ] [ covered ] ; } else { return new org . jacoco . core . internal . analysis . CounterImpl . Var ( missed , covered ) ; } } | org . junit . Assert . assertEquals ( org . jacoco . core . internal . analysis . CounterImpl . getInstance ( 1 , 2 ) , complexity ) |
testSetActionStatus ( ) { final org . bonitasoft . engine . queriablelogger . model . builder . SQueriableLogBuilder builder = fact . createNewInstance ( ) ; builder . actionStatus ( 1 ) . severity ( SQueriableLogSeverity . BUSINESS ) ; builder . actionType ( "variable_update" ) . actionScope ( "myVar" ) . rawMessage ( "successFull" ) ; final org . bonitasoft . engine . queriablelogger . model . SQueriableLog queriableLog = builder . done ( ) ; "<AssertPlaceHolder>" ; } getActionStatus ( ) { return actionStatus ; } | org . junit . Assert . assertEquals ( 1 , queriableLog . getActionStatus ( ) ) |
usesOrganizationLevelPreset ( ) { org . opencastproject . security . api . Organization organization = org . easymock . EasyMock . createMock ( org . opencastproject . security . api . Organization . class ) ; org . easymock . EasyMock . replay ( organization ) ; java . lang . String seriesID = "series-ID" ; presetProvider = org . easymock . EasyMock . createMock ( org . opencastproject . presets . api . PresetProvider . class ) ; org . easymock . EasyMock . expect ( presetProvider . getProperty ( seriesID , org . opencastproject . workflow . handler . workflow . DefaultsWorkflowOperationHandlerTest . OPT_KEY ) ) . andReturn ( org . opencastproject . workflow . handler . workflow . DefaultsWorkflowOperationHandlerTest . ORGANIZATION_PRESET_VALUE ) ; org . easymock . EasyMock . replay ( presetProvider ) ; java . util . Map < java . lang . String , java . lang . String > workflowConfiguration = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; workflowConfiguration . put ( org . opencastproject . workflow . handler . workflow . DefaultsWorkflowOperationHandlerTest . OPT_KEY , org . opencastproject . workflow . handler . workflow . DefaultsWorkflowOperationHandlerTest . WORKFLOW_PRESET_VALUE ) ; org . opencastproject . workflow . api . WorkflowInstance workflowInstance = setupInstance ( seriesID , workflowConfiguration , false ) ; org . opencastproject . workflow . handler . workflow . DefaultsWorkflowOperationHandler handler = new org . opencastproject . workflow . handler . workflow . DefaultsWorkflowOperationHandler ( ) ; handler . setPresetProvider ( presetProvider ) ; org . opencastproject . workflow . api . WorkflowOperationResult result = handler . start ( workflowInstance , null ) ; "<AssertPlaceHolder>" ; } getProperties ( ) { return new com . entwinemedia . fn . data . ImmutableSetWrapper ( data . keySet ( ) ) ; } | org . junit . Assert . assertEquals ( org . opencastproject . workflow . handler . workflow . DefaultsWorkflowOperationHandlerTest . ORGANIZATION_PRESET_VALUE , result . getProperties ( ) . get ( org . opencastproject . workflow . handler . workflow . DefaultsWorkflowOperationHandlerTest . OPT_KEY ) ) |
testPUSHN_2 ( ) { org . ethereum . vm . VM vm = new org . ethereum . vm . VM ( ) ; program = new org . ethereum . vm . Program ( org . spongycastle . util . encoders . Hex . decode ( "7fAABB" ) , invoke ) ; try { program . fullTrace ( ) ; vm . step ( program ) ; } finally { "<AssertPlaceHolder>" ; } } isStopped ( ) { return stopped ; } | org . junit . Assert . assertTrue ( program . isStopped ( ) ) |
isPaymentVisible_SubscriptionManager ( ) { java . util . List < org . oscm . internal . vo . VOPaymentInfo > paymentInfoTypeList = new java . util . ArrayList ( ) ; paymentInfoTypeList . add ( new org . oscm . internal . vo . VOPaymentInfo ( ) ) ; when ( java . lang . Boolean . valueOf ( userBean . isLoggedInAndAdmin ( ) ) ) . thenReturn ( Boolean . FALSE ) ; when ( java . lang . Boolean . valueOf ( userBean . isLoggedInAndAllowedToSubscribe ( ) ) ) . thenReturn ( Boolean . TRUE ) ; when ( paymentInfoBean . getPaymentInfosForSubscription ( ) ) . thenReturn ( paymentInfoTypeList ) ; boolean result = ctrl . isPaymentVisible ( ( ( java . util . Collection ) ( paymentInfoTypeList ) ) , paymentInfoBean . getPaymentInfosForSubscription ( ) ) ; "<AssertPlaceHolder>" ; } getPaymentInfosForSubscription ( ) { java . lang . Long serviceKeyForPayment = sessionBean . getServiceKeyForPayment ( ) ; if ( ( ( paymentInfosForSubscription ) == null ) || ( serviceKeyForPaymentChanged ( serviceKeyForPayment ) ) ) { currentServiceKeyForPayment = serviceKeyForPayment ; paymentInfosForSubscription = new java . util . ArrayList ( ) ; if ( ( currentServiceKeyForPayment ) != null ) { paymentInfosForSubscription = getPaymentInfosForSubscription ( serviceKeyForPayment . longValue ( ) , getAccountingService ( ) ) ; } } java . util . Collections . sort ( paymentInfosForSubscription , new org . oscm . ui . beans . PaymentInfoBean . PaymentInfoComparator ( ) ) ; return paymentInfosForSubscription ; } | org . junit . Assert . assertTrue ( result ) |
beanBound_setValidFieldValue_propertyValueChanged ( ) { binder . setBean ( item ) ; binder . bind ( nameField , "firstname" ) ; nameField . setValue ( "Henri" ) ; "<AssertPlaceHolder>" ; } getFirstname ( ) { return firstname ; } | org . junit . Assert . assertEquals ( "Henri" , item . getFirstname ( ) ) |
route ( ) { java . lang . String [ ] databases = new java . lang . String [ ] { "new://Resource?provider=org.router:DeterminedRouter&type=" 1 , "new://Resource?provider=org.router:DeterminedRouter&type=" 3 , "database3" } ; java . util . Properties properties = new java . util . Properties ( ) ; properties . setProperty ( Context . INITIAL_CONTEXT_FACTORY , org . apache . openejb . core . LocalInitialContextFactory . class . getName ( ) ) ; for ( int i = 1 ; i <= ( databases . length ) ; i ++ ) { java . lang . String dbName = databases [ ( i - 1 ) ] ; properties . setProperty ( dbName , "new://Resource?type=DataSource" ) ; dbName += "JdbcUrl" 2 ; properties . setProperty ( ( dbName + "JdbcUrl" 8 ) , "org.hsqldb.jdbcDriver" ) ; properties . setProperty ( ( dbName + "JdbcUrl" ) , ( "JdbcUrl" 4 + i ) ) ; properties . setProperty ( ( dbName + "new://Resource?provider=org.router:DeterminedRouter&type=" 5 ) , "JdbcUrl" 9 ) ; properties . setProperty ( ( dbName + "JdbcUrl" 1 ) , "" ) ; properties . setProperty ( ( dbName + "new://Resource?provider=org.router:DeterminedRouter&type=" 4 ) , "JdbcUrl" 6 ) ; } properties . setProperty ( "new://Resource?provider=org.router:DeterminedRouter&type=" 2 , ( "new://Resource?provider=org.router:DeterminedRouter&type=" + ( org . superbiz . dynamicdatasourcerouting . DeterminedRouter . class . getName ( ) ) ) ) ; properties . setProperty ( "My<sp>Router.DatasourceNames" , "JdbcUrl" 3 ) ; properties . setProperty ( "JdbcUrl" 0 , "new://Resource?provider=org.router:DeterminedRouter&type=" 1 ) ; properties . setProperty ( "Routed<sp>Datasource" , ( "new://Resource?provider=RoutedDataSource&type=" + ( javax . sql . DataSource . class . getName ( ) ) ) ) ; properties . setProperty ( "new://Resource?provider=org.router:DeterminedRouter&type=" 0 , "new://Resource?provider=org.router:DeterminedRouter&type=" 2 ) ; javax . naming . Context ctx = javax . ejb . embeddable . EJBContainer . createEJBContainer ( properties ) . getContext ( ) ; org . superbiz . dynamicdatasourcerouting . RoutedPersister ejb = ( ( org . superbiz . dynamicdatasourcerouting . RoutedPersister ) ( ctx . lookup ( "JdbcUrl" 5 ) ) ) ; for ( int i = 0 ; i < 18 ; i ++ ) { java . lang . String name = "record<sp>" + i ; java . lang . String db = databases [ ( i % 3 ) ] ; ejb . persist ( i , name , db ) ; } for ( int i = 1 ; i <= ( databases . length ) ; i ++ ) { java . sql . Connection connection = java . sql . DriverManager . getConnection ( ( "JdbcUrl" 4 + i ) , "JdbcUrl" 9 , "" ) ; java . sql . Statement st = connection . createStatement ( ) ; java . sql . ResultSet rs = st . executeQuery ( "JdbcUrl" 7 ) ; rs . next ( ) ; "<AssertPlaceHolder>" ; st . close ( ) ; connection . close ( ) ; } ctx . close ( ) ; } getInt ( java . lang . String ) { return message . getInt ( name ) ; } | org . junit . Assert . assertEquals ( 6 , rs . getInt ( 1 ) ) |
runCmdGetStringTet ( ) { process = org . mockito . Mockito . mock ( com . att . aro . core . commandline . impl . Process . class ) ; java . lang . String aMessage = "hello" ; java . io . InputStream stream = new java . io . ByteArrayInputStream ( aMessage . getBytes ( ) ) ; org . mockito . Mockito . when ( process . getInputStream ( ) ) . thenReturn ( stream ) ; org . mockito . Mockito . doNothing ( ) . when ( process ) . destroy ( ) ; org . mockito . Mockito . when ( factory . create ( org . mockito . Mockito . any ( java . lang . String [ ] . class ) ) ) . thenReturn ( process ) ; org . mockito . Mockito . when ( factory . create ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( process ) ; externalProcessRunner . setProcessFactory ( factory ) ; java . lang . String res = externalProcessRunner . runGetString ( "test" ) ; "<AssertPlaceHolder>" ; } runGetString ( java . lang . String ) { java . io . ByteArrayOutputStream data = this . run ( command ) ; java . lang . String out = "" ; if ( data != null ) { out = data . toString ( ) ; data . close ( ) ; return out ; } return null ; } | org . junit . Assert . assertEquals ( aMessage , res ) |
testCommandLine ( ) { int ret = runStreamJob ( ) ; "<AssertPlaceHolder>" ; checkOutput ( ) ; } runStreamJob ( ) { boolean mayExit = false ; int returnStatus = 0 ; org . apache . hadoop . streaming . StreamJob job = new org . apache . hadoop . streaming . StreamJob ( args , mayExit ) ; returnStatus = job . go ( ) ; org . junit . Assert . assertEquals ( "Streaming<sp>Job<sp>expected<sp>to<sp>succeed" , 0 , returnStatus ) ; job . running_ . killJob ( ) ; job . running_ . waitForCompletion ( ) ; } | org . junit . Assert . assertEquals ( 0 , ret ) |
testFlowWithNoRefStep ( ) { java . net . URI resource = getClass ( ) . getResource ( "/corrupted/step_with_no_ref_flow.sl" ) . toURI ( ) ; io . cloudslang . lang . compiler . modeller . result . ExecutableModellingResult result = compiler . preCompileSource ( io . cloudslang . lang . compiler . SlangSource . fromFile ( resource ) ) ; "<AssertPlaceHolder>" ; exception . expect ( io . cloudslang . lang . compiler . RuntimeException . class ) ; exception . expectMessage ( ( "For<sp>step<sp>\'step1\'<sp>syntax<sp>is<sp>illegal.\n" + "Step<sp>has<sp>no<sp>reference<sp>information." ) ) ; throw result . getErrors ( ) . get ( 0 ) ; } getErrors ( ) { return errors ; } | org . junit . Assert . assertTrue ( ( ( result . getErrors ( ) . size ( ) ) > 0 ) ) |
testReturn ( ) { fr . inria . corese . core . Graph g = fr . inria . corese . core . Graph . create ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; java . lang . String q = "select<sp>(us:fun(5)<sp>as<sp>?n)<sp>where<sp>{}" + ( ( ( ( ( "function<sp>us:fun(?n)<sp>{" + "for<sp>(?x<sp>in<sp>xt:iota(?n)){" ) + "if<sp>(?x<sp>=<sp>?n){" ) + "return<sp>(?x)}" ) + "}" ) + "}" ) ; fr . inria . corese . kgram . core . Mappings map = exec . query ( q ) ; fr . inria . corese . sparql . api . IDatatype dt = ( ( fr . inria . corese . sparql . api . IDatatype ) ( map . getValue ( "?n" ) ) ) ; "<AssertPlaceHolder>" ; } intValue ( ) { return ( ( int ) ( lvalue ) ) ; } | org . junit . Assert . assertEquals ( dt . intValue ( ) , 5 ) |
unescapeJSON_n ( ) { java . lang . String input = "\\n" ; java . lang . String unescaped = org . oscm . json . EscapeUtils . unescapeJSON ( input ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( "\n" , unescaped ) |
setMaxHeight ( ) { com . vaadin . flow . component . HasSizeTest . HasSizeComponent c = new com . vaadin . flow . component . HasSizeTest . HasSizeComponent ( ) ; c . setMaxHeight ( "100px" ) ; "<AssertPlaceHolder>" ; } getMaxHeight ( ) { return getElement ( ) . getStyle ( ) . get ( ElementConstants . STYLE_MAX_HEIGHT ) ; } | org . junit . Assert . assertEquals ( "100px" , c . getMaxHeight ( ) ) |
testIdClass ( ) { final cz . habarta . typescript . generator . Settings settings = cz . habarta . typescript . generator . TestUtils . settings ( ) ; final java . lang . String output = new cz . habarta . typescript . generator . TypeScriptGenerator ( settings ) . generateTypeScript ( cz . habarta . typescript . generator . Input . from ( cz . habarta . typescript . generator . TaggedUnionsTest . Car . class ) ) ; final java . lang . String expected = ( "\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "interface<sp>Car<sp>{\n" + "}\n" 0 ) + "<sp>name:<sp>string;\n" ) + "}\n" ) + "\n" ) + "}\n" 1 ) + "<sp>\'@class\':<sp>\'cz.habarta.typescript.generator.TaggedUnionsTest$DieselCar\';\n" ) + "<sp>fuelTankCapacityInLiters:<sp>number;\n" ) + "}\n" ) + "\n" ) + "interface<sp>ElectricCar<sp>extends<sp>Car<sp>{\n" ) + "<sp>\'@class\':<sp>\'cz.habarta.typescript.generator.TaggedUnionsTest$ElectricCar\';\n" ) + "}\n" 2 ) + "}\n" ) + "\n" ) + "type<sp>CarUnion<sp>=<sp>DieselCar<sp>|<sp>ElectricCar;\n" ) + "" ) ) . replace ( '\'' , '"' ) ; "<AssertPlaceHolder>" ; } from ( java . lang . reflect . Type [ ] ) { java . util . Objects . requireNonNull ( types , "types" ) ; final java . util . List < cz . habarta . typescript . generator . parser . SourceType < java . lang . reflect . Type > > sourceTypes = new java . util . ArrayList ( ) ; for ( java . lang . reflect . Type type : types ) { sourceTypes . add ( new cz . habarta . typescript . generator . parser . SourceType ( type ) ) ; } return new cz . habarta . typescript . generator . Input ( sourceTypes ) ; } | org . junit . Assert . assertEquals ( expected , output ) |
isRenewalNecessaryReturnsFalseDeviceKeyPresent ( ) { new tests . unit . com . microsoft . azure . sdk . iot . device . auth . StrictExpectations ( ) { { tests . unit . com . microsoft . azure . sdk . iot . device . auth . Deencapsulation . newInstance ( tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubSasToken . class , new java . lang . Class [ ] { java . lang . String . class , java . lang . String . class , java . lang . String . class , java . lang . String . class , java . lang . String . class , long . class } , anyString , anyString , anyString , anyString , anyString , anyLong ) ; result = mockSasToken ; tests . unit . com . microsoft . azure . sdk . iot . device . auth . Deencapsulation . invoke ( mockSasToken , "isExpired" ) ; result = true ; } } ; com . microsoft . azure . sdk . iot . device . auth . IotHubSasTokenAuthenticationProvider sasAuth = new com . microsoft . azure . sdk . iot . device . auth . IotHubSasTokenSoftwareAuthenticationProvider ( tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubSasTokenSoftwareIotHubAuthenticationProviderTest . expectedHostname , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubSasTokenSoftwareIotHubAuthenticationProviderTest . expectedGatewayHostname , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubSasTokenSoftwareIotHubAuthenticationProviderTest . expectedDeviceId , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubSasTokenSoftwareIotHubAuthenticationProviderTest . expectedModuleId , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubSasTokenSoftwareIotHubAuthenticationProviderTest . expectedDeviceKey , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubSasTokenSoftwareIotHubAuthenticationProviderTest . expectedSasToken ) ; boolean needsToRenew = tests . unit . com . microsoft . azure . sdk . iot . device . auth . Deencapsulation . invoke ( sasAuth , "isRenewalNecessary" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertFalse ( needsToRenew ) |
convertToFloatNull ( ) { java . lang . Boolean t = null ; java . lang . Float f = converter . toFloat ( t ) ; "<AssertPlaceHolder>" ; } toFloat ( java . lang . Long ) { if ( value == null ) { return null ; } return value . floatValue ( ) ; } | org . junit . Assert . assertNull ( f ) |
shouldGetHoursPerDay ( ) { net . rrm . ehour . data . DateRange dateRange = new net . rrm . ehour . data . DateRange ( new java . util . Date ( ( 2006 - 1900 ) , ( 5 - 1 ) , 1 ) , new java . util . Date ( ( 2008 - 1900 ) , 1 , 3 ) ) ; java . util . List < net . rrm . ehour . report . reports . element . FlatReportElement > results = detailedReportDao . getHoursPerDay ( dateRange ) ; "<AssertPlaceHolder>" ; } size ( ) { return nodes . size ( ) ; } | org . junit . Assert . assertEquals ( 12 , results . size ( ) ) |
testMarshalArchetypes ( ) { io . fabric8 . tooling . archetype . catalog . Archetypes archetypes = new io . fabric8 . tooling . archetype . catalog . Archetypes ( ) ; archetypes . add ( new io . fabric8 . tooling . archetype . catalog . Archetype ( "foo" , "bar" , "1.1" , "Found<sp>" 2 , "Some<sp>description" ) ) ; archetypes . add ( new io . fabric8 . tooling . archetype . catalog . Archetype ( "Found<sp>" 1 , "Found<sp>" 0 , "2.3" , "Some<sp>other<sp>name" , "Docs..." ) ) ; java . io . StringWriter buffer = new java . io . StringWriter ( ) ; io . fabric8 . tooling . archetype . catalog . Archetypes . newMarshaller ( ) . marshal ( archetypes , buffer ) ; System . out . println ( ( "Generated<sp>XML:<sp>" + buffer ) ) ; java . lang . Object result = io . fabric8 . tooling . archetype . catalog . Archetypes . newUnmarshaller ( ) . unmarshal ( new java . io . StringReader ( buffer . toString ( ) ) ) ; if ( result instanceof io . fabric8 . tooling . archetype . catalog . Archetypes ) { "<AssertPlaceHolder>" ; for ( io . fabric8 . tooling . archetype . catalog . Archetype a : ( ( io . fabric8 . tooling . archetype . catalog . Archetypes ) ( result ) ) . getArchetypes ( ) ) { System . out . println ( a ) ; } } else { org . junit . Assert . fail ( ( ( ( "Found<sp>" + ( result . getClass ( ) . getName ( ) ) ) + "<sp>when<sp>expected<sp>an<sp>" ) + ( io . fabric8 . tooling . archetype . catalog . Archetypes . class . getName ( ) ) ) ) ; } } getArchetypes ( ) { return archetypes ; } | org . junit . Assert . assertEquals ( 2 , ( ( io . fabric8 . tooling . archetype . catalog . Archetypes ) ( result ) ) . getArchetypes ( ) . size ( ) ) |
testRemoteExists ( ) { doReturn ( java . util . Collections . singletonList ( mockResource ) ) . when ( mockSardine ) . list ( entry . getLocation ( ) ) ; "<AssertPlaceHolder>" ; } remoteExists ( com . github . sardine . Sardine ) { try { sardine . list ( getLocation ( ) ) ; return true ; } catch ( java . io . IOException e ) { return false ; } } | org . junit . Assert . assertThat ( entry . remoteExists ( mockSardine ) , org . hamcrest . Matchers . is ( true ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.