input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testNextWhenNoValueIsPresent ( ) { java . util . List < java . lang . String > listOfWithoutElement = com . google . common . collect . ImmutableList . of ( ) ; when ( stream . iterator ( ) ) . thenReturn ( listOfWithoutElement . iterator ( ) ) ; scanner = new com . google . cloud . bigtable . grpc . scanner . RowResultScanner ( stream , com . google . cloud . bigtable . grpc . scanner . TestRowResultScanner . TEST_ARRAY ) ; "<AssertPlaceHolder>" ; verify ( stream ) . iterator ( ) ; } next ( ) { if ( ! ( iterator . hasNext ( ) ) ) { return null ; } try ( com . google . cloud . bigtable . metrics . Timer . Context ignored = com . google . cloud . bigtable . grpc . scanner . RowResultScanner . resultsTimer . time ( ) ) { T result = iterator . next ( ) ; com . google . cloud . bigtable . grpc . scanner . RowResultScanner . resultsMeter . mark ( ) ; return result ; } catch ( java . lang . RuntimeException e ) { throw e ; } }
org . junit . Assert . assertNull ( scanner . next ( ) )
readIntOneExtentTest ( ) { final java . util . Map < java . lang . String , java . lang . Object > extent = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; extent . put ( "addr" , java . lang . Long . valueOf ( 42 ) ) ; extent . put ( "len" , java . lang . Long . valueOf ( 10 ) ) ; final java . util . List < java . util . Map < java . lang . String , java . lang . Object > > extents = java . util . Collections . singletonList ( extent ) ; final byte [ ] src = new byte [ 1024 ] ; for ( int i = 0 ; i < ( src . length ) ; ++ i ) { src [ i ] = ( ( byte ) ( i % 256 ) ) ; } final org . apache . hadoop . fs . FSDataInputStream in = new com . lightboxtechnologies . spectrum . ExtentsInputStreamTest . ArrayFSDataInputStream ( src ) ; final java . io . InputStream eis = new com . lightboxtechnologies . spectrum . ExtentsInputStream ( in , extents ) ; "<AssertPlaceHolder>" ; } read ( ) { final byte [ ] b = new byte [ 1 ] ; int rlen ; do { rlen = read ( b , 0 , 1 ) ; } while ( rlen == 0 ) ; return rlen == ( - 1 ) ? - 1 : b [ 0 ] ; }
org . junit . Assert . assertEquals ( src [ 42 ] , eis . read ( ) )
shouldNotBeAuthorizedForPublicApiIfMemberOfUnauthorizedGroups ( ) { when ( api . getVisibility ( ) ) . thenReturn ( Visibility . PUBLIC ) ; when ( api . getId ( ) ) . thenReturn ( "apiId" ) ; io . gravitee . repository . management . model . Group grp1 = new io . gravitee . repository . management . model . Group ( ) ; io . gravitee . repository . management . model . Group grp2 = new io . gravitee . repository . management . model . Group ( ) ; grp1 . setId ( "grp1" ) ; grp2 . setId ( "grp2" ) ; when ( groupRepository . findAll ( ) ) . thenReturn ( new java . util . HashSet ( java . util . Arrays . asList ( grp1 , grp2 ) ) ) ; when ( membershipService . getMember ( MembershipReferenceType . API , api . getId ( ) , "user" , RoleScope . API ) ) . thenReturn ( null ) ; when ( membershipService . getMember ( MembershipReferenceType . GROUP , "grp2" , "user" , RoleScope . API ) ) . thenReturn ( null ) ; boolean userAuthorizedToAccess = groupService . isUserAuthorizedToAccessApiData ( api , java . util . Collections . singletonList ( "grp1" ) , "user" ) ; "<AssertPlaceHolder>" ; verify ( membershipService , times ( 2 ) ) . getMember ( any ( ) , any ( ) , any ( ) , any ( ) ) ; verify ( membershipService , times ( 1 ) ) . getMember ( MembershipReferenceType . API , api . getId ( ) , "user" , RoleScope . API ) ; verify ( membershipService , times ( 1 ) ) . getMember ( MembershipReferenceType . GROUP , "grp2" , "user" , RoleScope . API ) ; verify ( api , never ( ) ) . getGroups ( ) ; verify ( groupRepository , times ( 1 ) ) . findAll ( ) ; } isUserAuthorizedToAccessApiData ( io . gravitee . management . model . api . ApiEntity , io . gravitee . management . service . impl . List , java . lang . String ) { if ( username == null ) { return ( ( excludedGroups == null ) || ( excludedGroups . isEmpty ( ) ) ) && ( Visibility . PUBLIC . equals ( api . getVisibility ( ) ) ) ; } if ( ( ( excludedGroups != null ) && ( ! ( excludedGroups . isEmpty ( ) ) ) ) && ( ( membershipService . getMember ( MembershipReferenceType . API , api . getId ( ) , username , RoleScope . API ) ) == null ) ) { io . gravitee . management . service . impl . Set < java . lang . String > authorizedGroups = io . gravitee . management . service . impl . Collections . emptySet ( ) ; if ( ( ( Visibility . PRIVATE . equals ( api . getVisibility ( ) ) ) && ( ( api . getGroups ( ) ) != null ) ) && ( ! ( api . getGroups ( ) . isEmpty ( ) ) ) ) { authorizedGroups = new io . gravitee . management . service . impl . HashSet ( api . getGroups ( ) ) ; } if ( Visibility . PUBLIC . equals ( api . getVisibility ( ) ) ) { try { authorizedGroups = groupRepository . findAll ( ) . stream ( ) . map ( Group :: getId ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; } catch ( io . gravitee . repository . exceptions . TechnicalException ex ) { logger . error ( "An<sp>error<sp>occurs<sp>while<sp>trying<sp>to<sp>find<sp>all<sp>groups" , ex ) ; throw new io . gravitee . management . service . exceptions . TechnicalManagementException ( "An<sp>error<sp>occurs<sp>while<sp>trying<sp>to<sp>find<sp>all<sp>groups" , ex ) ; } } authorizedGroups . removeAll ( excludedGroups ) ; for ( java . lang . String authorizedGroupId : authorizedGroups ) { if ( ( membershipService . getMember ( MembershipReferenceType . GROUP , authorizedGroupId , username , RoleScope . API ) ) != null ) { return true ; } } return false ; } return true ; }
org . junit . Assert . assertFalse ( userAuthorizedToAccess )
testDeleteSnapshotF1 ( ) { when ( snapshotStrategy . deleteSnapshot ( com . cloud . storage . snapshot . SnapshotManagerTest . TEST_SNAPSHOT_ID ) ) . thenReturn ( true ) ; when ( snapshotMock . getState ( ) ) . thenReturn ( Snapshot . State . Destroyed ) ; when ( snapshotMock . getAccountId ( ) ) . thenReturn ( 2L ) ; when ( snapshotMock . getDataCenterId ( ) ) . thenReturn ( 2L ) ; final boolean result = _snapshotMgr . deleteSnapshot ( com . cloud . storage . snapshot . SnapshotManagerTest . TEST_SNAPSHOT_ID ) ; "<AssertPlaceHolder>" ; } deleteSnapshot ( java . lang . Long ) { final com . cloud . storage . SnapshotVO snapshotVO = snapshotDao . findById ( snapshotId ) ; if ( ( snapshotVO . getState ( ) ) == ( com . cloud . legacymodel . storage . ObjectInDataStoreStateMachine . State . Allocated ) ) { snapshotDao . remove ( snapshotId ) ; return true ; } if ( ( snapshotVO . getState ( ) ) == ( com . cloud . legacymodel . storage . ObjectInDataStoreStateMachine . State . Destroyed ) ) { return true ; } if ( Snapshot . State . Error . equals ( snapshotVO . getState ( ) ) ) { final java . util . List < com . cloud . storage . datastore . db . SnapshotDataStoreVO > storeRefs = snapshotStoreDao . findBySnapshotId ( snapshotId ) ; for ( final com . cloud . storage . datastore . db . SnapshotDataStoreVO ref : storeRefs ) { snapshotStoreDao . expunge ( ref . getId ( ) ) ; } snapshotDao . remove ( snapshotId ) ; return true ; } if ( ( snapshotVO . getState ( ) ) == ( com . cloud . legacymodel . storage . ObjectInDataStoreStateMachine . State . CreatedOnPrimary ) ) { com . cloud . storage . snapshot . XenserverSnapshotStrategy . s_logger . debug ( "delete<sp>snapshot<sp>on<sp>primary<sp>storage:" ) ; snapshotVO . setState ( Snapshot . State . Destroyed ) ; snapshotDao . update ( snapshotId , snapshotVO ) ; return true ; } if ( ( ! ( Snapshot . State . BackedUp . equals ( snapshotVO . getState ( ) ) ) ) && ( ! ( Snapshot . State . Error . equals ( snapshotVO . getState ( ) ) ) ) ) { throw new com . cloud . legacymodel . exceptions . InvalidParameterValueException ( ( ( ( ( "Can't<sp>delete<sp>snapshotshot<sp>" + snapshotId ) + "<sp>due<sp>to<sp>it<sp>is<sp>in<sp>" ) + ( snapshotVO . getState ( ) ) ) + "<sp>HostStatus" ) ) ; } final com . cloud . engine . subsystem . api . storage . SnapshotInfo snapshotOnImage = snapshotDataFactory . getSnapshot ( snapshotId , DataStoreRole . Image ) ; if ( snapshotOnImage == null ) { com . cloud . storage . snapshot . XenserverSnapshotStrategy . s_logger . debug ( "Can't<sp>find<sp>snapshot<sp>on<sp>backup<sp>storage,<sp>delete<sp>it<sp>in<sp>db" ) ; snapshotDao . remove ( snapshotId ) ; return true ; } final com . cloud . storage . snapshot . SnapshotObject obj = ( ( com . cloud . storage . snapshot . SnapshotObject ) ( snapshotOnImage ) ) ; try { obj . processEvent ( Snapshot . Event . DestroyRequested ) ; } catch ( final com . cloud . legacymodel . exceptions . NoTransitionException e ) { com . cloud . storage . snapshot . XenserverSnapshotStrategy . s_logger . debug ( "Failed<sp>to<sp>set<sp>the<sp>state<sp>to<sp>destroying:<sp>" , e ) ; return false ; } try { final boolean result = deleteSnapshotChain ( snapshotOnImage ) ; obj . processEvent ( Snapshot . Event . OperationSucceeded ) ; if ( result ) { final com . cloud . storage . datastore . db . SnapshotDataStoreVO snapshotOnPrimary = snapshotStoreDao . findBySnapshot ( snapshotId , DataStoreRole . Primary ) ; if ( snapshotOnPrimary != null ) { snapshotOnPrimary . setState ( State . Destroyed ) ; snapshotStoreDao . update ( snapshotOnPrimary . getId ( ) , snapshotOnPrimary ) ; } } } catch ( final java . lang . Exception e ) { com . cloud . storage . snapshot . XenserverSnapshotStrategy . s_logger . debug ( "Failed<sp>to<sp>delete<sp>snapshot:<sp>" , e ) ; try { obj . processEvent ( Snapshot . Event . OperationFailed ) ; } catch ( final com . cloud . legacymodel . exceptions . NoTransitionException e1 ) { com . cloud . storage . snapshot . XenserverSnapshotStrategy . s_logger . debug ( ( "Failed<sp>to<sp>change<sp>snapshot<sp>state:<sp>" + ( e . toString ( ) ) ) ) ; } return false ; } return true ; }
org . junit . Assert . assertTrue ( result )
testThreadSafetyOfContentCodings ( ) { final java . lang . String entityText = "Hello,<sp>this<sp>is<sp>some<sp>plain<sp>text<sp>coming<sp>back." ; this . server . registerHandler ( "*" , createGzipEncodingRequestHandler ( entityText ) ) ; endGate . await ( ) ; for ( final org . apache . hc . client5 . testing . sync . TestContentCodings . WorkerTask workerTask : workers ) { if ( workerTask . isFailed ( ) ) { org . junit . Assert . fail ( "A<sp>worker<sp>failed" ) ; } "<AssertPlaceHolder>" ; } } getText ( ) { return this . text ; }
org . junit . Assert . assertEquals ( entityText , workerTask . getText ( ) )
shouldSetStateTemplate ( ) { panelState . setState ( State . TEMPLATE ) ; "<AssertPlaceHolder>" ; verify ( listener1 ) . onStateChanged ( ) ; verify ( listener2 ) . onStateChanged ( ) ; } getState ( ) { return state ; }
org . junit . Assert . assertThat ( panelState . getState ( ) , org . hamcrest . core . Is . is ( State . TEMPLATE ) )
executeShouldImportIfNotAlreadyDone ( ) { com . gisgraphy . importer . IImporterManager mockImporterManager = org . easymock . EasyMock . createMock ( com . gisgraphy . importer . IImporterManager . class ) ; org . easymock . EasyMock . expect ( mockImporterManager . isInProgress ( ) ) . andStubReturn ( false ) ; org . easymock . EasyMock . expect ( mockImporterManager . isAlreadyDone ( ) ) . andStubReturn ( false ) ; mockImporterManager . importAll ( ) ; org . easymock . EasyMock . expectLastCall ( ) ; org . easymock . EasyMock . replay ( mockImporterManager ) ; com . gisgraphy . webapp . action . ImportAction action = new com . gisgraphy . webapp . action . ImportAction ( ) ; action . setImporterManager ( mockImporterManager ) ; "<AssertPlaceHolder>" ; } execute ( ) { java . util . List < com . gisgraphy . stats . StatsUsage > statsUsageList = new java . util . ArrayList < com . gisgraphy . stats . StatsUsage > ( ) ; com . gisgraphy . stats . StatsUsage statsUsage1 = new com . gisgraphy . stats . StatsUsage ( com . gisgraphy . stats . StatsUsageType . FULLTEXT ) ; com . gisgraphy . stats . StatsUsage statsUsage2 = new com . gisgraphy . stats . StatsUsage ( com . gisgraphy . stats . StatsUsageType . GEOLOC ) ; com . gisgraphy . stats . StatsUsage statsUsage3 = new com . gisgraphy . stats . StatsUsage ( com . gisgraphy . stats . StatsUsageType . STREET ) ; statsUsage1 . setUsage ( 10L ) ; statsUsage2 . setUsage ( 20L ) ; statsUsage3 . setUsage ( 30L ) ; statsUsageList . add ( statsUsage1 ) ; statsUsageList . add ( statsUsage2 ) ; statsUsageList . add ( statsUsage3 ) ; com . gisgraphy . webapp . action . StatsAction statsAction = new com . gisgraphy . webapp . action . StatsAction ( ) ; com . gisgraphy . domain . repository . IStatsUsageDao mockStatsUsageDao = org . easymock . EasyMock . createMock ( com . gisgraphy . domain . repository . IStatsUsageDao . class ) ; org . easymock . EasyMock . expect ( mockStatsUsageDao . getAll ( ) ) . andReturn ( statsUsageList ) . times ( 2 ) ; org . easymock . EasyMock . replay ( mockStatsUsageDao ) ; statsAction . setStatsUsageDao ( mockStatsUsageDao ) ; java . lang . String returnString = statsAction . execute ( ) ; org . junit . Assert . assertEquals ( "statsusage<sp>should<sp>be<sp>loaded<sp>when<sp>execute<sp>is<sp>called" , statsUsageList , statsAction . getStatsUsages ( ) ) ; org . junit . Assert . assertEquals ( Action . SUCCESS , returnString ) ; org . junit . Assert . assertEquals ( 60L , statsAction . getTotalUsage ( ) . longValue ( ) ) ; returnString = statsAction . execute ( ) ; org . junit . Assert . assertEquals ( "totalusage<sp>should<sp>not<sp>be<sp>recursively<sp>added<sp>for<sp>each<sp>call<sp>to<sp>execute" , 60L , statsAction . getTotalUsage ( ) . longValue ( ) ) ; org . easymock . EasyMock . verify ( mockStatsUsageDao ) ; }
org . junit . Assert . assertEquals ( ImportAction . SUCCESS , action . execute ( ) )
testUpdateBooleanObject ( ) { com . jmethods . catatumbo . entities . BooleanObject entity = new com . jmethods . catatumbo . entities . BooleanObject ( ) ; entity . setAwesome ( Boolean . TRUE ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . insert ( entity ) ; entity . setAwesome ( Boolean . FALSE ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . update ( entity ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . load ( com . jmethods . catatumbo . entities . BooleanObject . class , entity . getId ( ) ) ; "<AssertPlaceHolder>" ; } getAwesome ( ) { return awesome ; }
org . junit . Assert . assertTrue ( ( ! ( entity . getAwesome ( ) ) ) )
testLockUntilMVCCAdvanced ( ) { final java . lang . String tableName = ( org . apache . phoenix . end2end . ConcurrentMutationsIT . MVCC_LOCK_TEST_TABLE_PREFIX ) + ( generateUniqueName ( ) ) ; final java . lang . String indexName = generateUniqueName ( ) ; java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) ) ; conn . createStatement ( ) . execute ( ( ( "CREATE<sp>TABLE<sp>" + tableName ) + "(k<sp>VARCHAR<sp>PRIMARY<sp>KEY,<sp>v<sp>INTEGER)<sp>COLUMN_ENCODED_BYTES<sp>=<sp>0" ) ) ; conn . createStatement ( ) . execute ( ( ( ( ( "CREATE<sp>INDEX<sp>" + indexName ) + "<sp>ON<sp>" ) + tableName ) + "(v,k)" ) ) ; conn . createStatement ( ) . execute ( ( ( "UPSERT<sp>INTO<sp>" + tableName ) + "<sp>VALUES<sp>('foo',0)" ) ) ; conn . commit ( ) ; org . apache . phoenix . util . TestUtil . addCoprocessor ( conn , tableName , org . apache . phoenix . end2end . ConcurrentMutationsIT . DelayingRegionObserver . class ) ; final java . util . concurrent . CountDownLatch doneSignal = new java . util . concurrent . CountDownLatch ( 2 ) ; final java . lang . String [ ] failedMsg = new java . lang . String [ 1 ] ; java . lang . Runnable r1 = new java . lang . Runnable ( ) { @ org . apache . phoenix . end2end . Override public void run ( ) { try { java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) ) ; conn . createStatement ( ) . execute ( ( ( "UPSERT<sp>INTO<sp>" + tableName ) + "<sp>VALUES<sp>('foo',1)" ) ) ; conn . commit ( ) ; } catch ( java . lang . Exception e ) { failedMsg [ 0 ] = e . getMessage ( ) ; throw new java . lang . RuntimeException ( e ) ; } finally { doneSignal . countDown ( ) ; } } } ; java . lang . Runnable r2 = new java . lang . Runnable ( ) { @ org . apache . phoenix . end2end . Override public void run ( ) { try { java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) ) ; conn . createStatement ( ) . execute ( ( ( "UPSERT<sp>INTO<sp>" + tableName ) + "<sp>VALUES<sp>('foo',2)" ) ) ; conn . commit ( ) ; } catch ( java . lang . Exception e ) { failedMsg [ 0 ] = e . getMessage ( ) ; throw new java . lang . RuntimeException ( e ) ; } finally { doneSignal . countDown ( ) ; } } } ; java . lang . Thread t1 = new java . lang . Thread ( r1 ) ; t1 . start ( ) ; java . lang . Thread t2 = new java . lang . Thread ( r2 ) ; t2 . start ( ) ; doneSignal . await ( ( ( org . apache . phoenix . end2end . ConcurrentMutationsIT . ROW_LOCK_WAIT_TIME ) + 5000 ) , TimeUnit . SECONDS ) ; long actualRowCount = org . apache . phoenix . util . IndexScrutiny . scrutinizeIndex ( conn , tableName , indexName ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 1 , actualRowCount )
testParseTreeWithNotExistingTemplate ( ) { info . smart_tools . smartactors . http_endpoint . deserialize_strategy_get . parse_tree . IParseTree tree = new info . smart_tools . smartactors . http_endpoint . deserialize_strategy_get . parse_tree . ParseTree ( ) ; tree . addTemplate ( "/home/:messageMapId/abrakadabra" ) ; java . util . Map < java . lang . String , java . lang . String > resultMap = tree . match ( "/notHome/123/abrakadabra" ) ; "<AssertPlaceHolder>" ; } match ( java . lang . String ) { info . smart_tools . smartactors . http_endpoint . deserialize_strategy_get . parse_tree . TreeObject treeObject = new info . smart_tools . smartactors . http_endpoint . deserialize_strategy_get . parse_tree . TreeObject ( 0 , java . util . Arrays . asList ( uri . split ( "/" ) ) ) ; info . smart_tools . smartactors . http_endpoint . deserialize_strategy_get . parse_tree . TreeObject resultObject = match ( treeObject ) ; return resultObject . isEnded ( ) ? resultObject . getResult ( ) : null ; }
org . junit . Assert . assertEquals ( resultMap , null )
testIsGetServableFromCache ( ) { final org . apache . hc . core5 . http . message . BasicHttpRequest request = new org . apache . hc . core5 . http . message . BasicHttpRequest ( "GET" , "someUri" ) ; "<AssertPlaceHolder>" ; } isServableFromCache ( org . apache . hc . core5 . http . HttpRequest ) { final java . lang . String method = request . getMethod ( ) ; final org . apache . hc . core5 . http . ProtocolVersion pv = ( ( request . getVersion ( ) ) != null ) ? request . getVersion ( ) : org . apache . hc . core5 . http . HttpVersion . DEFAULT ; if ( ( HttpVersion . HTTP_1_1 . compareToVersion ( pv ) ) != 0 ) { log . debug ( "non-HTTP/1.1<sp>request<sp>is<sp>not<sp>serveable<sp>from<sp>cache" ) ; return false ; } if ( ( ! ( method . equals ( HeaderConstants . GET_METHOD ) ) ) && ( ! ( method . equals ( HeaderConstants . HEAD_METHOD ) ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( ( method + "<sp>request<sp>is<sp>not<sp>serveable<sp>from<sp>cache" ) ) ; } return false ; } if ( ( request . countHeaders ( HeaderConstants . PRAGMA ) ) > 0 ) { log . debug ( "request<sp>with<sp>Pragma<sp>header<sp>is<sp>not<sp>serveable<sp>from<sp>cache" ) ; return false ; } final java . util . Iterator < org . apache . hc . core5 . http . HeaderElement > it = org . apache . hc . core5 . http . message . MessageSupport . iterate ( request , HeaderConstants . CACHE_CONTROL ) ; while ( it . hasNext ( ) ) { final org . apache . hc . core5 . http . HeaderElement cacheControlElement = it . next ( ) ; if ( HeaderConstants . CACHE_CONTROL_NO_STORE . equalsIgnoreCase ( cacheControlElement . getName ( ) ) ) { log . debug ( "Request<sp>with<sp>no-store<sp>is<sp>not<sp>serveable<sp>from<sp>cache" ) ; return false ; } if ( HeaderConstants . CACHE_CONTROL_NO_CACHE . equalsIgnoreCase ( cacheControlElement . getName ( ) ) ) { log . debug ( "Request<sp>with<sp>no-cache<sp>is<sp>not<sp>serveable<sp>from<sp>cache" ) ; return false ; } } log . debug ( "Request<sp>is<sp>serveable<sp>from<sp>cache" ) ; return true ; }
org . junit . Assert . assertTrue ( policy . isServableFromCache ( request ) )
testValidateIndexTypePropertyValue2 ( ) { com . liferay . dynamic . data . mapping . model . DDMForm ddmForm = com . liferay . dynamic . data . mapping . test . util . DDMFormTestUtil . createDDMForm ( "Field1" ) ; com . liferay . dynamic . data . mapping . test . util . DDMFormTestUtil . setIndexTypeProperty ( ddmForm , "none" ) ; com . liferay . dynamic . data . mapping . model . DDMStructure structure = ddmStructureTestHelper . addStructure ( ddmForm , StorageType . JSON . getValue ( ) ) ; com . liferay . dynamic . data . mapping . model . DDMStructure structureAfterUpdate = updateStructure ( structure ) ; com . liferay . dynamic . data . mapping . model . DDMForm ddmFormAfterUpdate = structureAfterUpdate . getDDMForm ( ) ; java . util . List < com . liferay . dynamic . data . mapping . model . DDMFormField > ddmFormFieldAfterUpdate = ddmFormAfterUpdate . getDDMFormFields ( ) ; com . liferay . dynamic . data . mapping . model . DDMFormField textFieldAfterUpdate = ddmFormFieldAfterUpdate . get ( 0 ) ; "<AssertPlaceHolder>" ; } getIndexType ( ) { return com . liferay . portal . kernel . util . MapUtil . getString ( _properties , "indexType" ) ; }
org . junit . Assert . assertEquals ( "none" , textFieldAfterUpdate . getIndexType ( ) )
testEquals ( ) { org . jfree . chart . plot . ColorPalette p1 = new org . jfree . chart . plot . GreyPalette ( ) ; org . jfree . chart . plot . ColorPalette p2 = new org . jfree . chart . plot . GreyPalette ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; mdz . hc . ProcessValue other = ( ( mdz . hc . ProcessValue ) ( obj ) ) ; if ( ( state ) != ( other . state ) ) return false ; if ( ( timestamp ) == null ) { if ( ( other . timestamp ) != null ) return false ; } else if ( ! ( timestamp . equals ( other . timestamp ) ) ) return false ; if ( ( value ) == null ) { if ( ( other . value ) != null ) return false ; } else if ( ! ( value . equals ( other . value ) ) ) return false ; return true ; }
org . junit . Assert . assertTrue ( p1 . equals ( p2 ) )
testGetTableMetadataWithDots ( ) { com . streamsets . pipeline . lib . jdbc . HikariPoolConfigBean config = createConfigBean ( ) ; com . zaxxer . hikari . HikariDataSource dataSource = com . streamsets . pipeline . lib . jdbc . TestJdbcUtil . jdbcUtil . createDataSourceForRead ( config ) ; java . sql . Connection connection = dataSource . getConnection ( ) ; java . sql . ResultSet resultSet = com . streamsets . pipeline . lib . jdbc . TestJdbcUtil . jdbcUtil . getTableMetadata ( connection , schema , tableNameWithSpecialChars ) ; "<AssertPlaceHolder>" ; } next ( ) { com . streamsets . pipeline . api . impl . Utils . checkState ( hasNext ( ) , "Iterator<sp>does<sp>not<sp>have<sp>more<sp>elements" ) ; return it . next ( ) ; }
org . junit . Assert . assertEquals ( true , resultSet . next ( ) )
testForeach00 ( ) { java . lang . String source = "var<sp>installedManifestsRefIds=[ref.getId()<sp>for<sp>each<sp>(ref<sp>in<sp>$installedManifestsRef)];" + ( ( "var<sp>installedManifestsCurIds=[cur.getId()<sp>for<sp>each<sp>(cur<sp>in<sp>$installedManifestsCur)];" + "[x<sp>for<sp>each<sp>(x<sp>in<sp>installedManifestsRefIds)<sp>if<sp>(installedManifestsCurIds.indexOf(x)==-1)].length==0<sp>" ) + "&&<sp>[x<sp>for<sp>each<sp>(x<sp>in<sp>installedManifestsCurIds)<sp>if<sp>(installedManifestsRefIds.indexOf(x)==-1)].length==0" ) ; com . ebay . cloud . cms . expression . IExpression expression = getEngine ( ) . compile ( source ) ; com . ebay . cloud . cms . expression . entity . SampleEntity entity = new com . ebay . cloud . cms . expression . entity . SampleEntity ( ) ; entity . addFieldValue ( "installedManifestsRef" , new com . ebay . cloud . cms . expression . impl . RhinoExpressionTest . ManifestSampleEntity [ ] { new com . ebay . cloud . cms . expression . impl . RhinoExpressionTest . ManifestSampleEntity ( "abc" ) , new com . ebay . cloud . cms . expression . impl . RhinoExpressionTest . ManifestSampleEntity ( "def" ) } ) ; entity . addFieldValue ( "installedManifestsCur" , new com . ebay . cloud . cms . expression . impl . RhinoExpressionTest . ManifestSampleEntity [ ] { new com . ebay . cloud . cms . expression . impl . RhinoExpressionTest . ManifestSampleEntity ( "abc" ) } ) ; com . ebay . cloud . cms . expression . IExpressionContext context = new com . ebay . cloud . cms . expression . entity . SampleEntityExpressionContext ( entity ) ; java . lang . Object result = getEngine ( ) . evaluate ( expression , context ) ; "<AssertPlaceHolder>" ; } evaluate ( com . ebay . cloud . cms . dal . search . impl . criteria . FieldSearchCriteria , java . util . List ) { java . util . List < java . lang . Object > criteriaValueList = criteria . getValueList ( ) ; boolean evalRes = false ; com . ebay . cloud . cms . dal . search . impl . criteria . FieldSearchCriteria . FieldOperatorEnum op = criteria . getOperator ( ) ; switch ( op ) { case IN : evalRes = evalIn ( fieldValues , criteriaValueList ) ; break ; case NIN : evalRes = evalNotIn ( fieldValues , criteriaValueList ) ; break ; default : throw new java . lang . IllegalArgumentException ( ( "Unsupport<sp>comparision<sp>operator:<sp>" + op ) ) ; } return evalRes ; }
org . junit . Assert . assertEquals ( false , result )
testSourceNat ( ) { long vlanId = 123 ; com . cloud . agent . api . to . IpAddressTO ip = new com . cloud . agent . api . to . IpAddressTO ( 1 , "1.2.3.4" , true , false , false , null , "1.2.3.1" , "255.255.255.0" , null , null , false ) ; com . cloud . agent . api . routing . SetSourceNatCommand cmd = new com . cloud . agent . api . routing . SetSourceNatCommand ( ip , true ) ; cmd . setContextParam ( NetworkElementCommand . GUEST_VLAN_TAG , java . lang . Long . toString ( vlanId ) ) ; cmd . setContextParam ( NetworkElementCommand . GUEST_NETWORK_CIDR , "1.2.3.4/32" ) ; _resource . setConnection ( _connection ) ; when ( _connection . login ( ) ) . thenReturn ( true ) ; when ( _connection . createTenantVDCNatPolicySet ( anyString ( ) ) ) . thenReturn ( true ) ; when ( _connection . createTenantVDCSourceNatPolicy ( anyString ( ) , anyString ( ) ) ) . thenReturn ( true ) ; when ( _connection . createTenantVDCSourceNatPolicyRef ( anyString ( ) , anyString ( ) ) ) . thenReturn ( true ) ; when ( _connection . createTenantVDCSourceNatIpPool ( anyString ( ) , anyString ( ) , anyString ( ) ) ) . thenReturn ( true ) ; when ( _connection . createTenantVDCSourceNatRule ( anyString ( ) , anyString ( ) , anyString ( ) , anyString ( ) ) ) . thenReturn ( true ) ; when ( _connection . associateNatPolicySet ( anyString ( ) ) ) . thenReturn ( true ) ; com . cloud . agent . api . Answer answer = _resource . executeRequest ( cmd ) ; System . out . println ( answer . getDetails ( ) ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return this . result ; }
org . junit . Assert . assertTrue ( answer . getResult ( ) )
accessDeniedTest ( ) { "<AssertPlaceHolder>" ; } doAccessDenied ( ) { return org . sentilo . web . catalog . utils . Constants . VIEW_ERROR_ACCESS_NOT_ALLOWED ; }
org . junit . Assert . assertEquals ( Constants . VIEW_ERROR_ACCESS_NOT_ALLOWED , controller . doAccessDenied ( ) )
shouldFetchOrderSetMemberByUuid ( ) { java . lang . String orderSetUuid = "2d3fb1d0-ae06-22e3-a5e2-0140211c2002" ; executeDataSet ( org . openmrs . api . OrderSetServiceTest . ORDER_SET ) ; org . openmrs . OrderSetMember orderSetMember = orderSetService . getOrderSetMemberByUuid ( orderSetUuid ) ; "<AssertPlaceHolder>" ; } getId ( ) { return getLocationAttributeTypeId ( ) ; }
org . junit . Assert . assertNotNull ( orderSetMember . getId ( ) )
testDatumEindeInHetVerleden ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > meldingen = brby0012 . voerRegelUit ( null , null , nl . bzk . brp . bijhouding . business . regels . util . ActieBerichtBuilder . bouwNieuweActie ( SoortActie . REGISTRATIE_NATIONALITEIT ) . setDatumEinde ( new nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumEvtDeelsOnbekendAttribuut ( nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumAttribuut . gisteren ( ) ) ) . getActie ( ) , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) )
testSetLocalTimeWithoutType ( ) { java . time . LocalTime data = java . time . LocalTime . parse ( "16:21:51" ) ; java . sql . Time actual = insertThenReadWithoutType ( data , "time_without_time_zone_column" , java . sql . Time . class ) ; java . sql . Time expected = java . sql . Time . valueOf ( "16:21:51" ) ; "<AssertPlaceHolder>" ; } valueOf ( int ) { for ( com . impossibl . postgres . api . jdbc . PGType pgType : com . impossibl . postgres . api . jdbc . PGType . values ( ) ) { if ( ( ( pgType . oid ) != null ) && ( ( pgType . oid ) == oid ) ) return pgType ; } throw new java . lang . IllegalArgumentException ( ( ( "PostgreSQL<sp>Type:" + oid ) + "<sp>is<sp>not<sp>a<sp>valid<sp>PGType<sp>value." ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
shouldCopyStreamsLargerThanBufferSize ( ) { final byte [ ] expected = new byte [ 17 * 1024 ] ; java . util . Arrays . fill ( expected , ( ( byte ) ( 2 ) ) ) ; final java . io . ByteArrayInputStream bis = new java . io . ByteArrayInputStream ( expected ) ; final byte [ ] actual = org . pitest . highwheel . util . StreamUtil . streamToByteArray ( bis ) ; "<AssertPlaceHolder>" ; } streamToByteArray ( java . io . InputStream ) { final java . io . ByteArrayOutputStream result = new java . io . ByteArrayOutputStream ( ) ; org . pitest . highwheel . util . StreamUtil . copy ( in , result ) ; return result . toByteArray ( ) ; }
org . junit . Assert . assertArrayEquals ( expected , actual )
testIsConfiguredWithGatewayConfig ( ) { boolean isConfigured = smsMessageSender . isConfigured ( ) ; "<AssertPlaceHolder>" ; } isConfigured ( ) { return getEmailConfiguration ( ) . isOk ( ) ; }
org . junit . Assert . assertTrue ( isConfigured )
testNoScanOnEmptyStyle ( ) { org . geotools . styling . StyleBuilder sb = new org . geotools . styling . StyleBuilder ( ) ; org . geotools . styling . Style style = sb . createStyle ( sb . createPolygonSymbolizer ( ) ) ; style . featureTypeStyles ( ) . get ( 0 ) . rules ( ) . get ( 0 ) . setMaxScaleDenominator ( 1000 ) ; final org . geotools . feature . DefaultFeatureCollection fc = new org . geotools . feature . DefaultFeatureCollection ( ) ; org . geotools . map . FeatureLayer layer = new org . geotools . map . FeatureLayer ( fc , style ) ; org . geoserver . wms . WMSMapContent mc = createNiceMock ( org . geoserver . wms . WMSMapContent . class ) ; expect ( mc . getScaleDenominator ( ) ) . andReturn ( 2000.0 ) . anyTimes ( ) ; replay ( mc ) ; org . geoserver . kml . KmlEncodingContext context = createNiceMock ( org . geoserver . kml . KmlEncodingContext . class ) ; expect ( context . openIterator ( anyObject ( org . geotools . data . simple . SimpleFeatureCollection . class ) ) ) . andThrow ( new junit . framework . AssertionFailedError ( "Should<sp>not<sp>have<sp>called<sp>openIterator" ) ) . anyTimes ( ) ; expect ( context . getCurrentFeatureCollection ( ) ) . andReturn ( fc ) . anyTimes ( ) ; expect ( context . getMapContent ( ) ) . andReturn ( mc ) . anyTimes ( ) ; replay ( context ) ; org . geoserver . kml . iterator . FeatureIteratorFactory sf = new org . geoserver . kml . iterator . FeatureIteratorFactory ( context , layer ) ; java . util . Iterator < de . micromata . opengis . kml . v_2_2_0 . Feature > sequence = sf . newIterator ( ) ; "<AssertPlaceHolder>" ; } next ( ) { return featureCache . get ( ( ( featureIndex ) ++ ) ) ; }
org . junit . Assert . assertNull ( sequence . next ( ) )
testCloning ( ) { com . flowpowered . math . vector . Vector4d vector = new com . flowpowered . math . vector . Vector4d ( 3 , 2 , 5 , 6 ) ; "<AssertPlaceHolder>" ; } clone ( ) { return new com . flowpowered . math . vector . Vector4l ( this ) ; }
org . junit . Assert . assertEquals ( vector , vector . clone ( ) )
testGetParentItem ( ) { createTreeItems ( tree . getSWTWidget ( ) ) ; org . eclipse . reddeer . swt . impl . tree . DefaultTreeItem dfi = new org . eclipse . reddeer . swt . impl . tree . DefaultTreeItem ( "A" , "AA" ) ; org . eclipse . reddeer . swt . api . TreeItem parentItem = dfi . getParentItem ( ) ; "<AssertPlaceHolder>" ; } getText ( ) { return org . eclipse . reddeer . common . util . Display . syncExec ( new org . eclipse . reddeer . common . util . ResultRunnable < java . lang . String > ( ) { @ org . eclipse . reddeer . swt . test . keyboard . Override public java . lang . String run ( ) { return text . getText ( ) ; } } ) ; }
org . junit . Assert . assertEquals ( "A" , parentItem . getText ( ) )
testRotPar ( ) { java . lang . String templates = "foo()<sp>::=<sp>\"<a,b:t(),u()>\"\n" ; writeFile ( tmpdir , "t.stg" , templates ) ; org . stringtemplate . v4 . STGroupFile group ; org . stringtemplate . v4 . STErrorListener errors = new org . stringtemplate . v4 . misc . ErrorBuffer ( ) ; group = new org . stringtemplate . v4 . STGroupFile ( ( ( ( tmpdir ) + "/" ) + "t.stg" ) ) ; group . setListener ( errors ) ; group . load ( ) ; java . lang . String expected = "t.stg<sp>1:19:<sp>mismatched<sp>input<sp>','<sp>expecting<sp>RDELIM" + ( newline ) ; java . lang . String result = errors . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( getClass ( ) . getSimpleName ( ) ) + "{" ) + "self=" ) + ( scope . st ) ) + ",<sp>start=" ) + ( outputStartChar ) ) + ",<sp>stop=" ) + ( outputStopChar ) ) + '}' ; }
org . junit . Assert . assertEquals ( expected , result )
testNagativeCase ( ) { int actual = org . psjava . algo . sequence . search . BinarySearchFirst . search ( org . psjava . algo . sequence . search . BinarySearchFirstTest . NS , new java . util . function . Function < java . lang . Integer , java . lang . Integer > ( ) { @ org . psjava . algo . sequence . search . Override public org . psjava . algo . sequence . search . Integer apply ( java . lang . Integer key ) { return key ; } } , new org . psjava . util . DefaultComparator < java . lang . Integer > ( ) , ( - 10000 ) , 10000 , ( - 1000 ) , null ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . Integer ) { return x * 8 ; }
org . junit . Assert . assertEquals ( ( - 1000 ) , actual )
testNoMatchesNoExceptions ( ) { org . apache . metron . parsers . json . JSONMapParser parser = new org . apache . metron . parsers . json . JSONMapParser ( ) ; parser . configure ( new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( JSONMapParser . JSONP_QUERY , "$.foo" ) ; } } ) ; java . util . List < org . json . simple . JSONObject > output = parser . parse ( org . apache . metron . parsers . json . JSONMapParserQueryTest . JSON_SINGLE . getBytes ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( java . util . Map m : variableMappings ) { size += m . size ( ) ; } return size ; }
org . junit . Assert . assertEquals ( 0 , output . size ( ) )
testMaakentityConvertorBuitenlandsePlaatsGeboorte ( ) { nl . bzk . migratiebrp . test . brpnaarlo3 . adapter . ConverterContext ctx = createContext ( nl . bzk . migratiebrp . test . brpnaarlo3 . adapter . entity . IstStapelVoorkomenConverterTest . MINIMAAL ) ; converter . convertInhoudelijk ( ctx , IstStapelVoorkomenConverter . HEADER_BUITENLANDSE_PLAATS_GEBOORTE , buitenlandsePlaatsGeboorte ) ; converter . maakEntity ( ctx ) ; nl . bzk . algemeenbrp . dal . domein . brp . entity . StapelVoorkomen stapelVoorkomen = ctx . getStapel ( java . lang . Integer . parseInt ( volgnummer ) ) . getStapelvoorkomens ( ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } getBuitenlandsePlaatsGeboorte ( ) { return buitenlandsePlaatsGeboorte ; }
org . junit . Assert . assertEquals ( buitenlandsePlaatsGeboorte , stapelVoorkomen . getBuitenlandsePlaatsGeboorte ( ) )
whenAllEntitiesAreRetrieved_thenTheResultIsNotNull ( ) { final java . util . List < T > entities = getApi ( ) . findAll ( ) ; "<AssertPlaceHolder>" ; } getApi ( ) { return repository ; }
org . junit . Assert . assertNotNull ( entities )
testValidItemWithQualifier ( ) { java . lang . String id = "634e8505-bd4b-436e-97e8-2045d1b0d265" . replace ( "-" , "" ) ; java . lang . String qualifier = "zoom-and-enhanced-overview" ; ddf . catalog . content . data . ContentItem item = new ddf . catalog . content . data . impl . ContentItemImpl ( id , qualifier , null , "" , null ) ; "<AssertPlaceHolder>" ; } validate ( ddf . catalog . content . data . ContentItem ) { if ( ( item == null ) || ( org . apache . commons . lang . StringUtils . isBlank ( item . getUri ( ) ) ) ) { return false ; } if ( org . apache . commons . lang . StringUtils . isNotBlank ( item . getQualifier ( ) ) ) { boolean qualifierValid = ddf . catalog . content . data . impl . ContentItemValidator . validateInput ( item . getQualifier ( ) , ddf . catalog . content . data . impl . ContentItemValidator . QUALIFIER_PATTERN ) ; if ( ! qualifierValid ) { return false ; } } if ( ddf . catalog . content . data . impl . ContentItemValidator . CONTENT_PATTERN . matcher ( item . getUri ( ) ) . matches ( ) ) { return true ; } return false ; }
org . junit . Assert . assertThat ( ddf . catalog . content . data . impl . ContentItemValidator . validate ( item ) , org . hamcrest . Matchers . is ( true ) )
testToPDB_0args ( ) { java . lang . String expResult = ( ( "SITE<sp>1<sp>AC1<sp>6<sp>ARG<sp>H<sp>221A<sp>LYS<sp>H<sp>224<sp>HOH<sp>H<sp>403<sp>HOH<sp>H<sp>460<sp>" + ( org . biojava . nbio . structure . SiteTest . newline ) ) + "SITE<sp>2<sp>AC1<sp>6<sp>HOH<sp>H<sp>464<sp>HOH<sp>H<sp>497<sp>" ) + ( org . biojava . nbio . structure . SiteTest . newline ) ; java . lang . String result = org . biojava . nbio . structure . SiteTest . bindingSite . toPDB ( ) ; "<AssertPlaceHolder>" ; } toPDB ( ) { java . lang . StringBuffer buf = new java . lang . StringBuffer ( ) ; toPDB ( buf ) ; return buf . toString ( ) ; }
org . junit . Assert . assertEquals ( expResult , result )
writeAppendsKeyCorrectly ( ) { rand . id = "1" ; "<AssertPlaceHolder>" ; } write ( java . lang . Object ) { org . springframework . data . redis . core . convert . RedisData rdo = new org . springframework . data . redis . core . convert . RedisData ( ) ; converter . write ( source , rdo ) ; return rdo ; }
org . junit . Assert . assertThat ( write ( rand ) . getId ( ) , is ( "1" ) )
test_boolean_stream ( ) { boolean testValue = false ; org . omg . CORBA . Any any = setup . getClientOrb ( ) . create_any ( ) ; any . type ( setup . getClientOrb ( ) . get_primitive_tc ( TCKind . tk_boolean ) ) ; any . create_output_stream ( ) . write_boolean ( testValue ) ; boolean outValue = any . extract_boolean ( ) ; "<AssertPlaceHolder>" ; } extract_boolean ( ) { checkExtract ( TCKind . _tk_boolean , "Cannot<sp>extract<sp>boolean" ) ; checkNull ( ) ; if ( ( value ) instanceof java . lang . Boolean ) { return ( ( java . lang . Boolean ) ( value ) ) . booleanValue ( ) ; } else if ( ( value ) instanceof org . omg . CORBA . BooleanHolder ) { return ( ( org . omg . CORBA . BooleanHolder ) ( value ) ) . value ; } else if ( ( value ) instanceof org . jacorb . orb . CDROutputStream ) { return create_input_stream ( ) . read_boolean ( ) ; } else { throw new org . omg . CORBA . INTERNAL ( ( "Encountered<sp>unexpected<sp>type<sp>of<sp>value:<sp>" + ( value . getClass ( ) ) ) ) ; } }
org . junit . Assert . assertEquals ( testValue , outValue )
testGetTaskCount_1 ( ) { org . audit4j . core . util . StopWatch fixture = new org . audit4j . core . util . StopWatch ( "" ) ; fixture . setKeepTaskList ( true ) ; fixture . start ( "" ) ; halt ( ) ; fixture . stop ( ) ; int result = fixture . getTaskCount ( ) ; "<AssertPlaceHolder>" ; } getTaskCount ( ) { return this . taskCount ; }
org . junit . Assert . assertEquals ( 1 , result )
testSubDomainSameAuthority ( ) { java . net . URI current = java . net . URI . create ( "ws://hr.benefits.example.com:8001/echo" ) ; java . net . URI redirect = java . net . URI . create ( "ws://hr.benefits.example.com:8001/echo/;e/cbm" ) ; int status = HttpRedirectPolicy . SUB_DOMAIN . compare ( current , redirect ) ; "<AssertPlaceHolder>" ; } create ( java . lang . Class ) { return org . kaazing . net . auth . ChallengeHandler . load0 ( clazz , java . util . ServiceLoader . load ( clazz ) ) ; }
org . junit . Assert . assertTrue ( ( status == 0 ) )
testSomeValues ( ) { final double a = - 1.2 ; final double w = 0.34 ; final double p = 5.6 ; final org . hipparchus . analysis . UnivariateFunction f = new org . hipparchus . analysis . function . HarmonicOscillator ( a , w , p ) ; final double d = 0.12345 ; for ( int i = 0 ; i < 10 ; i ++ ) { final double v = i * d ; "<AssertPlaceHolder>" ; } } cos ( double ) { int quadrant = 0 ; double xb = 0 ; if ( xa > 3294198.0 ) { double [ ] reduceResults = new double [ 3 ] ; org . hipparchus . util . FastMath . reducePayneHanek ( xa , reduceResults ) ; quadrant = ( ( int ) ( reduceResults [ 0 ] ) ) & 3 ; xa = reduceResults [ 1 ] ; xb = reduceResults [ 2 ] ; } else if ( xa > 1.5707963267948966 ) { final org . hipparchus . util . FastMath . CodyWaite cw = new org . hipparchus . util . FastMath . CodyWaite ( xa ) ; quadrant = ( cw . getK ( ) ) & 3 ; xa = cw . getRemA ( ) ; xb = cw . getRemB ( ) ; } switch ( quadrant ) { case 0 : return org . hipparchus . util . FastMath . cosQ ( xa , xb ) ; case 1 : return - ( org . hipparchus . util . FastMath . sinQ ( xa , xb ) ) ; case 2 : return - ( org . hipparchus . util . FastMath . cosQ ( xa , xb ) ) ; case 3 : return org . hipparchus . util . FastMath . sinQ ( xa , xb ) ; default : return Double . NaN ; } }
org . junit . Assert . assertEquals ( ( a * ( org . hipparchus . util . FastMath . cos ( ( ( w * v ) + p ) ) ) ) , f . value ( v ) , 0 )
verifyEditableByOwnernWhenDifferentOwnerIsEditingForeignableFieldOfExistingForeignableObjectButHasChuckNorrisRoleShouldNotThrowException2 ( ) { ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner deletingOwner = ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner . MAIA ; ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner foreignableOwner = ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner . AMW ; int unchangedForeignable = new ch . puzzle . itc . mobiliar . builders . ResourceEntityBuilder ( ) . withOwner ( foreignableOwner ) . withId ( 1 ) . build ( ) . foreignableFieldHashCode ( ) ; ch . puzzle . itc . mobiliar . business . foreignable . entity . Foreignable < ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceEntity > changedForeignable = new ch . puzzle . itc . mobiliar . builders . ResourceEntityBuilder ( ) . withOwner ( foreignableOwner ) . withName ( "changed<sp>foreignable<sp>field" ) . withId ( 1 ) . build ( ) ; when ( permissionServiceMock . hasPermission ( Permission . IGNORE_FOREIGNABLE_OWNER ) ) . thenReturn ( true ) ; foreignableService . verifyEditableByOwner ( deletingOwner , unchangedForeignable , changedForeignable ) ; "<AssertPlaceHolder>" ; } verifyEditableByOwner ( ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwner , int , ch . puzzle . itc . mobiliar . business . foreignable . entity . Foreignable ) { if ( ( ( ! ( isNewObject ( afterChangeForeignable ) ) ) && ( ! ( isForeignableModifiableByOwner ( editingOwner , afterChangeForeignable ) ) ) ) && ( ! ( hasOnlyDecorationsChanged ( beforeChangeForeignableHashCode , afterChangeForeignable ) ) ) ) { throw new ch . puzzle . itc . mobiliar . business . foreignable . entity . ForeignableOwnerViolationException ( afterChangeForeignable , editingOwner , "Edit<sp>foreignable<sp>object<sp>not<sp>allowed<sp>by<sp>this<sp>owner" ) ; } }
org . junit . Assert . assertTrue ( true )
testNewLine ( ) { @ org . jetbrains . annotations . NotNull final java . lang . String expected = "\n" ; @ org . jetbrains . annotations . NotNull final net . openhft . chronicle . wire . Wire wire = wireFactory ( ) ; wire . write ( ) . text ( expected ) ; "<AssertPlaceHolder>" ; } read ( ) { readField ( acquireStringBuilder ( ) , null , net . openhft . chronicle . wire . BinaryWire . AnyCodeMatch . ANY_CODE_MATCH . code ( ) ) ; return ( bytes . readRemaining ( ) ) <= 0 ? acquireDefaultValueIn ( ) : valueIn ; }
org . junit . Assert . assertEquals ( expected , wire . read ( ) . text ( ) )
testValidateFunctionAndOperator ( ) { net . objecthunter . exp4j . Expression exp = new net . objecthunter . exp4j . ExpressionBuilder ( "sin(x<sp>+<sp>1<sp>+<sp>2)" ) . variable ( "x" ) . build ( ) ; net . objecthunter . exp4j . ValidationResult result = exp . validate ( false ) ; "<AssertPlaceHolder>" ; } isValid ( ) { return valid ; }
org . junit . Assert . assertTrue ( result . isValid ( ) )
givenCollectionOfNames_whenUsingIteratorToRemoveAllNamesStartingWithLetterA_finalListShouldContainNoNamesStartingWithLetterA ( ) { com . baeldung . removal . Iterator < java . lang . String > i = names . iterator ( ) ; while ( i . hasNext ( ) ) { java . lang . String e = i . next ( ) ; if ( e . startsWith ( "A" ) ) { i . remove ( ) ; } } "<AssertPlaceHolder>" ; } remove ( ) { com . baeldung . jhipster . gateway . security . oauth2 . CookieCollection cookies = new com . baeldung . jhipster . gateway . security . oauth2 . CookieCollection ( cookie , brownieCookie , cupsCookie ) ; cookies . remove ( cookie ) ; org . junit . Assert . assertEquals ( 2 , cookies . size ( ) ) ; org . junit . Assert . assertFalse ( cookies . contains ( cookie ) ) ; org . junit . Assert . assertFalse ( cookies . contains ( com . baeldung . jhipster . gateway . security . oauth2 . CookieCollectionTest . COOKIE_NAME ) ) ; org . junit . Assert . assertTrue ( cookies . contains ( brownieCookie ) ) ; org . junit . Assert . assertTrue ( cookies . contains ( com . baeldung . jhipster . gateway . security . oauth2 . CookieCollectionTest . BROWNIE_NAME ) ) ; }
org . junit . Assert . assertThat ( names , org . hamcrest . Matchers . is ( expected ) )
testQuadPatternInGraphComplex01 ( ) { java . lang . Object [ ] result = org . apache . jena . sparql . algebra . TestOpAsQuery . roundTripQueryQuad ( "SELECT<sp>*<sp>WHERE<sp>{<sp>GRAPH<sp><http://example><sp>{<sp>?s<sp>a<sp>?type<sp>.<sp>OPTIONAL<sp>{<sp>?s<sp><http://label><sp>?label<sp>}<sp>}<sp>}" ) ; "<AssertPlaceHolder>" ; } roundTripQueryQuad ( java . lang . String ) { org . apache . jena . query . Query orig = org . apache . jena . query . QueryFactory . create ( query , Syntax . syntaxSPARQL_11 ) ; org . apache . jena . sparql . algebra . Op toReconstruct = org . apache . jena . sparql . algebra . Algebra . compile ( orig ) ; toReconstruct = org . apache . jena . sparql . algebra . Algebra . toQuadForm ( toReconstruct ) ; org . apache . jena . query . Query got = org . apache . jena . sparql . algebra . OpAsQuery . asQuery ( toReconstruct ) ; org . apache . jena . query . Query [ ] r = new org . apache . jena . query . Query [ ] { orig , got } ; return r ; }
org . junit . Assert . assertFalse ( result [ 0 ] . equals ( result [ 1 ] ) )
zonedDateTime ( ) { java . time . ZonedDateTime zonedDateTime = java . time . ZonedDateTime . of ( 2016 , 2 , 24 , 6 , 10 , 9 , 5 , java . time . ZoneOffset . ofHours ( 6 ) ) ; javax . ws . rs . ext . ParamConverter < java . time . ZonedDateTime > converter = ( ( javax . ws . rs . ext . ParamConverter < java . time . ZonedDateTime > ) ( provider . getConverter ( zonedDateTime . getClass ( ) , zonedDateTime . getClass ( ) , zonedDateTime . getClass ( ) . getAnnotations ( ) ) ) ) ; "<AssertPlaceHolder>" ; } fromString ( java . lang . String ) { return null ; }
org . junit . Assert . assertEquals ( zonedDateTime , converter . fromString ( converter . toString ( zonedDateTime ) ) )
testAbstractMethodOnClassNoErrors_withAllowAbstractClassesEnabled ( ) { java . lang . String [ ] imports = new java . lang . String [ ] { } ; java . lang . String [ ] declarations = new java . lang . String [ ] { } ; java . lang . String [ ] testCode = new java . lang . String [ ] { } ; java . lang . String [ ] extra = new java . lang . String [ ] { "abstract<sp>class<sp>A<sp>{" , "public<sp>abstract<sp>function<sp>a():void;" , "}" } ; java . lang . String source = getAS ( imports , declarations , testCode , extra ) ; java . lang . String [ ] options = new java . lang . String [ ] { "-allow-abstract-classes=true" } ; java . io . File tempASFile = generateTempFile ( source ) ; java . lang . String result = compile ( tempASFile , source , false , false , false , options , true ) ; "<AssertPlaceHolder>" ; } compile ( java . io . File , java . lang . String , boolean , boolean , boolean , java . lang . String [ ] , boolean ) { System . out . println ( "Generating<sp>test:" ) ; as . ITestAdapter testAdapter = as . TestAdapterFactory . getTestAdapter ( ) ; java . util . List < java . lang . String > swcs = new java . util . ArrayList < java . lang . String > ( ) ; if ( withFramework ) { swcs . add ( testAdapter . getFlexArtifact ( "framework" ) . getPath ( ) ) ; swcs . add ( testAdapter . getFlexArtifactResourceBundle ( "framework" ) . getPath ( ) ) ; } if ( withRPC ) { swcs . add ( testAdapter . getFlexArtifact ( "spark" 5 ) . getPath ( ) ) ; swcs . add ( testAdapter . getFlexArtifactResourceBundle ( "spark" 5 ) . getPath ( ) ) ; } if ( withSpark ) { swcs . add ( testAdapter . getFlexArtifact ( "spark" ) . getPath ( ) ) ; swcs . add ( testAdapter . getFlexArtifactResourceBundle ( "spark" ) . getPath ( ) ) ; } java . util . List < java . lang . String > args = new java . util . ArrayList < java . lang . String > ( ) ; if ( hasFlashPlayerGlobal ) args . add ( ( "-external-library-path=" + ( testAdapter . getPlayerglobal ( ) . getPath ( ) ) ) ) ; else { java . lang . String jsSwcPath = as . FilenameNormalization . normalize ( "spark" 1 ) ; args . add ( ( "-external-library-path=" + jsSwcPath ) ) ; } if ( ( swcs . size ( ) ) > 0 ) { java . lang . String libraryPath = "-library-path=" + ( as . StringUtils . join ( swcs . toArray ( new java . lang . String [ swcs . size ( ) ] ) , "spark" 4 ) ) ; args . add ( libraryPath ) ; } if ( ( withFramework || withRPC ) || withSpark ) args . add ( ( ( ( "-namespace=" + ( as . ASFeatureTestsBase . NAMESPACE_2009 ) ) + "spark" 4 ) + ( testAdapter . getFlexManifestPath ( "spark" 2 ) ) ) ) ; if ( otherOptions != null ) { java . util . Collections . addAll ( args , otherOptions ) ; } args . add ( tempASFile . getAbsolutePath ( ) ) ; org . apache . royale . compiler . clients . MXMLC mxmlc = new org . apache . royale . compiler . clients . MXMLC ( ) ; java . lang . StringBuffer cmdLine = new java . lang . StringBuffer ( ) ; for ( java . lang . String arg : args ) { cmdLine . append ( arg ) . append ( "<sp>" ) ; } System . out . println ( ( "Compiling<sp>test:\n" + ( cmdLine . toString ( ) ) ) ) ; int exitCode = mxmlc . mainNoExit ( args . toArray ( new java . lang . String [ args . size ( ) ] ) ) ; java . util . List < org . apache . royale . compiler . problems . ICompilerProblem > problems = mxmlc . getProblems ( ) . getProblems ( ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ( checkExitCode && ( ( problems . size ( ) ) > 0 ) ? "Unexpected<sp>compilation<sp>problems:\n" : "spark" 0 ) ) ; for ( org . apache . royale . compiler . problems . ICompilerProblem problem : problems ) { sb . append ( problem . toString ( ) ) ; sb . append ( '\n' ) ; } System . out . println ( ( "spark" 3 + ( sb . toString ( ) ) ) ) ; if ( checkExitCode ) org . junit . Assert . assertThat ( sb . toString ( ) , exitCode , org . hamcrest . core . Is . is ( 0 ) ) ; return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( "" , result )
getAllUsersOfAnUnaccessibleGivenGroupWithSemiDomainIsolation ( ) { try { com . stratelia . webactiv . util . GeneralPropertiesManagerHelper . setDomainVisibility ( DomainProperties . DVIS_ONE ) ; com . stratelia . webactiv . beans . admin . Group aGroup = getTestResources ( ) . getAGroupNotInAnInternalDomain ( ) ; currentUser . setDomainId ( ( ( aGroup . getDomainId ( ) ) + "0" ) ) ; java . util . List < ? extends com . stratelia . webactiv . beans . admin . UserDetail > expectedUsers = aGroup . getAllUsers ( ) ; getAt ( ( ( ( aResourceURI ( ) ) + "?group=" ) + ( aGroup . getId ( ) ) ) , getWebEntityClass ( ) ) ; org . junit . Assert . fail ( "The<sp>user<sp>shouldn't<sp>be<sp>get<sp>as<sp>it<sp>is<sp>unaccessible" ) ; } catch ( com . sun . jersey . api . client . UniformInterfaceException ex ) { int receivedStatus = ex . getResponse ( ) . getStatus ( ) ; int forbidden = Response . Status . FORBIDDEN . getStatusCode ( ) ; "<AssertPlaceHolder>" ; } } is ( T ) { return java . util . Objects . equals ( this . value , value ) ; }
org . junit . Assert . assertThat ( receivedStatus , org . hamcrest . Matchers . is ( forbidden ) )
testInsertNestedItemDefinitionWhenAbsoluteParentIsPresent ( ) { final org . kie . workbench . common . dmn . client . editors . types . common . DataType reference = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; final org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition relativeParent = mock ( org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition . class ) ; final java . util . Optional < org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition > absoluteParent = java . util . Optional . of ( mock ( org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition . class ) ) ; final java . util . List < org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition > itemDefinitions = new java . util . ArrayList ( ) ; final java . lang . String referenceUUID = "referenceUUID" ; when ( itemDefinitionStore . get ( referenceUUID ) ) . thenReturn ( relativeParent ) ; when ( reference . getUUID ( ) ) . thenReturn ( referenceUUID ) ; when ( absoluteParent . get ( ) . getItemComponent ( ) ) . thenReturn ( itemDefinitions ) ; doReturn ( absoluteParent ) . when ( handler ) . lookupAbsoluteParent ( referenceUUID ) ; final org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition nestedItemDefinition = handler . insertNestedItemDefinition ( reference ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return itemDefinitions . get ( uuid ) ; }
org . junit . Assert . assertEquals ( nestedItemDefinition , itemDefinitions . get ( 0 ) )
getContextNullTest ( ) { when ( myApp . getApplicationContextLocal ( ) ) . thenReturn ( null ) ; myApp . onCreate ( ) ; "<AssertPlaceHolder>" ; } getContext ( ) { return org . mewx . wenku8 . MyApp . context ; }
org . junit . Assert . assertNull ( org . mewx . wenku8 . MyApp . getContext ( ) )
testEmptyConstructor ( ) { org . pentaho . platform . config . AppConfigException ex = new org . pentaho . platform . config . AppConfigException ( ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; }
org . junit . Assert . assertEquals ( null , ex . getMessage ( ) )
testTranslateContextSuccessfull6 ( ) { ichunk . setContext ( ExplanationChunk . VERY_NEGATIVE ) ; java . lang . String expResult = "VERY_NEGATIVE" ; java . lang . String result = org . goodoldai . jeff . report . pdf . RTFChunkUtility . translateContext ( ichunk ) ; "<AssertPlaceHolder>" ; } translateContext ( org . goodoldai . jeff . explanation . ExplanationChunk ) { if ( echunk == null ) { throw new org . goodoldai . jeff . explanation . ExplanationException ( "The<sp>entered<sp>chunk<sp>must<sp>not<sp>be<sp>null" ) ; } java . lang . Class cl = org . goodoldai . jeff . explanation . ExplanationChunk . class ; java . lang . reflect . Field [ ] fields = cl . getDeclaredFields ( ) ; try { for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { java . lang . reflect . Field field = fields [ i ] ; if ( ( java . lang . reflect . Modifier . isPublic ( field . getModifiers ( ) ) ) && ( ( field . getInt ( field . getName ( ) ) ) == ( echunk . getContext ( ) ) ) ) { return field . getName ( ) ; } } return null ; } catch ( java . lang . Exception e ) { throw new org . goodoldai . jeff . explanation . ExplanationException ( e . getMessage ( ) ) ; } }
org . junit . Assert . assertEquals ( expResult , result )
createPortletProvider ( ) { wizardAction . openNewLiferayModuleWizard ( ) ; wizardAction . newModule . prepareMaven ( project . getName ( ) , com . liferay . ide . ui . module . tests . PORTLET_PROVIDER ) ; wizardAction . finish ( ) ; jobAction . waitForNoRunningJobs ( ) ; viewAction . project . openUpdateMavenProjectDialog ( com . liferay . ide . ui . module . tests . NewModuleProjectWizardLiferayWorkspaceMavenTests . liferayWorkspace . getName ( ) ) ; dialogAction . updateMavenProject . selectAll ( ) ; dialogAction . confirm ( ) ; jobAction . waitForUpdateMavenProject ( ) ; "<AssertPlaceHolder>" ; viewAction . project . closeAndDeleteFromDisk ( com . liferay . ide . ui . module . tests . NewModuleProjectWizardLiferayWorkspaceMavenTests . liferayWorkspace . getModuleFiles ( project . getName ( ) ) ) ; } visibleFileTry ( java . lang . String [ ] ) { try { return _getProjects ( ) . isVisible ( files ) ; } catch ( java . lang . Exception e ) { _getProjects ( ) . setFocus ( ) ; try { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - 1 ) ) ; _getProjects ( ) . expand ( parents ) ; _getProjects ( ) . contextMenu ( com . liferay . ide . ui . liferay . action . REFRESH , parents ) ; ide . sleep ( 2000 ) ; } catch ( java . lang . Exception e1 ) { } for ( int i = ( files . length ) - 1 ; i > 0 ; i -- ) { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - i ) ) ; org . eclipse . swtbot . swt . finder . widgets . SWTBotTreeItem parent = _getProjects ( ) . getTreeItem ( parents ) ; _getProjects ( ) . expand ( parents ) ; java . lang . String subnode = files [ ( ( files . length ) - i ) ] ; _jobAction . waitForSubnode ( parent , subnode , com . liferay . ide . ui . liferay . action . REFRESH ) ; } return _getProjects ( ) . isVisible ( files ) ; } }
org . junit . Assert . assertTrue ( viewAction . project . visibleFileTry ( com . liferay . ide . ui . module . tests . NewModuleProjectWizardLiferayWorkspaceMavenTests . liferayWorkspace . getModuleFiles ( project . getName ( ) ) ) )
testRemove ( ) { com . liferay . dynamic . data . mapping . model . DDMContent newDDMContent = addDDMContent ( ) ; _persistence . remove ( newDDMContent ) ; com . liferay . dynamic . data . mapping . model . DDMContent existingDDMContent = _persistence . fetchByPrimaryKey ( newDDMContent . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertNull ( existingDDMContent )
test_valueOf ( ) { java . lang . String param1 = "BIGINT" ; cn . org . rapid_framework . generator . util . typemapping . JdbcType result = jdbcType . valueOf ( param1 ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . String ) { return newMoneyWithCent ( java . lang . Long . parseLong ( s ) ) ; }
org . junit . Assert . assertNotNull ( result )
test ( ) { org . onetwo . boot . plugin . AnnotationUtilsTest . AnnotationTest inst = org . springframework . core . annotation . AnnotationUtils . getAnnotation ( org . onetwo . boot . plugin . AnnotationUtilsTest . class , org . onetwo . boot . plugin . AnnotationUtilsTest . AnnotationTest . class ) ; java . util . Map < java . lang . String , java . lang . Object > attrs = org . springframework . core . annotation . AnnotationUtils . getAnnotationAttributes ( inst ) ; System . out . println ( ( "attrs:" + attrs ) ) ; "<AssertPlaceHolder>" ; } get ( java . io . Serializable ) { return this . cache . get ( key ) ; }
org . junit . Assert . assertEquals ( "test" , attrs . get ( "name" ) )
testShutdownReliableEndpoint ( ) { manager = new org . apache . cxf . ws . rm . RMManager ( ) ; org . apache . cxf . endpoint . Endpoint e = control . createMock ( org . apache . cxf . endpoint . Endpoint . class ) ; org . apache . cxf . ws . rm . RMEndpoint rme = control . createMock ( org . apache . cxf . ws . rm . RMEndpoint . class ) ; control . replay ( ) ; manager . shutdownReliableEndpoint ( e ) ; control . verify ( ) ; control . reset ( ) ; manager . getReliableEndpointsMap ( ) . put ( e , rme ) ; rme . shutdown ( ) ; org . easymock . EasyMock . expectLastCall ( ) ; control . replay ( ) ; manager . shutdownReliableEndpoint ( e ) ; "<AssertPlaceHolder>" ; control . verify ( ) ; } getReliableEndpointsMap ( ) { return reliableEndpoints ; }
org . junit . Assert . assertNull ( manager . getReliableEndpointsMap ( ) . get ( e ) )
testparseValueForDBEntityId ( ) { java . lang . Long expected = new java . lang . Long ( 123 ) ; java . lang . Object objectValue = org . sagebionetworks . table . cluster . SQLUtils . parseValueForDB ( ColumnType . ENTITYID , "syn123" ) ; "<AssertPlaceHolder>" ; } parseValueForDB ( org . sagebionetworks . repo . model . table . ColumnType , java . lang . String ) { if ( value == null ) return null ; if ( type == null ) throw new java . lang . IllegalArgumentException ( "Type<sp>cannot<sp>be<sp>null" ) ; org . sagebionetworks . table . cluster . ColumnTypeInfo info = org . sagebionetworks . table . cluster . ColumnTypeInfo . getInfoForType ( type ) ; return info . parseValueForDatabaseWrite ( value ) ; }
org . junit . Assert . assertEquals ( expected , objectValue )
isInOrderTest ( ) { java . util . List < java . lang . Integer > numbers = java . util . Arrays . asList ( 1 , 2 , 3 , 4 , 4 , 6 , 7 , 8 , 9 , 10 ) ; boolean isInAscendingOrder = com . google . common . collect . Comparators . isInOrder ( numbers , new com . baeldung . guava . tutorial . ComparatorsUnitTest . AscendingOrderComparator < java . lang . Number > ( ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( isInAscendingOrder )
testMaxBufferSize ( ) { java . util . Iterator < java . lang . String [ ] > iterator = org . simpleflatmapper . lightningcsv . CsvParser . maxBufferSize ( 4 ) . bufferSize ( 2 ) . iterator ( new java . io . StringReader ( "f1\nf11\nf111" ) ) ; iterator . next ( ) ; iterator . next ( ) ; try { iterator . next ( ) ; org . junit . Assert . fail ( "Expect<sp>BufferOverflowException" ) ; } catch ( java . lang . Exception e ) { if ( ! ( e instanceof org . simpleflatmapper . lightningcsv . parser . BufferOverflowException ) ) { org . junit . Assert . fail ( "Expect<sp>BufferOverflowException" ) ; } } iterator = org . simpleflatmapper . lightningcsv . CsvParser . maxBufferSize ( 9 ) . bufferSize ( 2 ) . iterator ( new java . io . StringReader ( "12345678\n1234567890" ) ) ; iterator . next ( ) ; try { iterator . next ( ) ; org . junit . Assert . fail ( "Expect<sp>BufferOverflowException" ) ; } catch ( java . lang . Exception e ) { if ( ! ( e instanceof org . simpleflatmapper . lightningcsv . parser . BufferOverflowException ) ) { org . junit . Assert . fail ( "Expect<sp>BufferOverflowException" ) ; } } iterator = org . simpleflatmapper . lightningcsv . CsvParser . maxBufferSize ( 11 ) . bufferSize ( 2 ) . iterator ( new java . io . StringReader ( "1234567890" ) ) ; java . lang . String [ ] row = iterator . next ( ) ; "<AssertPlaceHolder>" ; } next ( ) { ( currentIndex ) ++ ; if ( ( currentIndex ) < ( objects . length ) ) { return true ; } return false ; }
org . junit . Assert . assertEquals ( "1234567890" , row [ 0 ] )
setPropertyValueChained ( ) { com . github . dozermapper . core . propertydescriptor . FieldPropertyDescriptor descriptor = new com . github . dozermapper . core . propertydescriptor . FieldPropertyDescriptor ( com . github . dozermapper . core . propertydescriptor . FieldPropertyDescriptorTest . Container . class , "container.value" , false , 0 , null , null , destBeanCreator ) ; com . github . dozermapper . core . propertydescriptor . FieldPropertyDescriptorTest . Container bean = new com . github . dozermapper . core . propertydescriptor . FieldPropertyDescriptorTest . Container ( "" ) ; bean . container = new com . github . dozermapper . core . propertydescriptor . FieldPropertyDescriptorTest . Container ( "" ) ; descriptor . setPropertyValue ( bean , "A" , mock ( com . github . dozermapper . core . fieldmap . FieldMap . class ) ) ; "<AssertPlaceHolder>" ; } setPropertyValue ( java . lang . Object , java . lang . Object , com . github . dozermapper . core . fieldmap . FieldMap ) { if ( com . github . dozermapper . core . util . MappingUtils . isDeepMapping ( fieldName ) ) { writeDeepDestinationValue ( bean , value , fieldMap ) ; } else { if ( ( ! ( getPropertyType ( ) . isPrimitive ( ) ) ) || ( value != null ) ) { try { if ( ( value != null ) && ( ( getPropertyValue ( bean ) ) == value ) ) { return ; } } catch ( java . lang . Exception e ) { } invokeWriteMethod ( bean , value ) ; } } }
org . junit . Assert . assertEquals ( "A" , bean . container . value )
testLinkCategory ( ) { final java . util . List < net . magja . model . category . Category > categories = new java . util . ArrayList < net . magja . model . category . Category > ( ) ; categories . add ( service . getMinimalCategory ( service . getDefaultParent ( ) . getId ( ) , "cat1" ) ) ; categories . add ( service . getMinimalCategory ( service . getDefaultParent ( ) . getId ( ) , "cat3" ) ) ; net . magja . model . category . Category linkCategory = service . linkCategory ( categories ) ; "<AssertPlaceHolder>" ; } linkCategory ( java . util . List ) { if ( ( categories . size ( ) ) > 0 ) { for ( int i = 0 ; i < ( categories . size ( ) ) ; i ++ ) { if ( i > 0 ) { net . magja . model . category . Category parent = categories . get ( ( i - 1 ) ) ; categories . get ( i ) . setParent ( parent ) ; } if ( i < ( ( categories . size ( ) ) - 1 ) ) { java . util . List < net . magja . model . category . Category > children = new java . util . ArrayList < net . magja . model . category . Category > ( ) ; children . add ( categories . get ( ( i + 1 ) ) ) ; categories . get ( i ) . setChildren ( children ) ; } } return categories . get ( 0 ) ; } throw new net . magja . service . ServiceException ( "Category<sp>list<sp>is<sp>empty" ) ; }
org . junit . Assert . assertNotNull ( linkCategory )
should_get_empty_list_for_nonexistant_names ( ) { org . mamute . dao . TagDAO tags = new org . mamute . dao . TagDAO ( session ) ; createTags ( session , createUser ( session , "leonardo" , "leo@leo" ) ) ; java . util . List < org . mamute . dao . Tag > found = tags . findAllDistinct ( asList ( "blabla" , "lala" ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return comments . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( found . isEmpty ( ) )
senateBillTextFormatTest ( ) { java . lang . String inputText = "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 6 + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" + "<sp>________________________________________________________________________\n" ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 6 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 2 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 6 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 3 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 6 ) + "<sp>IN<sp>SENATE\n" ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 6 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 2 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 6 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 0 ) + "<sp>___________\n" ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 6 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 5 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 0 ) + "<sp>recommitted<sp>to<sp>the<sp>Committee<sp>on<sp>Consumer<sp>Protection<sp>in<sp>accordance<sp>with\n" ) + "<sp>Senate<sp>Rule<sp>6,<sp>sec.<sp>8<sp>--<sp>committee<sp>discharged,<sp>bill<sp>amended,<sp>ordered" ) ; java . lang . String expectedResult = "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 4 + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 3 + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 4 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 4 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 5 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 4 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 1 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 4 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 1 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 4 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 9 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 4 ) + "<sp>January<sp>4,<sp>2017\n" ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 7 ) + "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" 4 ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" ) + "<sp>Introduced<sp>by<sp>Sen.<sp>HOYLMAN<sp>--<sp>read<sp>twice<sp>and<sp>ordered<sp>printed,<sp>and<sp>when\n" 8 ) + "<sp>recommitted<sp>to<sp>the<sp>Committee<sp>on<sp>Consumer<sp>Protection<sp>in<sp>accordance<sp>with\n" ) + "<sp>Senate<sp>Rule<sp>6,<sp>sec.<sp>8<sp>--<sp>committee<sp>discharged,<sp>bill<sp>amended,<sp>ordered" ) ; "<AssertPlaceHolder>" ; } formatHtmlExtractedBillText ( java . lang . String ) { text = text . replaceAll ( "(?<=\n|^)<sp>" , "" ) ; java . util . regex . Matcher matcher = gov . nysenate . openleg . util . BillTextUtils . billHeaderPattern . matcher ( text ) ; if ( matcher . find ( ) ) { java . lang . StringBuilder replacement = new java . lang . StringBuilder ( ) . append ( matcher . group ( "startingNewlines" ) ) . append ( org . apache . commons . lang3 . StringUtils . repeat ( '<sp>' , 27 ) ) . append ( "divider" 0 ) . append ( matcher . group ( "divider" ) ) ; switch ( matcher . group ( "chamber" ) ) { case gov . nysenate . openleg . util . BillTextUtils . inSenate : replacement . append ( org . apache . commons . lang3 . StringUtils . repeat ( '<sp>' , 35 ) ) . append ( "I<sp>N<sp>S<sp>E<sp>N<sp>A<sp>T<sp>E" ) ; break ; case gov . nysenate . openleg . util . BillTextUtils . inAssembly : replacement . append ( org . apache . commons . lang3 . StringUtils . repeat ( '<sp>' , 33 ) ) . append ( "I<sp>N<sp>A<sp>S<sp>S<sp>E<sp>M<sp>B<sp>L<sp>Y" ) ; break ; case gov . nysenate . openleg . util . BillTextUtils . inBoth : replacement . append ( org . apache . commons . lang3 . StringUtils . repeat ( '<sp>' , 29 ) ) . append ( "S<sp>E<sp>N<sp>A<sp>T<sp>E<sp>-<sp>A<sp>S<sp>S<sp>E<sp>M<sp>B<sp>L<sp>Y" ) ; break ; default : throw new java . lang . IllegalStateException ( ( "divider" 1 + ( matcher . group ( "chamber" ) ) ) ) ; } if ( ( matcher . group ( "prefiledWhiteSpace" ) ) != null ) { replacement . append ( matcher . group ( "prefiledWhiteSpace" ) ) . append ( "(PREFILED)" ) ; } text = matcher . replaceFirst ( replacement . toString ( ) ) ; } return text ; }
org . junit . Assert . assertEquals ( expectedResult , gov . nysenate . openleg . util . BillTextUtils . formatHtmlExtractedBillText ( inputText ) )
testGetQuantity ( ) { ecommerceItem . setQuantity ( 1 ) ; "<AssertPlaceHolder>" ; } getQuantity ( ) { return quantity ; }
org . junit . Assert . assertEquals ( new java . lang . Integer ( 1 ) , ecommerceItem . getQuantity ( ) )
testGetBaseColulmnTypeWithQuotes ( ) { when ( mockHasQuoteValue . toSqlWithoutQuotes ( ) ) . thenReturn ( "foo" ) ; when ( mockHasQuoteValue . hasQuotesRecursive ( ) ) . thenReturn ( true ) ; org . sagebionetworks . repo . model . table . ColumnType type = org . sagebionetworks . table . cluster . SQLTranslatorUtils . getBaseColulmnType ( mockHasQuoteValue ) ; org . sagebionetworks . repo . model . table . ColumnType expected = org . sagebionetworks . repo . model . table . ColumnType . STRING ; "<AssertPlaceHolder>" ; } getBaseColulmnType ( org . sagebionetworks . table . query . model . ColumnNameReference ) { if ( referencedColumn == null ) { return null ; } java . lang . String columnNameUpper = referencedColumn . toSqlWithoutQuotes ( ) . toUpperCase ( ) ; if ( TableConstants . ROW_ID . equals ( columnNameUpper ) ) { return org . sagebionetworks . repo . model . table . ColumnType . INTEGER ; } if ( TableConstants . ROW_VERSION . equals ( columnNameUpper ) ) { return org . sagebionetworks . repo . model . table . ColumnType . INTEGER ; } if ( ! ( referencedColumn . hasQuotesRecursive ( ) ) ) { return org . sagebionetworks . repo . model . table . ColumnType . DOUBLE ; } return org . sagebionetworks . repo . model . table . ColumnType . STRING ; }
org . junit . Assert . assertEquals ( expected , type )
testIgnoreOwnBeaconBlocking ( ) { final int port = org . zeromq . Utils . findOpenPort ( ) ; final byte [ ] beacon = new byte [ ] { 'Z' , 'R' , 'E' , 1 , 2 } ; final byte [ ] prefix = new byte [ ] { 'Z' , 'R' , 'E' , 1 } ; final org . zeromq . ZBeacon zbeacon = new org . zeromq . ZBeacon ( ZBeacon . DEFAULT_BROADCAST_HOST , port , beacon , true , true ) ; zbeacon . setPrefix ( prefix ) ; final java . util . concurrent . atomic . AtomicLong counter = new java . util . concurrent . atomic . AtomicLong ( ) ; zbeacon . setListener ( new org . zeromq . ZBeacon . Listener ( ) { @ org . zeromq . Override public void onBeacon ( java . net . InetAddress sender , byte [ ] beacon ) { counter . incrementAndGet ( ) ; System . out . println ( sender . toString ( ) ) ; try { System . out . println ( java . net . InetAddress . getLocalHost ( ) . getHostAddress ( ) ) ; } catch ( java . lang . Exception e ) { } System . out . println ( new java . lang . String ( beacon ) ) ; } } ) ; zbeacon . start ( ) ; zmq . ZMQ . sleep ( 1 ) ; zbeacon . stop ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return producePongMessage ( pingContext ) ; }
org . junit . Assert . assertThat ( counter . get ( ) , org . hamcrest . CoreMatchers . is ( 0L ) )
testWhitespaceBodyWithCRLF ( ) { java . lang . String whitespace = "<sp>\n\n\n\r\n\r\n\r\n\r\n" ; javax . servlet . MultipartConfigElement config = new javax . servlet . MultipartConfigElement ( _dirname , 1024 , 3072 , 50 ) ; com . firefly . codec . http2 . model . MultiPartFormInputStream mpis = new com . firefly . codec . http2 . model . MultiPartFormInputStream ( new test . codec . http2 . model . ByteArrayInputStream ( whitespace . getBytes ( ) ) , _contentType , config , _tmpDir ) ; mpis . setDeleteOnExit ( true ) ; try { mpis . getParts ( ) ; org . junit . Assert . fail ( "Missing<sp>initial<sp>multi<sp>part<sp>boundary" ) ; } catch ( test . codec . http2 . model . IOException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { java . lang . StringBuilder b = new java . lang . StringBuilder ( ) ; if ( com . firefly . utils . StringUtils . hasText ( error ) ) { b . append ( error ) ; } if ( com . firefly . utils . StringUtils . hasText ( description ) ) { b . append ( ",<sp>" ) . append ( description ) ; } if ( com . firefly . utils . StringUtils . hasText ( uri ) ) { b . append ( ",<sp>" ) . append ( uri ) ; } if ( com . firefly . utils . StringUtils . hasText ( state ) ) { b . append ( ",<sp>" ) . append ( state ) ; } if ( com . firefly . utils . StringUtils . hasText ( scope ) ) { b . append ( ",<sp>" ) . append ( scope ) ; } return b . toString ( ) ; }
org . junit . Assert . assertTrue ( e . getMessage ( ) . contains ( "Missing<sp>initial<sp>multi<sp>part<sp>boundary" ) )
testSetSuffix ( ) { System . out . println ( "setSuffix" ) ; java . lang . String suffix = "order<sp>by<sp>1" ; com . rhythm . louie . jdbc . QueryBuilder builder = new com . rhythm . louie . jdbc . QueryBuilder ( jdbc , com . rhythm . louie . jdbc . QueryBuilderTest . SELECT_PREFIX , false ) ; builder . setSuffix ( suffix ) ; java . lang . String expected = ( ( com . rhythm . louie . jdbc . QueryBuilderTest . SELECT_PREFIX ) + "<sp>" ) + suffix ; "<AssertPlaceHolder>" ; } getQuery ( ) { java . lang . StringBuilder query = new java . lang . StringBuilder ( ) ; query . append ( "INSERT<sp>INTO<sp>" ) . append ( table ) . append ( "<sp>(" ) ; for ( int i = 0 ; i < ( fields . size ( ) ) ; i ++ ) { if ( i != 0 ) { query . append ( "," ) ; } com . rhythm . louie . jdbc . InsertODKUBuilder . Field f = fields . get ( i ) ; query . append ( f . getName ( ) ) ; } query . append ( ")<sp>VALUES<sp>(" ) ; for ( int j = 0 ; j < ( fields . size ( ) ) ; j ++ ) { if ( j != 0 ) { query . append ( "," ) ; } com . rhythm . louie . jdbc . InsertODKUBuilder . Field f = fields . get ( j ) ; if ( f . hasSpecial ( ) ) { query . append ( f . getSpecial ( ) ) ; } else { query . append ( ",<sp>" 0 ) ; } } query . append ( ")<sp>ON<sp>DUPLICATE<sp>KEY<sp>UPDATE<sp>" ) ; for ( int k = 0 ; k < ( odkus . size ( ) ) ; k ++ ) { if ( k != 0 ) { query . append ( "," ) ; } com . rhythm . louie . jdbc . InsertODKUBuilder . Field f = odkus . get ( k ) ; query . append ( f . getName ( ) ) ; if ( f . hasSpecial ( ) ) { query . append ( "=" ) . append ( f . getSpecial ( ) ) ; } else { query . append ( "=?" ) ; } } if ( ( autoIncrementField ) != null ) { query . append ( ",<sp>" ) . append ( autoIncrementField ) ; query . append ( "=LAST_INSERT_ID(" ) . append ( autoIncrementField ) . append ( ")" ) ; } return query . toString ( ) ; }
org . junit . Assert . assertEquals ( builder . getQuery ( ) , expected )
countOfClientsIsZero ( ) { int count = customerDao . countOfClients ( ) ; "<AssertPlaceHolder>" ; } countOfClients ( ) { java . util . Map < java . lang . String , java . lang . Object > queryParameters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . List queryResult = this . genericDao . executeNamedQuery ( "countOfClients" , queryParameters ) ; return ( ( java . lang . Long ) ( queryResult . get ( 0 ) ) ) . intValue ( ) ; }
org . junit . Assert . assertThat ( count , org . hamcrest . CoreMatchers . is ( 0 ) )
testIsRegionPersistentWhenDataPolicyIsPersistentReplicate ( ) { final com . gemstone . gemfire . cache . Region mockRegion = mockContext . mock ( com . gemstone . gemfire . cache . Region . class , "Region" ) ; final com . gemstone . gemfire . cache . RegionAttributes mockRegionAttributes = mockContext . mock ( com . gemstone . gemfire . cache . RegionAttributes . class , "RegionAttributes" ) ; mockContext . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockRegion ) . getAttributes ( ) ; will ( returnValue ( mockRegionAttributes ) ) ; oneOf ( mockRegionAttributes ) . getDataPolicy ( ) ; will ( returnValue ( DataPolicy . PERSISTENT_REPLICATE ) ) ; } } ) ; final com . gemstone . gemfire . management . internal . cli . functions . DescribeDiskStoreFunction function = createDescribeDiskStoreFunction ( null ) ; "<AssertPlaceHolder>" ; } isPersistent ( com . gemstone . gemfire . cache . Region ) { return com . gemstone . gemfire . management . internal . cli . functions . DescribeDiskStoreFunction . PERSISTENT_DATA_POLICIES . contains ( region . getAttributes ( ) . getDataPolicy ( ) ) ; }
org . junit . Assert . assertTrue ( function . isPersistent ( mockRegion ) )
testFieldFloat ( ) { @ org . simpleflatmapper . reflect . test . asm . SuppressWarnings ( "unchecked" ) org . simpleflatmapper . reflect . primitive . FloatSetter < org . simpleflatmapper . test . beans . DbPrimitiveObjectFields > setter = ( ( org . simpleflatmapper . reflect . primitive . FloatSetter < org . simpleflatmapper . test . beans . DbPrimitiveObjectFields > ) ( factory . createSetter ( org . simpleflatmapper . test . beans . DbPrimitiveObjectFields . class . getDeclaredField ( "pFloat" ) ) ) ) ; setter . setFloat ( objectField , 3.14F ) ; "<AssertPlaceHolder>" ; } getpFloat ( ) { return pFloat ; }
org . junit . Assert . assertEquals ( 3.14F , objectField . getpFloat ( ) , 0 )
readIntegerNumberFailing ( ) { victim = new org . sejda . sambox . input . SourceReader ( inMemorySeekableSourceFrom ( "ChuckNorris" . getBytes ( ) ) ) ; "<AssertPlaceHolder>" ; } readIntegerNumber ( ) { skipSpaces ( ) ; java . lang . StringBuilder builder = pool . borrow ( ) ; try { int c = source . read ( ) ; if ( ( c != ( - 1 ) ) && ( ( ( isDigit ( c ) ) || ( c == '+' ) ) || ( c == '-' ) ) ) { builder . append ( ( ( char ) ( c ) ) ) ; while ( ( ( c = source . read ( ) ) != ( - 1 ) ) && ( isDigit ( c ) ) ) { builder . append ( ( ( char ) ( c ) ) ) ; } } unreadIfValid ( c ) ; return builder . toString ( ) ; } finally { pool . give ( builder ) ; } }
org . junit . Assert . assertEquals ( "" , victim . readIntegerNumber ( ) )
testEqualsSelf ( ) { org . jfree . data . time . Minute minute = new org . jfree . data . time . Minute ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( minute , minute )
convertXmlToObjectFromFile ( ) { java . lang . ClassLoader classLoader = getClass ( ) . getClassLoader ( ) ; java . io . FileReader reader = new java . io . FileReader ( classLoader . getResource ( "data-file-ignore-field.xml" ) . getFile ( ) ) ; com . baeldung . pojo . Customer customer = ( ( com . baeldung . pojo . Customer ) ( xstream . fromXML ( reader ) ) ) ; "<AssertPlaceHolder>" ; } getFile ( ) { final java . io . InputStream in = getClass ( ) . getResourceAsStream ( "/com/baeldung/produceimage/data.txt" ) ; return org . apache . commons . io . IOUtils . toByteArray ( in ) ; }
org . junit . Assert . assertNotNull ( customer )
getScoreForwardsToOmimWhenMonarchScorerUnavailable ( ) { when ( this . monarchScorer . getScore ( this . patient ) ) . thenReturn ( ( - 1.0 ) ) ; when ( this . omimScorer . getScore ( this . patient ) ) . thenReturn ( 0.25 ) ; double score = this . mocker . getComponentUnderTest ( ) . getScore ( this . patient ) ; "<AssertPlaceHolder>" ; } getScore ( org . phenotips . data . Patient ) { double score = - 1 ; score = this . monarchScorer . getScore ( patient ) ; if ( score == ( - 1 ) ) { score = this . omimScorer . getScore ( patient ) ; } return score ; }
org . junit . Assert . assertEquals ( 0.25 , score , 0.0 )
testReadWriteParcelable ( ) { android . accounts . Account a1 = new android . accounts . Account ( "name" , "type" ) ; parcel . writeParcelable ( a1 , 0 ) ; parcel . setDataPosition ( 0 ) ; android . accounts . Account a2 = parcel . readParcelable ( android . accounts . Account . class . getClassLoader ( ) ) ; "<AssertPlaceHolder>" ; } getClassLoader ( ) { return org . robolectric . internal . bytecode . RobolectricInternals . classLoader ; }
org . junit . Assert . assertEquals ( a1 , a2 )
testMutate ( ) { org . apache . commons . math . genetics . MutationPolicy mutation = new org . apache . commons . math . genetics . RandomKeyMutation ( ) ; int l = 10 ; for ( int i = 0 ; i < 20 ; i ++ ) { org . apache . commons . math . genetics . DummyRandomKey origRk = new org . apache . commons . math . genetics . DummyRandomKey ( org . apache . commons . math . genetics . RandomKey . randomPermutation ( l ) ) ; org . apache . commons . math . genetics . Chromosome mutated = mutation . mutate ( origRk ) ; org . apache . commons . math . genetics . DummyRandomKey mutatedRk = ( ( org . apache . commons . math . genetics . DummyRandomKey ) ( mutated ) ) ; int changes = 0 ; for ( int j = 0 ; j < ( origRk . getLength ( ) ) ; j ++ ) { if ( ( origRk . getRepresentation ( ) . get ( j ) ) != ( mutatedRk . getRepresentation ( ) . get ( j ) ) ) { changes ++ ; } } "<AssertPlaceHolder>" ; } } get ( int ) { java . lang . Object result = null ; if ( ( index >= 0 ) && ( index < ( this . size ) ) ) { result = this . objects [ index ] ; } return result ; }
org . junit . Assert . assertEquals ( 1 , changes )
testReinitialize ( ) { conf = scheduler . getConfig ( ) ; try { reservationSystem . reinitialize ( conf , rmContext ) ; } catch ( org . apache . hadoop . yarn . exceptions . YarnException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } if ( getSchedulerType ( ) . equals ( SchedulerType . CAPACITY ) ) { org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemTestUtil . validateReservationQueue ( reservationSystem , org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemTestUtil . getReservationQueueName ( ) ) ; } else { org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemTestUtil . validateReservationQueue ( reservationSystem , org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemTestUtil . getFullReservationQueueName ( ) ) ; } java . lang . String newQ = "reservation" ; "<AssertPlaceHolder>" ; updateSchedulerConf ( conf , newQ ) ; try { scheduler . reinitialize ( conf , rmContext ) ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } try { reservationSystem . reinitialize ( conf , rmContext ) ; } catch ( org . apache . hadoop . yarn . exceptions . YarnException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } if ( getSchedulerType ( ) . equals ( SchedulerType . CAPACITY ) ) { org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemTestUtil . validateReservationQueue ( reservationSystem , newQ ) ; } else { org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemTestUtil . validateReservationQueue ( reservationSystem , ( "root." + newQ ) ) ; } } getPlan ( java . lang . String ) { org . apache . hadoop . yarn . server . resourcemanager . scheduler . fair . FSQueue queue = fairScheduler . getQueueManager ( ) . getQueue ( planName ) ; if ( queue != null ) { return super . getPlan ( queue . getQueueName ( ) ) ; } else { return null ; } }
org . junit . Assert . assertNull ( reservationSystem . getPlan ( newQ ) )
compareSymbol ( ) { org . openscience . cdk . silent . Element e1 = new org . openscience . cdk . silent . Element ( new java . lang . String ( "H" ) , 1 ) ; org . openscience . cdk . silent . Element e2 = new org . openscience . cdk . silent . Element ( new java . lang . String ( "H" ) , 1 ) ; "<AssertPlaceHolder>" ; } compare ( java . lang . Object ) { if ( ! ( object instanceof org . openscience . cdk . interfaces . IChemObject ) ) { return false ; } org . openscience . cdk . ChemObject chemObj = ( ( org . openscience . cdk . ChemObject ) ( object ) ) ; return com . google . common . base . Objects . equal ( identifier , chemObj . identifier ) ; }
org . junit . Assert . assertTrue ( e1 . compare ( e2 ) )
testDecisionResultNamedOnFailure ( ) { java . net . URI resource = getClass ( ) . getResource ( "/corrupted/on_failure/decision_1.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>decision<sp>'decision_1'<sp>syntax<sp>is<sp>illegal." ) ; exception . expectMessage ( "Result<sp>cannot<sp>be<sp>called<sp>'on_failure'." ) ; throw result . getErrors ( ) . get ( 0 ) ; } getErrors ( ) { return errors ; }
org . junit . Assert . assertTrue ( ( ( result . getErrors ( ) . size ( ) ) > 0 ) )
testDeleteRemoteMepOnDevice ( ) { boolean success = cfmProgrammable . deleteMaRemoteMepOnDevice ( org . onosproject . incubator . net . l2monitoring . cfm . identifier . MdIdCharStr . asMdId ( "md-1" ) , org . onosproject . incubator . net . l2monitoring . cfm . identifier . MaIdCharStr . asMaId ( "ma-1-1" ) , org . onosproject . incubator . net . l2monitoring . cfm . identifier . MepId . valueOf ( ( ( short ) ( 1001 ) ) ) ) ; "<AssertPlaceHolder>" ; } valueOf ( short ) { if ( ( id < 1 ) || ( id > 8191 ) ) { throw new java . lang . IllegalArgumentException ( ( ( "Invalid<sp>value<sp>for<sp>Mep<sp>Id<sp>-<sp>must<sp>be<sp>between<sp>1-8191<sp>inclusive.<sp>" + "Rejecting<sp>" ) + id ) ) ; } return new org . onosproject . incubator . net . l2monitoring . cfm . identifier . MepId ( id ) ; }
org . junit . Assert . assertTrue ( success )
testCompare_DiffAtomTypeName ( ) { org . openscience . cdk . silent . AtomType at1 = new org . openscience . cdk . silent . AtomType ( "C" ) ; org . openscience . cdk . silent . AtomType at2 = new org . openscience . cdk . silent . AtomType ( "C" ) ; at1 . setAtomTypeName ( new java . lang . String ( "C4" ) ) ; at2 . setAtomTypeName ( new java . lang . String ( "C3" ) ) ; "<AssertPlaceHolder>" ; } compare ( java . lang . Object ) { if ( ! ( object instanceof org . openscience . cdk . interfaces . IChemObject ) ) { return false ; } org . openscience . cdk . ChemObject chemObj = ( ( org . openscience . cdk . ChemObject ) ( object ) ) ; return com . google . common . base . Objects . equal ( identifier , chemObj . identifier ) ; }
org . junit . Assert . assertFalse ( at1 . compare ( at2 ) )
testUseCustomAtmoosphereInterceptor ( ) { org . apache . cxf . Bus bus = new org . apache . cxf . bus . extension . ExtensionManagerBus ( ) ; bus . setProperty ( "atmosphere.interceptors" , new org . apache . cxf . transport . websocket . atmosphere . AtmosphereWebSocketJettyDestinationTest . CustomInterceptor1 ( ) ) ; org . apache . cxf . transport . http . DestinationRegistry registry = new org . apache . cxf . transport . http . HTTPTransportFactory ( ) . getRegistry ( ) ; org . apache . cxf . service . model . EndpointInfo endpoint = new org . apache . cxf . service . model . EndpointInfo ( ) ; endpoint . setAddress ( org . apache . cxf . transport . websocket . atmosphere . AtmosphereWebSocketJettyDestinationTest . ENDPOINT_ADDRESS ) ; endpoint . setName ( org . apache . cxf . transport . websocket . atmosphere . AtmosphereWebSocketJettyDestinationTest . ENDPOINT_NAME ) ; org . apache . cxf . transport . websocket . atmosphere . AtmosphereWebSocketServletDestination dest = new org . apache . cxf . transport . websocket . atmosphere . AtmosphereWebSocketServletDestination ( bus , registry , endpoint , org . apache . cxf . transport . websocket . atmosphere . AtmosphereWebSocketJettyDestinationTest . ENDPOINT_ADDRESS ) ; java . util . List < org . atmosphere . cpr . AtmosphereInterceptor > ais = dest . getAtmosphereFramework ( ) . interceptors ( ) ; int added = 0 ; for ( org . atmosphere . cpr . AtmosphereInterceptor a : ais ) { if ( org . apache . cxf . transport . websocket . atmosphere . AtmosphereWebSocketJettyDestinationTest . CustomInterceptor1 . class . equals ( a . getClass ( ) ) ) { added ++ ; break ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( o instanceof org . apache . cxf . transport . http . Cookie ) ) { return false ; } org . apache . cxf . transport . http . Cookie c = ( ( org . apache . cxf . transport . http . Cookie ) ( o ) ) ; return ( this . name . equals ( c . name ) ) && ( ( ( ( this . path ) == null ) && ( ( c . path ) == null ) ) || ( ( ( this . path ) != null ) && ( this . path . equals ( c . path ) ) ) ) ; }
org . junit . Assert . assertEquals ( 1 , added )
testCreate ( ) { org . oscarehr . common . model . EyeformMacro entity = new org . oscarehr . common . model . EyeformMacro ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
org . junit . Assert . assertNotNull ( entity . getId ( ) )
testVoerRegelUitMinderjarigPersoonDatumNull ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > berichtEntiteiten = brby0137 . voerRegelUit ( maakHuidigeSituatie ( 19830404 ) , maakNieuweSituatie ( true , false ) , null , null ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( berichtEntiteiten . isEmpty ( ) )
testGetContainerName ( ) { java . lang . String inputType = "Template" ; long inputId = 45 ; java . lang . String output = com . cloud . utils . SwiftUtil . getContainerName ( inputType , inputId ) ; java . lang . String expected = "T-45" ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expected , output )
getCustomAllocationDefinitionWorks ( tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . SymmetricKeyAttestation ) { tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . CustomAllocationDefinition expectedCustomAllocationDefinition = new tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . CustomAllocationDefinition ( ) ; tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . IndividualEnrollment individualEnrollment = new tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . IndividualEnrollment ( "1234" , mockedAttestation ) ; tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . Deencapsulation . setField ( individualEnrollment , "customAllocationDefinition" , expectedCustomAllocationDefinition ) ; tests . unit . com . microsoft . azure . sdk . iot . provisioning . service . configs . CustomAllocationDefinition actualCustomAllocationDefinition = individualEnrollment . getCustomAllocationDefinition ( ) ; "<AssertPlaceHolder>" ; } getCustomAllocationDefinition ( ) { return this . customAllocationDefinition ; }
org . junit . Assert . assertEquals ( expectedCustomAllocationDefinition , actualCustomAllocationDefinition )
nameShouldBeEqualToFilenameIfDefault ( ) { java . lang . String filename = "justfortest.txt" ; java . lang . String path = "/hello/world/" + filename ; java . io . File newFile = new java . io . File ( path ) ; com . navercorp . volleyextensions . volleyer . multipart . FilePart part = new com . navercorp . volleyextensions . volleyer . multipart . FilePart ( newFile ) ; java . lang . String result = part . getName ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( filename ) )
servingUrlWithImageSize ( ) { com . google . appengine . api . images . ServingUrlOptions servingUrlOptions = ServingUrlOptions . Builder . withBlobKey ( blobKey ) ; java . lang . String baseUrl = imagesService . getServingUrl ( servingUrlOptions ) ; java . lang . String actualUrl = imagesService . getServingUrl ( servingUrlOptions . imageSize ( 32 ) . crop ( false ) ) ; java . lang . String expectedUrl = baseUrl + "=s32" ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expectedUrl , actualUrl )
aNewProfileShouldAllowSettingAdditionalParameters ( ) { org . openqa . selenium . firefox . FirefoxProfile profile = new org . openqa . selenium . firefox . FirefoxProfile ( ) ; profile . setPreference ( "browser.startup.homepage" , pages . formPage ) ; try { org . openqa . selenium . WebDriver secondDriver = newFirefoxDriver ( profile ) ; new org . openqa . selenium . support . ui . WebDriverWait ( secondDriver , 30 ) . until ( titleIs ( "We<sp>Leave<sp>From<sp>Here" ) ) ; java . lang . String title = secondDriver . getTitle ( ) ; secondDriver . quit ( ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( "Expected<sp>driver<sp>to<sp>be<sp>created<sp>successfully" ) ; } } is ( java . lang . String ) { java . lang . Object cap = getCapability ( capabilityName ) ; if ( cap == null ) { return false ; } return cap instanceof java . lang . Boolean ? ( ( java . lang . Boolean ) ( cap ) ) : java . lang . Boolean . parseBoolean ( java . lang . String . valueOf ( cap ) ) ; }
org . junit . Assert . assertThat ( title , org . hamcrest . Matchers . is ( "We<sp>Leave<sp>From<sp>Here" ) )
checkMessageMethod ( ) { java . lang . String str = "test" ; info . smart_tools . smartactors . message_processing_interfaces . iwrapper_generator . exception . WrapperGeneratorException exception = new info . smart_tools . smartactors . message_processing_interfaces . iwrapper_generator . exception . WrapperGeneratorException ( str ) ; "<AssertPlaceHolder>" ; throw exception ; } getMessage ( ) { return message ; }
org . junit . Assert . assertEquals ( exception . getMessage ( ) , str )
testContainsTrueValid ( ) { ddf . catalog . data . impl . MetacardImpl cachedMetacard = generateMetacard ( ) ; ddf . catalog . data . impl . MetacardImpl latestMetacard = generateMetacard ( ) ; java . lang . String cacheKey = "cacheKey1" ; resourceCache . put ( new ddf . catalog . resource . data . ReliableResource ( cacheKey , "" , null , "name" , cachedMetacard ) ) ; "<AssertPlaceHolder>" ; } containsValid ( java . lang . String , ddf . catalog . data . Metacard ) { if ( key == null ) { return false ; } ddf . catalog . resource . data . ReliableResource cachedResource = ( ( ddf . catalog . resource . data . ReliableResource ) ( cache . get ( key ) ) ) ; boolean result ; try { result = ( cachedResource != null ) ? validateCacheEntry ( cachedResource , latestMetacard ) : false ; } catch ( java . lang . IllegalArgumentException e ) { ddf . catalog . cache . impl . ResourceCache . LOGGER . debug ( e . getMessage ( ) ) ; return false ; } return result ; }
org . junit . Assert . assertTrue ( resourceCache . containsValid ( cacheKey , latestMetacard ) )
testGetParametersWithDefaultEntityAndDisabledSecurity ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . enrolment . foreign . type . EnrolmentForeignType entity = new org . lnu . is . domain . enrolment . foreign . type . EnrolmentForeignType ( ) ; 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 )
filter_A$Function1 ( ) { com . m3 . scalaflavor4j . None < java . lang . String > target = new com . m3 . scalaflavor4j . None < java . lang . String > ( ) ; com . m3 . scalaflavor4j . F1 < java . lang . String , java . lang . Boolean > isStartsWithv = new com . m3 . scalaflavor4j . F1 < java . lang . String , java . lang . Boolean > ( ) { @ com . m3 . scalaflavor4j . Override public com . m3 . scalaflavor4j . Boolean apply ( java . lang . String v1 ) { return v1 . startsWith ( "v" ) ; } } ; com . m3 . scalaflavor4j . Option < java . lang . String > actual = target . filter ( isStartsWithv ) ; "<AssertPlaceHolder>" ; } getOrNull ( ) { return null ; }
org . junit . Assert . assertNull ( actual . getOrNull ( ) )
testSetProperty ( ) { restGraphDatabase . getReferenceNode ( ) . setProperty ( "name" , "test" ) ; org . neo4j . graphdb . Node node = restGraphDatabase . getReferenceNode ( ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return map . get ( prefixedKey ( key ) ) ; }
org . junit . Assert . assertEquals ( "test" , node . getProperty ( "name" ) )
shouldHaveAllKeysInConfigurationData ( ) { java . util . Set < java . lang . String > messageKeysFromEnum = java . util . Arrays . stream ( fr . xephi . authme . message . MessageKey . values ( ) ) . map ( MessageKey :: getKey ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; java . util . Set < java . lang . String > messageKeysFromConfigData = fr . xephi . authme . message . updater . MessageUpdater . createConfigurationData ( ) . getProperties ( ) . stream ( ) . map ( Property :: getPath ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; "<AssertPlaceHolder>" ; } createConfigurationData ( ) { java . util . Map < java . lang . String , java . lang . String > comments = com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . String > builder ( ) . put ( "misc" 9 , "recovery" 4 ) . put ( "recovery" 3 , "misc" 0 ) . put ( "recovery" 9 , "Login" ) . put ( "misc" 5 , "recovery" 0 ) . put ( "misc" 8 , "AntiBot" ) . put ( "Password<sp>recovery<sp>by<sp>email" 0 , "misc" 7 ) . put ( "misc" , "misc" 3 ) . put ( "misc" 1 , "misc" 2 ) . put ( "recovery" 6 , "Error<sp>messages<sp>when<sp>joining" ) . put ( "recovery" 8 , "recovery" 2 ) . put ( "recovery" , "Password<sp>recovery<sp>by<sp>email" ) . put ( "recovery" 5 , "Captcha" ) . put ( "misc" 6 , "recovery" 1 ) . put ( "time" , "Time<sp>units" ) . put ( "misc" 4 , "recovery" 7 ) . build ( ) ; java . util . Set < java . lang . String > addedKeys = new java . util . HashSet ( ) ; fr . xephi . authme . message . updater . MessageUpdater . MessageKeyPropertyListBuilder builder = new fr . xephi . authme . message . updater . MessageUpdater . MessageKeyPropertyListBuilder ( ) ; for ( java . lang . String path : comments . keySet ( ) ) { fr . xephi . authme . message . MessageKey key = java . util . Arrays . stream ( fr . xephi . authme . message . MessageKey . values ( ) ) . filter ( ( p ) -> p . getKey ( ) . startsWith ( ( path + "." ) ) ) . findFirst ( ) . orElseThrow ( ( ) -> new java . lang . IllegalStateException ( path ) ) ; builder . addMessageKey ( key ) ; addedKeys . add ( key . getKey ( ) ) ; } java . util . Arrays . stream ( fr . xephi . authme . message . MessageKey . values ( ) ) . filter ( ( key ) -> ! ( addedKeys . contains ( key . getKey ( ) ) ) ) . forEach ( builder :: addMessageKey ) ; java . util . Map < java . lang . String , java . util . List < java . lang . String > > commentsMap = comments . entrySet ( ) . stream ( ) . collect ( java . util . stream . Collectors . toMap ( ( e ) -> e . getKey ( ) , ( e ) -> singletonList ( e . getValue ( ) ) ) ) ; return new fr . xephi . authme . message . updater . MessageKeyConfigurationData ( builder , commentsMap ) ; }
org . junit . Assert . assertThat ( messageKeysFromConfigData , org . hamcrest . Matchers . equalTo ( messageKeysFromEnum ) )
testConvertWithoutZeroPrecision ( ) { org . openl . rules . convertor . String2BigDecimalConvertor converter = new org . openl . rules . convertor . String2BigDecimalConvertor ( ) ; java . lang . Number result = converter . parse ( "4" , null ) ; "<AssertPlaceHolder>" ; } valueOf ( int ) { for ( org . openl . rules . ui . tablewizard . DataTableCreationWizard . Page page : org . openl . rules . ui . tablewizard . DataTableCreationWizard . Page . values ( ) ) { if ( ( page . pageNum ) == pageNum ) { return page ; } } org . openl . util . Log . warn ( "There<sp>is<sp>no<sp>pageNum<sp>{0}" , pageNum ) ; return org . openl . rules . ui . tablewizard . DataTableCreationWizard . Page . NO_SUCH_PAGE ; }
org . junit . Assert . assertEquals ( java . math . BigDecimal . valueOf ( 4 ) , result )
when_offeredToMinusOne_then_offeredToAll ( ) { com . hazelcast . jet . core . test . TestOutbox outbox = new com . hazelcast . jet . core . test . TestOutbox ( 2 ) ; "<AssertPlaceHolder>" ; } offer ( int [ ] , java . lang . Object ) { return outbox . offer ( ordinals , item ) ; }
org . junit . Assert . assertTrue ( outbox . offer ( ( - 1 ) , "foo" ) )
testReuseSelectorManager ( ) { final com . taobao . gecko . service . config . ServerConfig serverConfig = new com . taobao . gecko . service . config . ServerConfig ( ) ; serverConfig . setPort ( 0 ) ; com . taobao . gecko . service . RemotingServer remotingServer = com . taobao . gecko . service . RemotingFactory . bind ( serverConfig ) ; final com . taobao . gecko . service . udp . UDPServiceUnitTest . MockHandler serverHandler = new com . taobao . gecko . service . udp . UDPServiceUnitTest . MockHandler ( ) ; com . taobao . gecko . service . udp . UDPServer server = new com . taobao . gecko . service . udp . impl . DefaultUDPServer ( remotingServer , serverHandler , 7901 ) ; com . taobao . gecko . service . udp . UDPClient client = new com . taobao . gecko . service . udp . impl . DefaultUDPClient ( remotingServer , serverHandler ) ; client . send ( new java . net . InetSocketAddress ( 7901 ) , java . nio . ByteBuffer . wrap ( "hello" . getBytes ( ) ) ) ; java . lang . Thread . sleep ( 1000 ) ; "<AssertPlaceHolder>" ; server . stop ( ) ; client . stop ( ) ; remotingServer . stop ( ) ; } wrap ( java . nio . ByteBuffer ) { return new com . taobao . gecko . core . buffer . CachedBufferAllocator . CachedBuffer ( nioBuffer ) ; }
org . junit . Assert . assertEquals ( "hello" , new java . lang . String ( serverHandler . data ) )
writeBeanIfValid_invalidBeanAndBinderHasBindings_singleEvent ( ) { binder . forField ( nameField ) . bind ( Person :: getFirstName , Person :: setFirstName ) ; binder . readBean ( item ) ; binder . withValidator ( com . vaadin . flow . data . binder . Validator . from ( ( person ) -> false , "" ) ) ; binder . addStatusChangeListener ( this :: statusChanged ) ; "<AssertPlaceHolder>" ; binder . writeBeanIfValid ( item ) ; verifyEvent ( true ) ; } get ( ) { return com . vaadin . flow . dom . impl . BasicTextElementStateProvider . INSTANCE ; }
org . junit . Assert . assertNull ( event . get ( ) )
testAsIntWithDefaultWithNumberFormatException ( ) { final org . jboss . dmr . StringModelValue value = new org . jboss . dmr . StringModelValue ( "hello" ) ; "<AssertPlaceHolder>" ; } asInt ( int ) { return value ; }
org . junit . Assert . assertEquals ( 5 , value . asInt ( 10 ) )
testAddNonMatchingCandidate ( ) { preconditions . addPrecondition ( "a" ) ; preconditions . addCandidate ( "c" ) ; "<AssertPlaceHolder>" ; } areSatisfied ( ) { if ( dirty ) { satisfied = candidates . containsAll ( preconditions ) ; dirty = false ; } return satisfied ; }
org . junit . Assert . assertFalse ( preconditions . areSatisfied ( ) )