input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testGetCredentialFromCredStash ( ) { org . finra . herd . model . dto . AwsParamsDto awsParamsDto = new org . finra . herd . model . dto . AwsParamsDto ( org . finra . herd . dao . AbstractDaoTest . NO_AWS_ACCESS_KEY , org . finra . herd . dao . AbstractDaoTest . NO_AWS_SECRET_KEY , org . finra . herd . dao . AbstractDaoTest . NO_SESSION_TOKEN , org . finra . herd . dao . AbstractDaoTest . HTTP_PROXY_HOST , org . finra . herd . dao . AbstractDaoTest . HTTP_PROXY_PORT , org . finra . herd . dao . AbstractDaoTest . NO_AWS_REGION_NAME ) ; com . amazonaws . ClientConfiguration clientConfiguration = new com . amazonaws . ClientConfiguration ( ) ; java . util . Map < java . lang . String , java . lang . String > credStashEncryptionContextMap = new java . util . HashMap ( ) ; credStashEncryptionContextMap . put ( org . finra . herd . dao . AbstractDaoTest . KEY , org . finra . herd . dao . AbstractDaoTest . VALUE ) ; org . finra . herd . dao . credstash . CredStash credStash = mock ( org . finra . herd . dao . credstash . CredStash . class ) ; when ( credStash . getCredential ( org . finra . herd . dao . AbstractDaoTest . USER_CREDENTIAL_NAME , credStashEncryptionContextMap ) ) . thenReturn ( org . finra . herd . dao . AbstractDaoTest . PASSWORD ) ; when ( configurationHelper . getProperty ( ConfigurationValue . CREDSTASH_AWS_REGION_NAME ) ) . thenReturn ( org . finra . herd . dao . AbstractDaoTest . AWS_REGION_NAME ) ; when ( configurationHelper . getProperty ( ConfigurationValue . CREDSTASH_TABLE_NAME ) ) . thenReturn ( org . finra . herd . dao . AbstractDaoTest . TABLE_NAME ) ; when ( awsHelper . getAwsParamsDto ( ) ) . thenReturn ( awsParamsDto ) ; when ( awsHelper . getClientConfiguration ( awsParamsDto ) ) . thenReturn ( clientConfiguration ) ; when ( credStashFactory . getCredStash ( org . finra . herd . dao . AbstractDaoTest . AWS_REGION_NAME , org . finra . herd . dao . AbstractDaoTest . TABLE_NAME , clientConfiguration ) ) . thenReturn ( credStash ) ; when ( jsonHelper . unmarshallJsonToObject ( java . util . Map . class , org . finra . herd . dao . AbstractDaoTest . CREDSTASH_ENCRYPTION_CONTEXT ) ) . thenReturn ( credStashEncryptionContextMap ) ; java . lang . String result = credStashHelper . getCredentialFromCredStash ( org . finra . herd . dao . AbstractDaoTest . CREDSTASH_ENCRYPTION_CONTEXT , org . finra . herd . dao . AbstractDaoTest . USER_CREDENTIAL_NAME ) ; verify ( configurationHelper ) . getProperty ( ConfigurationValue . CREDSTASH_AWS_REGION_NAME ) ; verify ( configurationHelper ) . getProperty ( ConfigurationValue . CREDSTASH_TABLE_NAME ) ; verify ( awsHelper ) . getAwsParamsDto ( ) ; verify ( awsHelper ) . getClientConfiguration ( awsParamsDto ) ; verify ( credStashFactory ) . getCredStash ( org . finra . herd . dao . AbstractDaoTest . AWS_REGION_NAME , org . finra . herd . dao . AbstractDaoTest . TABLE_NAME , clientConfiguration ) ; verify ( jsonHelper ) . unmarshallJsonToObject ( java . util . Map . class , org . finra . herd . dao . AbstractDaoTest . CREDSTASH_ENCRYPTION_CONTEXT ) ; verify ( credStash ) . getCredential ( org . finra . herd . dao . AbstractDaoTest . USER_CREDENTIAL_NAME , credStashEncryptionContextMap ) ; verifyNoMoreInteractions ( credStash ) ; verifyNoMoreInteractionsHelper ( ) ; "<AssertPlaceHolder>" ; } verifyNoMoreInteractionsHelper ( ) { verifyNoMoreInteractions ( awsHelper , javaPropertiesHelper , retryPolicyFactory , s3Operations ) ; }
org . junit . Assert . assertEquals ( org . finra . herd . dao . AbstractDaoTest . PASSWORD , result )
testParseDataType ( ) { final int dataType = 5 ; final java . lang . String line = ( "data<sp>type<sp>=<sp>" + dataType ) + "\n" ; final java . io . BufferedReader in = createReader ( ( ( org . esa . beam . dataio . envi . HeaderTest . createMandatoryHeader ( ) ) + line ) ) ; final org . esa . beam . dataio . envi . Header header = new org . esa . beam . dataio . envi . Header ( in ) ; "<AssertPlaceHolder>" ; } getDataType ( ) { return dataType ; }
org . junit . Assert . assertEquals ( dataType , header . getDataType ( ) )
testHandle ( ) { org . apache . servicecomb . authentication . provider . ProviderAuthHanlder providerAuthHanlder = new org . apache . servicecomb . authentication . provider . ProviderAuthHanlder ( ) ; providerAuthHanlder . handle ( invocation , asyncResp ) ; "<AssertPlaceHolder>" ; } handle ( java . lang . String , java . util . Map ) { if ( ( parseConfigs == null ) || ( parseConfigs . isEmpty ( ) ) ) { return ; } java . util . Map < java . lang . String , java . lang . Object > configuration = org . apache . servicecomb . config . ConfigMapping . getConvertedMap ( parseConfigs ) ; if ( "create" . equals ( action ) ) { valueCache . putAll ( configuration ) ; updateConfiguration ( createIncremental ( com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > copyOf ( configuration ) , null , null ) ) ; } else if ( "set" . equals ( action ) ) { valueCache . putAll ( configuration ) ; updateConfiguration ( createIncremental ( null , com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > copyOf ( configuration ) , null ) ) ; } else if ( "delete" . equals ( action ) ) { for ( java . lang . String itemKey : configuration . keySet ( ) ) { valueCache . remove ( itemKey ) ; } updateConfiguration ( createIncremental ( null , null , com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > copyOf ( configuration ) ) ) ; } else { org . apache . servicecomb . config . archaius . sources . ConfigCenterConfigurationSourceImpl . LOGGER . error ( "action:<sp>{}<sp>is<sp>invalid." , action ) ; return ; } org . apache . servicecomb . config . archaius . sources . ConfigCenterConfigurationSourceImpl . LOGGER . warn ( "Config<sp>value<sp>cache<sp>changed:<sp>action:{};<sp>item:{}" , action , configuration . keySet ( ) ) ; }
org . junit . Assert . assertTrue ( true )
list1_size1 ( ) { sut . add ( "A" ) ; int actual = sut . size ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( 1 ) )
testGetChildren ( ) { final org . apache . oozie . fluentjob . api . dag . End instance = getInstance ( "end" ) ; "<AssertPlaceHolder>" ; } getChildren ( ) { return java . util . Arrays . asList ( ) ; }
org . junit . Assert . assertTrue ( instance . getChildren ( ) . isEmpty ( ) )
whenHasEnoughTotalVotes_thenSucceed ( ) { final org . baeldung . persistence . model . Post post = new org . baeldung . persistence . model . Post ( ) ; post . setMinScoreRequired ( 5 ) ; post . setMinTotalVotes ( 8 ) ; final org . baeldung . reddit . util . PostScores postScores = new org . baeldung . reddit . util . PostScores ( 2 , 10 , 1 ) ; "<AssertPlaceHolder>" ; } didPostGoalFail ( org . baeldung . persistence . model . Post , org . baeldung . reddit . util . PostScores ) { final boolean failToReachRequiredScore = ( postScores . getScore ( ) ) < ( post . getMinScoreRequired ( ) ) ; final boolean enoughTotalVotes = ( ( postScores . getTotalVotes ( ) ) >= ( post . getMinTotalVotes ( ) ) ) && ( ( post . getMinTotalVotes ( ) ) > 0 ) ; final boolean keepBecauseOfComments = ( ( postScores . getNoOfComments ( ) ) > 0 ) && ( post . isKeepIfHasComments ( ) ) ; return failToReachRequiredScore && ( ! ( keepBecauseOfComments || enoughTotalVotes ) ) ; }
org . junit . Assert . assertFalse ( didPostGoalFail ( post , postScores ) )
testGetName ( ) { java . lang . String nameParam = "nameX" ; java . lang . String valueParam = "val" ; com . gisgraphy . domain . valueobject . NameValueDTO < java . lang . String > nv = new com . gisgraphy . domain . valueobject . NameValueDTO < java . lang . String > ( nameParam , valueParam ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( nameParam , nv . getName ( ) )
getReverseActionsNull ( ) { com . ibm . ws . security . authorization . jacc . web . impl . ActionString as = new com . ibm . ws . security . authorization . jacc . web . impl . ActionString ( ) ; "<AssertPlaceHolder>" ; } getReverseActions ( ) { java . lang . String output = null ; if ( ( _actions ) != null ) { if ( _actions . startsWith ( "!" ) ) { output = _actions . substring ( 1 ) ; } else { output = "!" + ( _actions ) ; } } return output ; }
org . junit . Assert . assertNull ( as . getReverseActions ( ) )
testAutoRemoveWhenSetToTrue ( ) { requireDockerApiVersionAtLeast ( "1.25" , "AutoRemove" ) ; sut . pull ( com . spotify . docker . client . DefaultDockerClientTest . BUSYBOX_LATEST ) ; final com . spotify . docker . client . messages . ContainerConfig config = com . spotify . docker . client . messages . ContainerConfig . builder ( ) . image ( com . spotify . docker . client . DefaultDockerClientTest . BUSYBOX_LATEST ) . hostConfig ( com . spotify . docker . client . messages . HostConfig . builder ( ) . autoRemove ( true ) . build ( ) ) . build ( ) ; final com . spotify . docker . client . messages . ContainerCreation container = sut . createContainer ( config , randomName ( ) ) ; final com . spotify . docker . client . messages . ContainerInfo info = sut . inspectContainer ( container . id ( ) ) ; "<AssertPlaceHolder>" ; sut . startContainer ( container . id ( ) ) ; sut . stopContainer ( container . id ( ) , 5 ) ; await ( ) . until ( containerIsRunning ( sut , container . id ( ) ) , org . hamcrest . Matchers . is ( false ) ) ; exception . expect ( com . spotify . docker . client . exceptions . ContainerNotFoundException . class ) ; sut . inspectContainer ( container . id ( ) ) ; } id ( ) { return id ; }
org . junit . Assert . assertThat ( info . hostConfig ( ) . autoRemove ( ) , org . hamcrest . Matchers . is ( true ) )
testFromEmptyOptional ( ) { java . util . Optional < java . lang . String > empty = java . util . Optional . empty ( ) ; org . codefx . libfx . serialization . SerializableOptional < java . lang . String > emptySerializable = org . codefx . libfx . serialization . SerializableOptional . fromOptional ( empty ) ; "<AssertPlaceHolder>" ; } asOptional ( ) { return optional ; }
org . junit . Assert . assertEquals ( empty , emptySerializable . asOptional ( ) )
testRondverteer ( ) { final nl . bzk . migratiebrp . conversie . model . brp . BrpPersoonslijst brpPersoonslijst = converteerLo3NaarBrpService . converteerLo3Persoonslijst ( getLo3Persoonslijst ( ) ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Persoonslijst terug = converteerBrpNaarLo3Service . converteerBrpPersoonslijst ( brpPersoonslijst ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Stapel < nl . bzk . migratiebrp . conversie . model . lo3 . categorie . Lo3PersoonInhoud > rondverteerdeStapel = terug . getPersoonStapel ( ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Stapel < nl . bzk . migratiebrp . conversie . model . lo3 . categorie . Lo3PersoonInhoud > origineleStapel = getLo3Persoonslijst ( ) . getPersoonStapel ( ) ; "<AssertPlaceHolder>" ; } getPersoonStapel ( ) { return persoonStapel ; }
org . junit . Assert . assertEquals ( origineleStapel , rondverteerdeStapel )
getPresenter ( ) { java . lang . Object object = this . view . getPresenter ( ) ; "<AssertPlaceHolder>" ; } getPresenter ( ) { this . initializeFXMLLoader ( ) ; return this . presenterProperty . get ( ) ; }
org . junit . Assert . assertNotNull ( object )
testCreate ( ) { org . oscarehr . common . model . ConsultDocs entity = new org . oscarehr . common . model . ConsultDocs ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
org . junit . Assert . assertNotNull ( entity . getId ( ) )
decode_values_of_the_previously_supported_format ( ) { final java . util . Map < java . lang . String , java . lang . String > inMap = new java . util . HashMap < java . lang . String , java . lang . String > ( 2 ) ; inMap . put ( "a" , "b" ) ; inMap . put ( "c" , "d" ) ; final java . lang . String data = oldEncoder ( inMap ) ; final java . util . Map < java . lang . String , java . lang . String > outMap = new java . util . HashMap < java . lang . String , java . lang . String > ( 0 ) ; ninja . utils . CookieDataCodec . decode ( outMap , data ) ; "<AssertPlaceHolder>" ; } decode ( java . util . Map , java . lang . String ) { java . lang . String [ ] keyValues = data . split ( "&" ) ; for ( java . lang . String keyValue : keyValues ) { java . lang . String [ ] splitted = keyValue . split ( "=" , 2 ) ; if ( ( splitted . length ) == 2 ) { map . put ( java . net . URLDecoder . decode ( splitted [ 0 ] , "utf-8" ) , java . net . URLDecoder . decode ( splitted [ 1 ] , "utf-8" ) ) ; } } }
org . junit . Assert . assertEquals ( 0 , outMap . size ( ) )
testInputStreamChannel ( ) { byte [ ] expected = new byte [ Short . MAX_VALUE ] ; this . random . nextBytes ( expected ) ; net . sf . hajdbc . io . InputSinkChannel < java . io . InputStream , S > channel = this . strategy . createInputStreamChannel ( ) ; S sink = channel . write ( new java . io . ByteArrayInputStream ( expected ) ) ; try ( java . io . InputStream input = channel . read ( sink ) ) { byte [ ] result = new byte [ Short . MAX_VALUE ] ; input . read ( result ) ; "<AssertPlaceHolder>" ; } } read ( D extends net . sf . hajdbc . Database ) { this . connectionSource = database . getConnectionSource ( ) ; this . credentials = database . getCredentials ( ) ; this . weight = database . getWeight ( ) ; this . locality = database . getLocality ( ) ; return this ; }
org . junit . Assert . assertArrayEquals ( expected , result )
testDouble ( ) { java . lang . Class < com . j256 . ormlite . field . types . DoubleTypeTest . LocalDouble > clazz = com . j256 . ormlite . field . types . DoubleTypeTest . LocalDouble . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . DoubleTypeTest . LocalDouble , java . lang . Object > dao = createDao ( clazz , true ) ; double val = 1.3313323131221E10 ; java . lang . String valStr = java . lang . Double . toString ( val ) ; com . j256 . ormlite . field . types . DoubleTypeTest . LocalDouble foo = new com . j256 . ormlite . field . types . DoubleTypeTest . LocalDouble ( ) ; foo . doubleField = val ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , val , val , val , valStr , DataType . DOUBLE , com . j256 . ormlite . field . types . DoubleTypeTest . DOUBLE_COLUMN , false , true , false , true , false , false , true , false ) ; } create ( T ) { checkForInitialized ( ) ; if ( data == null ) { return 0 ; } if ( data instanceof com . j256 . ormlite . misc . BaseDaoEnabled ) { @ com . j256 . ormlite . dao . SuppressWarnings ( "unchecked" ) com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > daoEnabled = ( ( com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > ) ( data ) ) ; daoEnabled . setDao ( this ) ; } com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . create ( connection , data , objectCache ) ; } finally { connectionSource . releaseConnection ( connection ) ; } }
org . junit . Assert . assertEquals ( 1 , dao . create ( foo ) )
test ( ) { pipeline . apply ( org . apache . beam . sdk . io . GenerateSequence . from ( 0 ) . to ( org . apache . beam . runners . core . metrics . MetricsPusherTest . NUM_ELEMENTS ) . withMaxReadTime ( org . joda . time . Duration . standardDays ( 1 ) ) ) . apply ( org . apache . beam . sdk . transforms . ParDo . of ( new org . apache . beam . runners . core . metrics . MetricsPusherTest . CountingDoFn ( ) ) ) ; pipeline . run ( ) ; java . lang . Thread . sleep ( ( ( ( pipeline . getOptions ( ) . as ( org . apache . beam . sdk . metrics . MetricsOptions . class ) . getMetricsPushPeriod ( ) ) + 1L ) * 1000 ) ) ; "<AssertPlaceHolder>" ; } getCounterValue ( ) { return org . apache . beam . runners . core . metrics . TestMetricsSink . counterValue ; }
org . junit . Assert . assertThat ( org . apache . beam . runners . core . metrics . TestMetricsSink . getCounterValue ( ) , org . hamcrest . Matchers . is ( org . apache . beam . runners . core . metrics . MetricsPusherTest . NUM_ELEMENTS ) )
testDateIndexExpansion ( ) { java . lang . String originalQuery = "filter:betweenDates(UPTIME,<sp>'20100704_200000',<sp>'20100704_210000')" ; java . lang . String expectedQuery = "(filter:betweenDates(UPTIME,<sp>'20100704_200000',<sp>'20100704_210000')<sp>&&<sp>(SHARDS_AND_DAYS<sp>=<sp>'20100703_0,20100704_0,20100704_2,20100705_1'))" ; org . apache . commons . jexl2 . parser . ASTJexlScript script = datawave . query . jexl . JexlASTHelper . parseJexlQuery ( originalQuery ) ; java . util . Date startDate = datawave . util . time . DateHelper . parse ( "20100701" ) ; java . util . Date endDate = datawave . util . time . DateHelper . parse ( "20100710" ) ; datawave . query . config . ShardQueryConfiguration config = new datawave . query . config . ShardQueryConfiguration ( ) ; config . setBeginDate ( startDate ) ; config . setEndDate ( endDate ) ; datawave . query . util . DateIndexHelper helper2 = new datawave . query . util . DateIndexHelperFactory ( ) . createDateIndexHelper ( ) . initialize ( datawave . query . jexl . visitors . DateIndexQueryExpansionVisitorTest . connector , TableName . DATE_INDEX , java . util . Collections . singleton ( auths ) , 2 , 0.9F ) ; org . apache . commons . jexl2 . parser . ASTJexlScript newScript = datawave . query . jexl . visitors . FunctionIndexQueryExpansionVisitor . expandFunctions ( config , helper , helper2 , script ) ; java . lang . String newQuery = datawave . query . jexl . visitors . JexlStringBuildingVisitor . buildQuery ( newScript ) ; "<AssertPlaceHolder>" ; } buildQuery ( org . apache . commons . jexl2 . parser . JexlNode ) { datawave . query . jexl . visitors . JexlStringBuildingVisitor visitor = new datawave . query . jexl . visitors . JexlStringBuildingVisitor ( ) ; java . lang . String s = null ; try { java . lang . StringBuilder sb = ( ( java . lang . StringBuilder ) ( script . jjtAccept ( visitor , new java . lang . StringBuilder ( ) ) ) ) ; s = sb . toString ( ) ; try { datawave . query . jexl . JexlASTHelper . parseJexlQuery ( s ) ; } catch ( org . apache . commons . jexl2 . parser . ParseException e ) { datawave . query . jexl . visitors . JexlStringBuildingVisitor . log . error ( "Could<sp>not<sp>parse<sp>JEXL<sp>AST<sp>after<sp>performing<sp>transformations<sp>to<sp>run<sp>the<sp>query" , e ) ; for ( java . lang . String line : datawave . query . jexl . visitors . PrintingVisitor . formattedQueryStringList ( script ) ) { datawave . query . jexl . visitors . JexlStringBuildingVisitor . log . error ( line ) ; } datawave . query . jexl . visitors . JexlStringBuildingVisitor . log . error ( "" ) ; datawave . webservice . query . exception . QueryException qe = new datawave . webservice . query . exception . QueryException ( datawave . webservice . query . exception . DatawaveErrorCode . QUERY_EXECUTION_ERROR , e ) ; throw new datawave . query . exceptions . DatawaveFatalQueryException ( qe ) ; } } catch ( java . lang . StackOverflowError e ) { throw e ; } return s ; }
org . junit . Assert . assertEquals ( expectedQuery , newQuery )
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . document . library . kernel . model . DLFileEntryMetadata . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "fileEntryMetadataId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . document . library . kernel . model . DLFileEntryMetadata > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testIndexOf_02_SmallData ( ) { org . riversun . finbin . BinarySearcher bs = new org . riversun . finbin . BinarySearcher ( ) ; byte [ ] srcBytes = SMALL_SIZE_TEST_BYTES ; java . lang . String searchText = "world" ; byte [ ] searchBytes = getBytes ( searchText ) ; final int startIndex = 5 ; final int expected = 25 ; final int resultVal = bs . indexOf ( srcBytes , searchBytes , startIndex ) ; "<AssertPlaceHolder>" ; } indexOf ( byte [ ] , byte [ ] , int ) { final int endIndex = ( srcBytes . length ) - 1 ; return indexOf ( srcBytes , searchBytes , startIndex , endIndex ) ; }
org . junit . Assert . assertEquals ( expected , resultVal )
invalidIntegerMinLengthConstraintShouldCreateViolations ( ) { java . util . Set < javax . validation . ConstraintViolation < org . alien4cloud . tosca . model . definitions . PropertyDefinition > > violations = validator . validate ( createMinLenghtDefinition ( ToscaTypes . INTEGER . toString ( ) , 2 ) , alien4cloud . tosca . container . validation . ToscaSequence . class ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "name:<sp>[" + ( name ) ) + "],<sp>value:<sp>[" ) + ( value ) ) + "]" ; }
org . junit . Assert . assertEquals ( 2 , violations . size ( ) )
testNotContains ( ) { collection = java . util . Collections . singleton ( new java . lang . Object ( ) ) ; "<AssertPlaceHolder>" ; } render ( ) { tag . setPageContext ( context ) ; tag . setCollection ( collection ) ; tag . setObject ( object ) ; tag . setSuccessMessage ( successMessage ) ; tag . setFailMessage ( failMessage ) ; tag . doStartTag ( ) ; return ( ( org . springframework . mock . web . MockHttpServletResponse ) ( context . getResponse ( ) ) ) . getContentAsString ( ) ; }
org . junit . Assert . assertEquals ( this . render ( ) , failMessage )
testShouldResolveWithSocksNonProxyHost ( ) { java . lang . System . setProperty ( "socksProxyHost" , "fake-socks-proxy" ) ; java . lang . System . setProperty ( "socksNonProxyHosts" , "example.com" ) ; org . postgresql . util . HostSpec hostSpec = new org . postgresql . util . HostSpec ( "example.com" , 5432 ) ; "<AssertPlaceHolder>" ; } shouldResolve ( ) { java . lang . String socksProxy = java . lang . System . getProperty ( "socksProxyHost" ) ; if ( ( socksProxy == null ) || ( socksProxy . trim ( ) . isEmpty ( ) ) ) { return true ; } return matchesNonProxyHosts ( ) ; }
org . junit . Assert . assertTrue ( hostSpec . shouldResolve ( ) )
one_$parent_array_query_projection_with_no_match ( ) { com . redhat . lightblue . query . Projection p = com . redhat . lightblue . eval . EvalTestContext . projectionFromJson ( "{'field':'field6.$parent.field7','match':{'field':'elemf3','op':'>','rvalue':25},'project':{'field':'*'}}" ) ; com . redhat . lightblue . eval . Projector projector = com . redhat . lightblue . eval . Projector . getInstance ( p , md ) ; com . fasterxml . jackson . databind . JsonNode expectedNode = com . redhat . lightblue . util . JsonUtils . json ( "{}" . replace ( '\'' , '\"' ) ) ; com . redhat . lightblue . util . JsonDoc pdoc = projector . project ( jsonDoc , com . redhat . lightblue . eval . JSON_NODE_FACTORY ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ops [ 0 ] ; }
org . junit . Assert . assertEquals ( expectedNode . toString ( ) , pdoc . toString ( ) )
testCycle ( ) { com . cedarsoftware . util . TestGraphComparator . Node A = new com . cedarsoftware . util . TestGraphComparator . Node ( "A" ) ; com . cedarsoftware . util . TestGraphComparator . Node B = new com . cedarsoftware . util . TestGraphComparator . Node ( "B" ) ; com . cedarsoftware . util . TestGraphComparator . Node C = new com . cedarsoftware . util . TestGraphComparator . Node ( "C" ) ; A . child = B ; B . child = C ; C . child = A ; com . cedarsoftware . util . TestGraphComparator . Node Acopy = ( ( com . cedarsoftware . util . TestGraphComparator . Node ) ( clone ( A ) ) ) ; java . util . List deltas = new java . util . ArrayList ( ) ; com . cedarsoftware . util . GraphComparator . compare ( A , Acopy , getIdFetcher ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , deltas . size ( ) )
testBoundingBoxIntesects ( ) { org . teiid . query . sql . symbol . Expression ex = org . teiid . query . processor . TestFunctionResolving . getExpression ( "ST_GEOMFROMTEXT('LINESTRING(0<sp>0,<sp>1<sp>3)')<sp>&&<sp>ST_GEOMFROMTEXT('POINT(0<sp>1)')" ) ; "<AssertPlaceHolder>" ; } evaluate ( org . teiid . query . eval . Criteria ) { return new org . teiid . query . eval . Evaluator ( java . util . Collections . emptyMap ( ) , null , null ) . evaluate ( criteria , java . util . Collections . emptyList ( ) ) ; }
org . junit . Assert . assertTrue ( ( ( java . lang . Boolean ) ( org . teiid . query . eval . Evaluator . evaluate ( ex ) ) ) )
testFindByKeyword ( ) { java . util . List < com . hantsylab . example . ee7 . blog . domain . model . User > foundUsers = users . findByKeyword ( "test" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 1 , foundUsers . size ( ) )
testCharacter ( ) { java . lang . Character t = 'a' ; t = roundTrip ( t , org . apache . juneau . a . rttests . Character . class ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( new java . lang . Character ( 'a' ) , t )
testFindAll ( ) { java . util . List < org . sculptor . examples . library . media . domain . PhysicalMedia > all = physicalMediaService . findAll ( getServiceContext ( ) ) ; "<AssertPlaceHolder>" ; } getServiceContext ( ) { return org . sculptor . framework . test . AppEngineTestHelper . getServiceContext ( ) ; }
org . junit . Assert . assertEquals ( 6 , all . size ( ) )
testSerialization ( ) { org . jfree . data . xy . CategoryTableXYDataset d1 = new org . jfree . data . xy . CategoryTableXYDataset ( ) ; d1 . add ( 1.0 , 1.1 , "Series<sp>1" ) ; d1 . add ( 2.0 , 2.2 , "Series<sp>1" ) ; org . jfree . data . xy . CategoryTableXYDataset d2 = ( ( org . jfree . data . xy . CategoryTableXYDataset ) ( org . jfree . chart . TestUtilities . serialised ( d1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( d1 , d2 )
testWriteValueSubTrue ( ) { java . util . Map < java . lang . String , org . msgpack . type . Value > values = new java . util . HashMap < java . lang . String , org . msgpack . type . Value > ( ) ; doReturn ( true ) . when ( target ) . writeValueSub ( values ) ; "<AssertPlaceHolder>" ; verify ( target , times ( 1 ) ) . writeValueSub ( values ) ; } writeValueSub ( java . util . Map ) { values . put ( "subscriber_id" , org . msgpack . type . ValueFactory . createRawValue ( subscriberId ) ) ; org . msgpack . type . Value [ ] filtersMap = new org . msgpack . type . Value [ ( eventFilters . size ( ) ) * 2 ] ; int num1 = 0 ; for ( java . util . Map . Entry < java . lang . String , java . util . Set < java . lang . String > > entry : eventFilters . entrySet ( ) ) { org . msgpack . type . Value [ ] eventsArray = new org . msgpack . type . Value [ entry . getValue ( ) . size ( ) ] ; int num2 = 0 ; for ( java . lang . String eventId : entry . getValue ( ) ) { eventsArray [ ( num2 ++ ) ] = org . msgpack . type . ValueFactory . createRawValue ( eventId ) ; } filtersMap [ ( num1 * 2 ) ] = org . msgpack . type . ValueFactory . createRawValue ( entry . getKey ( ) ) ; filtersMap [ ( ( num1 * 2 ) + 1 ) ] = org . msgpack . type . ValueFactory . createArrayValue ( eventsArray ) ; ++ num1 ; } values . put ( "event_filters" , org . msgpack . type . ValueFactory . createMapValue ( filtersMap ) ) ; return true ; }
org . junit . Assert . assertThat ( target . writeValueSub ( values ) , org . hamcrest . CoreMatchers . is ( true ) )
shouldHandleLocalDateTime ( ) { final java . time . LocalDateTime o = java . time . LocalDateTime . now ( ) ; "<AssertPlaceHolder>" ; } serializeDeserialize ( org . apache . tinkerpop . shaded . jackson . databind . ObjectMapper , java . lang . Object , java . lang . Class ) { try ( final java . io . ByteArrayOutputStream stream = new java . io . ByteArrayOutputStream ( ) ) { mapper . writeValue ( stream , o ) ; try ( final java . io . InputStream inputStream = new java . io . ByteArrayInputStream ( stream . toByteArray ( ) ) ) { return mapper . readValue ( inputStream , clazz ) ; } } }
org . junit . Assert . assertEquals ( o , serializeDeserialize ( mapper , o , java . time . LocalDateTime . class ) )
testGetProviderTypes ( ) { java . util . List < org . guvnor . ala . runtime . providers . ProviderType > values = org . guvnor . ala . AlaSPITestCommons . mockList ( org . guvnor . ala . runtime . providers . ProviderType . class , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . ELEMENTS_COUNT ) ; org . guvnor . ala . services . api . itemlist . ProviderTypeList list = new org . guvnor . ala . services . api . itemlist . ProviderTypeList ( values ) ; when ( runtimeProvisioningService . getProviderTypes ( org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . PAGE , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . PAGE_SIZE , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . SORT , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . SORT_ORDER ) ) . thenReturn ( list ) ; java . util . List < org . guvnor . ala . runtime . providers . ProviderType > result = runtimeProvisioningServiceBackend . getProviderTypes ( org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . PAGE , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . PAGE_SIZE , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . SORT , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . SORT_ORDER ) ; verify ( runtimeProvisioningService , times ( 1 ) ) . getProviderTypes ( org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . PAGE , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . PAGE_SIZE , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . SORT , org . guvnor . ala . services . backend . impl . RuntimeProvisioningServiceBackendImplTest . SORT_ORDER ) ; "<AssertPlaceHolder>" ; } getProviderTypes ( java . lang . Integer , java . lang . Integer , java . lang . String , boolean ) { return runtimeProvisioningService . getProviderTypes ( page , pageSize , sort , sortOrder ) . getItems ( ) ; }
org . junit . Assert . assertEquals ( values , result )
testInsertAndRetrieve ( ) { org . hivedb . hibernate . HiveSessionFactoryBuilderImpl factoryBuilder = getHiveSessionFactoryBuilder ( ) ; final org . hivedb . util . database . test . WeatherReport report = newInstance ( ) ; save ( factoryBuilder , report ) ; org . hivedb . util . database . test . WeatherReport fetched = ( ( org . hivedb . util . database . test . WeatherReport ) ( factoryBuilder . openSession ( ) . get ( getGeneratedClass ( org . hivedb . util . database . test . WeatherReport . class ) , report . getReportId ( ) ) ) ) ; "<AssertPlaceHolder>" ; } getReportId ( ) { return reportId ; }
org . junit . Assert . assertEquals ( report , fetched )
shouldReturnCountForGivenSearchQueryWithGivenIndexUsingSearchQuery ( ) { java . lang . String documentId = java . lang . String . valueOf ( java . util . concurrent . ThreadLocalRandom . current ( ) . nextLong ( ) ) . substring ( 1 , 6 ) ; com . github . vanroy . springdata . jest . SampleEntity sampleEntity = com . github . vanroy . springdata . jest . SampleEntity . builder ( ) . id ( documentId ) . message ( "some<sp>message" ) . version ( java . lang . System . currentTimeMillis ( ) ) . build ( ) ; com . github . vanroy . springdata . jest . IndexQuery indexQuery = getIndexQuery ( sampleEntity ) ; elasticsearchTemplate . index ( indexQuery ) ; elasticsearchTemplate . refresh ( com . github . vanroy . springdata . jest . SampleEntity . class ) ; com . github . vanroy . springdata . jest . SearchQuery searchQuery = new com . github . vanroy . springdata . jest . NativeSearchQueryBuilder ( ) . withQuery ( matchAllQuery ( ) ) . withIndices ( "test-index" ) . build ( ) ; long count = elasticsearchTemplate . count ( searchQuery ) ; "<AssertPlaceHolder>" ; } count ( com . github . vanroy . springdata . jest . SearchQuery ) { return count ( query , null ) ; }
org . junit . Assert . assertThat ( count , is ( equalTo ( 1L ) ) )
testEmail ( ) { i5 . las2peer . security . UserAgentImpl a = i5 . las2peer . security . UserAgentImpl . createUserAgent ( "test" ) ; a . unlock ( "test" ) ; a . setEmail ( "test@bla" ) ; java . lang . String xml = a . toXmlString ( ) ; i5 . las2peer . security . UserAgentImpl andBack = i5 . las2peer . security . UserAgentImpl . createFromXml ( xml ) ; "<AssertPlaceHolder>" ; } getEmail ( ) { return sEmail ; }
org . junit . Assert . assertEquals ( "test@bla" , andBack . getEmail ( ) )
testSendCommandWithStringParams ( ) { java . lang . String commandString = "command" ; java . lang . String paramString = "param" ; org . bff . javampd . command . MPDCommand command = new org . bff . javampd . command . MPDCommand ( commandString , paramString ) ; commandExecutor = new org . bff . javampd . command . MPDCommandExecutorTest . TestMPDCommandExecutor ( ) ; commandExecutor . setMpd ( mpd ) ; java . util . List < java . lang . String > testResponse = new java . util . ArrayList ( ) ; testResponse . add ( "testResponse" ) ; when ( mpdSocket . sendCommand ( command ) ) . thenReturn ( testResponse ) ; java . util . List < java . lang . String > response = commandExecutor . sendCommand ( commandString , paramString ) ; "<AssertPlaceHolder>" ; } sendCommand ( java . lang . String , java . lang . Integer [ ] ) { java . lang . String [ ] intParms = new java . lang . String [ params . length ] ; for ( int i = 0 ; i < ( params . length ) ; ++ i ) { intParms [ i ] = java . lang . Integer . toString ( params [ i ] ) ; } return new java . util . ArrayList ( sendCommand ( new org . bff . javampd . command . MPDCommand ( command , intParms ) ) ) ; }
org . junit . Assert . assertEquals ( response . get ( 0 ) , testResponse . get ( 0 ) )
testStripJarSuffix_file ( ) { java . net . URI uri = net . sourceforge . jwbf . JWBF . toUri ( "file:/any/target/jwbf-3.0.0-snapshot.jar" ) ; java . lang . String actual = net . sourceforge . jwbf . JWBF . stripJarSuffix ( uri ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( java . util . Objects . toString ( name ) ) + "<sp>" ) + ( directory ) ; }
org . junit . Assert . assertEquals ( "file:/any/target/jwbf-3.0.0-snapshot.jar" , actual )
testSimpleGet ( ) { java . lang . String rootDir = new java . io . File ( java . lang . System . getProperty ( "test.build.data" , "/tmp" ) ) . getAbsolutePath ( ) ; java . io . File testFile = null ; java . lang . String expectedProcessId = ( org . apache . hadoop . util . Shell . WINDOWS ) ? "container_1353742680940_0002_01_000001" : "56789" ; try { testFile = new java . io . File ( rootDir , "temp.txt" ) ; java . io . PrintWriter fileWriter = new java . io . PrintWriter ( testFile ) ; fileWriter . println ( expectedProcessId ) ; fileWriter . close ( ) ; java . lang . String processId = null ; processId = org . apache . hadoop . yarn . server . nodemanager . util . ProcessIdFileReader . getProcessId ( new org . apache . hadoop . fs . Path ( ( ( rootDir + ( org . apache . hadoop . fs . Path . SEPARATOR ) ) + "temp.txt" ) ) ) ; "<AssertPlaceHolder>" ; } finally { if ( ( testFile != null ) && ( testFile . exists ( ) ) ) { testFile . delete ( ) ; } } } getProcessId ( org . apache . hadoop . fs . Path ) { if ( path == null ) { throw new java . io . IOException ( "Trying<sp>to<sp>access<sp>process<sp>id<sp>from<sp>a<sp>null<sp>path" ) ; } org . apache . hadoop . yarn . server . nodemanager . util . ProcessIdFileReader . LOG . debug ( "Accessing<sp>pid<sp>from<sp>pid<sp>file<sp>{}" , path ) ; java . lang . String processId = null ; java . io . BufferedReader bufReader = null ; try { java . io . File file = new java . io . File ( path . toString ( ) ) ; if ( file . exists ( ) ) { java . io . FileInputStream fis = new java . io . FileInputStream ( file ) ; bufReader = new java . io . BufferedReader ( new java . io . InputStreamReader ( fis , "UTF-8" ) ) ; while ( true ) { java . lang . String line = bufReader . readLine ( ) ; if ( line == null ) { break ; } java . lang . String temp = line . trim ( ) ; if ( ! ( temp . isEmpty ( ) ) ) { if ( org . apache . hadoop . util . Shell . WINDOWS ) { try { org . apache . hadoop . yarn . api . records . ContainerId . fromString ( temp ) ; processId = temp ; break ; } catch ( java . lang . Exception e ) { } } else { try { long pid = java . lang . Long . parseLong ( temp ) ; if ( pid > 0 ) { processId = temp ; break ; } } catch ( java . lang . Exception e ) { } } } } } } finally { if ( bufReader != null ) { bufReader . close ( ) ; } } org . apache . hadoop . yarn . server . nodemanager . util . ProcessIdFileReader . LOG . debug ( "Got<sp>pid<sp>{}<sp>from<sp>path<sp>{}" , ( processId != null ? processId : "null" ) , path ) ; return processId ; }
org . junit . Assert . assertEquals ( expectedProcessId , processId )
isOCSPSigningConfigurationAvailableWhenPasswordIsAvailable ( ) { this . configuration . setOCSPAccessCertificatePassword ( "aaa" . toCharArray ( ) ) ; "<AssertPlaceHolder>" ; } isOCSPSigningConfigurationAvailable ( ) { boolean available = ( org . apache . commons . lang3 . StringUtils . isNotBlank ( this . getOCSPAccessCertificateFileName ( ) ) ) && ( ( this . getOCSPAccessCertificatePassword ( ) . length ) != 0 ) ; org . digidoc4j . Configuration . LOGGER . debug ( "Is<sp>OCSP<sp>signing<sp>configuration<sp>available?<sp>{}" , available ) ; return available ; }
org . junit . Assert . assertFalse ( this . configuration . isOCSPSigningConfigurationAvailable ( ) )
testUndefinedObjectProperty ( ) { com . eclipsesource . v8 . V8Object result = v8 . getObject ( "object" ) ; "<AssertPlaceHolder>" ; } isUndefined ( ) { return v8Object . executeBooleanFunction ( com . eclipsesource . v8 . debug . mirror . Mirror . IS_UNDEFINED , null ) ; }
org . junit . Assert . assertTrue ( result . isUndefined ( ) )
testLocationStaticResourceLocationHasPrecedence ( ) { java . lang . String expected = "some_location" ; java . lang . String wrong = "fail" ; configure ( staticResourceLocation , expected ) ; configure ( resourceMappingLocation , wrong ) ; java . lang . String location = org . richfaces . resource . ResourceMappingConfiguration . getLocation ( ) ; "<AssertPlaceHolder>" ; } getLocation ( ) { if ( ( org . richfaces . resource . ResourceMappingConfiguration . getStaticResourceLocation ( ) ) != null ) { return org . richfaces . resource . ResourceMappingConfiguration . getStaticResourceLocation ( ) ; } return org . richfaces . resource . ResourceMappingConfiguration . getConfiguration ( CoreConfiguration . Items . resourceMappingLocation ) ; }
org . junit . Assert . assertEquals ( expected , location )
conversionToDataType ( ) { final org . drools . workbench . models . guided . dtable . shared . model . DTCellValue52 dcv = new org . drools . workbench . models . guided . dtable . shared . model . DTCellValue52 ( value ) ; dcv . setOtherwise ( isOtherwise ) ; cellUtilities . convertDTCellValueType ( DataType . DataTypes . NUMERIC_BIGDECIMAL , dcv ) ; "<AssertPlaceHolder>" ; } getNumericValue ( ) { try { if ( ( realCellValue . getNumericValue ( ) ) != null ) { return new org . drools . verifier . core . index . keys . Values ( ( ( java . lang . Comparable ) ( realCellValue . getNumericValue ( ) ) ) ) ; } else { return new org . drools . verifier . core . index . keys . Values ( ) ; } } catch ( final java . lang . Exception e ) { throw new org . drools . workbench . services . verifier . plugin . client . builders . ValueResolveException ( "Failed<sp>to<sp>resolve<sp>Numeric<sp>Value" ) ; } }
org . junit . Assert . assertEquals ( expected , dcv . getNumericValue ( ) )
testWelOverlapTweeActies ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtIdentificeerbaar > overtreders = brby0024 . voerRegelUit ( maakBericht ( 2001 , 2005 , 2003 , 2009 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , overtreders . size ( ) )
testHttpRelative1 ( ) { java . lang . String baseUri = "http://schemas.opengis.net/gml/3.2.1/gml.xsd" ; java . lang . String location = "feature.xsd" ; java . lang . String expected = "http://schemas.opengis.net/gml/3.2.1/feature.xsd" ; eu . esdihumboldt . hale . io . xsd . reader . internal . HumboldtURIResolver resolver = new eu . esdihumboldt . hale . io . xsd . reader . internal . HumboldtURIResolver ( ) ; org . xml . sax . InputSource source = resolver . resolveEntity ( "ns" , location , baseUri ) ; "<AssertPlaceHolder>" ; } getSystemId ( ) { return systemId ; }
org . junit . Assert . assertEquals ( expected , source . getSystemId ( ) )
shouldAwaitMergeToBeFullyAbortedBeforeLeavingCloseMethod ( ) { org . neo4j . kernel . impl . index . schema . BlockBasedIndexPopulatorTest . TrappingMonitor monitor = new org . neo4j . kernel . impl . index . schema . BlockBasedIndexPopulatorTest . TrappingMonitor ( false ) ; org . neo4j . kernel . impl . index . schema . BlockBasedIndexPopulator < org . neo4j . kernel . impl . index . schema . GenericKey , org . neo4j . kernel . impl . index . schema . NativeIndexValue > populator = instantiatePopulator ( monitor , new org . neo4j . memory . LocalMemoryTracker ( ) ) ; boolean closed = false ; try { populator . add ( org . neo4j . kernel . impl . index . schema . BlockBasedIndexPopulatorTest . batchOfUpdates ( ) ) ; java . util . concurrent . Future < java . lang . Object > mergeFuture = t2 . execute ( command ( ( ) -> populator . scanCompleted ( org . neo4j . kernel . impl . index . schema . nullInstance ) ) ) ; monitor . barrier . awaitUninterruptibly ( ) ; java . util . concurrent . Future < java . lang . Object > closeFuture = t3 . execute ( command ( ( ) -> populator . close ( false ) ) ) ; t3 . get ( ) . waitUntilWaiting ( ) ; monitor . barrier . release ( ) ; closeFuture . get ( ) ; closed = true ; "<AssertPlaceHolder>" ; } finally { if ( ! closed ) { populator . close ( true ) ; } } } isDone ( ) { return realFuture . isDone ( ) ; }
org . junit . Assert . assertTrue ( mergeFuture . isDone ( ) )
testCreate ( ) { org . oscarehr . common . model . Facility f = new org . oscarehr . common . model . Facility ( ) ; f . setDescription ( "test" ) ; f . setDisabled ( false ) ; f . setName ( "test" ) ; f . setOcanServiceOrgNumber ( "0" ) ; f . setOrgId ( 0 ) ; f . setSectorId ( 0 ) ; facilityDao . persist ( f ) ; org . oscarehr . common . model . Demographic d = new org . oscarehr . common . model . Demographic ( ) ; d . setFirstName ( "a" ) ; d . setLastName ( "b" ) ; d . setMiddleNames ( "doctor" 0 ) ; d . setYearOfBirth ( "2000" ) ; d . setMonthOfBirth ( "doctor" 1 ) ; d . setDateOfBirth ( "doctor" 1 ) ; d . setSex ( "M" ) ; demographicDao . save ( d ) ; org . oscarehr . common . model . Provider p = new org . oscarehr . common . model . Provider ( ) ; p . setLastName ( "x" ) ; p . setFirstName ( "y" ) ; p . setProviderNo ( "111111" ) ; p . setProviderType ( "doctor" ) ; p . setSex ( "M" ) ; p . setDob ( new java . util . Date ( ) ) ; p . setSpecialty ( "doctor" 2 ) ; providerDao . saveProvider ( p ) ; org . oscarehr . common . model . IntegratorConsent entity = new org . oscarehr . common . model . IntegratorConsent ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . setClientConsentStatus ( ConsentStatus . GIVEN ) ; entity . setSignatureStatus ( SignatureStatus . ELECTRONIC ) ; entity . setDemographicId ( d . getDemographicNo ( ) ) ; entity . setDigitalSignatureId ( null ) ; entity . setFacilityId ( f . getId ( ) ) ; entity . setProviderNo ( p . getProviderNo ( ) ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
org . junit . Assert . assertNotNull ( entity . getId ( ) )
setVirtualMachineDetailsWithPrivateIP ( ) { try { final com . microsoft . azure . vmagent . AzureVMDeploymentInfo deploymentInfo = createDefaultDeployment ( 1 , false , null ) ; final java . lang . String nodeName = ( deploymentInfo . getVmBaseName ( ) ) + "0" ; final java . lang . String ip = azureClient . virtualMachines ( ) . getByResourceGroup ( testEnv . azureResourceGroup , nodeName ) . getPrimaryNetworkInterface ( ) . primaryPrivateIP ( ) ; setVirtualMachineDetailsCommonVerification ( nodeName , ip , ip , "" ) ; } catch ( java . lang . Exception e ) { com . microsoft . azure . vmagent . test . ITAzureVMManagementServiceDelegate . LOGGER . log ( Level . SEVERE , null , e ) ; "<AssertPlaceHolder>" ; } } setVirtualMachineDetailsCommonVerification ( java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { com . microsoft . azure . vmagent . AzureVMAgent agentMock = mock ( com . microsoft . azure . vmagent . AzureVMAgent . class ) ; com . microsoft . azure . vmagent . AzureVMAgentTemplate templateMock = mock ( com . microsoft . azure . vmagent . AzureVMAgentTemplate . class ) ; com . microsoft . azure . vmagent . AzureVMCloud cloudMock = mock ( com . microsoft . azure . vmagent . AzureVMCloud . class ) ; when ( templateMock . getAzureCloud ( ) ) . thenReturn ( cloudMock ) ; when ( templateMock . getResourceGroupName ( ) ) . thenReturn ( testEnv . azureResourceGroup ) ; when ( agentMock . getNodeName ( ) ) . thenReturn ( vmName ) ; delegate . setVirtualMachineDetails ( agentMock , templateMock ) ; verify ( agentMock ) . setPublicDNSName ( fqdn ) ; verify ( agentMock ) . setSshPort ( Constants . DEFAULT_SSH_PORT ) ; verify ( agentMock ) . setPublicIP ( publicIp ) ; verify ( agentMock ) . setPrivateIP ( privateIP ) ; }
org . junit . Assert . assertTrue ( e . getMessage ( ) , false )
test ( ) { org . openl . types . IOpenMethod method = engineFactory . getCompiledOpenClass ( ) . getOpenClass ( ) . getMethod ( "SHTable" , new org . openl . types . IOpenClass [ ] { org . openl . types . java . JavaOpenClass . STRING } ) ; "<AssertPlaceHolder>" ; java . lang . Object target = engineFactory . newEngineInstance ( ) ; org . openl . vm . IRuntimeEnv env = new org . openl . rules . vm . SimpleRulesVM ( ) . getRuntimeEnv ( ) ; method . invoke ( target , new java . lang . Object [ ] { "ONE2" } , env ) ; } getMethod ( java . lang . String , org . openl . types . impl . IOpenClass [ ] ) { return baseClass . getMethod ( mname , classes ) ; }
org . junit . Assert . assertNotNull ( method )
testFindUserLabelNameByProjectNoReadWithProjectIdNull ( ) { cardLabelRepository . addLabel ( project . getId ( ) , false , CardLabel . LabelType . STRING , LabelDomain . USER , "label1" , 0 ) ; io . lavagna . service . UserWithPermission noRead = new io . lavagna . service . UserWithPermission ( user , io . lavagna . service . EnumSet . noneOf ( io . lavagna . service . Permission . class ) , io . lavagna . service . Collections . < java . lang . String , io . lavagna . service . Set < io . lavagna . service . Permission > > emptyMap ( ) , io . lavagna . service . Collections . < java . lang . Integer , io . lavagna . service . Set < io . lavagna . service . Permission > > emptyMap ( ) ) ; "<AssertPlaceHolder>" ; } findUserLabelNameBy ( java . lang . String , java . lang . Integer , io . lavagna . service . UserWithPermission ) { io . lavagna . service . Set < java . lang . Integer > projectIdFilter = userWithPermission . toProjectIdsFilter ( projectId ) ; return projectIdFilter . isEmpty ( ) ? queries . findUserLabelNameBy ( term ) : queries . findUserLabelNameBy ( term , projectIdFilter ) ; }
org . junit . Assert . assertEquals ( 1 , cardLabelRepository . findUserLabelNameBy ( "label1" , null , noRead ) . size ( ) )
testDiscoveryFinishedWithErrorEvent ( ) { discoverListener . discoveryFinished ( com . digi . xbee . api . IDiscoveryListenerTest . ERROR ) ; "<AssertPlaceHolder>" ; } getError ( ) { return error ; }
org . junit . Assert . assertEquals ( com . digi . xbee . api . IDiscoveryListenerTest . ERROR , discoverListener . getError ( ) )
test04SaveOneObject ( ) { "<AssertPlaceHolder>" ; service . commitInNewTransaction ( ) ; } countByQuery ( ) { com . orientechnologies . orient . object . db . OObjectDatabaseTx db = dbf . db ( ) ; com . orientechnologies . orient . core . sql . query . OSQLSynchQuery < com . orientechnologies . orient . core . record . impl . ODocument > q = new com . orientechnologies . orient . core . sql . query . OSQLSynchQuery < com . orientechnologies . orient . core . record . impl . ODocument > ( "select<sp>count(*)<sp>from<sp>Person" ) ; java . util . List < com . orientechnologies . orient . core . record . impl . ODocument > results = db . query ( q ) ; assert ( results . size ( ) ) == 1 ; return results . get ( 0 ) . field ( "count" ) ; }
org . junit . Assert . assertThat ( service . countByQuery ( ) , org . hamcrest . CoreMatchers . is ( 0L ) )
singleItem ( ) { long [ ] data = new long [ ] { 1 , 2 , 3 , 4 } ; long [ ] expectedSorted = new long [ ] { 1 , 2 , 3 , 4 } ; org . apache . bookkeeper . bookie . storage . ldb . ArrayGroupSort sorter = new org . apache . bookkeeper . bookie . storage . ldb . ArrayGroupSort ( 2 , 4 ) ; sorter . sort ( data ) ; "<AssertPlaceHolder>" ; } sort ( long [ ] ) { sort ( array , 0 , array . length ) ; }
org . junit . Assert . assertArrayEquals ( expectedSorted , data )
getNonExistingFunctionImport ( ) { "<AssertPlaceHolder>" ; } getFunctionImport ( java . lang . String ) { org . apache . olingo . commons . api . edm . EdmFunctionImport functionImport = functionImportCache . get ( functionImportName ) ; if ( functionImport == null ) { functionImport = createFunctionImport ( functionImportName ) ; if ( functionImport != null ) { functionImportCache . put ( functionImportName , functionImport ) ; } } return functionImport ; }
org . junit . Assert . assertNull ( container . getFunctionImport ( null ) )
testNN_AtmCorrGetNumInputNode ( ) { int numNodesInput = - 1 ; int numNodesOutput = 1 ; int numInputNode = org . esa . s3tbx . fub . wew . util . NN_YellowSubstance . compute ( in , numNodesInput , out , numNodesOutput , width , mask , 0 , a ) ; "<AssertPlaceHolder>" ; } compute ( float [ ] [ ] , int , float [ ] [ ] , int , int , int [ ] , int , float [ ] ) { final int [ ] rcheck ; final int nodes_input = 18 ; final int nodes_output = 1 ; final int nodes_input_bias = 1 ; final int nodes_input_pca = 1 ; final int nodes_hidden = 40 ; final int nodes_hidden_bias = 1 ; final double nodes_hidden_temperature = 1.0 ; final double t_input = nodes_hidden_temperature / ( ( double ) ( nodes_input ) ) ; final double t_hidden = nodes_hidden_temperature / ( ( double ) ( nodes_hidden ) ) ; final double [ ] vt ; final double [ ] vt1 ; if ( getNumNodesInput <= 0 ) { return nodes_input ; } if ( getNumNodesOutput <= 0 ) { return nodes_output ; } if ( getNumNodesInput != nodes_input ) { return - 1 ; } if ( getNumNodesOutput != nodes_output ) { return - 2 ; } vt = new double [ nodes_input + nodes_input_bias ] ; vt1 = new double [ nodes_hidden + nodes_hidden_bias ] ; rcheck = new int [ width ] ; for ( int x = 0 ; x < width ; x ++ ) { rcheck [ x ] = 0 ; if ( ( a [ x ] ) < 0.0F ) { rcheck [ x ] = 1 ; } a [ x ] = 1.0F ; } for ( int x = 0 ; x < width ; x ++ ) { if ( ( mask [ x ] ) == 0 ) { if ( ( rcheck [ x ] ) != 0 ) { for ( int i = 0 ; ( i < nodes_input ) && ( ( a [ x ] ) > 0.0F ) ; i ++ ) { if ( ( ( in [ i ] [ x ] ) < ( ( float ) ( NN_General . NODES_INPUT_SCALE_LIMITS [ i ] [ 0 ] ) ) ) || ( ( in [ i ] [ x ] ) > ( ( float ) ( NN_General . NODES_INPUT_SCALE_LIMITS [ i ] [ 1 ] ) ) ) ) { a [ x ] -= 3.0F ; } } if ( ( a [ x ] ) < 0.0F ) { mask [ x ] |= errmask ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == ( - 1 ) ) { in [ i ] [ x ] = ( ( float ) ( java . lang . Math . log ( ( ( double ) ( in [ i ] [ x ] ) ) ) ) ) ; } if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == ( - 2 ) ) { in [ i ] [ x ] = ( ( float ) ( java . lang . Math . exp ( ( ( double ) ( in [ i ] [ x ] ) ) ) ) ) ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { in [ i ] [ x ] = ( ( float ) ( NN_General . NODES_INPUT_SCALE_OFF [ i ] ) ) + ( ( ( in [ i ] [ x ] ) - ( ( float ) ( org . esa . s3tbx . fub . wew . util . NN_YellowSubstance . nodes_input_scale_run38 [ i ] [ 0 ] ) ) ) / ( ( float ) ( org . esa . s3tbx . fub . wew . util . NN_YellowSubstance . nodes_input_scale_run38 [ i ] [ 1 ] ) ) ) ; } if ( nodes_input_pca != 0 ) { for ( int i = 0 ; i < nodes_input ; i ++ ) { vt [ i ] = ( ( double ) ( in [ i ] [ x ] ) ) ; if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ i ] ) == 1 ) { vt [ i ] = 0.0 ; for ( int j = 0 ; j < nodes_input ; j ++ ) { if ( ( NN_General . NODES_INPUT_SCALE_FLAG [ j ] ) == 1 ) { vt [ i ] += ( ( double ) ( in [ j ] [ x ] ) ) * ( org . esa . s3tbx . fub . wew . util . NN_YellowSubstance . nodes_input_pca_evec_run38 [ j ] [ i ] ) ; } } } } for ( int i = 0 ; i < nodes_input ; i ++ ) { in [ i ] [ x ] = ( ( float ) ( vt [ i ] ) ) ; } } for ( int i = 0 ; i < nodes_input ; i ++ ) { vt [ i ] = ( ( double ) ( in [ i ] [ x ] ) ) ; } for ( int i = nodes_input ; i < ( nodes_input + nodes_input_bias ) ; i ++ ) { vt [ i ] = 1.0 ; } for ( int i = 0 ; i < nodes_hidden ; i ++ ) { vt1 [ i ] = 0.0 ; for ( int j = 0 ; j < ( nodes_input + nodes_input_bias ) ; j ++ ) { vt1 [ i ] += ( vt [ j ] ) * ( org . esa . s3tbx . fub . wew
org . junit . Assert . assertEquals ( 18 , numInputNode )
testST_Remove3Holes ( ) { com . vividsolutions . jts . geom . Polygon polygon = ( ( com . vividsolutions . jts . geom . Polygon ) ( wKTReader . read ( ( "POLYGON<sp>((<sp>112<sp>68,<sp>112<sp>307,<sp>318<sp>307,<sp>318<sp>68,<sp>112<sp>68<sp>),<sp>" + ( ( "(<sp>184<sp>169,<sp>247<sp>197,<sp>242<sp>247,<sp>167<sp>258,<sp>184<sp>169<sp>),<sp>" + "(<sp>235<sp>107,<sp>277<sp>120,<sp>267<sp>167,<sp>221<sp>161,<sp>235<sp>107<sp>),<sp>" ) + "(<sp>277<sp>280,<sp>266<sp>255,<sp>281<sp>249,<sp>300<sp>270,<sp>277<sp>280<sp>))" ) ) ) ) ) ; com . vividsolutions . jts . geom . Polygon expected = ( ( com . vividsolutions . jts . geom . Polygon ) ( wKTReader . read ( "POLYGON<sp>((<sp>112<sp>68,<sp>112<sp>307,<sp>318<sp>307,<sp>318<sp>68,<sp>112<sp>68<sp>))" ) ) ) ; com . vividsolutions . jts . geom . Geometry result = org . orbisgis . mapeditor . map . geometryUtils . GeometryEdit . removeHole ( polygon ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj instanceof org . orbisgis . sif . common . ContainerItem ) { org . orbisgis . sif . common . ContainerItem other = ( ( org . orbisgis . sif . common . ContainerItem ) ( obj ) ) ; return ! ( ( this . key ) == null ? ( other . key ) != null : ! ( this . key . equals ( other . key ) ) ) ; } else { return false ; } }
org . junit . Assert . assertTrue ( result . equals ( expected ) )
testWriteToStream ( ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; gsflw . writeToStream ( baos ) ; baos . close ( ) ; byte [ ] expected = new byte [ ] { 17 , 2 , 5 , 64 } ; "<AssertPlaceHolder>" ; } close ( ) { try { super . close ( ) ; } finally { file . delete ( ) ; } }
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( expected , baos . toByteArray ( ) ) )
statusCheck ( ) { final org . apache . hc . core5 . testing . framework . ClientTestingAdapter adapter = new org . apache . hc . core5 . testing . framework . ClientTestingAdapter ( ) { @ org . apache . hc . core5 . testing . framework . Override public java . util . Map < java . lang . String , java . lang . Object > execute ( final java . lang . String defaultURI , final java . util . Map < java . lang . String , java . lang . Object > request , final org . apache . hc . core5 . testing . framework . TestingFrameworkRequestHandler requestHandler , final java . util . Map < java . lang . String , java . lang . Object > responseExpectations ) { "<AssertPlaceHolder>" ; final java . util . Map < java . lang . String , java . lang . Object > response = new java . util . HashMap ( ) ; response . put ( org . apache . hc . core5 . testing . framework . ClientPOJOAdapter . STATUS , 201 ) ; return response ; } } ; final org . apache . hc . core5 . testing . framework . TestingFramework framework = newFrameworkAndSetAdapter ( adapter ) ; framework . addTest ( ) ; try { framework . runTests ( ) ; org . junit . Assert . fail ( "WebServerTestingFrameworkException<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( final org . apache . hc . core5 . testing . framework . TestingFrameworkException e ) { } } get ( int ) { int i = ( ( head ) - index ) - 1 ; if ( i < 0 ) { i = ( array . length ) + i ; } return array [ i ] ; }
org . junit . Assert . assertEquals ( 200 , responseExpectations . get ( org . apache . hc . core5 . testing . framework . ClientPOJOAdapter . STATUS ) )
test_success_get_all_policy_lonk_types ( ) { java . util . List < org . ikasan . security . model . PolicyLinkType > plts = this . xaSecurityService . getAllPolicyLinkTypes ( ) ; "<AssertPlaceHolder>" ; } size ( ) { logger . debug ( "Size!<sp>" ) ; return 15000 ; }
org . junit . Assert . assertTrue ( ( ( plts . size ( ) ) == 3 ) )
mergeParentDeclarationsRelativeMeasurementInheritTest ( ) { java . util . Map < java . lang . String , java . lang . String > styles = new java . util . HashMap ( ) ; java . lang . String styleProperty = "font-size" ; java . lang . String parentPropValue = "80%" ; java . lang . String parentFontSize = "16" ; java . util . Map < java . lang . String , java . lang . String > expectedStyles = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; expectedStyles . put ( styleProperty , "9.6pt" ) ; com . itextpdf . svg . css . impl . StyleResolverUtil sru = new com . itextpdf . svg . css . impl . StyleResolverUtil ( ) ; sru . mergeParentStyleDeclaration ( styles , styleProperty , parentPropValue , parentFontSize ) ; boolean equal = ( styles . size ( ) ) == ( expectedStyles . size ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > kvp : expectedStyles . entrySet ( ) ) { equal &= kvp . getValue ( ) . equals ( styles . get ( kvp . getKey ( ) ) ) ; } "<AssertPlaceHolder>" ; } getKey ( ) { return info . getKey ( ) ; }
org . junit . Assert . assertTrue ( equal )
testThree ( ) { org . terrier . matching . MatchingQueryTerms mqt = new org . terrier . matching . MatchingQueryTerms ( ) ; mqt . add ( org . terrier . querying . parser . Query . QTPBuilder . of ( new org . terrier . matching . matchops . SingleTermOp ( "a" ) ) . build ( ) ) ; mqt . add ( org . terrier . querying . parser . Query . QTPBuilder . of ( new org . terrier . matching . matchops . SingleTermOp ( "b" ) ) . build ( ) ) ; mqt . add ( org . terrier . querying . parser . Query . QTPBuilder . of ( new org . terrier . matching . matchops . SingleTermOp ( "c" ) ) . build ( ) ) ; new org . terrier . querying . DependenceModelPreProcess ( ) . process ( mqt , "pBiL" ) ; System . out . println ( mqt . toString ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return location . length ; }
org . junit . Assert . assertEquals ( 8 , mqt . size ( ) )
shouldGetAttributeReturnNullIfTheSolutionHasNoAttribute ( ) { org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttribute < org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttributeTest . MockedDoubleSolution , ? > genericSolutionAttribute ; genericSolutionAttribute = new org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttribute ( ) ; org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttributeTest . MockedDoubleSolution solution = new org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttributeTest . MockedDoubleSolution ( ) ; "<AssertPlaceHolder>" ; } getAttribute ( S extends org . uma . jmetal . solution . Solution ) { return ( ( java . util . List < java . lang . Double > ) ( solution . getAttribute ( getAttributeIdentifier ( ) ) ) ) ; }
org . junit . Assert . assertNull ( genericSolutionAttribute . getAttribute ( solution ) )
testOntologyChangeSymmetry ( ) { org . semanticweb . owlapi . change . AddOntologyAnnotationData data = createData ( ) ; org . semanticweb . owlapi . model . AddOntologyAnnotation change = new org . semanticweb . owlapi . model . AddOntologyAnnotation ( mockOntology , mockAnnotation ) ; "<AssertPlaceHolder>" ; } getChangeData ( ) { return new org . semanticweb . owlapi . change . SetOntologyIDData ( newOntologyID ) ; }
org . junit . Assert . assertEquals ( change . getChangeData ( ) , data )
checkCreation ( ) { info . smart_tools . smartactors . iobject . iobject . IObject env = mock ( info . smart_tools . smartactors . iobject . iobject . IObject . class ) ; info . smart_tools . smartactors . task . interfaces . itask . ITask task = new info . smart_tools . smartactors . message_processing . message_processor . FinalTask ( env ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( task )
loadFileNormalFile ( ) { org . mewx . wenku8 . util . LightCache . saveFile ( org . mewx . wenku8 . util . LightCacheTest . BASE_TEMP_FILE_NAME , new byte [ ] { 'a' , 'b' , 'c' } , false ) ; "<AssertPlaceHolder>" ; } loadFile ( java . lang . String ) { java . io . File file = new java . io . File ( path ) ; if ( ( file . exists ( ) ) && ( file . isFile ( ) ) ) { int fileSize = ( ( int ) ( file . length ( ) ) ) ; try { java . io . FileInputStream in = new java . io . FileInputStream ( file ) ; java . io . DataInputStream dis = new java . io . DataInputStream ( in ) ; byte [ ] bs = new byte [ fileSize ] ; if ( ( dis . read ( bs , 0 , fileSize ) ) == ( - 1 ) ) return null ; dis . close ( ) ; in . close ( ) ; return bs ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } } return null ; }
org . junit . Assert . assertArrayEquals ( new byte [ ] { 'a' , 'b' , 'c' } , org . mewx . wenku8 . util . LightCache . loadFile ( org . mewx . wenku8 . util . LightCacheTest . BASE_TEMP_FILE_NAME ) )
testUpdateContainerConfigWhenContainerConfigIsAProcessConfig ( ) { final org . kie . server . controller . impl . service . SpecManagementServiceImpl specManagementService = spy ( ( ( org . kie . server . controller . impl . service . SpecManagementServiceImpl ) ( this . specManagementService ) ) ) ; final org . kie . server . controller . impl . service . Capability capability = Capability . PROCESS ; final org . kie . server . controller . impl . service . ProcessConfig processConfig = mock ( org . kie . server . controller . impl . service . ProcessConfig . class ) ; final org . kie . server . controller . impl . service . ServerTemplate serverTemplate = mock ( org . kie . server . controller . impl . service . ServerTemplate . class ) ; final org . kie . server . controller . impl . service . ContainerSpec containerSpec = mock ( org . kie . server . controller . impl . service . ContainerSpec . class ) ; final java . util . List < ? > expectedContainers = mock ( java . util . List . class ) ; doReturn ( expectedContainers ) . when ( specManagementService ) . updateContainerProcessConfig ( processConfig , capability , serverTemplate , containerSpec ) ; final java . util . List < org . kie . server . controller . api . model . runtime . Container > actualContainers = specManagementService . updateContainerConfig ( capability , processConfig , serverTemplate , containerSpec ) ; "<AssertPlaceHolder>" ; } updateContainerConfig ( java . lang . String , java . lang . String , org . kie . server . controller . api . model . spec . Capability , org . kie . server . controller . api . model . spec . ContainerConfig ) { makePostRequestAndCreateCustomResponse ( ( ( ( ( ( ( ( controllerBaseUrl ) + ( org . kie . server . controller . client . rest . RestKieServerControllerClient . MANAGEMENT_URI_PART ) ) + serverTemplateId ) + ( org . kie . server . controller . client . rest . RestKieServerControllerClient . CONTAINERS_URI_PART ) ) + containerId ) + ( org . kie . server . controller . client . rest . RestKieServerControllerClient . CONFIG_URI_PART ) ) + ( capability . toString ( ) ) ) , config , java . lang . Object . class ) ; }
org . junit . Assert . assertEquals ( expectedContainers , actualContainers )
testTopNCloseClosesSource ( ) { long numItems = 3 ; boolean distinct = false ; org . apache . jena . sparql . util . Context context = new org . apache . jena . sparql . util . Context ( ) ; org . apache . jena . sparql . engine . ExecutionContext ec = new org . apache . jena . sparql . engine . ExecutionContext ( context , ( ( org . apache . jena . graph . Graph ) ( null ) ) , ( ( org . apache . jena . sparql . core . DatasetGraph ) ( null ) ) , ( ( org . apache . jena . sparql . engine . main . OpExecutorFactory ) ( null ) ) ) ; org . apache . jena . sparql . engine . iterator . QueryIterTopN tn = new org . apache . jena . sparql . engine . iterator . QueryIterTopN ( iterator , comparator , numItems , distinct , ec ) ; tn . close ( ) ; "<AssertPlaceHolder>" ; } isClosed ( ) { return closed ; }
org . junit . Assert . assertTrue ( iterator . isClosed ( ) )
testOffLoadedAndNonOffLoadedPayload ( ) { final org . apache . flink . runtime . deployment . TaskDeploymentDescriptor taskDeploymentDescriptor = createTaskDeploymentDescriptor ( new org . apache . flink . runtime . deployment . TaskDeploymentDescriptor . NonOffloaded < > ( serializedJobInformation ) , new org . apache . flink . runtime . deployment . TaskDeploymentDescriptor . Offloaded < > ( new org . apache . flink . runtime . blob . PermanentBlobKey ( ) ) ) ; org . apache . flink . util . SerializedValue < org . apache . flink . runtime . executiongraph . JobInformation > actualSerializedJobInformation = taskDeploymentDescriptor . getSerializedJobInformation ( ) ; "<AssertPlaceHolder>" ; try { taskDeploymentDescriptor . getSerializedTaskInformation ( ) ; org . junit . Assert . fail ( "Expected<sp>to<sp>fail<sp>since<sp>the<sp>task<sp>information<sp>should<sp>be<sp>offloaded." ) ; } catch ( java . lang . IllegalStateException expected ) { } } getSerializedJobInformation ( ) { if ( ( serializedJobInformation ) instanceof org . apache . flink . runtime . deployment . TaskDeploymentDescriptor . NonOffloaded ) { org . apache . flink . runtime . deployment . TaskDeploymentDescriptor . NonOffloaded < org . apache . flink . runtime . executiongraph . JobInformation > jobInformation = ( ( org . apache . flink . runtime . deployment . TaskDeploymentDescriptor . NonOffloaded < org . apache . flink . runtime . executiongraph . JobInformation > ) ( serializedJobInformation ) ) ; return jobInformation . serializedValue ; } else { throw new java . lang . IllegalStateException ( "Trying<sp>to<sp>work<sp>with<sp>offloaded<sp>serialized<sp>job<sp>information." ) ; } }
org . junit . Assert . assertThat ( actualSerializedJobInformation , org . hamcrest . Matchers . is ( serializedJobInformation ) )
testEvaluate ( ) { org . apache . commons . functor . NullaryFunction < java . lang . Object > f = new org . apache . commons . functor . adapter . BoundNullaryFunction < java . lang . Object > ( org . apache . commons . functor . core . Identity . INSTANCE , "xyzzy" ) ; "<AssertPlaceHolder>" ; } evaluate ( ) { return java . lang . Integer . valueOf ( ( ( count ) ++ ) ) ; }
org . junit . Assert . assertEquals ( "xyzzy" , f . evaluate ( ) )
shouldReturnFalseGivenANonEmptyArray ( ) { boolean isEmpty = org . flips . utils . Utils . isEmpty ( new java . lang . Object [ ] { "sample" } ) ; "<AssertPlaceHolder>" ; } isEmpty ( java . lang . Object [ ] ) { return org . springframework . util . ObjectUtils . isEmpty ( array ) ; }
org . junit . Assert . assertEquals ( false , isEmpty )
testNonAdminCountFirehoseItemsAuthorizeNode ( ) { store . setNodeConfValue ( org . buddycloud . channelserver . db . jdbc . TEST_SERVER1_NODE1_ID , Conf . ACCESS_MODEL , AccessModels . authorize . toString ( ) ) ; int firehoseItemCount = store . getFirehoseItemCount ( false , org . buddycloud . channelserver . db . jdbc . TEST_SERVER1_HOSTNAME ) ; "<AssertPlaceHolder>" ; } getFirehoseItemCount ( boolean , java . lang . String ) { java . sql . PreparedStatement stmt = null ; try { stmt = conn . prepareStatement ( dialect . countItemsForLocalNodes ( ) ) ; stmt . setString ( 1 , Conf . ACCESS_MODEL ) ; stmt . setBoolean ( 2 , isAdmin ) ; stmt . setString ( 3 , AccessModels . open . toString ( ) ) ; stmt . setString ( 4 , AccessModels . local . toString ( ) ) ; stmt . setString ( 5 , org . buddycloud . channelserver . db . jdbc . JDBCNodeStore . getDomainRegex ( actorDomain ) ) ; stmt . setBoolean ( 6 , isAdmin ) ; stmt . setString ( 7 , org . buddycloud . channelserver . db . jdbc . JDBCNodeStore . getLocalDomainRegex ( ) ) ; java . sql . ResultSet rs = stmt . executeQuery ( ) ; if ( ! ( rs . next ( ) ) ) { return 0 ; } return rs . getInt ( 1 ) ; } catch ( java . sql . SQLException e ) { throw new org . buddycloud . channelserver . db . exception . NodeStoreException ( e ) ; } finally { close ( stmt ) ; } }
org . junit . Assert . assertEquals ( 0 , firehoseItemCount )
checkStreamWhenDisabled ( ) { org . linagora . linshare . service . ClamavVirusScannerServiceImplTest . logger . info ( LinShareTestConstants . BEGIN_TEST ) ; boolean hasFailed = false ; try { org . linagora . linshare . core . business . service . VirusScannerBusinessService disabledVirusScannerService = new org . linagora . linshare . core . business . service . impl . ClamavVirusScannerBusinessServiceImpl ( "" , 1234 ) ; disabledVirusScannerService . check ( this . getClass ( ) . getResourceAsStream ( "/linshare-test.properties" ) ) ; } catch ( org . linagora . linshare . core . exception . TechnicalException e ) { if ( TechnicalErrorCode . VIRUS_SCANNER_IS_DISABLED . equals ( e . getErrorCode ( ) ) ) hasFailed = true ; } "<AssertPlaceHolder>" ; org . linagora . linshare . service . ClamavVirusScannerServiceImplTest . logger . debug ( LinShareTestConstants . END_TEST ) ; } getErrorCode ( ) { return errorCode ; }
org . junit . Assert . assertTrue ( hasFailed )
testObfuscateDataLocationCoordinates ( ) { java . lang . String testTitle = new java . lang . String ( ")<sp>" 3 ) ; org . societies . integration . test . ct . datamanagement . PrivacyDataManagerTest . LOG . info ( ( ( ( "[#" + ( testCaseNumber ) ) + ")<sp>" 5 ) + testTitle ) ) ; try { org . societies . api . internal . schema . privacytrust . privacy . model . dataobfuscation . DataWrapper dataWrapper = org . societies . api . internal . privacytrust . privacy . util . dataobfuscation . DataWrapperFactory . getLocationCoordinatesWrapper ( 48.856666 , 2.350987 , 542.0 ) ; TestCase . privacyDataManagerRemote . obfuscateData ( requestor , dataWrapper , new org . societies . api . internal . privacytrust . privacyprotection . model . listener . IDataObfuscationListener ( ) { @ org . societies . integration . test . ct . datamanagement . Override public void onObfuscationDone ( org . societies . api . internal . schema . privacytrust . privacy . model . dataobfuscation . DataWrapper data ) { succeed = true ; obfuscatedDataWrapper = data ; lock . countDown ( ) ; } @ org . societies . integration . test . ct . datamanagement . Override public void onObfuscationCancelled ( java . lang . String msg ) { succeed = false ; errorMsg = msg ; lock . countDown ( ) ; } @ org . societies . integration . test . ct . datamanagement . Override public void onObfuscationAborted ( java . lang . String msg , java . lang . Exception e ) { succeed = false ; errorMsg = msg ; errorException = e ; lock . countDown ( ) ; } } ) ; boolean releaseBeforeTimeout = lock . await ( org . societies . integration . test . ct . datamanagement . TestCase . getTimeout ( ) , TimeUnit . MILLISECONDS ) ; if ( ! releaseBeforeTimeout ) { succeed = false ; errorMsg = "Obfuscation<sp>aborted<sp>due<sp>to<sp>timeout" ; errorException = new java . util . concurrent . TimeoutException ( ( ( "Obfuscation<sp>aborted<sp>due<sp>to<sp>timeout:<sp>more<sp>then<sp>" + ( org . societies . integration . test . ct . datamanagement . TestCase . getTimeout ( ) ) ) + ")<sp>" 2 ) ) ; } if ( ! ( succeed ) ) { org . societies . integration . test . ct . datamanagement . PrivacyDataManagerTest . LOG . error ( ( ( ( "[#" + ( testCaseNumber ) ) + "]<sp>Error:<sp>" ) + ( errorMsg ) ) , errorException ) ; org . junit . Assert . fail ( ( "Error:<sp>" + ( errorMsg ) ) ) ; } "<AssertPlaceHolder>" ; org . societies . api . internal . schema . privacytrust . privacy . model . dataobfuscation . LocationCoordinates originalData = org . societies . api . internal . privacytrust . privacy . util . dataobfuscation . DataWrapperFactory . retrieveLocationCoordinates ( dataWrapper ) ; org . societies . api . internal . schema . privacytrust . privacy . model . dataobfuscation . LocationCoordinates obfuscatedData = org . societies . api . internal . privacytrust . privacy . util . dataobfuscation . DataWrapperFactory . retrieveLocationCoordinates ( obfuscatedDataWrapper ) ; org . societies . integration . test . ct . datamanagement . PrivacyDataManagerTest . LOG . info ( ( ( ( "[#" + ( testCaseNumber ) ) + "]<sp>Orginal<sp>name:<sp>" ) + ( org . societies . api . internal . privacytrust . privacy . util . dataobfuscation . LocationCoordinatesUtils . toJsonString ( originalData ) ) ) ) ; org . societies . integration . test . ct . datamanagement . PrivacyDataManagerTest . LOG . info ( ( ( ( "[#" + ( testCaseNumber ) ) + ")<sp>" 1 ) + ( org . societies . api . internal . privacytrust . privacy . util . dataobfuscation . LocationCoordinatesUtils . toJsonString ( obfuscatedData ) ) ) ) ; } catch ( org . societies . api . privacytrust . privacy . model . PrivacyException e ) { org . societies . integration . test . ct . datamanagement . PrivacyDataManagerTest . LOG . error ( ( ( ( "[#" + ( testCaseNumber ) ) + "]<sp>[PrivacyException<sp>obfuscator<sp>error]<sp>" ) + testTitle ) , e ) ; org . junit . Assert . fail ( ( ( ( ")<sp>" 4 + ( e . getMessage ( ) ) ) + ")<sp>" ) + testTitle ) ) ; } catch ( java . lang . InterruptedException e ) { org . societies . integration . test . ct . datamanagement . PrivacyDataManagerTest . LOG . error ( ( ( ( "[#" + ( testCaseNumber ) ) + "]<sp>[InterruptedException<sp>obfuscator<sp>error]<sp>" ) + testTitle ) , e ) ; org . junit . Assert . fail ( ( ( ( "InterruptedException<sp>obfuscator<sp>error<sp>(" + ( e . getMessage ( ) ) ) + ")<sp>" ) + testTitle ) ) ; } } fail ( java . lang . String ) { this . performanceTestResult = new org . societies . integration . performance . test . lower_tester . PerformanceTestResult ( this . getClass ( ) . getName ( ) , errorMesg , org . societies . integration . performance . test . lower_tester . PerformanceTestResult . ERROR_STATUS ) ; this . performanceLowerTester . testFinish ( this . performanceTestResult ) ; }
org . junit . Assert . assertNotNull ( ")<sp>" 0 , obfuscatedDataWrapper )
testDoLoadTwiceForSameApplication ( ) { ensureFiles ( new java . lang . String [ ] { org . eclipse . rap . rwt . internal . resources . JavaScriptModuleLoaderImpl_Test . JS_FILE_1 } ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . executeLifeCycleFromServerThread ( ) ; newSession ( ) ; ensureFiles ( new java . lang . String [ ] { org . eclipse . rap . rwt . internal . resources . JavaScriptModuleLoaderImpl_Test . JS_FILE_1 } ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . executeLifeCycleFromServerThread ( ) ; org . eclipse . rap . rwt . testfixture . internal . TestMessage message = org . eclipse . rap . rwt . testfixture . internal . Fixture . getProtocolMessage ( ) ; java . lang . String expected = ( ( "rwt-resources/" + ( getRegistryPath ( ) ) ) + "/" ) + ( org . eclipse . rap . rwt . internal . resources . JavaScriptModuleLoaderImpl_Test . JS_FILE_1 ) ; "<AssertPlaceHolder>" ; } findLoadOperation ( org . eclipse . rap . rwt . testfixture . internal . TestMessage , java . lang . String ) { org . eclipse . rap . rwt . internal . protocol . Operation . CallOperation [ ] operations = findLoadOperations ( message , file ) ; return ( operations . length ) == 0 ? null : operations [ 0 ] ; }
org . junit . Assert . assertNotNull ( findLoadOperation ( message , expected ) )
testGetKotsuCount ( ) { "<AssertPlaceHolder>" ; } getKantsuCount ( ) { return kantsuList . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , actual . getKantsuCount ( ) )
testNoConflictIfSameDiff ( ) { com . vividsolutions . jts . geom . Geometry oldGeom = new com . vividsolutions . jts . io . WKTReader ( ) . read ( "MULTILINESTRING<sp>((40<sp>40,<sp>20<sp>45,<sp>45<sp>30,<sp>40<sp>40),(20<sp>35,<sp>45<sp>10,<sp>30<sp>5,<sp>10<sp>30,<sp>20<sp>35))" ) ; com . vividsolutions . jts . geom . Geometry newGeom = new com . vividsolutions . jts . io . WKTReader ( ) . read ( "MULTILINESTRING<sp>((40<sp>40,<sp>20<sp>45,<sp>45<sp>35,<sp>30<sp>30),(20<sp>35,<sp>45<sp>10,<sp>30<sp>5,<sp>10<sp>30,<sp>20<sp>35))" ) ; org . locationtech . geogig . api . plumbing . diff . GeometryAttributeDiff diff = new org . locationtech . geogig . api . plumbing . diff . GeometryAttributeDiff ( com . google . common . base . Optional . of ( oldGeom ) , com . google . common . base . Optional . of ( newGeom ) ) ; org . locationtech . geogig . api . plumbing . diff . GeometryAttributeDiff diff2 = new org . locationtech . geogig . api . plumbing . diff . GeometryAttributeDiff ( com . google . common . base . Optional . of ( oldGeom ) , com . google . common . base . Optional . of ( newGeom ) ) ; "<AssertPlaceHolder>" ; } conflicts ( org . locationtech . geogig . api . plumbing . diff . AttributeDiff ) { if ( ! ( ad instanceof org . locationtech . geogig . api . plumbing . diff . GeometryAttributeDiff ) ) { return true ; } org . locationtech . geogig . api . plumbing . diff . GeometryAttributeDiff gad = ( ( org . locationtech . geogig . api . plumbing . diff . GeometryAttributeDiff ) ( ad ) ) ; if ( ( TYPE . REMOVED . equals ( ad . getType ( ) ) ) && ( TYPE . REMOVED . equals ( getType ( ) ) ) ) { return false ; } if ( ( TYPE . MODIFIED . equals ( ad . getType ( ) ) ) && ( TYPE . MODIFIED . equals ( getType ( ) ) ) ) { if ( gad . diff . equals ( diff ) ) { return false ; } else { return ! ( gad . canBeAppliedOn ( newGeometry ) ) ; } } if ( ( TYPE . ADDED . equals ( ad . getType ( ) ) ) && ( TYPE . ADDED . equals ( getType ( ) ) ) ) { return ! ( gad . newGeometry . equals ( newGeometry ) ) ; } return true ; }
org . junit . Assert . assertFalse ( diff . conflicts ( diff2 ) )
TestPlugin ( ) { org . bukkit . conversations . Conversable conversable = new org . bukkit . conversations . FakeConversable ( ) ; org . bukkit . conversations . ConversationContext context = new org . bukkit . conversations . ConversationContext ( null , conversable , new java . util . HashMap < java . lang . Object , java . lang . Object > ( ) ) ; "<AssertPlaceHolder>" ; } getPlugin ( ) { return plugin ; }
org . junit . Assert . assertEquals ( null , context . getPlugin ( ) )
shouldStoreDifferenceOfIncomingTransferSslToNewMergedRecord ( ) { previousRecord . setIncomingTransferSsl ( 1000 ) ; currentRecord . setIncomingTransferSsl ( 1200 ) ; usagePollerHelper . calculateUsage ( currentRecord , previousRecord , newMergedRecord ) ; "<AssertPlaceHolder>" ; } getIncomingTransferSsl ( ) { return incomingTransferSsl ; }
org . junit . Assert . assertEquals ( 200 , newMergedRecord . getIncomingTransferSsl ( ) )
testGetKeyType ( ) { org . pentaho . hbase . shim . api . Mapping mapping = getMapping ( ) ; mapping . m_keyType = Mapping . KeyType . INTEGER ; "<AssertPlaceHolder>" ; } getKeyType ( ) { return m_keyType ; }
org . junit . Assert . assertEquals ( Mapping . KeyType . INTEGER , mapping . getKeyType ( ) )
ReceiverMessageFromLinkWrongName ( ) { com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpDeviceOperations amqpDeviceOperation = new com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpDeviceOperations ( ) ; mockit . Deencapsulation . setField ( amqpDeviceOperation , "receiverLink" , mockedReceiverLink ) ; new mockit . NonStrictExpectations ( ) { { mockedReceiverLink . current ( ) ; result = mockedDelivery ; mockedDelivery . isReadable ( ) ; result = true ; mockedDelivery . pending ( ) ; result = 10 ; mockedReceiverLink . recv ( ( ( byte [ ] ) ( any ) ) , 0 , anyInt ) ; mockedReceiverLink . advance ( ) ; mockedAmqpMessage . decode ( ( ( byte [ ] ) ( any ) ) , 0 , anyInt ) ; } } ; com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpMessage result = amqpDeviceOperation . receiverMessageFromLink ( "WRONG_LINK_NAME" ) ; "<AssertPlaceHolder>" ; } receiverMessageFromLink ( java . lang . String ) { com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpMessage result ; if ( ( linkName == null ) || ( linkName . isEmpty ( ) ) ) { result = null ; } else if ( ( this . receiverLink ) == null ) { result = null ; } else { com . microsoft . azure . sdk . iot . deps . transport . amqp . Delivery delivery = this . receiverLink . current ( ) ; if ( ( ( ( linkName . equals ( this . receiverLinkTag ) ) && ( delivery != null ) ) && ( delivery . isReadable ( ) ) ) && ( ! ( delivery . isPartial ( ) ) ) ) { int size = delivery . pending ( ) ; byte [ ] buffer = new byte [ size ] ; int read = this . receiverLink . recv ( buffer , 0 , buffer . length ) ; this . receiverLink . advance ( ) ; result = new com . microsoft . azure . sdk . iot . deps . transport . amqp . AmqpMessage ( ) ; result . decode ( buffer , 0 , read ) ; } else { result = null ; } } return result ; }
org . junit . Assert . assertNull ( result )
testEquals ( ) { org . gbif . api . model . checklistbank . Reference r1 = new org . gbif . api . model . checklistbank . Reference ( ) ; r1 . setLink ( "http://www.example.org" ) ; r1 . setCitation ( "Please<sp>cite<sp>www.example.org" ) ; org . gbif . api . model . checklistbank . Reference r2 = new org . gbif . api . model . checklistbank . Reference ( ) ; r2 . setLink ( "http://www.example.org" ) ; r2 . setCitation ( "Please<sp>cite<sp>www.example.org" ) ; "<AssertPlaceHolder>" ; } setCitation ( java . lang . String ) { this . citation = citation ; }
org . junit . Assert . assertEquals ( r1 , r2 )
testGet ( ) { int slot = getRandomSlot ( ) ; org . spout . api . inventory . ItemStack item = getRandomItem ( ) ; inventory . set ( slot , item ) ; "<AssertPlaceHolder>" ; } get ( int ) { return getContents ( ) [ i ] ; }
org . junit . Assert . assertEquals ( item , inventory . get ( slot ) )
deleteGetAffectedRows ( ) { getJdbcUtils ( ) . scopes ( ) . autoCommit ( getTestDataSource ( ) , new org . spincast . plugins . jdbc . JdbcQueries < java . lang . Void > ( ) { @ org . spincast . plugins . jdbc . tests . Override public org . spincast . plugins . jdbc . tests . Void run ( java . sql . Connection connection ) { org . spincast . plugins . jdbc . statements . InsertStatement stm = getJdbcUtils ( ) . statements ( ) . createInsertStatement ( connection ) ; stm . sql ( ( "INSERT<sp>INTO<sp>test(name,<sp>birthdate)<sp>" + "VALUES('Stromgol',<sp>:birthdate)" ) ) ; java . time . Instant now = java . time . Instant . now ( ) ; stm . setInstant ( "birthdate" , now ) ; stm . insert ( ) ; stm . sql ( ( "INSERT<sp>INTO<sp>test(name,<sp>birthdate)<sp>" + "VALUES('Stromgol',<sp>:birthdate)" ) ) ; stm . setInstant ( "birthdate" , now ) ; stm . insert ( ) ; org . spincast . plugins . jdbc . statements . DeleteStatement stmDel = getJdbcUtils ( ) . statements ( ) . createDeleteStatement ( connection ) ; stmDel . sql ( ( "DELETE<sp>" + ( "FROM<sp>test<sp>" + "WHERE<sp>name<sp>=<sp>:name" ) ) ) ; stmDel . setString ( "name" , "Stromgol" ) ; int affectedRowsNbr = stmDel . delete ( ) ; "<AssertPlaceHolder>" ; return null ; } } ) ; } delete ( ) { java . sql . Connection connection = getConnection ( ) ; try { java . sql . PreparedStatement realStatement = getStatementWithParamsAdded ( connection ) ; try { int affectedRowsNbr = realStatement . executeUpdate ( ) ; return affectedRowsNbr ; } finally { close ( realStatement ) ; } } catch ( java . lang . Exception ex ) { throw org . spincast . core . utils . SpincastStatics . runtimize ( ex ) ; } }
org . junit . Assert . assertEquals ( 2 , affectedRowsNbr )
testBridgedEquals ( ) { org . easymock . tests2 . ChildEquals c = createMock ( org . easymock . tests2 . ChildEquals . class ) ; "<AssertPlaceHolder>" ; } createMock ( java . lang . Class ) { return org . easymock . EasyMock . mock ( toMock ) ; }
org . junit . Assert . assertEquals ( c , c )
testBondIsAliphaticT ( ) { org . openscience . cdk . isomorphism . matchers . Expr expr = new org . openscience . cdk . isomorphism . matchers . Expr ( IS_ALIPHATIC ) ; org . openscience . cdk . interfaces . IBond bond = mock ( org . openscience . cdk . interfaces . IBond . class ) ; when ( bond . isAromatic ( ) ) . thenReturn ( false ) ; "<AssertPlaceHolder>" ; } matches ( org . openscience . cdk . interfaces . IAtomContainer ) { return matches ( atomContainer , true ) ; }
org . junit . Assert . assertTrue ( expr . matches ( bond ) )
testBulkLoadNativeHFile ( ) { final org . apache . hadoop . hbase . TableName tableName = org . apache . hadoop . hbase . TableName . valueOf ( name . getMethodName ( ) ) ; long l = java . lang . System . currentTimeMillis ( ) ; org . apache . hadoop . hbase . client . Admin admin = org . apache . hadoop . hbase . regionserver . TestScannerWithBulkload . TEST_UTIL . getAdmin ( ) ; org . apache . hadoop . hbase . regionserver . TestScannerWithBulkload . createTable ( admin , tableName ) ; org . apache . hadoop . hbase . client . Scan scan = createScan ( ) ; final org . apache . hadoop . hbase . client . Table table = init ( admin , l , scan , tableName ) ; final org . apache . hadoop . fs . Path hfilePath = writeToHFile ( l , "/temp/testBulkLoadNativeHFile/" , "/temp/testBulkLoadNativeHFile/col/file" , true ) ; org . apache . hadoop . conf . Configuration conf = org . apache . hadoop . hbase . regionserver . TestScannerWithBulkload . TEST_UTIL . getConfiguration ( ) ; conf . setBoolean ( "hbase.mapreduce.bulkload.assign.sequenceNumbers" , true ) ; final org . apache . hadoop . hbase . tool . LoadIncrementalHFiles bulkload = new org . apache . hadoop . hbase . tool . LoadIncrementalHFiles ( conf ) ; try ( org . apache . hadoop . hbase . client . RegionLocator locator = org . apache . hadoop . hbase . regionserver . TestScannerWithBulkload . TEST_UTIL . getConnection ( ) . getRegionLocator ( tableName ) ) { bulkload . doBulkLoad ( hfilePath , admin , table , locator ) ; } org . apache . hadoop . hbase . client . ResultScanner scanner = table . getScanner ( scan ) ; org . apache . hadoop . hbase . client . Result result = scanner . next ( ) ; result = scanAfterBulkLoad ( scanner , result , "version2" ) ; org . apache . hadoop . hbase . client . Put put0 = new org . apache . hadoop . hbase . client . Put ( org . apache . hadoop . hbase . util . Bytes . toBytes ( "row1" ) ) ; put0 . add ( new org . apache . hadoop . hbase . KeyValue ( org . apache . hadoop . hbase . util . Bytes . toBytes ( "row1" ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "col" ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "q" ) , l , org . apache . hadoop . hbase . util . Bytes . toBytes ( "version3" ) ) ) ; table . put ( put0 ) ; admin . flush ( tableName ) ; scanner = table . getScanner ( scan ) ; result = scanner . next ( ) ; while ( result != null ) { java . util . List < org . apache . hadoop . hbase . Cell > cells = result . getColumnCells ( org . apache . hadoop . hbase . util . Bytes . toBytes ( "col" ) , org . apache . hadoop . hbase . util . Bytes . toBytes ( "q" ) ) ; for ( org . apache . hadoop . hbase . Cell _c : cells ) { if ( org . apache . hadoop . hbase . util . Bytes . toString ( _c . getRowArray ( ) , _c . getRowOffset ( ) , _c . getRowLength ( ) ) . equals ( "row1" ) ) { System . out . println ( org . apache . hadoop . hbase . util . Bytes . toString ( _c . getRowArray ( ) , _c . getRowOffset ( ) , _c . getRowLength ( ) ) ) ; System . out . println ( org . apache . hadoop . hbase . util . Bytes . toString ( _c . getQualifierArray ( ) , _c . getQualifierOffset ( ) , _c . getQualifierLength ( ) ) ) ; System . out . println ( org . apache . hadoop . hbase . util . Bytes . toString ( _c . getValueArray ( ) , _c . getValueOffset ( ) , _c . getValueLength ( ) ) ) ; "<AssertPlaceHolder>" ; } } result = scanner . next ( ) ; } scanner . close ( ) ; table . close ( ) ; } toString ( byte [ ] , java . lang . String , byte [ ] ) { return ( ( org . apache . hadoop . hbase . util . Bytes . toString ( b1 , 0 , b1 . length ) ) + sep ) + ( org . apache . hadoop . hbase . util . Bytes . toString ( b2 , 0 , b2 . length ) ) ; }
org . junit . Assert . assertEquals ( "version3" , org . apache . hadoop . hbase . util . Bytes . toString ( _c . getValueArray ( ) , _c . getValueOffset ( ) , _c . getValueLength ( ) ) )
testSimpleWordXML ( ) { javax . ws . rs . core . Response response = org . apache . cxf . jaxrs . client . WebClient . create ( ( ( endPoint ) + ( org . apache . tika . server . TikaResourceTest . TIKA_PATH ) ) ) . type ( "application/msword" ) . accept ( "text/xml" ) . put ( java . lang . ClassLoader . getSystemResourceAsStream ( org . apache . tika . server . TikaResourceTest . TEST_DOC ) ) ; java . lang . String responseMsg = getStringFromInputStream ( ( ( java . io . InputStream ) ( response . getEntity ( ) ) ) ) ; "<AssertPlaceHolder>" ; } contains ( java . nio . charset . Charset ) { return cs . equals ( StandardCharsets . US_ASCII ) ; }
org . junit . Assert . assertTrue ( responseMsg . contains ( "test" ) )
testGetCount ( ) { org . zenoss . app . metricservice . buckets . Value victim = new org . zenoss . app . metricservice . buckets . Value ( ) ; java . lang . Double [ ] testValues = new java . lang . Double [ ] { 1.0 , 1.1 , 2.0 , 2.1 } ; for ( java . lang . Double value : testValues ) { victim . add ( value ) ; } "<AssertPlaceHolder>" ; } getCount ( ) { return count ; }
org . junit . Assert . assertTrue ( ( ( testValues . length ) == ( victim . getCount ( ) ) ) )
writeToBuffer ( ) { byte [ ] input = new byte [ ] { 0 , 1 , 2 , 3 , 4 , 5 } ; java . nio . ByteBuffer source = java . nio . ByteBuffer . wrap ( input ) ; doTestWriteToByteBuffer ( source , java . nio . ByteBuffer . allocate ( input . length ) ) ; doTestWriteToByteBuffer ( source , java . nio . ByteBuffer . allocateDirect ( input . length ) ) ; "<AssertPlaceHolder>" ; source . position ( 2 ) ; doTestWriteToByteBuffer ( source , java . nio . ByteBuffer . allocate ( input . length ) ) ; doTestWriteToByteBuffer ( source , java . nio . ByteBuffer . allocateDirect ( input . length ) ) ; } position ( ) { return iter . getIndex ( ) ; }
org . junit . Assert . assertEquals ( 0 , source . position ( ) )
hasIgnorePlaceholder_Equal_StartAndEndWhitespacesInPlaceholder ( ) { java . lang . String control = "<elem1><elem11>${<sp>xmlunit.ignore<sp>}</elem11></elem1>" ; java . lang . String test = "<elem1><elem11>abc</elem11></elem1>" ; org . xmlunit . placeholder . Diff diff = org . xmlunit . builder . DiffBuilder . compare ( control ) . withTest ( test ) . withDifferenceEvaluator ( new org . xmlunit . placeholder . PlaceholderDifferenceEvaluator ( ) ) . build ( ) ; "<AssertPlaceHolder>" ; } hasDifferences ( ) { return differences . iterator ( ) . hasNext ( ) ; }
org . junit . Assert . assertFalse ( diff . hasDifferences ( ) )
testSparseRecursiveForm2 ( ) { org . apache . commons . math3 . random . RandomDataGenerator rnd = getRandomData ( ) ; for ( int i = 0 ; i < 1000 ; ++ i ) { cc . redberry . rings . poly . multivar . MultivariatePolynomial . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > p = cc . redberry . rings . poly . multivar . RandomMultivariatePolynomials . randomPolynomial ( rnd . nextInt ( 2 , 7 ) , rnd . nextInt ( 1 , 50 ) , rnd . nextInt ( 1 , 100 ) , Rings . Z , MonomialOrder . DEFAULT , rnd . getRandomGenerator ( ) ) ; cc . redberry . rings . poly . multivar . AMultivariatePolynomial recursiveRep = p . toSparseRecursiveForm ( ) ; "<AssertPlaceHolder>" ; } } fromSparseRecursiveForm ( cc . redberry . rings . poly . multivar . AMultivariatePolynomial , int , cc . redberry . rings . poly . multivar . Comparator ) { return cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . fromSparseRecursiveForm ( recForm , nVariables , ordering , ( nVariables - 1 ) ) ; }
org . junit . Assert . assertEquals ( p , fromSparseRecursiveForm ( recursiveRep , p . nVariables , MonomialOrder . DEFAULT ) )
testKieSessionsPoolInMultithreadEnv ( ) { org . kie . api . runtime . KieContainerSessionsPool pool = getKieContainer ( ) . newKieSessionsPool ( 4 ) ; final int THREAD_NR = 10 ; java . util . concurrent . ExecutorService executor = java . util . concurrent . Executors . newFixedThreadPool ( THREAD_NR , ( r ) -> { final java . lang . Thread t = new java . lang . Thread ( r ) ; t . setDaemon ( true ) ; return t ; } ) ; try { java . util . concurrent . CompletionService < java . lang . Boolean > ecs = new java . util . concurrent . ExecutorCompletionService ( executor ) ; for ( int i = 0 ; i < THREAD_NR ; i ++ ) { ecs . submit ( ( ) -> { try { org . kie . api . runtime . KieSession ksession = pool . newKieSession ( ) ; try { checkKieSession ( ksession ) ; } finally { ksession . dispose ( ) ; } return true ; } catch ( final e ) { return false ; } } ) ; } boolean success = true ; for ( int i = 0 ; i < THREAD_NR ; i ++ ) { success = ( ecs . take ( ) . get ( ) ) && success ; } "<AssertPlaceHolder>" ; } finally { executor . shutdown ( ) ; } pool . shutdown ( ) ; try { pool . newKieSession ( ) ; org . junit . Assert . fail ( "after<sp>pool<sp>shutdown<sp>it<sp>shouldn't<sp>be<sp>possible<sp>to<sp>get<sp>sessions<sp>from<sp>it" ) ; } catch ( java . lang . IllegalStateException e ) { } } get ( ) { return t ; }
org . junit . Assert . assertTrue ( success )
getAllProducts ( ) { final org . apache . olingo . fit . proxy . staticservice . odatawcfservice . types . ProductCollectionComposableInvoker products = container . operations ( ) . getAllProducts ( ) ; "<AssertPlaceHolder>" ; } execute ( ) { final org . apache . http . HttpResponse res = org . apache . olingo . client . core . communication . request . retrieve . ODataPropertyRequestImpl . doExecute ( ) ; return new ODataPropertyResponseImpl ( odataClient , httpClient , res ) ; }
org . junit . Assert . assertEquals ( 5 , products . execute ( ) . size ( ) )
GIVEN_the_iteration_has_stories_queued_in_a_workflow_step_AND_capacity_of_that_step_is_less_than_stories_available_to_play_WHEN_the_iteration_is_run_THEN_the_queue_increases ( ) { java . lang . String someWorkflowStep = IterationResultSpecHelper . FIRST_WORKFLOW_STEP ; int storiesQueuedBeforeRun = com . bigvisible . kanbansimulatortester . core . unit . UnitTestHelper . anyReasonableNumber ( ) ; int storiesAvailableToPlay = batchSize ; int capacity = storiesAvailableToPlay - 1 ; int expectedStoriesQueuedAfterRun = storiesQueuedBeforeRun + 1 ; iterationResult . setIterationNumber ( 1 ) ; iterationResult . setCapacity ( someWorkflowStep , capacity ) ; iterationResult . setQueued ( someWorkflowStep , storiesQueuedBeforeRun ) ; iterationResult . run ( storiesAvailableToPlay ) ; "<AssertPlaceHolder>" ; } getQueued ( java . lang . String ) { return getStep ( stepName ) . getQueued ( ) ; }
org . junit . Assert . assertThat ( iterationResult . getQueued ( someWorkflowStep ) , is ( expectedStoriesQueuedAfterRun ) )
testDate ( ) { java . util . Date date = java . util . Calendar . getInstance ( ) . getTime ( ) ; setDateProperty ( "date" , date ) ; "<AssertPlaceHolder>" ; } getDateProperty ( java . lang . String ) { try { org . drools . informer . domain . DomainModelSupportTest . logger . debug ( ( "Getting<sp>" + property ) ) ; java . lang . Object propertyValue = org . apache . commons . beanutils . PropertyUtils . getProperty ( data , property ) ; java . util . Date value = ( ( java . util . Date ) ( org . drools . informer . domain . DomainModelSupport . objectToAnswer ( propertyValue , Question . QuestionType . TYPE_DATE ) ) ) ; return value ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } }
org . junit . Assert . assertEquals ( date , getDateProperty ( "date" ) )
bridge ( ) { final ij . ImagePlus bridge = loadFromResource ( "/bridge.png" ) ; org . junit . Assume . assumeNotNull ( bridge ) ; final ij . ImagePlus bridgeExpect = loadFromResource ( "/bridge-expected.png" ) ; org . junit . Assume . assumeNotNull ( bridgeExpect ) ; ij . ImagePlus output = trainableSegmentation . BasicTest . segmentBridge ( bridge ) ; "<AssertPlaceHolder>" ; } diffImagePlus ( ij . ImagePlus , ij . ImagePlus ) { final int [ ] dimsA = a . getDimensions ( ) ; final int [ ] dimsB = b . getDimensions ( ) ; if ( ( dimsA . length ) != ( dimsB . length ) ) return ( dimsA . length ) - ( dimsB . length ) ; for ( int i = 0 ; i < ( dimsA . length ) ; i ++ ) { if ( ( dimsA [ i ] ) != ( dimsB [ i ] ) ) return ( dimsA [ i ] ) - ( dimsB [ i ] ) ; } int count = 0 ; final ij . ImageStack stackA = a . getStack ( ) ; final ij . ImageStack stackB = b . getStack ( ) ; for ( int slice = 1 ; slice <= ( stackA . getSize ( ) ) ; slice ++ ) { count += diff ( stackA . getProcessor ( slice ) , stackB . getProcessor ( slice ) ) ; } return count ; }
org . junit . Assert . assertEquals ( 0 , diffImagePlus ( output , bridgeExpect ) )
testOfferedTuplesDrainedGreedilyWhenTupleCountsNotUpdated ( ) { final cs . bilkent . joker . operator . Tuple tuple = cs . bilkent . joker . operator . Tuple . of ( cs . bilkent . joker . engine . tuplequeue . impl . operator . PartitionedOperatorQueueTest . PARTITION_KEY_FIELD , "key1" ) ; final java . util . List < cs . bilkent . joker . operator . Tuple > tuples = singletonList ( tuple ) ; operatorQueue . offer ( 0 , tuples ) ; final cs . bilkent . joker . operator . impl . TuplesImpl result = new cs . bilkent . joker . operator . impl . TuplesImpl ( cs . bilkent . joker . engine . tuplequeue . impl . operator . PartitionedOperatorQueueTest . INPUT_PORT_COUNT ) ; final cs . bilkent . joker . engine . tuplequeue . impl . drainer . GreedyDrainer drainer = new cs . bilkent . joker . engine . tuplequeue . impl . drainer . GreedyDrainer ( cs . bilkent . joker . engine . tuplequeue . impl . operator . PartitionedOperatorQueueTest . INPUT_PORT_COUNT ) ; operatorQueue . drain ( drainer , ( key ) -> result ) ; "<AssertPlaceHolder>" ; } getTuples ( int ) { return unmodifiableList ( ports [ portIndex ] ) ; }
org . junit . Assert . assertEquals ( tuples , result . getTuples ( 0 ) )
storeTo_multiple ( ) { java . util . Properties p = new java . util . Properties ( ) ; p . setProperty ( ( ( ResourceProfile . KEY_PREFIX ) + "testing1" ) , com . asakusafw . windgate . core . resource . MockResourceProvider . class . getName ( ) ) ; p . setProperty ( ( ( ( ( ResourceProfile . KEY_PREFIX ) + "testing1" ) + ( com . asakusafw . windgate . core . BaseProfile . QUALIFIER ) ) + "conf" ) , "p1" ) ; p . setProperty ( ( ( ResourceProfile . KEY_PREFIX ) + "testing2" ) , com . asakusafw . windgate . core . resource . MockResourceProvider . class . getName ( ) ) ; p . setProperty ( ( ( ( ( ResourceProfile . KEY_PREFIX ) + "testing2" ) + ( com . asakusafw . windgate . core . BaseProfile . QUALIFIER ) ) + "conf" ) , "p2" ) ; p . setProperty ( ( ( ResourceProfile . KEY_PREFIX ) + "testing3" ) , com . asakusafw . windgate . core . resource . MockResourceProvider . class . getName ( ) ) ; p . setProperty ( ( ( ( ( ResourceProfile . KEY_PREFIX ) + "testing3" ) + ( com . asakusafw . windgate . core . BaseProfile . QUALIFIER ) ) + "conf" ) , "p3" ) ; java . util . Collection < ? extends com . asakusafw . windgate . core . resource . ResourceProfile > profiles = com . asakusafw . windgate . core . resource . ResourceProfile . loadFrom ( p , com . asakusafw . windgate . core . ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; java . util . Properties restored = new java . util . Properties ( ) ; for ( com . asakusafw . windgate . core . resource . ResourceProfile profile : profiles ) { profile . storeTo ( restored ) ; } "<AssertPlaceHolder>" ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; }
org . junit . Assert . assertThat ( restored , is ( p ) )
testNoSegments ( ) { org . apache . commons . math4 . geometry . euclidean . twod . SubLine empty = new org . apache . commons . math4 . geometry . euclidean . twod . SubLine ( new org . apache . commons . math4 . geometry . euclidean . twod . Line ( new org . apache . commons . math4 . geometry . euclidean . twod . Cartesian2D ( ( - 1 ) , ( - 7 ) ) , new org . apache . commons . math4 . geometry . euclidean . twod . Cartesian2D ( 7 , ( - 1 ) ) , 1.0E-10 ) , new org . apache . commons . math4 . geometry . partitioning . RegionFactory < org . apache . commons . math4 . geometry . euclidean . oned . Euclidean1D > ( ) . getComplement ( new org . apache . commons . math4 . geometry . euclidean . oned . IntervalsSet ( 1.0E-10 ) ) ) ; java . util . List < org . apache . commons . math4 . geometry . euclidean . twod . Segment > segments = empty . getSegments ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; }
org . junit . Assert . assertEquals ( 0 , segments . size ( ) )
verifySingleAdapter ( ) { final java . util . Map < java . lang . String , java . lang . String > properties = new java . util . HashMap ( ) ; properties . put ( "name" , "Netflow-5" ) ; properties . put ( "adapters.1.name" , "Netflow-5-Parser" ) ; properties . put ( "adapters.1.class-name" , "org.opennms.netmgt.telemetry.protocols.netflow.adapter.netflow5.Netflow5Adapter" ) ; final java . util . List < org . opennms . netmgt . telemetry . config . api . AdapterDefinition > adapters = new org . opennms . netmgt . telemetry . distributed . common . AdapterDefinitionParser ( ) . parse ( properties ) ; "<AssertPlaceHolder>" ; } size ( ) { m_lock . readLock ( ) . lock ( ) ; try { return m_managedAddresses . size ( ) ; } finally { m_lock . readLock ( ) . unlock ( ) ; } }
org . junit . Assert . assertEquals ( 1 , adapters . size ( ) )