input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testIsServiceReady_WhenComponentStatusConditionTrue_ServiceReady ( ) { io . fabric8 . kubernetes . api . model . ComponentStatus componentStatus = newComponentStatus ( "Healthy" , "True" ) ; mockComponentStatus ( componentStatus ) ; boolean isServiceReady = this . api . isServiceReady ( ) ; "<AssertPlaceHolder>" ; } isServiceReady ( ) { boolean result = false ; try { io . fabric8 . kubernetes . api . model . ComponentStatus status = getKubernetesClient ( ) . componentstatuses ( ) . withName ( org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . K8S_CONTROLLER_COMPONENT_NAME ) . get ( ) ; if ( status == null ) { org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . LOG . warn ( java . lang . String . format ( "Kubernetes<sp>returned<sp>a<sp>null<sp>component<sp>for<sp>%s." , org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . K8S_CONTROLLER_COMPONENT_NAME ) ) ; return result ; } if ( ( status . getConditions ( ) ) == null ) { org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . LOG . warn ( java . lang . String . format ( "Kubernetes<sp>returned<sp>null<sp>conditions<sp>for<sp>the<sp>component<sp>%s." , org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . K8S_CONTROLLER_COMPONENT_NAME ) ) ; return result ; } java . util . Optional < io . fabric8 . kubernetes . api . model . ComponentCondition > healthyCondition = status . getConditions ( ) . stream ( ) . filter ( ( condition ) -> condition . getType ( ) . equals ( org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . K8S_HEALTHY_STATUS_NAME ) ) . findFirst ( ) ; if ( ! ( healthyCondition . isPresent ( ) ) ) { org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . LOG . warn ( java . lang . String . format ( "Kubernetes<sp>did<sp>not<sp>returned<sp>a<sp>condition<sp>with<sp>name<sp>%s<sp>for<sp>the<sp>component<sp>%s.<sp>Count<sp>of<sp>returned<sp>conditions:<sp>%s." , org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . K8S_HEALTHY_STATUS_NAME , org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . K8S_CONTROLLER_COMPONENT_NAME , status . getConditions ( ) . size ( ) ) ) ; return result ; } if ( healthyCondition . get ( ) . getStatus ( ) . equals ( org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . K8S_HEALTHY_STATUS_TRUE ) ) { result = true ; } else { org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . LOG . warn ( java . lang . String . format ( "Kubernetes<sp>returned<sp>a<sp>health<sp>status<sp>%s<sp>for<sp>the<sp>component<sp>%s." , healthyCondition . get ( ) . getStatus ( ) , org . osc . core . broker . rest . client . k8s . KubernetesStatusApi . K8S_CONTROLLER_COMPONENT_NAME ) ) ; } } catch ( io . fabric8 . kubernetes . client . KubernetesClientException e ) { throw new org . osc . core . broker . service . exceptions . VmidcException ( "Failed<sp>to<sp>get<sp>the<sp>Kubernetes<sp>controller<sp>health<sp>status." ) ; } return result ; }
org . junit . Assert . assertTrue ( isServiceReady )
testDifferentQuartzTimeZones ( ) { final com . google . common . base . Optional < java . lang . String > schedule = com . google . common . base . Optional . of ( "*<sp>30<sp>14<sp>22<sp>3<sp>?<sp>2083" ) ; com . hubspot . singularity . SingularityRequest requestEST = new com . hubspot . singularity . SingularityRequestBuilder ( "est_id" , com . hubspot . singularity . RequestType . SCHEDULED ) . setSchedule ( schedule ) . setScheduleType ( com . google . common . base . Optional . of ( ScheduleType . QUARTZ ) ) . setScheduleTimeZone ( com . google . common . base . Optional . of ( "EST" ) ) . build ( ) ; com . hubspot . singularity . SingularityRequest requestGMT = new com . hubspot . singularity . SingularityRequestBuilder ( "gmt_id" , com . hubspot . singularity . RequestType . SCHEDULED ) . setSchedule ( schedule ) . setScheduleType ( com . google . common . base . Optional . of ( ScheduleType . QUARTZ ) ) . setScheduleTimeZone ( com . google . common . base . Optional . of ( "GMT" ) ) . build ( ) ; requestResource . postRequest ( requestEST , singularityUser ) ; requestResource . postRequest ( requestGMT , singularityUser ) ; com . hubspot . singularity . SingularityDeploy deployEST = new com . hubspot . singularity . SingularityDeployBuilder ( requestEST . getId ( ) , "est_deploy_id" ) . setCommand ( com . google . common . base . Optional . of ( "sleep<sp>1" ) ) . build ( ) ; com . hubspot . singularity . SingularityDeploy deployGMT = new com . hubspot . singularity . SingularityDeployBuilder ( requestGMT . getId ( ) , "gmt_deploy_id" ) . setCommand ( com . google . common . base . Optional . of ( "sleep<sp>1" ) ) . build ( ) ; deployResource . deploy ( new com . hubspot . singularity . api . SingularityDeployRequest ( deployEST , com . google . common . base . Optional . absent ( ) , com . google . common . base . Optional . absent ( ) , com . google . common . base . Optional . absent ( ) ) , singularityUser ) ; deployResource . deploy ( new com . hubspot . singularity . api . SingularityDeployRequest ( deployGMT , com . google . common . base . Optional . absent ( ) , com . google . common . base . Optional . absent ( ) , com . google . common . base . Optional . absent ( ) ) , singularityUser ) ; deployChecker . checkDeploys ( ) ; scheduler . drainPendingQueue ( ) ; final long nextRunEST ; final long nextRunGMT ; final long fiveHoursInMilliseconds = TimeUnit . HOURS . toMillis ( 5 ) ; final java . util . List < com . hubspot . singularity . SingularityPendingTaskId > pendingTaskIds = taskManager . getPendingTaskIds ( ) ; if ( pendingTaskIds . get ( 0 ) . getRequestId ( ) . equals ( requestEST . getId ( ) ) ) { nextRunEST = pendingTaskIds . get ( 0 ) . getNextRunAt ( ) ; nextRunGMT = pendingTaskIds . get ( 1 ) . getNextRunAt ( ) ; } else { nextRunEST = pendingTaskIds . get ( 1 ) . getNextRunAt ( ) ; nextRunGMT = pendingTaskIds . get ( 0 ) . getNextRunAt ( ) ; } "<AssertPlaceHolder>" ; } getNextRunAt ( ) { return nextRunAt ; }
org . junit . Assert . assertEquals ( ( nextRunEST - nextRunGMT ) , fiveHoursInMilliseconds )
testRelateWithMatrix ( ) { java . sql . Statement st = cx . createStatement ( ) ; java . sql . ResultSet rs = st . executeQuery ( "SELECT<sp>ST_Relate(ST_GeomFromText('POINT(1<sp>2)',4326),<sp>ST_Buffer(ST_GeomFromText('POINT(1<sp>2)',4326),2),<sp>'0FFFFFFF2')" ) ; rs . next ( ) ; boolean result = rs . getBoolean ( 1 ) ; st . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { }
org . junit . Assert . assertTrue ( result )
readUI16DoesNotSignExtend ( ) { final byte [ ] data = new byte [ ] { - 1 , 0 , 0 , 0 } ; final java . io . ByteArrayInputStream stream = new java . io . ByteArrayInputStream ( data ) ; final com . flagstone . transform . coder . LittleDecoder fixture = new com . flagstone . transform . coder . LittleDecoder ( stream ) ; "<AssertPlaceHolder>" ; } readUnsignedShort ( ) { if ( ( ( size ) - ( index ) ) < 2 ) { fill ( ) ; } if ( ( ( index ) + 2 ) > ( size ) ) { throw new java . lang . ArrayIndexOutOfBoundsException ( ) ; } int value = ( buffer [ ( ( index ) ++ ) ] ) & ( com . flagstone . transform . coder . SWFDecoder . BYTE_MASK ) ; value |= ( ( buffer [ ( ( index ) ++ ) ] ) & ( com . flagstone . transform . coder . SWFDecoder . BYTE_MASK ) ) << ( com . flagstone . transform . coder . SWFDecoder . TO_BYTE1 ) ; return value ; }
org . junit . Assert . assertEquals ( 255 , fixture . readUnsignedShort ( ) )
validFeatureOneIncludeTagNoScenarioTagsTest ( ) { java . lang . String featureContent = "@featureTag\n" + ( ( "Feature:<sp>test<sp>feature\n" + "\n" ) + "Scenario:<sp>scenario<sp>1" ) ; when ( propertyManager . getIncludeScenarioTags ( ) ) . thenReturn ( "@tag1" ) ; java . util . List < com . trivago . vo . SingleScenario > singleScenariosFromFeature = gherkinDocumentParser . getSingleScenariosFromFeature ( featureContent , "" , null ) ; "<AssertPlaceHolder>" ; } getSingleScenariosFromFeature ( java . lang . String , java . lang . String , java . util . List ) { java . lang . String escapedFeatureContent = featureContent . replace ( "\\n" , "\\\\n" ) ; gherkin . ast . GherkinDocument gherkinDocument = getGherkinDocumentFromFeatureFileContent ( escapedFeatureContent ) ; gherkin . ast . Feature feature = gherkinDocument . getFeature ( ) ; java . lang . String featureName = ( ( feature . getKeyword ( ) ) + ":<sp>" ) + ( feature . getName ( ) ) ; java . lang . String featureLanguage = feature . getLanguage ( ) ; java . lang . String featureDescription = feature . getDescription ( ) ; java . util . List < java . lang . String > featureTags = gherkinToCucableConverter . convertGherkinTagsToCucableTags ( feature . getTags ( ) ) ; java . util . ArrayList < com . trivago . vo . SingleScenario > singleScenarioFeatures = new java . util . ArrayList ( ) ; java . util . List < com . trivago . vo . Step > backgroundSteps = new java . util . ArrayList ( ) ; java . util . List < gherkin . ast . ScenarioDefinition > scenarioDefinitions = feature . getChildren ( ) ; for ( gherkin . ast . ScenarioDefinition scenarioDefinition : scenarioDefinitions ) { java . lang . String scenarioName = ( ( scenarioDefinition . getKeyword ( ) ) + ":<sp>" ) + ( scenarioDefinition . getName ( ) ) ; java . lang . String scenarioDescription = scenarioDefinition . getDescription ( ) ; if ( scenarioDefinition instanceof gherkin . ast . Background ) { gherkin . ast . Background background = ( ( gherkin . ast . Background ) ( scenarioDefinition ) ) ; backgroundSteps = gherkinToCucableConverter . convertGherkinStepsToCucableSteps ( background . getSteps ( ) ) ; continue ; } if ( scenarioDefinition instanceof gherkin . ast . Scenario ) { gherkin . ast . Scenario scenario = ( ( gherkin . ast . Scenario ) ( scenarioDefinition ) ) ; if ( ( ( scenarioLineNumbers == null ) || ( scenarioLineNumbers . isEmpty ( ) ) ) || ( scenarioLineNumbers . contains ( scenario . getLocation ( ) . getLine ( ) ) ) ) { com . trivago . vo . SingleScenario singleScenario = new com . trivago . vo . SingleScenario ( featureName , featureFilePath , featureLanguage , featureDescription , scenarioName , scenarioDescription , featureTags , backgroundSteps ) ; addGherkinScenarioInformationToSingleScenario ( scenario , singleScenario ) ; if ( scenarioShouldBeIncluded ( singleScenario . getScenarioTags ( ) , singleScenario . getFeatureTags ( ) ) ) { singleScenarioFeatures . add ( singleScenario ) ; } } continue ; } if ( scenarioDefinition instanceof gherkin . ast . ScenarioOutline ) { gherkin . ast . ScenarioOutline scenarioOutline = ( ( gherkin . ast . ScenarioOutline ) ( scenarioDefinition ) ) ; if ( ( ( scenarioLineNumbers == null ) || ( scenarioLineNumbers . isEmpty ( ) ) ) || ( scenarioLineNumbers . contains ( scenarioOutline . getLocation ( ) . getLine ( ) ) ) ) { java . util . List < com . trivago . vo . SingleScenario > outlineScenarios = getSingleScenariosFromOutline ( scenarioOutline , featureName , featureFilePath , featureLanguage , featureDescription , featureTags , backgroundSteps ) ; for ( com . trivago . vo . SingleScenario singleScenario : outlineScenarios ) { if ( scenarioShouldBeIncluded ( singleScenario . getScenarioTags ( ) , singleScenario . getFeatureTags ( ) , singleScenario . getExampleTags ( ) ) ) { singleScenarioFeatures . add ( singleScenario ) ; } } } } } return singleScenarioFeatures ; }
org . junit . Assert . assertThat ( singleScenariosFromFeature . size ( ) , org . hamcrest . core . Is . is ( 0 ) )
should_apply_comparator_NotEqualIgnoreCase ( ) { final java . lang . String name = "findByNameNotEqualIgnoreCase" ; final java . lang . String expected = "select<sp>e<sp>from<sp>Simple<sp>e<sp>" + "where<sp>upper(e.name)<sp><><sp>upper(?1)" ; java . lang . String result = org . apache . deltaspike . data . impl . builder . part . QueryRoot . create ( name , repo , prefix ( name ) ) . getJpqlQuery ( ) . trim ( ) ; "<AssertPlaceHolder>" ; } getJpqlQuery ( ) { return jpqlQuery ; }
org . junit . Assert . assertEquals ( expected , result )
link$skip0_AssociationEnd ( ) { org . json . simple . JSONObject body = new org . json . simple . JSONObject ( ) ; try { body . put ( "__id" , toUserDataId ) ; createUserData ( body , HttpStatus . SC_CREATED , Setup . TEST_CELL1 , Setup . TEST_BOX1 , Setup . TEST_ODATA , "Sales" ) ; body . put ( "__id" , fromUserDataId ) ; createUserData ( body , HttpStatus . SC_CREATED , Setup . TEST_CELL1 , Setup . TEST_BOX1 , Setup . TEST_ODATA , "srcPath" 1 ) ; linkUserData ( "Sales" , toUserDataId , "srcPath" 1 , fromUserDataId ) ; com . fujitsu . dc . test . utils . TResponse res = com . fujitsu . dc . test . utils . Http . request ( "box/odatacol/list-link-with-query.txt" ) . with ( "cellPath" , Setup . TEST_CELL1 ) . with ( "srcPath" 2 , Setup . TEST_BOX1 ) . with ( "srcPath" 0 , Setup . TEST_ODATA ) . with ( "srcPath" , ( ( ( "srcPath" 1 + "srcPath" 3 ) + ( fromUserDataId ) ) + "srcPath" 4 ) ) . with ( "trgPath" , "Sales" ) . with ( "srcPath" 6 , "srcPath" 5 ) . with ( "token" , com . fujitsu . dc . core . DcCoreConfig . getMasterToken ( ) ) . with ( "accept" , MediaType . APPLICATION_JSON ) . returns ( ) . statusCode ( HttpStatus . SC_OK ) . debug ( ) ; org . json . simple . JSONArray results = ( ( org . json . simple . JSONArray ) ( ( ( org . json . simple . JSONObject ) ( res . bodyAsJson ( ) . get ( "d" ) ) ) . get ( "results" ) ) ) ; "<AssertPlaceHolder>" ; } finally { deleteUserDataLinks ( "Sales" , toUserDataId , "srcPath" 1 , fromUserDataId ) ; deleteUserData ( Setup . TEST_CELL1 , Setup . TEST_BOX1 , Setup . TEST_ODATA , "srcPath" 1 , fromUserDataId , com . fujitsu . dc . core . DcCoreConfig . getMasterToken ( ) , HttpStatus . SC_NO_CONTENT ) ; deleteUserData ( Setup . TEST_CELL1 , Setup . TEST_BOX1 , Setup . TEST_ODATA , "Sales" , toUserDataId , com . fujitsu . dc . core . DcCoreConfig . getMasterToken ( ) , HttpStatus . SC_NO_CONTENT ) ; } } get ( java . lang . String ) { com . fujitsu . dc . test . jersey . DcRequest req = new com . fujitsu . dc . test . jersey . DcRequest ( url ) ; req . method = javax . ws . rs . HttpMethod . GET ; return req ; }
org . junit . Assert . assertEquals ( 1 , results . size ( ) )
getTablesToRepairRemoveTwoTablesOneWithTwcsTest ( ) { io . cassandrareaper . jmx . JmxProxy proxy = io . cassandrareaper . jmx . JmxProxyTest . mockJmxProxyImpl ( ) ; when ( context . jmxConnectionFactory . connectAny ( cluster ) ) . thenReturn ( proxy ) ; when ( context . jmxConnectionFactory . connectAny ( org . mockito . Mockito . any ( java . util . Collection . class ) ) ) . thenReturn ( proxy ) ; when ( proxy . getTablesForKeyspace ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( com . google . common . collect . Sets . newHashSet ( io . cassandrareaper . core . Table . builder ( ) . withName ( "table1" ) . withCompactionStrategy ( io . cassandrareaper . service . RepairUnitServiceTest . STCS ) . build ( ) , io . cassandrareaper . core . Table . builder ( ) . withName ( "table2" ) . withCompactionStrategy ( io . cassandrareaper . service . RepairUnitServiceTest . STCS ) . build ( ) , io . cassandrareaper . core . Table . builder ( ) . withName ( "table3" ) . withCompactionStrategy ( io . cassandrareaper . service . RepairUnitServiceTest . TWCS ) . build ( ) ) ) ; io . cassandrareaper . core . RepairUnit unit = io . cassandrareaper . core . RepairUnit . builder ( ) . clusterName ( cluster . getName ( ) ) . keyspaceName ( "test" ) . blacklistedTables ( com . google . common . collect . Sets . newHashSet ( "table1" ) ) . incrementalRepair ( false ) . repairThreadCount ( 4 ) . build ( com . datastax . driver . core . utils . UUIDs . timeBased ( ) ) ; "<AssertPlaceHolder>" ; } getTablesToRepair ( io . cassandrareaper . jmx . JmxProxy , io . cassandrareaper . core . Cluster , io . cassandrareaper . core . RepairUnit ) { java . lang . String keyspace = repairUnit . getKeyspaceName ( ) ; java . util . Set < java . lang . String > tables ; if ( repairUnit . getColumnFamilies ( ) . isEmpty ( ) ) { java . util . Set < java . lang . String > twcsBlacklisted = findBlacklistedCompactionStrategyTables ( cluster , keyspace ) ; tables = proxy . getTablesForKeyspace ( keyspace ) . stream ( ) . map ( Table :: getName ) . filter ( ( tableName ) -> ! ( repairUnit . getBlacklistedTables ( ) . contains ( tableName ) ) ) . filter ( ( tableName ) -> ! ( twcsBlacklisted . contains ( tableName ) ) ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; } else { tables = repairUnit . getColumnFamilies ( ) . stream ( ) . filter ( ( tableName ) -> ! ( repairUnit . getBlacklistedTables ( ) . contains ( tableName ) ) ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; } com . google . common . base . Preconditions . checkState ( ( ( repairUnit . getBlacklistedTables ( ) . isEmpty ( ) ) || ( ! ( tables . isEmpty ( ) ) ) ) , "Invalid<sp>blacklist<sp>definition.<sp>It<sp>filtered<sp>out<sp>all<sp>tables<sp>in<sp>the<sp>keyspace." ) ; return tables ; }
org . junit . Assert . assertEquals ( com . google . common . collect . Sets . newHashSet ( "table2" ) , service . getTablesToRepair ( proxy , cluster , unit ) )
testWSIntegerValueUpdate ( ) { boolean result = ihcResourceInteractionService . resourceUpdate ( new org . openhab . binding . ihc . internal . ws . resourcevalues . WSIntegerValue ( 400004 , 201 , ( - 1000 ) , 1000 ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( result )
testGetNameWithArithmeticColumn ( ) { org . sagebionetworks . table . query . model . DerivedColumn element = org . sagebionetworks . table . query . util . SqlElementUntils . createDerivedColumn ( "5+foo" ) ; "<AssertPlaceHolder>" ; } getDisplayName ( ) { java . lang . String name = null ; if ( ( asClause ) != null ) { name = asClause . getFirstElementOfType ( org . sagebionetworks . table . query . model . ActualIdentifier . class ) . toSql ( ) ; } else { name = this . toSql ( ) ; } return org . sagebionetworks . table . query . model . DerivedColumn . stripLeadingAndTailingQuotes ( name ) ; }
org . junit . Assert . assertEquals ( "5+foo" , element . getDisplayName ( ) )
testHaRpcRequestWithTimeoutFailed ( ) { com . baidu . jprotobuf . pbrpc . spring . AnnotationEchoServiceClient annotationEchoServiceClient = ( ( com . baidu . jprotobuf . pbrpc . spring . AnnotationEchoServiceClient ) ( context . getBean ( "echoServiceClient" , com . baidu . jprotobuf . pbrpc . spring . AnnotationEchoServiceClient . class ) ) ) ; try { internalRpcRequestAndResponseTimeout ( annotationEchoServiceClient . namingServiceOfTimeoutFailed ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } }
org . junit . Assert . assertNotNull ( e )
testGetValue_FallbackNull ( ) { when ( primary . getValue ( row ) ) . thenReturn ( null ) ; when ( fallback . getValue ( row ) ) . thenReturn ( null ) ; "<AssertPlaceHolder>" ; verify ( fallbackIf , never ( ) ) . matches ( any ( ) ) ; } getValue ( io . lumify . mapping . column . AbstractColumnDocumentMapping . Row ) { java . lang . String value = null ; for ( int length = keyColumns . size ( ) ; ( value == null ) && ( length >= 0 ) ; length -- ) { value = valueMap . get ( buildKey ( row , length ) ) ; } return value ; }
org . junit . Assert . assertNull ( instance . getValue ( row ) )
testIfDifferenceIsNotChanged ( ) { org . onosproject . net . resource . DiscreteResource res1 = org . onosproject . net . resource . Resources . discrete ( org . onosproject . net . DeviceId . deviceId ( "a" ) ) . resource ( ) ; org . onosproject . net . resource . DiscreteResource res2 = org . onosproject . net . resource . Resources . discrete ( org . onosproject . net . DeviceId . deviceId ( "b" ) ) . resource ( ) ; org . onosproject . store . resource . impl . DiscreteResources sut = org . onosproject . store . resource . impl . GenericDiscreteResources . of ( com . google . common . collect . ImmutableSet . of ( res1 ) ) ; org . onosproject . store . resource . impl . DiscreteResources other = org . onosproject . store . resource . impl . GenericDiscreteResources . of ( com . google . common . collect . ImmutableSet . of ( res2 ) ) ; org . onosproject . store . resource . impl . DiscreteResources expected = org . onosproject . store . resource . impl . GenericDiscreteResources . of ( com . google . common . collect . ImmutableSet . of ( res1 ) ) ; "<AssertPlaceHolder>" ; } difference ( org . onosproject . store . resource . impl . DiscreteResources ) { if ( other instanceof org . onosproject . store . resource . impl . GenericDiscreteResources ) { return org . onosproject . store . resource . impl . GenericDiscreteResources . of ( new java . util . LinkedHashSet ( com . google . common . collect . Sets . difference ( this . values ( ) , other . values ( ) ) ) ) ; } else if ( other instanceof org . onosproject . store . resource . impl . EmptyDiscreteResources ) { return this ; } return org . onosproject . store . resource . impl . DiscreteResources . of ( com . google . common . collect . Sets . difference ( this . values ( ) , other . values ( ) ) ) ; }
org . junit . Assert . assertThat ( sut . difference ( other ) , org . hamcrest . Matchers . is ( expected ) )
testHashBaseForItemAnswersSkipsMissingResourcesForRichExtendedMatchingItems ( ) { final org . sakaiproject . tool . assessment . data . dao . assessment . ItemData item = newExtendedMatchingItem ( ) ; item . setAnswerOptionsSimpleOrRich ( ItemDataIfc . ANSWER_OPTIONS_RICH ) ; expectServerUrlLookup ( ) ; failResourceLookup ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 11 ] ) ; failResourceLookup ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 12 ] ) ; failResourceLookup ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 13 ] ) ; expectResourceLookupUnchecked ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 14 ] ) ; expectResourceLookupUnchecked ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 15 ] ) ; failResourceLookup ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 16 ] ) ; expectResourceLookupUnchecked ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 17 ] ) ; final java . lang . StringBuilder expectedHashBase = new java . lang . StringBuilder ( ) . append ( labeled ( "EmiAnswerOptionsRichText" , resourceDocTemplate1 ( fullUrlForContentResource ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 11 ] ) ) ) ) . append ( labeled ( "EmiCorrectOptionLabels" , "Answer<sp>Label<sp>3Answer<sp>Label<sp>5" ) ) . append ( labeled ( "EmiSequence" , ( "" + ( Long . MAX_VALUE ) ) ) ) . append ( labeled ( "EmiText" , resourceDocTemplate1 ( fullUrlForContentResource ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 12 ] ) ) ) ) . append ( expectedContentResourceHash1 ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 14 ] ) ) . append ( labeled ( "EmiCorrectOptionLabels" , "Answer<sp>Label<sp>6Answer<sp>Label<sp>8" ) ) . append ( labeled ( "EmiSequence" , ( "" + ( Long . MAX_VALUE ) ) ) ) . append ( labeled ( "EmiText" , resourceDocTemplate1 ( expectedContentResourceHash1 ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 15 ] ) ) ) ) . append ( expectedContentResourceHash1 ( org . sakaiproject . tool . assessment . facade . ItemHashUtilTest . CONTENT_RESOURCES [ 17 ] ) ) ; java . lang . StringBuilder actualHashBase = new java . lang . StringBuilder ( ) ; itemHashUtil . hashBaseForItemAnswers ( item , actualHashBase ) ; "<AssertPlaceHolder>" ; } toString ( ) { if ( name ( ) . equals ( "sessionId" ) ) { return "session-id" ; } else { return name ( ) ; } }
org . junit . Assert . assertThat ( actualHashBase . toString ( ) , org . hamcrest . CoreMatchers . equalTo ( expectedHashBase . toString ( ) ) )
byteTest ( ) { java . sql . PreparedStatement ps = sharedConnection . prepareStatement ( "insert<sp>into<sp>bytetest<sp>(a)<sp>values<sp>(?)" ) ; ps . setByte ( 1 , Byte . MAX_VALUE ) ; "<AssertPlaceHolder>" ; try ( java . sql . ResultSet rs = org . mariadb . jdbc . DatatypeTest . getResultSet ( "select<sp>a<sp>from<sp>bytetest" , false ) ) { byteTestResult ( rs ) ; } try ( java . sql . ResultSet rs = org . mariadb . jdbc . DatatypeTest . getResultSet ( "select<sp>a<sp>from<sp>bytetest" , true ) ) { byteTestResult ( rs ) ; } } execute ( ) { connection . lock . lock ( ) ; try { super . execute ( ) ; retrieveOutputResult ( ) ; return ( ( results ) != null ) && ( ( results . getResultSet ( ) ) == null ) ; } finally { connection . lock . unlock ( ) ; } }
org . junit . Assert . assertFalse ( ps . execute ( ) )
serialize ( ) { com . google . gson . Gson gson = com . github . seratch . jslack . common . json . GsonFactory . createSnakeCase ( ) ; com . github . seratch . jslack . api . model . event . StarAddedEvent event = new com . github . seratch . jslack . api . model . event . StarAddedEvent ( ) ; java . lang . String generatedJson = gson . toJson ( event ) ; java . lang . String expectedJson = "{\"type\":\"star_added\"}" ; "<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 ) )
testSetStatus ( ) { io . lumify . sql . model . user . SqlUser user = ( ( io . lumify . sql . model . user . SqlUser ) ( sqlUserRepository . addUser ( "123" , "abc" , null , null , new java . lang . String [ 0 ] ) ) ) ; sqlUserRepository . setStatus ( user . getUserId ( ) , UserStatus . ACTIVE ) ; io . lumify . sql . model . user . SqlUser testUser = ( ( io . lumify . sql . model . user . SqlUser ) ( sqlUserRepository . findById ( user . getUserId ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getUserStatus ( ) { return userStatus ; }
org . junit . Assert . assertEquals ( UserStatus . ACTIVE , testUser . getUserStatus ( ) )
testEqualsWithRiakObject ( ) { final com . basho . riak . client . core . query . RiakObject riakObject1 = com . basho . riak . client . core . query . RiakObjectTest . CreateFilledObject ( ) ; final com . basho . riak . client . core . query . RiakObject riakObject2 = com . basho . riak . client . core . query . RiakObjectTest . CreateFilledObject ( ) ; "<AssertPlaceHolder>" ; } CreateFilledObject ( ) { final com . basho . riak . client . core . query . RiakObject result = new com . basho . riak . client . core . query . RiakObject ( ) ; result . setValue ( com . basho . riak . client . core . util . BinaryValue . create ( new byte [ ] { 'O' , '_' , 'o' } ) ) ; result . getIndexes ( ) . getIndex ( com . basho . riak . client . core . query . indexes . StringBinIndex . named ( "foo" ) ) . add ( "bar" ) ; result . getLinks ( ) . addLink ( new com . basho . riak . client . core . query . links . RiakLink ( "bucket" , "linkkey" , "linktag" ) ) ; result . getUserMeta ( ) . put ( "foo" , "bar" ) ; result . setVTag ( "vtag" ) ; result . setVClock ( com . basho . riak . client . core . query . RiakObjectTest . vClock ) ; return result ; }
org . junit . Assert . assertEquals ( riakObject1 , riakObject2 )
getMatchingLinesOfTextShouldFindCorrectLinesWhenFirstAndLastLinesHaveExtraText ( ) { final java . util . List < net . usikkert . kouchat . android . util . Line > lines = net . usikkert . kouchat . android . util . RobotiumTestUtils . getMatchingLinesOfText ( "[17:02:41]<sp>***<sp>Tina<sp>aborted<sp>reception<sp>of<sp>kouchat-512x512.png<sp>***" , java . util . Arrays . asList ( "[17:02:41]<sp>***<sp>Tina<sp>aborted<sp>" , "reception<sp>of<sp>" , "kouchat-512x512.png<sp>***" ) , "Tina<sp>aborted<sp>reception<sp>of<sp>kouchat-512x512.png" ) ; "<AssertPlaceHolder>" ; correctLineContent ( lines . get ( 0 ) , 0 , "Tina<sp>aborted<sp>" ) ; correctLineContent ( lines . get ( 1 ) , 1 , "reception<sp>of<sp>" ) ; correctLineContent ( lines . get ( 2 ) , 2 , "kouchat-512x512.png" ) ; } size ( ) { return userList . size ( ) ; }
org . junit . Assert . assertEquals ( 3 , lines . size ( ) )
computeFactor_OverOneUsageForHour ( ) { long startTimeUsage = org . oscm . test . DateTimeHandling . calculateMillis ( "2012-01-01<sp>00:59:59" ) ; long endTimeUsage = org . oscm . test . DateTimeHandling . calculateMillis ( "2012-01-01<sp>02:00:00" ) ; org . oscm . billingservice . service . model . BillingInput billingInput = org . oscm . billingservice . business . calculation . revenue . BillingInputFactory . newBillingInput ( "2012-01-01<sp>00:00:00" , "2012-02-01<sp>00:00:00" ) ; double factor = calculator . computeFactor ( PricingPeriod . HOUR , billingInput , startTimeUsage , endTimeUsage , true , true ) ; "<AssertPlaceHolder>" ; } computeFactor ( org . oscm . internal . types . enumtypes . PricingPeriod , org . oscm . billingservice . service . model . BillingInput , long , long , boolean , boolean ) { if ( usagePeriodEnd < usagePeriodStart ) { throw new org . oscm . internal . types . exception . IllegalArgumentException ( ( ( ( ( "Usage<sp>period<sp>end<sp>(" + ( new java . util . Date ( usagePeriodEnd ) ) ) + ")<sp>before<sp>usage<sp>period<sp>start<sp>(" ) + ( new java . util . Date ( usagePeriodStart ) ) ) + ")" ) ) ; } java . util . Calendar adjustedBillingPeriodStart = org . oscm . billingservice . business . calculation . revenue . PricingPeriodDateConverter . getStartTime ( billingInput . getCutOffDate ( ) , pricingPeriod ) ; java . util . Calendar adjustedBillingPeriodEnd = org . oscm . billingservice . business . calculation . revenue . PricingPeriodDateConverter . getStartTime ( billingInput . getBillingPeriodEnd ( ) , pricingPeriod ) ; if ( usagePeriodOutsideOfAdjustedBillingPeriod ( usagePeriodStart , usagePeriodEnd , adjustedBillingPeriodStart . getTimeInMillis ( ) , adjustedBillingPeriodEnd . getTimeInMillis ( ) ) ) { return 0.0 ; } else { java . util . Calendar startTimeForFactorCalculation = determineStartTimeForFactorCalculation ( pricingPeriod , adjustedBillingPeriodStart , usagePeriodStart , adjustsPeriodStart ) ; java . util . Calendar endTimeForFactorCalculation = determineEndTimeForFactorCalculation ( pricingPeriod , adjustedBillingPeriodEnd , usagePeriodEnd , adjustsPeriodEnd ) ; return computeFractionalFactor ( startTimeForFactorCalculation . getTimeInMillis ( ) , endTimeForFactorCalculation . getTimeInMillis ( ) , pricingPeriod ) ; } }
org . junit . Assert . assertEquals ( 3 , factor , 0 )
testCreateBusinessObjectDefinitionSubjectMatterExpertTrimParameters ( ) { businessObjectDefinitionDaoTestHelper . createBusinessObjectDefinitionEntity ( org . finra . herd . service . BDEF_NAMESPACE , org . finra . herd . service . BDEF_NAME , org . finra . herd . service . DATA_PROVIDER_NAME , org . finra . herd . service . DESCRIPTION ) ; org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpert resultBusinessObjectDefinitionSubjectMatterExpert = businessObjectDefinitionSubjectMatterExpertService . createBusinessObjectDefinitionSubjectMatterExpert ( new org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpertCreateRequest ( new org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpertKey ( addWhitespace ( org . finra . herd . service . BDEF_NAMESPACE ) , addWhitespace ( org . finra . herd . service . BDEF_NAME . toUpperCase ( ) ) , addWhitespace ( org . finra . herd . service . USER_ID ) ) ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpert ( resultBusinessObjectDefinitionSubjectMatterExpert . getId ( ) , new org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpertKey ( BDEF_NAMESPACE , BDEF_NAME , USER_ID ) ) , resultBusinessObjectDefinitionSubjectMatterExpert )
createFormField ( ) { wizardAction . openNewLiferayModuleWizard ( ) ; wizardAction . newModule . prepareGradle ( project . getName ( ) , com . liferay . ide . ui . module . tests . FORM_FIELD ) ; wizardAction . finish ( ) ; jobAction . waitForNoRunningJobs ( ) ; "<AssertPlaceHolder>" ; viewAction . project . closeAndDelete ( project . getName ( ) ) ; } visibleFileTry ( java . lang . String [ ] ) { try { return _getProjects ( ) . isVisible ( files ) ; } catch ( java . lang . Exception e ) { _getProjects ( ) . setFocus ( ) ; try { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - 1 ) ) ; _getProjects ( ) . expand ( parents ) ; _getProjects ( ) . contextMenu ( com . liferay . ide . ui . liferay . action . REFRESH , parents ) ; ide . sleep ( 2000 ) ; } catch ( java . lang . Exception e1 ) { } for ( int i = ( files . length ) - 1 ; i > 0 ; i -- ) { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - i ) ) ; org . eclipse . swtbot . swt . finder . widgets . SWTBotTreeItem parent = _getProjects ( ) . getTreeItem ( parents ) ; _getProjects ( ) . expand ( parents ) ; java . lang . String subnode = files [ ( ( files . length ) - i ) ] ; _jobAction . waitForSubnode ( parent , subnode , com . liferay . ide . ui . liferay . action . REFRESH ) ; } return _getProjects ( ) . isVisible ( files ) ; } }
org . junit . Assert . assertTrue ( viewAction . project . visibleFileTry ( project . getName ( ) ) )
testPostConstruct ( ) { com . sun . mail . util . logging . MailHandler instance = new com . sun . mail . util . logging . MailHandler ( com . sun . mail . util . logging . MailHandlerTest . createInitProperties ( "" ) ) ; com . sun . mail . util . logging . MailHandlerTest . InternalErrorManager em = new com . sun . mail . util . logging . MailHandlerTest . InternalErrorManager ( ) ; instance . setErrorManager ( em ) ; instance . postConstruct ( ) ; "<AssertPlaceHolder>" ; instance . close ( ) ; } isEmpty ( ) { return parameters . isEmpty ( ) ; }
org . junit . Assert . assertEquals ( true , em . exceptions . isEmpty ( ) )
test2 ( ) { org . esa . s2tbx . dataio . s2 . l1c . IL1cGranuleMetadata granuleMetadata = org . esa . s2tbx . dataio . s2 . l1c . L1cMetadataFactory . createL1cGranuleMetadata ( new org . esa . s2tbx . dataio . VirtualPath ( buildPathResource ( "metadata/S2A_OPER_MTD_L1C_TL_CGS1_20130621T120000_A000065_T14SLF.xml" ) , null ) ) ; "<AssertPlaceHolder>" ; } buildPathResource ( java . lang . String ) { java . net . URL url = getClass ( ) . getResource ( resource ) ; java . nio . file . Path xmlPath = null ; java . io . File file = new java . io . File ( url . toURI ( ) ) ; xmlPath = file . toPath ( ) ; return xmlPath ; }
org . junit . Assert . assertNotNull ( granuleMetadata )
setRawValueForNullOptional ( ) { optionalSubject . setRawValue ( null ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( null , optionalSubject . getValue ( ) )
testGetTrustMode ( ) { gov . hhs . fha . nhinc . patientdiscovery . response . VerifyMode verifyMode = new gov . hhs . fha . nhinc . patientdiscovery . response . VerifyMode ( ) ; gov . hhs . fha . nhinc . patientdiscovery . response . TrustMode trustMode = verifyMode . getTrustMode ( ) ; "<AssertPlaceHolder>" ; } getTrustMode ( ) { return new gov . hhs . fha . nhinc . patientdiscovery . response . TrustMode ( ) ; }
org . junit . Assert . assertNotNull ( trustMode )
stripColor ( ) { java . lang . StringBuilder subject = new java . lang . StringBuilder ( ) ; java . lang . StringBuilder expected = new java . lang . StringBuilder ( ) ; final java . lang . String filler = "test" ; for ( org . bukkit . ChatColor color : org . bukkit . ChatColor . values ( ) ) { subject . append ( color ) . append ( filler ) ; expected . append ( filler ) ; } "<AssertPlaceHolder>" ; } stripColor ( java . lang . String ) { if ( input == null ) { return null ; } return org . bukkit . ChatColor . STRIP_COLOR_PATTERN . matcher ( input ) . replaceAll ( "" ) ; }
org . junit . Assert . assertThat ( org . bukkit . ChatColor . stripColor ( subject . toString ( ) ) , org . hamcrest . CoreMatchers . is ( expected . toString ( ) ) )
deveObterQuantidadeItemEfetivamenteExportadoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoItemExportacaoIndireta exportacaoIndireta = new com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoItemExportacaoIndireta ( ) ; final java . lang . String quantidadeItemEfetivamenteExportado = "9999999999.9999" ; exportacaoIndireta . setQuantidadeItemEfetivamenteExportado ( new java . math . BigDecimal ( quantidadeItemEfetivamenteExportado ) ) ; "<AssertPlaceHolder>" ; } getQuantidadeItemEfetivamenteExportado ( ) { return this . quantidadeItemEfetivamenteExportado ; }
org . junit . Assert . assertEquals ( quantidadeItemEfetivamenteExportado , exportacaoIndireta . getQuantidadeItemEfetivamenteExportado ( ) )
testParse ( ) { java . time . Duration duration = java . time . Duration . ofSeconds ( 323 , 1500000 ) ; java . time . Duration val1 = type . parse ( "PT5M23.0015S" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { return baseType . parse ( value ) ; }
org . junit . Assert . assertEquals ( duration , val1 )
testRejectNullSubnetIPv4 ( ) { "<AssertPlaceHolder>" ; } isValidIpv4Subnet ( java . lang . String ) { java . lang . String ip ; java . lang . String subnet ; java . util . regex . Matcher ipMatcher ; if ( in == null ) { return false ; } ipMatcher = org . openstack . atlas . api . validation . util . IPString . IPUtils . subnetPattern . matcher ( in ) ; int subnetint ; if ( ipMatcher . find ( ) ) { ip = ipMatcher . group ( 1 ) ; subnet = ipMatcher . group ( 2 ) ; try { subnetint = java . lang . Integer . parseInt ( subnet ) ; if ( ( ( subnetint < 0 ) || ( subnetint > 32 ) ) || ( ! ( org . openstack . atlas . api . validation . util . IPString . IPUtils . isValidIpv4String ( ip ) ) ) ) { return false ; } return true ; } catch ( java . lang . NumberFormatException e ) { return false ; } } return false ; }
org . junit . Assert . assertFalse ( org . openstack . atlas . api . validation . util . IPString . IPUtils . isValidIpv4Subnet ( null ) )
testGetCurrentUser ( ) { UserProfile user = smartsheet . userResources ( ) . getCurrentUser ( ) ; Account account = user . getAccount ( ) ; "<AssertPlaceHolder>" ; } getAccount ( ) { return account ; }
org . junit . Assert . assertNotNull ( user )
loadDrivers ( ) { java . util . List < org . osgi . service . device . DriverLocator > locators = new java . util . ArrayList < org . osgi . service . device . DriverLocator > ( ) ; org . osgi . service . device . DriverLocator dl = org . mockito . Mockito . mock ( org . osgi . service . device . DriverLocator . class , "dl" ) ; locators . add ( dl ) ; java . lang . String [ ] driverIds = new java . lang . String [ ] { "org.apache.felix.driver-1.0" , "org.apache.felix.driver-1.1" } ; for ( java . lang . String string : driverIds ) { org . mockito . Mockito . when ( dl . loadDriver ( org . mockito . Mockito . eq ( string ) ) ) . thenReturn ( null ) ; org . osgi . framework . Bundle bundle = org . mockito . Mockito . mock ( org . osgi . framework . Bundle . class ) ; org . mockito . Mockito . when ( m_context . installBundle ( ( "_DD_" + string ) , null ) ) . thenReturn ( bundle ) ; bundle . start ( ) ; org . osgi . framework . ServiceReference ref = org . mockito . Mockito . mock ( org . osgi . framework . ServiceReference . class ) ; org . mockito . Mockito . when ( ref . getProperty ( Constants . DRIVER_ID ) ) . thenReturn ( string ) ; org . mockito . Mockito . when ( bundle . getRegisteredServices ( ) ) . thenReturn ( new org . osgi . framework . ServiceReference [ ] { ref } ) ; } java . util . List < org . osgi . framework . ServiceReference > refs = m_loader . loadDrivers ( locators , driverIds ) ; "<AssertPlaceHolder>" ; for ( org . osgi . framework . ServiceReference serviceReference : refs ) { java . lang . String driverId = "" + ( serviceReference . getProperty ( Constants . DRIVER_ID ) ) ; if ( ( ! ( driverId . equals ( driverIds [ 0 ] ) ) ) && ( ! ( driverId . equals ( driverIds [ 1 ] ) ) ) ) { org . junit . Assert . fail ( "unexpected<sp>driverId" ) ; } } } size ( ) { return data . length ; }
org . junit . Assert . assertEquals ( "" , 2 , refs . size ( ) )
testRetrieveAllQueryMetacards ( ) { ddf . catalog . data . Result result = new ddf . catalog . data . impl . ResultImpl ( new ddf . catalog . data . impl . MetacardImpl ( ) ) ; ddf . catalog . operation . QueryResponse queryResponse = mock ( ddf . catalog . operation . QueryResponse . class ) ; doReturn ( java . util . Collections . singletonList ( result ) ) . when ( queryResponse ) . getResults ( ) ; doReturn ( queryResponse ) . when ( org . codice . ddf . catalog . ui . metacard . QueryMetacardApplicationTest . CATALOG_FRAMEWORK ) . query ( any ( ddf . catalog . operation . QueryRequest . class ) ) ; int statusCode = com . jayway . restassured . RestAssured . given ( ) . get ( org . codice . ddf . catalog . ui . metacard . QueryMetacardApplicationTest . localhostUrl ) . statusCode ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { throw new java . lang . RuntimeException ( "not<sp>implemented" ) ; }
org . junit . Assert . assertThat ( statusCode , org . hamcrest . CoreMatchers . is ( 200 ) )
test_paramaterSetting_Config_setConfiguration_on_top_level_class ( ) { org . milyn . cdr . SmooksResourceConfiguration config = new org . milyn . cdr . SmooksResourceConfiguration ( ) ; org . milyn . cdr . MyContentDeliveryUnit5 cdu = new org . milyn . cdr . MyContentDeliveryUnit5 ( ) ; org . milyn . cdr . Configurator . configure ( cdu , config ) ; "<AssertPlaceHolder>" ; } configure ( U , org . milyn . cdr . annotation . SmooksResourceConfiguration ) { org . milyn . cdr . annotation . AssertArgument . isNotNull ( instance , "instance" ) ; org . milyn . cdr . annotation . AssertArgument . isNotNull ( config , "config" ) ; org . milyn . cdr . annotation . Configurator . processFieldConfigAnnotations ( instance , config , true ) ; org . milyn . cdr . annotation . Configurator . processMethodConfigAnnotations ( instance , config ) ; org . milyn . cdr . annotation . Configurator . setConfiguration ( instance , config ) ; org . milyn . cdr . annotation . Configurator . initialise ( instance ) ; return instance ; }
org . junit . Assert . assertNotNull ( cdu . config )
testAddValueObject ( ) { final org . apache . commons . lang3 . mutable . MutableByte mutNum = new org . apache . commons . lang3 . mutable . MutableByte ( ( ( byte ) ( 1 ) ) ) ; mutNum . add ( java . lang . Integer . valueOf ( 1 ) ) ; "<AssertPlaceHolder>" ; } byteValue ( ) { return value ; }
org . junit . Assert . assertEquals ( ( ( byte ) ( 2 ) ) , mutNum . byteValue ( ) )
testIntrospectOptionalVersion ( ) { com . jmethods . catatumbo . impl . EntityMetadata entityMetadata = com . jmethods . catatumbo . impl . EntityIntrospector . introspect ( com . jmethods . catatumbo . entities . OptionalVersion . class ) ; com . jmethods . catatumbo . impl . PropertyMetadata propertyMetadata = entityMetadata . getVersionMetadata ( ) ; "<AssertPlaceHolder>" ; } isOptional ( ) { return optional ; }
org . junit . Assert . assertFalse ( propertyMetadata . isOptional ( ) )
string_ends_with_apache_commons ( ) { boolean isAnchor = org . apache . commons . lang3 . StringUtils . endsWith ( "http://www.leveluplunch.com/#" , "#" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( isAnchor )
isComplex_shouldReturnTrueIfTheConceptIsComplex ( ) { org . openmrs . ConceptDatatype cd = new org . openmrs . ConceptDatatype ( ) ; cd . setName ( "Complex" ) ; cd . setHl7Abbreviation ( "ED" ) ; org . openmrs . ConceptComplex complexConcept = new org . openmrs . ConceptComplex ( ) ; complexConcept . setDatatype ( cd ) ; org . openmrs . Obs obs = new org . openmrs . Obs ( ) ; obs . setConcept ( complexConcept ) ; "<AssertPlaceHolder>" ; } isComplex ( ) { return false ; }
org . junit . Assert . assertTrue ( obs . isComplex ( ) )
testIPv4toURL ( ) { try { final java . lang . String addressString = "192.168.0.1" ; java . net . InetAddress address = java . net . InetAddress . getByName ( addressString ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } ipAddressToUrlString ( java . net . InetAddress ) { if ( address == null ) { throw new java . lang . NullPointerException ( "address<sp>is<sp>null" ) ; } else if ( address instanceof java . net . Inet4Address ) { return address . getHostAddress ( ) ; } else if ( address instanceof java . net . Inet6Address ) { return org . apache . flink . util . NetUtils . getIPv6UrlRepresentation ( ( ( java . net . Inet6Address ) ( address ) ) ) ; } else { throw new java . lang . IllegalArgumentException ( ( "Unrecognized<sp>type<sp>of<sp>InetAddress:<sp>" + address ) ) ; } }
org . junit . Assert . assertEquals ( addressString , org . apache . flink . util . NetUtils . ipAddressToUrlString ( address ) )
getImpressionRowsTest ( ) { com . intuit . wasabi . experimentobjects . Experiment . ID experimentId = Experiment . ID . newInstance ( ) ; com . intuit . wasabi . analyticsobjects . Parameters parameters = mock ( com . intuit . wasabi . analyticsobjects . Parameters . class , com . intuit . wasabi . repository . database . RETURNS_DEEP_STUBS ) ; when ( parameters . getContext ( ) . getContext ( ) ) . thenReturn ( "TEST" ) ; java . util . Date from = mock ( java . util . Date . class ) ; java . util . Date to = mock ( java . util . Date . class ) ; when ( parameters . getFromTime ( ) ) . thenReturn ( from ) ; when ( parameters . getToTime ( ) ) . thenReturn ( to ) ; java . util . List < java . util . Map > expected = mock ( java . util . List . class ) ; when ( transaction . select ( anyString ( ) , org . mockito . Matchers . anyVararg ( ) ) ) . thenReturn ( expected ) ; java . util . List < java . util . Map > result = databaseAnalytics . getImpressionRows ( experimentId , parameters ) ; "<AssertPlaceHolder>" ; doThrow ( new java . lang . RuntimeException ( ) ) . when ( transaction ) . select ( anyString ( ) , org . mockito . Matchers . anyVararg ( ) ) ; databaseAnalytics . getImpressionRows ( experimentId , parameters ) ; org . junit . Assert . fail ( ) ; } getImpressionRows ( com . intuit . wasabi . experimentobjects . Experiment$ID , com . intuit . wasabi . analyticsobjects . Parameters ) { try { java . util . Date from_ts = parameters . getFromTime ( ) ; java . util . Date to_ts = parameters . getToTime ( ) ; java . lang . String sqlBase = "bucket_label<sp>as<sp>bid,<sp>count(user_id)<sp>as<sp>c,<sp>count(distinct<sp>user_id)<sp>as<sp>cu" ; java . lang . String sqlParams = "<sp>where<sp>experiment_id<sp>=<sp>?<sp>and<sp>context<sp>=<sp>?" ; java . util . List params = new java . util . ArrayList ( ) ; params . add ( experimentID ) ; params . add ( parameters . getContext ( ) . getContext ( ) ) ; if ( from_ts != null ) { params . add ( from_ts ) ; sqlParams += "<sp>and<sp>timestamp<sp>>=<sp>?" ; } if ( to_ts != null ) { params . add ( to_ts ) ; sqlParams += "<sp>and<sp>timestamp<sp><=<sp>?" ; } java . lang . Object [ ] bucketSqlData = new java . lang . Object [ params . size ( ) ] ; params . toArray ( bucketSqlData ) ; java . lang . String sqlImpressions = ( ( ( "select<sp>" + sqlBase ) + "<sp>from<sp>event_impression" ) + sqlParams ) + "<sp>group<sp>by<sp>bucket_label" ; java . util . List < java . util . Map > impressionRows = transaction . select ( sqlImpressions , bucketSqlData ) ; return impressionRows ; } catch ( java . lang . Exception e ) { throw new com . intuit . wasabi . repository . RepositoryException ( "error<sp>reading<sp>actions<sp>rows<sp>from<sp>MySQL" , e ) ; } }
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( expected ) )
compareToInputNotNullOutputZero ( ) { final org . sejda . sambox . cos . COSObjectKey objectUnderTest = new org . sejda . sambox . cos . COSObjectKey ( 0L , 0 ) ; final org . sejda . sambox . cos . COSObjectKey other = new org . sejda . sambox . cos . COSObjectKey ( 0L , 0 ) ; final int retval = objectUnderTest . compareTo ( other ) ; "<AssertPlaceHolder>" ; } compareTo ( org . sejda . sambox . pdmodel . font . FontMapperImpl$FontMatch ) { return java . lang . Double . compare ( match . score , this . score ) ; }
org . junit . Assert . assertEquals ( 0 , retval )
testExists_False ( ) { initializeExpectedDataset ( 1 ) ; com . google . cloud . bigquery . BigQuery [ ] expectedOptions = new BigQuery . DatasetOption [ ] { BigQuery . DatasetOption . fields ( ) } ; expect ( bigquery . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( bigquery . getDataset ( com . google . cloud . bigquery . DatasetTest . DATASET_INFO . getDatasetId ( ) , expectedOptions ) ) . andReturn ( null ) ; replay ( bigquery ) ; initializeDataset ( ) ; "<AssertPlaceHolder>" ; } exists ( ) { boolean exists = bucket . exists ( ) ; if ( exists ) { } else { } return exists ; }
org . junit . Assert . assertFalse ( dataset . exists ( ) )
when_jobSubmitted_Then_executedSuccessfully ( ) { java . lang . String sourceName = "source" ; java . lang . String sinkName = "sink" ; fillListWithInts ( instance . getList ( sourceName ) , 10 ) ; com . hazelcast . jet . pipeline . Pipeline p = com . hazelcast . jet . pipeline . Pipeline . create ( ) ; p . drawFrom ( com . hazelcast . jet . pipeline . Sources . list ( sourceName ) ) . drainTo ( com . hazelcast . jet . pipeline . Sinks . list ( sinkName ) ) ; client . newJob ( p ) . join ( ) ; "<AssertPlaceHolder>" ; } getList ( java . lang . String ) { return instance . getList ( name ) ; }
org . junit . Assert . assertEquals ( 10 , instance . getList ( sinkName ) . size ( ) )
testTransformWithOneFunction ( ) { com . liferay . portal . dao . sql . transformer . SQLTransformer sqlTransformer = new com . liferay . portal . dao . sql . transformer . DefaultSQLTransformer ( new java . util . function . Function [ ] { _dummyFunction } ) ; "<AssertPlaceHolder>" ; } transform ( java . lang . String ) { if ( html == null ) { return null ; } if ( ( ! ( html . contains ( "<img" ) ) ) || ( ! ( html . contains ( "/documents/" ) ) ) ) { return html ; } return super . transform ( html ) ; }
org . junit . Assert . assertNull ( sqlTransformer . transform ( null ) )
testFindAll ( ) { logger . debug ( "find<sp>All" ) ; java . util . List < fr . valtech . angularspring . app . domain . User > all = userDAO . findAll ( ) ; "<AssertPlaceHolder>" ; } findAll ( ) { return ( ( java . util . List < fr . valtech . angularspring . app . domain . User > ) ( em . createQuery ( "FROM<sp>User" ) . getResultList ( ) ) ) ; }
org . junit . Assert . assertThat ( all . size ( ) , org . hamcrest . Matchers . is ( 3 ) )
testGetWorld ( ) { System . out . println ( "getWorld" ) ; mudmap2 . backend . World world = new mudmap2 . backend . World ( ) ; mudmap2 . frontend . GUIElement . WorldPanel . WorldPanel instance = new mudmap2 . frontend . GUIElement . WorldPanel . WorldPanel ( null , world , false ) ; "<AssertPlaceHolder>" ; } getWorld ( ) { return world ; }
org . junit . Assert . assertEquals ( world , instance . getWorld ( ) )
testLineCount ( ) { com . cloudera . flume . core . EventSource src = new com . cloudera . flume . handlers . debug . NoNlASCIISynthSource ( 25 , 100 , 1 ) ; src . open ( ) ; com . cloudera . flume . reporter . builder . SimpleRegexReporterBuilder b = new com . cloudera . flume . reporter . builder . SimpleRegexReporterBuilder ( getClass ( ) . getClassLoader ( ) . getResource ( com . cloudera . flume . reporter . HADOOP_REGEXES ) . getFile ( ) ) ; java . util . Collection < com . cloudera . flume . reporter . histogram . RegexGroupHistogramSink > sinks = b . load ( ) ; com . cloudera . flume . reporter . MultiReporter mr = new com . cloudera . flume . reporter . MultiReporter ( "apache_sinks" , sinks ) ; mr . open ( ) ; com . cloudera . flume . core . EventUtil . dumpAll ( src , mr ) ; for ( com . cloudera . flume . reporter . histogram . RegexGroupHistogramSink r : sinks ) { System . out . println ( r . getHistogram ( ) ) ; } "<AssertPlaceHolder>" ; } size ( ) { return hist . size ( ) ; }
org . junit . Assert . assertEquals ( 5 , sinks . size ( ) )
saveBrandingUrl ( ) { org . oscm . domobjects . Marketplace mp = new org . oscm . domobjects . Marketplace ( ) ; org . oscm . marketplace . bean . MarketplaceServiceBean brandMgmtBean = setupWithMock ( mp ) ; brandMgmtBean . saveBrandingUrl ( voMarketplace , org . oscm . marketplace . bean . MarketplaceServiceBeanBrandingIT . BRANDING_URL ) ; "<AssertPlaceHolder>" ; } getBrandingUrl ( ) { return brandingUrl ; }
org . junit . Assert . assertEquals ( org . oscm . marketplace . bean . MarketplaceServiceBeanBrandingIT . BRANDING_URL , mp . getBrandingUrl ( ) )
testFindAll ( ) { org . oscarehr . PMmodule . model . CriteriaType cT1 = new org . oscarehr . PMmodule . model . CriteriaType ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( cT1 ) ; dao . persist ( cT1 ) ; org . oscarehr . PMmodule . model . CriteriaType cT2 = new org . oscarehr . PMmodule . model . CriteriaType ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( cT2 ) ; dao . persist ( cT2 ) ; org . oscarehr . PMmodule . model . CriteriaType cT3 = new org . oscarehr . PMmodule . model . CriteriaType ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( cT3 ) ; dao . persist ( cT3 ) ; org . oscarehr . PMmodule . model . CriteriaType cT4 = new org . oscarehr . PMmodule . model . CriteriaType ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( cT4 ) ; dao . persist ( cT4 ) ; java . util . List < org . oscarehr . PMmodule . model . CriteriaType > expectedResult = new java . util . ArrayList < org . oscarehr . PMmodule . model . CriteriaType > ( java . util . Arrays . asList ( cT1 , cT2 , cT3 , cT4 ) ) ; java . util . List < org . oscarehr . PMmodule . model . CriteriaType > result = dao . findAll ( ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } }
org . junit . Assert . assertTrue ( true )
testAdder3 ( ) { java . io . ByteArrayInputStream inputStream = new java . io . ByteArrayInputStream ( "2<sp>+<sp>3\n" . getBytes ( ) ) ; be . fedict . eid . applet . tests . javacc . adder3 . Adder3 adder = new be . fedict . eid . applet . tests . javacc . adder3 . Adder3 ( inputStream ) ; int result = adder . Start ( ) ; test . be . fedict . eid . applet . JavaCCTest . LOG . debug ( ( "result:<sp>" + result ) ) ; "<AssertPlaceHolder>" ; } debug ( java . lang . String ) { this . view . addDetailMessage ( message ) ; }
org . junit . Assert . assertEquals ( 5 , result )
testGetAuthorsCount ( ) { java . math . BigInteger authorCount = com . iluwatar . cqrs . IntegrationTest . queryService . getAuthorsCount ( ) ; "<AssertPlaceHolder>" ; } getAuthorsCount ( ) { java . math . BigInteger authorcount = null ; try ( org . hibernate . Session session = sessionFactory . openSession ( ) ) { org . hibernate . SQLQuery sqlQuery = session . createSQLQuery ( "SELECT<sp>count(id)<sp>from<sp>Author" ) ; authorcount = ( ( java . math . BigInteger ) ( sqlQuery . uniqueResult ( ) ) ) ; } return authorcount ; }
org . junit . Assert . assertEquals ( new java . math . BigInteger ( "2" ) , authorCount )
envRootVariableInNdkSearchOrderIsUsed ( ) { java . nio . file . Path envDir = createTmpNdkVersions ( com . facebook . buck . android . toolchain . ndk . impl . AndroidNdkResolver . NDK_POST_R11_VERSION_FILENAME , "ndk-dir-r17c1" , "Pkg.Desc<sp>=<sp>Android<sp>NDK\nPkg.Revision<sp>=<sp>17.2.4988734.1" ) [ 0 ] ; com . facebook . buck . android . toolchain . ndk . impl . AndroidNdkResolver resolver = new com . facebook . buck . android . toolchain . ndk . impl . AndroidNdkResolver ( tmpDir . getRoot ( ) . getFileSystem ( ) , com . google . common . collect . ImmutableMap . of ( "ANDROID_NDK" , envDir . toString ( ) ) , com . facebook . buck . android . FakeAndroidBuckConfig . builder ( ) . setNdkSearchOrder ( "<NDK_REPOSITORY_CONFIG>,<sp>ANDROID_NDK" ) . build ( ) ) ; "<AssertPlaceHolder>" ; } getNdkOrThrow ( ) { if ( ( ! ( ndk . isPresent ( ) ) ) && ( ndkErrorMessage . isPresent ( ) ) ) { throw new com . facebook . buck . core . exceptions . HumanReadableException ( ndkErrorMessage . get ( ) ) ; } return ndk . get ( ) ; }
org . junit . Assert . assertEquals ( envDir , resolver . getNdkOrThrow ( ) )
readOrderedLeafListDataAllTest ( ) { doReturn ( immediateFluentFuture ( java . util . Optional . of ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . orderedLeafSetNode1 ) ) ) . when ( read ) . read ( LogicalDatastoreType . OPERATIONAL , org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . leafSetNodePath ) ; doReturn ( immediateFluentFuture ( java . util . Optional . of ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . orderedLeafSetNode2 ) ) ) . when ( read ) . read ( LogicalDatastoreType . CONFIGURATION , org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . leafSetNodePath ) ; doReturn ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . leafSetNodePath ) . when ( context ) . getInstanceIdentifier ( ) ; final org . opendaylight . yangtools . yang . data . api . schema . NormalizedNode < ? , ? > normalizedNode = org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtil . readData ( RestconfDataServiceConstant . ReadData . ALL , wrapper , schemaContext ) ; final org . opendaylight . yangtools . yang . data . api . schema . LeafSetNode < java . lang . String > expectedData = org . opendaylight . yangtools . yang . data . impl . schema . Builders . < java . lang . String > orderedLeafSetBuilder ( ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . leafListQname ) ) . withValue ( com . google . common . collect . ImmutableList . < org . opendaylight . yangtools . yang . data . api . schema . LeafSetEntryNode < java . lang . String > > builder ( ) . addAll ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . orderedLeafSetNode1 . getValue ( ) ) . addAll ( org . opendaylight . restconf . nb . rfc8040 . rests . utils . ReadDataTransactionUtilTest . DATA . orderedLeafSetNode2 . getValue ( ) ) . build ( ) ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return configuration ; }
org . junit . Assert . assertEquals ( expectedData , normalizedNode )
calculateNumberOfSheepForEachTerrainTest ( ) { it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . BoardStatusExtended bse = new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . BoardStatusExtended ( 4 ) ; java . util . Map < it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain , java . lang . Integer > map = new java . util . HashMap < it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain , java . lang . Integer > ( ) ; for ( it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain terrain : it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain . values ( ) ) { map . put ( terrain , 0 ) ; } map . put ( Terrain . C1 , 3 ) ; map . put ( Terrain . W2 , 2 ) ; map . put ( Terrain . L3 , 1 ) ; it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . TypeOfSheep [ ] types = new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . TypeOfSheep [ ] { it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . TypeOfSheep . NORMALSHEEP , it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . TypeOfSheep . MALESHEEP , it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . TypeOfSheep . FEMALESHEEP } ; for ( it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . TypeOfSheep type : types ) { for ( int i = 0 ; i < 3 ; i ++ ) { bse . addSheep ( new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . Sheep ( 0 , type , it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain . C1 ) ) ; } for ( int i = 0 ; i < 2 ; i ++ ) { bse . addSheep ( new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . Sheep ( 0 , type , it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain . W2 ) ) ; } bse . addSheep ( new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . Sheep ( 0 , type , it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain . L3 ) ) ; java . util . Map < it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain , java . lang . Integer > results = bse . calculateNumberOfSheepForEachTerrain ( type ) ; for ( it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain terrain : it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain . values ( ) ) { "<AssertPlaceHolder>" ; } } } calculateNumberOfSheepForEachTerrain ( it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . TypeOfSheep ) { java . util . Map < it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain , java . lang . Integer > map = new java . util . HashMap < it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain , java . lang . Integer > ( ) ; for ( it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain t : it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain . values ( ) ) { map . put ( t , 0 ) ; } for ( it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . animals . Sheep s : sheeps ) { if ( s . getTypeOfSheep ( ) . equals ( type ) ) { int value = map . get ( s . getPosition ( ) ) ; value ++ ; map . put ( s . getPosition ( ) , value ) ; } } return map ; }
org . junit . Assert . assertEquals ( results . get ( terrain ) , map . get ( terrain ) )
testCatchException_ObjExc_superClassOfExpectedThrown ( ) { try { com . googlecode . catchexception . CatchException . catchException ( ( ) -> list . get ( 0 ) , com . googlecode . catchexception . ArrayIndexOutOfBoundsException . class ) ; org . junit . Assert . fail ( "IndexOutOfBoundsException<sp>is<sp>expected<sp>(shall<sp>not<sp>be<sp>caught)" ) ; } catch ( java . lang . IndexOutOfBoundsException e ) { "<AssertPlaceHolder>" ; } } caughtException ( ) { return com . googlecode . catchexception . ExceptionHolder . get ( ) ; }
org . junit . Assert . assertNull ( com . googlecode . catchexception . CatchException . caughtException ( ) )
testGetAuthenticator ( ) { org . apache . hadoop . security . authentication . client . Authenticator authenticator = org . mockito . Mockito . mock ( org . apache . hadoop . security . authentication . client . Authenticator . class ) ; org . apache . hadoop . security . authentication . client . AuthenticatedURL aURL = new org . apache . hadoop . security . authentication . client . AuthenticatedURL ( authenticator ) ; "<AssertPlaceHolder>" ; } getAuthenticator ( ) { return authenticator ; }
org . junit . Assert . assertEquals ( authenticator , aURL . getAuthenticator ( ) )
testPrettyPrint ( ) { java . lang . Double testAss = 50.0 ; java . lang . Double testSem = 55.0 ; java . lang . Double testCont = 55.0 ; java . lang . String expectedResult = ( ( ( ( ( ( ( ( ( "Dear<sp>student<sp>you<sp>have<sp>attained:\n" + "Assignment:<sp>" ) + testAss ) + "%\n" ) + "Semester<sp>test:<sp>" ) + testSem ) + "%\n" ) + "Continous<sp>Assessment:<sp>" ) + testCont ) + "%\n" ) + "Your<sp>DP<sp>is<sp>calculated<sp>as:<sp>52.0%" ; za . ac . pearson . cti . studentdpcalculator . DPcalc calculator = new za . ac . pearson . cti . studentdpcalculator . DPcalc ( testAss , testSem , testCont ) ; java . lang . String result = calculator . prettyPrintDPreport ( ) ; "<AssertPlaceHolder>" ; } prettyPrintDPreport ( ) { throw new java . lang . UnsupportedOperationException ( "You<sp>still<sp>need<sp>to<sp>complete<sp>this<sp>method" ) ; }
org . junit . Assert . assertEquals ( expectedResult , result )
halfClosed_runtimeExceptionCancelsCall ( ) { io . grpc . internal . ServerImpl . JumpToApplicationThreadServerStreamListener listener = new io . grpc . internal . ServerImpl . JumpToApplicationThreadServerStreamListener ( executor . getScheduledExecutorService ( ) , executor . getScheduledExecutorService ( ) , stream , Context . ROOT . withCancellation ( ) ) ; io . grpc . internal . ServerStreamListener mockListener = mock ( io . grpc . internal . ServerStreamListener . class ) ; listener . setListener ( mockListener ) ; java . lang . RuntimeException expectedT = new java . lang . RuntimeException ( ) ; doThrow ( expectedT ) . when ( mockListener ) . halfClosed ( ) ; listener . halfClosed ( ) ; try { executor . runDueTasks ( ) ; org . junit . Assert . fail ( "Expected<sp>exception" ) ; } catch ( java . lang . RuntimeException t ) { "<AssertPlaceHolder>" ; ensureServerStateNotLeaked ( ) ; } } fail ( io . grpc . Status ) { checkArgument ( ( ! ( status . isOk ( ) ) ) , "Cannot<sp>fail<sp>with<sp>OK<sp>status" ) ; checkState ( ( ! ( finalized ) ) , "apply()<sp>or<sp>fail()<sp>already<sp>called" ) ; finalizeWith ( new io . grpc . internal . FailingClientStream ( status ) ) ; }
org . junit . Assert . assertSame ( expectedT , t )
testAbsoluteNapiMountToDataset ( ) { org . eclipse . january . dataset . Dataset dummyData = org . eclipse . january . dataset . DatasetFactory . createFromObject ( new int [ ] { 0 , 1 , 2 } ) ; dummyData . setName ( "d" 0 ) ; try ( org . eclipse . dawnsci . nexus . NexusFile origin = org . eclipse . dawnsci . nexus . test . util . NexusTestUtils . createNexusFile ( ( ( org . eclipse . dawnsci . nexus . file . NexusFileTest . testScratchDirectoryName ) + "origin/test.nxs" ) ) ; org . eclipse . dawnsci . nexus . NexusFile linked = org . eclipse . dawnsci . nexus . test . util . NexusTestUtils . createNexusFile ( ( ( org . eclipse . dawnsci . nexus . file . NexusFileTest . testScratchDirectoryName ) + "linked/linked.nxs" ) ) ) { org . eclipse . dawnsci . analysis . api . tree . GroupNode g = origin . getGroup ( "/a/b/d" , true ) ; org . eclipse . january . dataset . Dataset mountData = org . eclipse . january . dataset . DatasetFactory . createFromObject ( new java . lang . String [ ] { ( "nxfile://" + ( org . eclipse . dawnsci . nexus . file . NexusFileTest . testScratchDirectoryName ) ) + "linked/linked.nxs#x/y/z" } ) ; mountData . setName ( "napimount" ) ; origin . addAttribute ( g , origin . createAttribute ( mountData ) ) ; org . eclipse . dawnsci . analysis . api . tree . GroupNode l = linked . getGroup ( "/x/y/" , true ) ; linked . createData ( l , dummyData ) ; } try ( org . eclipse . dawnsci . nexus . NexusFile origin = org . eclipse . dawnsci . nexus . test . util . NexusTestUtils . openNexusFileReadOnly ( ( ( org . eclipse . dawnsci . nexus . file . NexusFileTest . testScratchDirectoryName ) + "origin/test.nxs" ) ) ) { org . eclipse . dawnsci . analysis . api . tree . GroupNode group = origin . getGroup ( "/a/b" , false ) ; "<AssertPlaceHolder>" ; origin . getData ( group , "d" ) ; org . junit . Assert . fail ( "NAPI<sp>mount<sp>from<sp>group<sp>to<sp>dataset<sp>not<sp>supported" ) ; } catch ( java . lang . IllegalArgumentException e ) { } } containsDataNode ( java . lang . String ) { return ( nodes . containsKey ( name ) ) && ( nodes . get ( name ) . isDestinationData ( ) ) ; }
org . junit . Assert . assertFalse ( group . containsDataNode ( "d" ) )
isStorageCrossClusterMigrationTestStorageTypeEqualsCluster ( ) { org . mockito . Mockito . doReturn ( 1L ) . when ( hostMock ) . getClusterId ( ) ; org . mockito . Mockito . doReturn ( 2L ) . when ( storagePoolVoMock ) . getClusterId ( ) ; org . mockito . Mockito . doReturn ( ScopeType . CLUSTER ) . when ( storagePoolVoMock ) . getScope ( ) ; boolean returnedValue = virtualMachineManagerImpl . isStorageCrossClusterMigration ( hostMock , storagePoolVoMock ) ; "<AssertPlaceHolder>" ; } isStorageCrossClusterMigration ( com . cloud . host . Host , org . apache . cloudstack . storage . datastore . db . StoragePoolVO ) { return ( ScopeType . CLUSTER . equals ( currentPool . getScope ( ) ) ) && ( ( currentPool . getClusterId ( ) ) != ( targetHost . getClusterId ( ) ) ) ; }
org . junit . Assert . assertTrue ( returnedValue )
testSetGlobalValues ( ) { System . out . println ( "<sp>setGlobalValues" ) ; final java . util . Map < java . lang . String , java . lang . Object > table = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; table . put ( "foo" , 1 ) ; table . put ( "bar" , 2 ) ; org . geotools . filter . function . EnvFunction . setGlobalValues ( table ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 2 ) ; class Task implements java . lang . Runnable { final java . lang . String key ; Task ( java . lang . String key ) { if ( ! ( table . containsKey ( key ) ) ) { throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>arg<sp>" + key ) ) ; } this . key = key ; } public void run ( ) { org . geotools . filter . function . EnvFunction . setGlobalValue ( key , table . get ( key ) ) ; latch . countDown ( ) ; try { latch . await ( ) ; } catch ( java . lang . InterruptedException ex ) { throw new java . lang . IllegalStateException ( ex ) ; } for ( java . lang . String name : table . keySet ( ) ) { java . lang . Object result = ff . function ( "env" , ff . literal ( name ) ) . evaluate ( null ) ; int value = ( ( java . lang . Number ) ( result ) ) . intValue ( ) ; "<AssertPlaceHolder>" ; } } } java . util . concurrent . Future f1 = executor . submit ( new Task ( "foo" ) ) ; java . util . concurrent . Future f2 = executor . submit ( new Task ( "bar" ) ) ; f1 . get ( ) ; f2 . get ( ) ; } get ( java . lang . String ) { return super . get ( new javax . media . jai . util . CaselessStringKey ( key ) ) ; }
org . junit . Assert . assertEquals ( table . get ( name ) , value )
linuxCommandBuilderDriverTest ( ) { org . apache . reef . runtime . common . client . api . JobSubmissionEvent event = mock ( org . apache . reef . runtime . common . client . api . JobSubmissionEvent . class ) ; org . apache . reef . util . Optional < java . lang . Integer > memory = org . apache . reef . util . Optional . of ( 100 ) ; when ( event . getDriverMemory ( ) ) . thenReturn ( memory ) ; java . lang . String actual = this . linuxCommandBuilder . buildDriverCommand ( event ) ; java . lang . String expected = "/bin/sh<sp>-c<sp>\"unzip<sp>local.jar<sp>-d<sp>\'reef/\';<sp>{{JAVA_HOME}}/bin/java<sp>-Xmx100m<sp>-XX:PermSize=128m<sp>" + ( ( "-XX:MaxPermSize=128m<sp>-ea<sp>-classpath<sp>" + "c:\\driverpath1:c:\\driverpath2:reef/local/*:reef/global/*:driverclasspathsuffix<sp>" ) + "-Dproc_reef<sp>org.apache.reef.runtime.common.REEFLauncher<sp>reef/local/driver.conf\"" ) ; "<AssertPlaceHolder>" ; } buildDriverCommand ( org . apache . reef . runtime . common . client . api . JobSubmissionEvent ) { java . util . List < java . lang . String > commandList = new org . apache . reef . runtime . common . launch . JavaLaunchCommandBuilder ( this . launcherClass , this . commandListPrefix ) . setJavaPath ( runtimePathProvider . getPath ( ) ) . setConfigurationFilePaths ( java . util . Collections . singletonList ( this . reefFileNames . getDriverConfigurationPath ( ) ) ) . setClassPath ( getDriverClasspath ( ) ) . setMemory ( jobSubmissionEvent . getDriverMemory ( ) . get ( ) ) . build ( ) ; return java . lang . String . format ( this . osCommandFormat , org . apache . commons . lang . StringUtils . join ( commandList , '<sp>' ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
notBeforeDateIsCorrect ( ) { java . util . Date notBefore = helpers . CertificateHelper . stringToDate ( "Aug<sp>15<sp>10:56:49<sp>2012<sp>GMT" ) ; "<AssertPlaceHolder>" ; } getNotBefore ( ) { return certificate . getNotBefore ( ) ; }
org . junit . Assert . assertEquals ( notBefore , certificate . getNotBefore ( ) )
testBuildWithParametersAndDisabledDefaultConstraint ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String abbrName = "LieToMe" ; java . lang . String name = "fdsfds" ; org . lnu . is . domain . job . type . JobType context = new org . lnu . is . domain . job . type . JobType ( ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>JobType<sp>e<sp>WHERE<sp>(<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . job . type . JobType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
testGetLabelResource ( ) { System . out . println ( "getLabelResource" ) ; kg . apc . jmeter . reporters . FlexibleFileWriterGui instance = new kg . apc . jmeter . reporters . FlexibleFileWriterGui ( ) ; java . lang . String result = instance . getLabelResource ( ) ; "<AssertPlaceHolder>" ; } getLabelResource ( ) { return this . getClass ( ) . getSimpleName ( ) ; }
org . junit . Assert . assertTrue ( ( ( result . length ( ) ) > 0 ) )
initiallyEmpty ( ) { com . vaadin . ui . TextField textField = new com . vaadin . ui . TextField ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ( ) ) == 0 ; }
org . junit . Assert . assertTrue ( textField . isEmpty ( ) )
testNotNullOptions ( ) { fr . opensagres . xdocreport . converter . Options options = fr . opensagres . xdocreport . converter . Options . getFrom ( "DOCX" ) ; fr . opensagres . poi . xwpf . converter . pdf . PdfOptions pdfOptions = fr . opensagres . xdocreport . converter . docx . poi . itext . XWPF2PDFViaITextConverter . getInstance ( ) . toPdfOptions ( options ) ; "<AssertPlaceHolder>" ; } toPdfOptions ( fr . opensagres . xdocreport . converter . Options ) { if ( options == null ) { return null ; } java . lang . Object value = options . getSubOptions ( fr . opensagres . poi . xwpf . converter . pdf . PdfOptions . class ) ; if ( value instanceof fr . opensagres . poi . xwpf . converter . pdf . PdfOptions ) { return ( ( fr . opensagres . poi . xwpf . converter . pdf . PdfOptions ) ( value ) ) ; } fr . opensagres . poi . xwpf . converter . pdf . PdfOptions pdfOptions = fr . opensagres . poi . xwpf . converter . pdf . PdfOptions . create ( ) ; java . lang . String fontEncoding = fr . opensagres . xdocreport . converter . OptionsHelper . getFontEncoding ( options ) ; if ( fr . opensagres . xdocreport . core . utils . StringUtils . isNotEmpty ( fontEncoding ) ) { pdfOptions . fontEncoding ( fontEncoding ) ; } return pdfOptions ; }
org . junit . Assert . assertNotNull ( pdfOptions )
testBadLocation ( ) { textViewer . setDocument ( null ) ; org . eclipse . jface . text . hyperlink . IHyperlink [ ] hyperlinks = detectHyperlinks ( 10 , 0 ) ; "<AssertPlaceHolder>" ; } detectHyperlinks ( int , int ) { return detector . detectHyperlinks ( textViewer , new org . eclipse . jface . text . Region ( offset , length ) , false ) ; }
org . junit . Assert . assertNull ( hyperlinks )
virtOnly ( ) { java . lang . String expected = "Pool<sp>is<sp>restricted<sp>to<sp>virtual<sp>guests:<sp>\"pool10\"." ; try { bindByPoolErrorTest ( "rulefailed.virt.only" ) ; org . junit . Assert . fail ( ) ; } catch ( org . candlepin . common . exceptions . ForbiddenException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return this . message ; }
org . junit . Assert . assertEquals ( expected , e . getMessage ( ) )
shouldNotLoadPropertyWhenLoaded ( ) { final uk . gov . gchq . gaffer . data . element . ElementValueLoader elementLoader = mock ( uk . gov . gchq . gaffer . data . element . ElementValueLoader . class ) ; final java . lang . String propertyName = "property<sp>name" ; final java . lang . String exceptedPropertyValue = "property<sp>value" ; final uk . gov . gchq . gaffer . data . element . Properties properties = new uk . gov . gchq . gaffer . data . element . Properties ( propertyName , exceptedPropertyValue ) ; final uk . gov . gchq . gaffer . data . element . LazyProperties lazyProperties = new uk . gov . gchq . gaffer . data . element . LazyProperties ( properties , elementLoader ) ; given ( elementLoader . getProperty ( propertyName , lazyProperties ) ) . willReturn ( exceptedPropertyValue ) ; final java . lang . Object propertyValue = lazyProperties . get ( propertyName ) ; "<AssertPlaceHolder>" ; verify ( elementLoader , never ( ) ) . getProperty ( propertyName , lazyProperties ) ; } get ( K ) { return multiMap . get ( key ) ; }
org . junit . Assert . assertEquals ( exceptedPropertyValue , propertyValue )
parseEmpty ( ) { java . lang . String json = "{}" ; net . vvakame . util . jsonpullparser . JsonPullParser parser = net . vvakame . util . jsonpullparser . JsonPullParser . newParser ( json ) ; net . vvakame . util . jsonpullparser . util . JsonHash jsonHash = net . vvakame . util . jsonpullparser . util . JsonHash . fromParser ( parser ) ; "<AssertPlaceHolder>" ; } fromParser ( net . vvakame . util . jsonpullparser . JsonPullParser ) { net . vvakame . util . jsonpullparser . JsonPullParser . State state = parser . getEventType ( ) ; if ( state == ( net . vvakame . util . jsonpullparser . JsonPullParser . State . VALUE_NULL ) ) { return null ; } else if ( state != ( net . vvakame . util . jsonpullparser . JsonPullParser . State . START_HASH ) ) { throw new net . vvakame . util . jsonpullparser . JsonFormatException ( ( "unexpected<sp>token.<sp>token=" + state ) , parser ) ; } net . vvakame . util . jsonpullparser . util . JsonHash jsonHash = new net . vvakame . util . jsonpullparser . util . JsonHash ( ) ; while ( ( state = parser . lookAhead ( ) ) != ( net . vvakame . util . jsonpullparser . JsonPullParser . State . END_HASH ) ) { state = parser . getEventType ( ) ; if ( state != ( net . vvakame . util . jsonpullparser . JsonPullParser . State . KEY ) ) { throw new net . vvakame . util . jsonpullparser . JsonFormatException ( ( "unexpected<sp>token.<sp>token=" + state ) , parser ) ; } java . lang . String key = parser . getValueString ( ) ; state = parser . lookAhead ( ) ; jsonHash . put ( key , net . vvakame . util . jsonpullparser . util . JsonHash . getValue ( parser ) , state ) ; } parser . getEventType ( ) ; return jsonHash ; }
org . junit . Assert . assertThat ( jsonHash . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) )
testRandomByteArrayTransfer2 ( ) { byte [ ] value = new byte [ ( io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) * 2 ] ; for ( int i = 0 ; i < ( ( ( buffer . capacity ( ) ) - ( io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) ) + 1 ) ; i += io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) { random . nextBytes ( value ) ; buffer . setBytes ( i , value , random . nextInt ( io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) , io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) ; } random . setSeed ( seed ) ; byte [ ] expectedValueContent = new byte [ ( io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) * 2 ] ; io . netty . buffer . ByteBuf expectedValue = io . netty . buffer . Unpooled . wrappedBuffer ( expectedValueContent ) ; for ( int i = 0 ; i < ( ( ( buffer . capacity ( ) ) - ( io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) ) + 1 ) ; i += io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) { random . nextBytes ( expectedValueContent ) ; int valueOffset = random . nextInt ( io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) ; buffer . getBytes ( i , value , valueOffset , io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) ; for ( int j = valueOffset ; j < ( valueOffset + ( io . netty . buffer . AbstractByteBufTest . BLOCK_SIZE ) ) ; j ++ ) { "<AssertPlaceHolder>" ; } } } getByte ( int ) { return buf . getByte ( index ) ; }
org . junit . Assert . assertEquals ( expectedValue . getByte ( j ) , value [ j ] )
testReActivateNotificationSource ( ) { registration . setActive ( true ) ; registration . reActivateNotificationSource ( ) ; "<AssertPlaceHolder>" ; verify ( mount ) . invokeCreateSubscription ( stream , java . util . Optional . empty ( ) ) ; } isActive ( ) { return org . opendaylight . netconf . callhome . protocol . MinaSshNettyChannel . notClosing ( session ) ; }
org . junit . Assert . assertTrue ( registration . isActive ( ) )
contentTypeShouldNotEqualWithNull ( ) { java . lang . String contentTypeString = "text/just+for+test" ; com . navercorp . volleyextensions . volleyer . http . ContentType contentType = com . navercorp . volleyextensions . volleyer . http . ContentType . createContentType ( contentTypeString ) ; com . navercorp . volleyextensions . volleyer . http . ContentType nullContentType = null ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( object instanceof com . navercorp . volleyextensions . volleyer . http . ContentType ) == false ) { return false ; } com . navercorp . volleyextensions . volleyer . http . ContentType otherContentType = ( ( com . navercorp . volleyextensions . volleyer . http . ContentType ) ( object ) ) ; if ( ( this ) == otherContentType ) { return true ; } if ( contentTypeString . equals ( otherContentType . contentTypeString ) ) { return true ; } return false ; }
org . junit . Assert . assertTrue ( ( ( contentType . equals ( nullContentType ) ) == false ) )
testMissingPublicKey ( ) { logger . info ( LinShareTestConstants . BEGIN_TEST ) ; java . security . interfaces . RSAPublicKey key = org . linagora . linshare . core . utils . PemRsaKeyHelper . loadSSHPublicKeyFromFile ( ( ( pemPublicKeyPath ) + "foo" ) ) ; "<AssertPlaceHolder>" ; logger . info ( LinShareTestConstants . END_TEST ) ; } loadSSHPublicKeyFromFile ( java . lang . String ) { java . lang . String pem = org . linagora . linshare . core . utils . PemRsaKeyHelper . loadPemKey ( pemPublicKeyPath ) ; if ( pem == null ) { org . linagora . linshare . core . utils . PemRsaKeyHelper . logger . info ( ( ( "Public<sp>key<sp>'" + pemPublicKeyPath ) + "'<sp>was<sp>not<sp>found.<sp>(check<sp>read<sp>access)" ) ) ; return null ; } java . security . interfaces . RSAPublicKey publicKey = org . linagora . linshare . core . utils . PemRsaKeyHelper . loadSSHPublicKey ( pem ) ; org . linagora . linshare . core . utils . PemRsaKeyHelper . logger . info ( ( ( "Public<sp>key<sp>'" + pemPublicKeyPath ) + "'<sp>was<sp>loaded" ) ) ; return publicKey ; }
org . junit . Assert . assertEquals ( null , key )
shouldDecodeLegacyBinary ( ) { com . couchbase . client . java . document . BinaryDocument document = converter . decode ( "id" , com . couchbase . client . deps . io . netty . buffer . Unpooled . copiedBuffer ( "value" , CharsetUtil . UTF_8 ) , 0 , 0 , TranscoderUtils . BINARY_COMPAT_FLAGS , ResponseStatus . SUCCESS ) ; "<AssertPlaceHolder>" ; } content ( ) { return content ; }
org . junit . Assert . assertEquals ( "value" , document . content ( ) . toString ( CharsetUtil . UTF_8 ) )
backhaulViolationAtAct2_shouldWork ( ) { buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore ( ) ; com . graphhopper . jsprit . core . analysis . SolutionAnalyser analyser = new com . graphhopper . jsprit . core . analysis . SolutionAnalyser ( vrp , solution , vrp . getTransportCosts ( ) ) ; com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute route = solution . getRoutes ( ) . iterator ( ) . next ( ) ; java . lang . Boolean violation = analyser . hasBackhaulConstraintViolationAtActivity ( route . getActivities ( ) . get ( 1 ) , route ) ; "<AssertPlaceHolder>" ; } get ( com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute ) { com . graphhopper . jsprit . core . problem . constraint . List < com . graphhopper . jsprit . core . problem . constraint . Vehicle > vehicles = new com . graphhopper . jsprit . core . problem . constraint . ArrayList < com . graphhopper . jsprit . core . problem . constraint . Vehicle > ( ) ; vehicles . add ( route . getVehicle ( ) ) ; vehicles . addAll ( fleetManager . getAvailableVehicles ( route . getVehicle ( ) ) ) ; return vehicles ; }
org . junit . Assert . assertFalse ( violation )
createTypeFromClass ( ) { com . baidu . unbiz . easymapper . metadata . Type < ? > type = com . baidu . unbiz . easymapper . metadata . TypeFactory . valueOf ( "java.util.List" ) ; "<AssertPlaceHolder>" ; } getRawType ( ) { return getType ( ) . getRawType ( ) ; }
org . junit . Assert . assertEquals ( java . util . List . class , type . getRawType ( ) )
testLines ( ) { org . springframework . mock . web . MockHttpServletResponse resp = getAsServletResponse ( "wfs?request=GetFeature&version=1.1.0&typeName=Lines&outputFormat=dxf" ) ; java . lang . String sResponse = testBasicResult ( resp , "Lines" ) ; int pos = getGeometrySearchStart ( sResponse ) ; "<AssertPlaceHolder>" ; checkSequence ( sResponse , new java . lang . String [ ] { "LWPOLYLINE" } , pos ) ; } getGeometrySearchStart ( java . lang . String ) { return response . indexOf ( "BLOCKS" ) ; }
org . junit . Assert . assertTrue ( ( pos != ( - 1 ) ) )
lazyLoadingDetachWarning ( ) { javax . persistence . EntityManager em = factory . createEntityManager ( ) ; org . meri . jpa . relationships . entities . Person simon = em . find ( org . meri . jpa . relationships . entities . Person . class , org . meri . jpa . relationships . SIMON_SLASH_ID ) ; em . detach ( simon ) ; "<AssertPlaceHolder>" ; em . close ( ) ; } getTwitterAccounts ( ) { return twitterAccounts ; }
org . junit . Assert . assertNull ( simon . getTwitterAccounts ( ) )
testChangeSessionId ( ) { javax . servlet . http . HttpServletRequest wrappedSimple = mock ( javax . servlet . http . HttpServletRequest . class ) ; com . amadeus . session . servlet . HttpRequestWrapper req = new com . amadeus . session . servlet . HttpRequestWrapper ( wrappedSimple , servletContext ) ; com . amadeus . session . servlet . RepositoryBackedHttpSession session = mock ( com . amadeus . session . servlet . RepositoryBackedHttpSession . class ) ; when ( sessionManager . getSession ( req , false , null ) ) . thenReturn ( session ) ; when ( session . getId ( ) ) . thenReturn ( com . amadeus . session . servlet . TestHttpRequestWrapper . SESSION_ID ) ; java . lang . String id = req . changeSessionId ( ) ; "<AssertPlaceHolder>" ; verify ( sessionManager ) . switchSessionId ( session ) ; verify ( session ) . getId ( ) ; } changeSessionId ( ) { retrieveSessionIfNeeded ( false ) ; if ( ( session ) == null ) { throw new java . lang . IllegalStateException ( "There<sp>is<sp>no<sp>session<sp>associated<sp>with<sp>the<sp>request." ) ; } manager . switchSessionId ( session ) ; return session . getId ( ) ; }
org . junit . Assert . assertEquals ( com . amadeus . session . servlet . TestHttpRequestWrapper . SESSION_ID , id )
testContextBoundConstraintValidatorFactory ( ) { final java . util . Set < javax . validation . ConstraintViolation < org . apache . bval . jsr . ContextConstraintValidatorFactoryTest . Example > > violations = validator . validate ( new org . apache . bval . jsr . ContextConstraintValidatorFactoryTest . Example ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return true ; }
org . junit . Assert . assertTrue ( violations . isEmpty ( ) )
whenAddItemThatAddInMassive ( ) { ru . java_edu . start . Tracker track = new ru . java_edu . start . Tracker ( ) ; ru . java_edu . start . Task task1 = new ru . java_edu . start . Task ( "pervaja<sp>zajavka" , "eto<sp>pervaja<sp>zajavka" ) ; "<AssertPlaceHolder>" ; } addItem ( ru . szhernovoy . tracker . models . Task ) { if ( ( this . position ) == ( ( this . items . length ) - 1 ) ) { this . position = 0 ; } this . items [ ( ( position ) ++ ) ] = item ; return item ; }
org . junit . Assert . assertNotNull ( track . addItem ( task1 ) )
testCreateAgentWithRights ( ) { net . maritimecloud . identityregistry . model . database . Organization actingOrg = mock ( net . maritimecloud . identityregistry . model . database . Organization . class ) ; actingOrg . setMrn ( "urn:mrn:mcp:org:agent" ) ; net . maritimecloud . identityregistry . model . database . Organization onBehalfOfOrg = mock ( net . maritimecloud . identityregistry . model . database . Organization . class ) ; onBehalfOfOrg . setMrn ( "urn:mrn:mcp:org:dma" ) ; net . maritimecloud . identityregistry . model . database . Agent agent = new net . maritimecloud . identityregistry . model . database . Agent ( ) ; agent . setIdActingOrganization ( 1L ) ; agent . setIdOnBehalfOfOrganization ( 2L ) ; java . lang . String agentJson = net . maritimecloud . identityregistry . controllers . JSONSerializer . serialize ( agent ) ; org . keycloak . adapters . springsecurity . token . KeycloakAuthenticationToken auth = net . maritimecloud . identityregistry . controllers . TokenGenerator . generateKeycloakToken ( "urn:mrn:mcp:org:dma" , "ROLE_ORG_ADMIN" , "" ) ; given ( this . organizationService . getOrganizationById ( any ( ) ) ) . willReturn ( actingOrg ) ; given ( this . organizationService . getOrganizationByMrn ( "urn:mrn:mcp:org:dma" ) ) . willReturn ( onBehalfOfOrg ) ; given ( onBehalfOfOrg . getId ( ) ) . willReturn ( 2L ) ; try { mvc . perform ( post ( "/oidc/api/org/urn:mrn:mcp:org:dma/agent" ) . with ( authentication ( auth ) ) . header ( "Origin" , "bla" ) . content ( agentJson ) . contentType ( "application/json" ) ) . andExpect ( status ( ) . isOk ( ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } } getId ( ) { return id ; }
org . junit . Assert . assertTrue ( false )
isPackageLocalMethodAndTestingRequired_A$MethodMeta$TestingTarget ( ) { org . junithelper . core . meta . MethodMeta methodMeta = new org . junithelper . core . meta . MethodMeta ( ) ; methodMeta . accessModifier = org . junithelper . core . meta . AccessModifier . PackageLocal ; org . junithelper . core . config . TestingTarget target_ = new org . junithelper . core . config . TestingTarget ( ) ; target_ . isPublicMethodRequired = true ; boolean actual = org . junithelper . core . generator . GeneratorImplFunction . isPackageLocalMethodAndTestingRequired ( methodMeta , target_ ) ; boolean expected = true ; "<AssertPlaceHolder>" ; } isPackageLocalMethodAndTestingRequired ( org . junithelper . core . meta . MethodMeta , org . junithelper . core . config . TestingTarget ) { return ( ( methodMeta . accessModifier ) == ( org . junithelper . core . meta . AccessModifier . PackageLocal ) ) && ( target . isPackageLocalMethodRequired ) ; }
org . junit . Assert . assertThat ( actual , is ( equalTo ( expected ) ) )
testCloseThreadGroup ( ) { final java . util . concurrent . atomic . AtomicBoolean flag = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; final java . util . concurrent . CountDownLatch passedCloseCall = new java . util . concurrent . CountDownLatch ( 1 ) ; java . lang . Thread t = SQSSession . SESSION_THREAD_FACTORY . newThread ( new java . lang . Runnable ( ) { @ com . amazon . sqs . javamessaging . Override public void run ( ) { try { sqsConnection . close ( ) ; } catch ( javax . jms . IllegalStateException e ) { flag . set ( true ) ; } catch ( com . amazon . sqs . javamessaging . JMSException e ) { e . printStackTrace ( ) ; } passedCloseCall . countDown ( ) ; } } ) ; t . start ( ) ; passedCloseCall . await ( ) ; "<AssertPlaceHolder>" ; } start ( ) { if ( ( isClosed ( ) ) || ( running ) ) { return ; } synchronized ( stateLock ) { running = true ; notifyStateChange ( ) ; } }
org . junit . Assert . assertTrue ( flag . get ( ) )
shouldReturnAllOperationsAsOperationDetails ( ) { final java . util . Set < java . lang . Class < ? extends uk . gov . gchq . gaffer . operation . Operation > > expectedOperations = client . getDefaultGraphFactory ( ) . getGraph ( ) . getSupportedOperations ( ) ; final javax . ws . rs . core . Response response = ( ( uk . gov . gchq . gaffer . rest . service . v2 . RestApiV2TestClient ) ( client ) ) . getAllOperationsAsOperationDetails ( ) ; byte [ ] json = response . readEntity ( byte [ ] . class ) ; java . util . List < uk . gov . gchq . gaffer . rest . service . v2 . OperationServiceV2IT . OperationDetailPojo > opDetails = uk . gov . gchq . gaffer . jsonserialisation . JSONSerialiser . deserialise ( json , new com . fasterxml . jackson . core . type . TypeReference < java . util . List < uk . gov . gchq . gaffer . rest . service . v2 . OperationServiceV2IT . OperationDetailPojo > > ( ) { } ) ; final java . util . Set < java . lang . String > opDetailClasses = opDetails . stream ( ) . map ( uk . gov . gchq . gaffer . rest . service . v2 . OperationServiceV2IT . OperationDetailPojo :: getName ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; for ( final java . lang . Class < ? extends uk . gov . gchq . gaffer . operation . Operation > clazz : expectedOperations ) { "<AssertPlaceHolder>" ; } } contains ( java . lang . Object ) { if ( null == ( collection ) ) { return ( null != ( singleItem ) ) && ( singleItem . equals ( o ) ) ; } return collection . contains ( o ) ; }
org . junit . Assert . assertTrue ( opDetailClasses . contains ( clazz . getName ( ) ) )
testJoinerConfigWithSelectedFields ( ) { io . cdap . plugin . batch . joiner . JoinerConfig config = new io . cdap . plugin . batch . joiner . JoinerConfig ( ( "film.film_id=filmActor.film_id=filmCategory.film_id&" + "film.film_name=filmActor.film_name=filmCategory.film_name" ) , io . cdap . plugin . batch . joiner . JoinerConfigTest . selectedFields , "film,filmActor,filmCategory" ) ; ImmutableTable . Builder < java . lang . String , java . lang . String , java . lang . String > expected = new com . google . common . collect . ImmutableTable . Builder < > ( ) ; expected . put ( "film" , "filmCategory" 0 , "filmCategory" 0 ) ; expected . put ( "film" , "film_name" , "film_name" ) ; expected . put ( "filmCategory" 1 , "actor_name" , "renamed_actor" ) ; expected . put ( "filmCategory" , "category_name" , "renamed_category" ) ; "<AssertPlaceHolder>" ; } getPerStageSelectedFields ( ) { ImmutableTable . Builder < java . lang . String , java . lang . String , java . lang . String > tableBuilder = new com . google . common . collect . ImmutableTable . Builder < > ( ) ; if ( com . google . common . base . Strings . isNullOrEmpty ( selectedFields ) ) { throw new java . lang . IllegalArgumentException ( "selectedFields<sp>can<sp>not<sp>be<sp>empty.<sp>Please<sp>provide<sp>at<sp>least<sp>1<sp>selectedFields" ) ; } for ( java . lang . String selectedField : com . google . common . base . Splitter . on ( ',' ) . trimResults ( ) . omitEmptyStrings ( ) . split ( selectedFields ) ) { java . lang . Iterable < java . lang . String > stageOldNameAliasPair = com . google . common . base . Splitter . on ( "<sp>as<sp>" ) . trimResults ( ) . omitEmptyStrings ( ) . split ( selectedField ) ; java . lang . Iterable < java . lang . String > stageOldNamePair = com . google . common . base . Splitter . on ( '.' ) . trimResults ( ) . omitEmptyStrings ( ) . split ( com . google . common . collect . Iterables . get ( stageOldNameAliasPair , 0 ) ) ; if ( ( com . google . common . collect . Iterables . size ( stageOldNamePair ) ) != 2 ) { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( ( "Invalid<sp>syntax.<sp>Selected<sp>Fields<sp>must<sp>be<sp>of<sp>syntax<sp>" + "<stageName>.<oldFieldName><sp>as<sp><alias>,<sp>but<sp>found<sp>%s" ) , selectedField ) ) ; } java . lang . String stageName = com . google . common . collect . Iterables . get ( stageOldNamePair , 0 ) ; java . lang . String oldFieldName = com . google . common . collect . Iterables . get ( stageOldNamePair , 1 ) ; java . lang . String alias = ( isAliasPresent ( stageOldNameAliasPair ) ) ? oldFieldName : com . google . common . collect . Iterables . get ( stageOldNameAliasPair , 1 ) ; tableBuilder . put ( stageName , oldFieldName , alias ) ; } return tableBuilder . build ( ) ; }
org . junit . Assert . assertEquals ( expected . build ( ) , config . getPerStageSelectedFields ( ) )
getTimestamp ( ) { long timestamp = java . lang . System . currentTimeMillis ( ) ; long input = 1000 ; long output = 2000 ; long inputRates = 10 ; long outputRates = 20 ; result = new com . ctrip . xpipe . redis . core . proxy . monitor . SessionTrafficResult ( timestamp , input , output , inputRates , outputRates ) ; "<AssertPlaceHolder>" ; } getTimestamp ( ) { return timestamp ; }
org . junit . Assert . assertEquals ( timestamp , result . getTimestamp ( ) )
accountServiceEventShouldHave2Itmems ( ) { rae = mapper . map ( dae , rae . getClass ( ) ) ; "<AssertPlaceHolder>" ; } getLoadBalancerServiceEvents ( ) { if ( ( loadBalancerServiceEvents ) == null ) { loadBalancerServiceEvents = new java . util . ArrayList < org . openstack . atlas . service . domain . events . pojos . LoadBalancerServiceEvents > ( ) ; } return this . loadBalancerServiceEvents ; }
org . junit . Assert . assertEquals ( 2 , rae . getLoadBalancerServiceEvents ( ) . size ( ) )
testReadEmptyFile ( ) { try { com . emc . storageos . systemservices . impl . healthmonitor . FileReadUtil . readFirstLine ( com . emc . storageos . systemservices . impl . healthmonitor . FileReadUtilTest . TEST_EMPTY_FILE_PATH ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } readFirstLine ( java . lang . String ) { return com . emc . storageos . systemservices . impl . healthmonitor . FileReadUtil . readLines ( filePath ) [ 0 ] ; }
org . junit . Assert . assertTrue ( true )
test_String_array ( ) { com . gh . mygreen . xlsmapper . xml . OgnlValueFormatter formatter = new com . gh . mygreen . xlsmapper . xml . OgnlValueFormatter ( ) ; java . lang . String exp = formatter . format ( new java . lang . String [ ] { "Hello" , "こ\"んにちは" } ) ; org . junit . Assert . assertThat ( exp , is ( "new<sp>String[]<sp>{\"Hello\",<sp>\"こ\\\"んにちは\"}" ) ) ; "<AssertPlaceHolder>" ; } evalOgnl ( java . lang . String ) { try { ognl . OgnlContext context = new ognl . OgnlContext ( ) ; java . lang . Object obj = ognl . Ognl . getValue ( expression , context , new java . lang . Object ( ) ) ; return ( ( A ) ( obj ) ) ; } catch ( ognl . OgnlException e ) { throw new java . lang . RuntimeException ( e ) ; } }
org . junit . Assert . assertArrayEquals ( ( ( java . lang . String [ ] ) ( evalOgnl ( exp ) ) ) , new java . lang . String [ ] { "Hello" , "こ\"んにちは" } )
testGetChainID ( ) { org . openscience . cdk . interfaces . IPDBAtom atom = ( ( org . openscience . cdk . interfaces . IPDBAtom ) ( newChemObject ( ) ) ) ; atom . setSymbol ( "C" ) ; atom . setChainID ( "123" ) ; "<AssertPlaceHolder>" ; } getChainID ( ) { return chainID ; }
org . junit . Assert . assertEquals ( "123" , atom . getChainID ( ) )
should_verify_null_password ( ) { org . mamute . model . User user = user ( org . mamute . validators . SignupValidatorTest . VALID_USER_NAME , org . mamute . validators . SignupValidatorTest . VALID_EMAIL ) ; boolean valid = signupValidator . validate ( user , null , null ) ; "<AssertPlaceHolder>" ; } validate ( org . mamute . model . User , java . lang . String , java . lang . String ) { if ( user == null ) return false ; userValidator . validate ( user ) ; if ( users . existsWithName ( user . getName ( ) ) ) { validator . add ( messageFactory . build ( "error" , "user.errors.name.used" ) ) ; } if ( ( ( password == null ) || ( ( password . length ( ) ) < ( org . mamute . validators . SignupValidator . PASSWORD_MIN_LENGTH ) ) ) || ( ( password . length ( ) ) > ( org . mamute . validators . SignupValidator . PASSWORD_MAX_LENGTH ) ) ) { validator . add ( messageFactory . build ( "error" , "signup.errors.password.length" ) ) ; } if ( ( password != null ) && ( ! ( password . equals ( passwordConfirmation ) ) ) ) { validator . add ( messageFactory . build ( "error" , "signup.errors.password_confirmation" ) ) ; } return ! ( validator . hasErrors ( ) ) ; }
org . junit . Assert . assertFalse ( valid )
testScanning ( ) { final org . jboss . shrinkwrap . api . Archive < ? > archive = create ( org . jboss . shrinkwrap . api . BeanArchive . class ) . addClass ( org . jboss . weld . environment . se . test . builder . scanning . EmbeddedApplication . class ) ; final java . io . File jar = java . io . File . createTempFile ( "weld-se-resource-loader-test" , ".jar" ) ; jar . deleteOnExit ( ) ; archive . as ( org . jboss . shrinkwrap . api . exporter . ZipExporter . class ) . exportTo ( jar , true ) ; java . lang . ClassLoader classLoader = new java . net . URLClassLoader ( new java . net . URL [ ] { jar . toURI ( ) . toURL ( ) } ) { @ org . jboss . weld . environment . se . test . builder . scanning . Override public java . util . Enumeration < java . net . URL > getResources ( java . lang . String name ) throws java . io . IOException { if ( AbstractWeldDeployment . BEANS_XML . equals ( name ) ) { return findResources ( name ) ; } return super . getResources ( name ) ; } } ; try ( org . jboss . weld . environment . se . WeldContainer weld = new org . jboss . weld . environment . se . Weld ( ) . setResourceLoader ( new org . jboss . weld . resources . ClassLoaderResourceLoader ( classLoader ) ) . initialize ( ) ) { java . util . concurrent . atomic . AtomicInteger payload = new java . util . concurrent . atomic . AtomicInteger ( ) ; weld . event ( ) . fire ( payload ) ; "<AssertPlaceHolder>" ; } } intValue ( ) { return 0 ; }
org . junit . Assert . assertEquals ( 10 , payload . intValue ( ) )
testEntityLinkingEnhancementEngine ( ) { org . apache . stanbol . enhancer . servicesapi . ContentItem ci = initContentItem ( ) ; org . apache . stanbol . enhancer . engines . entitytagging . impl . NamedEntityTaggingEngine entityLinkingEngine = initEngine ( true , true , true ) ; entityLinkingEngine . computeEnhancements ( ci ) ; int entityAnnotationCount = org . apache . stanbol . enhancer . engines . entitytagging . impl . TestEntityLinkingEnhancementEngine . validateAllEntityAnnotations ( entityLinkingEngine , ci ) ; "<AssertPlaceHolder>" ; } validateAllEntityAnnotations ( org . apache . stanbol . enhancer . engines . entitytagging . impl . NamedEntityTaggingEngine , org . apache . stanbol . enhancer . servicesapi . ContentItem ) { java . util . Map < org . apache . clerezza . commons . rdf . IRI , org . apache . clerezza . commons . rdf . RDFTerm > expectedValues = new java . util . HashMap < org . apache . clerezza . commons . rdf . IRI , org . apache . clerezza . commons . rdf . RDFTerm > ( ) ; expectedValues . put ( org . apache . stanbol . enhancer . engines . entitytagging . impl . ENHANCER_EXTRACTED_FROM , ci . getUri ( ) ) ; expectedValues . put ( org . apache . stanbol . enhancer . engines . entitytagging . impl . DC_CREATOR , org . apache . clerezza . rdf . core . LiteralFactory . getInstance ( ) . createTypedLiteral ( entityLinkingEngine . getClass ( ) . getName ( ) ) ) ; java . util . Iterator < org . apache . clerezza . commons . rdf . Triple > entityAnnotationIterator = ci . getMetadata ( ) . filter ( null , org . apache . stanbol . enhancer . engines . entitytagging . impl . RDF_TYPE , org . apache . stanbol . enhancer . engines . entitytagging . impl . ENHANCER_ENTITYANNOTATION ) ; expectedValues . put ( Properties . ENHANCER_CONFIDENCE , null ) ; int entityAnnotationCount = 0 ; while ( entityAnnotationIterator . hasNext ( ) ) { org . apache . clerezza . commons . rdf . IRI entityAnnotation = ( ( org . apache . clerezza . commons . rdf . IRI ) ( entityAnnotationIterator . next ( ) . getSubject ( ) ) ) ; validateEntityAnnotation ( ci . getMetadata ( ) , entityAnnotation , expectedValues ) ; org . apache . clerezza . commons . rdf . IRI ENTITYHUB_SITE = new org . apache . clerezza . commons . rdf . IRI ( RdfResourceEnum . site . getUri ( ) ) ; java . util . Iterator < org . apache . clerezza . commons . rdf . Triple > entitySiteIterator = ci . getMetadata ( ) . filter ( entityAnnotation , ENTITYHUB_SITE , null ) ; org . junit . Assert . assertTrue ( ( ( "Expected<sp>entityhub:site<sp>value<sp>is<sp>missing<sp>(entityAnnotation<sp>" + entityAnnotation ) + ")" ) , entitySiteIterator . hasNext ( ) ) ; org . apache . clerezza . commons . rdf . RDFTerm siteResource = entitySiteIterator . next ( ) . getObject ( ) ; org . junit . Assert . assertTrue ( "entityhub:site<sp>values<sp>MUST<sp>BE<sp>Literals" , ( siteResource instanceof org . apache . clerezza . commons . rdf . Literal ) ) ; org . junit . Assert . assertEquals ( "'dbpedia'<sp>is<sp>expected<sp>as<sp>entityhub:site<sp>value" , "dbpedia" , ( ( org . apache . clerezza . commons . rdf . Literal ) ( siteResource ) ) . getLexicalForm ( ) ) ; org . junit . Assert . assertFalse ( "entityhub:site<sp>MUST<sp>HAVE<sp>only<sp>a<sp>single<sp>value" , entitySiteIterator . hasNext ( ) ) ; entityAnnotationCount ++ ; } return entityAnnotationCount ; }
org . junit . Assert . assertEquals ( 3 , entityAnnotationCount )
shouldHandleFlipBeanFailedExceptionGivenFipWithBeanFailed ( ) { java . lang . String response = flipControllerAdvice . handleFlipBeanFailedException ( new org . flips . exception . FlipBeanFailedException ( "test" ) ) ; "<AssertPlaceHolder>" ; } handleFlipBeanFailedException ( org . flips . exception . FlipBeanFailedException ) { return ex . getMessage ( ) ; }
org . junit . Assert . assertEquals ( "test" , response )
testPow ( ) { javax . measure . Unit < ? > result = one . pow ( 10 ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( one , result )
disallowsNullKeyAndNullValue ( ) { "<AssertPlaceHolder>" ; } okToAdd ( java . lang . Object , java . lang . Object ) { return true ; }
org . junit . Assert . assertFalse ( generator . okToAdd ( null , null ) )
testDefaultValue ( ) { java . lang . String INPUT = "My<sp>Default" ; com . thinkbiganalytics . policy . standardization . DefaultValueStandardizer standardizer = new com . thinkbiganalytics . policy . standardization . DefaultValueStandardizer ( INPUT ) ; com . thinkbiganalytics . policy . rest . model . FieldStandardizationRule uiModel = com . thinkbiganalytics . standardization . transform . StandardizationAnnotationTransformer . instance ( ) . toUIModel ( standardizer ) ; com . thinkbiganalytics . policy . standardization . DefaultValueStandardizer convertedPolicy = fromUI ( uiModel , com . thinkbiganalytics . policy . standardization . DefaultValueStandardizer . class ) ; "<AssertPlaceHolder>" ; } getDefaultStr ( ) { return defaultStr ; }
org . junit . Assert . assertEquals ( INPUT , convertedPolicy . getDefaultStr ( ) )