input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testGetPluralName ( ) { org . apache . ambari . server . api . resources . ViewPermissionResourceDefinition ViewPermissionResourceDefinition = new org . apache . ambari . server . api . resources . ViewPermissionResourceDefinition ( ) ; "<AssertPlaceHolder>" ; } getPluralName ( ) { return "permissions" ; }
|
org . junit . Assert . assertEquals ( "permissions" , ViewPermissionResourceDefinition . getPluralName ( ) )
|
equals_additionalTimeToWaitForLockDifferent_returnsFalse ( ) { com . amazonaws . services . dynamodbv2 . AcquireLockOptions left = createLockOptions ( ) ; com . amazonaws . services . dynamodbv2 . AcquireLockOptions right = com . amazonaws . services . dynamodbv2 . AcquireLockOptions . builder ( "partitionKey" ) . withSortKey ( "sortKey" ) . withData ( java . nio . ByteBuffer . wrap ( "data" . getBytes ( ) ) ) . withReplaceData ( true ) . withDeleteLockOnRelease ( true ) . withAcquireOnlyIfLockAlreadyExists ( false ) . withRefreshPeriod ( 1L ) . withAdditionalTimeToWaitForLock ( 2L ) . withTimeUnit ( TimeUnit . MILLISECONDS ) . withAdditionalAttributes ( new java . util . HashMap ( ) ) . withUpdateExistingLockRecord ( false ) . withAcquireReleasedLocksConsistently ( false ) . build ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( other == null ) || ( ! ( other instanceof com . amazonaws . services . dynamodbv2 . AcquireLockOptions ) ) ) { return false ; } final com . amazonaws . services . dynamodbv2 . AcquireLockOptions otherOptions = ( ( com . amazonaws . services . dynamodbv2 . AcquireLockOptions ) ( other ) ) ; return ( ( ( ( ( ( ( ( ( ( ( ( ( java . util . Objects . equals ( this . partitionKey , otherOptions . partitionKey ) ) && ( java . util . Objects . equals ( this . sortKey , otherOptions . sortKey ) ) ) && ( java . util . Objects . equals ( this . data , otherOptions . data ) ) ) && ( java . util . Objects . equals ( this . replaceData , otherOptions . replaceData ) ) ) && ( java . util . Objects . equals ( this . deleteLockOnRelease , otherOptions . deleteLockOnRelease ) ) ) && ( java . util . Objects . equals ( this . acquireOnlyIfLockAlreadyExists , otherOptions . acquireOnlyIfLockAlreadyExists ) ) ) && ( java . util . Objects . equals ( this . refreshPeriod , otherOptions . refreshPeriod ) ) ) && ( java . util . Objects . equals ( this . additionalTimeToWaitForLock , otherOptions . additionalTimeToWaitForLock ) ) ) && ( java . util . Objects . equals ( this . timeUnit , otherOptions . timeUnit ) ) ) && ( java . util . Objects . equals ( this . additionalAttributes , otherOptions . additionalAttributes ) ) ) && ( java . util . Objects . equals ( this . sessionMonitor , otherOptions . sessionMonitor ) ) ) && ( java . util . Objects . equals ( this . updateExistingLockRecord , otherOptions . updateExistingLockRecord ) ) ) && ( java . util . Objects . equals ( this . shouldSkipBlockingWait , otherOptions . shouldSkipBlockingWait ) ) ) && ( java . util . Objects . equals ( this . acquireReleasedLocksConsistently , otherOptions . acquireReleasedLocksConsistently ) ) ; }
|
org . junit . Assert . assertFalse ( left . equals ( right ) )
|
testAppendNotSupported ( ) { org . apache . hadoop . fs . Path localPartitionPath = new org . apache . hadoop . fs . Path ( ( "file://" + ( partitionPath ) ) ) ; org . apache . hadoop . fs . FileSystem localFs = com . uber . hoodie . common . util . FSUtils . getFs ( localPartitionPath . toString ( ) , com . uber . hoodie . common . model . HoodieTestUtils . getDefaultHadoopConf ( ) ) ; org . apache . hadoop . fs . Path testPath = new org . apache . hadoop . fs . Path ( localPartitionPath , "append_test" ) ; localFs . mkdirs ( testPath ) ; java . util . List < org . apache . avro . generic . IndexedRecord > records = com . uber . hoodie . common . util . SchemaTestUtil . generateTestRecords ( 0 , 100 ) ; java . util . Map < com . uber . hoodie . common . table . log . block . HoodieLogBlock . HeaderMetadataType , java . lang . String > header = com . google . common . collect . Maps . newHashMap ( ) ; header . put ( HoodieLogBlock . HeaderMetadataType . INSTANT_TIME , "100" ) ; header . put ( HoodieLogBlock . HeaderMetadataType . SCHEMA , getSimpleSchema ( ) . toString ( ) ) ; com . uber . hoodie . common . table . log . block . HoodieAvroDataBlock dataBlock = new com . uber . hoodie . common . table . log . block . HoodieAvroDataBlock ( records , header ) ; for ( int i = 0 ; i < 2 ; i ++ ) { com . uber . hoodie . common . table . log . HoodieLogFormat . newWriterBuilder ( ) . onParentPath ( testPath ) . withFileExtension ( HoodieArchivedLogFile . ARCHIVE_EXTENSION ) . withFileId ( "commits.archive" ) . overBaseCommit ( "" ) . withFs ( localFs ) . build ( ) . appendBlock ( dataBlock ) . close ( ) ; } org . apache . hadoop . fs . FileStatus [ ] statuses = localFs . listStatus ( testPath ) ; "<AssertPlaceHolder>" ; } listStatus ( org . apache . hadoop . mapred . JobConf ) { org . apache . hadoop . fs . FileStatus [ ] fileStatuses = super . listStatus ( job ) ; java . util . Map < com . uber . hoodie . common . table . HoodieTableMetaClient , java . util . List < org . apache . hadoop . fs . FileStatus > > groupedFileStatus = groupFileStatus ( fileStatuses ) ; com . uber . hoodie . hadoop . HoodieInputFormat . LOG . info ( ( ( "Found<sp>a<sp>total<sp>of<sp>" + ( groupedFileStatus . size ( ) ) ) + "<sp>groups" ) ) ; java . util . List < org . apache . hadoop . fs . FileStatus > returns = new java . util . ArrayList ( ) ; for ( Map . Entry < com . uber . hoodie . common . table . HoodieTableMetaClient , java . util . List < org . apache . hadoop . fs . FileStatus > > entry : groupedFileStatus . entrySet ( ) ) { com . uber . hoodie . common . table . HoodieTableMetaClient metadata = entry . getKey ( ) ; if ( metadata == null ) { returns . addAll ( entry . getValue ( ) ) ; continue ; } org . apache . hadoop . fs . FileStatus [ ] statuses = entry . getValue ( ) . toArray ( new org . apache . hadoop . fs . FileStatus [ entry . getValue ( ) . size ( ) ] ) ; if ( com . uber . hoodie . hadoop . HoodieInputFormat . LOG . isDebugEnabled ( ) ) { com . uber . hoodie . hadoop . HoodieInputFormat . LOG . debug ( ( "Hoodie<sp>Metadata<sp>initialized<sp>with<sp>completed<sp>commit<sp>Ts<sp>as<sp>:" + metadata ) ) ; } java . lang . String tableName = metadata . getTableConfig ( ) . getTableName ( ) ; java . lang . String mode = com . uber . hoodie . hadoop . HoodieHiveUtil . readMode ( org . apache . hadoop . mapreduce . Job . getInstance ( job ) , tableName ) ; com . uber . hoodie . common . table . HoodieTimeline timeline = metadata . getActiveTimeline ( ) . getCommitsTimeline ( ) . filterCompletedInstants ( ) ; com . uber . hoodie . common . table . TableFileSystemView . ReadOptimizedView roView = new com . uber . hoodie . common . table . view . HoodieTableFileSystemView ( metadata , timeline , statuses ) ; if ( HoodieHiveUtil . INCREMENTAL_SCAN_MODE . equals ( mode ) ) { java . lang . String lastIncrementalTs = com . uber . hoodie . hadoop . HoodieHiveUtil . readStartCommitTime ( org . apache . hadoop . mapreduce . Job . getInstance ( job ) , tableName ) ; java . lang . Integer maxCommits = com . uber . hoodie . hadoop . HoodieHiveUtil . readMaxCommits ( org . apache . hadoop . mapreduce . Job . getInstance ( job ) , tableName ) ; com . uber . hoodie . hadoop . HoodieInputFormat . LOG . info ( ( "Last<sp>Incremental<sp>timestamp<sp>was<sp>set<sp>as<sp>" + lastIncrementalTs ) ) ; java . util . List < java . lang . String > commitsToReturn = timeline . findInstantsAfter ( lastIncrementalTs , maxCommits ) . getInstants ( ) . map ( HoodieInstant :: getTimestamp ) . collect ( java . util . stream . Collectors . toList ( ) ) ; java . util . List < com . uber . hoodie . common . model . HoodieDataFile > filteredFiles = roView . getLatestDataFilesInRange ( commitsToReturn ) . collect ( java . util . stream . Collectors . toList ( ) ) ; for ( com . uber . hoodie . common . model . HoodieDataFile filteredFile
|
org . junit . Assert . assertEquals ( 2 , statuses . length )
|
filtersResourceWhenNotExported ( ) { when ( filter . exportsClass ( org . mule . runtime . module . artifact . api . classloader . FilteringArtifactClassLoaderTestCase . RESOURCE_NAME ) ) . thenReturn ( false ) ; filteringArtifactClassLoader = doCreateClassLoader ( java . util . Collections . emptyList ( ) ) ; java . net . URL resource = filteringArtifactClassLoader . getResource ( org . mule . runtime . module . artifact . api . classloader . FilteringArtifactClassLoaderTestCase . RESOURCE_NAME ) ; "<AssertPlaceHolder>" ; } equalTo ( java . util . Collection ) { return new org . mule . tck . util . EnumerationMatcher ( items ) ; }
|
org . junit . Assert . assertThat ( resource , org . hamcrest . CoreMatchers . equalTo ( null ) )
|
take_should_block_thread_until_element_is_available_in_queue ( ) { io . smartcat . berserker . util . LinkedEvictingBlockingQueue < java . lang . Integer > queue = new io . smartcat . berserker . util . LinkedEvictingBlockingQueue ( ) ; java . util . concurrent . CountDownLatch countDownLatch = new java . util . concurrent . CountDownLatch ( 1 ) ; newStartedThread ( ( ) -> { try { countDownLatch . await ( ) ; } catch ( e ) { } queue . put ( 2 ) ; } ) ; countDownLatch . countDown ( ) ; int val = queue . take ( ) ; "<AssertPlaceHolder>" ; } take ( ) { final java . util . concurrent . locks . ReentrantLock lock = this . lock ; lock . lock ( ) ; try { T x ; while ( ( x = unlinkFromHead ( ) ) == null ) notEmpty . await ( ) ; return x ; } finally { lock . unlock ( ) ; } }
|
org . junit . Assert . assertEquals ( 2 , val )
|
testMonitorWontTryToInstantiateAbstractClass ( ) { final com . picocontainer . containers . TransientPicoContainer tpc = new com . picocontainer . containers . TransientPicoContainer ( ) ; final java . lang . Class < com . picocontainer . web . providers . LateInstantiatingComponentMonitorTestCase . TestAbstract > key = com . picocontainer . web . providers . LateInstantiatingComponentMonitorTestCase . TestAbstract . class ; com . picocontainer . web . providers . LateInstantiatingComponentMonitor testMonitor = new com . picocontainer . web . providers . LateInstantiatingComponentMonitor ( ) ; "<AssertPlaceHolder>" ; } noComponentFound ( com . picocontainer . MutablePicoContainer , java . lang . Object ) { org . apache . commons . logging . Log log = ( ( this . log ) != null ) ? this . log : org . apache . commons . logging . LogFactory . getLog ( com . picocontainer . ComponentMonitor . class ) ; if ( log . isWarnEnabled ( ) ) { log . warn ( com . picocontainer . monitors . ComponentMonitorHelper . format ( ComponentMonitorHelper . NO_COMPONENT , key ) ) ; } return delegate . noComponentFound ( container , key ) ; }
|
org . junit . Assert . assertNull ( testMonitor . noComponentFound ( tpc , key ) )
|
parseEmptySensorWriteResponse ( ) { final java . lang . String [ ] parts = new java . lang . String [ ] { "prov1" , "sensor1" } ; when ( resource . getParts ( ) ) . thenReturn ( parts ) ; final java . util . List < org . sentilo . platform . common . domain . Observation > subscriptionList = java . util . Collections . emptyList ( ) ; final org . sentilo . platform . server . response . SentiloResponse response = org . sentilo . platform . server . response . SentiloResponse . build ( new org . apache . http . message . BasicHttpResponse ( new org . apache . http . message . BasicStatusLine ( org . apache . http . HttpVersion . HTTP_1_0 , 200 , "" ) ) ) ; parser . writeResponse ( sentiloRequest , response , subscriptionList ) ; final java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; ( ( org . apache . http . entity . ByteArrayEntity ) ( response . getHttpResponse ( ) . getEntity ( ) ) ) . writeTo ( baos ) ; final java . lang . String expected = "{\"observations\":[]}" ; "<AssertPlaceHolder>" ; } toString ( ) { final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "---<sp>Sensor<sp>observations<sp>---" ) ; sb . append ( "\n\t<sp>sensor:" ) . append ( sensor ) ; if ( org . springframework . util . StringUtils . hasText ( location ) ) { sb . append ( "\n\t<sp>location:" ) . append ( location ) ; } if ( ! ( org . springframework . util . CollectionUtils . isEmpty ( observations ) ) ) { sb . append ( observations . toString ( ) ) ; } return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , baos . toString ( ) )
|
testGetPlatformServicesAddServiceType ( ) { org . hyperic . hq . appdef . server . session . ServerType vServerType = createServerType ( "CPU<sp>Server" , "1.0" , new java . lang . String [ ] { testPlatforms . get ( 0 ) . getPlatformType ( ) . getName ( ) } , "Test<sp>virtual<sp>Server<sp>Plugin" , true ) ; org . hyperic . hq . appdef . shared . ServerValue serverVal = new org . hyperic . hq . appdef . shared . ServerValue ( ) ; org . hyperic . hq . appdef . server . session . Server virtualServer = serverManager . createServer ( subject , testPlatforms . get ( 0 ) . getId ( ) , vServerType . getId ( ) , serverVal ) ; org . hyperic . util . pager . PageList < org . hyperic . hq . appdef . shared . ServiceValue > svalues = new org . hyperic . util . pager . PageList < org . hyperic . hq . appdef . shared . ServiceValue > ( ) ; org . hyperic . hq . product . ServiceTypeInfo sinfo = new org . hyperic . hq . product . ServiceTypeInfo ( ) ; sinfo . setDescription ( "Test<sp>ServiceType<sp>Desc" ) ; sinfo . setInternal ( false ) ; sinfo . setName ( "Test<sp>ServiceType<sp>Name" ) ; org . hyperic . hq . appdef . server . session . ServiceType serviceType = serviceManager . createServiceType ( sinfo , "Test<sp>Service<sp>Plugin" , vServerType ) ; for ( int i = 1 ; i <= 5 ; i ++ ) { svalues . add ( serviceManager . createService ( subject , virtualServer . getId ( ) , serviceType . getId ( ) , ( "Test<sp>Service<sp>Name" + i ) , ( "Test<sp>Service<sp>From<sp>Server" + i ) , "my<sp>computer" ) . getServiceValue ( ) ) ; } org . hyperic . util . pager . PageList < org . hyperic . hq . appdef . shared . ServiceValue > svalues1 = serviceManager . getPlatformServices ( subject , testPlatforms . get ( 0 ) . getId ( ) , serviceType . getId ( ) , new org . hyperic . util . pager . PageControl ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
|
org . junit . Assert . assertEquals ( svalues , svalues1 )
|
checkGetValueMethod ( ) { info . smart_tools . smartactors . iobject . iobject . IObject config = mock ( info . smart_tools . smartactors . iobject . iobject . IObject . class ) ; info . smart_tools . smartactors . iobject . iobject . IObject rule = mock ( info . smart_tools . smartactors . iobject . iobject . IObject . class ) ; java . util . List < info . smart_tools . smartactors . iobject . iobject . IObject > rulesList = new java . util . ArrayList < info . smart_tools . smartactors . iobject . iobject . IObject > ( ) { { add ( rule ) ; } } ; when ( config . getValue ( new info . smart_tools . smartactors . iobject . field_name . FieldName ( "StringValue" ) ) ) . thenReturn ( rulesList ) ; info . smart_tools . smartactors . iobject . iobject . IObject env = mock ( info . smart_tools . smartactors . iobject . iobject . IObject . class ) ; info . smart_tools . smartactors . iobject . iobject . IObject message = mock ( info . smart_tools . smartactors . iobject . iobject . IObject . class ) ; info . smart_tools . smartactors . iobject . iobject . IObject submessage = mock ( info . smart_tools . smartactors . iobject . iobject . IObject . class ) ; when ( env . getValue ( new info . smart_tools . smartactors . iobject . field_name . FieldName ( "message" ) ) ) . thenReturn ( message ) ; when ( message . getValue ( new info . smart_tools . smartactors . iobject . field_name . FieldName ( "submessage" ) ) ) . thenReturn ( submessage ) ; when ( submessage . getValue ( new info . smart_tools . smartactors . iobject . field_name . FieldName ( "stringValue" ) ) ) . thenReturn ( "1" ) ; when ( rule . getValue ( new info . smart_tools . smartactors . iobject . field_name . FieldName ( "name" ) ) ) . thenReturn ( "wds_getter_strategy" ) ; when ( rule . getValue ( new info . smart_tools . smartactors . iobject . field_name . FieldName ( "args" ) ) ) . thenReturn ( new java . util . ArrayList < java . lang . String > ( ) { { add ( "message/submessage/stringValue" ) ; } } ) ; info . smart_tools . smartactors . iobject . iobject . IObject wObj = new info . smart_tools . smartactors . iobject_extension . wds_object . WDSObject ( config ) ; ( ( info . smart_tools . smartactors . iobject . iobject_wrapper . IObjectWrapper ) ( wObj ) ) . init ( env ) ; java . lang . String i = ( ( java . lang . String ) ( wObj . getValue ( new info . smart_tools . smartactors . iobject . field_name . FieldName ( "StringValue" ) ) ) ) ; "<AssertPlaceHolder>" ; } getValue ( info . smart_tools . smartactors . iobject . ifield_name . IFieldName ) { if ( null == name ) { throw new info . smart_tools . smartactors . base . exception . invalid_argument_exception . InvalidArgumentException ( "Name<sp>parameter<sp>should<sp>not<sp>be<sp>null." ) ; } return body . get ( name ) ; }
|
org . junit . Assert . assertEquals ( i , "1" )
|
test_subusers_reputations_get ( ) { com . sendgrid . SendGrid sg = new com . sendgrid . SendGrid ( "SENDGRID_API_KEY" , true ) ; sg . setHost ( "localhost:4010" ) ; sg . addRequestHeader ( "X-Mock" , "200" ) ; com . sendgrid . Request request = new com . sendgrid . Request ( ) ; request . setMethod ( Method . GET ) ; request . setEndpoint ( "subusers/reputations" ) ; request . addQueryParam ( "usernames" , "test_string" ) ; com . sendgrid . Response response = sg . api ( request ) ; "<AssertPlaceHolder>" ; } api ( com . sendgrid . Request ) { com . sendgrid . Request req = new com . sendgrid . Request ( ) ; req . setMethod ( request . getMethod ( ) ) ; req . setBaseUri ( this . host ) ; req . setEndpoint ( ( ( ( "/" + ( version ) ) + "/" ) + ( request . getEndpoint ( ) ) ) ) ; req . setBody ( request . getBody ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > header : this . requestHeaders . entrySet ( ) ) { req . addHeader ( header . getKey ( ) , header . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , java . lang . String > queryParam : request . getQueryParams ( ) . entrySet ( ) ) { req . addQueryParam ( queryParam . getKey ( ) , queryParam . getValue ( ) ) ; } return makeCall ( req ) ; }
|
org . junit . Assert . assertEquals ( 200 , response . getStatusCode ( ) )
|
findChildInTwoLevelResource ( ) { com . eviware . soapui . impl . rest . RestResource parent = com . eviware . soapui . utils . ModelItemFactory . makeRestResource ( ) ; parent . setPath ( "/parent" ) ; com . eviware . soapui . impl . rest . RestResource child = parent . addNewChildResource ( "child" , "/child" ) ; com . eviware . soapui . impl . rest . panels . component . RestResourceFinder finder = new com . eviware . soapui . impl . rest . panels . component . RestResourceFinder ( child ) ; "<AssertPlaceHolder>" ; } findResourceAt ( int ) { java . lang . String basePath = resource . getInterface ( ) . getBasePath ( ) ; if ( ( ! ( com . eviware . soapui . support . StringUtils . isNullOrEmpty ( basePath ) ) ) && ( caretPosition <= ( basePath . length ( ) ) ) ) { return null ; } for ( com . eviware . soapui . impl . rest . RestResource r : com . eviware . soapui . impl . rest . support . RestUtils . extractAncestorsParentFirst ( resource ) ) { if ( caretPosition <= ( r . getFullPath ( ) . length ( ) ) ) { return r ; } } return resource ; }
|
org . junit . Assert . assertThat ( finder . findResourceAt ( 10 ) , org . hamcrest . core . Is . is ( child ) )
|
readStreamInfo ( ) { final org . toilelibre . libe . soundtransform . model . converted . FormatInfo fi = org . toilelibre . libe . soundtransform . actions . fluent . FluentClient . start ( ) . withAnObserver ( new org . toilelibre . libe . soundtransform . infrastructure . service . observer . Slf4jObserver ( org . toilelibre . libe . soundtransform . model . logging . LogEvent . LogLevel . WARN ) ) . withClasspathResource ( "before.wav" ) . importToStream ( ) . stopWithStreamInfo ( ) ; "<AssertPlaceHolder>" ; new org . toilelibre . libe . soundtransform . infrastructure . service . observer . Slf4jObserver ( ) . notify ( fi . toString ( ) ) ; } stopWithStreamInfo ( ) { return new org . toilelibre . libe . soundtransform . actions . transform . GetStreamInfo ( this . getObservers ( ) ) . getStreamInfo ( this . audioInputStream ) ; }
|
org . junit . Assert . assertNotNull ( fi )
|
testGetParametersWithDefaultEntityAndDisabledStatus ( ) { unit . setActive ( false ) ; org . lnu . is . domain . education . type . EducationType entity = new org . lnu . is . domain . education . type . EducationType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "userGroups" , groups ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testInitDynAnyFromDynAny ( ) { java . lang . String msg ; org . omg . CORBA . Any any = null ; org . omg . CORBA . TypeCode tc = null ; org . omg . DynamicAny . DynEnum dynAny = null ; org . omg . DynamicAny . DynEnum dynAny2 = null ; tc = org . jacorb . test . EnumTypeHelper . type ( ) ; dynAny = createDynAnyFromTypeCode ( tc ) ; any = orb . create_any ( ) ; org . jacorb . test . EnumTypeHelper . insert ( any , org . jacorb . test . EnumType . from_int ( 1 ) ) ; dynAny2 = createDynAnyFromAny ( any ) ; msg = "Failed<sp>to<sp>initialize<sp>a<sp>DynAny<sp>object<sp>from<sp>another<sp>DynAny<sp>" ; msg += "object<sp>using<sp>the<sp>DynAny::assign<sp>operation" ; try { dynAny . assign ( dynAny2 ) ; } catch ( java . lang . Throwable ex ) { org . junit . Assert . fail ( ( ( msg + ":<sp>" ) + ex ) ) ; } "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
|
org . junit . Assert . assertTrue ( msg , dynAny . equal ( dynAny2 ) )
|
testOperationWithWrongNameYamlExtension ( ) { java . net . URI resource = getClass ( ) . getResource ( "/corrupted/wrong_name_operation.yaml" ) . toURI ( ) ; io . cloudslang . lang . compiler . modeller . result . ExecutableModellingResult result = compiler . preCompileSource ( io . cloudslang . lang . compiler . SlangSource . fromFile ( resource ) ) ; "<AssertPlaceHolder>" ; exception . expect ( io . cloudslang . lang . compiler . RuntimeException . class ) ; exception . expectMessage ( "should<sp>be<sp>declared<sp>in<sp>a<sp>file<sp>named<sp>\"test_op.yaml\"" ) ; throw result . getErrors ( ) . get ( 0 ) ; } getErrors ( ) { return errors ; }
|
org . junit . Assert . assertTrue ( ( ( result . getErrors ( ) . size ( ) ) > 0 ) )
|
geocodeStructuredAdressShouldCallGeocodeAddressIfParsedAddressIsSuccess ( ) { GeocodeAdressCalled = false ; com . gisgraphy . geocoding . GeocodingService geocodingService = new com . gisgraphy . geocoding . GeocodingService ( ) { @ com . gisgraphy . geocoding . Override public com . gisgraphy . addressparser . AddressResultsDto geocode ( com . gisgraphy . addressparser . Address address , java . lang . String countryCode ) throws com . gisgraphy . geocoding . GeocodingException { GeocodeAdressCalled = true ; return null ; } } ; com . gisgraphy . importer . ImporterConfig importerConfig = org . easymock . EasyMock . createMock ( com . gisgraphy . importer . ImporterConfig . class ) ; org . easymock . EasyMock . expect ( importerConfig . isOpenStreetMapFillIsIn ( ) ) . andStubReturn ( true ) ; geocodingService . setImporterConfig ( importerConfig ) ; geocodingService . setStatsUsageService ( statsUsageService ) ; geocodingService . setGisgraphyConfig ( gisgraphyConfig ) ; gisgraphyConfig . setUseAddressParserWhenGeocoding ( true ) ; com . gisgraphy . addressparser . IAddressParserService mockAddressParserService = org . easymock . EasyMock . createMock ( com . gisgraphy . addressparser . IAddressParserService . class ) ; java . util . List < com . gisgraphy . addressparser . Address > addressList = new java . util . ArrayList < com . gisgraphy . addressparser . Address > ( ) { { com . gisgraphy . addressparser . Address address = new com . gisgraphy . addressparser . Address ( ) ; address . setStreetName ( "streetName" ) ; address . setCity ( "city" ) ; add ( address ) ; } } ; com . gisgraphy . addressparser . AddressResultsDto addressresults = new com . gisgraphy . addressparser . AddressResultsDto ( addressList , 3L ) ; org . easymock . EasyMock . expect ( mockAddressParserService . execute ( ( ( com . gisgraphy . addressparser . AddressQuery ) ( org . easymock . EasyMock . anyObject ( ) ) ) ) ) . andReturn ( addressresults ) ; org . easymock . EasyMock . replay ( mockAddressParserService ) ; geocodingService . setAddressParser ( mockAddressParserService ) ; com . gisgraphy . addressparser . AddressQuery query = new com . gisgraphy . addressparser . StructuredAddressQuery ( new com . gisgraphy . addressparser . Address ( ) , "ac" ) ; geocodingService . geocode ( query ) ; "<AssertPlaceHolder>" ; } geocode ( com . gisgraphy . addressparser . AddressQuery ) { if ( query == null ) { throw new com . gisgraphy . geocoding . GeocodingException ( "Can<sp>not<sp>geocode<sp>a<sp>null<sp>query" ) ; } com . gisgraphy . geocoding . GeocodingService . logger . info ( query . toString ( ) ) ; java . lang . String countryCode = query . getCountry ( ) ; if ( ( countryCode != null ) && ( ( countryCode . trim ( ) . length ( ) ) != 2 ) ) { throw new com . gisgraphy . geocoding . GeocodingException ( ( "<sp>:<sp>" 7 + countryCode ) ) ; } if ( query instanceof com . gisgraphy . addressparser . StructuredAddressQuery ) { com . gisgraphy . addressparser . Address address = ( ( com . gisgraphy . addressparser . StructuredAddressQuery ) ( query ) ) . getStructuredAddress ( ) ; if ( com . gisgraphy . geocoding . GeocodingService . logger . isDebugEnabled ( ) ) { com . gisgraphy . geocoding . GeocodingService . logger . debug ( ( ( ( "is_in<sp>is<sp>active" 9 + address ) + "<sp>:<sp>" 5 ) + countryCode ) ) ; } com . gisgraphy . addressparser . AddressResultsDto addressResultsDto = geocode ( address , countryCode ) ; if ( shouldSetParseAddress ( query ) ) { addressResultsDto . setParsedAddress ( address ) ; } return com . gisgraphy . reversegeocoding . AddressHelper . limitNbResult ( addressResultsDto , query . getLimitNbResult ( ) ) ; } java . lang . String rawAddress = query . getAddress ( ) ; java . lang . Long startTime = java . lang . System . currentTimeMillis ( ) ; if ( isEmptyString ( rawAddress ) ) { throw new com . gisgraphy . geocoding . GeocodingException ( "Can<sp>not<sp>geocode<sp>a<sp>null<sp>or<sp>empty<sp>address" ) ; } com . gisgraphy . helper . CountryDetectorDto detectorDto = countryDetector . detectAndRemoveCountry ( rawAddress ) ; if ( ( detectorDto != null ) && ( ( detectorDto . getCountryCode ( ) ) != null ) ) { if ( ( ( detectorDto . getAddress ( ) ) != null ) && ( ! ( detectorDto . getAddress ( ) . trim ( ) . equals ( "is_in<sp>is<sp>active" 4 ) ) ) ) { com . gisgraphy . geocoding . GeocodingService . logger . debug ( ( "<sp>:<sp>" 1 + ( detectorDto . getCountryCode ( ) ) ) ) ; rawAddress = detectorDto . getAddress ( ) ; if ( countryCode == null ) { countryCode = detectorDto . getCountryCode ( ) ; } } else { java . util . List < com . gisgraphy . fulltext . SolrResponseDto > countries = findInText ( rawAddress , null , null , com . gisgraphy . fulltext . Constants . ONLY_COUNTRY_PLACETYPE , false , null ) ; com . gisgraphy . addressparser . AddressResultsDto results = buildAddressResultDtoFromSolrResponseDtoCountry ( countries ) ; return com . gisgraphy . reversegeocoding . AddressHelper . limitNbResult ( results , query . getLimitNbResult ( ) ) ; } } if ( ( countryCode != null ) && ( ( countryCode . trim ( ) . length ( ) ) != 2 ) ) { throw new com . gisgraphy . geocoding . GeocodingException ( ( "<sp>:<sp>" 7 + countryCode ) ) ; } if ( com . gisgraphy . geocoding . GeocodingService . logger . isDebugEnabled ( ) ) { com . gisgraphy . geocoding . GeocodingService . logger . debug ( ( ( ( "<sp>:<sp>" 2 + rawAddress ) + "<sp>:<sp>" 5 ) + countryCode ) ) ; } com . gisgraphy . addressparser . AddressQuery addressQuery = new com . gisgraphy . addressparser . AddressQuery ( rawAddress ,
|
org . junit . Assert . assertTrue ( GeocodeAdressCalled )
|
shouldIterateReadersUntilFindUsableProperties ( ) { org . jstryker . database . connection . ConnectionPropertiesReader unusableProperties = mock ( org . jstryker . database . connection . ConnectionPropertiesReader . class ) ; org . jstryker . database . connection . ConnectionPropertiesReader usableProperties = new org . jstryker . database . connection . HibernatePropertiesReader ( ) ; readers . add ( unusableProperties ) ; readers . add ( usableProperties ) ; "<AssertPlaceHolder>" ; } getConnectionPropertiesReader ( ) { try { for ( org . jstryker . database . connection . ConnectionPropertiesReader reader : propertiesReader ) { java . io . InputStream stream = getClass ( ) . getResourceAsStream ( ( "/" + ( reader . getPropertiesFileName ( ) ) ) ) ; if ( stream != null ) { java . util . Properties properties = new java . util . Properties ( ) ; properties . load ( stream ) ; reader . read ( properties ) ; stream . close ( ) ; return reader ; } } } catch ( java . io . IOException e ) { throw new org . jstryker . exception . JStrykerException ( e . getMessage ( ) , e ) ; } throw new org . jstryker . exception . JStrykerException ( "jstryker.properties<sp>or<sp>hibernate.properties<sp>not<sp>found<sp>in<sp>classpath." ) ; }
|
org . junit . Assert . assertSame ( usableProperties , factory . getConnectionPropertiesReader ( ) )
|
testEqual ( ) { final org . apache . drill . exec . expr . holders . VarCharHolder left = org . apache . drill . exec . fn . impl . TestByteComparisonFunctions . hello ; final org . apache . drill . exec . expr . holders . VarCharHolder right = org . apache . drill . exec . fn . impl . TestByteComparisonFunctions . hello ; "<AssertPlaceHolder>" ; } equal ( io . netty . buffer . DrillBuf , int , int , io . netty . buffer . DrillBuf , int , int ) { rangeCheck ( left , lStart , lEnd , right , rStart , rEnd ) ; return org . apache . drill . exec . expr . fn . impl . ByteFunctionHelpers . memEqual ( left . memoryAddress ( ) , lStart , lEnd , right . memoryAddress ( ) , rStart , rEnd ) ; }
|
org . junit . Assert . assertTrue ( ( ( org . apache . drill . exec . expr . fn . impl . ByteFunctionHelpers . equal ( left . buffer , left . start , left . end , right . buffer , right . start , right . end ) ) == 1 ) )
|
testRegressionJavaUtilPropertiesLoadConvert ( ) { java . lang . reflect . Method m = org . adoptopenjdk . jitwatch . test . UnitTestUtil . getMethod ( "java.util.Properties" , "loadConvert" , new java . lang . Class < ? > [ ] { char [ ] . class , int . class , int . class , char [ ] . class } ) ; org . adoptopenjdk . jitwatch . model . MetaMethod method = new org . adoptopenjdk . jitwatch . model . MetaMethod ( m , null ) ; java . lang . String sourceSig = "private<sp>String<sp>loadConvert<sp>(char[]<sp>in,<sp>int<sp>off,<sp>int<sp>len,<sp>char[]<sp>convtBuf)<sp>{" ; java . util . regex . Matcher matcher = java . util . regex . Pattern . compile ( method . getSourceMethodSignatureRegEx ( ) ) . matcher ( sourceSig ) ; boolean match = matcher . find ( ) ; "<AssertPlaceHolder>" ; } getSourceMethodSignatureRegEx ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; builder . append ( org . adoptopenjdk . jitwatch . model . C_HAT ) ; builder . append ( org . adoptopenjdk . jitwatch . model . REGEX_GROUP_ANY ) ; java . lang . String modifiers = java . lang . reflect . Modifier . toString ( modifier ) ; if ( ( modifiers . length ( ) ) > 0 ) { builder . append ( modifiers ) . append ( org . adoptopenjdk . jitwatch . model . C_SPACE ) ; } if ( ( ! ( isConstructor ( ) ) ) && ( ( returnType ) != null ) ) { java . lang . String rt = org . adoptopenjdk . jitwatch . model . AbstractMetaMember . expandParamRegEx ( returnType . getName ( ) ) ; builder . append ( rt ) ; builder . append ( org . adoptopenjdk . jitwatch . model . C_SPACE ) ; } if ( isConstructor ( ) ) { builder . append ( org . adoptopenjdk . jitwatch . model . REGEX_UNICODE_PACKAGE_NAME ) ; builder . append ( org . adoptopenjdk . jitwatch . util . StringUtil . getUnqualifiedClassName ( memberName ) ) ; } else { builder . append ( memberName ) ; } return builder . toString ( ) ; }
|
org . junit . Assert . assertTrue ( match )
|
setValueServerWhenReadOnly ( ) { com . vaadin . ui . RichTextArea tf = new com . vaadin . ui . RichTextArea ( ) ; tf . setReadOnly ( true ) ; tf . setValue ( "foo" ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertEquals ( "foo" , tf . getValue ( ) )
|
testCreateSSLSocketFactory ( ) { org . apache . servicecomb . foundation . ssl . SSLOption option = org . apache . servicecomb . foundation . ssl . SSLOption . build ( ( ( DIR ) + "/server.ssl.properties" ) ) ; org . apache . servicecomb . foundation . ssl . SSLCustom custom = new org . apache . servicecomb . foundation . ssl . SSLCustom ( ) { @ org . apache . servicecomb . foundation . ssl . Override public java . lang . String getFullPath ( java . lang . String filename ) { return ( ( DIR ) + "/ssl/" ) + filename ; } @ org . apache . servicecomb . foundation . ssl . Override public char [ ] decode ( char [ ] encrypted ) { return encrypted ; } } ; javax . net . ssl . SSLSocketFactory aSSLSocketFactory = org . apache . servicecomb . foundation . ssl . SSLManager . createSSLSocketFactory ( option , custom ) ; "<AssertPlaceHolder>" ; } getDefaultCipherSuites ( ) { return this . sslSocketFactory . getDefaultCipherSuites ( ) ; }
|
org . junit . Assert . assertNotNull ( aSSLSocketFactory . getDefaultCipherSuites ( ) [ 0 ] )
|
ListAutomationRules ( ) { try { com . smartsheet . api . Smartsheet ss = com . smartsheet . api . sdk_test . HelperFunctions . SetupClient ( "List<sp>Automation<sp>Rules" ) ; com . smartsheet . api . sdk_test . PagedResult < com . smartsheet . api . sdk_test . AutomationRule > automationRules = ss . sheetResources ( ) . automationRuleResources ( ) . listAutomationRules ( 324 , null ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception ex ) { com . smartsheet . api . sdk_test . HelperFunctions . ExceptionMessage ( ex . getMessage ( ) , ex . getCause ( ) ) ; } } getTotalCount ( ) { return totalCount ; }
|
org . junit . Assert . assertEquals ( 2 , ( ( long ) ( automationRules . getTotalCount ( ) ) ) )
|
shouldReturnAnInstanceOfDefaultProcessorForPath ( ) { org . codegist . crest . param . ParamProcessor actual = org . codegist . crest . param . ParamProcessors . newInstance ( ParamType . PATH , null ) ; "<AssertPlaceHolder>" ; } newInstance ( org . codegist . crest . config . ParamType , java . lang . String ) { switch ( type ) { case COOKIE : return listSeparator != null ? new org . codegist . crest . param . CollectionMergingCookieParamProcessor ( listSeparator ) : DefaultCookieParamProcessor . INSTANCE ; default : return listSeparator != null ? new org . codegist . crest . param . CollectionMergingParamProcessor ( listSeparator ) : DefaultParamProcessor . INSTANCE ; } }
|
org . junit . Assert . assertSame ( DefaultParamProcessor . INSTANCE , actual )
|
whenIsPowOfInteger_shouldReturnTrueIfPowerOfTwo ( ) { boolean result = com . google . common . math . IntMath . isPowerOfTwo ( 16 ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( result )
|
columnsTableNameElementNotInQuotes ( ) { class TestClass { @ com . zaxxer . sansorm . internal . Column ( table = "Table_Name" ) java . lang . String columnName ; } com . zaxxer . sansorm . internal . Introspected introspected = new com . zaxxer . sansorm . internal . Introspected ( TestClass . class ) ; java . lang . String [ ] columnTableNames = introspected . getColumnTableNames ( ) ; "<AssertPlaceHolder>" ; } getColumnTableNames ( ) { return columnTableNames ; }
|
org . junit . Assert . assertEquals ( "Table_Name" , columnTableNames [ 0 ] )
|
testGetMissingRomsFilesWithFullRomPath ( ) { org . tibennetwork . iarcade . mame . FakeMameRuntime mame = new org . tibennetwork . iarcade . mame . FakeMameRuntime ( ) ; java . util . List < java . io . InputStream > inputStreams = new java . util . ArrayList ( ) ; inputStreams . add ( new java . io . FileInputStream ( "src/test/resources/xml/neomrdo.xml" ) ) ; inputStreams . add ( new java . io . FileInputStream ( "src/test/resources/xml/neogeo.xml" ) ) ; mame . setInputStreamsToReturn ( inputStreams ) ; org . tibennetwork . iarcade . mame . MachineRepository mr = new org . tibennetwork . iarcade . mame . MachineRepository ( mame ) ; org . tibennetwork . iarcade . mame . Machine m = mr . findByName ( "neomrdo" ) ; java . util . Set < java . io . File > romPaths = new java . util . HashSet ( ) ; romPaths . add ( new java . io . File ( "src/test/resources/full-rompath" ) ) ; java . util . Set < java . lang . String > missingFiles = m . getMissingRomFiles ( MachineRomSetFormat . SPLIT , romPaths ) ; java . util . Set < java . lang . String > expectedMissingFiles = new java . util . HashSet ( ) ; "<AssertPlaceHolder>" ; } getMissingRomFiles ( org . tibennetwork . iarcade . internetarchive . MachineRomSet . MachineRomSetFormat , java . util . Set ) { java . util . Set < java . lang . String > missingRomFiles = new java . util . HashSet ( ) ; romfileloop : for ( java . lang . String romFile : this . getNeededRomFiles ( format ) ) { for ( java . io . File romPath : romPaths ) { java . lang . String romFileInRomPathWithoutExtension = ( ( romPath . getAbsolutePath ( ) ) + ( java . io . File . separator ) ) + romFile ; java . io . File zippedRomFileInRomPath = new java . io . File ( ( romFileInRomPathWithoutExtension + ".zip" ) ) ; java . io . File SevenZippedRomFileInRomPath = new java . io . File ( ( romFileInRomPathWithoutExtension + ".7z" ) ) ; if ( ( zippedRomFileInRomPath . exists ( ) ) || ( SevenZippedRomFileInRomPath . exists ( ) ) ) { continue romfileloop ; } } missingRomFiles . add ( romFile ) ; } return missingRomFiles ; }
|
org . junit . Assert . assertThat ( missingFiles , org . hamcrest . CoreMatchers . equalTo ( expectedMissingFiles ) )
|
puttingShortToEmptyBufferCausesError ( ) { short [ ] array = new short [ 4 ] ; java . nio . ShortBuffer buffer = java . nio . ShortBuffer . wrap ( array ) ; buffer . limit ( 2 ) ; buffer . put ( ( ( short ) ( 2 ) ) ) . put ( ( ( short ) ( 3 ) ) ) ; try { buffer . put ( ( ( short ) ( 5 ) ) ) ; org . junit . Assert . fail ( "Should<sp>have<sp>thrown<sp>error" ) ; } catch ( java . nio . BufferOverflowException e ) { "<AssertPlaceHolder>" ; } } put ( byte ) { if ( readOnly ) { throw new org . teavm . classlib . java . nio . TReadOnlyBufferException ( ) ; } if ( ( position ) >= ( limit ) ) { throw new org . teavm . classlib . java . nio . TBufferOverflowException ( ) ; } array [ ( ( start ) + ( ( position ) ++ ) ) ] = b ; return this ; }
|
org . junit . Assert . assertThat ( array [ 2 ] , org . hamcrest . CoreMatchers . is ( ( ( short ) ( 0 ) ) ) )
|
testConvertWithEmptyFields ( ) { org . lnu . is . domain . publicactivity . PublicActivity expected = new org . lnu . is . domain . publicactivity . PublicActivity ( ) ; org . lnu . is . resource . publicactivity . PublicActivityResource source = new org . lnu . is . resource . publicactivity . PublicActivityResource ( ) ; org . lnu . is . domain . publicactivity . PublicActivity actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testSerialThreadBoundClose ( ) { agds . setSleep ( 100 ) ; agds . threadBound = true ; core . setUserRequestSourceConcurrency ( 1 ) ; java . lang . String sql = "SELECT<sp>IntKey<sp>FROM<sp>BQT1.SmallA" ; java . lang . String userName = "logon" ; ( ( org . teiid . common . buffer . impl . BufferManagerImpl ) ( core . getBufferManager ( ) ) ) . setProcessorBatchSize ( 1 ) ; org . teiid . client . RequestMessage reqMsg = exampleRequestMessage ( sql ) ; execute ( userName , 1 , reqMsg ) ; "<AssertPlaceHolder>" ; } getCloseCount ( ) { return closeCount ; }
|
org . junit . Assert . assertEquals ( 1 , agds . getCloseCount ( ) . get ( ) )
|
getDefaultLanguage ( ) { when ( operatorServiceLocal . getDefaultLanguage ( ) ) . thenReturn ( DEFAULT_LANGUAGE_ISOCODE ) ; java . lang . String isoCode = service . getDefaultLanguage ( ) ; "<AssertPlaceHolder>" ; } getDefaultLanguage ( ) { javax . persistence . Query q = dm . createNamedQuery ( "SupportedLanguage.findDefault" ) ; java . util . List < java . lang . String > list = org . oscm . converter . ParameterizedTypes . list ( q . getResultList ( ) , java . lang . String . class ) ; if ( ( list == null ) || ( ( list . size ( ) ) < 1 ) ) { org . oscm . internal . types . exception . ObjectNotFoundException e = new org . oscm . internal . types . exception . ObjectNotFoundException ( "Default<sp>supported<sp>language<sp>cannot<sp>be<sp>found." ) ; org . oscm . operatorservice . bean . OperatorServiceLocalBean . logger . logError ( Log4jLogger . SYSTEM_LOG , e , LogMessageIdentifier . ERROR_DEFAULT_LANGUAGE_NOT_FOUND , new java . lang . String [ ] { } ) ; throw e ; } else if ( ( list . size ( ) ) > 1 ) { org . oscm . internal . types . exception . ObjectNotFoundException e = new org . oscm . internal . types . exception . ObjectNotFoundException ( "Two<sp>or<sp>more<sp>default<sp>supported<sp>languages<sp>have<sp>been<sp>found." ) ; org . oscm . operatorservice . bean . OperatorServiceLocalBean . logger . logError ( Log4jLogger . SYSTEM_LOG , e , LogMessageIdentifier . ERROR_DEFAULT_LANGUAGE_MORE_THAN_ONE , new java . lang . String [ ] { } ) ; throw e ; } return list . get ( 0 ) ; }
|
org . junit . Assert . assertEquals ( DEFAULT_LANGUAGE_ISOCODE , isoCode )
|
testGetMinMaxY ( ) { System . out . println ( "getMinMaxY" ) ; int maxPoints = 0 ; kg . apc . charting . AbstractGraphRow instance = new kg . apc . charting . AbstractGraphRowTest . AbstractGraphRowImpl ( ) ; double [ ] result = instance . getMinMaxY ( maxPoints ) ; "<AssertPlaceHolder>" ; } getMinMaxY ( int ) { return graphRow . getMinMaxY ( maxPoints ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
testDefaultPolicies ( ) { org . springframework . retry . RetryContext context = policy . open ( null ) ; "<AssertPlaceHolder>" ; } open ( org . springframework . retry . RetryContext ) { java . util . List < org . springframework . retry . RetryContext > list = new java . util . ArrayList < org . springframework . retry . RetryContext > ( ) ; for ( org . springframework . retry . RetryPolicy policy : this . policies ) { list . add ( policy . open ( parent ) ) ; } return new org . springframework . retry . policy . CompositeRetryPolicy . CompositeRetryContext ( parent , list , this . policies ) ; }
|
org . junit . Assert . assertNotNull ( context )
|
discardLogicWhitespace3 ( ) { java . lang . String html = rocker . DiscardLogicWhitespace3 . template ( "World" ) . render ( ) . toString ( ) ; java . lang . String expected = "<sp>Hello<sp>World!" ; "<AssertPlaceHolder>" ; } toString ( ) { byte [ ] bytes = toByteArray ( ) ; return new java . lang . String ( bytes , this . charset ) ; }
|
org . junit . Assert . assertEquals ( expected , html )
|
shouldInitialize ( ) { org . apache . sling . api . resource . Resource resource = com . adobe . acs . commons . wcm . comparisons . impl . PageCompareDataImplTest . mockResource ( "/my/path" , "latest" , new java . util . Date ( ) ) ; com . adobe . acs . commons . wcm . comparisons . PageCompareDataLoader one2OneData = new com . adobe . acs . commons . wcm . comparisons . impl . PageCompareDataLoaderImpl ( ) ; final com . adobe . acs . commons . wcm . comparisons . PageCompareData data = one2OneData . load ( resource , "latest" ) ; "<AssertPlaceHolder>" ; } load ( org . apache . sling . api . resource . Resource , java . lang . String ) { if ( ( resource != null ) && ( ! ( org . apache . sling . api . resource . ResourceUtil . isNonExistingResource ( resource ) ) ) ) { try { return loader . load ( resource , version ) ; } catch ( javax . jcr . RepositoryException e ) { com . adobe . acs . commons . wcm . comparisons . model . PageCompareModel . log . error ( "Error<sp>loading<sp>data" , e ) ; } } return null ; }
|
org . junit . Assert . assertNotNull ( data )
|
getRawShouldReturnNullOnNonexistentPath ( ) { org . apache . hadoop . fs . Path path = new org . apache . hadoop . fs . Path ( "/some/path" ) ; org . apache . metron . rest . service . impl . PcapServiceImpl pcapService = spy ( new org . apache . metron . rest . service . impl . PcapServiceImpl ( environment , configuration , new org . apache . metron . rest . config . PcapJobSupplier ( ) , new org . apache . metron . job . manager . InMemoryJobManager ( ) , pcapToPdmlScriptWrapper ) ) ; org . apache . hadoop . fs . FileSystem fileSystem = mock ( org . apache . hadoop . fs . FileSystem . class ) ; doReturn ( fileSystem ) . when ( pcapService ) . getFileSystem ( ) ; when ( fileSystem . exists ( path ) ) . thenReturn ( false ) ; doReturn ( path ) . when ( pcapService ) . getPath ( "user" , "jobId" , 1 ) ; "<AssertPlaceHolder>" ; } getRawPcap ( java . lang . String , java . lang . String , java . lang . Integer ) { java . io . InputStream inputStream = null ; org . apache . hadoop . fs . Path path = getPath ( username , jobId , page ) ; try { org . apache . hadoop . fs . FileSystem fileSystem = getFileSystem ( ) ; if ( ( path != null ) && ( fileSystem . exists ( path ) ) ) { inputStream = fileSystem . open ( path ) ; } } catch ( java . io . IOException e ) { throw new org . apache . metron . rest . RestException ( e ) ; } return inputStream ; }
|
org . junit . Assert . assertNull ( pcapService . getRawPcap ( "user" , "jobId" , 1 ) )
|
testJAXBBeanRepresentationJSONMediaType ( ) { initiateWebApplication ( com . sun . jersey . impl . entity . EntityTypesTest . JAXBBeanResourceJSONMediaType . class ) ; com . sun . jersey . api . client . WebResource r = resource ( "/" ) ; com . sun . jersey . impl . entity . JAXBBean in = new com . sun . jersey . impl . entity . JAXBBean ( "CONTENT" ) ; com . sun . jersey . impl . entity . JAXBBean out = r . entity ( in , "application/foo+json" ) . post ( com . sun . jersey . impl . entity . JAXBBean . class ) ; "<AssertPlaceHolder>" ; } post ( java . lang . String ) { return content ; }
|
org . junit . Assert . assertEquals ( in . value , out . value )
|
func_reactive_unfoldr_iteration_perf ( ) { final java . lang . String rulebase = "rules/reloaded/func_019_perf.prova" ; final long maxCount = 10000 ; final long expectedPatterns = 2537 ; test . ws . prova . test2 . ProvaFunctionalProgrammingTest . ResultCounter count = new test . ws . prova . test2 . ProvaFunctionalProgrammingTest . ResultCounter ( expectedPatterns ) ; java . util . Map < java . lang . String , java . lang . Object > globals = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; globals . put ( "$Count" , count ) ; java . util . concurrent . CountDownLatch doneSignal = new java . util . concurrent . CountDownLatch ( 1 ) ; globals . put ( "$Latch" , doneSignal ) ; prova = new ws . prova . api2 . ProvaCommunicatorImpl ( test . ws . prova . test2 . ProvaFunctionalProgrammingTest . kAgent , test . ws . prova . test2 . ProvaFunctionalProgrammingTest . kPort , rulebase , ws . prova . api2 . ProvaCommunicatorImpl . SYNC , globals ) ; long startTime = java . lang . System . currentTimeMillis ( ) ; long accountId = 0 ; try { for ( int i = 0 ; i < maxCount ; i ++ ) { int shift = i % 32 ; accountId = ( accountId + 1 ) % 1000 ; java . util . Map < java . lang . String , java . lang . Integer > payload1 = new java . util . HashMap < java . lang . String , java . lang . Integer > ( 1 ) ; payload1 . put ( "Unexpected<sp>exception:<sp>" 0 , shift ) ; ws . prova . kernel2 . ProvaList terms = ws . prova . reference2 . ProvaListImpl . create ( new ws . prova . kernel2 . ProvaObject [ ] { ws . prova . reference2 . ProvaConstantImpl . create ( ( "" + accountId ) ) , ws . prova . reference2 . ProvaConstantImpl . create ( "async" ) , ws . prova . reference2 . ProvaConstantImpl . create ( 0 ) , ws . prova . reference2 . ProvaConstantImpl . create ( "data" ) , ws . prova . reference2 . ProvaMapImpl . wrapValues ( payload1 ) } ) ; prova . addMsg ( terms ) ; } long diff0 = ( java . lang . System . currentTimeMillis ( ) ) - startTime ; System . out . println ( ( ( "All<sp>messages<sp>sent<sp>in<sp>" + diff0 ) + "<sp>ms" ) ) ; doneSignal . await ( 1500 , TimeUnit . SECONDS ) ; long diff = ( java . lang . System . currentTimeMillis ( ) ) - startTime ; System . out . println ( ( ( ( ( count . get ( ) ) + "<sp>patterns<sp>detected<sp>in<sp>" ) + diff ) + "<sp>ms" ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Unexpected<sp>exception:<sp>" + ( e . getLocalizedMessage ( ) ) ) ) ; } } get ( ) { return count ; }
|
org . junit . Assert . assertEquals ( expectedPatterns , count . get ( ) )
|
test002_toString ( ) { final java . lang . String x = "ff00eedd003713bb1bb26b808ec9312548e73946" ; final org . eclipse . jgit . lib . ObjectId oid = org . eclipse . jgit . lib . ObjectId . fromString ( x ) ; "<AssertPlaceHolder>" ; } name ( ) { final char [ ] b = new char [ Constants . OBJECT_ID_STRING_LENGTH ] ; org . eclipse . jgit . lib . AnyObjectId . formatHexChar ( b , 0 , w1 ) ; if ( ( nibbles ) <= 8 ) return new java . lang . String ( b , 0 , nibbles ) ; org . eclipse . jgit . lib . AnyObjectId . formatHexChar ( b , 8 , w2 ) ; if ( ( nibbles ) <= 16 ) return new java . lang . String ( b , 0 , nibbles ) ; org . eclipse . jgit . lib . AnyObjectId . formatHexChar ( b , 16 , w3 ) ; if ( ( nibbles ) <= 24 ) return new java . lang . String ( b , 0 , nibbles ) ; org . eclipse . jgit . lib . AnyObjectId . formatHexChar ( b , 24 , w4 ) ; if ( ( nibbles ) <= 32 ) return new java . lang . String ( b , 0 , nibbles ) ; org . eclipse . jgit . lib . AnyObjectId . formatHexChar ( b , 32 , w5 ) ; return new java . lang . String ( b , 0 , nibbles ) ; }
|
org . junit . Assert . assertEquals ( x , oid . name ( ) )
|
equals_differentValues_shouldBeFalse ( ) { com . vaadin . v7 . data . util . filter . Like like1 = new com . vaadin . v7 . data . util . filter . Like ( "test" , "foo" ) ; com . vaadin . v7 . data . util . filter . Like like2 = new com . vaadin . v7 . data . util . filter . Like ( "test" , "bar" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } else if ( obj instanceof com . vaadin . client . metadata . Property ) { com . vaadin . client . metadata . Property other = ( ( com . vaadin . client . metadata . Property ) ( obj ) ) ; return getSignature ( ) . equals ( other . getSignature ( ) ) ; } else { return false ; } }
|
org . junit . Assert . assertFalse ( like1 . equals ( like2 ) )
|
testSuccessfulDoubleMatch ( ) { org . graylog2 . plugin . streams . StreamRule rule = getSampleRule ( ) ; rule . setValue ( "100" ) ; org . graylog2 . plugin . Message msg = getSampleMessage ( ) ; msg . addField ( "something" , "20.45" ) ; org . graylog2 . streams . matchers . StreamRuleMatcher matcher = getMatcher ( rule ) ; "<AssertPlaceHolder>" ; } match ( org . graylog2 . plugin . Message , org . graylog2 . plugin . streams . StreamRule ) { java . lang . Double msgVal = getDouble ( msg . getField ( rule . getField ( ) ) ) ; if ( msgVal == null ) { return false ; } java . lang . Double ruleVal = getDouble ( rule . getValue ( ) ) ; if ( ruleVal == null ) { return false ; } return ( rule . getInverted ( ) ) ^ ( msgVal > ruleVal ) ; }
|
org . junit . Assert . assertTrue ( matcher . match ( msg , rule ) )
|
testValideEnGeauthenticeerdBericht ( ) { nl . bzk . brp . business . stappen . BerichtVerwerkingsResultaat resultaat = getWebService ( ) . voerBerichtUit ( getBericht ( ) ) ; org . mockito . Mockito . verify ( getBerichtVerwerker ( ) ) . verwerkBericht ( org . mockito . Matchers . any ( nl . bzk . brp . model . bericht . ber . BerichtBericht . class ) , org . mockito . Matchers . any ( nl . bzk . brp . business . stappen . BerichtContext . class ) ) ; "<AssertPlaceHolder>" ; } getMeldingen ( ) { return java . util . Collections . unmodifiableSet ( meldingen ) ; }
|
org . junit . Assert . assertEquals ( 0 , resultaat . getMeldingen ( ) . size ( ) )
|
getVisits_shouldNotFindAnyVisitsIfNoneHaveGivenAttributeValues ( ) { executeDataSet ( org . openmrs . api . VisitServiceTest . VISITS_ATTRIBUTES_XML ) ; java . util . Map < org . openmrs . VisitAttributeType , java . lang . Object > attrs = new java . util . HashMap ( ) ; attrs . put ( visitService . getVisitAttributeType ( 1 ) , new java . text . SimpleDateFormat ( "yyyy-MM-dd" ) . parse ( "1411-04-25" ) ) ; java . util . List < org . openmrs . Visit > visits = visitService . getVisits ( null , null , null , null , null , null , null , null , attrs , true , false ) ; "<AssertPlaceHolder>" ; } size ( ) { return getMemberships ( ) . stream ( ) . filter ( ( m ) -> ! ( m . getVoided ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , visits . size ( ) )
|
testMultipleArgsConstructor ( ) { io . beanmother . core . common . FixtureMap fixtureMap = store . reproduce ( "multiple-args-constructor" ) ; java . lang . Object obj = io . beanmother . core . mapper . ConstructHelper . construct ( io . beanmother . core . mapper . ConstructHelperTest . MultipleArgConstructorClass . class , fixtureMap , fixtureConverter ) ; "<AssertPlaceHolder>" ; } construct ( java . lang . Class , io . beanmother . core . common . FixtureMap , io . beanmother . core . mapper . FixtureConverter ) { final java . lang . reflect . Constructor < ? > [ ] constructs = type . getConstructors ( ) ; if ( ( constructs . length ) == 0 ) throw new java . lang . UnsupportedOperationException ( ( ( "can<sp>not<sp>create<sp>an<sp>instance.<sp>" + type ) + "<sp>does<sp>not<sp>have<sp>a<sp>constructor." ) ) ; java . lang . Object newInstance = null ; if ( fixtureMap . containsKey ( io . beanmother . core . mapper . ConstructHelper . CONSTRUCT_KEY ) ) { io . beanmother . core . common . FixtureTemplate constructorFixture = fixtureMap . get ( io . beanmother . core . mapper . ConstructHelper . CONSTRUCT_KEY ) ; if ( constructorFixture instanceof io . beanmother . core . common . FixtureValue ) { newInstance = io . beanmother . core . mapper . ConstructHelper . constructByFixtureValue ( type , ( ( io . beanmother . core . common . FixtureValue ) ( constructorFixture ) ) , fixtureConverter ) ; } else if ( constructorFixture instanceof io . beanmother . core . common . FixtureList ) { newInstance = io . beanmother . core . mapper . ConstructHelper . constructByFixtureList ( type , ( ( io . beanmother . core . common . FixtureList ) ( constructorFixture ) ) , fixtureConverter ) ; } } if ( newInstance == null ) { try { newInstance = type . newInstance ( ) ; } catch ( java . lang . Exception e ) { throw new io . beanmother . core . mapper . FixtureMappingException ( type , fixtureMap , e ) ; } } return newInstance ; }
|
org . junit . Assert . assertTrue ( ( obj instanceof io . beanmother . core . mapper . ConstructHelperTest . MultipleArgConstructorClass ) )
|
string ( ) { final java . util . Collection < com . yandex . yoctodb . util . UnsignedByteArray > elements = new java . util . LinkedList ( ) ; final int size = 10 ; for ( int i = 0 ; i < size ; i ++ ) elements . add ( com . yandex . yoctodb . util . UnsignedByteArrays . from ( i ) ) ; final com . yandex . yoctodb . util . mutable . ByteArrayIndexedList set = new com . yandex . yoctodb . util . mutable . impl . VariableLengthByteArrayIndexedList ( elements ) ; final java . lang . String text = set . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( com . yandex . yoctodb . util . UnsignedByteArray ) { return new java . lang . String ( bytes . data , com . yandex . yoctodb . util . UnsignedByteArrays . UTF8 ) ; }
|
org . junit . Assert . assertTrue ( text . contains ( java . lang . Integer . toString ( size ) ) )
|
testBadFormat ( ) { try { org . arquillian . droidium . container . configuration . Validate . sdSize ( sdSizeBadFormat , "Size<sp>of<sp>SD<sp>card<sp>is<sp>not<sp>in<sp>the<sp>propper<sp>format.<sp>Consult<sp>mksdcard<sp>command<sp>for<sp>the<sp>help!" ) ; org . junit . Assert . fail ( ) ; } catch ( org . arquillian . droidium . container . configuration . AndroidContainerConfigurationException ex ) { java . lang . String expected = "Size<sp>of<sp>SD<sp>card<sp>is<sp>not<sp>in<sp>the<sp>propper<sp>format.<sp>Consult<sp>mksdcard<sp>command<sp>for<sp>the<sp>help!" ; "<AssertPlaceHolder>" ; } } sdSize ( java . lang . String , java . lang . String ) { org . arquillian . droidium . container . configuration . Validate . notNullOrEmpty ( message , "Exception<sp>message<sp>is<sp>a<sp>null<sp>object!" ) ; org . arquillian . droidium . container . configuration . Validate . notNullOrEmpty ( sdSize , "Size<sp>of<sp>the<sp>Android<sp>SD<sp>card<sp>to<sp>check<sp>is<sp>null<sp>object<sp>or<sp>empty<sp>string" ) ; if ( ( ! ( ( sdSize . trim ( ) . length ( ) ) >= 2 ) ) || ( ! ( sdSize . matches ( "^[1-9]{1}[0-9]*[KGM]?$" ) ) ) ) { throw new org . arquillian . droidium . container . configuration . AndroidContainerConfigurationException ( message ) ; } java . lang . String sizeString = null ; java . lang . String sizeUnit = null ; if ( sdSize . substring ( ( ( sdSize . length ( ) ) - 1 ) ) . matches ( "[KGM]" ) ) { sizeString = sdSize . substring ( 0 , ( ( sdSize . length ( ) ) - 1 ) ) ; sizeUnit = sdSize . substring ( ( ( sdSize . length ( ) ) - 1 ) ) ; } else { sizeString = sdSize ; } long size ; try { size = java . lang . Long . parseLong ( sizeString ) ; } catch ( java . lang . NumberFormatException e ) { throw new java . lang . IllegalArgumentException ( ( ( "Unable<sp>to<sp>parse<sp>'" + sizeString ) + "Unable<sp>to<sp>parse<sp>'" 1 ) ) ; } if ( sizeUnit == null ) { if ( ( size > 1099511627264L ) || ( size < 9437184 ) ) { throw new org . arquillian . droidium . container . configuration . AndroidContainerConfigurationException ( "Unable<sp>to<sp>parse<sp>'" 0 ) ; } return ; } if ( ( ( ( ( ( size > 1023 ) && ( sizeUnit . equals ( "G" ) ) ) || ( ( size > 1048575 ) && ( sizeUnit . equals ( "M" ) ) ) ) || ( ( size > 1073741823 ) && ( sizeUnit . equals ( "K" ) ) ) ) || ( ( size < 9 ) && ( sizeUnit . equals ( "M" ) ) ) ) || ( ( size < 9126 ) && ( sizeUnit . equals ( "K" ) ) ) ) { throw new org . arquillian . droidium . container . configuration . AndroidContainerConfigurationException ( ( "Maximum<sp>size<sp>is<sp>1099511627264<sp>bytes,<sp>1073741823K,<sp>1048575M<sp>or<sp>1023G.<sp>Minimum<sp>size<sp>is<sp>9M.<sp>" + "The<sp>Android<sp>emulator<sp>cannot<sp>use<sp>smaller<sp>images." ) ) ; } }
|
org . junit . Assert . assertEquals ( expected , ex . getMessage ( ) )
|
marshall_MPOwnerRevenueShareResult ( ) { org . oscm . billingservice . business . model . mpownershare . MarketplaceOwnerRevenueShareResult mpOwnerRevenueShareResult = createMPOwnerRevenueShareResult ( ) ; byte [ ] serialized = sharesCalculator . marshallRevenueShareResults ( mpOwnerRevenueShareResult ) ; "<AssertPlaceHolder>" ; } marshallRevenueShareResults ( java . lang . Object ) { javax . xml . bind . Marshaller marshaller = createMarshaller ( obj ) ; marshaller . setProperty ( Marshaller . JAXB_ENCODING , "UTF-8" ) ; marshaller . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , Boolean . TRUE ) ; marshaller . setProperty ( Marshaller . JAXB_FRAGMENT , Boolean . TRUE ) ; java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; marshaller . marshal ( obj , bos ) ; return bos . toByteArray ( ) ; }
|
org . junit . Assert . assertNotNull ( serialized )
|
test_calculatEndTime_datapoint_null ( ) { long now = java . lang . System . currentTimeMillis ( ) ; org . kairosdb . rollup . Duration executionInterval = new org . kairosdb . rollup . Duration ( ) ; long time = org . kairosdb . rollup . RollUpJob . calculateEndTime ( null , executionInterval , now ) ; "<AssertPlaceHolder>" ; } calculateEndTime ( org . kairosdb . core . DataPoint , org . kairosdb . core . datastore . Duration , long ) { long endTime = now ; org . kairosdb . core . http . rest . json . RelativeTime relativeTime = new org . kairosdb . core . http . rest . json . RelativeTime ( ( ( int ) ( ( org . kairosdb . rollup . RollUpJob . TOO_OLD_MULTIPLIER ) * ( executionInterval . getValue ( ) ) ) ) , executionInterval . getUnit ( ) ) ; if ( ( datapoint != null ) && ( ( datapoint . getTimestamp ( ) ) < ( relativeTime . getTimeRelativeTo ( now ) ) ) ) { endTime = relativeTime . getFutureTimeRelativeTo ( datapoint . getTimestamp ( ) ) ; } return endTime ; }
|
org . junit . Assert . assertThat ( time , org . hamcrest . CoreMatchers . equalTo ( now ) )
|
testGetVserverId ( ) { parameters . put ( PropertyHandler . VSERVER_ID , new org . oscm . app . v2_0 . data . Setting ( PropertyHandler . VSERVER_ID , "vserverid" ) ) ; propertyHandler = new org . oscm . app . iaas . PropertyHandler ( settings ) ; java . lang . String id = propertyHandler . getVserverId ( ) ; "<AssertPlaceHolder>" ; } getVserverId ( ) { return props . getValidatedProperty ( org . oscm . app . iaas . PropertyHandler . VSERVER_ID ) ; }
|
org . junit . Assert . assertEquals ( "vserverid" , id )
|
testGetSetDisposition ( ) { for ( final java . lang . String validChar : testCharsValid ) { attachment . setDisposition ( validChar ) ; "<AssertPlaceHolder>" ; } } getDisposition ( ) { return disposition ; }
|
org . junit . Assert . assertEquals ( validChar , attachment . getDisposition ( ) )
|
getNoParametersWhenAddingNoParameters ( ) { final org . bonitasoft . engine . bpm . process . impl . ProcessDefinitionBuilder processBuilder = new org . bonitasoft . engine . bpm . process . impl . ProcessDefinitionBuilder ( ) . createNewInstance ( "firstProcess" , "1.0" ) ; processBuilder . addUserTask ( "userTask1" , null ) ; final org . bonitasoft . engine . bpm . process . DesignProcessDefinition processDefinition = processBuilder . done ( ) ; final org . bonitasoft . engine . bpm . bar . BusinessArchiveBuilder businessArchive = new org . bonitasoft . engine . bpm . bar . BusinessArchiveBuilder ( ) . createNewBusinessArchive ( ) ; businessArchive . setProcessDefinition ( processDefinition ) ; final org . bonitasoft . engine . bpm . process . ProcessDefinition definition = getProcessAPI ( ) . deploy ( businessArchive . done ( ) ) ; final int numberOfParamters = getProcessAPI ( ) . getNumberOfParameterInstances ( definition . getId ( ) ) ; "<AssertPlaceHolder>" ; deleteProcess ( definition ) ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( 0 , numberOfParamters )
|
testCreateWithDbIndex ( ) { this . pool = new org . springframework . data . redis . connection . lettuce . DefaultLettucePool ( org . springframework . data . redis . SettingsUtils . getHost ( ) , org . springframework . data . redis . SettingsUtils . getPort ( ) ) ; pool . setDatabase ( 1 ) ; pool . afterPropertiesSet ( ) ; "<AssertPlaceHolder>" ; } getResource ( ) { try { return internalPool . borrowObject ( ) ; } catch ( java . lang . Exception e ) { throw new org . springframework . data . redis . connection . PoolException ( "Could<sp>not<sp>get<sp>a<sp>resource<sp>from<sp>the<sp>pool" , e ) ; } }
|
org . junit . Assert . assertNotNull ( pool . getResource ( ) )
|
testConvertMillisecond ( ) { java . lang . String source = "1525887295000" ; com . box . l10n . mojito . rest . textunit . StringToDateTimeConverter instance = new com . box . l10n . mojito . rest . textunit . StringToDateTimeConverter ( ) ; org . joda . time . DateTime expResult = new org . joda . time . DateTime ( "2018-05-09T17:34:55.000Z" ) ; org . joda . time . DateTime result = instance . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { com . box . l10n . mojito . rest . entity . ExportDropConfig . Type type = null ; if ( string != null ) { try { type = ExportDropConfig . Type . valueOf ( string . toUpperCase ( ) ) ; } catch ( java . lang . IllegalArgumentException iae ) { throw new com . beust . jcommander . ParameterException ( ( ( "Invalid<sp>type<sp>[" + string ) + "]" ) ) ; } } return type ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testParticipantRemoveFails ( ) { com . hp . mwtests . ts . jta . tools . ObjStoreBrowserTest . HeuristicTestData hd = getHeuristic ( ) ; tryRemove ( true , false , hd ) ; "<AssertPlaceHolder>" ; } getHeuristicParticipants ( ) { java . util . Set < javax . management . ObjectName > names = com . arjuna . ats . arjuna . tools . osb . util . JMXServer . getAgent ( ) . queryNames ( resourceBeanName , null ) ; return names != null ? names : new java . util . HashSet ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , hd . getHeuristicParticipants ( ) . size ( ) )
|
testFindingThreeLinks ( ) { com . gistlabs . mechanize . document . json . node . JsonNode three = json . find ( "three" ) ; java . util . List < com . gistlabs . mechanize . document . json . hypermedia . JsonLink > links = finder . findOn ( three ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . response . getEntity ( ) . getContentLength ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , links . size ( ) )
|
containsTest ( ) { geom = org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . GF . createLineString ( new org . locationtech . jts . geom . Coordinate [ ] { new org . locationtech . jts . geom . Coordinate ( 20 , 0 ) , new org . locationtech . jts . geom . Coordinate ( 15 , 0 ) } ) ; org . geotoolkit . geometry . jts . JTS . setCRS ( geom , org . apache . sis . referencing . CommonCRS . defaultGeographic ( ) ) ; filter = org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . FF . dwithin ( org . geotoolkit . lucene . GEOMETRY_PROPERTY , org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . FF . literal ( geom ) , org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . TOLERANCE , "m" ) ; bboxQuery = new org . geotoolkit . lucene . filter . SpatialQuery ( wrap ( filter ) ) ; docs = org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . searcher . search ( org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . simpleQuery , bboxQuery . getSpatialFilter ( ) , 15 ) ; nbResults = docs . totalHits ; org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . LOGGER . log ( Level . FINER , "CT:Line<sp>2<sp>CRS=4326:<sp>nb<sp>Results:<sp>{0}" , nbResults ) ; results = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < nbResults ; i ++ ) { org . apache . lucene . document . Document doc = org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . searcher . doc ( docs . scoreDocs [ i ] . doc ) ; java . lang . String name = doc . get ( "id" ) ; results . add ( name ) ; org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . LOGGER . log ( Level . FINER , "\tid:<sp>{0}" , name ) ; } "<AssertPlaceHolder>" ; } log ( java . util . logging . Level , java . lang . String , java . lang . String ) { final java . util . logging . LogRecord record = new java . util . logging . LogRecord ( level , message ) ; record . setSourceClassName ( org . geotoolkit . internal . sql . Synchronizer . class . getName ( ) ) ; record . setSourceMethodName ( method ) ; org . apache . sis . util . logging . Logging . getLogger ( "org.geotoolkit.sql" ) . log ( record ) ; }
|
org . junit . Assert . assertEquals ( nbResults , 0 )
|
magVerwerktWordenMetPositiefResultaatDoorOverslaanAdmHnd ( ) { final java . util . List < nl . bzk . brp . model . algemeen . stamgegeven . kern . SoortAdministratieveHandeling > overslaanSoortAdministratieveHandelingen = new java . util . ArrayList ( ) ; overslaanSoortAdministratieveHandelingen . add ( SoortAdministratieveHandeling . CORRECTIE_ADRES ) ; overslaanSoortAdministratieveHandelingen . add ( SoortAdministratieveHandeling . GEBOORTE_IN_NEDERLAND_MET_ERKENNING ) ; overslaanSoortAdministratieveHandelingen . add ( SoortAdministratieveHandeling . DUMMY ) ; final java . util . List < java . lang . Integer > persoonIds = java . util . Arrays . asList ( 1 , 2 , 3 , 4 ) ; final nl . bzk . brp . model . operationeel . kern . AdministratieveHandelingModel administratieveHandeling = new nl . bzk . brp . model . operationeel . kern . AdministratieveHandelingModel ( new nl . bzk . brp . model . algemeen . stamgegeven . kern . SoortAdministratieveHandelingAttribuut ( nl . bzk . brp . model . algemeen . stamgegeven . kern . SoortAdministratieveHandeling . GEBOORTE_IN_NEDERLAND ) , null , null , nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumTijdAttribuut . nu ( ) ) ; final boolean magHet = administratieveHandelingVerwerkerRepository . magAdministratieveHandelingVerwerktWorden ( administratieveHandeling , persoonIds , overslaanSoortAdministratieveHandelingen ) ; "<AssertPlaceHolder>" ; } magAdministratieveHandelingVerwerktWorden ( nl . bzk . brp . model . operationeel . kern . AdministratieveHandelingModel , java . util . List , java . util . List ) { final java . lang . StringBuilder querySb = new java . lang . StringBuilder ( ( "SELECT<sp>CASE<sp>WHEN<sp>(count(afad)<sp>><sp>0)<sp>THEN<sp>false<sp>ELSE<sp>true<sp>END" + ( ( ( "<sp>FROM<sp>HisPersoonAfgeleidAdministratiefModel<sp>afad" + "<sp>WHERE<sp>afad.administratieveHandeling.levering.tijdstipLevering<sp>IS<sp>NULL" ) + "<sp>AND<sp>afad.administratieveHandeling.tijdstipRegistratie<sp><<sp>:huidigeTsreg" ) + "<sp>AND<sp>afad.persoon.id<sp>IN<sp>:persIds" ) ) ) ; final boolean heeftTeNegerenSoortAdministratieveHandelingen = ( overslaanSoortAdministratieveHandelingen != null ) && ( ! ( overslaanSoortAdministratieveHandelingen . isEmpty ( ) ) ) ; if ( heeftTeNegerenSoortAdministratieveHandelingen ) { querySb . append ( "<sp>AND<sp>afad.administratieveHandeling.soort.waarde<sp>NOT<sp>IN<sp>:overslaanSoortAdministratieveHandelingen" ) ; } final javax . persistence . TypedQuery < java . lang . Boolean > tQuery = em . createQuery ( querySb . toString ( ) , nl . bzk . brp . levering . dataaccess . repository . lezenenschrijven . impl . Boolean . class ) ; tQuery . setParameter ( "huidigeTsreg" , administratieveHandeling . getTijdstipRegistratie ( ) ) ; tQuery . setParameter ( "persIds" , persoonIds ) ; if ( heeftTeNegerenSoortAdministratieveHandelingen ) { tQuery . setParameter ( "overslaanSoortAdministratieveHandelingen" , overslaanSoortAdministratieveHandelingen ) ; } return tQuery . getSingleResult ( ) ; }
|
org . junit . Assert . assertTrue ( magHet )
|
sameTreadTest ( ) { long value = com . taobao . tddl . qatest . sequence . DefaultSequenceTest . seque . nextValue ( ) ; com . taobao . tddl . sequence . impl . DefaultSequence seque1 = ( ( com . taobao . tddl . sequence . impl . DefaultSequence ) ( com . taobao . tddl . qatest . sequence . DefaultSequenceTest . context . getBean ( "sequence" ) ) ) ; long value1 = seque1 . nextValue ( ) ; "<AssertPlaceHolder>" ; } nextValue ( ) { boolean isTest = this . isTestSeq ( ) ; if ( ( getSequenceRange ( isTest ) ) == null ) { lock . lock ( ) ; try { if ( ( getSequenceRange ( isTest ) ) == null ) { setSequenceRange ( sequenceDao . nextRange ( name ) , isTest ) ; } } finally { lock . unlock ( ) ; } } long value = getSequenceRange ( isTest ) . getAndIncrement ( ) ; if ( value == ( - 1 ) ) { lock . lock ( ) ; try { for ( ; ; ) { if ( getSequenceRange ( isTest ) . isOver ( ) ) { setSequenceRange ( sequenceDao . nextRange ( name ) , isTest ) ; } value = getSequenceRange ( isTest ) . getAndIncrement ( ) ; if ( value == ( - 1 ) ) { continue ; } break ; } } finally { lock . unlock ( ) ; } } if ( value < 0 ) { throw new com . taobao . tddl . sequence . exception . SequenceException ( ( "Sequence<sp>value<sp>overflow,<sp>value<sp>=<sp>" + value ) ) ; } return value ; }
|
org . junit . Assert . assertEquals ( ( value + 1 ) , value1 )
|
shouldSerializeGenericClass ( ) { java . lang . String expectedResult = "<genericWrapper><entityList<sp>class=\"list\"><client><name>washington<sp>botelho</name></client><client><name>washington<sp>botelho</name></client></entityList><total>2</total></genericWrapper>" ; java . util . Collection < br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . Client > entityList = new java . util . ArrayList ( ) ; entityList . add ( new br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . Client ( "washington<sp>botelho" ) ) ; entityList . add ( new br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . Client ( "washington<sp>botelho" ) ) ; br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . GenericWrapper < br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . Client > wrapper = new br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . GenericWrapper ( entityList , entityList . size ( ) ) ; serialization . from ( wrapper ) . include ( "entityList" ) . serialize ( ) ; "<AssertPlaceHolder>" ; } result ( ) { return new java . lang . String ( stream . toByteArray ( ) ) ; }
|
org . junit . Assert . assertThat ( result ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( expectedResult ) ) )
|
wildcardMirrorNoBounds ( ) { javax . lang . model . type . WildcardType wildcard = getTypes ( ) . getWildcardType ( null , null ) ; com . squareup . javapoet . TypeName type = com . squareup . javapoet . TypeName . get ( wildcard ) ; "<AssertPlaceHolder>" . isEqualTo ( "?" ) ; } toString ( ) { java . lang . StringBuilder out = new java . lang . StringBuilder ( ) ; try { com . squareup . javapoet . CodeWriter codeWriter = new com . squareup . javapoet . CodeWriter ( out ) ; emit ( codeWriter , "Constructor" , java . util . Collections . emptySet ( ) ) ; return out . toString ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . AssertionError ( ) ; } }
|
org . junit . Assert . assertThat ( type . toString ( ) )
|
testDataAccessFinderFindsIt ( ) { java . util . Iterator < org . geotools . data . DataAccessFactory > allFactories = org . geotools . data . DataAccessFinder . getAllDataStores ( ) ; org . geotools . arcsde . data . ArcSDEJNDIDataStoreFactory sdeFac = null ; while ( allFactories . hasNext ( ) ) { org . geotools . data . DataAccessFactory next = allFactories . next ( ) ; if ( next instanceof org . geotools . arcsde . data . ArcSDEJNDIDataStoreFactory ) { sdeFac = ( ( org . geotools . arcsde . data . ArcSDEJNDIDataStoreFactory ) ( next ) ) ; break ; } } "<AssertPlaceHolder>" ; } next ( ) { if ( ! ( hasNext ( ) ) ) { throw new java . util . NoSuchElementException ( ) ; } org . geotools . image . palette . ColorMap . ColorEntry result = current ; current = result . next ; return result ; }
|
org . junit . Assert . assertNotNull ( sdeFac )
|
cnpjInvalido2 ( ) { java . lang . String cpfInvalido = "60562266" ; boolean resultado = br . com . any . utils . ValidadorUtils . isCNPJ ( cpfInvalido ) ; "<AssertPlaceHolder>" ; } isCNPJ ( java . lang . String ) { if ( ( ( ( ( ( ( ( ( ( ( CNPJ . equals ( "00000000000000" ) ) || ( CNPJ . equals ( "11111111111111" ) ) ) || ( CNPJ . equals ( "22222222222222" ) ) ) || ( CNPJ . equals ( "33333333333333" ) ) ) || ( CNPJ . equals ( "44444444444444" ) ) ) || ( CNPJ . equals ( "55555555555555" ) ) ) || ( CNPJ . equals ( "66666666666666" ) ) ) || ( CNPJ . equals ( "77777777777777" ) ) ) || ( CNPJ . equals ( "88888888888888" ) ) ) || ( CNPJ . equals ( "99999999999999" ) ) ) || ( ( CNPJ . length ( ) ) != 14 ) ) return false ; char dig13 ; char dig14 ; int sm ; int i ; int r ; int num ; int peso ; try { sm = 0 ; peso = 2 ; for ( i = 11 ; i >= 0 ; i -- ) { num = ( ( int ) ( ( CNPJ . charAt ( i ) ) - 48 ) ) ; sm = sm + ( num * peso ) ; peso = peso + 1 ; if ( peso == 10 ) peso = 2 ; } r = sm % 11 ; if ( ( r == 0 ) || ( r == 1 ) ) dig13 = '0' ; else dig13 = ( ( char ) ( ( 11 - r ) + 48 ) ) ; sm = 0 ; peso = 2 ; for ( i = 12 ; i >= 0 ; i -- ) { num = ( ( int ) ( ( CNPJ . charAt ( i ) ) - 48 ) ) ; sm = sm + ( num * peso ) ; peso = peso + 1 ; if ( peso == 10 ) peso = 2 ; } r = sm % 11 ; if ( ( r == 0 ) || ( r == 1 ) ) dig14 = '0' ; else dig14 = ( ( char ) ( ( 11 - r ) + 48 ) ) ; if ( ( dig13 == ( CNPJ . charAt ( 12 ) ) ) && ( dig14 == ( CNPJ . charAt ( 13 ) ) ) ) return true ; else return false ; } catch ( java . util . InputMismatchException erro ) { return false ; } }
|
org . junit . Assert . assertFalse ( resultado )
|
testGetErrorMessage_1 ( ) { org . jumbune . utils . exception . JumbuneException fixture = new org . jumbune . utils . exception . JumbuneException ( org . jumbune . utils . exception . ErrorCodesAndMessages . COULD_NOT_CREATE_DIRECTORY ) ; fixture . setErrorCode ( 1 ) ; fixture . setErrorMessage ( "" ) ; java . lang . String result = fixture . getErrorMessage ( ) ; "<AssertPlaceHolder>" ; } getErrorMessage ( ) { return errorMessage ; }
|
org . junit . Assert . assertEquals ( "" , result )
|
testNullNotEqual ( ) { final org . apache . hc . core5 . http . NameValuePair NameValuePair = new org . apache . hc . core5 . http . message . BasicNameValuePair ( "name" , "value" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj instanceof org . apache . hc . core5 . http . message . BasicNameValuePair ) { final org . apache . hc . core5 . http . message . BasicNameValuePair that = ( ( org . apache . hc . core5 . http . message . BasicNameValuePair ) ( obj ) ) ; return ( this . name . equalsIgnoreCase ( that . name ) ) && ( org . apache . hc . core5 . util . LangUtils . equals ( this . value , that . value ) ) ; } return false ; }
|
org . junit . Assert . assertFalse ( NameValuePair . equals ( null ) )
|
shouldFindSingleElement ( ) { java . util . List < org . w3c . dom . Node > nodes = validateXPath ( "(//InternalListView)[1]" , document ) ; "<AssertPlaceHolder>" ; } validateXPath ( java . lang . String , org . w3c . dom . Document ) { java . util . List < org . w3c . dom . Node > elements = new java . util . ArrayList < org . w3c . dom . Node > ( ) ; javax . xml . xpath . XPath xPath = javax . xml . xpath . XPathFactory . newInstance ( ) . newXPath ( ) ; org . w3c . dom . NodeList nodeList ; try { nodeList = ( ( org . w3c . dom . NodeList ) ( xPath . compile ( expression ) . evaluate ( xmlDocument , XPathConstants . NODESET ) ) ) ; } catch ( javax . xml . xpath . XPathExpressionException e ) { io . selendroid . server . util . SelendroidLogger . error ( "Failed<sp>to<sp>get<sp>NodeList<sp>from<sp>xPath" , e ) ; return elements ; } if ( ( nodeList != null ) && ( ( nodeList . getLength ( ) ) > 0 ) ) { for ( int i = 0 ; i < ( nodeList . getLength ( ) ) ; i ++ ) { org . w3c . dom . Node node = nodeList . item ( i ) ; if ( ( node . getAttributes ( ) ) == null ) { continue ; } elements . add ( node ) ; } } return elements ; }
|
org . junit . Assert . assertEquals ( nodes . size ( ) , 1 )
|
shouldEqualsReturnTrueAndDoNotMakeInfinityCycleWith3Entities ( ) { final com . qcadoo . model . api . Entity secondEntity = new com . qcadoo . model . internal . DefaultEntity ( dataDefinition ) ; final com . qcadoo . model . api . Entity firstEntity = new com . qcadoo . model . internal . DefaultEntity ( dataDefinition ) ; final com . qcadoo . model . api . Entity thirdEntity = new com . qcadoo . model . internal . DefaultEntity ( dataDefinition ) ; firstEntity . setId ( 1L ) ; secondEntity . setId ( 2L ) ; thirdEntity . setId ( 3L ) ; when ( dataDefinition . get ( firstEntity . getId ( ) ) ) . thenReturn ( firstEntity ) ; when ( dataDefinition . get ( secondEntity . getId ( ) ) ) . thenReturn ( secondEntity ) ; when ( dataDefinition . get ( thirdEntity . getId ( ) ) ) . thenReturn ( thirdEntity ) ; final com . qcadoo . model . api . Entity firstWrappedEntity = buildEntityWrapper ( firstEntity ) ; final com . qcadoo . model . api . Entity secondWrappedEntity = buildEntityWrapper ( secondEntity ) ; final com . qcadoo . model . api . Entity thirdWrappedEntity = buildEntityWrapper ( thirdEntity ) ; firstWrappedEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BELONGS_TO_FIELD_NAME , secondWrappedEntity ) ; secondWrappedEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BELONGS_TO_FIELD_NAME , thirdWrappedEntity ) ; thirdWrappedEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BELONGS_TO_FIELD_NAME , firstWrappedEntity ) ; final com . qcadoo . model . api . Entity secondOtherEntity = new com . qcadoo . model . internal . DefaultEntity ( dataDefinition ) ; final com . qcadoo . model . api . Entity firstOtherEntity = new com . qcadoo . model . internal . DefaultEntity ( dataDefinition ) ; final com . qcadoo . model . api . Entity thirdOtherEntity = new com . qcadoo . model . internal . DefaultEntity ( dataDefinition ) ; firstOtherEntity . setId ( 1L ) ; secondOtherEntity . setId ( 2L ) ; thirdOtherEntity . setId ( 3L ) ; when ( dataDefinition . get ( firstOtherEntity . getId ( ) ) ) . thenReturn ( firstOtherEntity ) ; when ( dataDefinition . get ( secondOtherEntity . getId ( ) ) ) . thenReturn ( secondOtherEntity ) ; when ( dataDefinition . get ( thirdOtherEntity . getId ( ) ) ) . thenReturn ( thirdOtherEntity ) ; final com . qcadoo . model . api . Entity firstOtherWrappedEntity = buildEntityWrapper ( firstOtherEntity ) ; final com . qcadoo . model . api . Entity secondOtherWrappedEntity = buildEntityWrapper ( secondOtherEntity ) ; final com . qcadoo . model . api . Entity thirdOtherWrappedEntity = buildEntityWrapper ( thirdOtherEntity ) ; firstOtherWrappedEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BELONGS_TO_FIELD_NAME , secondOtherWrappedEntity ) ; secondOtherWrappedEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BELONGS_TO_FIELD_NAME , thirdOtherWrappedEntity ) ; thirdOtherWrappedEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BELONGS_TO_FIELD_NAME , firstOtherWrappedEntity ) ; try { "<AssertPlaceHolder>" ; } catch ( java . lang . StackOverflowError e ) { org . junit . Assert . fail ( ) ; } } setField ( java . lang . String , java . lang . Object ) { entity . setField ( fieldName , fieldValue ) ; }
|
org . junit . Assert . assertEquals ( firstWrappedEntity , firstOtherWrappedEntity )
|
shouldReplaceManifestPlaceholders ( ) { java . lang . String placeholderText = "<manifest>\n" + ( ( ( "<sp><permission\n" + "<sp>android:name=\"${applicationId}.permission.C2D_MESSAGE\"\n" ) + "<sp>android:protectionLevel=\"${custom$}\"<sp>/>\n" ) + "</manifest>" ) ; com . google . common . collect . ImmutableMap < java . lang . String , java . lang . String > placeholders = com . google . common . collect . ImmutableMap . of ( "applicationId" , "com.example" , "applicationId" 0 , "0x2" ) ; java . lang . String replaced = com . facebook . buck . android . ReplaceManifestPlaceholdersStep . replacePlaceholders ( placeholderText , placeholders ) ; java . lang . String expected = "<manifest>\n" + ( ( ( "<sp><permission\n" + "<sp>android:name=\"com.example.permission.C2D_MESSAGE\"\n" ) + "<sp>android:protectionLevel=\"0x2\"<sp>/>\n" ) + "</manifest>" ) ; "<AssertPlaceHolder>" ; } replacePlaceholders ( java . lang . String , com . google . common . collect . ImmutableMap ) { java . lang . Iterable < java . lang . String > escaped = com . google . common . collect . Iterables . transform ( placeholders . keySet ( ) , Pattern :: quote ) ; com . google . common . base . Joiner joiner = com . google . common . base . Joiner . on ( "|" ) ; java . lang . String patternString = ( ( ( ( java . util . regex . Pattern . quote ( "${" ) ) + "(" ) + ( joiner . join ( escaped ) ) ) + ")" ) + ( java . util . regex . Pattern . quote ( "}" ) ) ; java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( patternString ) ; java . util . regex . Matcher matcher = pattern . matcher ( content ) ; java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; while ( matcher . find ( ) ) { matcher . appendReplacement ( sb , placeholders . get ( matcher . group ( 1 ) ) ) ; } matcher . appendTail ( sb ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , replaced )
|
runTest ( ) { boolean result = checkNoError ( "Social_Forums_Forums_Tags" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
|
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
|
testFullDateTimeParsing ( ) { long currentMillis = java . lang . System . currentTimeMillis ( ) ; java . util . Date date = new java . util . Date ( ( currentMillis - ( currentMillis % 1000 ) ) ) ; java . text . DateFormat format = java . text . DateFormat . getDateTimeInstance ( DateFormat . FULL , DateFormat . FULL , m_testLocale ) ; java . lang . String formattedDate = format . format ( date ) ; java . util . Date newDate = format . parse ( formattedDate ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "NsclientRequest[command=" + ( getCommand ( ) ) ) + ",<sp>parameter=" ) + ( getParameter ( ) ) ) + "]" ; }
|
org . junit . Assert . assertEquals ( m_testLocale . toString ( ) , date , newDate )
|
testExtraLongRpc ( ) { org . apache . hadoop . ipc . TestProtoBufRpc . TestRpcService2 client = getClient2 ( ) ; final java . lang . String shortString = org . apache . commons . lang3 . StringUtils . repeat ( "X" , 4 ) ; org . apache . hadoop . ipc . protobuf . TestProtos . EchoResponseProto echoResponse = client . echo2 ( null , newEchoRequest ( shortString ) ) ; "<AssertPlaceHolder>" ; final java . lang . String longString = org . apache . commons . lang3 . StringUtils . repeat ( "X" , 4096 ) ; try { client . echo2 ( null , newEchoRequest ( longString ) ) ; org . junit . Assert . fail ( "expected<sp>extra-long<sp>RPC<sp>to<sp>fail" ) ; } catch ( com . google . protobuf . ServiceException se ) { } } getMessage ( ) { return message ; }
|
org . junit . Assert . assertEquals ( shortString , echoResponse . getMessage ( ) )
|
testNameTypeStatusList ( ) { for ( org . gbif . api . vocabulary . TypeStatus ts : org . gbif . api . vocabulary . TypeStatus . nameTypeStatusList ( ) ) { if ( ts != ( TypeStatus . TYPE ) ) { "<AssertPlaceHolder>" ; } } } isTypeSpecimen ( ) { return ( ( this ) != ( org . gbif . api . vocabulary . TypeStatus . TYPE_GENUS ) ) && ( ( this ) != ( org . gbif . api . vocabulary . TypeStatus . TYPE_SPECIES ) ) ; }
|
org . junit . Assert . assertFalse ( ts . isTypeSpecimen ( ) )
|
testRemoveColumn ( ) { int rows = 10 ; int cols = 5 ; java . util . List < edu . cmu . tetrad . graph . Node > variables = new java . util . LinkedList ( ) ; for ( int i = 0 ; i < cols ; i ++ ) { variables . add ( new edu . cmu . tetrad . data . ContinuousVariable ( ( "X" + i ) ) ) ; } edu . cmu . tetrad . data . DataSet dataSet = new edu . cmu . tetrad . data . ColtDataSet ( rows , variables ) ; edu . cmu . tetrad . util . RandomUtil randomUtil = edu . cmu . tetrad . util . RandomUtil . getInstance ( ) ; for ( int i = 0 ; i < rows ; i ++ ) { for ( int j = 0 ; j < cols ; j ++ ) { dataSet . setDouble ( i , j , randomUtil . nextDouble ( ) ) ; } } int [ ] _cols = new int [ 2 ] ; _cols [ 0 ] = 1 ; _cols [ 1 ] = 2 ; dataSet . removeCols ( _cols ) ; java . util . List < edu . cmu . tetrad . graph . Node > _variables = new java . util . LinkedList ( variables ) ; _variables . remove ( 2 ) ; _variables . remove ( 1 ) ; "<AssertPlaceHolder>" ; } getVariables ( ) { return searchVariables ; }
|
org . junit . Assert . assertEquals ( dataSet . getVariables ( ) , _variables )
|
testSimple ( ) { com . github . dozermapper . core . functional_tests . MapMappingTest . Simpler input = new com . github . dozermapper . core . functional_tests . MapMappingTest . Simpler ( ) ; input . getValues ( ) . put ( "f" , java . lang . Integer . valueOf ( 5 ) ) ; com . github . dozermapper . core . functional_tests . MapMappingTest . Simpler output = mapper . map ( input , com . github . dozermapper . core . functional_tests . MapMappingTest . Simpler . class ) ; "<AssertPlaceHolder>" ; } map ( java . lang . Object , java . lang . Class ) { return map ( srcObj , destClass , null ) ; }
|
org . junit . Assert . assertEquals ( input . getValues ( ) , output . getValues ( ) )
|
testExtractHourTime ( ) { java . lang . String sqlText = ( "select<sp>t,<sp>EXTRACT(HOUR<sp>FROM<sp>t)<sp>as<sp>\"HOUR\"<sp>from<sp>" + ( com . splicemachine . derby . utils . SpliceDateFunctionsIT . tableWatcherI ) ) + "<sp>order<sp>by<sp>t" ; try ( com . splicemachine . derby . utils . ResultSet rs = methodWatcher . executeQuery ( sqlText ) ) { java . lang . String expected = "23:59:59<sp>|<sp>23<sp>|" 1 + ( ( ( ( ( ( "----------------\n" + "00:00:01<sp>|<sp>0<sp>|\n" ) + "05:22:33<sp>|<sp>5<sp>|\n" ) + "10:30:29<sp>|<sp>10<sp>|\n" ) + "18:44:28<sp>|<sp>18<sp>|\n" ) + "23:59:59<sp>|<sp>23<sp>|" 0 ) + "23:59:59<sp>|<sp>23<sp>|" ) ; "<AssertPlaceHolder>" ; } } toStringUnsorted ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs , false ) . toString ( ) . trim ( ) ; }
|
org . junit . Assert . assertEquals ( ( ( "\n" + sqlText ) + "\n" ) , expected , TestUtils . FormattedResult . ResultFactory . toStringUnsorted ( rs ) )
|
selectNewPartTest ( ) { final org . uberfire . workbench . model . PartDefinition part = getPartDefinition ( true , false ) ; final boolean selected = listBar . selectPart ( part ) ; "<AssertPlaceHolder>" ; verify ( listBar . titleDropDown , never ( ) ) . selectPart ( part ) ; verify ( listBar , never ( ) ) . setupContextMenu ( ) ; verify ( listBar . header , never ( ) ) . setVisible ( anyBoolean ( ) ) ; verify ( listBar , never ( ) ) . resizePanelBody ( ) ; } selectPart ( org . uberfire . workbench . model . PartDefinition ) { if ( ( parts . containsKey ( part ) ) == false ) { return false ; } parts . entrySet ( ) . forEach ( ( e ) -> { if ( e . getKey ( ) . equals ( part ) ) { e . getValue ( ) . show ( ) ; } else { e . getValue ( ) . hide ( ) ; } } ) ; return true ; }
|
org . junit . Assert . assertFalse ( selected )
|
getAmenityObjectWithNull ( ) { com . gisgraphy . domain . geoloc . entity . GisFeature o = osmAmenityToPlacetype . getAmenityObject ( null ) ; "<AssertPlaceHolder>" ; } getAmenityObject ( java . lang . String ) { if ( isNonRealTag ( amenity ) ) { return null ; } com . gisgraphy . domain . geoloc . entity . GisFeature gisfeature = null ; java . lang . String a = amenity . trim ( ) . toLowerCase ( ) ; else if ( "waste_basket" 6.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . School ( ) ; } else if ( "waste_basket" 1.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Religious ( ) ; } else if ( "bar" 8.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Restaurant ( ) ; } else if ( "fuel" . equals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Fuel ( ) ; } else if ( "cafe" 6.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Bench ( ) ; } else if ( "nursing_home" 9.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Cemetery ( ) ; } else if ( "casino" 1.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . PostOffice ( ) ; } else if ( "bar" 4.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Bank ( ) ; } else if ( "nursing_home" 1.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Restaurant ( ) ; } else if ( "cafe" . equals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Restaurant ( ) ; } else if ( "emergency_phone" 7.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . School ( ) ; } else if ( "car_sharing" 0.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Hospital ( ) ; } else if ( "nursing_home" 6.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Pharmacy ( ) ; } else if ( "casino" 7.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . PostOffice ( ) ; } else if ( "casino" 0.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Bar ( ) ; } else if ( "emergency_phone" 3.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Parking ( ) ; } else if ( "casino" 9.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Telephone ( ) ; } else if ( "car_sharing" 9.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Toilet ( ) ; } else if ( "cafe" 3.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . ATM ( ) ; } else if ( "cafe" 7.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . GisFeature ( ) ; } else if ( "emergency_phone" 9.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . FireStation ( ) ; } else if ( "bar" 0.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . PolicePost ( ) ; } else if ( "bar" . equals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Bar ( ) ; } else if ( "casino" 8.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . SwimmingPool ( ) ; } else if ( "casino" 2.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . CityHall ( ) ; } else if ( "waste_basket" 4.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Parking ( ) ; } else if ( "emergency_phone" 1.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Library ( ) ; } else if ( "nursing_home" 0.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Fountain ( ) ; } else if ( "casino" 6.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . VendingMachine ( ) ; } else if ( "waste_basket" 5.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . School ( ) ; } else if ( "doctors" . equals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc . entity . Doctor ( ) ; } else if ( "car_sharing" 7.e quals ( a ) ) { gisfeature = new com . gisgraphy . domain . geoloc
|
org . junit . Assert . assertEquals ( null , o )
|
testConvertReplyToManyDocs ( ) { final com . allanbank . mongodb . bson . builder . DocumentBuilder db = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . addInteger ( "ok" , 1 ) ; db . pushArray ( "results" ) . push ( ) ; final java . util . List < com . allanbank . mongodb . bson . Document > docs = java . util . Arrays . asList ( db . build ( ) , db . build ( ) ) ; final com . allanbank . mongodb . client . message . Reply reply = new com . allanbank . mongodb . client . message . Reply ( 0 , 0 , 0 , docs , false , false , false , true ) ; final com . allanbank . mongodb . Callback < com . allanbank . mongodb . MongoIterator < com . allanbank . mongodb . bson . Document > > mockCallback = createMock ( com . allanbank . mongodb . Callback . class ) ; replay ( mockCallback ) ; final com . allanbank . mongodb . client . callback . ReplyResultCallback callback = new com . allanbank . mongodb . client . callback . ReplyResultCallback ( mockCallback ) ; "<AssertPlaceHolder>" ; verify ( mockCallback ) ; } convert ( com . allanbank . mongodb . client . message . Reply ) { final java . util . List < com . allanbank . mongodb . bson . Document > results = reply . getResults ( ) ; if ( ( results . size ( ) ) == 1 ) { return results . get ( 0 ) ; } return null ; }
|
org . junit . Assert . assertTrue ( callback . convert ( reply ) . toList ( ) . isEmpty ( ) )
|
shouldReturnFalseWhenNewFPMethodOfECIsNotCondom ( ) { boolean didRuleSucceed = newFPMethodIsCondomRule . apply ( new org . ei . drishti . util . SafeMap ( ) . put ( "newMethod" , "ocp" ) ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , java . lang . String ) { data . put ( key , value ) ; return this ; }
|
org . junit . Assert . assertFalse ( didRuleSucceed )
|
test_GetToolbarButton_By_Name_with_RegExPattern_Gets_Button ( ) { when ( element . findAll ( mmarquee . automation . BaseAutomationTest . isTreeScope ( TreeScope . Descendants ) , any ( ) ) ) . thenReturn ( list ) ; when ( targetElement . getName ( ) ) . thenReturn ( "myName" ) ; mmarquee . automation . controls . AutomationToolBar ctrl = new mmarquee . automation . controls . AutomationToolBar ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( container ) ) ; mmarquee . automation . controls . AutomationToolBarButton button = ctrl . getToolbarButton ( mmarquee . automation . controls . Search . getBuilder ( java . util . regex . Pattern . compile ( "my.*" ) ) . build ( ) ) ; "<AssertPlaceHolder>" ; verify ( element , atLeastOnce ( ) ) . findAll ( any ( ) , any ( ) ) ; } getElement ( ) { return this . element ; }
|
org . junit . Assert . assertEquals ( targetElement , button . getElement ( ) )
|
testNoServiceNOPortType ( ) { env . put ( ToolConstants . CFG_ALL , ToolConstants . CFG_ALL ) ; env . put ( ToolConstants . CFG_WSDLURL , getLocation ( "/wsdl2java_wsdl/no_port_or_service.wsdl" ) ) ; processor . setContext ( env ) ; processor . execute ( ) ; java . lang . Class < ? > clz = classLoader . loadClass ( "org.apache.cxf.no_port_or_service.types.TheComplexType" ) ; "<AssertPlaceHolder>" ; } loadClass ( java . lang . String ) { if ( className . contains ( "cxf" ) ) { throw new java . lang . ClassNotFoundException ( ( "TestClassLoader<sp>does<sp>not<sp>load<sp>CXF<sp>classes:<sp>" + className ) ) ; } return super . loadClass ( className ) ; }
|
org . junit . Assert . assertNotNull ( clz )
|
nullConditionShouldNotMatch ( ) { final java . lang . String existingSystemProperty = "existing.system.property" ; com . navercorp . pinpoint . common . util . SystemProperty property = com . navercorp . pinpoint . bootstrap . resolver . condition . SystemPropertyConditionTest . createTestProperty ( existingSystemProperty ) ; com . navercorp . pinpoint . bootstrap . resolver . condition . SystemPropertyCondition systemPropertyCondition = new com . navercorp . pinpoint . bootstrap . resolver . condition . SystemPropertyCondition ( property ) ; boolean matches = systemPropertyCondition . check ( null ) ; "<AssertPlaceHolder>" ; } check ( java . lang . String ) { if ( com . navercorp . pinpoint . common . util . StringUtils . isEmpty ( requiredKey ) ) { return false ; } if ( ( this . property . getProperty ( requiredKey ) ) != null ) { logger . debug ( "Property<sp>'{}'<sp>found<sp>in<sp>[{}]" , requiredKey , this . property . getClass ( ) . getSimpleName ( ) ) ; return true ; } else { logger . debug ( "Property<sp>'{}'<sp>not<sp>found<sp>in<sp>[{}]" , requiredKey , this . property . getClass ( ) . getSimpleName ( ) ) ; return false ; } }
|
org . junit . Assert . assertFalse ( matches )
|
batchIterable_forEachEntry ( ) { com . gs . collections . impl . parallel . BatchIterable < Map . Entry < java . lang . Integer , java . lang . Integer > > entries = ( ( com . gs . collections . impl . parallel . BatchIterable < Map . Entry < java . lang . Integer , java . lang . Integer > > ) ( com . gs . collections . impl . map . strategy . mutable . UnifiedMapWithHashingStrategy . newWithKeysValues ( com . gs . collections . impl . map . strategy . mutable . UnifiedMapWithHashingStrategyTest . INTEGER_HASHING_STRATEGY , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 ) . entrySet ( ) ) ) ; com . gs . collections . impl . math . Sum sum = new com . gs . collections . impl . math . IntegerSum ( 0 ) ; entries . forEach ( new com . gs . collections . impl . map . strategy . mutable . UnifiedMapWithHashingStrategyTest . EntrySumProcedure ( sum ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return this . value ; }
|
org . junit . Assert . assertEquals ( 20 , sum . getValue ( ) )
|
testCompileArcWithTolerance ( ) { com . vividsolutions . jts . io . WKTReader reader = new com . vividsolutions . jts . io . WKTReader ( ) ; try { com . vividsolutions . jts . geom . Geometry g1 = reader . read ( "LINESTRING<sp>(601103.3340069023<sp>129288.05055561525,<sp>601102.0842804064<sp>129856.67611130093,<sp>601320.7864172085<sp>129316.79426502353,<sp>601323.263544294<sp>129847.90736367383)" ) ; com . vividsolutions . jts . geom . Geometry g2 = reader . read ( "LINESTRING<sp>(601323.2858702005<sp>129847.92802582885,<sp>601824.4261951016<sp>129860.42529078897,<sp>601968.144742143<sp>129494.25542745732,<sp>601806.9300241574<sp>129236.81176927875,<sp>601447.0087933057<sp>129430.51937616068,<sp>601422.0142633856<sp>129672.9663163871,<sp>601549.4863659788<sp>129830.43185488468)" ) ; fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString line1 = ( ( fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString ) ( fr . ign . cogit . geoxygene . util . conversion . AdapterFactory . toGM_Object ( g1 ) ) ) ; fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString line2 = ( ( fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString ) ( fr . ign . cogit . geoxygene . util . conversion . AdapterFactory . toGM_Object ( g2 ) ) ) ; java . util . List < fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString > list = new java . util . ArrayList < fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString > ( ) ; list . add ( line1 ) ; list . add ( line2 ) ; fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString result = fr . ign . cogit . geoxygene . contrib . geometrie . Operateurs . compileArcs ( list , 1.0 ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } } compileArcs ( java . util . List , double ) { fr . ign . cogit . geoxygene . contrib . geometrie . Operateurs . logger . debug ( "compile<sp>geometries" ) ; for ( fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString l : geometries ) { fr . ign . cogit . geoxygene . contrib . geometrie . Operateurs . logger . debug ( ( "\t" + l ) ) ; } fr . ign . cogit . geoxygene . api . spatial . coordgeom . IDirectPositionList finalPoints = new fr . ign . cogit . geoxygene . spatial . coordgeom . DirectPositionList ( ) ; if ( geometries . isEmpty ( ) ) { fr . ign . cogit . geoxygene . contrib . geometrie . Operateurs . logger . error ( "ATTENTION.<sp>Erreur<sp><sp>la<sp>compilation<sp>de<sp>lignes<sp>:<sp>aucune<sp>ligne<sp>en<sp>entre" ) ; return null ; } fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString currentLine = geometries . get ( 0 ) ; if ( ( geometries . size ( ) ) == 1 ) { return currentLine ; } fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString nextLine = geometries . get ( 1 ) ; fr . ign . cogit . geoxygene . api . spatial . coordgeom . IDirectPosition currentPoint = null ; if ( ( fr . ign . cogit . geoxygene . contrib . geometrie . Distances . proche ( currentLine . startPoint ( ) , nextLine . startPoint ( ) , tolerance ) ) || ( fr . ign . cogit . geoxygene . contrib . geometrie . Distances . proche ( currentLine . startPoint ( ) , nextLine . endPoint ( ) , tolerance ) ) ) { finalPoints . addAll ( ( ( fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString ) ( currentLine . reverse ( ) ) ) . getControlPoint ( ) ) ; currentPoint = currentLine . startPoint ( ) ; } else if ( ( fr . ign . cogit . geoxygene . contrib . geometrie . Distances . proche ( currentLine . endPoint ( ) , nextLine . startPoint ( ) , tolerance ) ) || ( fr . ign . cogit . geoxygene . contrib . geometrie . Distances . proche ( currentLine . endPoint ( ) , nextLine . endPoint ( ) , tolerance ) ) ) { finalPoints . addAll ( currentLine . getControlPoint ( ) ) ; currentPoint = currentLine . endPoint ( ) ; } else { fr . ign . cogit . geoxygene . contrib . geometrie . Operateurs . logger . error ( "ATTENTION.<sp>Erreur<sp><sp>la<sp>compilation<sp>de<sp>lignes<sp>(Operateurs)<sp>:<sp>les<sp>lignes<sp>ne<sp>se<sp>touchent<sp>pas" ) ; for ( fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString l : geometries ) { fr . ign . cogit . geoxygene . contrib . geometrie . Operateurs . logger . error ( l ) ; } return null ; } fr . ign . cogit . geoxygene . contrib . geometrie . Operateurs . logger . debug ( ( "currentPoint<sp>=<sp>" + ( currentPoint . toGM_Point ( ) ) ) ) ; for ( int i = 1 ; i < ( geometries . size ( ) ) ; i ++ ) { nextLine = geometries . get ( i ) ; fr . ign . cogit . geoxygene . contrib . geometrie . Operateurs . logger . debug ( ( ( ( "copying<sp>" + ( nextLine . getControlPoint ( ) . size ( ) ) ) + "<sp>=<sp>" ) + nextLine ) ) ; fr . ign . cogit . geoxygene . api . spatial . coordgeom . ILineString lineCopy = new fr . ign . cogit . geoxygene . spatial . coordgeom . GM_LineString ( nextLine . getControlPoint ( ) ) ; if ( fr . ign . cogit . geoxygene . contrib . geometrie . Distances . proche ( currentPoint , nextLine . startPoint ( ) , tolerance ) ) { lineCopy . removeControlPoint ( lineCopy . startPoint ( ) ) ; finalPoints . addAll ( lineCopy .
|
org . junit . Assert . assertNotNull ( result )
|
testDecodeGeneralizedTimeWithTimeZoneZ ( ) { java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . clear ( ) ; cal . set ( Calendar . YEAR , 2010 ) ; cal . set ( Calendar . MONTH , Calendar . JULY ) ; cal . set ( Calendar . DAY_OF_MONTH , 12 ) ; cal . set ( Calendar . HOUR_OF_DAY , 21 ) ; cal . set ( Calendar . MINUTE , 45 ) ; cal . set ( Calendar . SECOND , 27 ) ; cal . setTimeZone ( java . util . TimeZone . getTimeZone ( "GMT" ) ) ; java . util . Date expectedDate = cal . getTime ( ) ; byte [ ] data = new byte [ ] { 24 , 15 , 50 , 48 , 49 , 48 , 48 , 55 , 49 , 50 , 50 , 49 , 52 , 53 , 50 , 55 , 90 } ; java . util . Date actualDate = org . kaazing . gateway . util . asn1 . Asn1Utils . decodeGeneralizedTime ( java . nio . ByteBuffer . wrap ( data ) ) ; "<AssertPlaceHolder>" ; } wrap ( org . kaazing . mina . netty . buffer . ByteBufferWrappingChannelBuffer ) { this . buffer = buffer . buffer ; order = buffer . order ; capacity = buffer . capacity ; setIndex ( buffer . readerIndex ( ) , buffer . writerIndex ( ) ) ; return this ; }
|
org . junit . Assert . assertEquals ( expectedDate , actualDate )
|
testEnableDropletBackups ( ) { com . myjeeva . digitalocean . pojo . Action action = apiClient . enableDropletBackups ( 9662284 ) ; "<AssertPlaceHolder>" ; log . info ( action . toString ( ) ) ; } enableDropletBackups ( java . lang . Integer ) { validateDropletId ( dropletId ) ; java . lang . Object [ ] params = new java . lang . Object [ ] { dropletId } ; return ( ( com . myjeeva . digitalocean . pojo . Action ) ( perform ( new com . myjeeva . digitalocean . impl . ApiRequest ( com . myjeeva . digitalocean . common . ApiAction . ENABLE_DROPLET_BACKUPS , new com . myjeeva . digitalocean . pojo . DropletAction ( com . myjeeva . digitalocean . common . ActionType . ENABLE_BACKUPS ) , params ) ) . getData ( ) ) ) ; }
|
org . junit . Assert . assertNotNull ( action )
|
testBothInstanceAndLocalVariableMessageCorrelation ( ) { org . camunda . bpm . model . bpmn . BpmnModelInstance model = org . camunda . bpm . model . bpmn . Bpmn . createExecutableProcess ( "Process_1" ) . startEvent ( ) . subProcess ( "SubProcess_1" ) . embeddedSubProcess ( ) . startEvent ( ) . receiveTask ( "SubProcess_1" 2 ) . message ( org . camunda . bpm . engine . test . api . runtime . MessageCorrelationByLocalVariablesTest . TEST_MESSAGE_NAME ) . userTask ( "UserTask_1" ) . endEvent ( ) . subProcessDone ( ) . multiInstance ( ) . camundaCollection ( "${vars}" ) . camundaElementVariable ( "SubProcess_1" 0 ) . multiInstanceDone ( ) . endEvent ( ) . done ( ) ; model = modify ( model ) . activityBuilder ( "SubProcess_1" 2 ) . camundaInputParameter ( "localVar" , "${loopVar}" ) . camundaInputParameter ( "SubProcess_1" 5 , "someValue" ) . done ( ) ; testHelper . deploy ( model ) ; java . util . Map < java . lang . String , java . lang . Object > variables = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; variables . put ( "vars" , java . util . Arrays . asList ( 1 , 2 , 3 ) ) ; variables . put ( "SubProcess_1" 4 , "SubProcess_1" 1 ) ; org . camunda . bpm . engine . runtime . ProcessInstance processInstance = engineRule . getRuntimeService ( ) . startProcessInstanceByKey ( "Process_1" , variables ) ; variables = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; variables . put ( "vars" , java . util . Arrays . asList ( 1 , 2 , 3 ) ) ; variables . put ( "SubProcess_1" 4 , "SubProcess_1" 3 ) ; engineRule . getRuntimeService ( ) . startProcessInstanceByKey ( "Process_1" , variables ) ; java . lang . String messageName = org . camunda . bpm . engine . test . api . runtime . MessageCorrelationByLocalVariablesTest . TEST_MESSAGE_NAME ; java . util . Map < java . lang . String , java . lang . Object > correlationKeys = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; int correlationKey = 1 ; correlationKeys . put ( "localVar" , correlationKey ) ; correlationKeys . put ( "SubProcess_1" 5 , "someValue" ) ; java . util . Map < java . lang . String , java . lang . Object > processInstanceKeys = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . lang . String processInstanceVarValue = "SubProcess_1" 1 ; processInstanceKeys . put ( "SubProcess_1" 4 , processInstanceVarValue ) ; java . util . Map < java . lang . String , java . lang . Object > messagePayload = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; messagePayload . put ( "newVar" , "newValue" ) ; org . camunda . bpm . engine . runtime . MessageCorrelationResult messageCorrelationResult = engineRule . getRuntimeService ( ) . createMessageCorrelation ( messageName ) . processInstanceVariablesEqual ( processInstanceKeys ) . localVariablesEqual ( correlationKeys ) . setVariables ( messagePayload ) . correlateWithResult ( ) ; checkExecutionMessageCorrelationResult ( messageCorrelationResult , processInstance , "SubProcess_1" 2 ) ; java . util . List < org . camunda . bpm . engine . runtime . Execution > uncorrelatedExecutions = engineRule . getRuntimeService ( ) . createExecutionQuery ( ) . activityId ( "SubProcess_1" 2 ) . list ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( ( ( historicProcessInstanceIds . size ( ) ) + ( historicDecisionInstanceIds . size ( ) ) ) + ( historicCaseInstanceIds . size ( ) ) ) + ( historicBatchIds . size ( ) ) ; }
|
org . junit . Assert . assertEquals ( 5 , uncorrelatedExecutions . size ( ) )
|
testValidate ( ) { java . util . Map < java . lang . String , org . apache . kafka . common . config . ConfigValue > expected = new java . util . HashMap ( ) ; java . lang . String errorMessageB = "Missing<sp>required<sp>configuration<sp>\"b\"<sp>which<sp>has<sp>no<sp>default<sp>value." ; java . lang . String errorMessageC = "Missing<sp>required<sp>configuration<sp>\"c\"<sp>which<sp>has<sp>no<sp>default<sp>value." ; org . apache . kafka . common . config . ConfigValue configA = new org . apache . kafka . common . config . ConfigValue ( "a" , 1 , java . util . Arrays . < java . lang . Object > asList ( 1 , 2 , 3 ) , java . util . Collections . < java . lang . String > emptyList ( ) ) ; org . apache . kafka . common . config . ConfigValue configB = new org . apache . kafka . common . config . ConfigValue ( "b" , null , java . util . Arrays . < java . lang . Object > asList ( 4 , 5 ) , java . util . Arrays . asList ( errorMessageB , errorMessageB ) ) ; org . apache . kafka . common . config . ConfigValue configC = new org . apache . kafka . common . config . ConfigValue ( "c" , null , java . util . Arrays . < java . lang . Object > asList ( 4 , 5 ) , java . util . Arrays . asList ( errorMessageC ) ) ; org . apache . kafka . common . config . ConfigValue configD = new org . apache . kafka . common . config . ConfigValue ( "d" , 10 , java . util . Arrays . < java . lang . Object > asList ( 1 , 2 , 3 ) , java . util . Collections . < java . lang . String > emptyList ( ) ) ; expected . put ( "a" , configA ) ; expected . put ( "b" , configB ) ; expected . put ( "c" , configC ) ; expected . put ( "d" , configD ) ; org . apache . kafka . common . config . ConfigDef def = new org . apache . kafka . common . config . ConfigDef ( ) . define ( "a" , Type . INT , Importance . HIGH , "docs" , "group" , 1 , Width . SHORT , "a" , java . util . Arrays . asList ( "b" , "c" ) , new org . apache . kafka . common . config . ConfigDefTest . IntegerRecommender ( false ) ) . define ( "b" , Type . INT , Importance . HIGH , "docs" , "group" , 2 , Width . SHORT , "b" , new org . apache . kafka . common . config . ConfigDefTest . IntegerRecommender ( true ) ) . define ( "c" , Type . INT , Importance . HIGH , "docs" , "group" , 3 , Width . SHORT , "c" , new org . apache . kafka . common . config . ConfigDefTest . IntegerRecommender ( true ) ) . define ( "d" , Type . INT , Importance . HIGH , "docs" , "group" , 4 , Width . SHORT , "d" , java . util . Arrays . asList ( "b" ) , new org . apache . kafka . common . config . ConfigDefTest . IntegerRecommender ( false ) ) ; java . util . Map < java . lang . String , java . lang . String > props = new java . util . HashMap ( ) ; props . put ( "a" , "1" ) ; props . put ( "d" , "10" ) ; java . util . List < org . apache . kafka . common . config . ConfigValue > configs = def . validate ( props ) ; for ( org . apache . kafka . common . config . ConfigValue config : configs ) { java . lang . String name = config . name ( ) ; org . apache . kafka . common . config . ConfigValue expectedConfig = expected . get ( name ) ; "<AssertPlaceHolder>" ; } } get ( org . apache . kafka . connect . data . Field ) { java . lang . Object val = values [ field . index ( ) ] ; if ( ( val == null ) && ( ( field . schema ( ) . defaultValue ( ) ) != null ) ) { val = field . schema ( ) . defaultValue ( ) ; } return val ; }
|
org . junit . Assert . assertEquals ( expectedConfig , config )
|
checkReservedNames ( ) { System . out . println ( ( ( cz . metacentrum . perun . core . entry . ModulesUtilsEntryIntegrationTest . CLASS_NAME ) + "checkReservedNames" ) ) ; java . lang . String goodName = "cokoliv" ; java . lang . String badName = "sys" ; cz . metacentrum . perun . core . api . Attribute attr = new cz . metacentrum . perun . core . api . Attribute ( ) ; attr . setValue ( goodName ) ; modulesUtilsBl . checkReservedUnixGroupNames ( attr ) ; attr . setValue ( badName ) ; boolean ok = false ; try { modulesUtilsBl . checkReservedUnixGroupNames ( attr ) ; } catch ( cz . metacentrum . perun . core . api . exceptions . WrongAttributeValueException ex ) { ok = true ; } "<AssertPlaceHolder>" ; } checkReservedUnixGroupNames ( cz . metacentrum . perun . core . api . Attribute ) { if ( groupNameAttribute == null ) return ; checkPerunNamespacesMap ( ) ; java . lang . String reservedNames = perunNamespaces . get ( ( ( groupNameAttribute . getFriendlyName ( ) ) + ":reservedNames" ) ) ; if ( reservedNames != null ) { java . util . List < java . lang . String > reservedNamesList = java . util . Arrays . asList ( reservedNames . split ( "\\s*,\\s*" ) ) ; if ( reservedNamesList . contains ( groupNameAttribute . valueAsString ( ) ) ) throw new cz . metacentrum . perun . core . api . exceptions . WrongAttributeValueException ( groupNameAttribute , "This<sp>groupName<sp>is<sp>reserved." ) ; } else { if ( cz . metacentrum . perun . core . blImpl . ModulesUtilsBlImpl . reservedNamesForUnixGroups . contains ( groupNameAttribute . valueAsString ( ) ) ) throw new cz . metacentrum . perun . core . api . exceptions . WrongAttributeValueException ( groupNameAttribute , "This<sp>groupName<sp>is<sp>reserved." ) ; } }
|
org . junit . Assert . assertTrue ( ok )
|
testPut ( ) { com . googlecode . concurrenttrees . radixinverted . ConcurrentInvertedRadixTree < java . lang . Integer > tree = new com . googlecode . concurrenttrees . radixinverted . ConcurrentInvertedRadixTree < java . lang . Integer > ( getNodeFactory ( ) ) ; tree . put ( "FOO" , 1 ) ; tree . put ( "FOOBAR" , 2 ) ; java . lang . String expected = "β\n" + ( "βββ<sp>β<sp>FOO<sp>(1)\n" + "<sp>βββ<sp>β<sp>BAR<sp>(2)\n" ) ; java . lang . String actual = com . googlecode . concurrenttrees . common . PrettyPrinter . prettyPrint ( tree ) ; "<AssertPlaceHolder>" ; } prettyPrint ( com . googlecode . concurrenttrees . radix . node . util . PrettyPrintable ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; com . googlecode . concurrenttrees . common . PrettyPrinter . prettyPrint ( tree . getNode ( ) , sb , "" , true , true ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testGetParametersWithDefaultEntityAndDisabledDefaults ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . timesheet . type . TimeSheetType entity = new org . lnu . is . domain . timesheet . type . TimeSheetType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testClassInitializationFailure ( ) { java . lang . Throwable throwable = new java . lang . Throwable ( ) ; com . liferay . portal . test . aspects . ReflectionUtilAdvice . setDeclaredMethodThrowable ( throwable ) ; try { java . lang . Class . forName ( com . liferay . portal . bean . ConstantsBeanFactoryImpl . class . getName ( ) ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . ExceptionInInitializerError eiie ) { "<AssertPlaceHolder>" ; } } getCause ( ) { return _cause ; }
|
org . junit . Assert . assertSame ( throwable , eiie . getCause ( ) )
|
getNextTupleTest6 ( ) { java . util . List < edu . uci . ics . texera . api . tuple . Tuple > data = edu . uci . ics . texera . dataflow . nlp . entity . NlpEntityTestConstants . getTest4Tuple ( ) ; edu . uci . ics . texera . storage . DataWriter twoSentenceDataWriter = edu . uci . ics . texera . storage . RelationManager . getInstance ( ) . getTableDataWriter ( edu . uci . ics . texera . dataflow . nlp . entity . NlpEntityTest . TWO_SENTENCE_TABLE ) ; twoSentenceDataWriter . open ( ) ; for ( edu . uci . ics . texera . api . tuple . Tuple tuple : data ) { twoSentenceDataWriter . insertTuple ( tuple ) ; } twoSentenceDataWriter . close ( ) ; java . lang . String attribute1 = NlpEntityTestConstants . SENTENCE_ONE ; java . lang . String attribute2 = NlpEntityTestConstants . SENTENCE_TWO ; java . util . List < java . lang . String > attributeNames = new java . util . ArrayList ( ) ; attributeNames . add ( attribute1 ) ; attributeNames . add ( attribute2 ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > returnedResults = getQueryResults ( edu . uci . ics . texera . dataflow . nlp . entity . NlpEntityTest . TWO_SENTENCE_TABLE , attributeNames , NlpEntityType . ORGANIZATION ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > expectedResults = edu . uci . ics . texera . dataflow . nlp . entity . NlpEntityTestConstants . getTest6ResultTuples ( ) ; boolean contains = edu . uci . ics . texera . api . utils . TestUtils . equals ( expectedResults , returnedResults ) ; "<AssertPlaceHolder>" ; } equals ( java . util . List , java . util . List ) { expectedResults = Tuple . Builder . removeIfExists ( expectedResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; exactResults = Tuple . Builder . removeIfExists ( exactResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; if ( ( expectedResults . size ( ) ) != ( exactResults . size ( ) ) ) return false ; return ( expectedResults . containsAll ( exactResults ) ) && ( exactResults . containsAll ( expectedResults ) ) ; }
|
org . junit . Assert . assertTrue ( contains )
|
lookupNodes ( ) { java . lang . String createNodeQuery = "CREATE<sp>(p1:Person<sp>{name:<sp>'Mark'})<sp>CREATE<sp>(p2:Person<sp>{name:<sp>'Arya'})<sp>RETURN<sp>p1,<sp>p2" ; org . neo4j . graphalgo . algo . Map < java . lang . String , java . lang . Object > savedRow = org . neo4j . graphalgo . algo . GetNodeFuncTest . DB . execute ( createNodeQuery ) . next ( ) ; org . neo4j . graphdb . Node savedNode1 = ( ( org . neo4j . graphdb . Node ) ( savedRow . get ( "p1" ) ) ) ; org . neo4j . graphdb . Node savedNode2 = ( ( org . neo4j . graphdb . Node ) ( savedRow . get ( "p2" ) ) ) ; org . neo4j . graphalgo . algo . Map < java . lang . String , java . lang . Object > params = org . neo4j . helpers . collection . MapUtil . map ( "nodeIds" , org . neo4j . graphalgo . algo . Arrays . asList ( savedNode1 . getId ( ) , savedNode2 . getId ( ) ) ) ; org . neo4j . graphalgo . algo . Map < java . lang . String , java . lang . Object > row = org . neo4j . graphalgo . algo . GetNodeFuncTest . DB . execute ( "RETURN<sp>algo.asNodes($nodeIds)<sp>AS<sp>nodes" , params ) . next ( ) ; org . neo4j . graphalgo . algo . List < org . neo4j . graphdb . Node > nodes = ( ( org . neo4j . graphalgo . algo . List < org . neo4j . graphdb . Node > ) ( row . get ( "nodes" ) ) ) ; "<AssertPlaceHolder>" ; } get ( int ) { int distance = this . distance . get ( nodeId ) ; return distance == ( Integer . MAX_VALUE ) ? Double . POSITIVE_INFINITY : distance / ( multiplier ) ; }
|
org . junit . Assert . assertEquals ( org . neo4j . graphalgo . algo . Arrays . asList ( savedNode1 , savedNode2 ) , nodes )
|
test_isLeapYear_inLastWeekOf ( java . time . DayOfWeek , java . time . Month ) { org . threeten . extra . chrono . AccountingChronology chronology = new org . threeten . extra . chrono . AccountingChronologyBuilder ( ) . endsOn ( dayOfWeek ) . inLastWeekOf ( ending ) . withDivision ( AccountingYearDivision . QUARTERS_OF_PATTERN_4_4_5_WEEKS ) . leapWeekInMonth ( 12 ) . toChronology ( ) ; java . util . function . IntFunction < java . time . LocalDate > getYearEnd = ( year ) -> { return java . time . LocalDate . of ( year , ending , 1 ) . with ( java . time . temporal . TemporalAdjusters . lastDayOfMonth ( ) ) . with ( java . time . temporal . TemporalAdjusters . previousOrSame ( dayOfWeek ) ) ; } ; java . util . function . Predicate < java . lang . Integer > isLeapYear = ( year ) -> { java . time . LocalDate currentYearEnd = getYearEnd . apply ( year ) ; java . time . LocalDate prevYearEnd = getYearEnd . apply ( ( year - 1 ) ) ; return ( prevYearEnd . until ( currentYearEnd , org . threeten . extra . chrono . DAYS ) ) == 371 ; } ; for ( int year = - 200 ; year < 600 ; year ++ ) { "<AssertPlaceHolder>" ; } } isLeapYear ( long ) { return ( java . lang . Math . floorMod ( prolepticYear , 4 ) ) == 3 ; }
|
org . junit . Assert . assertEquals ( isLeapYear . test ( year ) , chronology . isLeapYear ( year ) )
|
testMailFrom ( ) { java . lang . System . setProperty ( "user.name" , "Joe" ) ; java . util . Properties p = new java . util . Properties ( ) ; p . setProperty ( "mail.from" , "Bob@home" ) ; javax . mail . Session s = javax . mail . Session . getInstance ( p ) ; javax . mail . internet . InternetAddress ia = javax . mail . internet . InternetAddress . getLocalAddress ( s ) ; "<AssertPlaceHolder>" ; } getAddress ( ) { return addr ; }
|
org . junit . Assert . assertEquals ( "Bob@home" , ia . getAddress ( ) )
|
testGetDownloadFileInAStringFileIsDownloaded ( ) { org . phoenicis . tools . http . DownloaderTest . mockServer . when ( request ( ) . withMethod ( "GET" ) . withPath ( "/test2.txt" ) ) . respond ( response ( ) . withStatusCode ( 200 ) . withHeaders ( new org . mockserver . model . Header ( "Content-Type" , "application/config" ) ) . withBody ( "Content<sp>file<sp>to<sp>download<sp>2" ) ) ; java . lang . String result = new org . phoenicis . tools . http . Downloader ( new org . phoenicis . tools . files . FileSizeUtilities ( ) ) . get ( org . phoenicis . tools . http . DownloaderTest . mockServerURLFile2 , ( e ) -> { } ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String , java . util . function . Consumer ) { org . phoenicis . tools . http . ByteArrayOutputStream outputStream = new org . phoenicis . tools . http . ByteArrayOutputStream ( ) ; try { get ( new java . net . URL ( url ) , outputStream , onChange ) ; } catch ( java . net . MalformedURLException e ) { throw new org . phoenicis . tools . http . DownloadException ( java . lang . String . format ( org . phoenicis . tools . http . Downloader . EXCEPTION_ITEM_DOWNLOAD_FAILED , url ) , e ) ; } return outputStream . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "Content<sp>file<sp>to<sp>download<sp>2" , result )
|
concurrentTestReadFasterThanWrite ( ) { final int totalTimes = 10000 ; final int writerCount = 10 ; final int readerCount = 20 ; com . geekhua . filequeue . Config config = new com . geekhua . filequeue . Config ( ) ; config . setBaseDir ( com . geekhua . filequeue . FileQueueImplTest . baseDir . getAbsolutePath ( ) ) ; final com . geekhua . filequeue . FileQueue < com . geekhua . filequeue . FileQueueImplTest . TestObject > fq = new com . geekhua . filequeue . FileQueueImpl < com . geekhua . filequeue . FileQueueImplTest . TestObject > ( config ) ; final java . util . Set < com . geekhua . filequeue . FileQueueImplTest . TestObject > results = java . util . Collections . synchronizedSet ( new java . util . TreeSet < com . geekhua . filequeue . FileQueueImplTest . TestObject > ( ) ) ; final java . util . Set < com . geekhua . filequeue . FileQueueImplTest . TestObject > expected = java . util . Collections . synchronizedSet ( new java . util . TreeSet < com . geekhua . filequeue . FileQueueImplTest . TestObject > ( ) ) ; final java . util . concurrent . CountDownLatch startLatch = new java . util . concurrent . CountDownLatch ( 1 ) ; final java . util . concurrent . CountDownLatch endLatch = new java . util . concurrent . CountDownLatch ( ( writerCount + readerCount ) ) ; for ( int i = 0 ; i < writerCount ; i ++ ) { final int threadNum = i ; java . lang . Thread writerThread = new java . lang . Thread ( new java . lang . Runnable ( ) { public void run ( ) { try { startLatch . await ( ) ; } catch ( java . lang . InterruptedException e ) { e . printStackTrace ( ) ; } for ( int j = 0 ; j < ( totalTimes / writerCount ) ; j ++ ) { try { com . geekhua . filequeue . FileQueueImplTest . TestObject m = new com . geekhua . filequeue . FileQueueImplTest . TestObject ( totalTimes , ( ( ( "t-" + threadNum ) + "-" ) + j ) , ( ( j % 2 ) == 0 ) , j ) ; fq . add ( m ) ; expected . add ( m ) ; java . lang . Thread . sleep ( 5 ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } } endLatch . countDown ( ) ; } } ) ; writerThread . start ( ) ; } for ( int i = 0 ; i < readerCount ; i ++ ) { java . lang . Thread readerThread = new java . lang . Thread ( new java . lang . Runnable ( ) { public void run ( ) { try { startLatch . await ( ) ; } catch ( java . lang . InterruptedException e ) { e . printStackTrace ( ) ; } for ( int j = 0 ; j < ( totalTimes / readerCount ) ; j ++ ) { try { com . geekhua . filequeue . FileQueueImplTest . TestObject m = fq . get ( ) ; results . add ( m ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } } endLatch . countDown ( ) ; } } ) ; readerThread . start ( ) ; } startLatch . countDown ( ) ; endLatch . await ( ) ; "<AssertPlaceHolder>" ; } add ( E ) { writeLock . lock ( ) ; try { if ( stopped ) { throw new com . geekhua . filequeue . exception . FileQueueClosedException ( ) ; } dataStore . put ( m ) ; } finally { writeLock . unlock ( ) ; } }
|
org . junit . Assert . assertEquals ( expected , results )
|
shouldSaveData ( ) { jsonDataSaver . saveJSONData ( destDir , "data" , null , uriFileTranslator ) ; java . lang . String json = ioUtils . loadFromFileSystem ( new java . io . File ( destDir , "jscoverage.json" ) ) ; "<AssertPlaceHolder>" ; } saveJSONData ( java . io . File , java . lang . String , jscover . report . List , jscover . util . UriFileTranslator ) { try { lockOnReportDir ( reportDir ) ; reportDir . mkdirs ( ) ; java . io . File jsonFile = new java . io . File ( reportDir , "jscoverage.json" ) ; jscover . report . SortedMap < java . lang . String , jscover . report . FileData > dataMap = new jscover . report . TreeMap ( ) ; if ( jsonFile . exists ( ) ) { jscover . report . JSONDataSaver . logger . info ( "Saving/merging<sp>JSON<sp>with<sp>existing<sp>JSON" ) ; java . lang . String existingJSON = ioUtils . toString ( jsonFile ) ; if ( uriFileTranslator . mutates ( ) ) { translateUris ( data , uriFileTranslator , dataMap ) ; dataMap = jsonDataMerger . mergeJSONCoverageMaps ( dataMap , jsonDataMerger . jsonToMap ( existingJSON ) ) ; } else dataMap . putAll ( jsonDataMerger . mergeJSONCoverageStrings ( existingJSON , data ) ) ; ioUtils . copy ( jsonDataMerger . toJSON ( dataMap ) , jsonFile ) ; } else if ( unloadJSData != null ) { jscover . report . JSONDataSaver . logger . info ( "Saving/merging<sp>JSON<sp>with<sp>unloaded<sp>JavaScript<sp>JSON" ) ; dataMap . putAll ( jsonDataMerger . createEmptyJSON ( unloadJSData ) ) ; if ( uriFileTranslator . mutates ( ) ) translateUris ( data , uriFileTranslator , dataMap ) ; else dataMap . putAll ( jsonDataMerger . jsonToMap ( data ) ) ; ioUtils . copy ( jsonDataMerger . toJSON ( dataMap ) , jsonFile ) ; } else { jscover . report . JSONDataSaver . logger . info ( "Saving<sp>JSON" ) ; if ( uriFileTranslator . mutates ( ) ) { translateUris ( data , uriFileTranslator , dataMap ) ; ioUtils . copy ( jsonDataMerger . toJSON ( dataMap ) , jsonFile ) ; } else ioUtils . copy ( data , jsonFile ) ; } } finally { unlockOnReportDir ( reportDir ) ; } }
|
org . junit . Assert . assertThat ( json , org . hamcrest . CoreMatchers . equalTo ( "data" ) )
|
selectorWithoutIndicatorsPatternAndMultipleMatchingValues ( ) { final java . lang . String expectedValue = "This<sp>is<sp>the<sp>expected<sp>value" ; final org . marc4j . marc . Record record = newRecord ( eu . aliada . rdfizer . pipeline . format . marc . selector . binary . A_VARIABLE_FIELD_NAME , '#' , '#' , 'a' , expectedValue , "another<sp>value" , "still<sp>another<sp>value" ) ; final eu . aliada . rdfizer . pipeline . format . marc . selector . binary . VariableFieldExpression expression = new eu . aliada . rdfizer . pipeline . format . marc . selector . binary . VariableFieldExpression ( ( ( A_VARIABLE_FIELD_NAME ) + "a" ) ) ; "<AssertPlaceHolder>" ; } evaluate ( org . xml . sax . InputSource ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertEquals ( expectedValue , expression . evaluate ( record ) )
|
cloneAsVersionTest ( ) { final org . opendaylight . controller . cluster . access . commands . ReadTransactionSuccess clone = org . opendaylight . controller . cluster . access . commands . ReadTransactionSuccessTest . OBJECT . cloneAsVersion ( ABIVersion . BORON ) ; "<AssertPlaceHolder>" ; } cloneAsVersion ( org . opendaylight . controller . cluster . access . ABIVersion ) { return ( ( T ) ( this ) ) ; }
|
org . junit . Assert . assertEquals ( org . opendaylight . controller . cluster . access . commands . ReadTransactionSuccessTest . OBJECT , clone )
|
testComputeCallbackUrlAlreadyDefined ( ) { final java . lang . String callbackUrl = ( ( ( CALLBACK_URL ) + '?' ) + ( org . pac4j . core . context . Pac4jConstants . DEFAULT_CLIENT_NAME_PARAMETER ) ) + "=cn" ; final java . lang . String url = org . pac4j . core . http . callback . QueryParameterCallbackUrlResolverTests . resolver . compute ( new org . pac4j . core . http . url . DefaultUrlResolver ( ) , callbackUrl , org . pac4j . core . http . callback . CLIENT_NAME , org . pac4j . core . context . MockWebContext . create ( ) ) ; "<AssertPlaceHolder>" ; } create ( ) { return new org . pac4j . core . context . MockWebContext ( ) ; }
|
org . junit . Assert . assertEquals ( callbackUrl , url )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.