input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testStartPositionAndMaxResults ( ) { java . util . List < java . lang . Object > list = template . setFirstResult ( 150 ) . setMaxResults ( 20 ) . getResultList ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . size ; }
|
org . junit . Assert . assertTrue ( ( ( list . size ( ) ) == 10 ) )
|
testSorteerOnderzoek ( ) { final nl . bzk . brp . domain . leveringmodel . MetaObject . Builder builder1 = nl . bzk . brp . domain . leveringmodel . MetaObject . maakBuilder ( ) ; final nl . bzk . brp . domain . leveringmodel . Actie actieInhoud = nl . bzk . brp . domain . leveringmodel . TestVerantwoording . maakActie ( 1 , nl . bzk . brp . domain . leveringmodel . helper . TestDatumUtil . gisteren ( ) ) ; builder1 . metId ( 111 ) . metObjectElement ( Element . ONDERZOEK . getId ( ) ) . metGroep ( ) . metGroepElement ( Element . ONDERZOEK_STANDAARD . getId ( ) ) . metRecord ( ) . metId ( 456 ) . metActieInhoud ( actieInhoud ) . metAttribuut ( Element . ONDERZOEK_DATUMAANVANG . getId ( ) , 20101011 ) . eindeRecord ( ) . eindeGroep ( ) . eindeObject ( ) ; final nl . bzk . brp . domain . leveringmodel . MetaObject . Builder builder2 = nl . bzk . brp . domain . leveringmodel . MetaObject . maakBuilder ( ) ; builder2 . metId ( 111 ) . metObjectElement ( Element . ONDERZOEK . getId ( ) ) . metGroep ( ) . metGroepElement ( Element . ONDERZOEK_STANDAARD . getId ( ) ) . metRecord ( ) . metId ( 457 ) . metActieInhoud ( actieInhoud ) . metAttribuut ( Element . ONDERZOEK_DATUMAANVANG . getId ( ) , 19000000 ) . eindeRecord ( ) . eindeGroep ( ) . eindeObject ( ) ; final nl . bzk . brp . domain . leveringmodel . persoon . Persoonslijst persoonsLijst = new nl . bzk . brp . domain . leveringmodel . persoon . Persoonslijst ( nl . bzk . brp . domain . leveringmodel . helper . TestBuilders . maakLeegPersoon ( ) . metObject ( builder1 ) . metObject ( builder2 ) . build ( ) , 0L ) ; final nl . bzk . brp . service . maakbericht . algemeen . Berichtgegevens berichtgegevens = new nl . bzk . brp . service . maakbericht . algemeen . Berichtgegevens ( null , persoonsLijst , null , null , new nl . bzk . brp . service . maakbericht . bepaling . StatischePersoongegevens ( ) ) ; final nl . bzk . brp . service . maakbericht . builders . BerichtObjectComparator berichtObjectComparator = new nl . bzk . brp . service . maakbericht . builders . BerichtObjectComparator ( berichtgegevens ) ; final int compare = berichtObjectComparator . compare ( builder1 . build ( ) , builder2 . build ( ) ) ; "<AssertPlaceHolder>" ; } build ( ) { final nl . bzk . brp . bijhouding . business . stappen . resultaat . Resultaat resultaat = new nl . bzk . brp . bijhouding . business . stappen . resultaat . Resultaat ( ) ; resultaat . meldingen = meldingen ; resultaat . toegepasteDeblokkeerverzoeken = toegepasteDeblokkeerverzoeken ; resultaat . teArchiverenPersoonIdsIngaandBericht = teArchiverenPersoonIdsIngaandBericht ; resultaat . administratieveHandeling = administratieveHandeling ; org . springframework . util . Assert . notNull ( meldingen ) ; org . springframework . util . Assert . notNull ( toegepasteDeblokkeerverzoeken ) ; org . springframework . util . Assert . notNull ( teArchiverenPersoonIdsIngaandBericht ) ; return resultaat ; }
|
org . junit . Assert . assertEquals ( 1 , compare )
|
testFindBeanManager ( ) { "<AssertPlaceHolder>" ; } findBeanManager ( ) { javax . enterprise . inject . spi . BeanManager bm = null ; try { javax . naming . Context initialContext = new javax . naming . InitialContext ( ) ; if ( ( ( jndiKey ) != null ) && ( ( jndiKey . trim ( ) . length ( ) ) > 0 ) ) { bm = lookup ( initialContext , jndiKey ) ; } if ( bm == null ) { bm = lookup ( initialContext , org . apache . struts2 . cdi . CdiObjectFactory . CDI_JNDIKEY_BEANMANAGER_COMP ) ; } if ( bm == null ) { bm = lookup ( initialContext , org . apache . struts2 . cdi . CdiObjectFactory . CDI_JNDIKEY_BEANMANAGER_APP ) ; } if ( bm == null ) { bm = lookup ( initialContext , org . apache . struts2 . cdi . CdiObjectFactory . CDI_JNDIKEY_BEANMANAGER_COMP_ENV ) ; } if ( bm == null ) { org . apache . struts2 . cdi . CdiObjectFactory . LOG . error ( "[findBeanManager]:<sp>Could<sp>not<sp>find<sp>BeanManager<sp>instance<sp>for<sp>any<sp>given<sp>JNDI<sp>key,<sp>giving<sp>up" ) ; } } catch ( javax . naming . NamingException e ) { org . apache . struts2 . cdi . CdiObjectFactory . LOG . error ( "[findBeanManager]:<sp>Unable<sp>to<sp>get<sp>InitialContext<sp>for<sp>BeanManager<sp>lookup" , e ) ; } return bm ; }
|
org . junit . Assert . assertNotNull ( new org . apache . struts2 . cdi . CdiObjectFactory ( ) . findBeanManager ( ) )
|
ibanShouldReturnValidOwnerAccountType ( ) { org . iban4j . Iban iban = new org . iban4j . Iban . Builder ( ) . countryCode ( CountryCode . BR ) . bankCode ( "00360305" ) . branchCode ( "00001" ) . accountNumber ( "0009795493" ) . accountType ( "P" ) . ownerAccountType ( "1" ) . build ( ) ; "<AssertPlaceHolder>" ; } getOwnerAccountType ( ) { return org . iban4j . IbanUtil . getOwnerAccountType ( value ) ; }
|
org . junit . Assert . assertThat ( iban . getOwnerAccountType ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( "1" ) ) )
|
completeShortStatementWhenEmpty ( ) { "<AssertPlaceHolder>" ; } completeShortFormStatement ( java . lang . String ) { java . lang . String lcStatement = statement . toLowerCase ( ) . trim ( ) ; if ( ( ( ( lcStatement . isEmpty ( ) ) || ( lcStatement . startsWith ( "," ) ) ) || ( lcStatement . startsWith ( "where<sp>" ) ) ) || ( lcStatement . startsWith ( "order<sp>by<sp>" ) ) ) { return "select<sp>doc.fullName<sp>from<sp>XWikiDocument<sp>doc<sp>" + ( statement . trim ( ) ) ; } return statement ; }
|
org . junit . Assert . assertEquals ( "select<sp>doc.fullName<sp>from<sp>XWikiDocument<sp>doc<sp>" , this . executor . completeShortFormStatement ( "" ) )
|
setIdTag_string20_isSet ( ) { java . lang . String validString = aString ( 20 ) ; request . setIdTag ( validString ) ; "<AssertPlaceHolder>" ; } getIdTag ( ) { return idTag ; }
|
org . junit . Assert . assertThat ( request . getIdTag ( ) , org . hamcrest . CoreMatchers . equalTo ( validString ) )
|
testNoWriteThrough ( ) { javax . cache . spi . CachingProvider cachingProvider = javax . cache . Caching . getCachingProvider ( ) ; java . util . Properties p = new java . util . Properties ( ) ; try ( javax . cache . CacheManager cacheManager = cachingProvider . getCacheManager ( cachingProvider . getDefaultURI ( ) , cachingProvider . getDefaultClassLoader ( ) , p ) ) { blazingcache . jcache . CacheWriterTest . MockCacheWriter external = new blazingcache . jcache . CacheWriterTest . MockCacheWriter ( ) ; javax . cache . configuration . MutableConfiguration < java . lang . String , java . lang . String > config = new javax . cache . configuration . MutableConfiguration < java . lang . String , java . lang . String > ( ) . setTypes ( java . lang . String . class , java . lang . String . class ) . setCacheWriterFactory ( new javax . cache . configuration . FactoryBuilder . SingletonFactory < > ( external ) ) . setWriteThrough ( false ) ; javax . cache . Cache < java . lang . String , java . lang . String > cache = cacheManager . createCache ( "simpleCache" , config ) ; java . lang . String key = "key" ; cache . put ( key , "some_datum" ) ; java . lang . String result = external . database . get ( key ) ; "<AssertPlaceHolder>" ; } } get ( K ) { checkClosed ( ) ; if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } return get ( key , true , true , null ) ; }
|
org . junit . Assert . assertNull ( result )
|
testGetDataSources ( ) { org . biopax . paxtools . pattern . miner . SIFSearcher searcher = new org . biopax . paxtools . pattern . miner . SIFSearcher ( org . biopax . paxtools . pattern . miner . SIFEnum . values ( ) ) ; org . biopax . paxtools . pattern . miner . Set < org . biopax . paxtools . pattern . miner . SIFInteraction > inters = searcher . searchSIF ( model_urea ) ; org . biopax . paxtools . pattern . miner . Set < java . lang . String > dataSources = new org . biopax . paxtools . pattern . miner . HashSet < java . lang . String > ( ) ; for ( org . biopax . paxtools . pattern . miner . SIFInteraction inter : inters ) { dataSources . addAll ( inter . getDataSources ( ) ) ; } "<AssertPlaceHolder>" ; } isEmpty ( ) { return elements . isEmpty ( ) ; }
|
org . junit . Assert . assertFalse ( dataSources . isEmpty ( ) )
|
testContainsKeyForExistingEntry ( ) { java . lang . String participantId = "participantId" ; final boolean isGloballyVisible = false ; final long expiryDateMs = Long . MAX_VALUE ; final boolean isSticky = false ; final boolean allowUpdate = false ; subject . put ( participantId , new joynr . system . RoutingTypes . Address ( ) , isGloballyVisible , expiryDateMs , isSticky , allowUpdate ) ; "<AssertPlaceHolder>" ; } containsKey ( java . lang . String ) { boolean containsKey = hashMap . containsKey ( participantId ) ; io . joynr . messaging . routing . RoutingTableImpl . logger . trace ( "checking<sp>for<sp>participant:<sp>{}<sp>success:<sp>{}" , participantId , containsKey ) ; if ( ! containsKey ) { dumpRoutingTableEntry ( ) ; } return containsKey ; }
|
org . junit . Assert . assertTrue ( subject . containsKey ( participantId ) )
|
hBaseShouldStart ( ) { java . lang . String tableName = fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . configuration . getString ( fr . jetoile . hadoopunit . integrationtest . HBASE_TEST_TABLE_NAME_KEY ) ; java . lang . String colFamName = fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . configuration . getString ( fr . jetoile . hadoopunit . integrationtest . HBASE_TEST_COL_FAMILY_NAME_KEY ) ; java . lang . String colQualiferName = fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . configuration . getString ( fr . jetoile . hadoopunit . integrationtest . HBASE_TEST_COL_QUALIFIER_NAME_KEY ) ; java . lang . Integer numRowsToPut = fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . configuration . getInt ( fr . jetoile . hadoopunit . integrationtest . HBASE_TEST_NUM_ROWS_TO_PUT_KEY ) ; org . apache . hadoop . conf . Configuration hbaseConfiguration = org . apache . hadoop . hbase . HBaseConfiguration . create ( ) ; hbaseConfiguration . set ( "hbase.zookeeper.quorum" , fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . configuration . getString ( fr . jetoile . hadoopunit . integrationtest . ZOOKEEPER_HOST_KEY ) ) ; hbaseConfiguration . setInt ( "hbase.zookeeper.property.clientPort" , fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . configuration . getInt ( fr . jetoile . hadoopunit . integrationtest . ZOOKEEPER_PORT_KEY ) ) ; hbaseConfiguration . set ( "hbase.master" , ( "127.0.0.1:" + ( fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . configuration . getInt ( fr . jetoile . hadoopunit . integrationtest . HBASE_MASTER_PORT_KEY ) ) ) ) ; hbaseConfiguration . set ( "zookeeper.znode.parent" , fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . configuration . getString ( fr . jetoile . hadoopunit . integrationtest . HBASE_ZNODE_PARENT_KEY ) ) ; fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . LOGGER . info ( "HBASE:<sp>Deleting<sp>table<sp>{}" , tableName ) ; fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . deleteHbaseTable ( tableName , hbaseConfiguration ) ; fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . LOGGER . info ( "HBASE:<sp>Creating<sp>table<sp>{}<sp>with<sp>column<sp>family<sp>{}" , tableName , colFamName ) ; fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . createHbaseTable ( tableName , colFamName , hbaseConfiguration ) ; fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . LOGGER . info ( "HBASE:<sp>Populate<sp>the<sp>table<sp>with<sp>{}<sp>rows." , numRowsToPut ) ; for ( int i = 0 ; i < numRowsToPut ; i ++ ) { fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . putRow ( tableName , colFamName , java . lang . String . valueOf ( i ) , colQualiferName , ( "row_" + i ) , hbaseConfiguration ) ; } fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . LOGGER . info ( "HBASE:<sp>Fetching<sp>and<sp>comparing<sp>the<sp>results" ) ; for ( int i = 0 ; i < numRowsToPut ; i ++ ) { fr . jetoile . hadoopunit . integrationtest . Result result = fr . jetoile . hadoopunit . integrationtest . ManualIntegrationBootstrapTest . getRow ( tableName , colFamName , java . lang . String . valueOf ( i ) , colQualiferName , hbaseConfiguration ) ; "<AssertPlaceHolder>" ; } } getRow ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , org . apache . hadoop . conf . Configuration ) { fr . jetoile . hadoopunit . integrationtest . Result result ; fr . jetoile . hadoopunit . integrationtest . HTable table = new fr . jetoile . hadoopunit . integrationtest . HTable ( configuration , tableName ) ; fr . jetoile . hadoopunit . integrationtest . Get get = new fr . jetoile . hadoopunit . integrationtest . Get ( org . apache . hadoop . hbase . util . Bytes . toBytes ( rowKey ) ) ; get . addColumn ( org . apache . hadoop . hbase . util . Bytes . toBytes ( colFamName ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( colQualifier ) ) ; get . setMaxVersions ( 1 ) ; result = table . get ( get ) ; return result ; }
|
org . junit . Assert . assertEquals ( ( "row_" + i ) , new java . lang . String ( result . value ( ) ) )
|
testGetUserById ( ) { when ( userRepository . findById ( user . getId ( ) ) ) . thenReturn ( user ) ; io . lavagna . model . User u = userController . getUser ( user . getId ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( user , u )
|
testKinesisOperations ( ) { java . lang . String streamName = "java-test-stream-" + ( java . lang . System . currentTimeMillis ( ) ) ; boolean created = false ; try { System . out . println ( "Creating<sp>Stream..." ) ; client . createStream ( new com . amazonaws . services . kinesis . model . CreateStreamRequest ( ) . withStreamName ( streamName ) . withShardCount ( 1 ) ) ; System . out . println ( "<sp>OK" ) ; created = true ; findStreamInList ( streamName ) ; System . out . println ( "Waiting<sp>for<sp>stream<sp>to<sp>become<sp>active..." ) ; java . util . List < com . amazonaws . services . kinesis . model . Shard > shards = waitForStream ( streamName ) ; System . out . println ( "<sp>OK" ) ; "<AssertPlaceHolder>" ; com . amazonaws . services . kinesis . model . Shard shard = shards . get ( 0 ) ; java . lang . Thread . sleep ( 5000 ) ; testPuts ( streamName , shard ) ; java . lang . Thread . sleep ( 5000 ) ; System . out . println ( "Reading..." ) ; testGets ( streamName , shard ) ; System . out . println ( "<sp>OK" ) ; } finally { if ( created ) { client . deleteStream ( new com . amazonaws . services . kinesis . model . DeleteStreamRequest ( ) . withStreamName ( streamName ) ) ; } } } size ( ) { return com . amazonaws . http . IdleConnectionReaper . CONNECTION_MANAGERS . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , shards . size ( ) )
|
testGetNameWithEscapedColumnName ( ) { java . lang . String expected = "\"column\"" ; org . deegree . commons . jdbc . SQLIdentifier actual = new org . deegree . commons . jdbc . SQLIdentifier ( expected ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertEquals ( expected , actual . getName ( ) )
|
shouldReturnFalseWhenFileSizeIsLowerThanMaxSize ( ) { final long maxSize = 10 ; final org . neo4j . kernel . impl . transaction . log . pruning . FileSizeThreshold threshold = new org . neo4j . kernel . impl . transaction . log . pruning . FileSizeThreshold ( fs , maxSize ) ; when ( fs . getFileSize ( file ) ) . thenReturn ( 5L ) ; threshold . init ( ) ; final boolean result = threshold . reached ( file , version , source ) ; "<AssertPlaceHolder>" ; } reached ( java . io . File , long , org . neo4j . kernel . impl . transaction . log . LogFileInformation ) { try { long lastTx = source . getFirstEntryId ( ( version + 1 ) ) ; if ( lastTx == ( - 1 ) ) { throw new java . lang . IllegalStateException ( ( "The<sp>next<sp>version<sp>should<sp>always<sp>exist,<sp>since<sp>this<sp>is<sp>called<sp>after<sp>rotation<sp>and<sp>the<sp>" + "PruneStrategy<sp>never<sp>checks<sp>the<sp>current<sp>active<sp>log<sp>file" ) ) ; } long highest = source . getLastEntryId ( ) ; return ( highest - lastTx ) >= ( maxTransactionCount ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } }
|
org . junit . Assert . assertFalse ( result )
|
testCloning ( ) { com . flowpowered . math . matrix . Matrix4d matrix = new com . flowpowered . math . matrix . Matrix4d ( 1 , 2 , 3 , 4 , 0 , 2 , 0 , 0 , 0 , 0 , 3 , 0 , 0 , 0 , 0 , 4 ) ; "<AssertPlaceHolder>" ; } clone ( ) { return new com . flowpowered . math . matrix . Matrix3f ( this ) ; }
|
org . junit . Assert . assertEquals ( matrix , matrix . clone ( ) )
|
testMixAddIntInt ( ) { int expected = 573785173 ; int actual = de . nx42 . maps4cim . map . texture . data . Texture . mixAdd ( 287454020 , 286331153 ) ; "<AssertPlaceHolder>" ; } mixAdd ( int , int ) { return ( ( ( ( texture1 & 255 ) + ( texture2 & 255 ) ) | ( ( ( ( texture1 > > > 8 ) & 255 ) + ( ( texture2 > > > 8 ) & 255 ) ) << 8 ) ) | ( ( ( ( texture1 > > > 16 ) & 255 ) + ( ( texture2 > > > 16 ) & 255 ) ) << 16 ) ) | ( ( ( ( texture1 > > > 24 ) & 255 ) + ( ( texture2 > > > 24 ) & 255 ) ) << 24 ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testToArrayShouldNullElementAfterLastEntry ( ) { it . unimi . dsi . fastutil . ints . IntSet set = IntSets . EMPTY_SET ; java . lang . Object [ ] values = new java . lang . Object [ ] { "test" } ; set . toArray ( values ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNull ( values [ 0 ] )
|
deactivateOSPFTest ( ) { startResource ( ) ; org . opennaas . extensions . router . capability . ospf . IOSPFCapability ospfCapability = ( ( org . opennaas . extensions . router . capability . ospf . IOSPFCapability ) ( routerResource . getCapability ( org . opennaas . itests . helpers . InitializerTestHelper . getCapabilityInformation ( TestsConstants . OSPF_CAPABILIY_TYPE ) ) ) ) ; ospfCapability . deactivateOSPF ( ) ; org . opennaas . extensions . queuemanager . IQueueManagerCapability queueCapability = ( ( org . opennaas . extensions . queuemanager . IQueueManagerCapability ) ( routerResource . getCapability ( org . opennaas . itests . helpers . InitializerTestHelper . getCapabilityInformation ( TestsConstants . QUEUE_CAPABILIY_TYPE ) ) ) ) ; org . opennaas . core . resources . queue . QueueResponse queueResponse = ( ( org . opennaas . core . resources . queue . QueueResponse ) ( queueCapability . execute ( ) ) ) ; "<AssertPlaceHolder>" ; stopResource ( ) ; } isOk ( ) { for ( org . opennaas . core . resources . action . ActionResponse action : responses ) { if ( ( action . getStatus ( ) ) == ( org . opennaas . core . resources . action . ActionResponse . STATUS . ERROR ) ) return false ; } return ( getConfirmResponse ( ) . getStatus ( ) . equals ( STATUS . OK ) ) && ( getRefreshResponse ( ) . getStatus ( ) . equals ( STATUS . OK ) ) ; }
|
org . junit . Assert . assertTrue ( queueResponse . isOk ( ) )
|
testESuperTypeLastIndexOf ( ) { org . eclipse . emf . ecore . EClass eClass1 = EcoreFactory . eINSTANCE . createEClass ( ) ; eClass1 . setName ( "Class1" ) ; org . eclipse . emf . ecore . EClass eClass2 = EcoreFactory . eINSTANCE . createEClass ( ) ; eClass2 . setName ( "Class2" ) ; eClass2 . getESuperTypes ( ) . add ( eClass1 ) ; "<AssertPlaceHolder>" ; } lastIndexOf ( java . lang . Object ) { getterCalled ( ) ; return wrappedList . lastIndexOf ( o ) ; }
|
org . junit . Assert . assertEquals ( 0 , eClass2 . getESuperTypes ( ) . lastIndexOf ( eClass1 ) )
|
testSimpleExamplesEnglishSnowball ( ) { org . terrier . terms . Stemmer stemmer = new org . terrier . terms . EnglishSnowballStemmer ( null ) ; final int l = TestPorterStemmer . TEST_EXAMPLES . length ; for ( int i = 0 ; i < ( l / 2 ) ; i ++ ) { "<AssertPlaceHolder>" ; } } stem ( java . lang . String ) { stemmer . setCurrent ( term ) ; try { stemMethod . invoke ( stemmer , org . terrier . terms . SnowballStemmer . emptyArgs ) ; } catch ( java . lang . Exception e ) { System . err . println ( ( ( ( "ERROR:<sp>Cannot<sp>use<sp>snowball<sp>stemmer<sp>" + ( language ) ) + "<sp>:<sp>" ) + e ) ) ; e . printStackTrace ( ) ; } return stemmer . getCurrent ( ) ; }
|
org . junit . Assert . assertEquals ( TestPorterStemmer . TEST_EXAMPLES [ ( i + 1 ) ] , stemmer . stem ( TestPorterStemmer . TEST_EXAMPLES [ i ] ) )
|
testSetMinutes ( ) { org . opengis . util . InternationalString result = periodDuration1 . getMinutes ( ) ; ( ( org . geotools . temporal . object . DefaultPeriodDuration ) ( periodDuration1 ) ) . setMinutes ( new org . geotools . util . SimpleInternationalString ( "4" ) ) ; "<AssertPlaceHolder>" ; } getMinutes ( ) { return ( ( java . math . BigInteger ) ( getMixed ( ) . get ( Gml311Package . eINSTANCE . getDocumentRoot_Minutes ( ) , true ) ) ) ; }
|
org . junit . Assert . assertFalse ( periodDuration1 . getMinutes ( ) . equals ( result ) )
|
testEqualHashCode ( ) { com . streamreduce . core . model . OutboundConfiguration outboundConfigurationA = new com . streamreduce . core . model . OutboundConfiguration . Builder ( ) . credentials ( new com . streamreduce . core . model . ConnectionCredentials ( "user" , "pass" ) ) . protocol ( "s3" ) . destination ( "bucket" ) . namespace ( "prefix" ) . dataTypes ( OutboundDataType . PROCESSED ) . build ( ) ; com . streamreduce . core . model . OutboundConfiguration outboundConfigurationB = new com . streamreduce . core . model . OutboundConfiguration . Builder ( ) . credentials ( new com . streamreduce . core . model . ConnectionCredentials ( "user" , "pass" ) ) . protocol ( "s3" ) . destination ( "bucket" ) . namespace ( "prefix" ) . dataTypes ( OutboundDataType . PROCESSED ) . build ( ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return ( name ) != null ? name . hashCode ( ) : 0 ; }
|
org . junit . Assert . assertEquals ( outboundConfigurationA . hashCode ( ) , outboundConfigurationB . hashCode ( ) )
|
getRepositories ( ) { this . mocker . getComponentUnderTest ( ) . addRepository ( this . descriptor ) ; java . util . Collection < org . xwiki . extension . repository . ExtensionRepository > repositorties = this . mocker . getComponentUnderTest ( ) . getRepositories ( ) ; "<AssertPlaceHolder>" ; } getRepositories ( ) { this . mocker . getComponentUnderTest ( ) . addRepository ( this . descriptor ) ; java . util . Collection < org . xwiki . extension . repository . ExtensionRepository > repositorties = this . mocker . getComponentUnderTest ( ) . getRepositories ( ) ; org . junit . Assert . assertEquals ( java . util . Arrays . asList ( this . testRepository ) , new java . util . ArrayList < org . xwiki . extension . repository . ExtensionRepository > ( repositorties ) ) ; }
|
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( this . testRepository ) , new java . util . ArrayList < org . xwiki . extension . repository . ExtensionRepository > ( repositorties ) )
|
ralfTest ( ) { java . sql . Statement stmt = sharedConnection . createStatement ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { stmt . execute ( ( ( "INSERT<sp>INTO<sp>Drivert2<sp>(test)<sp>VALUES<sp>('aa" + i ) + "')" ) ) ; } java . sql . PreparedStatement ps = sharedConnection . prepareStatement ( "SELECT<sp>*<sp>FROM<sp>Drivert2<sp>where<sp>test<sp>like'%%'<sp>limit<sp>?" ) ; ps . setInt ( 1 , 5 ) ; ps . addBatch ( ) ; java . sql . ResultSet rs = ps . executeQuery ( ) ; int result = 0 ; while ( rs . next ( ) ) { result ++ ; } "<AssertPlaceHolder>" ; } next ( ) { if ( isClosed ) { throw new java . sql . SQLException ( "Operation<sp>not<sp>permit<sp>on<sp>a<sp>closed<sp>resultSet" , "HY000" ) ; } if ( ( rowPointer ) < ( ( dataSize ) - 1 ) ) { ( rowPointer ) ++ ; return true ; } else { if ( ( streaming ) && ( ! ( isEof ) ) ) { lock . lock ( ) ; try { if ( ! ( isEof ) ) { nextStreamingValue ( ) ; } } catch ( java . io . IOException ioe ) { throw handleIoException ( ioe ) ; } finally { lock . unlock ( ) ; } if ( ( resultSetScrollType ) == ( TYPE_FORWARD_ONLY ) ) { rowPointer = 0 ; return ( dataSize ) > 0 ; } else { ( rowPointer ) ++ ; return ( dataSize ) > ( rowPointer ) ; } } rowPointer = dataSize ; return false ; } }
|
org . junit . Assert . assertEquals ( result , 5 )
|
getLastCronInvocationTimeMillis_A$ ( ) { long actual = taskun . getLastCronInvocationTimeMillis ( ) ; "<AssertPlaceHolder>" ; } getLastCronInvocationTimeMillis ( ) { return cronInvocation . getPreviousCheckedTimeMillis ( ) ; }
|
org . junit . Assert . assertNotNull ( actual )
|
testInvisibleConstructorAndNoSetters ( ) { uk . co . jemos . podam . api . PodamFactory factory = new uk . co . jemos . podam . api . PodamFactoryImpl ( ) ; uk . co . jemos . podam . test . dto . pdm5 . InvisibleConstructorAndNoSettersPojo pojo = factory . manufacturePojo ( uk . co . jemos . podam . test . dto . pdm5 . InvisibleConstructorAndNoSettersPojo . class ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( pojo )
|
testGetAreaLength ( ) { defaultIsisInterface . setAreaLength ( 3 ) ; resultInt = defaultIsisInterface . getAreaLength ( ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; }
|
org . junit . Assert . assertThat ( resultInt , org . hamcrest . CoreMatchers . is ( 3 ) )
|
testInsertRowIllegalMethods ( ) { java . sql . Statement st = con . createStatement ( ResultSet . TYPE_SCROLL_INSENSITIVE , ResultSet . CONCUR_UPDATABLE ) ; java . sql . ResultSet rs = st . executeQuery ( "select<sp>*<sp>from<sp>updateable" ) ; "<AssertPlaceHolder>" ; rs . moveToInsertRow ( ) ; try { rs . cancelRowUpdates ( ) ; org . junit . Assert . fail ( "expected<sp>an<sp>exception<sp>when<sp>calling<sp>cancelRowUpdates()<sp>on<sp>the<sp>insert<sp>row" ) ; } catch ( java . sql . SQLException e ) { } try { rs . updateRow ( ) ; org . junit . Assert . fail ( "expected<sp>an<sp>exception<sp>when<sp>calling<sp>updateRow()<sp>on<sp>the<sp>insert<sp>row" ) ; } catch ( java . sql . SQLException e ) { } try { rs . deleteRow ( ) ; org . junit . Assert . fail ( "expected<sp>an<sp>exception<sp>when<sp>calling<sp>deleteRow()<sp>on<sp>the<sp>insert<sp>row" ) ; } catch ( java . sql . SQLException e ) { } try { rs . refreshRow ( ) ; org . junit . Assert . fail ( "expected<sp>an<sp>exception<sp>when<sp>calling<sp>refreshRow()<sp>on<sp>the<sp>insert<sp>row" ) ; } catch ( java . sql . SQLException e ) { } rs . close ( ) ; st . close ( ) ; } executeQuery ( java . lang . String ) { if ( ! ( executeWithFlags ( sql , 0 ) ) ) { throw new org . postgresql . util . PSQLException ( org . postgresql . util . GT . tr ( "No<sp>results<sp>were<sp>returned<sp>by<sp>the<sp>query." ) , org . postgresql . util . PSQLState . NO_DATA ) ; } return getSingleResultSet ( ) ; }
|
org . junit . Assert . assertNotNull ( rs )
|
testAuthenticationCreation ( ) { mockHudson ( ) ; java . io . File f = new java . io . File ( "/tmp/.hudsonrsa" ) ; if ( ! ( f . exists ( ) ) ) f . createNewFile ( ) ; hudson . scm . credential . SshPublicKeyCredential sshKey = new hudson . scm . credential . SshPublicKeyCredential ( "username" , "password" , f ) ; org . tmatesoft . svn . core . auth . SVNSSHAuthentication authent = sshKey . createSVNAuthentication ( ISVNAuthenticationManager . SSH ) ; "<AssertPlaceHolder>" ; } createSVNAuthentication ( java . lang . String ) { if ( kind . equals ( ISVNAuthenticationManager . SSH ) ) { try { hudson . remoting . Channel channel = hudson . remoting . Channel . current ( ) ; java . lang . String privateKey ; if ( channel != null ) { privateKey = channel . call ( new hudson . remoting . Callable < java . lang . String , java . io . IOException > ( ) { public java . lang . String call ( ) throws java . io . IOException { return org . apache . commons . io . FileUtils . readFileToString ( getKeyFile ( ) , hudson . scm . credential . Messages . SshPublicKeyCredential_private_key_encoding ( ) ) ; } } ) ; } else { privateKey = org . apache . commons . io . FileUtils . readFileToString ( getKeyFile ( ) , hudson . scm . credential . Messages . SshPublicKeyCredential_private_key_encoding ( ) ) ; } return new org . tmatesoft . svn . core . auth . SVNSSHAuthentication ( userName , privateKey . toCharArray ( ) , hudson . util . Scrambler . descramble ( passphrase ) , ( - 1 ) , false , null , false ) ; } catch ( java . io . IOException e ) { throw new org . tmatesoft . svn . core . SVNException ( org . tmatesoft . svn . core . SVNErrorMessage . create ( SVNErrorCode . AUTHN_CREDS_UNAVAILABLE , hudson . scm . credential . Messages . SshPublicKeyCredential_private_key_load_error ( ) ) , e ) ; } catch ( java . lang . InterruptedException e ) { throw new org . tmatesoft . svn . core . SVNException ( org . tmatesoft . svn . core . SVNErrorMessage . create ( SVNErrorCode . AUTHN_CREDS_UNAVAILABLE , hudson . scm . credential . Messages . SshPublicKeyCredential_private_key_load_error ( ) ) , e ) ; } } return null ; }
|
org . junit . Assert . assertNotNull ( authent )
|
testRandomSync ( ) { byte [ ] sync = org . apache . avro . TestDataFileCustomSync . generateSync ( ) ; byte [ ] randSyncFile = createDataFile ( null ) ; byte [ ] customSyncFile = createDataFile ( sync ) ; "<AssertPlaceHolder>" ; } createDataFile ( byte [ ] ) { org . apache . avro . Schema schema = org . apache . avro . Schema . create ( Type . STRING ) ; org . apache . avro . file . DataFileWriter < org . apache . avro . util . Utf8 > w = new org . apache . avro . file . DataFileWriter ( new org . apache . avro . generic . GenericDatumWriter ( schema ) ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; w . create ( schema , baos , sync ) ; w . append ( new org . apache . avro . util . Utf8 ( "apple" ) ) ; w . append ( new org . apache . avro . util . Utf8 ( "banana" ) ) ; w . sync ( ) ; w . append ( new org . apache . avro . util . Utf8 ( "celery" ) ) ; w . append ( new org . apache . avro . util . Utf8 ( "date" ) ) ; w . sync ( ) ; w . append ( new org . apache . avro . util . Utf8 ( "endive" ) ) ; w . append ( new org . apache . avro . util . Utf8 ( "fig" ) ) ; w . close ( ) ; return baos . toByteArray ( ) ; }
|
org . junit . Assert . assertFalse ( java . util . Arrays . equals ( randSyncFile , customSyncFile ) )
|
getDescendantLocations_shouldReturnAllDescendantLocationsIfIncludeRetiredIsTrue ( ) { org . openmrs . Location rootLocation = new org . openmrs . Location ( ) ; org . openmrs . Location locationOne = new org . openmrs . Location ( ) ; org . openmrs . Location locationTwo = new org . openmrs . Location ( ) ; org . openmrs . Location childOflocationOne = new org . openmrs . Location ( ) ; org . openmrs . Location childOnfLocationTwo = new org . openmrs . Location ( ) ; rootLocation . setChildLocations ( new java . util . HashSet ( java . util . Arrays . asList ( locationOne , locationTwo ) ) ) ; locationOne . setChildLocations ( new java . util . HashSet ( java . util . Collections . singletonList ( childOflocationOne ) ) ) ; locationTwo . setChildLocations ( new java . util . HashSet ( java . util . Collections . singletonList ( childOnfLocationTwo ) ) ) ; childOflocationOne . setChildLocations ( new java . util . HashSet ( ) ) ; childOnfLocationTwo . setChildLocations ( new java . util . HashSet ( ) ) ; java . util . Set < org . openmrs . Location > descendantLocations = rootLocation . getDescendantLocations ( true ) ; java . util . Set < org . openmrs . Location > expectedLocations = new java . util . HashSet ( java . util . Arrays . asList ( locationOne , locationTwo , childOflocationOne , childOnfLocationTwo ) ) ; "<AssertPlaceHolder>" ; } getDescendantLocations ( boolean ) { java . util . Set < org . openmrs . Location > result = new java . util . HashSet ( ) ; for ( org . openmrs . Location childLocation : getChildLocations ( ) ) { if ( ( ! ( childLocation . getRetired ( ) ) ) || includeRetired ) { result . add ( childLocation ) ; result . addAll ( childLocation . getDescendantLocations ( includeRetired ) ) ; } } return result ; }
|
org . junit . Assert . assertThat ( descendantLocations , org . hamcrest . Matchers . equalTo ( expectedLocations ) )
|
testIsInstanceNotReady1 ( ) { ec2mock . createDescribeInstanceStatusResult ( "instance1" , "nok" , "nok" , "ok" ) ; boolean ready = ec2comm . isInstanceReady ( "instance1" ) ; "<AssertPlaceHolder>" ; } isInstanceReady ( java . lang . String ) { org . oscm . app . aws . EC2Communication . LOGGER . debug ( "isInstanceReady('{}')<sp>entered" , instanceId ) ; com . amazonaws . services . ec2 . model . DescribeInstanceStatusResult result = getEC2 ( ) . describeInstanceStatus ( new com . amazonaws . services . ec2 . model . DescribeInstanceStatusRequest ( ) . withInstanceIds ( instanceId ) ) ; java . util . List < com . amazonaws . services . ec2 . model . InstanceStatus > statusList = result . getInstanceStatuses ( ) ; boolean instanceStatus = false ; boolean systemStatus = false ; for ( com . amazonaws . services . ec2 . model . InstanceStatus status : statusList ) { org . oscm . app . aws . EC2Communication . LOGGER . debug ( "<sp>InstanceState:<sp>{}" , status . getInstanceState ( ) ) ; org . oscm . app . aws . EC2Communication . LOGGER . debug ( "<sp>InstanceStatus:<sp>{}" , status . getInstanceStatus ( ) . getStatus ( ) ) ; org . oscm . app . aws . EC2Communication . LOGGER . debug ( "<sp>SystemStatus:<sp>{}" , status . getSystemStatus ( ) . getStatus ( ) ) ; org . oscm . app . aws . EC2Communication . LOGGER . debug ( "<sp>AvailabilityZone:<sp>{}" , status . getAvailabilityZone ( ) ) ; instanceStatus = "ok" . equals ( status . getInstanceStatus ( ) . getStatus ( ) ) ; systemStatus = "ok" . equals ( status . getSystemStatus ( ) . getStatus ( ) ) ; } org . oscm . app . aws . EC2Communication . LOGGER . debug ( "isInstanceReady('{}')<sp>left" , instanceId ) ; return instanceStatus && systemStatus ; }
|
org . junit . Assert . assertFalse ( ready )
|
testNoGlobal ( ) { fr . inria . corese . core . Graph g = fr . inria . corese . core . Graph . create ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; java . lang . String init = "insert<sp>data<sp>{<sp>" + ( ( "<John><sp>rdf:value<sp>1,<sp>2<sp>." + "" ) + "}" ) ; java . lang . String qq = "select<sp>*" + ( ( ( ( "where<sp>{" + "bind<sp>(xt:test(?x)<sp>as<sp>?z)" ) + "?x<sp>?p<sp>?y<sp>" ) + "}" ) + "function<sp>xt:test(?x)<sp>{<sp>?y<sp>}<sp>" ) ; exec . query ( init ) ; fr . inria . corese . kgram . core . Mappings map = exec . query ( qq ) ; fr . inria . corese . kgram . api . core . Node n = map . getNode ( "?z" ) ; "<AssertPlaceHolder>" ; } getNode ( int ) { return nodes . get ( n ) ; }
|
org . junit . Assert . assertEquals ( null , n )
|
testGetSourcesWithNullSources ( ) { testMojo . sources = null ; java . util . Set < java . io . File > sources = testMojo . getSources ( ) ; "<AssertPlaceHolder>" ; } getSources ( ) { return getFiles ( sources , org . codehaus . gmavenplus . mojo . AbstractGroovySourcesMojo . MAIN , false ) ; }
|
org . junit . Assert . assertEquals ( 0 , sources . size ( ) )
|
addsQueryParam ( java . lang . String , java . lang . String , java . lang . String [ ] , java . lang . String ) { java . net . URI u = javax . ws . rs . core . UriBuilder . fromUri ( source ) . queryParam ( queryParamName , queryParamValues ) . build ( ) ; "<AssertPlaceHolder>" ; } create ( javax . servlet . http . HttpServletRequest ) { final java . net . URL forwardedUrl = org . everrest . core . servlet . ServletContainerRequest . getForwardedUrl ( req ) ; java . lang . String host ; int port ; if ( forwardedUrl == null ) { host = req . getServerName ( ) ; port = req . getServerPort ( ) ; } else { host = forwardedUrl . getHost ( ) ; port = forwardedUrl . getPort ( ) ; if ( port < 0 ) { port = forwardedUrl . getDefaultPort ( ) ; } org . everrest . core . servlet . ServletContainerRequest . LOG . debug ( "Assuming<sp>forwarded<sp>URL:<sp>{}" , forwardedUrl ) ; } final java . lang . StringBuilder commonUriBuilder = new java . lang . StringBuilder ( ) ; final java . lang . String scheme = org . everrest . core . servlet . ServletContainerRequest . getScheme ( req ) ; commonUriBuilder . append ( scheme ) ; commonUriBuilder . append ( "://" ) ; commonUriBuilder . append ( host ) ; if ( ! ( ( ( port < 0 ) || ( ( port == 80 ) && ( "http" . equals ( scheme ) ) ) ) || ( ( port == 443 ) && ( "https" . equals ( scheme ) ) ) ) ) { commonUriBuilder . append ( ':' ) ; commonUriBuilder . append ( port ) ; } final java . lang . String commonUriPrefix = commonUriBuilder . toString ( ) ; final java . lang . StringBuilder baseUriBuilder = new java . lang . StringBuilder ( commonUriPrefix ) ; baseUriBuilder . append ( req . getContextPath ( ) ) ; baseUriBuilder . append ( req . getServletPath ( ) ) ; final java . net . URI baseUri = java . net . URI . create ( baseUriBuilder . toString ( ) ) ; final java . lang . StringBuilder requestUriBuilder = new java . lang . StringBuilder ( commonUriPrefix ) ; requestUriBuilder . append ( req . getRequestURI ( ) ) ; final java . lang . String queryString = req . getQueryString ( ) ; if ( queryString != null ) { requestUriBuilder . append ( '?' ) ; requestUriBuilder . append ( queryString ) ; } final java . net . URI requestUri = java . net . URI . create ( requestUriBuilder . toString ( ) ) ; return new org . everrest . core . servlet . ServletContainerRequest ( org . everrest . core . servlet . ServletContainerRequest . getMethod ( req ) , requestUri , baseUri , org . everrest . core . servlet . ServletContainerRequest . getEntityStream ( req ) , org . everrest . core . servlet . ServletContainerRequest . getHeaders ( req ) , org . everrest . core . servlet . ServletContainerRequest . getSecurityContext ( req ) ) ; }
|
org . junit . Assert . assertEquals ( java . net . URI . create ( expected ) , u )
|
testVersionStrategy ( ) { database . setConflictStrategy ( "version" ) ; com . orientechnologies . orient . core . record . impl . ODocument rootDoc = new com . orientechnologies . orient . core . record . impl . ODocument ( ) . field ( "name" , "Jay" ) . save ( database . getClusterNameById ( database . getDefaultClusterId ( ) ) ) ; com . orientechnologies . orient . core . record . impl . ODocument copy = rootDoc . copy ( ) ; rootDoc . field ( "name" , "Jay1" ) ; rootDoc . save ( database . getClusterNameById ( database . getDefaultClusterId ( ) ) ) ; copy . field ( "name" , "Jay2" ) ; try { copy . save ( database . getClusterNameById ( database . getDefaultClusterId ( ) ) ) ; "<AssertPlaceHolder>" ; } catch ( com . orientechnologies . orient . core . exception . OConcurrentModificationException e ) { } } getDefaultClusterId ( ) { return defaultClusterId ; }
|
org . junit . Assert . assertTrue ( false )
|
testFloatObject ( ) { java . lang . Float t = 1.0F ; t = roundTrip ( t , org . apache . juneau . a . rttests . Float . class ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( new java . lang . Float ( 1.0F ) , t )
|
TSDLEnumTest ( ) { org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . createDummyTrace ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . enumTSDL ) ; trace = new org . eclipse . tracecompass . ctf . core . trace . CTFTrace ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . tempTraceDir ) ; "<AssertPlaceHolder>" ; } createDummyTrace ( java . lang . String ) { java . io . File dir = new java . io . File ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . tempTraceDir ) ; if ( dir . exists ( ) ) { org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . deltree ( dir ) ; } dir . mkdirs ( ) ; java . io . File metadataFile = new java . io . File ( ( ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . tempTraceDir ) + "/metadata" ) ) ; try ( java . io . FileWriter fw = new java . io . FileWriter ( metadataFile ) ) { fw . write ( metadata ) ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } byte [ ] magicLE = new byte [ ] { ( ( byte ) ( 193 ) ) , ( ( byte ) ( 31 ) ) , ( ( byte ) ( 252 ) ) , ( ( byte ) ( 193 ) ) } ; byte [ ] uuid = new byte [ ] { ( ( byte ) ( 176 ) ) , 77 , 57 , 27 , ( ( byte ) ( 231 ) ) , 54 , 68 , ( ( byte ) ( 193 ) ) , ( ( byte ) ( 141 ) ) , ( ( byte ) ( 137 ) ) , 75 , ( ( byte ) ( 180 ) ) , 56 , ( ( byte ) ( 133 ) ) , 127 , ( ( byte ) ( 141 ) ) } ; org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . Event ev = new org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . Event ( 2 , 2 ) ; final int nbEvents = ( ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . DATA_SIZE ) / ( ev . getSize ( ) ) ) - 1 ; final int contentSize = ( ( nbEvents * ( ev . getSize ( ) ) ) + ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . HEADER_SIZE ) ) * 8 ; java . nio . ByteBuffer data = java . nio . ByteBuffer . allocate ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . PACKET_SIZE ) ; data . order ( ByteOrder . LITTLE_ENDIAN ) ; data . clear ( ) ; data . put ( magicLE ) ; data . put ( uuid ) ; data . putInt ( 0 ) ; data . putLong ( 42240 ) ; data . putLong ( ( ( nbEvents * 65536 ) + 42406 ) ) ; data . putLong ( contentSize ) ; data . putLong ( ( ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . PACKET_SIZE ) * 8 ) ) ; data . putLong ( 0 ) ; data . putInt ( 0 ) ; for ( int i = 0 ; i < nbEvents ; i ++ ) { ev . setEventTimestamp ( ( ( i * 65536 ) + 42405 ) ) ; ev . setEventContent ( i ) ; ev . writeEvent ( data ) ; } data . flip ( ) ; java . io . File dummyFile = new java . io . File ( ( ( org . eclipse . tracecompass . ctf . core . tests . trace . IOstructgenTest . tempTraceDir ) + "/dummyChan" ) ) ; try ( java . io . FileOutputStream fos = new java . io . FileOutputStream ( dummyFile ) ) { fos . getChannel ( ) . write ( data ) ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } }
|
org . junit . Assert . assertNotNull ( trace )
|
testGetCpus ( ) { int cpus = host . getCpus ( ) ; "<AssertPlaceHolder>" ; } getCpus ( ) { return cpus ; }
|
org . junit . Assert . assertTrue ( ( cpus == 16 ) )
|
addCleanIDDoesNotAddNull ( ) { java . util . List < java . lang . String > list = new java . util . ArrayList < java . lang . String > ( ) ; webGroupDao . addCleanID ( null , list ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 0 , list . size ( ) )
|
testMap ( ) { java . util . Map < java . lang . String , java . lang . Object > aMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , com . amazonaws . services . dynamodbv2 . model . AttributeValue > exMap = new java . util . HashMap < java . lang . String , com . amazonaws . services . dynamodbv2 . model . AttributeValue > ( ) ; aMap . put ( "A" , "B" ) ; exMap . put ( "A" , new com . amazonaws . services . dynamodbv2 . model . AttributeValue ( ) . withS ( "B" ) ) ; aMap . put ( "C" , "D" ) ; exMap . put ( "C" , new com . amazonaws . services . dynamodbv2 . model . AttributeValue ( ) . withS ( "D" ) ) ; com . amazonaws . services . dynamodbv2 . model . AttributeValue expected = new com . amazonaws . services . dynamodbv2 . model . AttributeValue ( ) . withM ( exMap ) ; com . amazonaws . services . dynamodbv2 . model . AttributeValue actual = org . apache . hadoop . hive . dynamodb . type . HiveDynamoDBTypeUtil . parseObject ( aMap ) ; "<AssertPlaceHolder>" ; } parseObject ( java . lang . Object ) { if ( ( o instanceof java . lang . String ) || ( o instanceof org . apache . hadoop . io . Text ) ) { return new com . amazonaws . services . dynamodbv2 . model . AttributeValue ( ) . withS ( o . toString ( ) ) ; } else if ( o instanceof org . apache . hadoop . hive . serde2 . lazy . LazyDouble ) { return new com . amazonaws . services . dynamodbv2 . model . AttributeValue ( ) . withN ( o . toString ( ) ) ; } else if ( o instanceof java . util . Map ) { return org . apache . hadoop . hive . dynamodb . type . HiveDynamoDBTypeUtil . parseMap ( o ) ; } else { throw new java . lang . RuntimeException ( ( "Unsupported<sp>type:<sp>" + ( o . getClass ( ) . getName ( ) ) ) ) ; } }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testThrownErrorIsUnwrapped ( ) { final com . picocontainer . PicoContainer pico = mockery . mock ( com . picocontainer . PicoContainer . class ) ; final com . picocontainer . PicoVisitor visitor = new com . picocontainer . visitors . VerifyingVisitor ( ) ; final java . lang . Error error = new java . lang . InternalError ( "junit" ) ; final org . jmock . Sequence sequence = mockery . sequence ( "accepting" ) ; mockery . checking ( new org . jmock . Expectations ( ) { { one ( pico ) . accept ( with ( same ( visitor ) ) ) ; inSequence ( sequence ) ; one ( pico ) . accept ( with ( same ( visitor ) ) ) ; inSequence ( sequence ) ; will ( throwException ( error ) ) ; } } ) ; visitor . traverse ( pico ) ; try { visitor . traverse ( pico ) ; org . junit . Assert . fail ( "UndeclaredThrowableException<sp>expected" ) ; } catch ( java . lang . InternalError e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
|
org . junit . Assert . assertEquals ( "junit" , e . getMessage ( ) )
|
testOuterProductUpdate_4args ( ) { System . out . println ( "OuterProductUpdate" ) ; jsat . linear . Matrix A = jsat . linear . Matrix . eye ( 4 ) ; jsat . linear . Vec x = new jsat . linear . DenseVector ( new double [ ] { 1 , 2 , 3 , 4 } ) ; jsat . linear . Vec y = new jsat . linear . DenseVector ( new double [ ] { 5 , 6 , 7 , 8 } ) ; double c = 2.0 ; double [ ] [ ] expected = new double [ ] [ ] { new double [ ] { 11 , 12 , 14 , 16 } , new double [ ] { 20 , 25 , 28 , 32 } , new double [ ] { 30 , 36 , 43 , 48 } , new double [ ] { 40 , 48 , 56 , 65 } } ; jsat . linear . Matrix . OuterProductUpdate ( A , x , y , c ) ; for ( int i = 0 ; i < ( expected . length ) ; i ++ ) for ( int j = 0 ; j < ( expected . length ) ; j ++ ) "<AssertPlaceHolder>" ; } get ( long , java . util . concurrent . TimeUnit ) { return get ( ) ; }
|
org . junit . Assert . assertEquals ( expected [ i ] [ j ] , A . get ( i , j ) , 0.0 )
|
testGet_acceptsDisposedDisplay ( ) { display . dispose ( ) ; org . eclipse . rap . rwt . remote . RemoteObject remoteObject = org . eclipse . rap . rwt . internal . protocol . RemoteObjectFactory . getRemoteObject ( display ) ; "<AssertPlaceHolder>" ; } getRemoteObject ( org . eclipse . swt . widgets . Widget ) { org . eclipse . rap . rwt . internal . util . ParamCheck . notNull ( widget , "widget" ) ; return org . eclipse . rap . rwt . internal . protocol . RemoteObjectFactory . getForId ( org . eclipse . rap . rwt . internal . lifecycle . WidgetUtil . getId ( widget ) ) ; }
|
org . junit . Assert . assertNotNull ( remoteObject )
|
testFalse ( ) { "<AssertPlaceHolder>" ; } toTrueFalseString ( boolean ) { return org . dcache . util . Booleans . toPredefinedString ( value , "true" , "false" ) ; }
|
org . junit . Assert . assertEquals ( "false" , org . dcache . util . Booleans . toTrueFalseString ( false ) )
|
customDateFormatValidationShouldWork ( ) { when ( context . getParameter ( "param1" ) ) . thenReturn ( "blah" ) ; create ( "dateParam" , ninja . params . ControllerMethodInvokerTest . DateParamParser . class ) . invoke ( mockController , context ) ; verify ( mockController ) . dateParam ( null ) ; "<AssertPlaceHolder>" ; } hasViolation ( java . lang . String ) { return this . violations . containsKey ( paramName ) ; }
|
org . junit . Assert . assertTrue ( validation . hasViolation ( "param1" ) )
|
hasNotElapsedIfCurrentClockReadingIsNotEntirelyWithinTargetRange ( ) { expect ( mockClock . getGranularity ( ) ) . andReturn ( 1L ) . anyTimes ( ) ; expect ( mockClock . getNanoTime ( ) ) . andReturn ( new org . fishwife . jrugged . interval . DiscreteInterval ( 4L , 5L ) ) ; expect ( mockClock . getNanoTime ( ) ) . andReturn ( new org . fishwife . jrugged . interval . DiscreteInterval ( 900L , 1015L ) ) . anyTimes ( ) ; replay ( mockClock ) ; impl . set ( 1000L , 100L ) ; impl . start ( ) ; "<AssertPlaceHolder>" ; verify ( mockClock ) ; } hasElapsed ( ) { if ( ( startTime ) == null ) return false ; return ( clock . getNanoTime ( ) . getMin ( ) ) >= ( targetEndTime . getMin ( ) ) ; }
|
org . junit . Assert . assertFalse ( impl . hasElapsed ( ) )
|
intervalIsNotEqualToNonIntervals ( ) { org . fishwife . jrugged . interval . DiscreteInterval i1 = new org . fishwife . jrugged . interval . DiscreteInterval ( 1 , 6 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; org . fishwife . jrugged . interval . DiscreteInterval other = ( ( org . fishwife . jrugged . interval . DiscreteInterval ) ( obj ) ) ; if ( ( max ) != ( other . max ) ) return false ; if ( ( min ) != ( other . min ) ) return false ; return true ; }
|
org . junit . Assert . assertFalse ( i1 . equals ( new java . lang . Object ( ) ) )
|
testGetEventsInRangeNoEventsAtEdges ( ) { long count = org . eclipse . tracecompass . tmf . ctf . core . tests . temp . statistics . TmfStatisticsTest . backend . getEventsInRange ( org . eclipse . tracecompass . tmf . ctf . core . tests . temp . statistics . TmfStatisticsTest . t1 , org . eclipse . tracecompass . tmf . ctf . core . tests . temp . statistics . TmfStatisticsTest . t6 ) ; "<AssertPlaceHolder>" ; } getEventsInRange ( long , long ) { org . eclipse . tracecompass . tmf . core . timestamp . ITmfTimestamp startTS = org . eclipse . tracecompass . tmf . core . timestamp . TmfTimestamp . create ( start , org . eclipse . tracecompass . tmf . core . statistics . TmfEventsStatistics . SCALE ) ; org . eclipse . tracecompass . tmf . core . timestamp . ITmfTimestamp endTS = org . eclipse . tracecompass . tmf . core . timestamp . TmfTimestamp . create ( end , org . eclipse . tracecompass . tmf . core . statistics . TmfEventsStatistics . SCALE ) ; org . eclipse . tracecompass . tmf . core . timestamp . TmfTimeRange range = new org . eclipse . tracecompass . tmf . core . timestamp . TmfTimeRange ( startTS , endTS ) ; org . eclipse . tracecompass . tmf . core . statistics . TmfEventsStatistics . StatsTotalRequest request = new org . eclipse . tracecompass . tmf . core . statistics . TmfEventsStatistics . StatsTotalRequest ( trace , range ) ; sendAndWait ( request ) ; return request . getResult ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , count )
|
testMarked2 ( ) { java . lang . String md = loadResourceAsString ( "gitbucket.md" ) ; java . lang . String result = io . github . gitbucket . markedj . Marked . marked ( md , new io . github . gitbucket . markedj . Options ( ) ) ; java . lang . String expect = loadResourceAsString ( "gitbucket.html" ) ; "<AssertPlaceHolder>" ; } loadResourceAsString ( java . lang . String ) { java . io . InputStream in = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( path ) ; try { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; byte [ ] buf = new byte [ 1024 * 8 ] ; int length = 0 ; while ( ( length = in . read ( buf ) ) != ( - 1 ) ) { out . write ( buf , 0 , length ) ; } return new java . lang . String ( out . toByteArray ( ) , "UTF-8" ) ; } finally { in . close ( ) ; } }
|
org . junit . Assert . assertEquals ( expect , result )
|
testRemoveObjectNameFilter ( ) { connection = createConnection ( TestConfig . serverEndpoint , TestConfig . port ) ; com . voxeo . rayo . client . filter . XmppObjectNameFilter filter = new com . voxeo . rayo . client . filter . XmppObjectNameFilter ( "iq" ) ; filter . setDefaultTimeout ( 100 ) ; connection . addFilter ( filter ) ; connection . removeFilter ( filter ) ; connection . connect ( ) ; connection . login ( "userc" , "1" , "voxeo" ) ; "<AssertPlaceHolder>" ; } poll ( ) { final com . voxeo . moho . Call c = _queue . poll ( ) ; if ( c != null ) { if ( _shared ) { c . unjoin ( _mixer ) ; } dispatch ( new com . voxeo . moho . queue . DequeueEventImpl ( this , c ) ) ; } return c ; }
|
org . junit . Assert . assertNull ( filter . poll ( ) )
|
testEvaluate4 ( ) { com . huawei . streaming . expression . ArithmeticExpression arithmeticExpression = new com . huawei . streaming . expression . ArithmeticExpression ( ExpressionOperator . DIVIDE , new com . huawei . streaming . expression . ConstExpression ( com . huawei . streaming . support . SupportConst . I_TWO ) , new com . huawei . streaming . expression . ConstExpression ( com . huawei . streaming . support . SupportConst . I_THREE ) ) ; com . huawei . streaming . event . IEvent theEvent = new com . huawei . streaming . event . TupleEvent ( ) ; java . lang . Object actualResult = arithmeticExpression . evaluate ( theEvent ) ; int expectedResult = ( com . huawei . streaming . support . SupportConst . I_TWO ) / ( com . huawei . streaming . support . SupportConst . I_THREE ) ; "<AssertPlaceHolder>" ; } evaluate ( com . huawei . streaming . event . IEvent [ ] ) { if ( ( null == eventsPerStream ) || ( 0 == ( eventsPerStream . length ) ) ) { com . huawei . streaming . expression . ArithmeticExpression . LOG . error ( "Streams<sp>events<sp>are<sp>null." ) ; throw new com . huawei . streaming . exception . StreamingRuntimeException ( "Streams<sp>events<sp>are<sp>null." ) ; } com . huawei . streaming . expression . IExpression leftExpr = getLeftExpr ( ) ; com . huawei . streaming . expression . IExpression rightExpr = getRightExpr ( ) ; java . lang . Object lo = leftExpr . evaluate ( eventsPerStream ) ; java . lang . Object ro = rightExpr . evaluate ( eventsPerStream ) ; return compute ( lo , ro ) ; }
|
org . junit . Assert . assertEquals ( expectedResult , actualResult )
|
testIsTrue3 ( ) { software . amazon . awssdk . utils . Validate . isTrue ( true , "MSG" , 6 ) ; try { software . amazon . awssdk . utils . Validate . isTrue ( false , "MSG" , 6 ) ; org . junit . Assert . fail ( "Expecting<sp>IllegalArgumentException" ) ; } catch ( final java . lang . IllegalArgumentException ex ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { if ( ( awsErrorDetails ) != null ) { return ( ( ( ( ( ( ( awsErrorDetails ( ) . errorMessage ( ) ) + "<sp>(Service:<sp>" ) + ( awsErrorDetails ( ) . serviceName ( ) ) ) + ",<sp>Status<sp>Code:<sp>" ) + ( statusCode ( ) ) ) + ",<sp>Request<sp>ID:<sp>" ) + ( requestId ( ) ) ) + ")" ; } return super . getMessage ( ) ; }
|
org . junit . Assert . assertEquals ( "MSG" , ex . getMessage ( ) )
|
testGetContentReturnsNullAfterRemove ( ) { com . eclipsesource . tabris . widgets . swipe . SwipeItem item = mock ( com . eclipsesource . tabris . widgets . swipe . SwipeItem . class ) ; swipeItemHolder . addItem ( 0 , item ) ; org . eclipse . swt . widgets . Composite content = mock ( org . eclipse . swt . widgets . Composite . class ) ; swipeItemHolder . setContentForItem ( 0 , content ) ; swipeItemHolder . removeContentForItem ( 0 ) ; org . eclipse . swt . widgets . Control actualContent = swipeItemHolder . getContentForItem ( 0 ) ; "<AssertPlaceHolder>" ; } getContentForItem ( int ) { return contentHolder . get ( getKey ( index ) ) ; }
|
org . junit . Assert . assertNull ( actualContent )
|
assertValidationThrowsExceptionContainingMessagesForAllMinMaxConfigParameters ( ) { java . util . List < org . eclipse . smarthome . config . core . validation . ConfigValidationMessage > expected = java . util . stream . Stream . of ( new org . eclipse . smarthome . config . core . validation . ConfigValidationMessage ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . TXT_MIN_PARAM_NAME , MessageKey . MIN_VALUE_TXT_VIOLATED . defaultMessage , MessageKey . MIN_VALUE_TXT_VIOLATED . key , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . MIN . toString ( ) ) , new org . eclipse . smarthome . config . core . validation . ConfigValidationMessage ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . TXT_MAX_PARAM_NAME , MessageKey . MAX_VALUE_TXT_VIOLATED . defaultMessage , MessageKey . MAX_VALUE_TXT_VIOLATED . key , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . MAX . toString ( ) ) , new org . eclipse . smarthome . config . core . validation . ConfigValidationMessage ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . INT_MIN_PARAM_NAME , MessageKey . MIN_VALUE_NUMERIC_VIOLATED . defaultMessage , MessageKey . MIN_VALUE_NUMERIC_VIOLATED . key , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . MIN . toString ( ) ) , new org . eclipse . smarthome . config . core . validation . ConfigValidationMessage ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . INT_MAX_PARAM_NAME , MessageKey . MAX_VALUE_NUMERIC_VIOLATED . defaultMessage , MessageKey . MAX_VALUE_NUMERIC_VIOLATED . key , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . MAX . toString ( ) ) , new org . eclipse . smarthome . config . core . validation . ConfigValidationMessage ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . DECIMAL_MIN_PARAM_NAME , MessageKey . MIN_VALUE_NUMERIC_VIOLATED . defaultMessage , MessageKey . MIN_VALUE_NUMERIC_VIOLATED . key , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . DECIMAL_MIN . toString ( ) ) , new org . eclipse . smarthome . config . core . validation . ConfigValidationMessage ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . DECIMAL_MAX_PARAM_NAME , MessageKey . MAX_VALUE_NUMERIC_VIOLATED . defaultMessage , MessageKey . MAX_VALUE_NUMERIC_VIOLATED . key , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . DECIMAL_MAX . toString ( ) ) ) . collect ( toList ( ) ) ; try { params . put ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . TXT_MIN_PARAM_NAME , java . lang . String . valueOf ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . MIN_VIOLATED ) ) ; params . put ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . TXT_MAX_PARAM_NAME , java . lang . String . valueOf ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . MAX_VIOLATED ) ) ; params . put ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . INT_MIN_PARAM_NAME , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . MIN_VIOLATED ) ; params . put ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . INT_MAX_PARAM_NAME , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . MAX_VIOLATED ) ; params . put ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . DECIMAL_MIN_PARAM_NAME , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . DECIMAL_MIN_VIOLATED ) ; params . put ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . DECIMAL_MAX_PARAM_NAME , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . DECIMAL_MAX_VIOLATED ) ; configDescriptionValidator . validate ( params , org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . CONFIG_DESCRIPTION_URI ) ; failBecauseOfMissingConfigValidationException ( ) ; } catch ( org . eclipse . smarthome . config . core . validation . ConfigValidationException e ) { "<AssertPlaceHolder>" ; } } getConfigValidationMessages ( org . eclipse . smarthome . config . core . validation . ConfigValidationException ) { try { java . lang . reflect . Field field = cve . getClass ( ) . getDeclaredField ( "configValidationMessages" ) ; field . setAccessible ( true ) ; return ( ( java . util . List < org . eclipse . smarthome . config . core . validation . ConfigValidationMessage > ) ( field . get ( cve ) ) ) ; } catch ( java . lang . NoSuchFieldException | java . lang . SecurityException | java . lang . IllegalArgumentException | java . lang . IllegalAccessException e ) { throw new java . lang . IllegalStateException ( ( "Failed<sp>to<sp>get<sp>configValidationMessages:<sp>" + ( e . getMessage ( ) ) ) , e ) ; } }
|
org . junit . Assert . assertThat ( org . eclipse . smarthome . config . core . internal . validation . ConfigDescriptionValidatorTest . getConfigValidationMessages ( e ) , org . hamcrest . CoreMatchers . is ( expected ) )
|
testIsUnionOnEnum ( ) { org . apache . avro . Schema schema = org . apache . avro . Schema . createEnum ( "name" , "doc" , "namespace" , java . util . Collections . singletonList ( "value" ) ) ; "<AssertPlaceHolder>" ; } isUnion ( ) { return ( this ) instanceof org . apache . avro . Schema . UnionSchema ; }
|
org . junit . Assert . assertFalse ( schema . isUnion ( ) )
|
getGoogleTokenCase6 ( ) { mockGoogleHelper ( io . dockstore . webservice . TokenResourceIT . GOOGLE_ACCOUNT_USERNAME1 ) ; io . swagger . client . api . TokensApi tokensApi = new io . swagger . client . api . TokensApi ( getWebClient ( true , io . dockstore . webservice . TokenResourceIT . GITHUB_ACCOUNT_USERNAME ) ) ; tokensApi . addGoogleToken ( satellizerJSON ) ; io . swagger . client . api . TokensApi unauthenticatedTokensApi = new io . swagger . client . api . TokensApi ( getWebClient ( false , "n/a" ) ) ; mockGoogleHelper ( io . dockstore . webservice . TokenResourceIT . GOOGLE_ACCOUNT_USERNAME1 ) ; checkTokenCount ( ( ( initialTokenCount ) + 1 ) ) ; io . swagger . client . model . Token case6Token = unauthenticatedTokensApi . addGoogleToken ( satellizerJSON ) ; "<AssertPlaceHolder>" ; verify ( io . dockstore . webservice . helpers . GoogleHelper . class ) ; } getUsername ( ) { return username ; }
|
org . junit . Assert . assertEquals ( io . dockstore . webservice . TokenResourceIT . GITHUB_ACCOUNT_USERNAME , case6Token . getUsername ( ) )
|
test ( ) { org . tests . model . basic . ResetBasicData . reset ( ) ; java . util . List < org . tests . model . basic . Customer > list = io . ebean . Ebean . find ( org . tests . model . basic . Customer . class ) . setAutoTune ( false ) . setBeanCacheMode ( CacheMode . PUT ) . findList ( ) ; "<AssertPlaceHolder>" ; for ( org . tests . model . basic . Customer customer : list ) { org . tests . model . basic . Address billingAddress = customer . getBillingAddress ( ) ; if ( billingAddress != null ) { billingAddress . getLine1 ( ) ; } org . tests . model . basic . Address shippingAddress = customer . getShippingAddress ( ) ; if ( shippingAddress != null ) { shippingAddress . getLine1 ( ) ; } java . util . List < org . tests . model . basic . Contact > contacts = customer . getContacts ( ) ; for ( org . tests . model . basic . Contact contact : contacts ) { contact . getFirstName ( ) ; } } } size ( ) { return changes . size ( ) ; }
|
org . junit . Assert . assertTrue ( ( ( list . size ( ) ) > 1 ) )
|
testIsColumnCreationEnabledToActiveDecisionTableWhenPresenterDoesNotHaveActiveDecisionTable ( ) { doReturn ( false ) . when ( presenter ) . hasActiveDecisionTable ( ) ; final boolean isColumnCreationEnabled = presenter . isColumnCreationEnabledToActiveDecisionTable ( ) ; "<AssertPlaceHolder>" ; } isColumnCreationEnabledToActiveDecisionTable ( ) { return ( hasActiveDecisionTable ( ) ) && ( isColumnCreationEnabled ( getActiveDecisionTable ( ) ) ) ; }
|
org . junit . Assert . assertFalse ( isColumnCreationEnabled )
|
givenProperJson_whenDeserializeIsInvoked_thenProperObjectIsReturned ( ) { com . baeldung . flink . model . InputMessage message = new com . baeldung . flink . model . InputMessage ( "Me" , "User" , java . time . LocalDateTime . now ( ) , "Test<sp>Message" ) ; byte [ ] messageSerialized = com . baeldung . flink . BackupCreatorIntegrationTest . mapper . writeValueAsBytes ( message ) ; org . apache . flink . api . common . serialization . DeserializationSchema < com . baeldung . flink . model . InputMessage > deserializationSchema = new com . baeldung . flink . schema . InputMessageDeserializationSchema ( ) ; com . baeldung . flink . model . InputMessage messageDeserialized = deserializationSchema . deserialize ( messageSerialized ) ; "<AssertPlaceHolder>" ; } deserialize ( byte [ ] ) { return com . baeldung . flink . schema . InputMessageDeserializationSchema . objectMapper . readValue ( bytes , com . baeldung . flink . model . InputMessage . class ) ; }
|
org . junit . Assert . assertEquals ( message , messageDeserialized )
|
givenCompositionVerbose_whenSortingEntitiesByNameThenAge_thenCorrectlySorted ( ) { final java . util . List < com . baeldung . java8 . entity . Human > humans = com . google . common . collect . Lists . newArrayList ( new com . baeldung . java8 . entity . Human ( "Sarah" , 12 ) , new com . baeldung . java8 . entity . Human ( "Sarah" , 10 ) , new com . baeldung . java8 . entity . Human ( "Zack" , 12 ) ) ; final java . util . Comparator < com . baeldung . java8 . entity . Human > byName = ( h1 , h2 ) -> h1 . getName ( ) . compareTo ( h2 . getName ( ) ) ; final java . util . Comparator < com . baeldung . java8 . entity . Human > byAge = ( h1 , h2 ) -> com . google . common . primitives . Ints . compare ( h1 . getAge ( ) , h2 . getAge ( ) ) ; humans . sort ( byName . thenComparing ( byAge ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Integer ) { return emf . unwrap ( org . hibernate . SessionFactory . class ) . getCurrentSession ( ) . get ( org . baeldung . demo . model . Foo . class , id ) ; }
|
org . junit . Assert . assertThat ( humans . get ( 0 ) , org . hamcrest . Matchers . equalTo ( new com . baeldung . java8 . entity . Human ( "Sarah" , 10 ) ) )
|
testAddUISessionListener_returnsFalseWhenUnbound ( ) { httpSession . invalidate ( ) ; org . eclipse . rap . rwt . internal . service . UISessionImpl_Test . EmptyUISessionListener listener = new org . eclipse . rap . rwt . internal . service . UISessionImpl_Test . EmptyUISessionListener ( ) ; boolean added = uiSession . addUISessionListener ( listener ) ; "<AssertPlaceHolder>" ; } addUISessionListener ( org . eclipse . rap . rwt . service . UISessionListener ) { org . eclipse . rap . rwt . internal . util . ParamCheck . notNull ( listener , "listener" ) ; boolean result = false ; synchronized ( lock ) { if ( ( bound ) && ( ! ( inDestroy ) ) ) { result = true ; listeners . add ( listener ) ; } } return result ; }
|
org . junit . Assert . assertFalse ( added )
|
getPlayerNameInNameModeReturnsPreviouslyCachedName ( ) { configuration . linkingMethod = "name" ; when ( player . getName ( ) ) . thenReturn ( org . communitybridge . linker . UserPlayerLinkerTest . PLAYER_NAME ) ; when ( userIDDao . getUserID ( org . communitybridge . linker . UserPlayerLinkerTest . PLAYER_NAME ) ) . thenReturn ( org . communitybridge . linker . UserPlayerLinkerTest . NAME_USER_ID ) ; when ( player . getUniqueId ( ) ) . thenReturn ( uuid ) ; userPlayerLinker . getUserID ( player ) ; "<AssertPlaceHolder>" ; } getPlayerName ( java . lang . String ) { java . lang . String identifier = getIdentifier ( userID ) ; java . util . UUID uuid ; try { uuid = java . util . UUID . fromString ( identifier ) ; } catch ( java . lang . IllegalArgumentException exception ) { return identifier ; } return bukkit . getPlayer ( uuid ) . getName ( ) ; }
|
org . junit . Assert . assertEquals ( org . communitybridge . linker . UserPlayerLinkerTest . PLAYER_NAME , userPlayerLinker . getPlayerName ( org . communitybridge . linker . UserPlayerLinkerTest . NAME_USER_ID ) )
|
testScanNextAfterRollback ( ) { for ( int i = 0 ; i < ( com . geophile . erdo . OrderedMapTransactionTest . N ) ; i ++ ) { map . put ( com . geophile . erdo . TestRecord . createRecord ( i , null ) ) ; } com . geophile . erdo . Cursor cursor = map . first ( ) ; db . rollbackTransaction ( ) ; "<AssertPlaceHolder>" ; } next ( ) { return neighbor ( true ) ; }
|
org . junit . Assert . assertNull ( cursor . next ( ) )
|
getRestartRequiredServicesNames ( ) { java . util . Set < java . lang . String > res = org . apache . ambari . server . api . services . AmbariMetaInfoTest . metaInfo . getRestartRequiredServicesNames ( org . apache . ambari . server . api . services . AmbariMetaInfoTest . STACK_NAME_HDP , "2.0.7" ) ; "<AssertPlaceHolder>" ; } size ( ) { java . util . Set < java . lang . String > nodes = new java . util . HashSet < java . lang . String > ( ) ; for ( org . apache . ambari . eventdb . model . WorkflowDag . WorkflowDagEntry entry : entries ) { nodes . add ( entry . getSource ( ) ) ; nodes . addAll ( entry . getTargets ( ) ) ; } return nodes . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , res . size ( ) )
|
testConvertAll ( ) { java . lang . String utid = "utid" ; java . lang . String note = "note" ; org . lnu . is . domain . person . Person source = new org . lnu . is . domain . person . Person ( ) ; source . setNote ( note ) ; source . setUtid ( utid ) ; org . lnu . is . resource . person . PersonResource expected = new org . lnu . is . resource . person . PersonResource ( ) ; expected . setNote ( note ) ; expected . setUtid ( utid ) ; java . util . List < org . lnu . is . domain . person . Person > sources = java . util . Arrays . asList ( source ) ; java . util . List < org . lnu . is . resource . person . PersonResource > expecteds = java . util . Arrays . asList ( expected ) ; java . util . List < org . lnu . is . resource . person . PersonResource > target = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( expecteds , target )
|
retrievesPathParameterFromRequest ( ) { when ( typeProducer . createValue ( "foo" , pathParameters , null ) ) . thenReturn ( pathParameters . getFirst ( "foo" ) ) ; java . lang . Object resolvedHeader = pathParameterResolver . resolve ( parameter , applicationContext ) ; "<AssertPlaceHolder>" ; } getFirst ( java . lang . String ) { return m . getFirst ( new org . everrest . core . util . CaselessStringWrapper ( key ) ) ; }
|
org . junit . Assert . assertEquals ( pathParameters . getFirst ( "foo" ) , resolvedHeader )
|
testNewCounterC ( ) { final org . apache . hadoop . mapreduce . Job job = org . apache . hadoop . mapred . TestJobCounters . createJob ( ) ; final org . apache . hadoop . conf . Configuration conf = job . getConfiguration ( ) ; conf . setInt ( JobContext . IO_SORT_FACTOR , 3 ) ; org . apache . hadoop . mapred . TestJobCounters . createWordsFile ( org . apache . hadoop . mapred . TestJobCounters . inFiles [ 3 ] , conf ) ; org . apache . hadoop . mapred . TestJobCounters . createWordsFile ( org . apache . hadoop . mapred . TestJobCounters . inFiles [ 4 ] , conf ) ; long inputSize = 0 ; inputSize += org . apache . hadoop . mapred . TestJobCounters . getFileSize ( org . apache . hadoop . mapred . TestJobCounters . inFiles [ 0 ] ) ; inputSize += org . apache . hadoop . mapred . TestJobCounters . getFileSize ( org . apache . hadoop . mapred . TestJobCounters . inFiles [ 1 ] ) ; inputSize += org . apache . hadoop . mapred . TestJobCounters . getFileSize ( org . apache . hadoop . mapred . TestJobCounters . inFiles [ 2 ] ) ; inputSize += org . apache . hadoop . mapred . TestJobCounters . getFileSize ( org . apache . hadoop . mapred . TestJobCounters . inFiles [ 3 ] ) ; inputSize += org . apache . hadoop . mapred . TestJobCounters . getFileSize ( org . apache . hadoop . mapred . TestJobCounters . inFiles [ 4 ] ) ; org . apache . hadoop . mapreduce . lib . input . FileInputFormat . setInputPaths ( job , org . apache . hadoop . mapred . TestJobCounters . IN_DIR ) ; org . apache . hadoop . mapreduce . lib . output . FileOutputFormat . setOutputPath ( job , new org . apache . hadoop . fs . Path ( org . apache . hadoop . mapred . TestJobCounters . OUT_DIR , "outputN2" ) ) ; "<AssertPlaceHolder>" ; final org . apache . hadoop . mapred . Counters c1 = org . apache . hadoop . mapred . Counters . downgrade ( job . getCounters ( ) ) ; validateCounters ( c1 , 147456 , 25600 , 102400 ) ; validateFileCounters ( c1 , inputSize , 0 , 0 , 0 ) ; } waitForCompletion ( boolean ) { if ( ( state ) == ( org . apache . hadoop . mapreduce . Job . JobState . DEFINE ) ) { submit ( ) ; } if ( verbose ) { monitorAndPrintJob ( ) ; } else { int completionPollIntervalMillis = org . apache . hadoop . mapreduce . Job . getCompletionPollInterval ( cluster . getConf ( ) ) ; while ( ! ( isComplete ( ) ) ) { try { java . lang . Thread . sleep ( completionPollIntervalMillis ) ; } catch ( java . lang . InterruptedException ie ) { } } } return isSuccessful ( ) ; }
|
org . junit . Assert . assertTrue ( job . waitForCompletion ( true ) )
|
checkAbilityToStartServiceWithIpUsingShortFlag ( ) { java . lang . String expectedUrl = java . lang . String . format ( "http://%s:4723/wd/hub" , io . appium . java_client . service . local . ServerBuilderTest . testIP ) ; service = new io . appium . java_client . service . local . AppiumServiceBuilder ( ) . withArgument ( ( ) -> "-a" , io . appium . java_client . service . local . ServerBuilderTest . testIP ) . build ( ) ; java . lang . String actualUrl = service . getUrl ( ) . toString ( ) ; "<AssertPlaceHolder>" ; service . start ( ) ; } toString ( ) { return getWrappedElement ( ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expectedUrl , actualUrl )
|
testSetName ( ) { dtm . setName ( "S83" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return fName ; }
|
org . junit . Assert . assertEquals ( "S83" , dtm . getName ( ) )
|
testValidatePersonUsingToken ( ) { org . orcid . core . utils . SecurityContextTestUtils . setUpSecurityContext ( ORCID , ScopePathType . READ_LIMITED ) ; javax . ws . rs . core . Response response = serviceDelegator . viewPerson ( ORCID ) ; "<AssertPlaceHolder>" ; org . orcid . jaxb . model . record_v2 . Person person = ( ( org . orcid . jaxb . model . record_v2 . Person ) ( response . getEntity ( ) ) ) ; validatePerson ( person ) ; } viewPerson ( java . lang . String ) { checkProfileStatus ( orcid ) ; org . orcid . jaxb . model . v3 . release . record . Person person = personDetailsManagerReadOnly . getPublicPersonDetails ( orcid ) ; publicAPISecurityManagerV3 . filter ( person ) ; org . orcid . api . common . util . v3 . ElementUtils . setPathToPerson ( person , orcid ) ; org . orcid . core . version . impl . Api3_0LastModifiedDatesHelper . calculateLastModified ( person ) ; sourceUtilsReadOnly . setSourceName ( person ) ; return javax . ws . rs . core . Response . ok ( person ) . build ( ) ; }
|
org . junit . Assert . assertNotNull ( response )
|
testCreateLimit ( ) { org . jacoco . report . check . Limit l1 = new org . jacoco . report . check . Limit ( ) ; org . jacoco . report . check . Limit l2 = new org . jacoco . report . check . Limit ( ) ; rule . setLimits ( new java . util . ArrayList < org . jacoco . report . check . Limit > ( java . util . Arrays . asList ( l1 , l2 ) ) ) ; org . jacoco . report . check . Limit l3 = rule . createLimit ( ) ; "<AssertPlaceHolder>" ; } getLimits ( ) { return limits ; }
|
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( l1 , l2 , l3 ) , rule . getLimits ( ) )
|
FindInstances_Empty_Result ( ) { System . out . println ( "Delete<sp>all<sp>notes" ) ; java . util . List < com . mysema . rdfbean . object . SessionInvLoadTest . Note > notes = session . findInstances ( com . mysema . rdfbean . object . SessionInvLoadTest . Note . class ) ; session . deleteAll ( notes . toArray ( ) ) ; session . clear ( ) ; "<AssertPlaceHolder>" ; } findInstances ( java . lang . Class ) { com . mysema . rdfbean . model . UID type = configuration . getMappedClass ( clazz ) . getUID ( ) ; if ( type != null ) { java . util . Set < T > instances = new java . util . LinkedHashSet < T > ( ) ; findInstances ( clazz , type , instances ) ; return new java . util . ArrayList < T > ( instances ) ; } else { throw new java . lang . IllegalArgumentException ( ( "No<sp>RDF<sp>type<sp>specified<sp>for<sp>" + ( clazz . getName ( ) ) ) ) ; } }
|
org . junit . Assert . assertTrue ( session . findInstances ( com . mysema . rdfbean . object . SessionInvLoadTest . Note . class ) . isEmpty ( ) )
|
setAssociationMessageV2 ( ) { org . openhab . binding . zwave . internal . protocol . commandclass . ZWaveMultiAssociationCommandClass cls = ( ( org . openhab . binding . zwave . internal . protocol . commandclass . ZWaveMultiAssociationCommandClass ) ( getCommandClass ( CommandClass . COMMAND_CLASS_MULTI_CHANNEL_ASSOCIATION ) ) ) ; org . openhab . binding . zwave . internal . protocol . transaction . ZWaveCommandClassTransactionPayload msg ; byte [ ] expectedResponse2 = new byte [ ] { - 114 , 1 , 1 , 2 } ; cls . setVersion ( 1 ) ; msg = cls . setAssociationMessage ( 1 , 2 , 0 ) ; "<AssertPlaceHolder>" ; } getPayloadBuffer ( ) { return payload ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( msg . getPayloadBuffer ( ) , expectedResponse2 ) )
|
testPropertyIsLikeWildcard ( ) { java . lang . String searchPhrase = "abc-123*" ; java . lang . String expectedQuery = ( SolrFilterDelegate . WHITESPACE_TOKENIZED_METADATA_FIELD ) + ":(abc\\-123*)" ; boolean isCaseSensitive = false ; org . apache . solr . client . solrj . SolrQuery isLikeQuery = toTest . propertyIsLike ( Metacard . ANY_TEXT , searchPhrase , isCaseSensitive ) ; "<AssertPlaceHolder>" ; } getQuery ( ) { return query ; }
|
org . junit . Assert . assertThat ( isLikeQuery . getQuery ( ) , org . hamcrest . CoreMatchers . is ( expectedQuery ) )
|
testPeriodicChecker ( ) { org . eclipse . january . dataset . IDynamicDataset lazy = createDynamic ( ) ; org . eclipse . january . dataset . LazyDynamicDatasetTest . CountingListener counter = new org . eclipse . january . dataset . LazyDynamicDatasetTest . CountingListener ( ) ; lazy . addDataListener ( counter ) ; int period = 200 ; int repeat = 5 ; long total = ( ( long ) ( ( repeat + 0.1 ) * period ) ) ; lazy . startUpdateChecker ( period , null ) ; try { java . lang . Thread . sleep ( total ) ; lazy . startUpdateChecker ( 0 , null ) ; } catch ( java . lang . InterruptedException e ) { org . junit . Assert . fail ( "Sleep<sp>interrupted!" ) ; } "<AssertPlaceHolder>" ; } startUpdateChecker ( int , org . eclipse . january . dataset . IDatasetChangeChecker ) { if ( ( checkingThread ) != null ) { stop = true ; if ( ( checkingThread ) != null ) { checkingThread . interrupt ( ) ; } } this . checker = checker ; if ( checker != null ) { checker . setDataset ( this ) ; } if ( milliseconds <= 0 ) { return ; } runner . millis = milliseconds ; checkingThread = new java . lang . Thread ( runner ) ; checkingThread . setDaemon ( true ) ; checkingThread . setName ( ( ( "Checking<sp>thread<sp>with<sp>period<sp>" + milliseconds ) + "ms" ) ) ; checkingThread . start ( ) ; }
|
org . junit . Assert . assertEquals ( repeat , counter . count )
|
testSameInputTwoInstructionsFromDiffentRules ( ) { querqy . rewrite . commonrules . model . RulesCollectionBuilder builder = new querqy . rewrite . commonrules . model . TrieMapRulesCollectionBuilder ( false ) ; java . lang . String s1 = "test" ; querqy . rewrite . commonrules . model . Input input = new querqy . rewrite . commonrules . model . Input ( inputTerms ( null , s1 ) , false , false ) ; querqy . rewrite . commonrules . model . Instructions instructions1 = instructions ( "instruction1" ) ; builder . addRule ( input , instructions1 ) ; querqy . rewrite . commonrules . model . Instructions instructions2 = instructions ( "instruction2" ) ; builder . addRule ( input , instructions2 ) ; querqy . rewrite . commonrules . model . RulesCollection rulesCollection = builder . build ( ) ; querqy . rewrite . commonrules . model . PositionSequence < querqy . model . InputSequenceElement > sequence = new querqy . rewrite . commonrules . model . PositionSequence ( ) ; sequence . nextPosition ( ) ; sequence . addElement ( new querqy . model . Term ( null , s1 ) ) ; java . util . List < querqy . rewrite . commonrules . model . Action > actions = rulesCollection . getRewriteActions ( sequence ) ; "<AssertPlaceHolder>" ; } termMatches ( java . lang . String [ ] ) { querqy . rewrite . commonrules . model . TermMatches result = new querqy . rewrite . commonrules . model . TermMatches ( ) ; for ( java . lang . String value : values ) { result . add ( new querqy . rewrite . commonrules . model . TermMatch ( new querqy . model . Term ( null , value ) ) ) ; } return result ; }
|
org . junit . Assert . assertThat ( actions , org . hamcrest . Matchers . contains ( new querqy . rewrite . commonrules . model . Action ( java . util . Arrays . asList ( instructions1 , instructions2 ) , termMatches ( s1 ) , 0 , 1 ) ) )
|
testWriteAndRead ( ) { int SIZE = 100 * 1000 ; byte [ ] data = new byte [ SIZE ] ; java . util . Random r = new java . util . Random ( java . lang . System . currentTimeMillis ( ) ) ; r . nextBytes ( data ) ; java . io . File f = new java . io . File ( ( "/tmp/test." + ( java . lang . System . currentTimeMillis ( ) ) ) ) ; java . io . FileOutputStream fos = new java . io . FileOutputStream ( f ) ; fos . write ( data ) ; fos . close ( ) ; byte [ ] buf = new byte [ 128 ] ; java . io . InputStream in = new org . fastcatsearch . ir . io . BufferedFileInput ( f ) ; int c = 0 ; int offset = 0 ; int k = 0 ; while ( ( c = in . read ( buf ) ) != ( - 1 ) ) { for ( int i = 0 ; i < c ; i ++ ) { if ( ( data [ ( offset + i ) ] ) != ( buf [ i ] ) ) { System . out . printf ( "error<sp>at<sp>=<sp>%d\n" , ( offset + i ) ) ; } "<AssertPlaceHolder>" ; k ++ ; } offset += c ; } in . close ( ) ; f . delete ( ) ; } printf ( java . lang . String , java . lang . Object [ ] ) { System . out . print ( java . lang . String . format ( format , args ) ) ; }
|
org . junit . Assert . assertEquals ( data [ ( offset + i ) ] , buf [ i ] )
|
Test1result ( ) { searchExpression . setText ( "blindness" ) ; btnSearch . doClick ( ) ; java . lang . String result = ResultData . getText ( ) ; java . lang . String ExpectedResult = "Found<sp>1<sp>hits." ; "<AssertPlaceHolder>" ; } getText ( ) { return this . text ; }
|
org . junit . Assert . assertTrue ( result . contains ( ExpectedResult ) )
|
testArray ( ) { java . util . Map < java . lang . String , java . lang . Object > params = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . lang . String [ ] list = new java . lang . String [ ] { "value1" , "value2" , "value3" } ; params . put ( "array1" , list ) ; java . lang . String lastValue = ( ( java . lang . String ) ( executeFlowAndReturnObject ( "org.neuro4j.flows.nodes.loopnode.LoopExample-StartNode1" , params , "var1" ) ) ) ; "<AssertPlaceHolder>" ; } executeFlowAndReturnObject ( java . lang . String , java . util . Map , java . lang . String ) { org . neuro4j . workflow . ExecutionResult result = executeFlowAndReturnResult ( flowName , parameters ) ; return result . getFlowContext ( ) . get ( name ) ; }
|
org . junit . Assert . assertSame ( "value3" , lastValue )
|
testMacAddressToLong ( ) { com . cloud . utils . net . MacAddress mac = new com . cloud . utils . net . MacAddress ( Long . MAX_VALUE ) ; "<AssertPlaceHolder>" ; System . out . println ( mac . toString ( ) ) ; } toLong ( ) { return _addr ; }
|
org . junit . Assert . assertEquals ( Long . MAX_VALUE , mac . toLong ( ) )
|
testGetColumnNameFromIndex ( ) { java . util . Map < java . lang . String , java . lang . String > metaDataSource = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; java . lang . String key1 = "key1" ; java . lang . String val1 = "10003" ; java . lang . String key2 = "key2" ; java . lang . String val2 = "10004" ; metaDataSource . put ( key1 , val1 ) ; metaDataSource . put ( key2 , val2 ) ; org . irods . jargon . core . query . ExtensibleMetaDataMapping metaDataMapping = org . irods . jargon . core . query . ExtensibleMetaDataMapping . instance ( metaDataSource ) ; java . lang . String actual = metaDataMapping . getColumnNameFromIndex ( val1 ) ; "<AssertPlaceHolder>" ; } getColumnNameFromIndex ( java . lang . String ) { java . lang . String columnName = null ; java . lang . String foundIntValue = "" ; for ( java . lang . String key : extensibleMappings . keySet ( ) ) { foundIntValue = extensibleMappings . get ( key ) ; if ( foundIntValue . equals ( index ) ) { columnName = key ; break ; } } return columnName ; }
|
org . junit . Assert . assertEquals ( key1 , actual )
|
ConnectedToInstanceAgain ( ) { final org . apache . rya . shell . SharedShellState state = new org . apache . rya . shell . SharedShellState ( ) ; final org . apache . rya . api . client . accumulo . AccumuloConnectionDetails connectionDetails = mock ( org . apache . rya . api . client . accumulo . AccumuloConnectionDetails . class ) ; final org . apache . rya . api . client . RyaClient connectedCommands = mock ( org . apache . rya . api . client . RyaClient . class ) ; state . connectedToAccumulo ( connectionDetails , connectedCommands ) ; state . connectedToInstance ( "instance" ) ; state . connectedToInstance ( "secondInstance" ) ; final org . apache . rya . shell . SharedShellState . ShellState expected = org . apache . rya . shell . SharedShellState . ShellState . builder ( ) . setConnectionState ( ConnectionState . CONNECTED_TO_INSTANCE ) . setAccumuloDetails ( connectionDetails ) . setConnectedCommands ( connectedCommands ) . setRyaInstanceName ( "secondInstance" ) . build ( ) ; "<AssertPlaceHolder>" ; } getShellState ( ) { lock . lock ( ) ; try { return shellState ; } finally { lock . unlock ( ) ; } }
|
org . junit . Assert . assertEquals ( expected , state . getShellState ( ) )
|
testSetSeedXavier ( ) { org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 123 ) ; org . deeplearning4j . nn . api . Layer model = org . deeplearning4j . nn . conf . NeuralNetConfigurationTest . getLayer ( trainingSet . numInputs ( ) , trainingSet . numOutcomes ( ) , new org . deeplearning4j . nn . conf . WeightInitUniform ( ) , true ) ; org . nd4j . linalg . api . ndarray . INDArray modelWeights = model . getParam ( DefaultParamInitializer . WEIGHT_KEY ) ; org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 123 ) ; org . deeplearning4j . nn . api . Layer model2 = org . deeplearning4j . nn . conf . NeuralNetConfigurationTest . getLayer ( trainingSet . numInputs ( ) , trainingSet . numOutcomes ( ) , new org . deeplearning4j . nn . conf . WeightInitUniform ( ) , true ) ; org . nd4j . linalg . api . ndarray . INDArray modelWeights2 = model2 . getParam ( DefaultParamInitializer . WEIGHT_KEY ) ; "<AssertPlaceHolder>" ; } getParam ( java . lang . String ) { int idx = param . indexOf ( '_' ) ; if ( idx == ( - 1 ) ) throw new java . lang . IllegalStateException ( ( ( "Invalid<sp>param<sp>key:<sp>does<sp>not<sp>have<sp>layer<sp>separator:<sp>\"" + param ) + "\"" ) ) ; int layerIdx = java . lang . Integer . parseInt ( param . substring ( 0 , idx ) ) ; java . lang . String newKey = param . substring ( ( idx + 1 ) ) ; return layers [ layerIdx ] . getParam ( newKey ) ; }
|
org . junit . Assert . assertEquals ( modelWeights , modelWeights2 )
|
hasSuffixFindsParameter ( ) { org . hl7 . fhir . dstu3 . model . HumanName humanName = new org . hl7 . fhir . dstu3 . model . HumanName ( ) . addSuffix ( "test" ) ; "<AssertPlaceHolder>" ; } hasSuffix ( java . lang . String ) { if ( ( this . suffix ) == null ) return false ; for ( org . hl7 . fhir . dstu3 . model . StringType v : this . suffix ) if ( v . getValue ( ) . equals ( value ) ) return true ; return false ; }
|
org . junit . Assert . assertTrue ( humanName . hasSuffix ( "test" ) )
|
getNumOfCPU ( ) { org . apache . commons . configuration . HierarchicalConfiguration configuration = prepareConfiguration ( org . oscm . app . ror . LServerConfigurationTest . NUMOFCPU , org . oscm . app . ror . LServerConfigurationTest . NUMOFCPU ) ; lServerConfiguration = new org . oscm . app . ror . data . LServerConfiguration ( configuration ) ; "<AssertPlaceHolder>" ; } getNumOfCPU ( ) { return numCPU ; }
|
org . junit . Assert . assertEquals ( org . oscm . app . ror . LServerConfigurationTest . NUMOFCPU , lServerConfiguration . getNumOfCPU ( ) )
|
migrate_ClassNull ( ) { try { datastore . migrate ( mock ( at . ac . tuwien . infosys . jcloudscale . datastore . api . Datastore . class ) , null , "SomeID" ) ; org . junit . Assert . fail ( ) ; } catch ( at . ac . tuwien . infosys . jcloudscale . datastore . api . DatastoreException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
|
org . junit . Assert . assertNotNull ( e . getMessage ( ) )
|
convertMultiLineString_WithRedundantSpaces_ShouldConvert ( ) { java . lang . String wkt = "MULTILINESTRING<sp>(<sp>(10<sp>10,<sp>20<sp>20,<sp>10<sp>40<sp>)<sp>,<sp>(40<sp>40,<sp>30<sp>30,<sp>40<sp>20,<sp>30<sp>10))" ; java . lang . String geoJson = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . toGeoJson ( wkt ) ; java . lang . String expectedGeoJson = "{\"type\":\"MultiLineString\",<sp>\"coordinates\":<sp>[[[10,10],[20,20],[10,40]],[[40,40],[30,30],[40,20],[30,10]]]}" ; "<AssertPlaceHolder>" ; } toGeoJson ( java . lang . String ) { wkt = wkt . toLowerCase ( ) ; int startOfCoordinates = wkt . indexOf ( "multilinestring" 2 ) ; if ( startOfCoordinates == ( - 1 ) ) throw new java . lang . IllegalArgumentException ( "multilinestring" 4 ) ; java . lang . String wktType = wkt . substring ( 0 , startOfCoordinates ) . trim ( ) ; wkt = wkt . substring ( startOfCoordinates ) ; java . lang . String type = "" ; java . lang . String coordinates = "" ; switch ( wktType ) { case "point" : type = "multilinestring" 3 ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . pointCoordinatesFromWkt ( wkt ) ; break ; case "polygon" : type = "multilinestring" 1 ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . polygonCoordinatesFromWkt ( wkt ) ; break ; case "linestring" : type = "LineString" ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . lineStringCoordinatesFromWkt ( wkt ) ; break ; case "multipolygon" : type = "MultiPolygon" ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . multiPolygonCoordinatesFromWkt ( wkt ) ; break ; case "multipoint" : type = "multilinestring" 0 ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . multiPointCoordinatesFromWkt ( wkt ) ; break ; case "multilinestring" : type = "MultiLineString" ; coordinates = org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . multiLineStringCoordinatesFromWkt ( wkt ) ; break ; default : throw new java . lang . IllegalArgumentException ( "multilinestring" 5 ) ; } return org . nlpcn . es4sql . spatial . WktToGeoJsonConverter . buildGeoJson ( type , coordinates ) ; }
|
org . junit . Assert . assertEquals ( expectedGeoJson , geoJson )
|
testPathAwarePropertyLookup ( ) { org . apache . jackrabbit . oak . spi . state . NodeState root = org . apache . jackrabbit . oak . InitialContentHelper . INITIAL_CONTENT ; org . apache . jackrabbit . oak . spi . state . NodeBuilder builder = root . builder ( ) ; org . apache . jackrabbit . oak . plugins . index . IndexUtils . createIndexDefinition ( builder . child ( org . apache . jackrabbit . oak . plugins . index . IndexConstants . INDEX_DEFINITIONS_NAME ) , "foo" , true , false , com . google . common . collect . ImmutableSet . of ( "foo" ) , null ) ; org . apache . jackrabbit . oak . spi . state . NodeState before = builder . getNodeState ( ) ; builder . child ( "a" ) . setProperty ( "foo" , "abc" ) ; builder . child ( "b" ) . setProperty ( "foo" , "abc" ) ; org . apache . jackrabbit . oak . spi . state . NodeState after = builder . getNodeState ( ) ; org . apache . jackrabbit . oak . spi . state . NodeState indexed = org . apache . jackrabbit . oak . plugins . index . property . PropertyIndexTest . HOOK . processCommit ( before , after , CommitInfo . EMPTY ) ; org . apache . jackrabbit . oak . query . index . FilterImpl f = org . apache . jackrabbit . oak . plugins . index . property . PropertyIndexTest . createFilter ( indexed , org . apache . jackrabbit . JcrConstants . NT_BASE ) ; f . restrictPath ( "/a" , Filter . PathRestriction . ALL_CHILDREN ) ; org . apache . jackrabbit . oak . plugins . index . property . PropertyIndexLookup lookup = new org . apache . jackrabbit . oak . plugins . index . property . PropertyIndexLookup ( indexed ) ; "<AssertPlaceHolder>" ; } of ( org . apache . jackrabbit . oak . spi . security . ConfigurationParameters ) { org . apache . jackrabbit . oak . spi . security . authentication . external . basic . DefaultSyncConfig cfg = new org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl ( ) . setName ( params . getConfigValue ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_NAME , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_NAME_DEFAULT ) ) ; cfg . user ( ) . setDisableMissing ( params . getConfigValue ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_DISABLE_MISSING_USERS , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_DISABLE_MISSING_USERS_DEFAULT ) ) . setMembershipExpirationTime ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . getMilliSeconds ( params , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_MEMBERSHIP_EXPIRATION_TIME , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_MEMBERSHIP_EXPIRATION_TIME_DEFAULT , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . ONE_HOUR ) ) . setMembershipNestingDepth ( params . getConfigValue ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_MEMBERSHIP_NESTING_DEPTH , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_MEMBERSHIP_NESTING_DEPTH_DEFAULT ) ) . setDynamicMembership ( params . getConfigValue ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_DYNAMIC_MEMBERSHIP , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_DYNAMIC_MEMBERSHIP_DEFAULT ) ) . setExpirationTime ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . getMilliSeconds ( params , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_EXPIRATION_TIME , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_EXPIRATION_TIME_DEFAULT , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . ONE_HOUR ) ) . setApplyRFC7613UsernameCaseMapped ( params . getConfigValue ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE_DEFAULT ) ) . setPathPrefix ( params . getConfigValue ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_PATH_PREFIX , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_PATH_PREFIX_DEFAULT ) ) . setAutoMembership ( params . getConfigValue ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_AUTO_MEMBERSHIP , org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_AUTO_MEMBERSHIP_DEFAULT ) ) . setPropertyMapping ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . createMapping ( params . getConfigValue ( org . apache . jackrabbit . oak . spi . security . authentication . external . impl . DefaultSyncConfigImpl . PARAM_USER_PROPERTY_MAPPING , org . apache . jackrabbit
|
org . junit . Assert . assertEquals ( com . google . common . collect . ImmutableSet . of ( "a" ) , org . apache . jackrabbit . oak . plugins . index . property . PropertyIndexTest . find ( lookup , "foo" , "abc" , f ) )
|
testUnidentifiedWordNoVowel ( ) { zemberek . morphology . TurkishMorphology morphology = getMorphology ( ) ; zemberek . morphology . analysis . WordAnalysis result = morphology . analyze ( "gnctrkcll" ) ; "<AssertPlaceHolder>" ; } analysisCount ( ) { return analysisResults . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . analysisCount ( ) )
|
notEmpty ( ) { "<AssertPlaceHolder>" ; } newWith ( ) { com . gs . collections . api . bag . ImmutableBag < java . lang . String > bag = this . newBag ( ) ; com . gs . collections . api . bag . ImmutableBag < java . lang . String > newBag = bag . newWith ( "1" ) ; org . junit . Assert . assertNotEquals ( bag , newBag ) ; org . junit . Assert . assertEquals ( newBag . size ( ) , ( ( bag . size ( ) ) + 1 ) ) ; com . gs . collections . api . bag . ImmutableBag < java . lang . String > newBag2 = bag . newWith ( "5" ) ; org . junit . Assert . assertNotEquals ( bag , newBag2 ) ; org . junit . Assert . assertEquals ( newBag2 . size ( ) , ( ( bag . size ( ) ) + 1 ) ) ; org . junit . Assert . assertEquals ( 1 , newBag2 . sizeDistinct ( ) ) ; }
|
org . junit . Assert . assertFalse ( this . newWith ( ) . notEmpty ( ) )
|
testGetFollows_1 ( ) { org . jinstagram . entity . users . basicinfo . Counts fixture = new org . jinstagram . entity . users . basicinfo . Counts ( ) ; fixture . setFollows ( 1 ) ; fixture . setMedia ( 1 ) ; fixture . setFollowedBy ( 1 ) ; int result = fixture . getFollows ( ) ; "<AssertPlaceHolder>" ; } getFollows ( ) { return follows ; }
|
org . junit . Assert . assertEquals ( 1 , result )
|
testBuildWithDisabledDefaultConstraints ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . person . enrolment . subject . PersonEnrolmentSubject context = new org . lnu . is . domain . person . enrolment . subject . PersonEnrolmentSubject ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>PersonEnrolmentSubject<sp>e<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . person . enrolment . subject . PersonEnrolmentSubject > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testAbs ( ) { org . araqne . logdb . query . expr . Abs abs = new org . araqne . logdb . query . expr . Abs ( null , expr ( 1 ) ) ; "<AssertPlaceHolder>" ; } eval ( org . araqne . logdb . Row ) { java . lang . Object l = ( isLhString ) ? lh : m . get ( lh . toString ( ) ) ; java . lang . Object r = ( isRhString ) ? rh : m . get ( rh . toString ( ) ) ; try { int cmp = org . araqne . logdb . query . command . Term . comp . compare ( l , r ) ; switch ( operator ) { case Eq : return cmp == 0 ; case Neq : return cmp != 0 ; case Gt : return cmp > 0 ; case Lt : return cmp < 0 ; case Ge : return cmp >= 0 ; case Le : return cmp <= 0 ; case Contain : return l . toString ( ) . contains ( r . toString ( ) ) ; case Regexp : { if ( l == null ) return false ; if ( isRhString ) return p . matcher ( l . toString ( ) ) . find ( ) ; else { java . util . regex . Pattern pp = java . util . regex . Pattern . compile ( m . get ( rh . toString ( ) ) . toString ( ) , Pattern . MULTILINE ) ; return pp . matcher ( l . toString ( ) ) . find ( ) ; } } case In : return java . util . Arrays . asList ( r . toString ( ) . replaceAll ( ",(<sp>)*" , "," ) . split ( "," ) ) . contains ( l . toString ( ) ) ; case IsNull : return ( l == null ) || ( l . toString ( ) . isEmpty ( ) ) ; case NotNull : return ( l != null ) && ( ! ( l . toString ( ) . isEmpty ( ) ) ) ; } } catch ( java . lang . Exception e ) { } return false ; }
|
org . junit . Assert . assertEquals ( 1 , abs . eval ( null ) )
|
testDumpExcludes ( ) { java . lang . String input = "list<sp>excludes<sp>\"b\"" ; java . lang . String expected = "!(<sp>list<sp>contains<sp>\"b\"<sp>)" ; org . drools . compiler . lang . descr . ConstraintConnectiveDescr descr = parse ( input ) ; java . lang . String result = dumper . dump ( descr ) ; "<AssertPlaceHolder>" ; } dump ( org . drools . core . reteoo . Rete ) { traverseRete ( rete , this :: dumpNode ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
testParseLastDayOfMonth ( ) { final java . lang . String cronExpr = "*<sp>*<sp>L<sp>*<sp>*" ; final com . cronutils . model . Cron cron = cron4jParser . parse ( cronExpr ) ; "<AssertPlaceHolder>" ; } asString ( ) { org . junit . Assert . assertEquals ( "0<sp>0<sp>0<sp>15|16<sp>8|9<sp>?<sp>2015/2" , cron1 . asString ( ) ) ; }
|
org . junit . Assert . assertThat ( cron . asString ( ) , org . hamcrest . core . Is . is ( "*<sp>*<sp>L<sp>*<sp>*" ) )
|
testEqualsObjectNotequlseType ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
|
betweenMondayAndFriday ( ) { "<AssertPlaceHolder>" ; } betweenMondayAndFriday ( ) { org . junit . Assert . assertThat ( net . time4j . range . SpanOfWeekdays . betweenMondayAndFriday ( ) , org . hamcrest . CoreMatchers . is ( net . time4j . range . SpanOfWeekdays . between ( Weekday . MONDAY , Weekday . FRIDAY ) ) ) ; }
|
org . junit . Assert . assertThat ( net . time4j . range . SpanOfWeekdays . betweenMondayAndFriday ( ) , org . hamcrest . CoreMatchers . is ( net . time4j . range . SpanOfWeekdays . between ( Weekday . MONDAY , Weekday . FRIDAY ) ) )
|
runTestMultidimensionalArray1 ( ) { soot . jimple . infoflow . results . InfoflowResults res = analyzeAPKFile ( "ArraysAndLists/MultidimensionalArray1.apk" ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( this . results ) == null ? 0 : this . results . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , res . size ( ) )
|
testForConnectionLeak ( ) { java . lang . Integer expectedConnectionCount = 0 ; for ( int i = 0 ; i < ( org . apache . activemq . proxy . AMQ4889Test . ITERATIONS ) ; i ++ ) { try { if ( ( i % 2 ) == 0 ) { org . apache . activemq . proxy . AMQ4889Test . LOG . debug ( "Iteration<sp>{}<sp>adding<sp>bad<sp>connection" , i ) ; javax . jms . Connection connection = connectionFactory . createConnection ( org . apache . activemq . proxy . AMQ4889Test . USER , org . apache . activemq . proxy . AMQ4889Test . WRONG_PASSWORD ) ; javax . jms . Session session = connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; org . junit . Assert . fail ( "createSession<sp>should<sp>fail" ) ; } else { org . apache . activemq . proxy . AMQ4889Test . LOG . debug ( "Iteration<sp>{}<sp>adding<sp>good<sp>connection" , i ) ; javax . jms . Connection connection = connectionFactory . createConnection ( org . apache . activemq . proxy . AMQ4889Test . USER , org . apache . activemq . proxy . AMQ4889Test . GOOD_USER_PASSWORD ) ; javax . jms . Session session = connection . createSession ( false , Session . AUTO_ACKNOWLEDGE ) ; expectedConnectionCount ++ ; } } catch ( javax . jms . JMSSecurityException e ) { } org . apache . activemq . proxy . AMQ4889Test . LOG . debug ( "Iteration<sp>{}<sp>Connections?<sp>{}" , i , proxyConnector . getConnectionCount ( ) ) ; } final java . lang . Integer val = expectedConnectionCount ; org . apache . activemq . util . Wait . waitFor ( new org . apache . activemq . util . Wait . Condition ( ) { @ org . apache . activemq . proxy . Override public boolean isSatisified ( ) throws org . apache . activemq . proxy . Exception { return val . equals ( proxyConnector . getConnectionCount ( ) ) ; } } , 20 ) ; "<AssertPlaceHolder>" ; } getConnectionCount ( ) { return remotingService . getConnections ( ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( val , proxyConnector . getConnectionCount ( ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.