input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
getServiceRolesForSubscription_SubscriptionManger_Authorized ( ) { java . lang . reflect . Method method = beanClass . getMethod ( "getServiceRolesForSubscription" , java . lang . String . class ) ; boolean isSubscriptionManagerRoleAllowed = isRoleAllowed ( method , UserRoleType . SUBSCRIPTION_MANAGER ) ; "<AssertPlaceHolder>" ; } isRoleAllowed ( java . lang . reflect . Method , org . oscm . internal . types . enumtypes . UserRoleType ) { javax . annotation . security . RolesAllowed rolesAllowed = method . getAnnotation ( javax . annotation . security . RolesAllowed . class ) ; if ( rolesAllowed == null ) { return true ; } for ( java . lang . String role : rolesAllowed . value ( ) ) { if ( role . equals ( roleType . name ( ) ) ) { return true ; } } return false ; }
org . junit . Assert . assertTrue ( isSubscriptionManagerRoleAllowed )
testBuildListMessagesURLNullLimit ( ) { java . lang . String expected = "/admin/messages?startChangeNumber=345&type=EVALUATION" ; java . lang . String url = org . sagebionetworks . client . SynapseAdminClientImpl . buildListMessagesURL ( new java . lang . Long ( 345 ) , ObjectType . EVALUATION , null ) ; "<AssertPlaceHolder>" ; } buildListMessagesURL ( java . lang . Long , org . sagebionetworks . repo . model . ObjectType , java . lang . Long ) { if ( startChangeNumber == null ) throw new java . lang . IllegalArgumentException ( "startChangeNumber<sp>cannot<sp>be<sp>null" ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; builder . append ( org . sagebionetworks . client . SynapseAdminClientImpl . ADMIN_CHANGE_MESSAGES ) ; builder . append ( "?" ) ; builder . append ( "startChangeNumber=" ) . append ( startChangeNumber ) ; if ( type != null ) { builder . append ( "&type=" ) . append ( type . name ( ) ) ; } if ( limit != null ) { builder . append ( "&limit=" ) . append ( limit ) ; } return builder . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , url )
getOrders_shouldGetAllUnvoidedMatchesIfIncludeVoidedIsSetToFalse ( ) { org . openmrs . Patient patient = patientService . getPatient ( 2 ) ; org . openmrs . CareSetting outPatient = orderService . getCareSetting ( 1 ) ; org . openmrs . OrderType testOrderType = orderService . getOrderType ( 2 ) ; "<AssertPlaceHolder>" ; } getOrders ( org . openmrs . Patient , org . openmrs . CareSetting , org . openmrs . OrderType , boolean ) { if ( patient == null ) { throw new java . lang . IllegalArgumentException ( "Patient<sp>is<sp>required" ) ; } if ( careSetting == null ) { throw new java . lang . IllegalArgumentException ( "CareSetting<sp>is<sp>required" ) ; } java . util . List < org . openmrs . OrderType > orderTypes = null ; if ( orderType != null ) { orderTypes = new java . util . ArrayList ( ) ; orderTypes . add ( orderType ) ; orderTypes . addAll ( getSubtypes ( orderType , true ) ) ; } return dao . getOrders ( patient , careSetting , orderTypes , includeVoided , false ) ; }
org . junit . Assert . assertEquals ( 3 , orderService . getOrders ( patient , outPatient , testOrderType , false ) . size ( ) )
whenAborted_thenCommitBarrierOpenException ( ) { org . multiverse . commitbarriers . VetoCommitBarrier barrier = new org . multiverse . commitbarriers . VetoCommitBarrier ( ) ; barrier . abort ( ) ; java . lang . Runnable task = mock ( org . multiverse . commitbarriers . Runnable . class ) ; try { barrier . registerOnCommitTask ( task ) ; org . junit . Assert . fail ( ) ; } catch ( org . multiverse . commitbarriers . CommitBarrierOpenException expected ) { } "<AssertPlaceHolder>" ; verify ( task , never ( ) ) . run ( ) ; } isAborted ( ) { return ( status ) == ( org . multiverse . commitbarriers . CommitBarrier . Status . Aborted ) ; }
org . junit . Assert . assertTrue ( barrier . isAborted ( ) )
testValueOfKnownCodes ( ) { for ( final org . springframework . roo . project . DependencyType dependencyType : org . springframework . roo . project . DependencyType . values ( ) ) { "<AssertPlaceHolder>" ; } } valueOfTypeCode ( java . lang . String ) { if ( org . apache . commons . lang3 . StringUtils . isBlank ( typeCode ) ) { return org . springframework . roo . project . DependencyType . JAR ; } if ( "test-jar" . equals ( typeCode ) ) { return org . springframework . roo . project . DependencyType . TESTJAR ; } try { return org . springframework . roo . project . DependencyType . valueOf ( typeCode . toUpperCase ( ) ) ; } catch ( final java . lang . IllegalArgumentException invalidCode ) { return org . springframework . roo . project . DependencyType . OTHER ; } }
org . junit . Assert . assertEquals ( dependencyType , org . springframework . roo . project . DependencyType . valueOfTypeCode ( dependencyType . name ( ) . toLowerCase ( ) ) )
nameWithNoProhibitChars_DisplayedWithNoChanges ( ) { final java . lang . String nameWithProhibitChars = "Month<sp>1" ; final java . lang . String id = "Month<sp>1" ; org . pentaho . metadata . model . thin . Column [ ] columns = new org . pentaho . metadata . model . thin . Column [ ] { createColumn ( id , nameWithProhibitChars ) } ; org . pentaho . metadata . automodel . importing . strategy . CsvDatasourceImportStrategy importStrategy = new org . pentaho . metadata . automodel . importing . strategy . CsvDatasourceImportStrategy ( columns ) ; org . pentaho . di . core . row . ValueMetaInterface meta = new org . pentaho . di . core . row . value . ValueMetaString ( id ) ; "<AssertPlaceHolder>" ; } displayName ( org . pentaho . di . core . row . ValueMetaInterface ) { final java . lang . String columnId = valueMeta . getName ( ) ; final java . lang . String columnName = columnsIdToNameMap . get ( columnId ) ; return columnName == null ? columnId : columnName ; }
org . junit . Assert . assertEquals ( importStrategy . displayName ( meta ) , nameWithProhibitChars )
completableFuture ( ) { java . lang . reflect . Method producerMethod = org . apache . servicecomb . foundation . common . utils . ReflectUtils . findMethod ( this . getClass ( ) , "producer" ) ; java . lang . reflect . Method swaggerMethod = org . apache . servicecomb . foundation . common . utils . ReflectUtils . findMethod ( this . getClass ( ) , "swagger" ) ; org . apache . servicecomb . swagger . invocation . response . producer . ProducerResponseMapper mapper = factory . createResponseMapper ( factorys , swaggerMethod . getGenericReturnType ( ) , producerMethod . getGenericReturnType ( ) ) ; org . apache . servicecomb . swagger . invocation . Response response = mapper . mapResponse ( Status . OK , new java . lang . String [ ] { "a" , "b" } ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; }
org . junit . Assert . assertThat ( response . getResult ( ) , org . hamcrest . Matchers . contains ( "a" , "b" ) )
testMultipleIdsWithEmpty ( ) { java . util . List < java . lang . Integer > ids1 = java . util . Arrays . asList ( 1 , 2 ) ; java . util . List < java . lang . Integer > ids2 = new java . util . ArrayList < java . lang . Integer > ( ) ; java . util . List < java . lang . Integer > ids3 = java . util . Arrays . asList ( 2 , 3 ) ; org . apache . hadoop . hive . serde2 . ColumnProjectionUtils . appendReadColumns ( conf , ids1 ) ; org . apache . hadoop . hive . serde2 . ColumnProjectionUtils . appendReadColumns ( conf , ids2 ) ; org . apache . hadoop . hive . serde2 . ColumnProjectionUtils . appendReadColumns ( conf , ids3 ) ; java . util . List < java . lang . Integer > actual = org . apache . hadoop . hive . serde2 . ColumnProjectionUtils . getReadColumnIDs ( conf ) ; "<AssertPlaceHolder>" ; } getReadColumnIDs ( org . apache . hadoop . conf . Configuration ) { java . lang . String skips = conf . get ( org . apache . hadoop . hive . serde2 . ColumnProjectionUtils . READ_COLUMN_IDS_CONF_STR , org . apache . hadoop . hive . serde2 . ColumnProjectionUtils . READ_COLUMN_IDS_CONF_STR_DEFAULT ) ; java . lang . String [ ] list = org . apache . hadoop . util . StringUtils . split ( skips ) ; java . util . List < java . lang . Integer > result = new java . util . ArrayList < java . lang . Integer > ( list . length ) ; for ( java . lang . String element : list ) { java . lang . Integer toAdd = java . lang . Integer . parseInt ( element ) ; if ( ! ( result . contains ( toAdd ) ) ) { result . add ( toAdd ) ; } } return result ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( 2 , 3 , 1 ) , actual )
testFiveImageTargetsAreFound ( ) { org . sikuli . api . Target t = new org . sikuli . api . ImageTarget ( getClass ( ) . getResource ( "fileIcon.png" ) ) ; t . setLimit ( 5 ) ; java . util . List < org . sikuli . api . ScreenRegion > results = testScreenRegion . findAll ( t ) ; "<AssertPlaceHolder>" ; } findAll ( org . sikuli . api . Target ) { java . util . List < org . sikuli . api . ScreenRegion > rs = target . doFindAll ( this ) ; return rs ; }
org . junit . Assert . assertEquals ( 5 , results . size ( ) )
applyCmd ( ) { java . util . List < ch . usi . da . smr . message . Command > cmd = new java . util . ArrayList < ch . usi . da . smr . message . Command > ( ) ; cmd . add ( new ch . usi . da . smr . message . Command ( 1 , ch . usi . da . smr . message . CommandType . PUT , "test" , "Value" . getBytes ( ) ) ) ; ch . usi . da . smr . message . Message m = new ch . usi . da . smr . message . Message ( 1 , "127.0.0.1;1234" , "" , cmd ) ; m . setInstance ( 1 ) ; m . setRing ( 1 ) ; replica . receive ( m ) ; cmd = new java . util . ArrayList < ch . usi . da . smr . message . Command > ( ) ; cmd . add ( new ch . usi . da . smr . message . Command ( 2 , ch . usi . da . smr . message . CommandType . GET , "test" , new byte [ 0 ] ) ) ; m = new ch . usi . da . smr . message . Message ( 2 , "127.0.0.1;1234" , "" , cmd ) ; m . setInstance ( 2 ) ; m . setRing ( 1 ) ; replica . receive ( m ) ; ch . usi . da . smr . message . Command response = null ; for ( int i = 0 ; i < 5 ; i ++ ) { java . lang . Thread . sleep ( 1000 ) ; for ( ch . usi . da . smr . message . Message r : received ) { for ( ch . usi . da . smr . message . Command c : r . getCommands ( ) ) { if ( ( c . getID ( ) ) == 2 ) { response = c ; break ; } } } } "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( "Value" , new java . lang . String ( response . getValue ( ) ) )
testUnSubscribedRequest ( ) { java . lang . String id = "key" ; com . couchbase . client . core . message . kv . GetRequest request = new com . couchbase . client . core . message . kv . GetRequest ( id , com . couchbase . client . core . endpoint . kv . KeyValueHandlerTest . BUCKET ) ; rx . observers . TestSubscriber < com . couchbase . client . core . message . CouchbaseResponse > ts = rx . observers . TestSubscriber . create ( ) ; request . subscriber ( ts ) ; ts . unsubscribe ( ) ; "<AssertPlaceHolder>" ; } isActive ( ) { return false ; }
org . junit . Assert . assertTrue ( ( ! ( request . isActive ( ) ) ) )
testGrandparentFalseCondition ( ) { io . yawp . repository . models . parents . Grandchild grandchild = saveGrandchild ( "granchild" , saveChild ( "child" , saveParent ( "another-parent" ) ) ) ; io . yawp . repository . shields . RuleConditions conditions = new io . yawp . repository . shields . RuleConditions ( yawp , io . yawp . repository . models . parents . Grandchild . class , null , java . util . Arrays . asList ( grandchild ) ) ; conditions . where ( c ( "name" , "=" , "granchild" ) ) ; conditions . and ( c ( "parent->name" , "=" , "child" ) ) ; conditions . and ( c ( "parent->parent->name" , "=" , "parent" ) ) ; "<AssertPlaceHolder>" ; } evaluate ( ) { initConditions ( ) ; return ( evaluateIncoming ( ) ) && ( evaluateExisting ( ) ) ; }
org . junit . Assert . assertFalse ( conditions . evaluate ( ) )
doubleValueFunctionToComparator ( ) { org . eclipse . collections . api . list . MutableList < java . lang . Double > list = org . eclipse . collections . impl . list . mutable . FastList . newListWith ( 5.0 , 4.0 , 3.0 , 2.0 , 1.0 ) . shuffleThis ( ) ; org . eclipse . collections . api . block . function . Function < java . lang . Double , java . lang . Double > function = Double :: doubleValue ; list . sortThis ( org . eclipse . collections . impl . block . factory . Comparators . byFunction ( function ) ) ; "<AssertPlaceHolder>" ; } byFunction ( org . eclipse . collections . api . block . function . Function ) { if ( function instanceof org . eclipse . collections . api . block . function . primitive . BooleanFunction ) { return org . eclipse . collections . impl . block . factory . Functions . toBooleanComparator ( ( ( org . eclipse . collections . api . block . function . primitive . BooleanFunction < T > ) ( function ) ) ) ; } if ( function instanceof org . eclipse . collections . api . block . function . primitive . ByteFunction ) { return org . eclipse . collections . impl . block . factory . Functions . toByteComparator ( ( ( org . eclipse . collections . api . block . function . primitive . ByteFunction < T > ) ( function ) ) ) ; } if ( function instanceof org . eclipse . collections . api . block . function . primitive . CharFunction ) { return org . eclipse . collections . impl . block . factory . Functions . toCharComparator ( ( ( org . eclipse . collections . api . block . function . primitive . CharFunction < T > ) ( function ) ) ) ; } if ( function instanceof org . eclipse . collections . api . block . function . primitive . DoubleFunction ) { return org . eclipse . collections . impl . block . factory . Functions . toDoubleComparator ( ( ( org . eclipse . collections . api . block . function . primitive . DoubleFunction < T > ) ( function ) ) ) ; } if ( function instanceof org . eclipse . collections . api . block . function . primitive . FloatFunction ) { return org . eclipse . collections . impl . block . factory . Functions . toFloatComparator ( ( ( org . eclipse . collections . api . block . function . primitive . FloatFunction < T > ) ( function ) ) ) ; } if ( function instanceof org . eclipse . collections . api . block . function . primitive . IntFunction ) { return org . eclipse . collections . impl . block . factory . Functions . toIntComparator ( ( ( org . eclipse . collections . api . block . function . primitive . IntFunction < T > ) ( function ) ) ) ; } if ( function instanceof org . eclipse . collections . api . block . function . primitive . LongFunction ) { return org . eclipse . collections . impl . block . factory . Functions . toLongComparator ( ( ( org . eclipse . collections . api . block . function . primitive . LongFunction < T > ) ( function ) ) ) ; } if ( function instanceof org . eclipse . collections . api . block . function . primitive . ShortFunction ) { return org . eclipse . collections . impl . block . factory . Functions . toShortComparator ( ( ( org . eclipse . collections . api . block . function . primitive . ShortFunction < T > ) ( function ) ) ) ; } return org . eclipse . collections . impl . block . factory . Comparators . byFunction ( function , org . eclipse . collections . impl . block . factory . Comparators . naturalOrder ( ) ) ; }
org . junit . Assert . assertEquals ( org . eclipse . collections . impl . list . mutable . FastList . newListWith ( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ) , list )
testSetHeaderBackground_nullValue ( ) { org . eclipse . swt . graphics . Color color = new org . eclipse . swt . graphics . Color ( display , 1 , 2 , 3 ) ; table . setHeaderBackground ( color ) ; table . setHeaderBackground ( null ) ; "<AssertPlaceHolder>" ; } getHeaderBackground ( ) { checkWidget ( ) ; return headerBackground ; }
org . junit . Assert . assertNull ( table . getHeaderBackground ( ) )
testJobIdNotFoundInJobSubmission ( ) { final java . lang . String logFile = "src/test/resources/trace/invalidLog2.txt" ; parseFile ( logFile ) ; final org . apache . hadoop . resourceestimator . common . api . RecurrenceId recurrenceId = new org . apache . hadoop . resourceestimator . common . api . RecurrenceId ( "Test" , "2" ) ; "<AssertPlaceHolder>" ; } getHistory ( org . apache . hadoop . resourceestimator . common . api . RecurrenceId ) { inputValidator . validate ( recurrenceId ) ; readLock . lock ( ) ; try { java . lang . String pipelineId = recurrenceId . getPipelineId ( ) ; if ( pipelineId . equals ( "*" ) ) { org . apache . hadoop . resourceestimator . skylinestore . impl . InMemoryStore . LOGGER . info ( "Successfully<sp>query<sp>resource<sp>skylines<sp>for<sp>{}." , recurrenceId ) ; return java . util . Collections . unmodifiableMap ( skylineStore ) ; } java . lang . String runId = recurrenceId . getRunId ( ) ; java . util . Map < org . apache . hadoop . resourceestimator . common . api . RecurrenceId , java . util . List < org . apache . hadoop . resourceestimator . common . api . ResourceSkyline > > result = new java . util . HashMap < org . apache . hadoop . resourceestimator . common . api . RecurrenceId , java . util . List < org . apache . hadoop . resourceestimator . common . api . ResourceSkyline > > ( ) ; if ( runId . equals ( "*" ) ) { for ( Map . Entry < org . apache . hadoop . resourceestimator . common . api . RecurrenceId , java . util . List < org . apache . hadoop . resourceestimator . common . api . ResourceSkyline > > entry : skylineStore . entrySet ( ) ) { org . apache . hadoop . resourceestimator . common . api . RecurrenceId index = entry . getKey ( ) ; if ( index . getPipelineId ( ) . equals ( pipelineId ) ) { result . put ( index , entry . getValue ( ) ) ; } } if ( ( result . size ( ) ) > 0 ) { org . apache . hadoop . resourceestimator . skylinestore . impl . InMemoryStore . LOGGER . info ( "Successfully<sp>query<sp>resource<sp>skylines<sp>for<sp>{}." , recurrenceId ) ; return java . util . Collections . unmodifiableMap ( result ) ; } else { org . apache . hadoop . resourceestimator . skylinestore . impl . InMemoryStore . LOGGER . warn ( "Trying<sp>to<sp>getHistory<sp>non-existing<sp>resource<sp>skylines<sp>for<sp>{}." , recurrenceId ) ; return null ; } } if ( skylineStore . containsKey ( recurrenceId ) ) { result . put ( recurrenceId , skylineStore . get ( recurrenceId ) ) ; } else { org . apache . hadoop . resourceestimator . skylinestore . impl . InMemoryStore . LOGGER . warn ( "Trying<sp>to<sp>getHistory<sp>non-existing<sp>resource<sp>skylines<sp>for<sp>{}." , recurrenceId ) ; return null ; } org . apache . hadoop . resourceestimator . skylinestore . impl . InMemoryStore . LOGGER . info ( "Successfully<sp>query<sp>resource<sp>skylines<sp>for<sp>{}." , recurrenceId ) ; return java . util . Collections . unmodifiableMap ( result ) ; } finally { readLock . unlock ( ) ; } }
org . junit . Assert . assertNull ( skylineStore . getHistory ( recurrenceId ) )
processOptionsNoop ( ) { org . apache . hadoop . fs . shell . find . Find find = new org . apache . hadoop . fs . shell . find . Find ( ) ; find . setConf ( org . apache . hadoop . fs . shell . find . TestFind . conf ) ; java . lang . String args = "path<sp>-name<sp>one<sp>-name<sp>two<sp>-print" ; java . lang . String expected = "And(;And(;Name(one;),Name(two;)),Print(;))" ; find . processOptions ( getArgs ( args ) ) ; org . apache . hadoop . fs . shell . find . Expression expression = find . getRootExpression ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( ( json ) == null ) { return "Test<sp>codec<sp>" + ( id ) ; } else { return json . toString ( ) ; } }
org . junit . Assert . assertEquals ( expected , expression . toString ( ) )
testGetBusinessObjectDefinitionUseSsl ( ) { retentionExpirationExporterWebClient . getRegServerAccessParamsDto ( ) . setUseSsl ( true ) ; org . finra . herd . model . api . xml . BusinessObjectDefinition result = retentionExpirationExporterWebClient . getBusinessObjectDefinition ( org . finra . herd . tools . retention . exporter . NAMESPACE , org . finra . herd . tools . retention . exporter . BUSINESS_OBJECT_DEFINITION_NAME ) ; "<AssertPlaceHolder>" ; } getBusinessObjectDefinition ( java . lang . String , java . lang . String ) { org . finra . herd . tools . retention . exporter . RetentionExpirationExporterWebClient . LOGGER . info ( "Retrieving<sp>business<sp>object<sp>definition<sp>information<sp>from<sp>the<sp>registration<sp>server..." ) ; java . lang . String uriPathBuilder = ( ( ( ( ( HERD_APP_REST_URI_PREFIX ) + "/businessObjectDefinitions" ) + "/namespaces/" ) + namespace ) + "/businessObjectDefinitionNames/" ) + businessObjectDefinitionName ; org . apache . http . client . utils . URIBuilder uriBuilder = new org . apache . http . client . utils . URIBuilder ( ) . setScheme ( getUriScheme ( ) ) . setHost ( regServerAccessParamsDto . getRegServerHost ( ) ) . setPort ( regServerAccessParamsDto . getRegServerPort ( ) ) . setPath ( uriPathBuilder ) ; java . net . URI uri = uriBuilder . build ( ) ; try ( org . apache . http . impl . client . CloseableHttpClient client = httpClientHelper . createHttpClient ( regServerAccessParamsDto . isTrustSelfSignedCertificate ( ) , regServerAccessParamsDto . isDisableHostnameVerification ( ) ) ) { org . apache . http . client . methods . HttpGet request = new org . apache . http . client . methods . HttpGet ( uri ) ; request . addHeader ( "Accepts" , org . finra . herd . tools . retention . exporter . DEFAULT_ACCEPT ) ; if ( regServerAccessParamsDto . isUseSsl ( ) ) { request . addHeader ( getAuthorizationHeader ( ) ) ; } org . finra . herd . tools . retention . exporter . RetentionExpirationExporterWebClient . LOGGER . info ( java . lang . String . format ( "<sp>HTTP<sp>GET<sp>URI:<sp>%s" , request . getURI ( ) . toString ( ) ) ) ; org . finra . herd . tools . retention . exporter . RetentionExpirationExporterWebClient . LOGGER . info ( java . lang . String . format ( "<sp>HTTP<sp>GET<sp>Headers:<sp>%s" , java . util . Arrays . toString ( request . getAllHeaders ( ) ) ) ) ; org . finra . herd . model . api . xml . BusinessObjectDefinition businessObjectDefinition = getBusinessObjectDefinition ( httpClientOperations . execute ( client , request ) ) ; org . finra . herd . tools . retention . exporter . RetentionExpirationExporterWebClient . LOGGER . info ( "Successfully<sp>retrieved<sp>business<sp>object<sp>definition<sp>from<sp>the<sp>registration<sp>server." ) ; return businessObjectDefinition ; } }
org . junit . Assert . assertNotNull ( result )
testParallelRolloutWithRemainder ( ) { final com . spotify . helios . common . descriptors . DeploymentGroup deploymentGroup = com . spotify . helios . common . descriptors . DeploymentGroup . newBuilder ( ) . setRolloutOptions ( com . spotify . helios . common . descriptors . RolloutOptions . newBuilder ( ) . setParallelism ( 3 ) . build ( ) ) . build ( ) ; final com . spotify . helios . rollingupdate . RolloutPlanner rolloutPlanner = com . spotify . helios . rollingupdate . RollingUndeployPlanner . of ( deploymentGroup ) ; final java . util . List < com . spotify . helios . common . descriptors . RolloutTask > tasks = rolloutPlanner . plan ( com . spotify . helios . rollingupdate . RollingUndeployPlannerTest . HOSTS ) ; final java . util . List < com . spotify . helios . common . descriptors . RolloutTask > expected = com . google . common . collect . Lists . newArrayList ( com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . FORCE_UNDEPLOY_JOBS , "agent1" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . FORCE_UNDEPLOY_JOBS , "agent2" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . FORCE_UNDEPLOY_JOBS , "agent3" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . AWAIT_UNDEPLOYED , "agent1" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . MARK_UNDEPLOYED , "agent1" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . AWAIT_UNDEPLOYED , "agent2" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . MARK_UNDEPLOYED , "agent2" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . AWAIT_UNDEPLOYED , "agent3" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . MARK_UNDEPLOYED , "agent3" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . FORCE_UNDEPLOY_JOBS , "agent4" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . AWAIT_UNDEPLOYED , "agent4" ) , com . spotify . helios . common . descriptors . RolloutTask . of ( RolloutTask . Action . MARK_UNDEPLOYED , "agent4" ) ) ; "<AssertPlaceHolder>" ; } of ( com . spotify . helios . common . descriptors . RolloutTask$Action , java . lang . String ) { return new com . spotify . helios . common . descriptors . RolloutTask ( action , target ) ; }
org . junit . Assert . assertEquals ( expected , tasks )
testFlattenResourcesForNullInitialization ( ) { mojo . setFlattingResources ( null ) ; "<AssertPlaceHolder>" ; } flattenResources ( ) { return org . apache . commons . lang . BooleanUtils . toBooleanDefaultIfNull ( flattenResources , false ) ; }
org . junit . Assert . assertThat ( mojo . flattenResources ( ) , org . hamcrest . CoreMatchers . is ( false ) )
testHandleDuplicateCreation ( ) { org . dataconservancy . packaging . tool . impl . generator . DomainObjectResourceBuilder underTest = new org . dataconservancy . packaging . tool . impl . generator . DomainObjectResourceBuilder ( ) ; org . dataconservancy . packaging . tool . impl . URIGenerator uriGen = new org . dataconservancy . packaging . tool . impl . SimpleURIGenerator ( ) ; org . dataconservancy . packaging . tool . impl . generator . PackageModelBuilderState state = bootstrap2 ( ) ; org . dataconservancy . packaging . tool . model . ipm . Node child = state . tree . getChildren ( ) . get ( 0 ) ; state . assembler = mock ( org . dataconservancy . packaging . tool . api . generator . PackageAssembler . class ) ; when ( state . assembler . createResource ( eq ( ( "bin/" + ( org . dataconservancy . packaging . tool . impl . generator . IPMUtil . path ( child , "" ) ) ) ) , eq ( PackageResourceType . DATA ) , any ( java . io . InputStream . class ) ) ) . thenThrow ( new org . dataconservancy . packaging . tool . model . PackageToolException ( org . dataconservancy . packaging . tool . model . PackagingToolReturnInfo . PKG_ASSEMBLER_DUPLICATE_RESOURCE ) ) ; final java . lang . String expectedSuffix = shaHex ( child . getIdentifier ( ) . toString ( ) ) ; final java . util . concurrent . atomic . AtomicBoolean matchedSuffix = new java . util . concurrent . atomic . AtomicBoolean ( Boolean . FALSE ) ; when ( state . assembler . createResource ( endsWith ( expectedSuffix ) , any ( org . dataconservancy . packaging . tool . api . generator . PackageResourceType . class ) , any ( java . io . InputStream . class ) ) ) . then ( ( invocationOnMock ) -> { matchedSuffix . set ( Boolean . TRUE ) ; return uriGen . generateDomainObjectURI ( state . tree ) ; } ) ; underTest . init ( state ) ; verify ( state . assembler , times ( 2 ) ) . createResource ( anyString ( ) , any ( org . dataconservancy . packaging . tool . api . generator . PackageResourceType . class ) , any ( java . io . InputStream . class ) ) ; "<AssertPlaceHolder>" ; } init ( org . dataconservancy . packaging . tool . impl . generator . PackageModelBuilderState ) { org . apache . jena . rdf . model . Resource rem = state . manifest . createResource ( "" ) ; org . apache . jena . rdf . model . Resource aggregation = state . manifest . createResource ( "#Aggregation" ) ; org . apache . jena . rdf . model . Property rdfType = state . manifest . createProperty ( ( ( org . dataconservancy . packaging . tool . ontologies . Ontologies . NS_RDF ) + "type" ) ) ; org . apache . jena . rdf . model . Property describes = state . manifest . createProperty ( ( ( NS_ORE ) + "describes" ) ) ; rem . addProperty ( rdfType , state . manifest . createResource ( ( ( NS_ORE ) + "ResourceMap" ) ) ) ; rem . addProperty ( describes , aggregation ) ; aggregation . addProperty ( rdfType , state . manifest . createResource ( ( ( NS_ORE ) + "Aggregation" ) ) ) ; }
org . junit . Assert . assertTrue ( matchedSuffix . get ( ) )
copyReaderValidOutputStreamPosBufSz ( ) { java . io . ByteArrayOutputStream outputStream = new org . apache . maven . shared . utils . io . IOUtilTest . DontCloseByteArrayOutputStream ( ) ; java . lang . String probe = "A<sp>string<sp>⍅ï" ; org . apache . maven . shared . utils . io . IOUtil . copy ( new org . apache . maven . shared . utils . io . IOUtilTest . DontCloseStringReader ( probe ) , outputStream , 1 ) ; "<AssertPlaceHolder>" ; } copy ( java . io . InputStream , java . io . OutputStream , int ) { final byte [ ] buffer = new byte [ bufferSize ] ; int n ; while ( ( - 1 ) != ( n = input . read ( buffer ) ) ) { output . write ( buffer , 0 , n ) ; } }
org . junit . Assert . assertThat ( outputStream . toByteArray ( ) , org . hamcrest . CoreMatchers . is ( probe . getBytes ( ) ) )
getTargetTypeRequiredTypeBoolean ( ) { org . apache . jackrabbit . oak . spi . xml . PropInfo propInfo = new org . apache . jackrabbit . oak . spi . xml . PropInfo ( "undef" , javax . jcr . PropertyType . UNDEFINED , mockTextValue ( "value" , PropertyType . STRING ) ) ; javax . jcr . nodetype . PropertyDefinition def = mockPropDef ( PropertyType . BOOLEAN , false ) ; "<AssertPlaceHolder>" ; } getTargetType ( javax . jcr . nodetype . PropertyDefinition ) { int target = def . getRequiredType ( ) ; if ( target != ( javax . jcr . PropertyType . UNDEFINED ) ) { return target ; } else if ( ( type ) != ( javax . jcr . PropertyType . UNDEFINED ) ) { return type ; } else { return javax . jcr . PropertyType . STRING ; } }
org . junit . Assert . assertEquals ( PropertyType . BOOLEAN , propInfo . getTargetType ( def ) )
writeReadStringTest ( ) { final org . uberfire . preferences . shared . PreferenceScope scope = userEntireApplicationScope ; preferenceStorageServiceBackendImpl . write ( scope , "my.preference.key" , "text" ) ; final java . lang . String value = preferenceStorageServiceBackendImpl . read ( scope , "my.preference.key" ) ; "<AssertPlaceHolder>" ; } read ( org . uberfire . security . impl . authz . AuthorizationPolicyBuilder , java . util . Map [ ] ) { for ( java . util . Map m : input ) { m . forEach ( ( x , y ) -> read ( builder , x . toString ( ) , y . toString ( ) , DEFAULT_ONLY ) ) ; } for ( java . util . Map m : input ) { m . forEach ( ( x , y ) -> read ( builder , x . toString ( ) , y . toString ( ) , DEFAULT_EXCLUDED ) ) ; } }
org . junit . Assert . assertEquals ( "text" , value )
testUpdateByQuery ( ) { org . apache . gora . cassandra . store . TestCassandraStoreWithNativeSerialization . userDataStore . truncateSchema ( ) ; java . util . UUID id1 = java . util . UUID . randomUUID ( ) ; org . apache . gora . cassandra . example . generated . nativeSerialization . User user1 = new org . apache . gora . cassandra . example . generated . nativeSerialization . User ( id1 , "user1" , java . util . Date . from ( java . time . Instant . now ( ) ) ) ; org . apache . gora . cassandra . store . TestCassandraStoreWithNativeSerialization . userDataStore . put ( id1 , user1 ) ; java . util . UUID id2 = java . util . UUID . randomUUID ( ) ; org . apache . gora . cassandra . example . generated . nativeSerialization . User user2 = new org . apache . gora . cassandra . example . generated . nativeSerialization . User ( id2 , "user2" , java . util . Date . from ( java . time . Instant . now ( ) ) ) ; org . apache . gora . cassandra . store . TestCassandraStoreWithNativeSerialization . userDataStore . put ( id2 , user2 ) ; org . apache . gora . query . Query < java . util . UUID , org . apache . gora . cassandra . example . generated . nativeSerialization . User > query1 = org . apache . gora . cassandra . store . TestCassandraStoreWithNativeSerialization . userDataStore . newQuery ( ) ; if ( query1 instanceof org . apache . gora . cassandra . query . CassandraQuery ) { ( ( org . apache . gora . cassandra . query . CassandraQuery ) ( query1 ) ) . addUpdateField ( "name" , "madhawa" ) ; } query1 . setKey ( id1 ) ; if ( ( org . apache . gora . cassandra . store . TestCassandraStoreWithNativeSerialization . userDataStore ) instanceof org . apache . gora . cassandra . store . CassandraStore ) { org . apache . gora . cassandra . store . TestCassandraStoreWithNativeSerialization . userDataStore . updateByQuery ( query1 ) ; } org . apache . gora . cassandra . example . generated . nativeSerialization . User user = org . apache . gora . cassandra . store . TestCassandraStoreWithNativeSerialization . userDataStore . get ( id1 ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( user . getName ( ) , "madhawa" )
shouldParseComplexLiteralText ( ) { java . lang . String scriptFragment = "\"GET<sp>/<sp>HTTP/1.1\\r\\nHost:<sp>localhost:8000\\r\\nUser-Agent:<sp>Mozilla/5.0<sp>" + ( "(Macintosh;<sp>Intel<sp>Mac<sp>OS<sp>X<sp>10.6;<sp>rv:8.0)<sp>Gecko/20100101<sp>Firefox/8.0\\r\\nAccept:<sp>text/html," + "application/xhtml+xml,<sp>application/xml;q=0.9,*/*;q=0.8\\r\\n\\r\\n\"" ) ; org . kaazing . k3po . lang . internal . parser . ScriptParserImpl parser = new org . kaazing . k3po . lang . internal . parser . ScriptParserImpl ( ) ; org . kaazing . k3po . lang . internal . ast . value . AstLiteralTextValue actual = parser . parseWithStrategy ( scriptFragment , org . kaazing . k3po . lang . internal . parser . ScriptParseStrategy . LITERAL_TEXT_VALUE ) ; org . kaazing . k3po . lang . internal . ast . value . AstLiteralTextValue expected = new org . kaazing . k3po . lang . internal . ast . value . AstLiteralTextValue ( ( "GET<sp>/<sp>HTTP/1.1\r\nHost:<sp>localhost:8000\r\nUser-Agent:<sp>Mozilla/5.0<sp>" + ( "(Macintosh;<sp>Intel<sp>Mac<sp>OS<sp>X<sp>10.6;<sp>rv:8.0)<sp>Gecko/20100101<sp>Firefox/8.0\r\nAccept:<sp>text/html," + "application/xhtml+xml,<sp>application/xml;q=0.9,*/*;q=0.8\r\n\r\n" ) ) ) ; "<AssertPlaceHolder>" ; } parseWithStrategy ( java . lang . String , org . kaazing . k3po . lang . internal . parser . ScriptParseStrategy ) { return parseWithStrategy ( new java . io . ByteArrayInputStream ( input . getBytes ( org . kaazing . k3po . lang . internal . parser . UTF_8 ) ) , strategy ) ; }
org . junit . Assert . assertEquals ( expected , actual )
addNodeStoresGraphInNode ( ) { annis . model . AnnisNode node = new annis . model . AnnisNode ( 1 ) ; graph . addNode ( node ) ; "<AssertPlaceHolder>" ; } getGraph ( ) { return graph ; }
org . junit . Assert . assertThat ( node . getGraph ( ) , org . hamcrest . Matchers . is ( graph ) )
testQueryFromAllShardsWithSorter ( ) { try { com . ctrip . platform . dal . dao . shard . DalHints hints = new com . ctrip . platform . dal . dao . shard . DalHints ( ) ; java . util . List < java . lang . Short > result = queryFromInAllShard ( hints . sortBy ( new com . ctrip . platform . dal . dao . shard . DalQueryDaoTest . TestComparator ( ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ) ; } } size ( ) { return allKeys . size ( ) ; }
org . junit . Assert . assertEquals ( 4 , result . size ( ) )
testBasic ( ) { java . lang . String value = codeine . utils . GzipUtils . decompress ( codeine . utils . GzipUtils . compress ( "test" ) ) ; "<AssertPlaceHolder>" ; } compress ( java . lang . String ) { try { if ( ( str == null ) || ( ( str . length ( ) ) == 0 ) ) { return new byte [ 0 ] ; } java . io . ByteArrayOutputStream obj = new java . io . ByteArrayOutputStream ( ) ; java . util . zip . GZIPOutputStream gzip = new java . util . zip . GZIPOutputStream ( obj ) ; gzip . write ( str . getBytes ( "UTF-8" ) ) ; gzip . close ( ) ; return obj . toByteArray ( ) ; } catch ( java . lang . Exception e ) { throw codeine . utils . ExceptionUtils . asUnchecked ( e ) ; } }
org . junit . Assert . assertEquals ( "test" , value )
testEncode2 ( ) { java . lang . Object o = new java . lang . Object ( ) ; com . dianping . swallow . common . internal . codec . JsonEncoder jsonEncoder = new com . dianping . swallow . common . internal . codec . JsonEncoder ( com . dianping . swallow . common . internal . message . SwallowMessage . class ) ; "<AssertPlaceHolder>" ; } encode ( org . jboss . netty . channel . ChannelHandlerContext , org . jboss . netty . channel . Channel , java . lang . Object ) { if ( msg instanceof com . dianping . swallow . common . message . Message ) { java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( 1024 ) ; com . caucho . hessian . io . Hessian2Output h2o = new com . caucho . hessian . io . Hessian2Output ( bos ) ; h2o . setSerializerFactory ( factory ) ; h2o . writeObject ( msg ) ; h2o . flush ( ) ; byte [ ] content = bos . toByteArray ( ) ; return org . jboss . netty . buffer . ChannelBuffers . wrappedBuffer ( content ) ; } return msg ; }
org . junit . Assert . assertEquals ( o , jsonEncoder . encode ( null , null , o ) )
testDeleteAllOverridesUsingEmptyContentLabel ( ) { java . util . List < org . candlepin . model . ConsumerContentOverride > overrides = this . createOverrides ( this . consumer , 1 , 3 ) ; java . util . List < org . candlepin . dto . api . v1 . ContentOverrideDTO > actual = this . resource . deleteContentOverrides ( context , principal , java . util . Collections . emptyList ( ) ) . list ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return virtUuidToConsumerMap . keySet ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , actual . size ( ) )
testSuccess ( ) { expectValidPrincipal ( ) ; "<AssertPlaceHolder>" ; } runTest ( boolean ) { org . springframework . security . context . SecurityContext originalSecurityContext = org . springframework . security . context . SecurityContextHolder . getContext ( ) ; org . springframework . security . context . SecurityContextHolder . setContext ( securityContext ) ; org . eurekastreams . server . action . principal . SpringSecurityContextPrincipalPopulator sut = new org . eurekastreams . server . action . principal . SpringSecurityContextPrincipalPopulator ( exceptionOnError ) ; org . eurekastreams . commons . actions . context . Principal result ; try { result = sut . transform ( request ) ; } finally { org . springframework . security . context . SecurityContextHolder . setContext ( originalSecurityContext ) ; } context . assertIsSatisfied ( ) ; return result ; }
org . junit . Assert . assertNotNull ( runTest ( true ) )
get_partitions ( ) { java . util . List < org . apache . hadoop . hive . metastore . api . Partition > partitions = com . google . common . collect . Lists . newArrayList ( ) ; java . util . List < org . apache . hadoop . hive . metastore . api . Partition > outbound = com . google . common . collect . Lists . newArrayList ( ) ; when ( primaryMapping . transformInboundDatabaseName ( com . hotels . bdp . waggledance . server . FederatedHMSHandlerTest . DB_P ) ) . thenReturn ( "inbound" ) ; when ( primaryClient . get_partitions ( "inbound" , "table" , ( ( short ) ( 10 ) ) ) ) . thenReturn ( partitions ) ; when ( primaryMapping . transformOutboundPartitions ( partitions ) ) . thenReturn ( outbound ) ; java . util . List < org . apache . hadoop . hive . metastore . api . Partition > result = handler . get_partitions ( com . hotels . bdp . waggledance . server . FederatedHMSHandlerTest . DB_P , "table" , ( ( short ) ( 10 ) ) ) ; "<AssertPlaceHolder>" ; verify ( primaryMapping , never ( ) ) . checkWritePermissions ( com . hotels . bdp . waggledance . server . FederatedHMSHandlerTest . DB_P ) ; } get_partitions ( java . lang . String , java . lang . String , short ) { com . hotels . bdp . waggledance . mapping . model . DatabaseMapping mapping = databaseMappingService . databaseMapping ( db_name ) ; java . util . List < org . apache . hadoop . hive . metastore . api . Partition > partitions = mapping . getClient ( ) . get_partitions ( mapping . transformInboundDatabaseName ( db_name ) , tbl_name , max_parts ) ; return mapping . transformOutboundPartitions ( partitions ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( outbound ) )
testLeaseDoesExpired ( ) { binding . setLeaseDuration ( 0L ) ; "<AssertPlaceHolder>" ; } isBindingTimeout ( ) { long currentTime = java . lang . System . nanoTime ( ) ; if ( ( currentTime / 1000000000 ) >= ( ( this . startTimeSec ) + ( this . durationTimeSec ) ) ) { this . currentState = LeasingState . EXPIRED ; return true ; } else { return false ; } }
org . junit . Assert . assertEquals ( true , binding . isBindingTimeout ( ) )
testSaveAndLoadScheduledTask ( ) { taskManager . saveTask ( task1 ) ; "<AssertPlaceHolder>" ; } getTask ( java . lang . String ) { for ( pt . utl . ist . task . ScheduledTask currentScheduledTask : scheduledTasks ) { if ( currentScheduledTask . getId ( ) . equals ( id ) ) { return currentScheduledTask ; } } return null ; }
org . junit . Assert . assertNotNull ( taskManager . getTask ( task1 . getId ( ) ) )
testDerivativeImageFile ( ) { java . lang . String pathname = edu . illinois . library . cantaloupe . config . Configuration . getInstance ( ) . getString ( Key . FILESYSTEMCACHE_PATHNAME ) ; edu . illinois . library . cantaloupe . image . Identifier identifier = new edu . illinois . library . cantaloupe . image . Identifier ( "cats_~!@#$%^&*()" ) ; edu . illinois . library . cantaloupe . operation . Scale scale = new edu . illinois . library . cantaloupe . operation . Scale ( ) ; scale . setMode ( Scale . Mode . ASPECT_FIT_INSIDE ) ; scale . setPercent ( 0.905 ) ; edu . illinois . library . cantaloupe . operation . OperationList ops = new edu . illinois . library . cantaloupe . operation . OperationList ( identifier , scale , new edu . illinois . library . cantaloupe . operation . Encode ( edu . illinois . library . cantaloupe . image . Format . TIF ) ) ; final java . nio . file . Path expected = java . nio . file . Paths . get ( pathname , "image" , hashedPathFragment ( identifier . toString ( ) ) , ops . toFilename ( ) ) ; "<AssertPlaceHolder>" ; } derivativeImageFile ( edu . illinois . library . cantaloupe . operation . OperationList ) { return edu . illinois . library . cantaloupe . cache . FilesystemCache . rootDerivativeImagePath ( ) . resolve ( edu . illinois . library . cantaloupe . cache . FilesystemCache . hashedPathFragment ( ops . getIdentifier ( ) . toString ( ) ) ) . resolve ( ops . toFilename ( ) ) ; }
org . junit . Assert . assertEquals ( expected , derivativeImageFile ( ops ) )
withThreeNodes ( ) { treegraph . BinaryTreeNode root = new treegraph . BinaryTreeNode ( 2 ) ; root . left = new treegraph . BinaryTreeNode ( 1 ) ; root . right = new treegraph . BinaryTreeNode ( 3 ) ; "<AssertPlaceHolder>" ; } sequences ( treegraph . BinaryTreeNode ) { java . util . List < java . util . LinkedList < java . lang . Integer > > result = new java . util . ArrayList ( ) ; if ( root == null ) { result . add ( new java . util . LinkedList ( ) ) ; return result ; } java . util . LinkedList < java . lang . Integer > prefix = new java . util . LinkedList ( ) ; prefix . add ( root . val ) ; java . util . List < java . util . LinkedList < java . lang . Integer > > leftSeqs = sequences ( root . left ) ; java . util . List < java . util . LinkedList < java . lang . Integer > > rightSeqs = sequences ( root . right ) ; for ( java . util . LinkedList < java . lang . Integer > leftSeq : leftSeqs ) { for ( java . util . LinkedList < java . lang . Integer > rightSeq : rightSeqs ) { java . util . List < java . util . LinkedList < java . lang . Integer > > weaved = new java . util . ArrayList ( ) ; weave ( leftSeq , rightSeq , weaved , prefix ) ; result . addAll ( weaved ) ; } } return result ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( java . util . Arrays . asList ( 2 , 1 , 3 ) , java . util . Arrays . asList ( 2 , 3 , 1 ) ) , s . sequences ( root ) )
testGetValue ( ) { org . openscience . cdk . reaction . type . parameters . IParameterReact paramSet = new org . openscience . cdk . reaction . type . parameters . ParameterReact ( ) ; paramSet . setValue ( new java . lang . Object ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return this . value ; }
org . junit . Assert . assertNotNull ( paramSet . getValue ( ) )
testToString001 ( ) { javax . naming . ldap . LdapName ln = new javax . naming . ldap . LdapName ( "t=test" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . toString ( "" ) ; }
org . junit . Assert . assertEquals ( "t=test" , ln . toString ( ) )
testCompareToLessThanZero ( ) { org . bff . javampd . MPDItem item1 = new org . bff . javampd . album . MPDAlbum ( "Album1" , "Artist1" ) ; org . bff . javampd . MPDItem item2 = new org . bff . javampd . album . MPDAlbum ( "Album2" , "Artist1" ) ; "<AssertPlaceHolder>" ; } compareTo ( org . bff . javampd . MPDItem ) { org . bff . javampd . song . MPDSong song = ( ( org . bff . javampd . song . MPDSong ) ( item ) ) ; java . lang . StringBuilder sb ; sb = new java . lang . StringBuilder ( getName ( ) ) ; sb . append ( ( ( getAlbumName ( ) ) == null ? "" : getAlbumName ( ) ) ) ; sb . append ( org . bff . javampd . song . MPDSong . formatToComparableString ( getTrack ( ) ) ) ; java . lang . String thisSong = sb . toString ( ) ; sb = new java . lang . StringBuilder ( song . getName ( ) ) ; sb . append ( ( ( song . getAlbumName ( ) ) == null ? "" : song . getAlbumName ( ) ) ) ; sb . append ( org . bff . javampd . song . MPDSong . formatToComparableString ( song . getTrack ( ) ) ) ; java . lang . String songToCompare = sb . toString ( ) ; return thisSong . compareTo ( songToCompare ) ; }
org . junit . Assert . assertTrue ( ( ( item1 . compareTo ( item2 ) ) < 0 ) )
shouldTransformTransformerException ( ) { doThrow ( new javax . xml . transform . TransformerException ( "foo" ) ) . when ( transformer ) . transform ( any ( javax . xml . transform . Source . class ) , any ( javax . xml . transform . Result . class ) ) ; t . setFactory ( fac ) ; try { t . transformToString ( ) ; org . junit . Assert . fail ( "should<sp>have<sp>thrown<sp>XMLUnitException" ) ; } catch ( org . xmlunit . XMLUnitException ex ) { "<AssertPlaceHolder>" ; } } transformToString ( ) { java . io . StringWriter sw = new java . io . StringWriter ( ) ; transformTo ( new javax . xml . transform . stream . StreamResult ( sw ) ) ; return sw . toString ( ) ; }
org . junit . Assert . assertEquals ( org . xmlunit . XMLUnitException . class , ex . getClass ( ) )
test_long_disc_union ( ) { org . jacorb . test . orb . LongDiscUnion testValue = new org . jacorb . test . orb . LongDiscUnion ( ) ; testValue . s ( "foo" ) ; org . omg . CORBA . Any outAny = setup . getClientOrb ( ) . create_any ( ) ; org . jacorb . test . orb . LongDiscUnionHelper . insert ( outAny , testValue ) ; org . omg . CORBA . Any inAny = server . bounce_any ( outAny ) ; "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
org . junit . Assert . assertTrue ( outAny . equal ( inAny ) )
testInvalidJsonBody ( ) { final java . lang . String jsonDocument = java . lang . String . format ( "{\"firstName\":\"%s\",<sp>\"lastName\":\"%s\",<sp>\"birthYear\":%d,<sp>\"lastSeen\":\"%s\"" , ninja . bodyparser . BodyParserEngineJsonTest . DATA_FIRSTNAME , ninja . bodyparser . BodyParserEngineJsonTest . DATA_LASTNAME , ninja . bodyparser . BodyParserEngineJsonTest . DATA_BIRTHYEAR , ninja . bodyparser . BodyParserEngineJsonTest . DATA_LASTSEEN ) ; final java . io . InputStream is = new java . io . ByteArrayInputStream ( jsonDocument . getBytes ( ) ) ; final com . fasterxml . jackson . databind . ObjectMapper jsonObjMapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; final ninja . bodyparser . BodyParserEngineJson bodyParserEngineJson = new ninja . bodyparser . BodyParserEngineJson ( jsonObjMapper ) ; boolean badRequestThrown = false ; try { org . mockito . Mockito . when ( context . getInputStream ( ) ) . thenReturn ( is ) ; } catch ( java . io . IOException ignore ) { } try { bodyParserEngineJson . invoke ( context , ninja . bodyparser . BodyParserEngineJsonTest . SimpleTestForm . class ) ; } catch ( ninja . exceptions . BadRequestException ignore ) { badRequestThrown = true ; } finally { try { is . close ( ) ; } catch ( java . io . IOException ignore ) { } } "<AssertPlaceHolder>" ; } close ( ) { shutdown ( ) ; }
org . junit . Assert . assertTrue ( badRequestThrown )
testEqualsEquivalent ( ) { com . bazaarvoice . ostrich . ServiceEndPoint endPoint1 = endPoint ( "Foo" , "server:80" ) ; com . bazaarvoice . ostrich . ServiceEndPoint endPoint2 = endPoint ( "Foo" , "server:80" ) ; "<AssertPlaceHolder>" ; } endPoint ( java . lang . String , java . lang . String ) { return endPoint ( serviceName , id , null ) ; }
org . junit . Assert . assertEquals ( endPoint1 , endPoint2 )
testShouldFindBooksByNullSearchCriteria ( ) { java . util . List < com . capgemini . techday . model . to . Book > books = bookService . findBooksBySearchCriteria ( null ) ; "<AssertPlaceHolder>" ; } findBooksBySearchCriteria ( com . capgemini . techday . rest . BookSearchCriteria ) { final com . mysema . query . types . Predicate searchPredicate = createSearchParameterPredicate ( bookSearchCriteria ) ; final java . util . List < com . capgemini . techday . model . entity . BookEntity > books = convertIterableToList ( bookRepository . findAll ( searchPredicate ) ) ; return mapBookEntityToBook ( books ) ; }
org . junit . Assert . assertFalse ( books . isEmpty ( ) )
itIsZeroDollars ( ) { com . wesabe . api . util . money . Money tenDollars = new com . wesabe . api . util . money . Money ( decimal ( "10.00" ) , USD ) ; com . wesabe . api . util . money . Money zeroDollars = new com . wesabe . api . util . money . Money ( decimal ( "0.00" ) , USD ) ; "<AssertPlaceHolder>" ; } multiply ( int ) { return new com . wesabe . api . util . money . Money ( amount . multiply ( new java . math . BigDecimal ( multiplicand ) ) , currency ) ; }
org . junit . Assert . assertEquals ( zeroDollars , tenDollars . multiply ( 0 ) )
testIsCompanyAdminWithRegularUser ( ) { _user = com . liferay . portal . kernel . test . util . UserTestUtil . addUser ( ) ; com . liferay . portal . kernel . security . permission . PermissionChecker permissionChecker = _permissionCheckerFactory . create ( _user ) ; "<AssertPlaceHolder>" ; } isCompanyAdmin ( ) { return companyAdmin ; }
org . junit . Assert . assertFalse ( permissionChecker . isCompanyAdmin ( ) )
testGetExportedObjects_01 ( ) { java . lang . Iterable < org . eclipse . xtext . resource . IEObjectDescription > iterable = container . getExportedObjects ( EcorePackage . Literals . ECLASSIFIER , org . eclipse . xtext . resource . impl . ResourceDescriptionsBasedContainerTest . SOME_NAME , false ) ; org . eclipse . emf . ecore . EObject eObject = com . google . common . collect . Iterables . getOnlyElement ( iterable ) . getEObjectOrProxy ( ) ; "<AssertPlaceHolder>" ; } getEObjectOrProxy ( ) { org . eclipse . emf . ecore . EObject element = super . getEObjectOrProxy ( ) ; org . eclipse . emf . ecore . InternalEObject result = ( ( org . eclipse . emf . ecore . InternalEObject ) ( EcoreFactory . eINSTANCE . create ( element . eClass ( ) ) ) ) ; result . eSetProxyURI ( org . eclipse . emf . ecore . util . EcoreUtil . getURI ( element ) ) ; return result ; }
org . junit . Assert . assertSame ( eClass , eObject )
testDisableAll ( ) { com . foundationdb . util . tap . Tap . setInitiallyEnabled ( "^c|d$" ) ; com . foundationdb . util . tap . InOutTap a = com . foundationdb . util . tap . Tap . createTimer ( "a" ) ; com . foundationdb . util . tap . PointTap b = com . foundationdb . util . tap . Tap . createCount ( "b" ) ; com . foundationdb . util . tap . InOutTap c = com . foundationdb . util . tap . Tap . createTimer ( "c" ) ; com . foundationdb . util . tap . PointTap d = com . foundationdb . util . tap . Tap . createCount ( "d" ) ; com . foundationdb . util . tap . Tap . setEnabled ( ".*" , false ) ; com . foundationdb . util . tap . TapReport [ ] reports = com . foundationdb . util . tap . Tap . getReport ( ".*" ) ; "<AssertPlaceHolder>" ; } getReport ( java . lang . String ) { return com . foundationdb . util . tap . Tap . getReport ( regExPattern ) ; }
org . junit . Assert . assertEquals ( 0 , reports . length )
get ( ) { int key = 3 ; int value = 5 ; doReturn ( serializer . serialize ( value ) ) . when ( client ) . get ( serializer . serialize ( key ) ) ; int actualValue = cache . get ( key ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { if ( key == null ) { return null ; } final java . lang . Object value = cache . get ( key ) ; return value != null ? new org . springframework . cache . support . SimpleValueWrapper ( value ) : null ; }
org . junit . Assert . assertEquals ( value , actualValue )
testSerialization ( ) { org . jfree . data . time . Minute m1 = new org . jfree . data . time . Minute ( ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( m1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . data . time . Minute m2 = ( ( org . jfree . data . time . Minute ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } }
org . junit . Assert . assertEquals ( m1 , m2 )
manageModificationVDiskCreation_VSERVER_UPDATED_Stopped ( ) { org . oscm . app . iaas . data . FlowState flowState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATED ; org . oscm . app . iaas . data . FlowState newState = null ; doReturn ( Boolean . TRUE ) . when ( vServerProcessor . vserverComm ) . startVServer ( paramHandler ) ; newState = vServerProcessor . manageModificationVDiskCreation ( "controllerId" , "instanceId" , paramHandler , flowState , newState ) ; "<AssertPlaceHolder>" ; } manageModificationVDiskCreation ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState , org . oscm . app . iaas . data . FlowState ) { org . oscm . app . iaas . data . FlowState newState = newStateParam ; boolean vSysInNormalState = VSystemStatus . NORMAL . equals ( paramHandler . getIaasContext ( ) . getVSystemStatus ( ) ) ; switch ( flowState ) { case VSERVER_MODIFICATION_REQUESTED : if ( ( paramHandler . getControllerWaitTime ( ) ) != 0 ) { paramHandler . suspendProcessInstanceFor ( paramHandler . getControllerWaitTime ( ) ) ; newState = org . oscm . app . iaas . data . FlowState . WAITING_BEFORE_STOP ; break ; } case WAITING_BEFORE_STOP : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STOPPED_FOR_MODIFICATION , paramHandler ) ) { java . lang . String status = vserverComm . getVServerStatus ( paramHandler ) ; if ( VServerStatus . RUNNING . equals ( status ) ) { vserverComm . stopVServer ( paramHandler ) ; } else if ( VServerStatus . STOPPED . equals ( status ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STOPPED_FOR_MODIFICATION ; } } break ; case VSERVER_STOPPED_FOR_MODIFICATION : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATING , paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATING ; vserverComm . modifyVServerAttributes ( paramHandler ) ; if ( vdiskInfo . isAdditionalDiskSelected ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATION_REQUESTED ; } } break ; case VSDISK_CREATION_REQUESTED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATING , paramHandler ) ) ) { vdiskInfo . createVDisk ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATING ; } break ; case VSDISK_CREATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATED , paramHandler ) ) { if ( vdiskInfo . isVDiskDeployed ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATED ; } } break ; case VSDISK_CREATED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_ATTACHING , paramHandler ) ) ) { vdiskInfo . attachVDisk ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_ATTACHING ; } break ; case VSDISK_ATTACHING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_ATTACHED , paramHandler ) ) { if ( vdiskInfo . isVDiskAttached ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_ATTACHED ; } } break ; case VSDISK_ATTACHED : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATING , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATING ; } break ; case VSERVER_UPDATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATED , paramHandler ) ) { if ( VServerStatus . STOPPED . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_UPDATED ; } } break ; case VSERVER_UPDATED : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTING , paramHandler ) ) { if ( vserverComm . startVServer ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } } break ; case VSERVER_STARTING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_RETRIEVEGUEST ; } } break ; case VSERVER_RETRIEVEGUEST : java . lang . String mail = paramHandler . getMailForCompletion ( ) ; if ( mail != null ) { newState = dispatchVServerManualOperation ( controllerId , instanceId , paramHandler , mail ) ; } else if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; default : } return newState ; }
org . junit . Assert . assertEquals ( FlowState . VSERVER_STARTING , newState )
isNotEmpty ( ) { mandatorySubject . setValue ( SpdConstants . Attention . NO_ATTENTION ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; }
org . junit . Assert . assertEquals ( false , mandatorySubject . isEmpty ( ) )
serialize ( ) { com . google . gson . Gson gson = com . github . seratch . jslack . common . json . GsonFactory . createSnakeCase ( ) ; com . github . seratch . jslack . api . model . event . TokensRevokedEvent event = new com . github . seratch . jslack . api . model . event . TokensRevokedEvent ( ) ; java . lang . String generatedJson = gson . toJson ( event ) ; java . lang . String expectedJson = "{\"type\":\"tokens_revoked\"}" ; "<AssertPlaceHolder>" ; } createSnakeCase ( ) { return new com . google . gson . GsonBuilder ( ) . setFieldNamingPolicy ( FieldNamingPolicy . LOWER_CASE_WITH_UNDERSCORES ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . LayoutBlock . class , new com . github . seratch . jslack . common . json . GsonLayoutBlockFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . composition . TextObject . class , new com . github . seratch . jslack . common . json . GsonTextObjectFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . ContextBlockElement . class , new com . github . seratch . jslack . common . json . GsonContextBlockElementFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . element . BlockElement . class , new com . github . seratch . jslack . common . json . GsonBlockElementFactory ( ) ) . create ( ) ; }
org . junit . Assert . assertThat ( generatedJson , org . hamcrest . CoreMatchers . is ( expectedJson ) )
testCreateErrorIcon ( ) { javafx . scene . Node icon = org . peerbox . utils . IconUtils . createErrorIcon ( ) ; "<AssertPlaceHolder>" ; } createErrorIcon ( ) { org . controlsfx . glyphfont . GlyphFont fontAwesome = org . controlsfx . glyphfont . GlyphFontRegistry . font ( "FontAwesome" ) ; org . controlsfx . glyphfont . Glyph graphic = fontAwesome . create ( FontAwesome . Glyph . EXCLAMATION_TRIANGLE ) ; graphic . setFontSize ( 20.0 ) ; graphic . setColor ( Color . RED ) ; return graphic ; }
org . junit . Assert . assertNotNull ( icon )
shouldRequestTopicsAndHandleTimeoutException ( ) { final java . util . concurrent . atomic . AtomicBoolean functionCalled = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; final org . apache . kafka . clients . consumer . MockConsumer < byte [ ] , byte [ ] > consumer = new org . apache . kafka . clients . consumer . MockConsumer < byte [ ] , byte [ ] > ( org . apache . kafka . clients . consumer . OffsetResetStrategy . EARLIEST ) { @ org . apache . kafka . streams . processor . internals . Override public java . util . Map < java . lang . String , java . util . List < org . apache . kafka . common . PartitionInfo > > listTopics ( ) { functionCalled . set ( true ) ; throw new org . apache . kafka . common . errors . TimeoutException ( "KABOOM!" ) ; } } ; final org . apache . kafka . streams . processor . internals . StoreChangelogReader changelogReader = new org . apache . kafka . streams . processor . internals . StoreChangelogReader ( consumer , java . time . Duration . ZERO , stateRestoreListener , logContext ) ; changelogReader . register ( new org . apache . kafka . streams . processor . internals . StateRestorer ( topicPartition , restoreListener , null , Long . MAX_VALUE , true , "storeName" , identity ( ) ) ) ; changelogReader . restore ( active ) ; "<AssertPlaceHolder>" ; } get ( ) { return value ; }
org . junit . Assert . assertTrue ( functionCalled . get ( ) )
testNotEqualLong ( ) { final org . apache . drill . exec . expr . holders . VarCharHolder left = org . apache . drill . exec . fn . impl . TestByteComparisonFunctions . helloLong ; final org . apache . drill . exec . expr . holders . VarCharHolder right = org . apache . drill . exec . fn . impl . TestByteComparisonFunctions . goodbyeLong ; "<AssertPlaceHolder>" ; } equal ( io . netty . buffer . DrillBuf , int , int , io . netty . buffer . DrillBuf , int , int ) { rangeCheck ( left , lStart , lEnd , right , rStart , rEnd ) ; return org . apache . drill . exec . expr . fn . impl . ByteFunctionHelpers . memEqual ( left . memoryAddress ( ) , lStart , lEnd , right . memoryAddress ( ) , rStart , rEnd ) ; }
org . junit . Assert . assertTrue ( ( ( org . apache . drill . exec . expr . fn . impl . ByteFunctionHelpers . equal ( left . buffer , left . start , left . end , right . buffer , right . start , right . end ) ) == 0 ) )
waitForCompletionNormally ( ) { java . lang . String testBlobId = "BLOBID" ; java . lang . String testContentType = "application/java-serialized-object" ; com . fnproject . fn . runtime . flow . APIModel . Blob blob = new com . fnproject . fn . runtime . flow . APIModel . Blob ( ) ; blob . blobId = testBlobId ; blob . contentType = testContentType ; com . fnproject . fn . runtime . flow . APIModel . CompletionResult completionResult = APIModel . CompletionResult . success ( APIModel . BlobDatum . fromBlob ( blob ) ) ; when ( mockHttpClient . execute ( requestForAwaitStageResult ( ) ) ) . thenReturn ( responseWithAwaitStageResponse ( completionResult ) ) ; when ( blobStoreClient . readBlob ( eq ( testFlowId ) , eq ( "BLOBID" ) , any ( ) , eq ( "application/java-serialized-object" ) ) ) . thenReturn ( 1 ) ; java . lang . Object result = completerClient . waitForCompletion ( new com . fnproject . fn . runtime . flow . FlowId ( testFlowId ) , new com . fnproject . fn . runtime . flow . CompletionId ( testStageId ) , null ) ; "<AssertPlaceHolder>" ; } waitForCompletion ( com . fnproject . fn . runtime . flow . FlowId , com . fnproject . fn . runtime . flow . CompletionId , java . lang . ClassLoader ) { try { return waitForCompletion ( flowId , id , ignored , 10 , TimeUnit . MINUTES ) ; } catch ( java . util . concurrent . TimeoutException e ) { throw new com . fnproject . fn . runtime . exception . PlatformCommunicationException ( "timeout" , e ) ; } }
org . junit . Assert . assertEquals ( result , 1 )
renderTemplate_shouldRenderSuccessfully ( ) { java . lang . String template = net . sourceforge . schemaspy . view . TemplateServiceTest . TESTTEMPLATES_FOOTEMPLATE_FTL ; java . util . Map < java . lang . String , java . lang . String > data = new java . util . HashMap ( ) ; data . put ( "foo" , "data" ) ; java . lang . String result = net . sourceforge . schemaspy . view . TemplateService . getInstance ( ) . renderTemplate ( template , data ) ; "<AssertPlaceHolder>" ; } renderTemplate ( java . lang . String , java . lang . Object ) { freemarker . template . Template temp = net . sourceforge . schemaspy . view . TemplateService . cfg . getTemplate ( template ) ; java . io . Writer out = new java . io . StringWriter ( ) ; try { temp . process ( data , out ) ; } catch ( freemarker . template . TemplateException e ) { net . sourceforge . schemaspy . view . TemplateService . logger . log ( Level . WARNING , "TemplateException:<sp>" , e ) ; } return out . toString ( ) ; }
org . junit . Assert . assertEquals ( "data" , result )
testTruncIntegerColumn1 ( ) { java . lang . String sqlText = java . lang . String . format ( "select<sp>trunc(i,<sp>1),<sp>i<sp>from<sp>%s" , com . splicemachine . derby . impl . sql . execute . operations . TruncateFunctionIT . QUALIFIED_TABLE_NAME ) ; java . sql . ResultSet rs = com . splicemachine . derby . impl . sql . execute . operations . TruncateFunctionIT . spliceClassWatcher . executeQuery ( sqlText ) ; java . lang . String expected = "1<sp>|<sp>I<sp>|\n" + ( "----------------\n" + "123321<sp>|123321<sp>|" ) ; "<AssertPlaceHolder>" ; rs . close ( ) ; } toStringUnsorted ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs , false ) . toString ( ) . trim ( ) ; }
org . junit . Assert . assertEquals ( ( ( "\n" + sqlText ) + "\n" ) , expected , TestUtils . FormattedResult . ResultFactory . toStringUnsorted ( rs ) )
testEquality ( ) { javax . measure . Quantity < javax . measure . quantity . Length > value = tec . uom . se . quantity . Quantities . getQuantity ( new java . lang . Integer ( 10 ) , Units . METRE ) ; javax . measure . Quantity < javax . measure . quantity . Length > anotherValue = tec . uom . se . quantity . Quantities . getQuantity ( new java . lang . Integer ( 10 ) , Units . METRE ) ; "<AssertPlaceHolder>" ; } getQuantity ( java . lang . Number , javax . measure . Unit ) { java . util . Objects . requireNonNull ( value ) ; java . util . Objects . requireNonNull ( unit ) ; if ( tec . uom . se . quantity . Double . class . isInstance ( value ) ) { return new tec . uom . se . quantity . DoubleQuantity ( tec . uom . se . quantity . Double . class . cast ( value ) , unit ) ; } else if ( java . math . BigDecimal . class . isInstance ( value ) ) { return new tec . uom . se . quantity . DecimalQuantity ( java . math . BigDecimal . class . cast ( value ) , unit ) ; } else if ( java . math . BigInteger . class . isInstance ( value ) ) { return new tec . uom . se . quantity . DecimalQuantity ( new java . math . BigDecimal ( java . math . BigInteger . class . cast ( value ) ) , unit ) ; } return new tec . uom . se . quantity . NumberQuantity ( value , unit ) ; }
org . junit . Assert . assertEquals ( value , anotherValue )
joinStringsShouldReturnEmptyStringWithEmptyInput ( ) { java . util . List < java . lang . String > emptyList = new java . util . ArrayList < java . lang . String > ( ) ; java . lang . String result = org . communitybridge . utility . StringUtilities . joinStrings ( emptyList , "" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( object instanceof org . communitybridge . main . CBMetrics . Graph ) ) { return false ; } final org . communitybridge . main . CBMetrics . Graph graph = ( ( org . communitybridge . main . CBMetrics . Graph ) ( object ) ) ; return graph . name . equals ( name ) ; }
org . junit . Assert . assertTrue ( result . equals ( "" ) )
backoff ( ) { int n = 10 ; alluxio . time . ExponentialTimer timer = new alluxio . time . ExponentialTimer ( 1 , 1000 , 0 , 1000 ) ; long start = java . lang . System . currentTimeMillis ( ) ; for ( int i = 0 ; i < n ; i ++ ) { while ( ( timer . tick ( ) ) == ( ExponentialTimer . Result . NOT_READY ) ) { alluxio . util . CommonUtils . sleepMs ( 10 ) ; } long now = java . lang . System . currentTimeMillis ( ) ; "<AssertPlaceHolder>" ; } } sleepMs ( long ) { alluxio . util . SleepUtils . sleepMs ( timeMs ) ; }
org . junit . Assert . assertTrue ( ( ( now - start ) >= ( 1 << ( i - 1 ) ) ) )
shouldMatchTreeEventsForTwoPropertyFilters ( ) { org . unitedinternet . cosmo . calendar . query . PropertyFilter propFilter = new org . unitedinternet . cosmo . calendar . query . PropertyFilter ( "SUMMARY" ) ; propFilter . setTextMatchFilter ( new org . unitedinternet . cosmo . calendar . query . TextMatchFilter ( "Visible" ) ) ; this . eventFilter . getPropFilters ( ) . add ( propFilter ) ; org . unitedinternet . cosmo . calendar . query . PropertyFilter propFilter2 = new org . unitedinternet . cosmo . calendar . query . PropertyFilter ( "SUMMARY" ) ; propFilter2 . setTextMatchFilter ( new org . unitedinternet . cosmo . calendar . query . TextMatchFilter ( "Physical" ) ) ; eventFilter . getPropFilters ( ) . add ( propFilter2 ) ; java . util . Set < org . unitedinternet . cosmo . model . ICalendarItem > queryEvents = calendarDao . findCalendarItems ( calendar , filter ) ; "<AssertPlaceHolder>" ; } findCalendarItems ( org . unitedinternet . cosmo . model . CollectionItem , org . unitedinternet . cosmo . calendar . query . CalendarFilter ) { try { org . unitedinternet . cosmo . dao . query . hibernate . CalendarFilterConverter filterConverter = new org . unitedinternet . cosmo . dao . query . hibernate . CalendarFilterConverter ( ) ; try { if ( collection instanceof org . unitedinternet . cosmo . model . hibernate . HibCollectionItem ) { java . util . Set < org . unitedinternet . cosmo . model . ICalendarItem > results = new java . util . HashSet < org . unitedinternet . cosmo . model . ICalendarItem > ( ) ; java . util . Set < org . unitedinternet . cosmo . model . Item > itemsToProcess = collection . getChildren ( ) ; org . unitedinternet . cosmo . calendar . query . CalendarFilterEvaluater evaluater = new org . unitedinternet . cosmo . calendar . query . CalendarFilterEvaluater ( ) ; for ( org . unitedinternet . cosmo . model . Item child : itemsToProcess ) { if ( child instanceof org . unitedinternet . cosmo . model . ICalendarItem ) { org . unitedinternet . cosmo . model . ICalendarItem content = ( ( org . unitedinternet . cosmo . model . ICalendarItem ) ( child ) ) ; net . fortuna . ical4j . model . Calendar calendar = entityConverter . convertContent ( content ) ; if ( ( calendar != null ) && ( evaluater . evaluate ( calendar , filter ) ) ) { results . add ( content ) ; } } } return results ; } catch ( org . hibernate . HibernateException e ) { this . em . clear ( ) ; throw org . springframework . orm . hibernate5 . SessionFactoryUtils . convertHibernateAccessException ( e ) ; } }
org . junit . Assert . assertEquals ( 3 , queryEvents . size ( ) )
createSnowflakeTest ( ) { cn . hutool . core . lang . Snowflake snowflake = cn . hutool . core . util . IdUtil . createSnowflake ( 1 , 1 ) ; long id = snowflake . nextId ( ) ; "<AssertPlaceHolder>" ; } nextId ( ) { long timestamp = genTime ( ) ; if ( timestamp < ( lastTimestamp ) ) { throw new java . lang . IllegalStateException ( cn . hutool . core . util . StrUtil . format ( "Clock<sp>moved<sp>backwards.<sp>Refusing<sp>to<sp>generate<sp>id<sp>for<sp>{}ms" , ( ( lastTimestamp ) - timestamp ) ) ) ; } if ( ( lastTimestamp ) == timestamp ) { sequence = ( ( sequence ) + 1 ) & ( sequenceMask ) ; if ( ( sequence ) == 0 ) { timestamp = tilNextMillis ( lastTimestamp ) ; } } else { sequence = 0L ; } lastTimestamp = timestamp ; return ( ( ( ( timestamp - ( twepoch ) ) << ( timestampLeftShift ) ) | ( ( datacenterId ) << ( datacenterIdShift ) ) ) | ( ( workerId ) << ( workerIdShift ) ) ) | ( sequence ) ; }
org . junit . Assert . assertTrue ( ( id > 0 ) )
testInitialize ( ) { data . put ( new org . apache . accumulo . core . data . Key ( ) , new org . apache . accumulo . core . data . Value ( ) ) ; formatter . initialize ( data . entrySet ( ) , new org . apache . accumulo . core . util . format . FormatterConfig ( ) ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return iterator . hasNext ( ) ; }
org . junit . Assert . assertTrue ( formatter . hasNext ( ) )
getAttributeAsIntListOffset_should_default_should_get_ith_element ( ) { au . edu . wehi . idsv . IdsvVariantContextTest . TestIdsvVariantContext vc = new au . edu . wehi . idsv . IdsvVariantContextTest . TestIdsvVariantContext ( minimalVariant ( ) . attribute ( "intlist" , L ( "1" , "2" ) ) . make ( ) ) ; "<AssertPlaceHolder>" ; } getAttributeAsIntListOffset ( java . lang . String , int , int ) { return au . edu . wehi . idsv . AttributeConverter . asIntListOffset ( getAttribute ( attrName ) , i , j ) ; }
org . junit . Assert . assertEquals ( 1 , vc . getAttributeAsIntListOffset ( "intlist" , 0 , 7 ) )
testAddNotification_noOrigMessageId_assertTxNotAdded ( ) { org . nhindirect . monitor . processor . impl . DefaultDuplicateNotificationStateManager mgr = new org . nhindirect . monitor . processor . impl . DefaultDuplicateNotificationStateManager ( ) ; mgr . setDao ( notifDao ) ; org . nhindirect . common . tx . model . Tx tx = org . nhindirect . monitor . util . TestUtils . makeMessage ( TxMessageType . DSN , "1234" , "" , "" , "" , "gm2552@cerner.com" ) ; mgr . addNotification ( tx ) ; java . util . Set < java . lang . String > addedAddr = notifDao . getReceivedAddresses ( "1234" , java . util . Arrays . asList ( "gm2552@cerner.com" ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 0 , addedAddr . size ( ) )
assertOrderIsCorrectBreadthFirst ( ) { java . util . List < org . jboss . solder . exception . control . HandlerMethod < ? extends java . lang . Throwable > > handlers = new java . util . ArrayList < org . jboss . solder . exception . control . HandlerMethod < ? extends java . lang . Throwable > > ( extension . getHandlersForExceptionType ( org . jboss . solder . exception . control . test . common . handler . Exception . class , bm , java . util . Collections . < java . lang . annotation . Annotation > emptySet ( ) , TraversalMode . BREADTH_FIRST ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return "200MB" ; }
org . junit . Assert . assertThat ( handlers . size ( ) , org . hamcrest . CoreMatchers . is ( 4 ) )
emptyFeedForPoster ( ) { com . mongodb . socialite . feed . FeedServiceTest . createSimpleUserGraph ( ) ; postMessage ( com . mongodb . socialite . feed . FeedServiceTest . user1 , com . mongodb . socialite . feed . FeedServiceTest . message1 ) ; java . util . List < com . mongodb . socialite . api . Content > feed2 = feedService . getFeedFor ( com . mongodb . socialite . feed . FeedServiceTest . user1 , 50 ) ; "<AssertPlaceHolder>" ; } getFeedFor ( com . mongodb . socialite . api . User , int ) { java . util . List < com . mongodb . socialite . api . Content > result = new java . util . ArrayList < com . mongodb . socialite . api . Content > ( limit ) ; com . mongodb . DBCursor cursor = buckets . find ( findBy ( com . mongodb . socialite . feed . FanoutOnWriteSizedBuckets . BUCKET_OWNER_KEY , user . getUserId ( ) ) , getFields ( com . mongodb . socialite . feed . FanoutOnWriteSizedBuckets . BUCKET_CONTENT_KEY ) ) . sort ( sortByDecending ( com . mongodb . socialite . feed . FanoutOnWriteSizedBuckets . BUCKET_ID_KEY ) ) . batchSize ( config . bucket_read_batch_size ) ; try { while ( ( cursor . hasNext ( ) ) && ( ( result . size ( ) ) < limit ) ) { com . mongodb . DBObject currentBucket = cursor . next ( ) ; @ com . mongodb . socialite . feed . SuppressWarnings ( "unchecked" ) java . util . List < com . mongodb . DBObject > contentList = ( ( java . util . List < com . mongodb . DBObject > ) ( currentBucket . get ( com . mongodb . socialite . feed . FanoutOnWriteSizedBuckets . BUCKET_CONTENT_KEY ) ) ) ; int bucketSize = contentList . size ( ) ; for ( int i = bucketSize - 1 ; i >= 0 ; -- i ) { result . add ( new com . mongodb . socialite . api . Content ( contentList . get ( i ) ) ) ; if ( ( result . size ( ) ) >= limit ) break ; } } } finally { cursor . close ( ) ; } return result ; }
org . junit . Assert . assertTrue ( ( ( feed2 . size ( ) ) == 0 ) )
testSetTrustStoreEmpty ( ) { org . eclipse . kura . core . ssl . SslManagerServiceOptions serviceOptions = mock ( org . eclipse . kura . core . ssl . SslManagerServiceOptions . class ) ; org . eclipse . kura . core . ssl . ConnectionSslOptions sslOptions = new org . eclipse . kura . core . ssl . ConnectionSslOptions ( serviceOptions ) ; when ( serviceOptions . getSslKeyStore ( ) ) . thenReturn ( "ts2" ) ; sslOptions . setTrustStore ( "" ) ; "<AssertPlaceHolder>" ; } getTrustStore ( ) { return this . trustStore ; }
org . junit . Assert . assertEquals ( "ts2" , sslOptions . getTrustStore ( ) )
testUndefinedHashCodeEquals ( ) { com . eclipsesource . v8 . V8Object undefined1 = v8 . getObject ( "foo" ) ; com . eclipsesource . v8 . V8Object undefined2 = v8 . getObject ( "bar" ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return v8Object . hashCode ( ) ; }
org . junit . Assert . assertEquals ( undefined1 . hashCode ( ) , undefined2 . hashCode ( ) )
ovalTestCenterDef4 ( ) { de . nx42 . maps4cim . config . Config c = de . nx42 . maps4cim . config . ConfigTest . generateConfig ( ) ; de . nx42 . maps4cim . config . bounds . CenterDef cd = ( ( de . nx42 . maps4cim . config . bounds . CenterDef ) ( c . getBoundsTrans ( ) ) ) ; cd . extent = null ; cd . extentLat = 8.0 ; cd . extentLon = 12.0 ; java . util . List < net . sf . oval . ConstraintViolation > cvs = de . nx42 . maps4cim . util . ValidatorUtils . validateR ( c ) ; "<AssertPlaceHolder>" ; } validateR ( java . lang . Object ) { return de . nx42 . maps4cim . util . ValidatorUtils . filterRootCauses ( de . nx42 . maps4cim . util . ValidatorUtils . val . validate ( o ) ) ; }
org . junit . Assert . assertEquals ( 0 , cvs . size ( ) )
testDeleteLoadBalancerListener ( ) { try { com . fit2cloud . aliyun . slb . model . request . DeleteLoadBalancerListenerRequest request = new com . fit2cloud . aliyun . slb . model . request . DeleteLoadBalancerListenerRequest ( ) ; request . setLoadBalancerId ( loadBalancerId ) ; request . setListenerPort ( 80 ) ; com . fit2cloud . aliyun . Response response = client . deleteLoadBalancerListener ( request ) ; System . out . println ( ( "testDeleteLoadBalancerListener<sp>::<sp>" + ( new com . google . gson . Gson ( ) . toJson ( response ) ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } deleteLoadBalancerListener ( com . fit2cloud . aliyun . slb . model . request . DeleteLoadBalancerListenerRequest ) { return gson . fromJson ( request . execute ( "DeleteLoadBalancerListener" , deleteLoadBalancerListenerRequest . toMap ( ) ) , com . fit2cloud . aliyun . Response . class ) ; }
org . junit . Assert . assertTrue ( true )
knownGoodGenerateTestTokenSWT ( ) { java . lang . String expectedToken = "urn%3amicrosoft%3aazure%3amediaservices%3acontentkeyidentifier=24734598-f050-4cbb-8b98-2dad6eaa260a&Audience=http%3a%2f%2faudience.com&ExpiresOn=1451606400&Issuer=http%3a%2f%2fissuer.com&HMACSHA256=2XrNjMo1EIZflJOovHxt9dekEhb2DhqG9fU5MjQy9vI%3d" ; byte [ ] knownSymetricKey = "64bytes6RNhi8EsxcYsdYQ9zpFuNR1Ks9milykbxYWGILaK0LKzd5dCtYonsr456" . getBytes ( ) ; java . util . UUID knownGuid = java . util . UUID . fromString ( "24734598-f050-4cbb-8b98-2dad6eaa260a" ) ; java . text . SimpleDateFormat sdf = new java . text . SimpleDateFormat ( "yyyy-MM-dd" , java . util . Locale . ENGLISH ) ; sdf . setTimeZone ( java . util . TimeZone . getTimeZone ( "UTC" ) ) ; java . util . Date knownExpireOn = sdf . parse ( "2016-01-01" ) ; java . lang . String knownAudience = "http://audience.com" ; java . lang . String knownIssuer = "http://issuer.com" ; com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . TokenRestrictionTemplate template = new com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . TokenRestrictionTemplate ( TokenType . SWT ) ; template . setPrimaryVerificationKey ( new com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . SymmetricVerificationKey ( knownSymetricKey ) ) ; template . setAudience ( new java . net . URI ( knownAudience ) ) ; template . setIssuer ( new java . net . URI ( knownIssuer ) ) ; template . getRequiredClaims ( ) . add ( com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . TokenClaim . getContentKeyIdentifierClaim ( ) ) ; java . lang . String resultsToken = com . microsoft . windowsazure . services . media . implementation . templates . tokenrestriction . TokenRestrictionTemplateSerializer . generateTestToken ( template , template . getPrimaryVerificationKey ( ) , knownGuid , knownExpireOn , null ) ; "<AssertPlaceHolder>" ; } getPrimaryVerificationKey ( ) { return primaryVerificationKey ; }
org . junit . Assert . assertEquals ( expectedToken , resultsToken )
shouldMarkTransitionFromBlankToSuperadminAsValidWhenPerformedBySuperadmin ( ) { stubSecurityContextWithAuthentication ( ) ; stubCurrentUserRole ( com . qcadoo . security . internal . validators . ROLE_SUPERADMIN ) ; stubRoleTransition ( "<sp>" , com . qcadoo . security . internal . validators . ROLE_SUPERADMIN ) ; final boolean isValid = userRoleValidationService . checkUserCreatingSuperadmin ( userDataDefMock , userEntityMock ) ; "<AssertPlaceHolder>" ; } checkUserCreatingSuperadmin ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { java . lang . Boolean isRoleSuperadminInNewGroup = securityService . hasRole ( entity , QcadooSecurityConstants . ROLE_SUPERADMIN ) ; java . lang . Boolean isRoleSuperadminInOldGroup = ( ( entity . getId ( ) ) == null ) ? false : securityService . hasRole ( dataDefinition . get ( entity . getId ( ) ) , QcadooSecurityConstants . ROLE_SUPERADMIN ) ; if ( ( com . google . common . base . Objects . equal ( isRoleSuperadminInOldGroup , isRoleSuperadminInNewGroup ) ) || ( isCurrentUserShopOrSuperAdmin ( dataDefinition ) ) ) { return true ; } entity . addError ( dataDefinition . getField ( UserFields . GROUP ) , "qcadooUsers.validate.global.error.forbiddenRole" ) ; return false ; }
org . junit . Assert . assertTrue ( isValid )
testGetApplicationContext_fromFakeContext ( ) { applicationContext . activate ( ) ; org . eclipse . rap . rwt . internal . service . ServiceContext context = new org . eclipse . rap . rwt . internal . service . ServiceContext ( mock ( javax . servlet . http . HttpServletRequest . class ) , mock ( javax . servlet . http . HttpServletResponse . class ) , uiSession ) ; org . eclipse . rap . rwt . internal . application . ApplicationContextImpl found = context . getApplicationContext ( ) ; "<AssertPlaceHolder>" ; } getApplicationContext ( ) { org . eclipse . rap . rwt . RWT . checkContext ( ) ; return org . eclipse . rap . rwt . internal . service . ContextProvider . getApplicationContext ( ) ; }
org . junit . Assert . assertSame ( applicationContext , found )
testFilterArrayNullParameters ( ) { final java . io . File fileA = org . apache . commons . io . testtools . TestUtils . newFile ( getTestDirectory ( ) , "A" ) ; final java . io . File fileB = org . apache . commons . io . testtools . TestUtils . newFile ( getTestDirectory ( ) , "B" ) ; try { org . apache . commons . io . filefilter . FileFilterUtils . filter ( null , fileA , fileB ) ; org . junit . Assert . fail ( ) ; } catch ( final java . lang . IllegalArgumentException iae ) { } final org . apache . commons . io . filefilter . IOFileFilter filter = org . apache . commons . io . filefilter . FileFilterUtils . trueFileFilter ( ) ; try { org . apache . commons . io . filefilter . FileFilterUtils . filter ( filter , fileA , null ) ; org . junit . Assert . fail ( ) ; } catch ( final java . lang . IllegalArgumentException iae ) { } final java . io . File [ ] filtered = org . apache . commons . io . filefilter . FileFilterUtils . filter ( filter , ( ( java . io . File [ ] ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } filter ( org . apache . commons . io . filefilter . IOFileFilter , java . io . File [ ] ) { if ( filter == null ) { throw new java . lang . IllegalArgumentException ( "file<sp>filter<sp>is<sp>null" ) ; } if ( files == null ) { return new java . io . File [ 0 ] ; } final java . util . List < java . io . File > acceptedFiles = new java . util . ArrayList ( ) ; for ( final java . io . File file : files ) { if ( file == null ) { throw new java . lang . IllegalArgumentException ( "file<sp>array<sp>contains<sp>null" ) ; } if ( filter . accept ( file ) ) { acceptedFiles . add ( file ) ; } } return acceptedFiles . toArray ( new java . io . File [ acceptedFiles . size ( ) ] ) ; }
org . junit . Assert . assertEquals ( 0 , filtered . length )
shouldOnlyRunFirstExtractorIfItGetsAMatch ( ) { org . jsoup . nodes . Document document = createMock ( org . jsoup . nodes . Document . class ) ; org . jsoup . select . Elements elements = createMock ( org . jsoup . select . Elements . class ) ; org . jsoup . nodes . Element element = createMock ( org . jsoup . nodes . Element . class ) ; io . seldon . importer . articles . dynamicextractors . MultiSelectorDynamicExtractor extr = new io . seldon . importer . articles . dynamicextractors . MultiSelectorDynamicExtractor ( ) ; io . seldon . importer . articles . dynamicextractors . AttributeDetail attrDetail = new io . seldon . importer . articles . dynamicextractors . AttributeDetail ( ) ; io . seldon . importer . articles . dynamicextractors . AttributeDetail . SubExtractor extr1 = new io . seldon . importer . articles . dynamicextractors . AttributeDetail . SubExtractor ( ) ; io . seldon . importer . articles . dynamicextractors . AttributeDetail . SubExtractor extr2 = new io . seldon . importer . articles . dynamicextractors . AttributeDetail . SubExtractor ( ) ; extr1 . extractor_type = "FirstElementTextValue" ; extr1 . extractor_args = java . util . Arrays . asList ( "selector" ) ; extr2 . extractor_type = "FirstElementTextValue" ; extr2 . extractor_args = java . util . Arrays . asList ( "selector2" ) ; attrDetail . sub_types = java . util . Arrays . asList ( extr1 , extr2 ) ; expect ( document . select ( "selector" ) ) . andReturn ( elements ) ; expect ( elements . first ( ) ) . andReturn ( element ) ; expect ( element . text ( ) ) . andReturn ( "notEmpty" ) ; replay ( document , elements , element ) ; "<AssertPlaceHolder>" ; verify ( document , elements , element ) ; } extract ( io . seldon . importer . articles . dynamicextractors . AttributeDetail , java . lang . String , org . jsoup . nodes . Document ) { java . lang . String attrib_value = null ; if ( ( ( attributeDetail . extractor_args ) != null ) && ( ( attributeDetail . extractor_args . size ( ) ) == 1 ) ) { java . lang . String subCategoryClassPrefix = attributeDetail . extractor_args . get ( 0 ) ; if ( org . apache . commons . lang3 . StringUtils . isNotBlank ( subCategoryClassPrefix ) ) { java . lang . String className = ( "io.seldon.importer.articles.category." + subCategoryClassPrefix ) + "SubCategoryExtractor" ; java . lang . Class < ? > clazz = java . lang . Class . forName ( className ) ; java . lang . reflect . Constructor < ? > ctor = clazz . getConstructor ( ) ; io . seldon . importer . articles . category . CategoryExtractor extractor = ( ( io . seldon . importer . articles . category . CategoryExtractor ) ( ctor . newInstance ( ) ) ) ; attrib_value = extractor . getCategory ( url , articleDoc ) ; } } return attrib_value ; }
org . junit . Assert . assertEquals ( "notEmpty" , extr . extract ( attrDetail , null , document ) )
testSetArrowLengthListKONotSameSize ( ) { final java . util . List < java . util . Optional < java . lang . Double > > vals = java . util . Arrays . asList ( java . util . Optional . of ( arr1 . getArrowLength ( ) ) , java . util . Optional . of ( arr2 . getArrowLength ( ) ) ) ; group . setArrowLengthList ( java . util . Arrays . asList ( java . util . Optional . of ( 34.0 ) , java . util . Optional . of ( 22.0 ) ) ) ; "<AssertPlaceHolder>" ; } getArrowLength ( ) { return firstIArrowable ( ) . map ( ( sh ) -> sh . getArrowLength ( ) ) . orElse ( Double . NaN ) ; }
org . junit . Assert . assertEquals ( vals , java . util . Arrays . asList ( java . util . Optional . of ( arr1 . getArrowLength ( ) ) , java . util . Optional . of ( arr2 . getArrowLength ( ) ) ) )
lessAndGreatNoDataTest ( ) { long start = 5 ; long end = 15 ; java . lang . String sql = ( "select<sp>*<sp>from<sp>" + ( normaltblTableName ) ) + "<sp>where<sp>pk<?<sp>and<sp>pk>?" ; java . util . List < java . lang . Object > param = new java . util . ArrayList < java . lang . Object > ( ) ; param . add ( start ) ; param . add ( end ) ; { rs = mysqlQueryData ( sql , param ) ; rc = andorQueryData ( sql , param ) ; "<AssertPlaceHolder>" ; } } resultsSize ( java . sql . ResultSet ) { int row = 0 ; while ( rs . next ( ) ) { row ++ ; } return row ; }
org . junit . Assert . assertEquals ( resultsSize ( rs ) , resultsSize ( rc ) )
index ( ) { "<AssertPlaceHolder>" ; } index ( org . springframework . ui . Model ) { return org . sentilo . web . catalog . utils . Constants . VIEW_HOME ; }
org . junit . Assert . assertEquals ( Constants . VIEW_HOME , controller . index ( model ) )
updateValueObjects_emptyParameters ( ) { org . oscm . ui . dialog . mp . wizards . JsonConverter jc = new org . oscm . ui . dialog . mp . wizards . JsonConverter ( ) ; bean . setJsonConverter ( spy ( jc ) ) ; org . oscm . ui . dialog . mp . wizards . JsonObject parameters = givenParameters ( ) ; int originalHash = model . hashCode ( ) ; bean . getJsonConverter ( ) . updateValueObjects ( parameters , bean . getModel ( ) . getService ( ) ) ; "<AssertPlaceHolder>" ; verify ( bean . getJsonConverter ( ) , never ( ) ) . logParameterNotFound ( anyString ( ) ) ; } hashCode ( ) { int hc = 13 ; int multiplier = 37 ; hc = ( hc * multiplier ) + ( java . lang . Long . valueOf ( startTime ) . hashCode ( ) ) ; hc = ( hc * multiplier ) + ( java . lang . Long . valueOf ( endTime ) . hashCode ( ) ) ; return hc ; }
org . junit . Assert . assertEquals ( originalHash , model . hashCode ( ) )
testViewListTemplate ( ) { com . ewcms . publication . freemarker . preview . PreviewService service = newPreviewService ( ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; boolean mock = false ; service . viewListTemplate ( out , new com . ewcms . core . site . model . Site ( ) , new com . ewcms . core . site . model . Channel ( ) , initTemplate ( "index.html" ) , mock ) ; "<AssertPlaceHolder>" ; out . close ( ) ; } size ( ) { return this . size ; }
org . junit . Assert . assertTrue ( ( ( out . size ( ) ) > 0 ) )
testSave ( ) { org . jbei . ice . storage . model . Account account = org . jbei . ice . lib . AccountCreator . createTestAccount ( "testSave" , false ) ; org . jbei . ice . storage . model . Group group = new org . jbei . ice . storage . model . Group ( ) ; group . setOwner ( account ) ; group . setLabel ( "group<sp>label" ) ; group . setDescription ( "group<sp>description" ) ; "<AssertPlaceHolder>" ; } save ( org . jbei . ice . storage . model . Account ) { account . setModificationTime ( java . util . Calendar . getInstance ( ) . getTime ( ) ) ; if ( ( ( account . getSalt ( ) ) == null ) || ( account . getSalt ( ) . isEmpty ( ) ) ) { account . setSalt ( org . jbei . ice . lib . utils . Utils . generateSaltForUserAccount ( ) ) ; } return dao . create ( account ) ; }
org . junit . Assert . assertNotNull ( controller . save ( group ) )
should_return_a_Collection_without_null_elements ( ) { java . lang . String [ ] array = new java . lang . String [ ] { "Frodo" , null , "Sam" , null } ; java . util . List < java . lang . String > nonNull = org . fest . util . Arrays . nonNullElementsIn ( array ) ; "<AssertPlaceHolder>" ; } nonNullElementsIn ( T [ ] ) { org . fest . util . Preconditions . checkNotNull ( array ) ; java . util . List < T > nonNullElements = new java . util . ArrayList < T > ( ) ; for ( T o : array ) { if ( o != null ) { nonNullElements . add ( o ) ; } } return nonNullElements ; }
org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "Frodo" , "Sam" } , nonNull . toArray ( ) )
testKafkaFindMultiple ( ) { final java . lang . String topicName = testName . getMethodName ( ) ; org . apache . metron . management . KafkaFunctionsIntegrationTest . variables . put ( "topic" , topicName ) ; java . util . concurrent . Future < java . lang . Object > future = runAsync ( "KAFKA_FIND(topic,<sp>m<sp>-><sp>true,<sp>2)" ) ; runAsyncAndWait ( java . util . Collections . nCopies ( 10 , "KAFKA_PUT(topic,<sp>[message2])" ) ) ; java . util . List < java . lang . String > expected = new java . util . ArrayList < java . lang . String > ( ) { { add ( org . apache . metron . management . KafkaFunctionsIntegrationTest . message2 ) ; add ( org . apache . metron . management . KafkaFunctionsIntegrationTest . message2 ) ; } } ; java . lang . Object actual = future . get ( 10 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } get ( java . util . Map , java . lang . Class ) { java . lang . Object o = properties . getOrDefault ( key , defaultValue ) ; return o == null ? null : org . apache . metron . stellar . common . utils . ConversionUtils . convert ( o , clazz ) ; }
org . junit . Assert . assertEquals ( expected , actual )
getFieldsOverride ( ) { com . xpn . xwiki . objects . BaseObject o = org . mockito . Mockito . mock ( com . xpn . xwiki . objects . BaseObject . class ) ; java . util . List < java . lang . String > fields = new java . util . LinkedList ( ) ; fields . add ( "external_id" ) ; fields . add ( "gender" ) ; fields . add ( "name" ) ; fields . add ( "phenotype" ) ; org . mockito . Mockito . when ( o . getListValue ( "fields" ) ) . thenReturn ( fields ) ; org . phenotips . studies . internal . StudyConfiguration result = new org . phenotips . studies . internal . StudyConfiguration ( o ) ; "<AssertPlaceHolder>" ; } getFieldsOverride ( ) { return this . configuration . getListValue ( "fields" ) ; }
org . junit . Assert . assertSame ( fields , result . getFieldsOverride ( ) )
testLocalBuild ( ) { prepareLocalFullBuild ( ) ; when ( localBinaryConfig . getBuildResults ( ) ) . thenReturn ( buildResults ) ; org . guvnor . common . services . project . builder . model . BuildResults result = serviceHelper . localBuild ( module ) ; "<AssertPlaceHolder>" ; verify ( pipelineInvoker , times ( 1 ) ) . invokeLocalBuildPipeLine ( eq ( expectedRequest ) , any ( java . util . function . Consumer . class ) ) ; } localBuild ( org . guvnor . common . services . project . model . Module ) { final org . guvnor . common . services . project . builder . model . BuildResults [ ] result = new org . guvnor . common . services . project . builder . model . BuildResults [ 1 ] ; invokeLocalBuildPipeLine ( module , ( localBinaryConfig ) -> { result [ 0 ] = localBinaryConfig . getBuildResults ( ) ; } ) ; return result [ 0 ] ; }
org . junit . Assert . assertEquals ( buildResults , result )
test_with_nostatic_class ( ) { org . apache . sling . commons . testing . osgi . MockBundle bundle = new org . apache . sling . commons . testing . osgi . MockBundle ( ( - 1 ) ) ; org . apache . sling . commons . testing . osgi . MockComponentContext ctx = new org . apache . sling . commons . testing . osgi . MockComponentContext ( bundle ) ; ctx . setProperty ( "prefixes" , new java . lang . String [ ] { "/etc/clientlib" } ) ; ctx . setProperty ( "host.pattern" , "static.host.com" ) ; com . adobe . acs . commons . rewriter . impl . StaticReferenceRewriteTransformerFactory factory = new com . adobe . acs . commons . rewriter . impl . StaticReferenceRewriteTransformerFactory ( ) ; factory . activate ( ctx ) ; org . apache . sling . rewriter . Transformer transformer = factory . createTransformer ( ) ; transformer . setContentHandler ( handler ) ; org . xml . sax . helpers . AttributesImpl in = new org . xml . sax . helpers . AttributesImpl ( ) ; in . addAttribute ( null , "href" , null , "CDATA" , "/etc/clientlib/test.css" ) ; in . addAttribute ( null , "class" , null , "CDATA" , "something<sp>nostatic" ) ; transformer . startElement ( null , "link" , null , in ) ; verify ( handler , only ( ) ) . startElement ( isNull ( java . lang . String . class ) , eq ( "link" ) , isNull ( java . lang . String . class ) , attributesCaptor . capture ( ) ) ; org . xml . sax . Attributes out = attributesCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( java . lang . Object ) { org . apache . sling . api . resource . Resource resource = ( ( org . apache . sling . api . resource . Resource ) ( result ) ) ; com . day . cq . tagging . TagManager tagMgr = resource . getResourceResolver ( ) . adaptTo ( com . day . cq . tagging . TagManager . class ) ; com . adobe . acs . commons . reports . models . TagReportCellCSVExporter . log . debug ( "Loading<sp>tags<sp>from<sp>{}@{}" , resource . getPath ( ) , property ) ; java . util . List < java . lang . String > tags = new java . util . ArrayList < java . lang . String > ( ) ; java . lang . String [ ] values = resource . getValueMap ( ) . get ( property , java . lang . String [ ] . class ) ; if ( values != null ) { for ( java . lang . String value : values ) { tags . add ( tagMgr . resolve ( value ) . getTitle ( ) ) ; } } com . adobe . acs . commons . reports . models . TagReportCellCSVExporter . log . debug ( "Loaded<sp>{}<sp>tags" , tags ) ; return org . apache . commons . lang3 . StringUtils . join ( tags , ";" ) ; }
org . junit . Assert . assertEquals ( "/etc/clientlib/test.css" , out . getValue ( 0 ) )
testGeboorteDatumKindOpAanvAdreshoudingMoeder ( ) { kind . getGeboorte ( ) . setDatumGeboorte ( 20120501 ) ; nl . bzk . brp . model . validatie . Melding melding = brpuc00120 . executeer ( null , nieuweSituatie , null ) ; "<AssertPlaceHolder>" ; } setDatumGeboorte ( nl . bzk . brp . pocmotor . model . gedeeld . usr . attribuuttype . Datum ) { this . datumGeboorte = datumGeboorte ; }
org . junit . Assert . assertNull ( melding )
simple ( ) { java . lang . String [ ] [ ] result = read ( "Hello,<sp>world!" ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( new java . lang . String [ ] [ ] { new java . lang . String [ ] { "Hello,<sp>world!" } } ) )
testCreateFromQuestionMarkYieldsEmptyQueryStringBuilder ( ) { java . lang . String query = "?" ; org . ocpsoft . rewrite . servlet . util . QueryStringBuilder qs = org . ocpsoft . rewrite . servlet . util . QueryStringBuilder . createFromEncoded ( query ) ; java . lang . String result = qs . toQueryString ( ) ; "<AssertPlaceHolder>" ; } toQueryString ( ) { java . lang . StringBuilder result = new java . lang . StringBuilder ( ) ; if ( ( null != ( parameters ) ) && ( ! ( parameters . isEmpty ( ) ) ) ) { result . append ( "?" ) ; java . util . Iterator < java . util . Map . Entry < java . lang . String , java . util . List < java . lang . String > > > iterator = parameters . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { java . util . Map . Entry < java . lang . String , java . util . List < java . lang . String > > entry = iterator . next ( ) ; java . lang . String key = entry . getKey ( ) ; java . util . List < java . lang . String > values = entry . getValue ( ) ; if ( ( key != null ) && ( ! ( "" . equals ( key ) ) ) ) { result . append ( key ) ; if ( ( values != null ) && ( ! ( values . isEmpty ( ) ) ) ) { for ( int i = 0 ; i < ( values . size ( ) ) ; i ++ ) { java . lang . String value = values . get ( i ) ; if ( ( value != null ) && ( ! ( "" . equals ( value ) ) ) ) { result . append ( ( "=" + value ) ) ; } else if ( ( value != null ) && ( "" . equals ( value ) ) ) { result . append ( "=" ) ; } if ( i < ( ( values . size ( ) ) - 1 ) ) { result . append ( ( "&" + key ) ) ; } } } } if ( iterator . hasNext ( ) ) { result . append ( "&" ) ; } } } return result . toString ( ) ; }
org . junit . Assert . assertTrue ( ( ( result . length ( ) ) == 0 ) )
customPropertyStyle ( ) { com . vaadin . flow . dom . Element element = com . vaadin . flow . dom . ElementFactory . createDiv ( ) ; com . vaadin . flow . dom . Style style = element . getStyle ( ) ; style . set ( "--some-variable" , "foo" ) ; "<AssertPlaceHolder>" ; } get ( com . vaadin . flow . internal . StateNode ) { assert node != null ; if ( com . vaadin . flow . dom . ShadowRoot . isShadowRoot ( node ) ) { return new com . vaadin . flow . dom . ShadowRoot ( node ) ; } else { throw new java . lang . IllegalArgumentException ( "Node<sp>is<sp>not<sp>valid<sp>as<sp>an<sp>element" ) ; } }
org . junit . Assert . assertEquals ( "foo" , style . get ( "--some-variable" ) )
testChangeStringEmpty ( ) { "<AssertPlaceHolder>" ; } determineChangeFromString ( java . lang . String ) { if ( input == null ) { return null ; } try { java . util . regex . Matcher matcher = org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . GERRIT_URL_PATTERN . matcher ( input ) ; if ( matcher . matches ( ) ) { java . lang . String first = matcher . group ( 1 ) ; java . lang . String second = matcher . group ( 2 ) ; java . lang . String third = matcher . group ( 3 ) ; if ( ( second != null ) && ( ! ( second . isEmpty ( ) ) ) ) { if ( ( third != null ) && ( ! ( third . isEmpty ( ) ) ) ) { return org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . Change . create ( java . lang . Integer . parseInt ( second ) , java . lang . Integer . parseInt ( third ) ) ; } else if ( input . startsWith ( "http" ) ) { return org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . Change . create ( java . lang . Integer . parseInt ( first ) , java . lang . Integer . parseInt ( second ) ) ; } else { int firstNum = java . lang . Integer . parseInt ( first ) ; int secondNum = java . lang . Integer . parseInt ( second ) ; if ( firstNum > secondNum ) { return org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . Change . create ( firstNum , secondNum ) ; } else { return org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . Change . create ( secondNum ) ; } } } else { return org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . Change . create ( java . lang . Integer . parseInt ( first ) ) ; } } matcher = org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . GERRIT_CHANGE_REF_PATTERN . matcher ( input ) ; if ( matcher . matches ( ) ) { int firstNum = java . lang . Integer . parseInt ( matcher . group ( 2 ) ) ; java . lang . String second = matcher . group ( 3 ) ; if ( second != null ) { return org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . Change . create ( firstNum , java . lang . Integer . parseInt ( second ) ) ; } else { return org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . Change . create ( firstNum ) ; } } } catch ( java . lang . NumberFormatException e ) { } return null ; }
org . junit . Assert . assertNull ( org . eclipse . egit . ui . internal . fetch . FetchGerritChangePage . determineChangeFromString ( "" ) )
shouldReturnGivenValue ( ) { java . lang . Object value = new java . lang . Object ( ) ; org . junit . contrib . theories . PotentialAssignment assignment = org . junit . contrib . theories . PotentialAssignment . forValue ( "name" , value ) ; "<AssertPlaceHolder>" ; } getValue ( ) { try { return fMethod . invokeExplosively ( null ) ; } catch ( java . lang . IllegalArgumentException e ) { throw new java . lang . RuntimeException ( "unexpected:<sp>argument<sp>length<sp>is<sp>checked" ) ; } catch ( java . lang . IllegalAccessException e ) { throw new java . lang . RuntimeException ( "unexpected:<sp>getMethods<sp>returned<sp>an<sp>inaccessible<sp>method" ) ; } catch ( java . lang . Throwable throwable ) { org . junit . contrib . theories . DataPoint annotation = fMethod . getAnnotation ( org . junit . contrib . theories . DataPoint . class ) ; org . junit . Assume . assumeTrue ( ( ( annotation == null ) || ( ! ( org . junit . contrib . theories . internal . AllMembersSupplier . isAssignableToAnyOf ( annotation . ignoredExceptions ( ) , throwable ) ) ) ) ) ; throw new org . junit . contrib . theories . internal . CouldNotGenerateValueException ( throwable ) ; } }
org . junit . Assert . assertEquals ( value , assignment . getValue ( ) )
testGetFromNeuron ( ) { org . neuroph . core . Connection instance = new org . neuroph . core . Connection ( fromNeuron , toNeuron ) ; org . neuroph . core . Neuron expResult = fromNeuron ; org . neuroph . core . Neuron result = instance . getFromNeuron ( ) ; "<AssertPlaceHolder>" ; } getFromNeuron ( ) { return fromNeuron ; }
org . junit . Assert . assertEquals ( expResult , result )
lt ( ) { io . robe . hibernate . criteria . api . criterion . Restriction expectedRestriction = new io . robe . hibernate . criteria . api . criterion . Restriction ( io . robe . hibernate . criteria . query . Operator . LESS_THAN , "age" , 3 ) ; io . robe . hibernate . criteria . api . criterion . Restriction restriction = io . robe . hibernate . criteria . api . criterion . Restrictions . lt ( "age" , 3 ) ; "<AssertPlaceHolder>" ; } lt ( java . lang . String , java . lang . Object ) { return new io . robe . hibernate . criteria . api . criterion . Restriction ( io . robe . hibernate . criteria . query . Operator . LESS_THAN , name , Object ) ; }
org . junit . Assert . assertEquals ( expectedRestriction , restriction )
testFindMeasurementsAndProviders ( ) { "<AssertPlaceHolder>" ; } findMeasurementsAndProviders ( java . lang . Integer ) { java . lang . String sql = "FROM<sp>Measurement<sp>m,<sp>MeasurementType<sp>mt,<sp>Provider<sp>p<sp>" + ( ( "WHERE<sp>m.providerNo<sp>=<sp>p.ProviderNo<sp>" + "AND<sp>m.id<sp>=<sp>:mrId<sp>" ) + "AND<sp>m.type<sp>=<sp>mt.type" ) ; javax . persistence . Query query = entityManager . createQuery ( sql ) ; query . setParameter ( "mrId" , measurementId ) ; return query . getResultList ( ) ; }
org . junit . Assert . assertNotNull ( dao . findMeasurementsAndProviders ( 100 ) )
testSetChild ( ) { com . example . stock . StockQuoteOffer wrapper = new com . example . stock . StockQuoteOffer ( ) ; handler . setChild ( wrapper , 0 , new org . apache . tuscany . sca . interfacedef . util . ElementInfo ( org . apache . tuscany . sca . databinding . jaxb . JAXBWrapperHandlerTestCase . INPUT , null ) , "IBM" ) ; "<AssertPlaceHolder>" ; } getInput ( ) { return this . input ; }
org . junit . Assert . assertEquals ( "IBM" , wrapper . getInput ( ) )
shouldWatchRegisteredFolderForFileRemoval ( ) { service . register ( rootFolder . getRoot ( ) . toPath ( ) ) ; java . io . File file = rootFolder . newFile ( org . eclipse . che . api . watcher . server . impl . FileWatcherServiceTest . FILE_NAME ) ; java . nio . file . Path path = file . toPath ( ) ; verify ( handler , timeout ( org . eclipse . che . api . watcher . server . impl . FileWatcherServiceTest . TIMEOUT_VALUE ) ) . handle ( path , org . eclipse . che . api . watcher . server . impl . ENTRY_CREATE ) ; boolean deleted = file . delete ( ) ; "<AssertPlaceHolder>" ; verify ( handler , timeout ( org . eclipse . che . api . watcher . server . impl . FileWatcherServiceTest . TIMEOUT_VALUE ) ) . handle ( path , org . eclipse . che . api . watcher . server . impl . ENTRY_DELETE ) ; } delete ( ) { try { clientFactory . create ( workspaceId ) . services ( ) . inNamespace ( namespace ) . withLabel ( org . eclipse . che . workspace . infrastructure . kubernetes . Constants . CHE_WORKSPACE_ID_LABEL , workspaceId ) . delete ( ) ; } catch ( io . fabric8 . kubernetes . client . KubernetesClientException e ) { throw new org . eclipse . che . workspace . infrastructure . kubernetes . KubernetesInfrastructureException ( e ) ; } }
org . junit . Assert . assertTrue ( deleted )