input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
rejectAfterFailHandlerAdded ( ) { final com . b2international . snowowl . core . events . util . Promise < java . lang . Object > p = new com . b2international . snowowl . core . events . util . Promise ( ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; p . fail ( new com . google . common . base . Function < java . lang . Throwable , java . lang . Object > ( ) { @ com . b2international . snowowl . core . events . util . Override public java . lang . Object apply ( java . lang . Throwable input ) { "<AssertPlaceHolder>" ; latch . countDown ( ) ; return null ; } } ) ; p . reject ( rejection ) ; latch . await ( 100 , TimeUnit . MILLISECONDS ) ; } apply ( org . eclipse . core . runtime . IConfigurationElement ) { try { return ( ( org . eclipse . spi . net4j . ClientProtocolFactory ) ( input . createExecutableExtension ( com . b2international . snowowl . datastore . ClientProtocolFactoryRegistry . CLASS_ATTRIBUTE ) ) ) ; } catch ( final org . eclipse . core . runtime . CoreException e ) { throw new java . lang . RuntimeException ( ( "Error<sp>while<sp>creating<sp>executable<sp>extension<sp>from<sp>the<sp>passed<sp>in<sp>configuration<sp>element:<sp>" + input ) , e ) ; } }
org . junit . Assert . assertEquals ( rejection , input )
applyTest ( ) { java . lang . String [ ] [ ] tests = new java . lang . String [ ] [ ] { new java . lang . String [ ] { "{{<sp>''<sp>|<sp>remove:'a'<sp>}}" , "" } , new java . lang . String [ ] { "{{<sp>nil<sp>|<sp>remove:'a'<sp>}}" , "" } , new java . lang . String [ ] { "{{<sp>'aabb'<sp>|<sp>remove:'ab'<sp>}}" , "ab" } , new java . lang . String [ ] { "{{<sp>'ababab'<sp>|<sp>remove:'a'<sp>}}" , "bbb" } } ; for ( java . lang . String [ ] test : tests ) { liqp . Template template = liqp . Template . parse ( test [ 0 ] ) ; java . lang . String rendered = java . lang . String . valueOf ( template . render ( ) ) ; "<AssertPlaceHolder>" ; } } render ( ) { return render ( new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; }
org . junit . Assert . assertThat ( rendered , org . hamcrest . CoreMatchers . is ( test [ 1 ] ) )
noIntersectionIfGapExists ( ) { net . time4j . range . DateInterval i1 = net . time4j . range . DateInterval . between ( net . time4j . PlainDate . of ( 2014 , 2 , 28 ) , net . time4j . PlainDate . of ( 2014 , 5 , 31 ) ) ; net . time4j . range . DateInterval i2 = net . time4j . range . DateInterval . between ( net . time4j . PlainDate . of ( 2014 , 4 , 1 ) , net . time4j . PlainDate . of ( 2014 , 4 , 5 ) ) ; net . time4j . range . DateInterval i3 = net . time4j . range . DateInterval . between ( net . time4j . PlainDate . of ( 2014 , 4 , 10 ) , net . time4j . PlainDate . of ( 2014 , 6 , 1 ) ) ; net . time4j . range . DateInterval i4 = net . time4j . range . DateInterval . between ( net . time4j . PlainDate . of ( 2014 , 6 , 15 ) , net . time4j . PlainDate . of ( 2014 , 6 , 30 ) ) ; net . time4j . range . IntervalCollection < net . time4j . PlainDate > windows = net . time4j . range . IntervalCollection . onDateAxis ( ) ; windows = windows . plus ( i1 ) . plus ( i2 ) . plus ( i3 ) . plus ( i4 ) ; "<AssertPlaceHolder>" ; } withIntersection ( ) { int len = this . intervals . size ( ) ; if ( len < 2 ) { return this ; } else { return this . create ( this . intersect ( this . intervals ) ) ; } }
org . junit . Assert . assertThat ( windows . withIntersection ( ) . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) )
testNullSafeNumeric ( ) { setupParameters ( data , values ) ; parameters . add ( ff2 . literal ( InterpolateFunction . METHOD_NUMERIC ) ) ; org . opengis . filter . expression . Function fn = finder . findFunction ( "interpolate" , parameters ) ; java . lang . Object result = fn . evaluate ( null , org . geotools . filter . function . Double . class ) ; "<AssertPlaceHolder>" ; } evaluate ( org . geotools . coverage . grid . GridCoordinates2D , double [ ] ) { if ( image . getBounds ( ) . contains ( coord . x , coord . y ) ) { return image . getTile ( image . XToTileX ( coord . x ) , image . YToTileY ( coord . y ) ) . getPixel ( coord . x , coord . y , dest ) ; } throw new org . opengis . coverage . PointOutsideCoverageException ( formatEvaluateError ( coord , true ) ) ; }
org . junit . Assert . assertNull ( result )
testAlwaysSample ( ) { org . hawkular . apm . client . opentracing . APMTracerTest . TestTraceRecorder traceRecorder = new org . hawkular . apm . client . opentracing . APMTracerTest . TestTraceRecorder ( ) ; io . opentracing . Tracer tracer = new org . hawkular . apm . client . opentracing . APMTracer ( traceRecorder , org . hawkular . apm . client . api . sampler . Sampler . ALWAYS_SAMPLE ) ; io . opentracing . Span span = tracer . buildSpan ( "foo" ) . start ( ) ; span . finish ( ) ; "<AssertPlaceHolder>" ; } getTraces ( ) { return traces ; }
org . junit . Assert . assertEquals ( 1 , traceRecorder . getTraces ( ) . size ( ) )
testGetAsDateDefault ( ) { org . onebusaway . gtfs . model . calendar . ServiceDate serviceDate = new org . onebusaway . gtfs . model . calendar . ServiceDate ( 2010 , 2 , 11 ) ; java . util . Date dateA = serviceDate . getAsDate ( ) ; java . util . Date dateB = serviceDate . getAsDate ( java . util . TimeZone . getDefault ( ) ) ; "<AssertPlaceHolder>" ; } getAsDate ( java . util . TimeZone ) { java . util . Calendar c = getAsCalendar ( timeZone ) ; return c . getTime ( ) ; }
org . junit . Assert . assertEquals ( dateA , dateB )
testTimeLogicalTypes ( ) { org . apache . parquet . format . converter . ParquetMetadataConverter parquetMetadataConverter = new org . apache . parquet . format . converter . ParquetMetadataConverter ( ) ; org . apache . parquet . schema . MessageType expected = org . apache . parquet . schema . Types . buildMessage ( ) . required ( PrimitiveTypeName . INT64 ) . as ( timestampType ( false , TimeUnit . MILLIS ) ) . named ( "aTimestampNonUtcMillis" ) . required ( PrimitiveTypeName . INT64 ) . as ( timestampType ( true , TimeUnit . MILLIS ) ) . named ( "aTimeUtcMillis" 0 ) . required ( PrimitiveTypeName . INT64 ) . as ( timestampType ( false , TimeUnit . MICROS ) ) . named ( "aTimestampNonUtcMicros" ) . required ( PrimitiveTypeName . INT64 ) . as ( timestampType ( true , TimeUnit . MICROS ) ) . named ( "aTimeUtcMillis" 1 ) . required ( PrimitiveTypeName . INT64 ) . as ( timestampType ( false , TimeUnit . NANOS ) ) . named ( "aTimestampNonUtcNanos" ) . required ( PrimitiveTypeName . INT64 ) . as ( timestampType ( true , TimeUnit . NANOS ) ) . named ( "aTimestampUtcNanos" ) . required ( PrimitiveTypeName . INT32 ) . as ( timeType ( false , TimeUnit . MILLIS ) ) . named ( "aTimeUtcMillis" 2 ) . required ( PrimitiveTypeName . INT32 ) . as ( timeType ( true , TimeUnit . MILLIS ) ) . named ( "aTimeUtcMillis" ) . required ( PrimitiveTypeName . INT64 ) . as ( timeType ( false , TimeUnit . MICROS ) ) . named ( "aTimeNonUtcMicros" ) . required ( PrimitiveTypeName . INT64 ) . as ( timeType ( true , TimeUnit . MICROS ) ) . named ( "aTimeUtcMicros" ) . required ( PrimitiveTypeName . INT64 ) . as ( timeType ( false , TimeUnit . NANOS ) ) . named ( "aTimeNonUtcNanos" ) . required ( PrimitiveTypeName . INT64 ) . as ( timeType ( true , TimeUnit . NANOS ) ) . named ( "aTimeUtcNanos" ) . named ( "Message" ) ; java . util . List < org . apache . parquet . format . SchemaElement > parquetSchema = parquetMetadataConverter . toParquetSchema ( expected ) ; org . apache . parquet . schema . MessageType schema = parquetMetadataConverter . fromParquetSchema ( parquetSchema , null ) ; "<AssertPlaceHolder>" ; } toParquetSchema ( org . apache . parquet . thrift . struct . ThriftType$StructType ) { return org . apache . parquet . thrift . ThriftSchemaConverter . convertWithoutProjection ( struct ) ; }
org . junit . Assert . assertEquals ( expected , schema )
testIsJ9VM ( ) { final boolean expected = java . lang . management . ManagementFactory . getRuntimeMXBean ( ) . getVmName ( ) . contains ( SystemUtils . IBM_J9_JVM_NAME ) ; "<AssertPlaceHolder>" ; } isJ9VM ( ) { final java . lang . String vm = java . lang . System . getProperty ( "java.vm.name" ) ; return ( vm != null ) && ( vm . contains ( com . gemstone . gemfire . internal . lang . SystemUtils . IBM_J9_JVM_NAME ) ) ; }
org . junit . Assert . assertEquals ( expected , com . gemstone . gemfire . internal . lang . SystemUtils . isJ9VM ( ) )
givenShortenedMultiple_whenUrlIsUnshortened_thenCorrectResult ( ) { final java . lang . String expectedResult = "http://www.baeldung.com/rest-versioning" ; final java . lang . String actualResult = getOriginalUrl ( "http://t.co/e4rDDbnzmk" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final org . baeldung . persistence . model . Role role = ( ( org . baeldung . persistence . model . Role ) ( obj ) ) ; if ( ! ( role . equals ( role . name ) ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( actualResult . equals ( expectedResult ) )
testImportRelativeTemplateFile ( ) { java . lang . String dir = getRandomDir ( ) ; java . lang . String groupFile = "import<sp>\"subdir/c.st\"\n" + ( "a()<sp>::=<sp>\"g1<sp>a\"\n" + "b()<sp>::=<sp>\"<c()>\"\n" ) ; writeFile ( dir , "group1.stg" , groupFile ) ; java . lang . String stFile = "c()<sp>::=<sp>\"c\"\n" ; writeFile ( dir , "subdir/c.st" , stFile ) ; org . stringtemplate . v4 . STGroup group1 = new org . stringtemplate . v4 . STGroupFile ( ( dir + "/group1.stg" ) ) ; org . stringtemplate . v4 . ST st = group1 . getInstanceOf ( "c" ) ; java . lang . String expected = "c" ; java . lang . String result = ( st != null ) ? st . render ( ) : null ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
org . junit . Assert . assertEquals ( expected , result )
testIsOpenSSLPossibleWhenKeyAliasIsSpecified ( ) { org . junit . Assume . assumeTrue ( io . netty . handler . ssl . OpenSsl . isAvailable ( ) ) ; org . junit . Assume . assumeTrue ( io . netty . handler . ssl . OpenSsl . supportsKeyManagerFactory ( ) ) ; org . junit . Assume . assumeTrue ( io . netty . handler . ssl . OpenSsl . supportsHostnameValidation ( ) ) ; org . apache . qpid . jms . transports . TransportOptions options = new org . apache . qpid . jms . transports . TransportOptions ( ) ; options . setUseOpenSSL ( true ) ; options . setKeyAlias ( "alias" ) ; "<AssertPlaceHolder>" ; } isOpenSSLPossible ( org . apache . qpid . jms . transports . TransportOptions ) { boolean result = false ; if ( options . isUseOpenSSL ( ) ) { if ( ! ( io . netty . handler . ssl . OpenSsl . isAvailable ( ) ) ) { org . apache . qpid . jms . transports . TransportSupport . LOG . debug ( "OpenSSL<sp>could<sp>not<sp>be<sp>enabled<sp>because<sp>a<sp>suitable<sp>implementation<sp>could<sp>not<sp>be<sp>found." , io . netty . handler . ssl . OpenSsl . unavailabilityCause ( ) ) ; } else if ( ( options . getSslContextOverride ( ) ) != null ) { org . apache . qpid . jms . transports . TransportSupport . LOG . debug ( "OpenSSL<sp>could<sp>not<sp>be<sp>enabled<sp>due<sp>to<sp>user<sp>SSLContext<sp>being<sp>supplied." ) ; } else if ( ! ( io . netty . handler . ssl . OpenSsl . supportsKeyManagerFactory ( ) ) ) { org . apache . qpid . jms . transports . TransportSupport . LOG . debug ( "OpenSSL<sp>could<sp>not<sp>be<sp>enabled<sp>because<sp>the<sp>version<sp>provided<sp>does<sp>not<sp>allow<sp>a<sp>KeyManagerFactory<sp>to<sp>be<sp>used." ) ; } else if ( ( options . isVerifyHost ( ) ) && ( ! ( io . netty . handler . ssl . OpenSsl . supportsHostnameValidation ( ) ) ) ) { org . apache . qpid . jms . transports . TransportSupport . LOG . debug ( "OpenSSL<sp>could<sp>not<sp>be<sp>enabled<sp>due<sp>to<sp>verifyHost<sp>being<sp>enabled<sp>but<sp>not<sp>supported<sp>by<sp>the<sp>provided<sp>OpenSSL<sp>version." ) ; } else if ( ( options . getKeyAlias ( ) ) != null ) { org . apache . qpid . jms . transports . TransportSupport . LOG . debug ( "OpenSSL<sp>could<sp>not<sp>be<sp>enabled<sp>because<sp>a<sp>keyAlias<sp>is<sp>set<sp>and<sp>that<sp>feature<sp>is<sp>not<sp>supported<sp>for<sp>OpenSSL." ) ; } else { org . apache . qpid . jms . transports . TransportSupport . LOG . debug ( "OpenSSL<sp>Enabled:<sp>Version<sp>{}<sp>of<sp>OpenSSL<sp>will<sp>be<sp>used" , io . netty . handler . ssl . OpenSsl . versionString ( ) ) ; result = true ; } } return result ; }
org . junit . Assert . assertFalse ( org . apache . qpid . jms . transports . TransportSupport . isOpenSSLPossible ( options ) )
setPropertyValueOnAllResourceRelationsForContextWhereNotYetSetShouldThrowExceptionWhenNoSlaveResourceFound ( ) { java . lang . String resourceGroupName = "resourceGroupName" ; java . lang . String relatedResourceGroupName = "relatedResourceGroupName" ; java . lang . String relatedResourceReleaseName = "relatedResourceReleaseName" ; java . lang . String contextName = "contextName" ; java . lang . String propertyName = "propertyName" ; java . lang . String propertyValue = "propertyValue" ; ch . puzzle . itc . mobiliar . business . property . boundary . List < ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity > resourcesByGroupNameWithRelations = new ch . puzzle . itc . mobiliar . business . property . boundary . ArrayList ( ) ; resourcesByGroupNameWithRelations . add ( createWithIdNameAndTypeName ( 1 , resourceGroupName , "resourceType" ) ) ; when ( resourceLocatorMock . getResourcesByGroupNameWithRelations ( resourceGroupName ) ) . thenReturn ( resourcesByGroupNameWithRelations ) ; when ( resourceLocatorMock . getResourceByGroupNameAndRelease ( relatedResourceGroupName , relatedResourceReleaseName ) ) . thenReturn ( null ) ; "<AssertPlaceHolder>" ; editor . setPropertyValueOnAllResourceRelationsForContextWhereNotYetSet ( resourceGroupName , relatedResourceGroupName , relatedResourceReleaseName , contextName , propertyName , propertyValue ) ; } isEmpty ( ) { if ( ( ( asProperties ) != null ) && ( ! ( asProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( nodeProperties ) != null ) && ( ! ( nodeProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( consumerUnit ) != null ) && ( ! ( consumerUnit . isEmpty ( ) ) ) ) { return false ; } return true ; }
org . junit . Assert . assertFalse ( resourcesByGroupNameWithRelations . isEmpty ( ) )
testTopicSending ( ) { xpadro . spring . jms . model . Notification notification = null ; for ( int i = 1 ; i < 11 ; i ++ ) { notification = new xpadro . spring . jms . model . Notification ( java . lang . String . valueOf ( i ) , "this<sp>is<sp>a<sp>topic" ) ; producer . convertAndSendTopic ( notification ) ; } java . lang . Thread . sleep ( 2000 ) ; "<AssertPlaceHolder>" ; } getReceivedNotifications ( ) { return receivedNotifications ; }
org . junit . Assert . assertEquals ( 10 , registry . getReceivedNotifications ( ) . size ( ) )
testNextNumberWithRollback ( ) { sequenceRepository . initSequence ( ) ; java . lang . Long number1 = sequenceRepository . nextNumber ( ) ; testTransactionManager . rollbackTransaction ( ) ; testTransactionManager . beginTransaction ( ) ; java . lang . Long number2 = sequenceRepository . nextNumber ( ) ; "<AssertPlaceHolder>" ; } nextNumber ( ) { return number . incrementAndGet ( ) ; }
org . junit . Assert . assertEquals ( number1 , number2 )
testGet ( ) { org . glassfish . jersey . server . spi . ContainerResponseWriter writer ; writer = provider . get ( vertxRequest , jerseyRequest ) ; "<AssertPlaceHolder>" ; } get ( io . vertx . core . http . HttpServerRequest , org . glassfish . jersey . server . ContainerRequest ) { return new com . englishtown . vertx . jersey . impl . VertxResponseWriter ( vertxRequest , vertx , responseProcessors , postResponseProcessors ) ; }
org . junit . Assert . assertNotNull ( writer )
testConstructor ( ) { org . eurekastreams . server . domain . ResourceSortCriteria sut = new org . eurekastreams . server . domain . ResourceSortCriteria ( ) ; java . util . List < org . eurekastreams . server . domain . ResourceSortCriterion > criteriaList = new java . util . ArrayList < org . eurekastreams . server . domain . ResourceSortCriterion > ( ) ; sut = new org . eurekastreams . server . domain . ResourceSortCriteria ( criteriaList ) ; "<AssertPlaceHolder>" ; } getCriteria ( ) { return criteria ; }
org . junit . Assert . assertSame ( criteriaList , sut . getCriteria ( ) )
testFormsBinaries ( ) { java . util . Date fixedDate = new java . util . Date ( ) ; org . camunda . bpm . engine . impl . util . ClockUtil . setCurrentTime ( fixedDate ) ; java . lang . String deploymentId = testRule . deploy ( "org/camunda/bpm/engine/test/api/form/DeployedFormsProcess.bpmn20.xml" , "org/camunda/bpm/engine/test/api/form/start.form" , "org/camunda/bpm/engine/test/api/form/task.form" , "org/camunda/bpm/engine/test/api/authorization/renderedFormProcess.bpmn20.xml" , "org/camunda/bpm/engine/test/api/authorization/oneTaskCase.cmmn" ) . getId ( ) ; java . util . List < org . camunda . bpm . engine . repository . Resource > deploymentResources = repositoryService . getDeploymentResources ( deploymentId ) ; "<AssertPlaceHolder>" ; for ( org . camunda . bpm . engine . repository . Resource resource : deploymentResources ) { org . camunda . bpm . engine . impl . persistence . entity . ResourceEntity entity = ( ( org . camunda . bpm . engine . impl . persistence . entity . ResourceEntity ) ( resource ) ) ; checkEntity ( fixedDate , entity ) ; } } size ( ) { return ( ( ( historicProcessInstanceIds . size ( ) ) + ( historicDecisionInstanceIds . size ( ) ) ) + ( historicCaseInstanceIds . size ( ) ) ) + ( historicBatchIds . size ( ) ) ; }
org . junit . Assert . assertEquals ( 5 , deploymentResources . size ( ) )
shouldNotMatchIfFileContentChanged ( ) { net . ripe . rpki . commons . crypto . cms . manifest . ManifestCms mft = net . ripe . rpki . commons . crypto . cms . manifest . ManifestCmsTest . getRootManifestCms ( ) ; java . util . Map < java . lang . String , byte [ ] > wrongFiles = new java . util . HashMap < java . lang . String , byte [ ] > ( net . ripe . rpki . commons . crypto . cms . manifest . ManifestCmsTest . files ) ; wrongFiles . put ( "filename2" , net . ripe . rpki . commons . crypto . cms . manifest . ManifestCmsTest . FILE1_CONTENTS ) ; "<AssertPlaceHolder>" ; } matchesFiles ( java . util . Map ) { if ( hashes . keySet ( ) . equals ( filesToMatch . keySet ( ) ) ) { for ( java . util . Map . Entry < java . lang . String , byte [ ] > entry : hashes . entrySet ( ) ) { java . lang . String fileName = entry . getKey ( ) ; byte [ ] contentToMatch = filesToMatch . get ( fileName ) ; if ( ! ( verifyFileContents ( fileName , contentToMatch ) ) ) { return false ; } } return true ; } else { return false ; } }
org . junit . Assert . assertFalse ( mft . matchesFiles ( wrongFiles ) )
testEos ( ) { try { org . talend . dq . dbms . DbmsLanguage dbms = getMysqlDbmsLanguage ( ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } eos ( ) { return org . talend . dq . dbms . DbmsLanguage . EOS ; }
org . junit . Assert . assertNotNull ( dbms . eos ( ) )
testResourceLoading_noLeadingTrailing ( ) { java . net . URL url = org . reficio . ws . common . ResourceUtils . getResourceWithAbsolutePackagePath ( org . reficio . ws . common . System . class , "org/reficio/ws/common/test" , "soapEncoding.xsd" ) ; "<AssertPlaceHolder>" ; } getResourceWithAbsolutePackagePath ( java . lang . Class , java . lang . String , java . lang . String ) { checkNotNull ( clazz , "clazz<sp>cannot<sp>be<sp>null" ) ; java . lang . String resourcePath = org . reficio . ws . common . ResourceUtils . getResourcePath ( absolutePackagePath , resourceName ) ; java . net . URL resource = null ; resource = clazz . getClass ( ) . getResource ( resourcePath ) ; if ( resource == null ) { if ( ( resourcePath . charAt ( 0 ) ) == '/' ) { java . lang . String resourcePathWithoutLeadingSlash = resourcePath . substring ( 1 ) ; resource = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( resourcePathWithoutLeadingSlash ) ; } } checkArgument ( ( resource != null ) , java . lang . String . format ( "Resource<sp>[%s]<sp>loading<sp>failed" , resourcePath ) ) ; return resource ; }
org . junit . Assert . assertNotNull ( url )
testFields ( ) { java . lang . String inputPath = com . couchbase . jdbc . TestUtil . getRQGFieldsDir ( ) ; com . couchbase . jdbc . TestResultAnalysis analysis = com . couchbase . jdbc . JDBCTestUtils . runTestsWithFieldProjectionQueries ( TestUtil . clusterInfo , inputPath ) ; "<AssertPlaceHolder>" ; } isTestPassing ( ) { if ( ( this . totalQueries ) == ( this . totalPassResults ) ) { return true ; } return false ; }
org . junit . Assert . assertTrue ( analysis . isTestPassing ( ) )
xmldbURIRelativizeCollectionName2 ( ) { org . exist . xmldb . XmldbURI xmldbURI = org . exist . xmldb . XmldbURI . xmldbUriFor ( "xmldb:exist://localhost:8080/xmlrpc/db/collection" ) ; java . net . URI uri = new java . net . URI ( "/db/db/collection" ) ; "<AssertPlaceHolder>" ; } relativizeCollectionPath ( java . net . URI ) { if ( uri == null ) { throw new java . lang . NullPointerException ( "The<sp>provided<sp>URI<sp>is<sp>null" ) ; } final java . lang . String collectionPath = this . encodedCollectionPath ; if ( collectionPath == null ) { throw new java . lang . NullPointerException ( "The<sp>current<sp>collection<sp>path<sp>is<sp>null" ) ; } java . net . URI collectionPathURI ; if ( ! ( collectionPath . endsWith ( "/" ) ) ) { org . exist . xmldb . XmldbURI . LOG . info ( ( ( "Added<sp>a<sp>final<sp>'/'<sp>to<sp>'" + collectionPath ) + "'" ) ) ; collectionPathURI = java . net . URI . create ( ( collectionPath + "/" ) ) ; } else { collectionPathURI = java . net . URI . create ( collectionPath ) ; } return collectionPathURI . relativize ( uri ) ; }
org . junit . Assert . assertEquals ( "/db/db/collection" , xmldbURI . relativizeCollectionPath ( uri ) . toString ( ) )
happyCaseUsingAction ( ) { final java . math . BigDecimal newCost = new java . math . BigDecimal ( "123.45" ) ; toDoItem . updateCost ( newCost ) ; "<AssertPlaceHolder>" ; } getCost ( ) { return cost ; }
org . junit . Assert . assertThat ( toDoItem . getCost ( ) , org . hamcrest . CoreMatchers . is ( newCost ) )
testEvaluationPhraseTermOverlapPass2 ( ) { java . lang . String query = buildFunction ( phraseFunction , Constants . TERM_OFFSET_MAP_JEXL_VARIABLE_NAME , "'cat'" , "'rat'" , "'dog'" ) ; org . apache . commons . jexl2 . Expression expr = datawave . query . jexl . functions . ContentFunctionsTest . engine . createExpression ( query ) ; java . util . List < datawave . ingest . protobuf . TermWeightPosition > list1 ; java . util . List < datawave . ingest . protobuf . TermWeightPosition > list2 ; java . util . List < datawave . ingest . protobuf . TermWeightPosition > list3 ; list1 = asList ( 1 ) ; list2 = asList ( 1 ) ; list3 = asList ( 2 ) ; termOffSetMap . put ( "cat" , new datawave . query . jexl . functions . TermFrequencyList ( com . google . common . collect . Maps . immutableEntry ( new datawave . query . jexl . functions . TermFrequencyList . Zone ( "CONTENT" , true , eventId ) , list1 ) ) ) ; termOffSetMap . put ( "rat" , new datawave . query . jexl . functions . TermFrequencyList ( com . google . common . collect . Maps . immutableEntry ( new datawave . query . jexl . functions . TermFrequencyList . Zone ( "CONTENT" , true , eventId ) , list2 ) ) ) ; termOffSetMap . put ( "dog" , new datawave . query . jexl . functions . TermFrequencyList ( com . google . common . collect . Maps . immutableEntry ( new datawave . query . jexl . functions . TermFrequencyList . Zone ( "CONTENT" , true , eventId ) , list3 ) ) ) ; context . set ( Constants . TERM_OFFSET_MAP_JEXL_VARIABLE_NAME , termOffSetMap ) ; java . lang . Object o = expr . evaluate ( context ) ; "<AssertPlaceHolder>" ; } expect ( java . lang . Object , java . lang . Boolean ) { if ( null == result ) { return Boolean . FALSE . equals ( expected ) ; } if ( result instanceof java . lang . Boolean ) { return result . equals ( expected ) ; } return false ; }
org . junit . Assert . assertTrue ( datawave . query . jexl . functions . ContentFunctionsTest . expect ( o , true ) )
testDivisionCache ( ) { for ( int i = 1 ; i < 100 ; i ++ ) { org . eclipse . recommenders . jayes . factor . opcache . DivisionCache cache = new org . eclipse . recommenders . jayes . factor . opcache . DivisionCache ( i ) ; for ( int j = 0 ; j < 100 ; j ++ ) { "<AssertPlaceHolder>" ; } } } apply ( int ) { if ( ( divisor ) == 1 ) { return arg ; } if ( isInCache ( arg ) ) { return cachedResult ; } cachedResult = arg / ( divisor ) ; cachedBlockStart = ( cachedResult ) * ( divisor ) ; return cachedResult ; }
org . junit . Assert . assertEquals ( ( j / i ) , cache . apply ( j ) )
testAncestorsQuery ( ) { owltools . graph . OWLGraphWrapper g = getOntologyWrapper ( ) ; org . semanticweb . owlapi . model . OWLClass c = g . getOWLClass ( "http://purl.obolibrary.org/obo/NCBITaxon_10090" ) ; org . semanticweb . owlapi . model . OWLObject i = g . getOWLObject ( "http://purl.obolibrary.org/obo/MGI_101761" ) ; boolean ok = false ; for ( owltools . graph . OWLGraphEdge e : g . getOutgoingEdgesClosureReflexive ( i ) ) { System . out . println ( ( ( ( "i:" + e ) + "<sp>" ) + ( e . getTarget ( ) . getClass ( ) ) ) ) ; if ( e . getTarget ( ) . equals ( c ) ) ok = true ; } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( obj instanceof owltools . gaf . ExtensionExpression ) == false ) return false ; owltools . gaf . ExtensionExpression other = ( ( owltools . gaf . ExtensionExpression ) ( obj ) ) ; if ( ( cls ) == null ) { if ( ( other . cls ) != null ) return false ; } else if ( ! ( cls . equals ( other . cls ) ) ) return false ; if ( ( relation ) == null ) { if ( ( other . relation ) != null ) return false ; } else if ( ! ( relation . equals ( other . relation ) ) ) return false ; return true ; }
org . junit . Assert . assertTrue ( ok )
testGetFileName_returnsEmptyStringWhenCanceled ( ) { dialog . shell . close ( ) ; "<AssertPlaceHolder>" ; } getFileName ( ) { java . lang . String [ ] fileNames = getFileNames ( ) ; return ( fileNames . length ) == 0 ? "" : fileNames [ 0 ] ; }
org . junit . Assert . assertEquals ( "" , dialog . getFileName ( ) )
Property ( ) { java . lang . String testENTITY = "testEntity" ; org . odata4j . edm . EdmEntityType . Builder entityType = EntityType ( testENTITY ) ; EntityTypesimpleProperty ( 399 , entityType ) ; org . odata4j . edm . EdmDataServices . Builder builder = org . odata4j . edm . EdmDataServices . newBuilder ( ) ; org . odata4j . edm . EdmSchema . Builder schema = org . odata4j . edm . EdmSchema . newBuilder ( ) . addEntityTypes ( entityType ) . setNamespace ( com . fujitsu . dc . test . unit . core . model . impl . es . odata . PropertyLimitCheckerTest . NS ) ; org . odata4j . edm . EdmDataServices metadata = builder . addSchemas ( schema ) . build ( ) ; com . fujitsu . dc . core . model . impl . es . doc . PropertyDocHandler handler = new com . fujitsu . dc . core . model . impl . es . doc . PropertyDocHandler ( ) ; org . json . simple . JSONObject staticFields = new org . json . simple . JSONObject ( ) ; staticFields . put ( "Type" , "Edm.String" ) ; handler . setStaticFields ( staticFields ) ; java . util . Map < java . lang . String , java . lang . String > entityTypeMap = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; entityTypeMap . put ( "_EntityType.Name_uniqueKey" , testENTITY ) ; handler . setEntityTypeMap ( entityTypeMap ) ; handler . setEntityTypeId ( "_uniqueKey" ) ; java . util . Map < java . lang . String , java . lang . Object > manyToOneKindMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; manyToOneKindMap . put ( EntityType . EDM_TYPE_NAME , "_uniqueKey" ) ; handler . setManyToOnelinkId ( manyToOneKindMap ) ; com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker checker = new com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker ( metadata , handler ) ; java . util . List < com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError > errors = checker . checkPropertyLimits ( ) ; "<AssertPlaceHolder>" ; } checkPropertyLimits ( ) { java . util . List < com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError > result = new java . util . ArrayList < com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError > ( ) ; if ( null == ( metadata ) ) { return result ; } java . util . Iterator < org . odata4j . edm . EdmEntityType > iter = metadata . getEntityTypes ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { org . odata4j . edm . EdmEntityType target = iter . next ( ) ; checkPropertyLimitsForEntityTypeInternal ( result , target ) ; } java . util . Iterator < org . odata4j . edm . EdmComplexType > complexTypeIter = metadata . getComplexTypes ( ) . iterator ( ) ; while ( complexTypeIter . hasNext ( ) ) { int simplePropCount = 0 ; int complexPropCount = 0 ; org . odata4j . edm . EdmComplexType complexType = complexTypeIter . next ( ) ; for ( org . odata4j . edm . EdmProperty prop : complexType . getProperties ( ) ) { if ( prop . getName ( ) . startsWith ( "_" ) ) { continue ; } if ( prop . getType ( ) . isSimple ( ) ) { simplePropCount ++ ; } else { complexPropCount ++ ; } } if ( ( simpleMaxForOverAllLayers ) < simplePropCount ) { java . lang . String message = java . lang . String . format ( "Total<sp>property[%s]<sp>count<sp>exceeds<sp>the<sp>limit[%d]." , complexType . getName ( ) , simpleMaxForOverAllLayers ) ; com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . log . info ( message ) ; result . add ( new com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError ( complexType . getName ( ) , message ) ) ; } if ( ( complexMaxForOverallLayers ) < complexPropCount ) { java . lang . String message = java . lang . String . format ( "Total<sp>property[%s]<sp>count<sp>exceeds<sp>the<sp>limit[%d]." , complexType . getName ( ) , complexMaxForOverallLayers ) ; com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . log . info ( message ) ; result . add ( new com . fujitsu . dc . core . model . impl . es . odata . PropertyLimitChecker . CheckError ( complexType . getName ( ) , message ) ) ; } } return result ; }
org . junit . Assert . assertEquals ( 0 , errors . size ( ) )
testIsConfigChangedSizes ( ) { org . eclipse . kura . net . admin . monitor . EthernetMonitorServiceImpl svc = new org . eclipse . kura . net . admin . monitor . EthernetMonitorServiceImpl ( ) ; java . util . List < org . eclipse . kura . net . NetInterfaceAddressConfig > newConfig = new java . util . ArrayList ( ) ; java . util . List < org . eclipse . kura . net . NetInterfaceAddressConfig > currentConfig = new java . util . ArrayList ( ) ; newConfig . add ( null ) ; boolean result = ( ( boolean ) ( org . eclipse . kura . core . testutil . TestUtil . invokePrivate ( svc , "isConfigChanged" , newConfig , currentConfig ) ) ) ; "<AssertPlaceHolder>" ; } invokePrivate ( java . lang . Object , java . lang . String , org . eclipse . kura . core . testutil . Class [ ] , java . lang . Object [ ] ) { java . lang . reflect . Method method = org . eclipse . kura . core . testutil . TestUtil . getMethod ( svc , methodName , paramTypes ) ; method . setAccessible ( true ) ; try { java . lang . Object result = method . invoke ( svc , params ) ; return result ; } catch ( java . lang . IllegalAccessException e ) { org . eclipse . kura . core . testutil . TestUtil . logger . warn ( e . getMessage ( ) , e ) ; } catch ( java . lang . IllegalArgumentException e ) { org . eclipse . kura . core . testutil . TestUtil . logger . warn ( e . getMessage ( ) , e ) ; } catch ( java . lang . reflect . InvocationTargetException e ) { throw e . getCause ( ) ; } return null ; }
org . junit . Assert . assertTrue ( result )
extractIncompatibleColorProfileTest ( ) { com . itextpdf . io . image . ImageData imageData = com . itextpdf . io . image . ImageDataFactory . create ( ( ( com . itextpdf . layout . ImageColorProfileTest . sourceFolder ) + "png-incorrect-embedded-color-profile.png" ) ) ; "<AssertPlaceHolder>" ; } getProfile ( ) { return profile ; }
org . junit . Assert . assertNotNull ( imageData . getProfile ( ) )
testNullExceptionPassing ( ) { exceptionContext = new org . apache . commons . lang3 . exception . ContextedRuntimeException ( TEST_MESSAGE_2 , new java . lang . Exception ( TEST_MESSAGE ) , null ) . addContextValue ( "test1" , null ) . addContextValue ( "test2" , "some<sp>value" ) . addContextValue ( "test<sp>Date" , new java . util . Date ( ) ) . addContextValue ( "test<sp>Nbr" , java . lang . Integer . valueOf ( 5 ) ) . addContextValue ( "test<sp>Poorly<sp>written<sp>obj" , new org . apache . commons . lang3 . exception . ObjectWithFaultyToString ( ) ) ; final java . lang . String message = exceptionContext . getMessage ( ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; }
org . junit . Assert . assertTrue ( ( message != null ) )
valueIsObtainedFromEnvironmentProperty ( ) { java . util . Properties environment = new java . util . Properties ( ) ; environment . setProperty ( "PROPERTY" , "env.value" ) ; java . util . Properties properties = new java . util . Properties ( ) ; properties . setProperty ( "p1" , "${env.PROPERTY}" ) ; java . lang . String value = resolver . getPropertyValue ( "p1" , properties , environment ) ; "<AssertPlaceHolder>" ; } getPropertyValue ( java . lang . String , java . util . Properties , java . util . Properties ) { try { return resolver . getPropertyValue ( k , p , environment ) ; } catch ( java . lang . IllegalArgumentException e ) { throw new org . apache . maven . plugin . MojoFailureException ( e . getMessage ( ) ) ; } }
org . junit . Assert . assertEquals ( "env.value" , value )
testGet ( ) { for ( org . sagebionetworks . repo . model . AccessControlList acl : aclList ) { java . lang . String id = acl . getId ( ) ; org . sagebionetworks . repo . model . AccessControlList acl2 = aclDAO . get ( id , ObjectType . ENTITY ) ; "<AssertPlaceHolder>" ; } } get ( org . sagebionetworks . repo . model . UserInfo , java . lang . String ) { org . sagebionetworks . repo . model . MembershipRequest mr = membershipRequestDAO . get ( id ) ; org . sagebionetworks . repo . manager . AuthorizationStatus status = authorizationManager . canAccessMembershipRequest ( userInfo , mr , ACCESS_TYPE . READ ) ; if ( ! ( status . getAuthorized ( ) ) ) { throw new org . sagebionetworks . repo . model . UnauthorizedException ( status . getReason ( ) ) ; } return mr ; }
org . junit . Assert . assertEquals ( acl , acl2 )
testPoints ( ) { org . springframework . mock . web . MockHttpServletResponse resp = getAsServletResponse ( "wfs?request=GetFeature&version=1.1.0&typeName=Points&outputFormat=dxf" ) ; java . lang . String sResponse = testBasicResult ( resp , "Points" ) ; int pos = getGeometrySearchStart ( sResponse ) ; "<AssertPlaceHolder>" ; checkSequence ( sResponse , new java . lang . String [ ] { "POINT" } , pos ) ; } getGeometrySearchStart ( java . lang . String ) { return response . indexOf ( "BLOCKS" ) ; }
org . junit . Assert . assertTrue ( ( pos != ( - 1 ) ) )
testFindAllByType ( ) { java . lang . String type = "typeA" ; org . oscarehr . common . model . DataExport de1 = new org . oscarehr . common . model . DataExport ( ) ; java . sql . Timestamp ts1 = new java . sql . Timestamp ( 1000 ) ; de1 . setDaterun ( ts1 ) ; de1 . setType ( type ) ; org . oscarehr . common . model . DataExport de2 = new org . oscarehr . common . model . DataExport ( ) ; java . sql . Timestamp ts2 = new java . sql . Timestamp ( 2000 ) ; de2 . setDaterun ( ts2 ) ; de2 . setType ( "typeB" ) ; org . oscarehr . common . model . DataExport de3 = new org . oscarehr . common . model . DataExport ( ) ; java . sql . Timestamp ts3 = new java . sql . Timestamp ( 1500 ) ; de3 . setDaterun ( ts3 ) ; de3 . setType ( type ) ; dao . persist ( de1 ) ; dao . persist ( de2 ) ; dao . persist ( de3 ) ; java . util . List < org . oscarehr . common . model . DataExport > result = dao . findAllByType ( type ) ; java . util . List < org . oscarehr . common . model . DataExport > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . DataExport > ( java . util . Arrays . asList ( de1 , de3 ) ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>not<sp>sorted<sp>by<sp>DateRun." ) ; org . junit . Assert . fail ( "Items<sp>not<sp>sorted<sp>by<sp>DateRun." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } }
org . junit . Assert . assertTrue ( true )
shouldInvokeLoadTwoTimesForDifferentKeys ( ) { final java . util . concurrent . atomic . AtomicInteger count = createSlowCountingDecorator ( ) ; final java . lang . String key1 = "key1" ; final java . lang . String key2 = "key2" ; executor . execute ( getRunnableForKey ( key1 ) ) ; executor . execute ( getRunnableForKey ( key1 ) ) ; executor . execute ( getRunnableForKey ( key2 ) ) ; executor . execute ( getRunnableForKey ( key1 ) ) ; executor . execute ( getRunnableForKey ( key2 ) ) ; executor . execute ( getRunnableForKey ( key1 ) ) ; executor . execute ( getRunnableForKey ( key2 ) ) ; executor . execute ( getRunnableForKey ( key1 ) ) ; awaitTermination ( ) ; "<AssertPlaceHolder>" ; } get ( ) { final int c = in . read ( ) ; if ( ( ( c >= '<sp>' ) || ( c == '\n' ) ) || ( c == ( ro . isdc . wro . model . resource . processor . support . JSMin . EOF ) ) ) { return c ; } if ( c == '\r' ) { return '\n' ; } return '<sp>' ; }
org . junit . Assert . assertEquals ( 2 , count . get ( ) )
testClosing_4x4 ( ) { ij . process . ImageProcessor image = createImage_Square10x10 ( ) ; inra . ijpb . morphology . Strel strel = new inra . ijpb . morphology . strel . OctagonStrel ( 4 ) ; ij . process . ImageProcessor result = strel . closing ( image ) ; for ( int y = 0 ; y < ( image . getHeight ( ) ) ; y ++ ) { for ( int x = 0 ; x < ( image . getWidth ( ) ) ; x ++ ) { "<AssertPlaceHolder>" ; } } } get ( int , int ) { if ( x < 0 ) return ( ( int ) ( this . value ) ) ; if ( y < 0 ) return ( ( int ) ( this . value ) ) ; if ( x >= ( this . image . getWidth ( ) ) ) return ( ( int ) ( this . value ) ) ; if ( y >= ( this . image . getHeight ( ) ) ) return ( ( int ) ( this . value ) ) ; return this . image . get ( x , y ) ; }
org . junit . Assert . assertEquals ( image . get ( x , y ) , result . get ( x , y ) )
shouldGenerateCorrectSqlForMathOperations11 ( ) { java . lang . String result = testDialect . getSqlFrom ( org . alfasoftware . morf . sql . SqlUtils . bracket ( org . alfasoftware . morf . sql . SqlUtils . field ( "a" ) . divideBy ( org . alfasoftware . morf . sql . SqlUtils . literal ( 100 ) ) . plus ( org . alfasoftware . morf . sql . SqlUtils . literal ( 1 ) ) ) . divideBy ( org . alfasoftware . morf . sql . SqlUtils . field ( "b" ) ) . plus ( org . alfasoftware . morf . sql . SqlUtils . literal ( 100 ) ) ) ; "<AssertPlaceHolder>" ; } expectedSqlForMathOperations11 ( ) { return "(a<sp>/<sp>100<sp>+<sp>1)<sp>/<sp>b<sp>+<sp>100" ; }
org . junit . Assert . assertEquals ( expectedSqlForMathOperations11 ( ) , result )
testGetMaximizeSessionSheetOnOpen ( ) { classUnderTest . setMaximizeSessionSheetOnOpen ( true ) ; "<AssertPlaceHolder>" ; } getMaximizeSessionSheetOnOpen ( ) { return _maxSessionSheetOnOpen ; }
org . junit . Assert . assertEquals ( true , classUnderTest . getMaximizeSessionSheetOnOpen ( ) )
equals_A$Object_false ( ) { java . lang . String value = "vvv" ; com . m3 . scalaflavor4j . Some < java . lang . String > target = new com . m3 . scalaflavor4j . Some < java . lang . String > ( value ) ; java . lang . Object obj = new com . m3 . scalaflavor4j . Some < java . lang . String > ( "bar" ) ; boolean actual = target . equals ( obj ) ; boolean expected = false ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return obj instanceof com . m3 . scalaflavor4j . None < ? > ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
testNothing ( ) { org . eclipse . collections . api . list . ImmutableList < com . gs . obevo . api . appdata . ArtifactRestrictions > restrictions = this . restrictionsReader . valueOf ( this . doc ( null , "regularContent" , null ) ) ; "<AssertPlaceHolder>" ; } doc ( java . lang . String , java . lang . String , org . eclipse . collections . api . map . ImmutableMap ) { return new com . gs . obevo . api . appdata . doc . TextMarkupDocumentSection ( sectionName , sectionContent , attrs ) ; }
org . junit . Assert . assertTrue ( restrictions . isEmpty ( ) )
startBillingRun_TerminatedSubscriptionInsideBillingPeriod ( ) { final long invocationTime = defineInvocationTime ( "2012-06-05<sp>14:00:00" ) ; final int billingRunOffsetInDays = 2 ; setBillingRunOffset ( billingRunOffsetInDays ) ; final int cutOffDay = 3 ; org . oscm . domobjects . Subscription subscription = createSubscription ( "2012-05-10<sp>12:00:00" , cutOffDay , product ) ; terminateSubscription ( subscription . getKey ( ) , "2012-05-15<sp>12:00:00" ) ; boolean result = startBillingRun ( invocationTime ) ; "<AssertPlaceHolder>" ; verifyBillingRun ( invocationTime , 1 ) ; long startOfPeriod = calculateMillis ( "2012-05-03<sp>00:00:00" ) ; long endOfPeriodxx = calculateMillis ( "2012-06-03<sp>00:00:00" ) ; java . math . BigDecimal expectedGrossAmount = new java . math . BigDecimal ( ( 5 * 24 ) ) . multiply ( org . oscm . billingservice . service . BillingServiceBeanStartBillingRunIT . PRICE_PER_HOUR ) ; expectedGrossAmount = expectedGrossAmount . add ( org . oscm . billingservice . service . BillingServiceBeanStartBillingRunIT . ONE_TIME_FEE ) ; checkBillingResult ( subscription . getKey ( ) , customerOrg . getKey ( ) , startOfPeriod , endOfPeriodxx , expectedGrossAmount ) ; } startBillingRun ( java . lang . String ) { java . lang . String result ; try { boolean status = ejbClientFacade . startBillingRun ( getCurrentTime ( currentDate ) ) ; result = "BillingService.startBillingRun<sp>successful<sp>executed.\nReturn<sp>state<sp>is<sp>" + status ; } catch ( java . text . ParseException e ) { result = "BillingService.startBillingRun<sp>failed.\nReason:\nThe<sp>format<sp>for<sp>currentDate<sp>is<sp>" + ( org . oscm . jmx . internal . mbean . StartBillingRun . DATE_FORMAT . toUpperCase ( ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; result = "BillingService.startBillingRun<sp>failed.\nException:\n" + e ; } return result ; }
org . junit . Assert . assertTrue ( result )
testGetColumns ( ) { java . sql . Statement stmt = com . aliyun . odps . jdbc . TestManager . getInstance ( ) . conn . createStatement ( ) ; stmt . executeUpdate ( "drop<sp>table<sp>if<sp>exists<sp>dual;" ) ; stmt . executeUpdate ( "create<sp>table<sp>if<sp>not<sp>exists<sp>dual(id<sp>bigint);" ) ; stmt . close ( ) ; java . sql . ResultSet rs = com . aliyun . odps . jdbc . OdpsDatabaseMetaDataTest . databaseMetaData . getColumns ( null , null , "dual" , null ) ; "<AssertPlaceHolder>" ; printRs ( rs ) ; rs . close ( ) ; } getColumns ( java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { long begin = java . lang . System . currentTimeMillis ( ) ; if ( tableNamePattern == null ) { throw new java . sql . SQLException ( "SQL_DATETIME_SUB" 5 ) ; } java . util . List < java . lang . Object [ ] > rows = new java . util . ArrayList < java . lang . Object [ ] > ( ) ; if ( ( ( ( tableNamePattern != null ) && ( ! ( tableNamePattern . trim ( ) . isEmpty ( ) ) ) ) && ( ! ( tableNamePattern . trim ( ) . equals ( "%" ) ) ) ) && ( ! ( tableNamePattern . trim ( ) . equals ( "%" 3 ) ) ) ) { try { com . aliyun . odps . Table table ; if ( com . aliyun . odps . utils . StringUtils . isNullOrEmpty ( schemaPattern ) ) { table = conn . getOdps ( ) . tables ( ) . get ( tableNamePattern ) ; } else { table = conn . getOdps ( ) . tables ( ) . get ( schemaPattern , tableNamePattern ) ; } table . reload ( ) ; java . util . List < com . aliyun . odps . Column > columns = table . getSchema ( ) . getColumns ( ) ; for ( int i = 0 ; i < ( columns . size ( ) ) ; i ++ ) { com . aliyun . odps . Column col = columns . get ( i ) ; com . aliyun . odps . jdbc . utils . JdbcColumn jdbcCol = new com . aliyun . odps . jdbc . utils . JdbcColumn ( col . getName ( ) , tableNamePattern , null , col . getType ( ) , col . getTypeInfo ( ) , col . getComment ( ) , ( i + 1 ) ) ; java . lang . Object [ ] rowVals = new java . lang . Object [ ] { null , jdbcCol . getTableSchema ( ) , jdbcCol . getTableName ( ) , jdbcCol . getColumnName ( ) , ( ( long ) ( jdbcCol . getType ( ) ) ) , jdbcCol . getTypeName ( ) , null , null , ( ( long ) ( jdbcCol . getDecimalDigits ( ) ) ) , ( ( long ) ( jdbcCol . getNumPercRaidx ( ) ) ) , ( ( long ) ( jdbcCol . getIsNullable ( ) ) ) , jdbcCol . getComment ( ) , null , null , null , null , ( ( long ) ( jdbcCol . getOrdinalPos ( ) ) ) , jdbcCol . getIsNullableString ( ) , null , null , null , null } ; rows . add ( rowVals ) ; } } catch ( com . aliyun . odps . OdpsException e ) { throw new java . sql . SQLException ( ( ( ( ( ( ( ( "%" 0 + catalog ) + "SQL_DATETIME_SUB" 7 ) + schemaPattern ) + "SQL_DATETIME_SUB" 3 ) + tableNamePattern ) + "%" 1 ) + columnNamePattern ) , e ) ; } } long end = java . lang . System . currentTimeMillis ( ) ; log . debug ( ( ( ( ( "It<sp>took<sp>me<sp>" + ( end - begin ) ) + "SQL_DATETIME_SUB" 0 ) + ( rows . size ( ) ) ) + "%" 4 ) ) ; com . aliyun . odps . jdbc . OdpsResultSetMetaData meta = new com . aliyun . odps . jdbc . OdpsResultSetMetaData ( java . util . Arrays . asList ( "SQL_DATETIME_SUB" 8 , "SQL_DATETIME_SUB" 1 , "TABLE_NAME" , "It<sp>took<sp>me<sp>" 1 , "%" 2 , "TYPE_NAME" , "SQL_DATETIME_SUB" 4 , "%" 7 , "SQL_DATETIME_SUB" 6 , "%" 8 , "%" 5 , "REMARKS" , "%" 6 , "SQL_DATA_TYPE" , "SQL_DATETIME_SUB" , "%" 9 , "SQL_DATETIME_SUB" 9 , "SQL_DATETIME_SUB" 2 , "SCOPE_CATALOG" , "SCOPE_SCHEMA" , "It<sp>took<sp>me<sp>" 0 , "SOURCE_DATA_TYPE" ) , java . util . Arrays . asList ( TypeInfoFactory . STRING , TypeInfoFactory . STRING , TypeInfoFactory . STRING , TypeInfoFactory . STRING , TypeInfoFactory . BIGINT , TypeInfoFactory . STRING , TypeInfoFactory . BIGINT , TypeInfoFactory . BIGINT , TypeInfoFactory . BIGINT , TypeInfoFactory . BIGINT , TypeInfoFactory . BIGINT , TypeInfoFactory . STRING , TypeInfoFactory . STRING , TypeInfoFactory . BIGINT , TypeInfoFactory . BIGINT , TypeInfoFactory . BIGINT , TypeInfoFactory . BIGINT , TypeInfoFactory . STRING , TypeInfoFactory . STRING , TypeInfoFactory . STRING , TypeInfoFactory . STRING , TypeInfoFactory . BIGINT ) ) ; return new com . aliyun . odps . jdbc . OdpsStaticResultSet ( getConnection ( ) , meta , rows . iterator ( ) ) ; }
org . junit . Assert . assertNotNull ( rs )
testLoadWithData ( ) { name . dlazerka . gm . basic . BasicGraph expected = new name . dlazerka . gm . basic . BasicGraph ( ) ; name . dlazerka . gm . basic . BasicVertex vertex0 = expected . createVertex ( "0" ) ; name . dlazerka . gm . basic . BasicVertex vertex1 = expected . createVertex ( "1" ) ; name . dlazerka . gm . basic . BasicVertex vertex2 = expected . createVertex ( "2" ) ; name . dlazerka . gm . basic . BasicVertex vertex3 = expected . createVertex ( "3" ) ; name . dlazerka . gm . basic . BasicVertex vertex4 = expected . createVertex ( "4" ) ; name . dlazerka . gm . basic . BasicVertex vertex5 = expected . createVertex ( "5" ) ; expected . createEdge ( vertex0 , vertex2 ) ; expected . createEdge ( vertex0 , vertex1 ) ; expected . createEdge ( vertex1 , vertex3 ) ; expected . createEdge ( vertex3 , vertex2 ) ; expected . createEdge ( vertex2 , vertex4 ) ; expected . createEdge ( vertex3 , vertex5 ) ; expected . createEdge ( vertex5 , vertex4 ) ; java . io . File file = new java . io . File ( name . dlazerka . gm . shell . store . GraphmlStorerTest . xmlSourceWithData . toURI ( ) ) ; name . dlazerka . gm . basic . BasicGraph actual = name . dlazerka . gm . shell . store . GraphmlStorer . load ( file ) ; "<AssertPlaceHolder>" ; } load ( java . io . File ) { try { name . dlazerka . gm . shell . store . GraphmlStorer . logger . info ( "Loading<sp>graph<sp>from<sp>{}" , source . getCanonicalPath ( ) ) ; java . io . FileReader fileReader = new java . io . FileReader ( source ) ; java . io . BufferedReader reader = new java . io . BufferedReader ( fileReader ) ; name . dlazerka . gm . basic . BasicGraph graph = name . dlazerka . gm . shell . store . GraphmlStorer . load ( reader ) ; name . dlazerka . gm . shell . store . GraphmlStorer . logger . info ( "Graph<sp>loaded" ) ; return graph ; } catch ( java . io . IOException e ) { throw new name . dlazerka . gm . shell . store . GraphLoadingException ( e ) ; } }
org . junit . Assert . assertEquals ( expected , actual )
equals_sameInstance_true ( ) { javax . jcr . Property property = mockProperty ( "myValue" , "/base/path/relative/path/jcr:content" , "propertyName" ) ; com . adobe . acs . commons . wcm . comparisons . impl . PageCompareDataLineImpl underTest = new com . adobe . acs . commons . wcm . comparisons . impl . PageCompareDataLineImpl ( property , "/base/path" , 1 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj instanceof com . adobe . acs . commons . wcm . ComponentEditType . Type ) { return this . equals ( ( ( com . adobe . acs . commons . wcm . ComponentEditType . Type ) ( obj ) ) ) ; } return false ; }
org . junit . Assert . assertTrue ( underTest . equals ( underTest ) )
shouldAddIngredientToDrug ( ) { int before = service . getDrugByUuid ( drugUuid ) . getIngredients ( ) . size ( ) ; java . lang . String json = "{<sp>\"ingredient\":\"0abca361-f6bf-49cc-97de-b2f37f099dde\",<sp>\"strength\":4.0,<sp>\"units\":\"0955b484-b364-43dd-909b-1fa3655eaad2\"}" ; handle ( newPostRequest ( getURI ( ) , json ) ) ; int after = service . getDrugByUuid ( drugUuid ) . getIngredients ( ) . size ( ) ; "<AssertPlaceHolder>" ; } getURI ( ) { return "orderfrequency" ; }
org . junit . Assert . assertEquals ( ( before + 1 ) , after )
testGetPort ( ) { System . out . println ( "getPort" ) ; java . lang . String expResult = "53" ; java . lang . String result = instance . getPort ( ) ; "<AssertPlaceHolder>" ; } getPort ( ) { return port ; }
org . junit . Assert . assertEquals ( expResult , result )
testUserConnectionWithInvalidPassword ( ) { final java . lang . Process mosquitto = startMosquitto ( "src/test/resources/mosquitto/mosquitto_specified_users.conf" ) ; final pl . baczkowicz . mqttspy . common . generated . MqttConnectionDetails connectionDetails = createMqttConnectionDetails ( "tcp://localhost:10002" , new pl . baczkowicz . spy . common . generated . UserCredentials ( "test1" , "blabla" ) , null ) ; final pl . baczkowicz . mqttspy . connectivity . SimpleMqttConnection connection = new pl . baczkowicz . mqttspy . connectivity . SimpleMqttConnection ( reconnectionManager , "0" , connectionDetails ) ; connection . createClient ( createTestCallback ( "tcp://localhost:10002" ) ) ; "<AssertPlaceHolder>" ; java . lang . Thread . sleep ( 1000 ) ; stopProcess ( mosquitto ) ; java . lang . Thread . sleep ( 2000 ) ; } connect ( ) { setConnectionStatus ( ConnectionStatus . CONNECTING ) ; try { connectAndWait ( connectionDetails . getOptions ( ) ) ; pl . baczkowicz . mqttspy . connectivity . SimpleMqttConnection . logger . info ( "Successfully<sp>connected<sp>to<sp>{}" , connectionDetails . getName ( ) ) ; setConnectionStatus ( ConnectionStatus . CONNECTED ) ; return true ; } catch ( pl . baczkowicz . spy . exceptions . SpyException e ) { pl . baczkowicz . mqttspy . connectivity . SimpleMqttConnection . logger . error ( "Connection<sp>attempt<sp>failed" , e ) ; setConnectionStatus ( ConnectionStatus . NOT_CONNECTED ) ; } return false ; }
org . junit . Assert . assertFalse ( connection . connect ( ) )
testAssignability6 ( ) { java . util . Set < javax . enterprise . inject . spi . Bean < ? > > beans = beanManager . getBeans ( new javax . enterprise . util . TypeLiteral < org . jboss . weld . tests . assignability . Dao < ? extends org . jboss . weld . tests . assignability . User > > ( ) { } . getType ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; }
org . junit . Assert . assertEquals ( 2 , beans . size ( ) )
testToolTitle ( ) { context . checking ( new org . jmock . Expectations ( ) { { oneOf ( serverConfigurationService ) . getBoolean ( "legacyPageTitleCustom" , true ) ; will ( returnValue ( true ) ) ; one ( activeToolManager ) . getTool ( "toolId" ) ; org . sakaiproject . tool . impl . ToolImpl result = new org . sakaiproject . tool . impl . ToolImpl ( activeToolManager ) ; result . setId ( "toolId" ) ; result . setTitle ( "Tool<sp>Title" ) ; will ( returnValue ( result ) ) ; one ( activeToolManager ) . getLocalizedToolProperty ( "toolId" , "title" ) ; will ( returnValue ( null ) ) ; } } ) ; page . addTool ( "toolId" ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return "(title<sp>unknown)" ; }
org . junit . Assert . assertEquals ( "Tool<sp>Title" , page . getTitle ( ) )
renderConfluencePage_asciiDocWithUnorderedListAndTitle_returnsConfluencePageHavingCorrectUnorderedListAndTitleMarkup ( ) { java . lang . String adocContent = ".An<sp>unordered<sp>list<sp>title\n" + ( "*<sp>L1-1\n" + "*<sp>L1-2\n" ) ; org . sahli . asciidoc . confluence . publisher . converter . AsciidocPagesStructureProvider . AsciidocPage asciidocPage = asciidocPage ( org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . prependTitle ( adocContent ) ) ; org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage asciidocConfluencePage = org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage . newAsciidocConfluencePage ( asciidocPage , org . sahli . asciidoc . confluence . publisher . converter . UTF_8 , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . TEMPLATES_FOLDER , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . dummyAssetsTargetPath ( ) ) ; java . lang . String expectedContent = "<div<sp>class=\"cp-ulist-title\"><em>An<sp>unordered<sp>list<sp>title</em></div>" + "<ul><li>L1-1</li><li>L1-2</li></ul>" ; "<AssertPlaceHolder>" ; } content ( ) { return this . htmlContent ; }
org . junit . Assert . assertThat ( asciidocConfluencePage . content ( ) , org . hamcrest . Matchers . is ( expectedContent ) )
testDelegatesPostt ( ) { javax . servlet . http . HttpServletRequest req = mockHttpRequest ( ) ; javax . servlet . http . HttpServletResponse resp = mock ( javax . servlet . http . HttpServletResponse . class ) ; callbackSerlvet . doPost ( req , resp ) ; verify ( resource ) . post ( any ( com . eclipsesource . restfuse . Request . class ) ) ; "<AssertPlaceHolder>" ; } wasCalled ( ) { return wasCalled ; }
org . junit . Assert . assertTrue ( callbackSerlvet . wasCalled ( ) )
test0x0 ( ) { java . util . List < java . util . List < java . lang . Integer > > matrix = java . util . Arrays . asList ( ) ; final java . lang . Iterable < java . util . List < java . lang . Integer > > crossProductStream = org . qcri . rheem . core . util . RheemCollections . streamedCrossProduct ( matrix ) ; final java . util . List < java . util . List < java . lang . Integer > > crossProduct = java . util . stream . StreamSupport . stream ( crossProductStream . spliterator ( ) , false ) . collect ( java . util . stream . Collectors . toList ( ) ) ; java . util . List < java . util . List < java . lang . Integer > > expectedCrossProduct = java . util . Arrays . asList ( ) ; "<AssertPlaceHolder>" ; } streamedCrossProduct ( org . qcri . rheem . core . util . List ) { return new org . qcri . rheem . core . util . CrossProductIterable ( iterables ) ; }
org . junit . Assert . assertEquals ( expectedCrossProduct , crossProduct )
verifyGetNameHasNecessaryPieces ( ) { final java . lang . String name = collector . getName ( "metric-name-goes-here" ) ; "<AssertPlaceHolder>" ; } getName ( java . lang . String ) { return com . codahale . metrics . MetricRegistry . name ( net . dempsy . monitoring . dropwizard . DropwizardNodeStatsCollector . class , "node" , key ) ; }
org . junit . Assert . assertTrue ( name . contains ( "metric-name-goes-here" ) )
testIsFieldBindingValidWhenPluginBindingAndFactPatternBoundNameHaveTheSameValue ( ) { final org . drools . workbench . screens . guided . dtable . client . wizard . column . plugins . commons . PatternWrapper patternWrapper = mock ( org . drools . workbench . screens . guided . dtable . client . wizard . column . plugins . commons . PatternWrapper . class ) ; final org . drools . workbench . models . datamodel . rule . FactPattern factPattern = new org . drools . workbench . models . datamodel . rule . FactPattern ( ) { { setBoundName ( "$fact" ) ; } } ; doReturn ( BaseSingleFieldConstraint . TYPE_LITERAL ) . when ( plugin ) . constraintValue ( ) ; doReturn ( factPattern ) . when ( patternWrapper ) . makeFactPattern ( ) ; doReturn ( patternWrapper ) . when ( plugin ) . patternWrapper ( ) ; doReturn ( "$fact" ) . when ( plugin ) . getBinding ( ) ; "<AssertPlaceHolder>" ; } isFieldBindingValid ( ) { if ( ! ( isBindable ( ) ) ) { return true ; } final java . lang . String binding = getBinding ( ) ; if ( ( binding == null ) || ( binding . isEmpty ( ) ) ) { return true ; } if ( ! ( isNewColumn ( ) ) ) { if ( binding . equals ( originalCondition ( ) . getBinding ( ) ) ) { return true ; } } return ! ( makeBRLRuleModel ( ) . isVariableNameUsed ( binding ) ) ; }
org . junit . Assert . assertFalse ( plugin . isFieldBindingValid ( ) )
whenEmployingVehicleWithDifferentWorkingShifts_and_vehicleSwitchIsNotAllowed_certainVehiclesCanNeverBeAssignedToCertainRoutes ( ) { jsprit . core . problem . VehicleRoutingProblem . Builder vrpBuilder = VehicleRoutingProblem . Builder . newInstance ( ) ; new jsprit . core . problem . io . VrpXMLReader ( vrpBuilder ) . read ( "src/test/resources/simpleProblem.xml" ) ; jsprit . core . problem . VehicleRoutingProblem vrp = vrpBuilder . build ( ) ; jsprit . core . algorithm . VehicleRoutingAlgorithm vra = jsprit . core . algorithm . io . VehicleRoutingAlgorithms . readAndCreateAlgorithm ( vrp , "src/test/resources/schrimpf_vehicleSwitchNotAllowed.xml" ) ; vra . setMaxIterations ( 100 ) ; final java . util . List < java . lang . Boolean > testFailed = new java . util . ArrayList < java . lang . Boolean > ( ) ; vra . addListener ( new jsprit . core . algorithm . recreate . listener . VehicleSwitchedListener ( ) { @ jsprit . core . algorithm . Override public void vehicleSwitched ( jsprit . core . problem . solution . route . VehicleRoute vehicleRoute , jsprit . core . problem . vehicle . Vehicle oldVehicle , jsprit . core . problem . vehicle . Vehicle newVehicle ) { if ( oldVehicle == null ) return ; if ( ( oldVehicle . getId ( ) . equals ( "21" ) ) && ( newVehicle . getId ( ) . equals ( "19" ) ) ) { for ( jsprit . core . problem . job . Job j : vehicleRoute . getTourActivities ( ) . getJobs ( ) ) { if ( j . getId ( ) . equals ( "1" ) ) { testFailed . add ( true ) ; } } } if ( ( oldVehicle . getId ( ) . equals ( "19" ) ) && ( newVehicle . getId ( ) . equals ( "21" ) ) ) { for ( jsprit . core . problem . job . Job j : vehicleRoute . getTourActivities ( ) . getJobs ( ) ) { if ( j . getId ( ) . equals ( "2" ) ) { testFailed . add ( true ) ; } } } } } ) ; @ jsprit . core . algorithm . SuppressWarnings ( "unused" ) java . util . Collection < jsprit . core . problem . solution . VehicleRoutingProblemSolution > solutions = vra . searchSolutions ( ) ; System . out . println ( ( "failed<sp>" + ( testFailed . size ( ) ) ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( testFailed . isEmpty ( ) )
testGetShortProperty ( ) { org . apache . qpid . jms . message . JmsMessage msg = factory . createMessage ( ) ; java . lang . String name = "shortProperty" ; msg . setShortProperty ( name , ( ( short ) ( 1 ) ) ) ; "<AssertPlaceHolder>" ; } getShortProperty ( java . lang . String ) { try { return convertPropertyTo ( name , messageProperties . get ( name ) , org . apache . qpid . jms . Short . class ) ; } catch ( javax . jms . JMSException jmse ) { throw org . apache . qpid . jms . exceptions . JmsExceptionSupport . createRuntimeException ( jmse ) ; } }
org . junit . Assert . assertTrue ( ( ( msg . getShortProperty ( name ) ) == 1 ) )
ADSfalse ( ) { com . fujitsu . dc . core . model . impl . es . repair . RepairAds repair = com . fujitsu . dc . core . model . impl . es . repair . RepairAds . getInstance ( ) ; com . fujitsu . dc . common . ads . AdsWriteFailureLogWriter writer = com . fujitsu . dc . common . ads . AdsWriteFailureLogWriter . getInstance ( "./" , com . fujitsu . dc . test . unit . core . model . impl . es . repair . RepairAdsCompleteTest . PIO_VERSION_DUMMY , true ) ; java . io . File dir = new java . io . File ( com . fujitsu . dc . test . unit . core . model . impl . es . repair . RepairAdsCompleteTest . TEST_ADS_LOGDIR ) ; try { java . lang . Class < ? > clazz = com . fujitsu . dc . common . ads . AbstractAdsWriteFailureLog . class ; java . lang . reflect . Field baseDir = clazz . getDeclaredField ( "baseDir" ) ; baseDir . setAccessible ( true ) ; baseDir . set ( writer , com . fujitsu . dc . test . unit . core . model . impl . es . repair . RepairAdsCompleteTest . TEST_ADS_LOGDIR ) ; if ( ! ( dir . mkdir ( ) ) ) { org . junit . Assert . fail ( ( "mkdir<sp>failed(environment<sp>error):<sp>" + ( dir . getAbsolutePath ( ) ) ) ) ; } } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( "configuration<sp>failed." ) ; } java . io . File file = null ; java . lang . String fileName = ( java . lang . String . format ( AbstractAdsWriteFailureLog . LOGNAME_FORMAT_ROTATE , com . fujitsu . dc . test . unit . core . model . impl . es . repair . RepairAdsCompleteTest . PIO_VERSION_DUMMY , java . lang . System . currentTimeMillis ( ) ) ) + ( com . fujitsu . dc . common . ads . AbstractAdsWriteFailureLog . ERROR_LOGNAME_SUFFIX ) ; java . io . File rotated = new java . io . File ( dir , fileName ) ; try { java . lang . Class < ? > clazz = com . fujitsu . dc . core . model . impl . es . repair . RepairAds . class ; java . lang . reflect . Field baseDir = clazz . getDeclaredField ( "adsLogBaseDir" ) ; baseDir . setAccessible ( true ) ; baseDir . set ( repair , new java . io . File ( com . fujitsu . dc . test . unit . core . model . impl . es . repair . RepairAdsCompleteTest . TEST_ADS_LOGDIR ) ) ; java . lang . reflect . Field version = clazz . getDeclaredField ( "pcsVersion" ) ; version . setAccessible ( true ) ; version . set ( repair , com . fujitsu . dc . test . unit . core . model . impl . es . repair . RepairAdsCompleteTest . PIO_VERSION_DUMMY ) ; java . lang . reflect . Method method = clazz . getDeclaredMethod ( "isRepairCompleted" ) ; method . setAccessible ( true ) ; rotated . createNewFile ( ) ; file = getAdsWriteFailureRotatedErrorLog ( writer ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( "check<sp>failed" ) ; } finally { try { writer . closeActiveFile ( ) ; } catch ( com . fujitsu . dc . common . ads . AdsWriteFailureLogException e ) { e . printStackTrace ( ) ; } if ( null != file ) { file . delete ( ) ; } if ( null != rotated ) { rotated . delete ( ) ; } if ( null != dir ) { dir . delete ( ) ; } } } getAdsWriteFailureRotatedErrorLog ( com . fujitsu . dc . common . ads . AdsWriteFailureLogWriter ) { java . io . File file = null ; try { java . lang . Class < ? > clazz = com . fujitsu . dc . common . ads . AbstractAdsWriteFailureLog . class ; java . lang . reflect . Field baseDir = clazz . getDeclaredField ( "baseDir" ) ; baseDir . setAccessible ( true ) ; java . lang . String baseDirV = ( ( java . lang . String ) ( baseDir . get ( writer ) ) ) ; clazz = writer . getClass ( ) ; java . lang . reflect . Field createdTime = clazz . getDeclaredField ( "createdTime" ) ; createdTime . setAccessible ( true ) ; java . lang . Long createdTimeV = ( ( java . lang . Long ) ( createdTime . get ( writer ) ) ) ; final java . lang . String fileName = ( java . lang . String . format ( AbstractAdsWriteFailureLog . LOGNAME_FORMAT_ROTATE , com . fujitsu . dc . test . unit . core . model . impl . es . repair . RepairAdsCompleteTest . PIO_VERSION_DUMMY , createdTimeV ) ) + ( com . fujitsu . dc . common . ads . AbstractAdsWriteFailureLog . ERROR_LOGNAME_SUFFIX ) ; file = new java . io . File ( baseDirV , fileName ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( "configuration<sp>failed." ) ; } return file ; }
org . junit . Assert . assertFalse ( ( ( java . lang . Boolean ) ( method . invoke ( repair ) ) ) )
testIsRegionPersistentWhenDataPolicyIsReplicate ( ) { final com . gemstone . gemfire . cache . Region mockRegion = mockContext . mock ( com . gemstone . gemfire . cache . Region . class , "Region" ) ; final com . gemstone . gemfire . cache . RegionAttributes mockRegionAttributes = mockContext . mock ( com . gemstone . gemfire . cache . RegionAttributes . class , "RegionAttributes" ) ; mockContext . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockRegion ) . getAttributes ( ) ; will ( returnValue ( mockRegionAttributes ) ) ; oneOf ( mockRegionAttributes ) . getDataPolicy ( ) ; will ( returnValue ( DataPolicy . REPLICATE ) ) ; } } ) ; final com . gemstone . gemfire . management . internal . cli . functions . DescribeDiskStoreFunction function = createDescribeDiskStoreFunction ( null ) ; "<AssertPlaceHolder>" ; } isPersistent ( com . gemstone . gemfire . cache . Region ) { return com . gemstone . gemfire . management . internal . cli . functions . DescribeDiskStoreFunction . PERSISTENT_DATA_POLICIES . contains ( region . getAttributes ( ) . getDataPolicy ( ) ) ; }
org . junit . Assert . assertFalse ( function . isPersistent ( mockRegion ) )
test_hierarchical_multilevel_createNullKeys ( ) { java . lang . Object [ ] inputAsObject = new java . lang . Object [ ] { new java . lang . Object [ ] { new java . lang . Object [ ] { "B.C.c1" } } } ; org . apache . avro . generic . IndexedRecord inputIndexedRecord = org . talend . daikon . avro . GenericDataRecordHelper . createRecord ( inputAsObject ) ; java . util . List < java . lang . String > keyList = java . util . Arrays . asList ( "B.C.c1" , "B.C.c2" , "B.b1" , "a1" , "D.d1" , "E.F.f1" ) ; java . lang . String transformedIndexedRecord = ( "{'key':<sp>{'B':<sp>{'C':<sp>{'c1':<sp>'B.C.c1',<sp>'c2':<sp>null},<sp>'b1':<sp>null},<sp>'a1':<sp>null,<sp>'D':<sp>{'d1':<sp>null},<sp>" + ( "'E':<sp>{'F':<sp>{'f1':<sp>null}}},<sp>" + "'value':<sp>{}}" ) ) . replaceAll ( "\\\'" , "\"" ) ; org . apache . avro . generic . IndexedRecord outputRecord = org . talend . components . adapter . beam . kv . KeyValueUtils . transformToKV ( inputIndexedRecord , org . talend . components . adapter . beam . kv . SchemaGeneratorUtils . extractKeyValues ( inputIndexedRecord . getSchema ( ) , keyList ) ) ; org . junit . Assert . assertEquals ( transformedIndexedRecord , outputRecord . toString ( ) ) ; org . apache . avro . Schema kvSchema = org . talend . components . adapter . beam . kv . SchemaGeneratorUtils . mergeKeyValues ( outputRecord . getSchema ( ) ) ; java . lang . String mergedRecord = ( "{'B':<sp>{'C':<sp>{'c1':<sp>'B.C.c1',<sp>'c2':<sp>null},<sp>'b1':<sp>null},<sp>'a1':<sp>null,<sp>'D':<sp>{'d1':<sp>null},<sp>" + "'E':<sp>{'F':<sp>{'f1':<sp>null}}}" B . C . c1 "5\\\'" , "\"B.C.c1" 1 ) ; "<AssertPlaceHolder>" ; } transformFromKV ( org . apache . avro . generic . IndexedRecord , org . apache . avro . Schema ) { org . apache . avro . generic . IndexedRecord keyRecord = ( ( org . apache . avro . generic . IndexedRecord ) ( record . get ( record . getSchema ( ) . getField ( org . talend . components . adapter . beam . kv . KeyValueRecordConstant . RECORD_KEY_PREFIX ) . pos ( ) ) ) ) ; org . apache . avro . generic . IndexedRecord valueRecord = ( ( org . apache . avro . generic . IndexedRecord ) ( record . get ( record . getSchema ( ) . getField ( org . talend . components . adapter . beam . kv . KeyValueRecordConstant . RECORD_VALUE_PREFIX ) . pos ( ) ) ) ) ; return org . talend . components . adapter . beam . kv . KeyValueUtils . mergeIndexedRecord ( keyRecord , valueRecord , schema ) ; }
org . junit . Assert . assertEquals ( mergedRecord , org . talend . components . adapter . beam . kv . KeyValueUtils . transformFromKV ( outputRecord , kvSchema ) . toString ( ) )
doesNotAcceptExcludedFileIfExactMatch ( ) { boolean fileAccepted = caseInsensitiveFileFilter . accept ( new java . io . File ( "servlet" ) ) ; "<AssertPlaceHolder>" ; } accept ( java . io . File ) { return ( ( f . isDirectory ( ) ) || ( "*" . equals ( extension ) ) ) || ( f . getName ( ) . toLowerCase ( java . util . Locale . getDefault ( ) ) . endsWith ( extension ) ) ; }
org . junit . Assert . assertThat ( fileAccepted , org . hamcrest . core . Is . is ( false ) )
testOpenOpenAscending ( ) { org . apache . commons . functor . range . CharacterRange range = org . apache . commons . functor . range . Ranges . characterRange ( 'b' , BoundType . OPEN , 'l' , BoundType . OPEN , 3 ) ; java . util . List < java . lang . Character > expected = java . util . Arrays . asList ( 'e' , 'h' , 'k' ) ; java . util . Collection < java . lang . Character > elements = org . apache . commons . functor . generator . loop . IteratorToGeneratorAdapter . adapt ( range ) . toCollection ( ) ; "<AssertPlaceHolder>" ; } toCollection ( ) { return new org . apache . commons . functor . generator . util . CollectionTransformer < E , java . util . Collection < E > > ( new java . util . ArrayList < E > ( ) ) ; }
org . junit . Assert . assertEquals ( expected , elements )
testCountAllNATSituations ( ) { final int extectedResult = 625 ; final int actualResult = this . util . getAllPossibleNATSituations ( ) . size ( ) ; "<AssertPlaceHolder>" ; } getAllPossibleNATSituations ( ) { final java . util . Set < de . fhkn . in . uce . plugininterface . NATSituation > result = new java . util . HashSet < de . fhkn . in . uce . plugininterface . NATSituation > ( ) ; final java . util . Set < de . fhkn . in . uce . plugininterface . NATBehavior > client = this . getAllPossibleNATBehaviors ( ) ; final java . util . Set < de . fhkn . in . uce . plugininterface . NATBehavior > server = this . getAllPossibleNATBehaviors ( ) ; for ( de . fhkn . in . uce . plugininterface . NATBehavior c : client ) { for ( de . fhkn . in . uce . plugininterface . NATBehavior s : server ) { result . add ( new de . fhkn . in . uce . plugininterface . NATSituation ( c , s ) ) ; } } return java . util . Collections . unmodifiableSet ( result ) ; }
org . junit . Assert . assertEquals ( extectedResult , actualResult )
testSerialization ( ) { org . jfree . chart . renderer . xy . XYAreaRenderer r1 = new org . jfree . chart . renderer . xy . XYAreaRenderer ( ) ; org . jfree . chart . renderer . xy . XYAreaRenderer r2 = ( ( org . jfree . chart . renderer . xy . XYAreaRenderer ) ( org . jfree . chart . TestUtilities . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( r1 , r2 )
checkAnalysisJobsVersionsTest ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( true )
usesSecondCacheForArchivePath ( ) { com . facebook . buck . util . cache . ProjectFileHashCache innerCache = com . facebook . buck . util . cache . impl . DefaultFileHashCache . createDefaultFileHashCache ( com . facebook . buck . io . filesystem . TestProjectFilesystems . createProjectFilesystem ( tmp . getRoot ( ) ) , fileHashCacheMode ) ; com . facebook . buck . io . filesystem . ProjectFilesystem filesystem2 = com . facebook . buck . io . filesystem . TestProjectFilesystems . createProjectFilesystem ( tmp2 . getRoot ( ) ) ; java . nio . file . Path path = filesystem2 . getPath ( "world.jar" ) ; com . facebook . buck . util . cache . ProjectFileHashCache innerCache2 = com . facebook . buck . util . cache . impl . DefaultFileHashCache . createDefaultFileHashCache ( filesystem2 , fileHashCacheMode ) ; writeJarWithHashes ( filesystem2 , path ) ; com . facebook . buck . core . io . ArchiveMemberPath archiveMemberPath = com . facebook . buck . core . io . ArchiveMemberPath . of ( path , java . nio . file . Paths . get ( com . facebook . buck . util . cache . impl . StackedFileHashCacheTest . SOME_FILE_INSIDE_JAR ) ) ; com . facebook . buck . util . cache . impl . StackedFileHashCache cache = new com . facebook . buck . util . cache . impl . StackedFileHashCache ( com . google . common . collect . ImmutableList . of ( innerCache , innerCache2 ) ) ; cache . get ( filesystem2 , archiveMemberPath ) ; "<AssertPlaceHolder>" ; } willGet ( com . facebook . buck . core . io . ArchiveMemberPath ) { return ( remoteArchiveHashes . containsKey ( relPath . withArchivePath ( filesystem . resolve ( relPath . getArchivePath ( ) ) ) ) ) || ( delegate . willGet ( relPath ) ) ; }
org . junit . Assert . assertTrue ( innerCache2 . willGet ( archiveMemberPath ) )
testAddAVUMetadataToDataObjectTwiceIncludeUnitsVal ( ) { java . lang . String testFileName = "testAddAVUMetadataToDataObjectTwiceIncludeUnitsVal.txt" ; java . lang . String expectedAttribName = "testAddAVUMetadataToDataObjectTwice" ; java . lang . String expectedValueName = "testval1" ; java . lang . String expectedUnitsVal = "testunits1" ; java . lang . String targetIrodsCollection = org . irods . jargon . core . pub . DataObjectAOImplTest . testingPropertiesHelper . buildIRODSCollectionAbsolutePathFromTestProperties ( org . irods . jargon . core . pub . DataObjectAOImplTest . testingProperties , org . irods . jargon . core . pub . DataObjectAOImplTest . IRODS_TEST_SUBDIR_PATH ) ; java . lang . String targetIrodsDataObject = ( targetIrodsCollection + "/" ) + testFileName ; java . lang . String absPath = org . irods . jargon . core . pub . DataObjectAOImplTest . scratchFileUtils . createAndReturnAbsoluteScratchPath ( org . irods . jargon . core . pub . DataObjectAOImplTest . IRODS_TEST_SUBDIR_PATH ) ; java . lang . String fileNameOrig = org . irods . jargon . testutils . filemanip . FileGenerator . generateFileOfFixedLengthGivenName ( absPath , testFileName , 2 ) ; org . irods . jargon . core . connection . IRODSAccount irodsAccount = org . irods . jargon . core . pub . DataObjectAOImplTest . testingPropertiesHelper . buildIRODSAccountFromTestProperties ( org . irods . jargon . core . pub . DataObjectAOImplTest . testingProperties ) ; org . irods . jargon . core . pub . io . IRODSFile targetIrodsFile = org . irods . jargon . core . pub . DataObjectAOImplTest . irodsFileSystem . getIRODSFileFactory ( irodsAccount ) . instanceIRODSFile ( targetIrodsCollection ) ; org . irods . jargon . core . pub . DataTransferOperations dataTransferOperationsAO = org . irods . jargon . core . pub . DataObjectAOImplTest . irodsFileSystem . getIRODSAccessObjectFactory ( ) . getDataTransferOperations ( irodsAccount ) ; dataTransferOperationsAO . putOperation ( new java . io . File ( fileNameOrig ) , targetIrodsFile , null , null ) ; org . irods . jargon . core . pub . domain . AvuData avuData = org . irods . jargon . core . pub . domain . AvuData . instance ( expectedAttribName , expectedValueName , expectedUnitsVal ) ; org . irods . jargon . core . pub . DataObjectAO dataObjectAO = org . irods . jargon . core . pub . DataObjectAOImplTest . irodsFileSystem . getIRODSAccessObjectFactory ( ) . getDataObjectAO ( irodsAccount ) ; dataObjectAO . addAVUMetadata ( targetIrodsDataObject , avuData ) ; dataObjectAO . addAVUMetadata ( targetIrodsDataObject , avuData ) ; java . util . List < org . irods . jargon . core . query . AVUQueryElement > avuQueryElements = new java . util . ArrayList < org . irods . jargon . core . query . AVUQueryElement > ( ) ; avuQueryElements . add ( org . irods . jargon . core . query . AVUQueryElement . instanceForValueQuery ( AVUQueryPart . ATTRIBUTE , QueryConditionOperators . EQUAL , expectedAttribName ) ) ; java . util . List < org . irods . jargon . core . pub . domain . DataObject > dataObjects = dataObjectAO . findDomainByMetadataQuery ( avuQueryElements ) ; "<AssertPlaceHolder>" ; } findDomainByMetadataQuery ( java . util . List ) { return findDomainByMetadataQuery ( avuQueryElements , 0 ) ; }
org . junit . Assert . assertTrue ( ( ( dataObjects . size ( ) ) == 1 ) )
testCreate ( ) { org . oscarehr . common . model . Billingreferral entity = new org . oscarehr . common . model . Billingreferral ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . setBillingreferralNo ( null ) ; dao . updateBillingreferral ( entity ) ; "<AssertPlaceHolder>" ; } getBillingreferralNo ( ) { return this . billingreferralNo ; }
org . junit . Assert . assertNotNull ( entity . getBillingreferralNo ( ) )
sseId ( ) { org . jooby . Sse sse = new org . jooby . Sse ( ) { @ org . jooby . Override protected void closeInternal ( ) { } @ org . jooby . Override protected java . util . concurrent . CompletableFuture < java . util . Optional < java . lang . Object > > send ( final java . util . Optional < java . lang . Object > id , final byte [ ] data ) { return null ; } @ org . jooby . Override protected void handshake ( final java . lang . Runnable handler ) throws org . jooby . Exception { } } ; "<AssertPlaceHolder>" ; java . util . UUID . fromString ( sse . id ( ) ) ; sse . close ( ) ; } id ( ) { return java . util . Optional . ofNullable ( id ) ; }
org . junit . Assert . assertNotNull ( sse . id ( ) )
testFluentNotQuery ( ) { com . github . jmkgreen . morphia . TestQuery . PhotoWithKeywords pwk = new com . github . jmkgreen . morphia . TestQuery . PhotoWithKeywords ( "scott" , "hernandez" ) ; ds . save ( pwk ) ; com . github . jmkgreen . morphia . AdvancedDatastore ads = ( ( com . github . jmkgreen . morphia . AdvancedDatastore ) ( ds ) ) ; com . github . jmkgreen . morphia . query . Query < com . github . jmkgreen . morphia . TestQuery . PhotoWithKeywords > q = ads . createQuery ( com . github . jmkgreen . morphia . TestQuery . PhotoWithKeywords . class ) ; q . criteria ( "keywords.keyword" ) . not ( ) . startsWith ( "ralph" ) ; "<AssertPlaceHolder>" ; } countAll ( ) { com . mongodb . DBObject query = getQueryObject ( ) ; if ( com . github . jmkgreen . morphia . query . QueryImpl . log . isTraceEnabled ( ) ) com . github . jmkgreen . morphia . query . QueryImpl . log . trace ( ( ( ( "Executing<sp>count(" + ( dbColl . getName ( ) ) ) + ")<sp>for<sp>query:<sp>" ) + query ) ) ; return dbColl . getCount ( query ) ; }
org . junit . Assert . assertEquals ( 1 , q . countAll ( ) )
testEmptyPartitionKey ( ) { final java . lang . Object [ ] key = new java . lang . Object [ ] { } ; final uk . gov . gchq . gaffer . parquetstore . partitioner . PartitionKey partitionKey = new uk . gov . gchq . gaffer . parquetstore . partitioner . PartitionKey ( key ) ; final uk . gov . gchq . gaffer . parquetstore . partitioner . serialisation . PartitionKeySerialiser serialiser = new uk . gov . gchq . gaffer . parquetstore . partitioner . serialisation . PartitionKeySerialiser ( ) ; final java . lang . String filename = ( testFolder . newFolder ( ) . getAbsolutePath ( ) ) + "/testEmptyPartitionKey" ; final uk . gov . gchq . gaffer . parquetstore . partitioner . serialisation . DataOutputStream dos = new uk . gov . gchq . gaffer . parquetstore . partitioner . serialisation . DataOutputStream ( new uk . gov . gchq . gaffer . parquetstore . partitioner . serialisation . FileOutputStream ( filename ) ) ; serialiser . write ( partitionKey , dos ) ; dos . close ( ) ; final uk . gov . gchq . gaffer . parquetstore . partitioner . serialisation . DataInputStream dis = new uk . gov . gchq . gaffer . parquetstore . partitioner . serialisation . DataInputStream ( new uk . gov . gchq . gaffer . parquetstore . partitioner . serialisation . FileInputStream ( filename ) ) ; final uk . gov . gchq . gaffer . parquetstore . partitioner . PartitionKey readPartitionKey = serialiser . read ( dis ) ; dis . close ( ) ; "<AssertPlaceHolder>" ; } getPartitionKey ( ) { return partitionKey ; }
org . junit . Assert . assertArrayEquals ( key , readPartitionKey . getPartitionKey ( ) )
extensionNotEqual ( ) { System . out . println ( "extensionNotEqual():<sp>initializing..." ) ; for ( java . lang . String extension : MimeType . mimeTypes . keySet ( ) ) { java . lang . String fileName = "test." + extension ; boolean result = ( extension + "x" ) . equals ( org . parse4j . util . MimeType . getFileExtension ( fileName ) ) ; "<AssertPlaceHolder>" ; } } getFileExtension ( java . lang . String ) { java . lang . String extension = "" ; int i = fileName . lastIndexOf ( '.' ) ; if ( i > 0 ) { extension = fileName . substring ( ( i + 1 ) ) ; } return extension ; }
org . junit . Assert . assertFalse ( result )
testExportAsRawLabel ( ) { "<AssertPlaceHolder>" ; } getExportAsRawLabel ( ) { return translationService . getValue ( DMNProjectClientConstants . DMNDiagramResourceTypeDownload ) ; }
org . junit . Assert . assertEquals ( DMNProjectClientConstants . DMNDiagramResourceTypeDownload , builder . getExportAsRawLabel ( ) )
testResponse ( ) { com . sparkplatform . api . core . Response r = handler . handleResponse ( mockResponse ( 200 , com . sparkplatform . api . core . JsonResponseHandlerTest . RESPONSE ) ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return success ; }
org . junit . Assert . assertTrue ( r . isSuccess ( ) )
shouldGetDbFromURIWithoutCredentials ( ) { java . net . URI uri = new java . net . URI ( "redis://host:9000/4" ) ; "<AssertPlaceHolder>" ; } getDBIndex ( java . net . URI ) { java . lang . String [ ] pathSplit = uri . getPath ( ) . split ( "/" , 2 ) ; if ( ( pathSplit . length ) > 1 ) { java . lang . String dbIndexStr = pathSplit [ 1 ] ; if ( dbIndexStr . isEmpty ( ) ) { return redis . clients . jedis . util . JedisURIHelper . DEFAULT_DB ; } return java . lang . Integer . parseInt ( dbIndexStr ) ; } else { return redis . clients . jedis . util . JedisURIHelper . DEFAULT_DB ; } }
org . junit . Assert . assertEquals ( 4 , redis . clients . jedis . util . JedisURIHelper . getDBIndex ( uri ) )
testApplyTrue2 ( ) { com . liferay . dynamic . data . mapping . form . evaluator . internal . function . IsDecimalFunction isDecimalFunction = new com . liferay . dynamic . data . mapping . form . evaluator . internal . function . IsDecimalFunction ( ) ; java . lang . Boolean result = isDecimalFunction . apply ( "3" ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . String ) { return _getUrlTitle ( languageId ) ; }
org . junit . Assert . assertTrue ( result )
testGetSwiftCmd ( ) { com . cloud . utils . SwiftUtil . SwiftClientCfg cfg = mock ( com . cloud . utils . SwiftUtil . SwiftClientCfg . class ) ; given ( cfg . getEndPoint ( ) ) . willReturn ( "swift.endpoint" ) ; given ( cfg . getAccount ( ) ) . willReturn ( "cs" ) ; given ( cfg . getUserName ( ) ) . willReturn ( "sec-storage" ) ; given ( cfg . getKey ( ) ) . willReturn ( "mypassword" ) ; given ( cfg . getStoragePolicy ( ) ) . willReturn ( null ) ; java . lang . String cmd = com . cloud . utils . SwiftUtil . getSwiftCmd ( cfg , "swift" , "stat" ) ; java . lang . String expected = "/usr/bin/python<sp>swift<sp>-A<sp>swift.endpoint<sp>-U<sp>cs:sec-storage<sp>-K<sp>mypassword<sp>stat" ; "<AssertPlaceHolder>" ; } is ( com . cloud . utils . db . Attribute$Flag ) { return flag . check ( flags ) ; }
org . junit . Assert . assertThat ( cmd , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( expected ) ) )
testShutdownNotCompletedYet ( ) { java . util . concurrent . Callable < java . lang . Boolean > requestedShutdownCallable = buildRequestedShutdownCallable ( ) ; mockLatchAwait ( notificationCompleteLatch , true ) ; mockLatchAwait ( shutdownCompleteLatch , false , true ) ; when ( shutdownCompleteLatch . getCount ( ) ) . thenReturn ( 1L , 0L ) ; when ( scheduler . shutdownComplete ( ) ) . thenReturn ( false , true ) ; mockShardInfoConsumerMap ( 1 , 0 ) ; "<AssertPlaceHolder>" ; verify ( notificationCompleteLatch ) . await ( anyLong ( ) , any ( java . util . concurrent . TimeUnit . class ) ) ; verify ( notificationCompleteLatch , never ( ) ) . getCount ( ) ; verify ( shutdownCompleteLatch , times ( 2 ) ) . await ( anyLong ( ) , any ( java . util . concurrent . TimeUnit . class ) ) ; verify ( shutdownCompleteLatch , times ( 2 ) ) . getCount ( ) ; verify ( scheduler ) . shutdown ( ) ; } call ( ) { int exitCode = 0 ; try { scheduler ( ) . run ( ) ; } catch ( java . lang . Throwable t ) { log . error ( "Caught<sp>throwable<sp>while<sp>processing<sp>data" , t ) ; exitCode = 1 ; } return exitCode ; }
org . junit . Assert . assertThat ( requestedShutdownCallable . call ( ) , org . hamcrest . CoreMatchers . equalTo ( true ) )
testRenewTokenSingleManager ( ) { for ( int i = 0 ; i < ( org . apache . hadoop . security . token . delegation . TestZKDelegationTokenSecretManager . TEST_RETRIES ) ; i ++ ) { org . apache . hadoop . security . token . delegation . web . DelegationTokenManager tm1 = null ; java . lang . String connectString = zkServer . getConnectString ( ) ; org . apache . hadoop . conf . Configuration conf = getSecretConf ( connectString ) ; tm1 = new org . apache . hadoop . security . token . delegation . web . DelegationTokenManager ( conf , new org . apache . hadoop . io . Text ( "foo" ) ) ; tm1 . init ( ) ; org . apache . hadoop . security . token . Token < org . apache . hadoop . security . token . delegation . web . DelegationTokenIdentifier > token = ( ( org . apache . hadoop . security . token . Token < org . apache . hadoop . security . token . delegation . web . DelegationTokenIdentifier > ) ( tm1 . createToken ( org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) , "foo" ) ) ) ; "<AssertPlaceHolder>" ; tm1 . renewToken ( token , "foo" ) ; tm1 . verifyToken ( token ) ; verifyDestroy ( tm1 , conf ) ; } } getCurrentUser ( ) { java . security . AccessControlContext context = java . security . AccessController . getContext ( ) ; javax . security . auth . Subject subject = javax . security . auth . Subject . getSubject ( context ) ; if ( ( subject == null ) || ( subject . getPrincipals ( org . apache . hadoop . security . User . class ) . isEmpty ( ) ) ) { return org . apache . hadoop . security . UserGroupInformation . getLoginUser ( ) ; } else { return new org . apache . hadoop . security . UserGroupInformation ( subject ) ; } }
org . junit . Assert . assertNotNull ( token )
testIsolatedElements ( ) { org . antlr . v4 . runtime . misc . IntervalSet s = new org . antlr . v4 . runtime . misc . IntervalSet ( ) ; s . add ( 1 ) ; s . add ( 'z' ) ; s . add ( '￰' ) ; java . lang . String expecting = "{1,<sp>122,<sp>65520}" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( a ) + ".." ) + ( b ) ; }
org . junit . Assert . assertEquals ( s . toString ( ) , expecting )
testReload ( ) { java . security . KeyPair kp = org . apache . hadoop . security . ssl . KeyStoreTestUtil . generateKeyPair ( "RSA" ) ; cert1 = org . apache . hadoop . security . ssl . KeyStoreTestUtil . generateCertificate ( "CN=Cert1" , kp , 30 , "SHA1withRSA" ) ; cert2 = org . apache . hadoop . security . ssl . KeyStoreTestUtil . generateCertificate ( "CN=Cert2" , kp , 30 , "SHA1withRSA" ) ; java . lang . String truststoreLocation = ( org . apache . hadoop . security . ssl . TestReloadingX509TrustManager . BASEDIR ) + "/testreload.jks" ; org . apache . hadoop . security . ssl . KeyStoreTestUtil . createTrustStore ( truststoreLocation , "password" , "cert1" , cert1 ) ; final org . apache . hadoop . security . ssl . ReloadingX509TrustManager tm = new org . apache . hadoop . security . ssl . ReloadingX509TrustManager ( "jks" , truststoreLocation , "password" , 10 ) ; try { tm . init ( ) ; "<AssertPlaceHolder>" ; java . lang . Thread . sleep ( ( ( tm . getReloadInterval ( ) ) + 1000 ) ) ; java . util . Map < java . lang . String , java . security . cert . X509Certificate > certs = new java . util . HashMap < java . lang . String , java . security . cert . X509Certificate > ( ) ; certs . put ( "cert1" , cert1 ) ; certs . put ( "cert2" , cert2 ) ; org . apache . hadoop . security . ssl . KeyStoreTestUtil . createTrustStore ( truststoreLocation , "password" , certs ) ; org . apache . hadoop . test . GenericTestUtils . waitFor ( new com . google . common . base . Supplier < java . lang . Boolean > ( ) { @ org . apache . hadoop . security . ssl . Override public org . apache . hadoop . security . ssl . Boolean get ( ) { return ( tm . getAcceptedIssuers ( ) . length ) == 2 ; } } , ( ( int ) ( tm . getReloadInterval ( ) ) ) , 10000 ) ; } finally { tm . destroy ( ) ; } } getAcceptedIssuers ( ) { java . security . cert . X509Certificate [ ] issuers = org . apache . hadoop . security . ssl . ReloadingX509TrustManager . EMPTY ; javax . net . ssl . X509TrustManager tm = trustManagerRef . get ( ) ; if ( tm != null ) { issuers = tm . getAcceptedIssuers ( ) ; } return issuers ; }
org . junit . Assert . assertEquals ( 1 , tm . getAcceptedIssuers ( ) . length )
shouldGetTextFromElseIf ( ) { java . lang . String text = compile ( "{{#if<sp>a}}a{{else<sp>if<sp>b}}b{{else}}c{{/if}}" ) . text ( ) ; "<AssertPlaceHolder>" ; } text ( ) { org . junit . Assert . assertEquals ( "{{#>dude}}{{#*inline<sp>\"myPartial\"}}success{{/inline}}{{/dude}}" , compile ( "{{#><sp>dude}}{{#*inline<sp>\"myPartial\"}}success{{/inline}}{{/dude}}" ) . text ( ) ) ; org . junit . Assert . assertEquals ( "{{#>dude}}success{{/dude}}" , compile ( "{{#><sp>dude}}success{{/dude}}" ) . text ( ) ) ; }
org . junit . Assert . assertEquals ( "{{#if<sp>a}}a{{else<sp>if<sp>b}}b{{else}}c{{/if}}" , text )
takingDamageReducesHitpoints ( ) { com . fundynamic . d2tm . game . entities . units . Unit unit = makeUnit ( player ) ; int hitPoints = unit . getHitPoints ( ) ; int damageInHitpoints = 5 ; unit . takeDamage ( damageInHitpoints , null ) ; "<AssertPlaceHolder>" ; } getHitPoints ( ) { return hitPointBasedDestructibility . getCurrent ( ) ; }
org . junit . Assert . assertEquals ( ( hitPoints - damageInHitpoints ) , unit . getHitPoints ( ) )
testLoggingTool_Class ( ) { org . openscience . cdk . tools . ILoggingTool logger = new org . openscience . cdk . tools . SystemOutLoggingTool ( this . getClass ( ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( logger )
findByAppIdBlankIdTest ( ) { java . util . List < org . kaaproject . kaa . server . common . dao . model . sql . LogAppender > result = appenderDao . findByAppId ( "" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return rawSchema . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( result . isEmpty ( ) )
testFindNamespaceByPrimaryKey ( ) { com . salesforce . dva . argus . entity . PrincipalUser user = _userService . findAdminUser ( ) ; com . salesforce . dva . argus . entity . Namespace namespace = new com . salesforce . dva . argus . entity . Namespace ( "namespace" , user ) ; namespace = _namespaceService . createNamespace ( namespace ) ; com . salesforce . dva . argus . entity . Namespace retrievedNamespace = _namespaceService . findNamespaceByPrimaryKey ( namespace . getId ( ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final com . salesforce . dva . argus . ws . dto . MethodHelpDto other = ( ( com . salesforce . dva . argus . ws . dto . MethodHelpDto ) ( obj ) ) ; if ( ! ( java . util . Objects . equals ( this . path , other . path ) ) ) { return false ; } if ( ! ( java . util . Objects . equals ( this . description , other . description ) ) ) { return false ; } if ( ! ( java . util . Objects . equals ( this . method , other . method ) ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( namespace . equals ( retrievedNamespace ) )
createNode_returnEntity ( ) { org . junit . Assume . assumeTrue ( dk . i2m . converge . plugins . drupal . DrupalServicesClientIT . execute ) ; dk . i2m . converge . plugins . drupal . entities . NodeEntity create = servicesClient . createNode ( getNodeParams ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertNotNull ( create . getId ( ) )
testOutsideTouchingRight ( ) { org . mrgeo . geometry . Point [ ] inputs = new org . mrgeo . geometry . Point [ ] { org . mrgeo . geometry . GeometryFactory . createPoint ( 30.0 , 25.0 ) , org . mrgeo . geometry . GeometryFactory . createPoint ( 40.0 , 20.0 ) , org . mrgeo . geometry . GeometryFactory . createPoint ( 40.0 , 30.0 ) } ; org . mrgeo . geometry . Polygon input = org . mrgeo . geometry . GeometryFactory . createPolygon ( inputs ) ; org . mrgeo . geometry . Point [ ] clips = new org . mrgeo . geometry . Point [ ] { org . mrgeo . geometry . GeometryFactory . createPoint ( 20.0 , 20.0 ) , org . mrgeo . geometry . GeometryFactory . createPoint ( 30.0 , 20.0 ) , org . mrgeo . geometry . GeometryFactory . createPoint ( 30.0 , 30.0 ) , org . mrgeo . geometry . GeometryFactory . createPoint ( 20.0 , 30.0 ) } ; org . mrgeo . geometry . Polygon clip = org . mrgeo . geometry . GeometryFactory . createPolygon ( clips ) ; org . mrgeo . geometry . Geometry output = input . clip ( clip ) ; "<AssertPlaceHolder>" ; } clip ( org . mrgeo . geometry . Polygon ) { org . mrgeo . geometry . Geometry clipped = super . clip ( geom ) ; if ( clipped instanceof org . mrgeo . geometry . GeometryCollection ) { org . mrgeo . geometry . WritableGeometryCollection collection = ( ( org . mrgeo . geometry . WritableGeometryCollection ) ( clipped ) ) ; org . mrgeo . geometry . Iterator < ? extends org . mrgeo . geometry . Geometry > iter = collection . iterator ( ) ; while ( iter . hasNext ( ) ) { org . mrgeo . geometry . Geometry g = iter . next ( ) ; if ( g . isEmpty ( ) ) { iter . remove ( ) ; } } if ( ( collection . getNumGeometries ( ) ) == 0 ) { return null ; } else if ( ( collection . getNumGeometries ( ) ) == 1 ) { org . mrgeo . geometry . WritableGeometry g = ( ( org . mrgeo . geometry . WritableGeometry ) ( collection . getGeometry ( 0 ) ) ) ; g . setAttributes ( collection . getAllAttributes ( ) ) ; return g ; } return collection ; } return null ; }
org . junit . Assert . assertNull ( output )
whenGettingListOfUsers_thenCorrect ( ) { final io . restassured . response . Response response = givenAuth ( ) . get ( URL_PREFIX ) ; final com . baeldung . persistence . model . MyUser [ ] result = response . as ( com . baeldung . persistence . model . MyUser [ ] . class ) ; "<AssertPlaceHolder>" ; } get ( int ) { return ( ( E ) ( internal [ index ] ) ) ; }
org . junit . Assert . assertEquals ( result . length , 2 )
testGetCategoryCount ( ) { org . jfree . data . category . DefaultIntervalCategoryDataset empty = new org . jfree . data . category . DefaultIntervalCategoryDataset ( new double [ 0 ] [ 0 ] , new double [ 0 ] [ 0 ] ) ; "<AssertPlaceHolder>" ; } getCategoryCount ( ) { int result = 0 ; if ( ( this . startData ) != null ) { if ( ( getSeriesCount ( ) ) > 0 ) { result = this . startData [ 0 ] . length ; } } return result ; }
org . junit . Assert . assertEquals ( 0 , empty . getCategoryCount ( ) )
testNoLocalFile ( ) { final java . io . File tempFile = se . skl . skltpservices . npoadapter . router . RouteDataTest . getTempFile ( ) ; final se . skl . skltpservices . npoadapter . router . RouteData routeData = se . skl . skltpservices . npoadapter . router . RouteData . load ( tempFile . getAbsolutePath ( ) ) ; "<AssertPlaceHolder>" ; } load ( java . lang . String ) { se . skl . skltpservices . npoadapter . router . RouteData routingData = null ; se . skl . skltpservices . npoadapter . router . ObjectInputStream is = null ; try { is = new se . skl . skltpservices . npoadapter . router . ObjectInputStream ( new se . skl . skltpservices . npoadapter . router . FileInputStream ( fileName ) ) ; routingData = ( ( se . skl . skltpservices . npoadapter . router . RouteData ) ( is . readObject ( ) ) ) ; se . skl . skltpservices . npoadapter . router . RouteData . log . debug ( ( "NPOAdapter:<sp>Successfully<sp>loaded<sp>route<sp>data<sp>from<sp>file:<sp>" + fileName ) ) ; } catch ( java . lang . Exception e ) { se . skl . skltpservices . npoadapter . router . RouteData . log . error ( ( "NPOAdapter:<sp>Unable<sp>to<sp>load<sp>route<sp>data<sp>from<sp>local<sp>file:<sp>" + fileName ) , e ) ; } finally { if ( is != null ) { try { is . close ( ) ; } catch ( java . lang . Exception err ) { se . skl . skltpservices . npoadapter . router . RouteData . log . error ( "Could<sp>not<sp>close<sp>input<sp>stream" , err ) ; } } } return routingData ; }
org . junit . Assert . assertNull ( routeData )
testExportPPT ( ) { java . io . File file = new java . io . File ( com . archimatetool . jasperreports . JasperReportsExporterTests . exportFolder , ( ( com . archimatetool . jasperreports . JasperReportsExporterTests . exportFileName ) + ".ppt" ) ) ; com . archimatetool . jasperreports . JasperReportsExporterTests . exporter . exportPPT ( com . archimatetool . jasperreports . JasperReportsExporterTests . jasperPrint , file ) ; "<AssertPlaceHolder>" ; } exists ( ) { return ( getURL ( ) ) != null ; }
org . junit . Assert . assertTrue ( file . exists ( ) )
testSetTimeoutWithTimeunitForExecSelectWithNegative ( ) { java . lang . String queryString = "select<sp>?s<sp>?p<sp>?o<sp>where<sp>{<sp>?s<sp>?p<sp>?o<sp>.<sp>}<sp>limit<sp>1" ; com . franz . agraph . jena . AGQuery query = com . franz . agraph . jena . AGQueryFactory . create ( queryString ) ; try ( com . franz . agraph . jena . AGQueryExecution qe = com . franz . agraph . jena . AGQueryExecutionFactory . create ( query , test . AGQueryExecutionTest . model ) ) { qe . setTimeout ( ( - 5 ) , TimeUnit . SECONDS ) ; org . apache . jena . query . ResultSet rs = qe . execSelect ( ) ; "<AssertPlaceHolder>" ; } } execSelect ( ) { com . franz . agraph . repository . AGTupleQuery tq = model . getGraph ( ) . getConnection ( ) . prepareTupleQuery ( query . getLanguage ( ) , query . getQueryString ( ) ) ; tq . setIncludeInferred ( ( ( model . getGraph ( ) ) instanceof com . franz . agraph . jena . AGInfGraph ) ) ; tq . setEntailmentRegime ( model . getGraph ( ) . getEntailmentRegime ( ) ) ; tq . setCheckVariables ( query . isCheckVariables ( ) ) ; tq . setLimit ( query . getLimit ( ) ) ; tq . setOffset ( query . getOffset ( ) ) ; if ( ( binding ) != null ) { java . util . Iterator < java . lang . String > vars = binding . varNames ( ) ; while ( vars . hasNext ( ) ) { java . lang . String var = vars . next ( ) ; tq . setBinding ( var , model . getGraph ( ) . vf . asValue ( binding . get ( var ) . asNode ( ) ) ) ; } } org . eclipse . rdf4j . query . TupleQueryResult result ; try { tq . setDataset ( model . getGraph ( ) . getDataset ( ) ) ; if ( ( timeout ) > 0 ) { tq . setMaxExecutionTime ( ( ( int ) ( ( timeout ) / 1000 ) ) ) ; } result = tq . evaluate ( ) ; } catch ( org . eclipse . rdf4j . query . QueryEvaluationException e ) { throw new org . apache . jena . query . QueryException ( e ) ; } resultToClose = result ; return new com . franz . agraph . jena . AGResultSet ( result , model ) ; }
org . junit . Assert . assertNotNull ( rs )
multipleThreadsResultsGetMixedUp ( ) { org . springframework . data . neo4j . examples . galaxy . domain . World world1 = new org . springframework . data . neo4j . examples . galaxy . domain . World ( "world<sp>1" , 1 ) ; worldRepository . save ( world1 , 0 ) ; org . springframework . data . neo4j . examples . galaxy . domain . World world2 = new org . springframework . data . neo4j . examples . galaxy . domain . World ( "world<sp>2" , 2 ) ; worldRepository . save ( world2 , 0 ) ; int iterations = 10 ; java . util . concurrent . ExecutorService service = java . util . concurrent . Executors . newFixedThreadPool ( 2 ) ; final java . util . concurrent . CountDownLatch countDownLatch = new java . util . concurrent . CountDownLatch ( ( iterations * 2 ) ) ; for ( int i = 0 ; i < iterations ; i ++ ) { service . execute ( ( ) -> { org . springframework . data . neo4j . examples . galaxy . domain . World world = worldRepository . findByName ( "world<sp>1" ) ; if ( ! ( "world<sp>1" . equals ( world . getName ( ) ) ) ) { failed = true ; } countDownLatch . countDown ( ) ; } ) ; service . execute ( ( ) -> { org . springframework . data . neo4j . examples . galaxy . domain . World world = worldRepository . findByName ( "world<sp>2" ) ; if ( ! ( "world<sp>2" . equals ( world . getName ( ) ) ) ) { failed = true ; } countDownLatch . countDown ( ) ; } ) ; } countDownLatch . await ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertFalse ( failed )
testAddNetConfigIP6PropertiesWithDhcp ( ) { org . eclipse . kura . core . net . NetworkConfiguration config = new org . eclipse . kura . core . net . NetworkConfiguration ( ) ; org . eclipse . kura . net . NetConfigIP6 netConfig = new org . eclipse . kura . net . NetConfigIP6 ( org . eclipse . kura . net . NetInterfaceStatus . netIPv6StatusEnabledLAN , true ) ; netConfig . setDhcp ( true ) ; java . lang . String prefix = "prefix." ; java . util . HashMap < java . lang . String , java . lang . Object > expected = new java . util . HashMap ( ) ; expected . put ( "prefix.ip6.status" , "netIPv6StatusEnabledLAN" ) ; expected . put ( "prefix.dhcpClient6.enabled" , true ) ; java . util . HashMap < java . lang . String , java . lang . Object > properties = new java . util . HashMap ( ) ; org . eclipse . kura . core . testutil . TestUtil . invokePrivate ( config , "addNetConfigIP6Properties" , netConfig , prefix , properties ) ; "<AssertPlaceHolder>" ; } put ( int , byte ) { this . data [ offset ] = value ; }
org . junit . Assert . assertEquals ( expected , properties )
testCourseStartedAndExpiredAWeekAgo ( ) { final java . lang . String expectedOutput = "Course<sp>access<sp>expired<sp>7<sp>days<sp>ago" ; final java . lang . String expiry = "2018-11-24T00:59:59+05:00" ; final java . lang . String start = "2018-11-01T00:00:00+05:00" ; final java . lang . String output = org . edx . mobile . util . images . CourseCardUtils . getFormattedDate ( context , today , expiry , start , end , StartType . TIMESTAMP , null ) ; "<AssertPlaceHolder>" ; } getFormattedDate ( android . content . Context , java . util . Date , java . lang . String , java . lang . String , java . lang . String , org . edx . mobile . model . api . StartType , java . lang . String ) { final java . lang . CharSequence formattedDate ; if ( org . edx . mobile . util . images . CourseCardUtils . isDatePassed ( today , start ) ) { if ( expiry != null ) { final java . util . Date expiryDate = org . edx . mobile . util . DateUtil . convertToDate ( expiry ) ; final long dayDifferenceInMillies ; if ( today . after ( expiryDate ) ) { dayDifferenceInMillies = ( today . getTime ( ) ) - ( expiryDate . getTime ( ) ) ; } else { dayDifferenceInMillies = ( expiryDate . getTime ( ) ) - ( today . getTime ( ) ) ; } if ( org . edx . mobile . util . images . CourseCardUtils . isDatePassed ( today , expiry ) ) { if ( dayDifferenceInMillies > ( org . edx . mobile . util . images . CourseCardUtils . SEVEN_DAYS_IN_MILLIS ) ) { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_expired_on , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( expiryDate . getTime ( ) ) ) ; } else { final java . lang . CharSequence timeSpan = android . text . format . DateUtils . getRelativeTimeSpanString ( expiryDate . getTime ( ) , today . getTime ( ) , DateUtils . SECOND_IN_MILLIS , DateUtils . FORMAT_ABBREV_RELATIVE ) . toString ( ) . toLowerCase ( ) ; formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_expired , "date" , timeSpan ) ; } } else { if ( dayDifferenceInMillies > ( org . edx . mobile . util . images . CourseCardUtils . SEVEN_DAYS_IN_MILLIS ) ) { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_expires_on , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( expiryDate . getTime ( ) ) ) ; } else { final java . lang . CharSequence timeSpan = android . text . format . DateUtils . getRelativeTimeSpanString ( expiryDate . getTime ( ) , today . getTime ( ) , DateUtils . SECOND_IN_MILLIS , DateUtils . FORMAT_ABBREV_RELATIVE ) . toString ( ) . toLowerCase ( ) ; formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_expires , "date" , timeSpan ) ; } } } else { final java . util . Date endDate = org . edx . mobile . util . DateUtil . convertToDate ( end ) ; if ( endDate == null ) { return null ; } else if ( org . edx . mobile . util . images . CourseCardUtils . isDatePassed ( today , end ) ) { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_ended , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( endDate . getTime ( ) ) ) ; } else { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_ending , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( endDate . getTime ( ) ) ) ; } } } else { if ( ( start_type == ( org . edx . mobile . model . api . StartType . TIMESTAMP ) ) && ( ! ( android . text . TextUtils . isEmpty ( start ) ) ) ) { final java . util . Date startDate = org . edx . mobile . util . DateUtil . convertToDate ( start ) ; formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_starting , "date" , org . edx . mobile . util . DateUtil . formatDateWithNoYear ( startDate . getTime ( ) ) ) ; } else if ( ( start_type == ( org . edx . mobile . model . api . StartType . STRING ) ) && ( ! ( android . text . TextUtils . isEmpty ( start_display ) ) ) ) { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_starting , "date" , start_display ) ; } else { formattedDate = org . edx . mobile . util . ResourceUtil . getFormattedString ( context . getResources ( ) , R . string . label_starting , "date" , context . getString ( R . string . assessment_soon ) ) ; } } return formattedDate . toString ( ) ; }
org . junit . Assert . assertEquals ( expectedOutput , output )
should_raise_exception_if_illegal_parameter_for_queue ( ) { com . flow . platform . domain . CmdInfo cmdBase = new com . flow . platform . domain . CmdInfo ( "test-zone-1" , "test-agent-1" , com . flow . platform . domain . CmdType . RUN_SHELL , "~/hello.sh" ) ; "<AssertPlaceHolder>" ; org . springframework . test . web . servlet . request . MockHttpServletRequestBuilder content = post ( "/cmd/queue/send" ) . param ( "priority" , "0" ) . param ( "retry" , "0" ) . contentType ( MediaType . APPLICATION_JSON ) . content ( cmdBase . toJson ( ) ) ; this . mockMvc . perform ( content ) . andExpect ( status ( ) . isBadRequest ( ) ) ; content = post ( "/cmd/queue/send" ) . param ( "priority" , "1" ) . param ( "retry" , "101" ) . contentType ( MediaType . APPLICATION_JSON ) . content ( cmdBase . toJson ( ) ) ; this . mockMvc . perform ( content ) . andExpect ( status ( ) . isBadRequest ( ) ) ; } getStatus ( ) { return status ; }
org . junit . Assert . assertNotNull ( cmdBase . getStatus ( ) )
testRestoreWithFilterWhenRequiredAndFailedAndMatching ( ) { final boolean required = true ; org . mockito . Mockito . when ( referencedEntry . restore ( org . mockito . Mockito . eq ( required ) , org . mockito . Mockito . any ( ) ) ) . thenReturn ( false ) ; org . mockito . Mockito . doNothing ( ) . when ( entry ) . verifyPropertyAfterCompletion ( ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( referencedEntry ) . restore ( org . mockito . Mockito . eq ( required ) , org . mockito . Mockito . any ( ) ) ; org . mockito . Mockito . verify ( entry , org . mockito . Mockito . never ( ) ) . verifyPropertyAfterCompletion ( ) ; } restore ( boolean , java . nio . file . PathMatcher ) { org . apache . commons . lang . Validate . notNull ( filter , "invalid<sp>null<sp>path<sp>filter" ) ; if ( ( restored ) == null ) { this . restored = false ; if ( filter . matches ( path ) ) { this . restored = handleRestore ( required , filter ) ; } else { this . restored = handleRestoreWhenFilterNotMatching ( required ) ; } } return restored ; }
org . junit . Assert . assertThat ( entry . restore ( required , ( p ) -> true ) , org . hamcrest . Matchers . equalTo ( false ) )
testIsNodeField ( ) { for ( org . sagebionetworks . repo . model . query . entity . NodeToEntity field : org . sagebionetworks . repo . model . query . entity . NodeToEntity . values ( ) ) { "<AssertPlaceHolder>" ; } } isNodeField ( java . lang . String ) { try { org . sagebionetworks . repo . model . query . entity . NodeToEntity . valueOf ( key ) ; return true ; } catch ( java . lang . IllegalArgumentException e ) { return false ; } }
org . junit . Assert . assertTrue ( org . sagebionetworks . repo . model . query . entity . NodeToEntity . isNodeField ( field . name ( ) ) )
testGetSigned ( ) { fixture . position ( 0 ) ; fixture . putInt ( ( - 1 ) ) ; fixture . putInt ( ( - 1 ) ) ; fixture . position ( 0 ) ; fixture . setByteOrder ( ByteOrder . LITTLE_ENDIAN ) ; long result = fixture . get ( 32 , true ) ; "<AssertPlaceHolder>" ; } get ( int , boolean ) { if ( length > ( org . eclipse . tracecompass . ctf . core . event . io . BitBuffer . BIT_LONG ) ) { throw new org . eclipse . tracecompass . ctf . core . CTFException ( ( "Cannot<sp>read<sp>a<sp>long<sp>longer<sp>than<sp>64<sp>bits.<sp>Rquested:<sp>" + length ) ) ; } if ( length > ( org . eclipse . tracecompass . ctf . core . event . io . BitBuffer . BIT_INT ) ) { final int highShift = length - ( org . eclipse . tracecompass . ctf . core . event . io . BitBuffer . BIT_INT ) ; long a = getInt ( ) ; long b = getInt ( highShift , false ) ; long retVal ; if ( signed ) { int signExtendBits = ( org . eclipse . tracecompass . ctf . core . event . io . BitBuffer . BIT_LONG ) - length ; retVal = ( retVal << signExtendBits ) > > signExtendBits ; } return retVal ; } long retVal = getInt ( length , signed ) ; return signed ? retVal : retVal & ( org . eclipse . tracecompass . ctf . core . event . io . BitBuffer . INT_MASK ) ; }
org . junit . Assert . assertEquals ( ( - 1L ) , result )