input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
getSubscriptionsForMyCustomersFilteredByMultiColumnNoSubscriptionReturned ( ) { final int expected = 0 ; final org . oscm . paginator . Sorting sorting = new org . oscm . paginator . Sorting ( org . oscm . paginator . TableColumns . SUBSCRIPTION_ID , org . oscm . paginator . SortOrder . ASC ) ; java . util . Set < org . oscm . paginator . Filter > filterSet = createFilterSet ( SUBSCRIPTION_ID1 , TIMESTAMP_STRING2 , SUPPLIER_CUSTOMER1 , CUSTOMER_NAME_PREFIX , SERVICE_ID1 ) ; final org . oscm . paginator . Pagination pagination = createPagination ( 0 , NUM_CUSTOMER_SUBSCRIPTIONS , sorting , filterSet ) ; java . util . List < org . oscm . domobjects . Subscription > result = runTX ( new java . util . concurrent . Callable < java . util . List < org . oscm . domobjects . Subscription > > ( ) { @ org . oscm . subscriptionservice . dao . Override public java . util . List < org . oscm . domobjects . Subscription > call ( ) throws org . oscm . subscriptionservice . dao . Exception { return dao . getSubscriptionsForMyCustomers ( supplierUser , states , pagination ) ; } } ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
org . junit . Assert . assertEquals ( expected , result . size ( ) )
copiesEmptyInputStream ( ) { final byte [ ] bytes = createByteArray ( 0 ) ; final java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( bytes ) ; final java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; org . apache . isis . core . commons . lang . InputStreamExtensions . copyTo ( bais , baos ) ; "<AssertPlaceHolder>" ; } arrayEqualTo ( byte [ ] ) { return new org . apache . isis . core . commons . lang . IoUtils_CopyTest . ArrayMatcher ( bytes ) ; }
org . junit . Assert . assertThat ( baos . toByteArray ( ) , arrayEqualTo ( bytes ) )
testGetObjectNoObjectIdInFilter ( ) { org . apache . chemistry . opencmis . inmemory . ObjectServiceTest . log . info ( "starting<sp>testGetObjectNoObjectIdInFilter()<sp>..." ) ; org . apache . chemistry . opencmis . inmemory . ObjectServiceTest . log . info ( "<sp>creating<sp>object" ) ; java . lang . String id = createDocument ( fRootFolderId , false ) ; if ( id != null ) { org . apache . chemistry . opencmis . inmemory . ObjectServiceTest . log . info ( ( "<sp>createDocument<sp>succeeded<sp>with<sp>created<sp>id:<sp>" + id ) ) ; } org . apache . chemistry . opencmis . inmemory . ObjectServiceTest . log . info ( "<sp>getting<sp>object" ) ; java . lang . String filter = ( ( ( ( org . apache . chemistry . opencmis . commons . PropertyIds . NAME ) + "," ) + ( org . apache . chemistry . opencmis . commons . PropertyIds . CREATION_DATE ) ) + "," ) + ( org . apache . chemistry . opencmis . commons . PropertyIds . LAST_MODIFICATION_DATE ) ; org . apache . chemistry . opencmis . commons . data . ObjectData res = fObjSvc . getObject ( fRepositoryId , id , filter , false , IncludeRelationships . NONE , null , false , false , null ) ; java . lang . String returnedId = res . getId ( ) ; "<AssertPlaceHolder>" ; org . apache . chemistry . opencmis . inmemory . ObjectServiceTest . log . info ( "...<sp>testGetObjectNoObjectIdInFilter()<sp>finished." ) ; } getId ( ) { return getPropertyValue ( PropertyIds . OBJECT_ID ) ; }
org . junit . Assert . assertEquals ( id , returnedId )
orelasitcsearch ( ) { java . lang . String filterStr = "itemKey<sp>eq<sp>'itemValue'<sp>or<sp>itemKey2<sp>eq<sp>'itemValue2'<sp>or<sp>itemKey3<sp>eq<sp>'itemValue3'" ; org . odata4j . expression . BoolCommonExpression filterExp = com . fujitsu . dc . core . odata . DcOptionsQueryParser . parseFilter ( filterStr ) ; org . odata4j . producer . QueryInfo queryInfo = new org . odata4j . producer . QueryInfo ( null , null , null , filterExp , null , null , null , null , null ) ; com . fujitsu . dc . core . model . impl . es . odata . EsQueryHandler esQueryHandler = new com . fujitsu . dc . core . model . impl . es . odata . EsQueryHandler ( entityType ) ; esQueryHandler . initialize ( queryInfo , null ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . ArrayList < java . util . Map < java . lang . String , java . lang . Object > > orElement = new java . util . ArrayList < java . util . Map < java . lang . String , java . lang . Object > > ( ) ; java . util . ArrayList < java . util . Map < java . lang . String , java . lang . Object > > rightOr = new java . util . ArrayList < java . util . Map < java . lang . String , java . lang . Object > > ( ) ; java . util . Map < java . lang . String , java . lang . Object > mapRightOr = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > leftTerm = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > middleTerm = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > rightTerm = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > leftTermValue = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > middleTermValue = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > rightTermValue = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > or = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > filtersElement = new java . util . ArrayList < java . util . Map < java . lang . String , java . lang . Object > > ( ) ; java . util . Map < java . lang . String , java . lang . Object > filters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > and = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; leftTermValue . put ( "s.itemKey.untouched" , "itemValue" ) ; middleTermValue . put ( "s.itemKey2.untouched" , "itemValue2" ) ; rightTermValue . put ( "and" 3 , "itemValue3" ) ; leftTerm . put ( "term" , leftTermValue ) ; middleTerm . put ( "term" , middleTermValue ) ; rightTerm . put ( "term" , rightTermValue ) ; rightOr . add ( middleTerm ) ; rightOr . add ( rightTerm ) ; mapRightOr . put ( "and" 0 , rightOr ) ; orElement . add ( leftTerm ) ; orElement . add ( mapRightOr ) ; or . put ( "and" 0 , orElement ) ; filtersElement . add ( or ) ; filters . put ( "and" 2 , filtersElement ) ; and . put ( "and" , filters ) ; expected . put ( "filter" , and ) ; expected . put ( "and" 1 , 25 ) ; expected . put ( "version" , true ) ; "<AssertPlaceHolder>" ; } getSource ( ) { java . lang . String dataType = ( ( java . lang . String ) ( this . staticFields . get ( "Type" ) ) ) ; java . lang . String entityTypeId = ( ( java . lang . String ) ( this . manyToOnelinkId . get ( EntityType . EDM_TYPE_NAME ) ) ) ; java . lang . String entityTypeName = this . entityTypeMap . get ( ( ( linkTypeName ) + entityTypeId ) ) ; java .
org . junit . Assert . assertEquals ( expected , esQueryHandler . getSource ( ) )
multipleTuplesMutliplesFiles ( ) { org . apache . storm . hdfs . bolt . AvroGenericRecordBolt bolt = makeAvroBolt ( hdfsURI , 1 , 1.0E-4F , org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . schemaV1 ) ; bolt . prepare ( new org . apache . storm . Config ( ) , topologyContext , collector ) ; bolt . execute ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . tuple1 ) ; bolt . execute ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . tuple1 ) ; bolt . execute ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . tuple1 ) ; bolt . execute ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . tuple1 ) ; "<AssertPlaceHolder>" ; verifyAllAvroFiles ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . testRoot ) ; } countNonZeroLengthFiles ( java . lang . String ) { org . apache . hadoop . fs . Path p = new org . apache . hadoop . fs . Path ( path ) ; int nonZero = 0 ; for ( org . apache . hadoop . fs . FileStatus file : fs . listStatus ( p ) ) { if ( ( file . getLen ( ) ) > 0 ) { nonZero ++ ; } } return nonZero ; }
org . junit . Assert . assertEquals ( 4 , countNonZeroLengthFiles ( org . apache . storm . hdfs . bolt . AvroGenericRecordBoltTest . testRoot ) )
test_FiniteCapacityItemProduct_NoQtyPlanned_QtyMoved ( ) { final de . metas . handlingunits . impl . HUPIItemProductDisplayNameBuilder builder = new de . metas . handlingunits . impl . HUPIItemProductDisplayNameBuilder ( ) ; final de . metas . handlingunits . model . I_M_HU_PI_Item_Product piItemProduct = createM_HU_PI_Item_Product ( "IFCO" , "10" , false , "Kg" ) ; final java . lang . String displayNameActual = builder . setM_HU_PI_Item_Product ( piItemProduct ) . setQtyTUMoved ( new java . math . BigDecimal ( "22" ) ) . build ( ) ; final java . lang . String displayNameExpected = "22<sp>/<sp>?<sp>x<sp>[IFCO<sp>x<sp>10<sp>Kg]" ; "<AssertPlaceHolder>" ; } build ( ) { final de . metas . aggregation . model . I_C_Aggregation aggregation = org . adempiere . model . InterfaceWrapperHelper . newInstance ( de . metas . aggregation . model . I_C_Aggregation . class , context ) ; aggregation . setName ( name ) ; aggregation . setAD_Table_ID ( adTableId ) ; aggregation . setIsDefault ( isDefault ) ; aggregation . setIsDefaultPO ( isDefaultPO ) ; aggregation . setIsDefaultSO ( isDefaultSO ) ; de . metas . util . Check . assumeNotEmpty ( aggregationUsageLevel , "aggregationUsageLevel<sp>not<sp>empty" ) ; aggregation . setAggregationUsageLevel ( aggregationUsageLevel ) ; org . adempiere . model . InterfaceWrapperHelper . save ( aggregation ) ; for ( final de . metas . aggregation . model . C_AggregationItem_Builder itemBuilder : itemBuilders ) { itemBuilder . setC_Aggregation ( aggregation ) ; itemBuilder . build ( ) ; } return aggregation ; }
org . junit . Assert . assertEquals ( displayNameExpected , displayNameActual )
shouldReturnTrueWhenComparingRemoteVariantContainerWithContainer ( ) { org . eclipse . egit . core . synchronize . GitResourceVariantComparator grvc = new org . eclipse . egit . core . synchronize . GitResourceVariantComparator ( null ) ; java . io . File file1 = testRepo . createFile ( iProject , ( ( "test1" + ( java . io . File . separator ) ) + "keep1" ) ) ; testRepo . track ( file1 ) ; testRepo . addToIndex ( testRepo . getIFile ( iProject , file1 ) ) ; org . eclipse . jgit . revwalk . RevCommit commit = testRepo . commit ( "initial<sp>commit" ) ; java . lang . String path1 = org . eclipse . jgit . lib . Repository . stripWorkDir ( repo . getWorkTree ( ) , new java . io . File ( file1 . getParent ( ) ) ) ; org . eclipse . egit . core . synchronize . GitRemoteFolder base = new org . eclipse . egit . core . synchronize . GitRemoteFolder ( repo , null , commit , commit . getTree ( ) , path1 ) ; org . eclipse . egit . core . synchronize . GitRemoteFolder remote = new org . eclipse . egit . core . synchronize . GitRemoteFolder ( repo , null , commit , commit . getTree ( ) , path1 ) ; "<AssertPlaceHolder>" ; } compare ( org . eclipse . jgit . lib . Repository , org . eclipse . jgit . lib . Repository ) { java . lang . String name1 = o1 . getWorkTree ( ) . getName ( ) ; java . lang . String name2 = o2 . getWorkTree ( ) . getName ( ) ; return name1 . compareToIgnoreCase ( name2 ) ; }
org . junit . Assert . assertTrue ( grvc . compare ( base , remote ) )
testRemoveEndingString2 ( ) { final java . lang . String EXPECT = "removeEnding" ; final java . lang . String ENDING = "/" ; java . lang . String testString = ENDING + EXPECT ; java . lang . String result = org . talend . utils . string . StringUtilities . removeEndingString ( testString , ENDING ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org . talend . repository . items . importexport . handlers . model . ImportItem ) ) { return false ; } org . talend . repository . items . importexport . handlers . model . ImportItem other = ( ( org . talend . repository . items . importexport . handlers . model . ImportItem ) ( obj ) ) ; if ( ( this . path ) == null ) { if ( ( other . path ) != null ) { return false ; } } else if ( ! ( this . path . equals ( other . path ) ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( testString . equals ( result ) )
testSetParameters_noNPE ( ) { this . agent . setParameters ( null ) ; "<AssertPlaceHolder>" ; } setParameters ( java . lang . String ) { this . parameters = parameters ; reloadUserData ( ) ; reconfigure ( ) ; }
org . junit . Assert . assertNull ( this . agent . parameters )
testWorkshop1EdgeCase1 ( ) { final java . lang . String expected = org . dswarm . persistence . util . DMPPersistenceUtil . getResourceAsString ( "test-mabxml.ws1ec1.result.json" ) ; final org . dswarm . converter . flow . JSONTransformationFlowFactory flowFactory = GuicedTest . injector . getInstance ( org . dswarm . converter . flow . JSONTransformationFlowFactory . class ) ; final org . dswarm . converter . flow . JSONTransformationFlow flow = flowFactory . fromFile ( "ws1ec1morph.xml" ) ; final java . lang . String actual = flow . applyResource ( "ralfs_mabxml.tuples.json" ) . toBlocking ( ) . first ( ) ; final com . fasterxml . jackson . databind . node . ArrayNode expectedJson = replaceKeyWithActualKey ( expected , actual ) ; final java . lang . String finalExpected = org . dswarm . persistence . util . DMPPersistenceUtil . getJSONObjectMapper ( ) . writeValueAsString ( expectedJson ) ; "<AssertPlaceHolder>" ; } getJSONObjectMapper ( ) { return org . dswarm . persistence . util . DMPPersistenceUtil . MAPPER ; }
org . junit . Assert . assertEquals ( finalExpected , actual )
isAssignable ( ) { "<AssertPlaceHolder>" ; } isAssignable ( ) { org . junit . Assert . assertTrue ( this . mocker . getComponentUnderTest ( ) . isAssignable ( ) ) ; }
org . junit . Assert . assertTrue ( this . mocker . getComponentUnderTest ( ) . isAssignable ( ) )
shouldHandleZonedDateTime ( ) { final java . time . ZonedDateTime o = java . time . ZonedDateTime . 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 . ZonedDateTime . class ) )
testToBuilderIncomplete ( ) { com . google . cloud . compute . deprecated . NetworkInfo networkInfo = com . google . cloud . compute . deprecated . NetworkInfo . of ( com . google . cloud . compute . deprecated . NetworkInfoTest . NETWORK_ID , com . google . cloud . compute . deprecated . NetworkInfoTest . NETWORK_CONFIGURATION ) ; "<AssertPlaceHolder>" ; } toBuilder ( ) { return ( this ) == ( com . google . firestore . admin . v1 . DeleteIndexRequest . DEFAULT_INSTANCE ) ? new com . google . firestore . admin . v1 . DeleteIndexRequest . Builder ( ) : new com . google . firestore . admin . v1 . DeleteIndexRequest . Builder ( ) . mergeFrom ( this ) ; }
org . junit . Assert . assertEquals ( networkInfo , networkInfo . toBuilder ( ) . build ( ) )
shouldDeserialiseSourceDestinationValuesUndirected ( ) { final uk . gov . gchq . gaffer . data . element . Edge edge = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . source ( "1" ) . dest ( "2" ) . directed ( false ) . group ( TestGroups . ENTITY ) . build ( ) ; final byte [ ] rowKey = serialisation . getRowKeys ( edge ) . getFirst ( ) ; final byte [ ] [ ] sourceDestValues = new byte [ 2 ] [ ] ; final uk . gov . gchq . gaffer . data . element . EdgeDirection direction = serialisation . getSourceAndDestination ( rowKey , sourceDestValues ) ; "<AssertPlaceHolder>" ; } getSourceAndDestination ( byte [ ] , byte [ ] [ ] ) { final int [ ] positionsOfDelimiters = new int [ 3 ] ; short numDelims = 0 ; for ( int i = 0 ; i < ( ( rowKey . length ) - 1 ) ; ++ i ) { if ( ( rowKey [ i ] ) == ( uk . gov . gchq . gaffer . commonutil . ByteArrayEscapeUtils . DELIMITER ) ) { if ( numDelims >= 3 ) { throw new uk . gov . gchq . gaffer . exception . SerialisationException ( "Too<sp>many<sp>delimiters<sp>found<sp>in<sp>row<sp>cell<sp>-<sp>found<sp>more<sp>than<sp>the<sp>expected<sp>3." ) ; } positionsOfDelimiters [ ( numDelims ++ ) ] = i ; } } if ( numDelims != 3 ) { throw new uk . gov . gchq . gaffer . exception . SerialisationException ( ( ( "Wrong<sp>number<sp>of<sp>delimiters<sp>found<sp>in<sp>row<sp>cell<sp>-<sp>found<sp>" + numDelims ) + ",<sp>expected<sp>3." ) ) ; } byte directionFlag ; try { directionFlag = rowKey [ ( ( rowKey . length ) - 1 ) ] ; } catch ( final java . lang . NumberFormatException e ) { throw new uk . gov . gchq . gaffer . exception . SerialisationException ( ( "Error<sp>parsing<sp>direction<sp>flag<sp>from<sp>row<sp>cell<sp>-<sp>" + e ) ) ; } byte [ ] sourceBytes = uk . gov . gchq . gaffer . commonutil . ByteArrayEscapeUtils . unEscape ( rowKey , 0 , positionsOfDelimiters [ 0 ] ) ; byte [ ] destBytes = uk . gov . gchq . gaffer . commonutil . ByteArrayEscapeUtils . unEscape ( rowKey , ( ( positionsOfDelimiters [ 1 ] ) + 1 ) , positionsOfDelimiters [ 2 ] ) ; sourceDestValues [ 0 ] = sourceBytes ; sourceDestValues [ 1 ] = destBytes ; uk . gov . gchq . gaffer . data . element . EdgeDirection rtn ; switch ( directionFlag ) { case uk . gov . gchq . gaffer . hbasestore . utils . HBaseStoreConstants . UNDIRECTED_EDGE : rtn = uk . gov . gchq . gaffer . data . element . EdgeDirection . UNDIRECTED ; break ; case uk . gov . gchq . gaffer . hbasestore . utils . HBaseStoreConstants . CORRECT_WAY_DIRECTED_EDGE : rtn = uk . gov . gchq . gaffer . data . element . EdgeDirection . DIRECTED ; break ; case uk . gov . gchq . gaffer . hbasestore . utils . HBaseStoreConstants . INCORRECT_WAY_DIRECTED_EDGE : sourceDestValues [ 0 ] = destBytes ; sourceDestValues [ 1 ] = sourceBytes ; rtn = uk . gov . gchq . gaffer . data . element . EdgeDirection . DIRECTED_REVERSED ; break ; default : throw new uk . gov . gchq . gaffer . exception . SerialisationException ( ( "Invalid<sp>direction<sp>flag<sp>in<sp>row<sp>cell<sp>-<sp>flag<sp>was<sp>" + directionFlag ) ) ; } return rtn ; }
org . junit . Assert . assertEquals ( EdgeDirection . UNDIRECTED , direction )
testExceptionExtensionFilter_shouldReturnEmptyFileListIfDirectoryDoesNotExist ( ) { java . io . File [ ] files = WorkerProcessFailureMonitor . ExceptionExtensionFilter . listFiles ( new java . io . File ( "notFound" ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 0 , files . length )
testRunTransServletCheckParameter ( ) { javax . servlet . http . HttpServletRequest request = org . mockito . Mockito . mock ( javax . servlet . http . HttpServletRequest . class ) ; javax . servlet . http . HttpServletResponse response = org . mockito . Mockito . mock ( javax . servlet . http . HttpServletResponse . class ) ; org . mockito . Mockito . when ( request . getParameter ( "trans" ) ) . thenReturn ( "home/test.rtr" ) ; java . io . StringWriter out = new java . io . StringWriter ( ) ; java . io . PrintWriter printWriter = new java . io . PrintWriter ( out ) ; org . mockito . Mockito . when ( request . getContextPath ( ) ) . thenReturn ( RunTransServlet . CONTEXT_PATH ) ; org . mockito . Mockito . when ( response . getWriter ( ) ) . thenReturn ( printWriter ) ; org . pentaho . di . www . TransformationMap mockTransformationMap = org . mockito . Mockito . mock ( org . pentaho . di . www . TransformationMap . class ) ; org . pentaho . di . www . SlaveServerConfig slaveServerConfig = org . mockito . Mockito . mock ( org . pentaho . di . www . SlaveServerConfig . class ) ; org . mockito . Mockito . when ( mockTransformationMap . getSlaveServerConfig ( ) ) . thenReturn ( slaveServerConfig ) ; org . pentaho . di . repository . Repository repository = org . mockito . Mockito . mock ( org . pentaho . di . repository . Repository . class ) ; org . mockito . Mockito . when ( slaveServerConfig . getRepository ( ) ) . thenReturn ( repository ) ; org . pentaho . di . repository . RepositoryDirectoryInterface repositoryDirectoryInterface = org . mockito . Mockito . mock ( org . pentaho . di . repository . RepositoryDirectoryInterface . class ) ; org . mockito . Mockito . when ( repository . loadRepositoryDirectoryTree ( ) ) . thenReturn ( repositoryDirectoryInterface ) ; org . mockito . Mockito . when ( repositoryDirectoryInterface . findDirectory ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( repositoryDirectoryInterface ) ; org . pentaho . di . trans . TransMeta transMeta = org . mockito . Mockito . mock ( org . pentaho . di . trans . TransMeta . class ) ; org . mockito . Mockito . when ( repository . loadTransformation ( org . mockito . Mockito . any ( ) , org . mockito . Mockito . any ( ) ) ) . thenReturn ( transMeta ) ; java . lang . String testParameter = "testParameter" ; org . mockito . Mockito . when ( transMeta . listVariables ( ) ) . thenReturn ( new java . lang . String [ ] { testParameter } ) ; org . mockito . Mockito . when ( transMeta . getVariable ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( "default<sp>value" ) ; org . mockito . Mockito . when ( transMeta . listParameters ( ) ) . thenReturn ( new java . lang . String [ ] { testParameter } ) ; org . mockito . Mockito . when ( request . getParameterNames ( ) ) . thenReturn ( new java . util . StringTokenizer ( testParameter ) ) ; java . lang . String testValue = "testValue" ; org . mockito . Mockito . when ( request . getParameterValues ( testParameter ) ) . thenReturn ( new java . lang . String [ ] { testValue } ) ; org . pentaho . di . www . RunTransServlet runTransServlet = org . mockito . Mockito . mock ( org . pentaho . di . www . RunTransServlet . class ) ; org . mockito . Mockito . doCallRealMethod ( ) . when ( runTransServlet ) . doGet ( org . mockito . Mockito . anyObject ( ) , org . mockito . Mockito . anyObject ( ) ) ; org . pentaho . di . trans . Trans trans = new org . pentaho . di . trans . Trans ( transMeta , new org . pentaho . di . core . logging . SimpleLoggingObject ( RunTransServlet . CONTEXT_PATH , org . pentaho . di . core . logging . LoggingObjectType . CARTE , null ) ) ; org . mockito . Mockito . when ( runTransServlet . createTrans ( org . mockito . Mockito . anyObject ( ) , org . mockito . Mockito . anyObject ( ) ) ) . thenReturn ( trans ) ; org . mockito . Mockito . when ( transMeta . getParameterValue ( org . mockito . Mockito . eq ( testParameter ) ) ) . thenReturn ( testValue ) ; runTransServlet . log = new org . pentaho . di . core . logging . LogChannel ( "RunTransServlet" ) ; runTransServlet . transformationMap = mockTransformationMap ; runTransServlet . doGet ( request , response ) ; "<AssertPlaceHolder>" ; } getParameterValue ( java . lang . String ) { return namedParams . getParameterValue ( key ) ; }
org . junit . Assert . assertEquals ( testValue , trans . getParameterValue ( testParameter ) )
test_LocalDate_adjustToJulianDate ( ) { org . threeten . extra . chrono . JulianDate julian = org . threeten . extra . chrono . JulianDate . of ( 2012 , 6 , 23 ) ; java . time . LocalDate test = LocalDate . MIN . with ( julian ) ; "<AssertPlaceHolder>" ; } of ( int , int , int ) { org . threeten . extra . chrono . YEAR . checkValidValue ( prolepticYear ) ; PaxChronology . MONTH_OF_YEAR_RANGE . checkValidValue ( month , org . threeten . extra . chrono . MONTH_OF_YEAR ) ; PaxChronology . DAY_OF_MONTH_RANGE . checkValidValue ( dayOfMonth , org . threeten . extra . chrono . DAY_OF_MONTH ) ; if ( ( month == ( ( org . threeten . extra . chrono . PaxChronology . MONTHS_IN_YEAR ) + 1 ) ) && ( ! ( PaxChronology . INSTANCE . isLeapYear ( prolepticYear ) ) ) ) { throw new java . time . DateTimeException ( ( ( "Invalid<sp>month<sp>14<sp>as<sp>" + prolepticYear ) + "is<sp>not<sp>a<sp>leap<sp>year" ) ) ; } if ( ( ( dayOfMonth > ( org . threeten . extra . chrono . PaxChronology . DAYS_IN_WEEK ) ) && ( month == ( org . threeten . extra . chrono . PaxChronology . MONTHS_IN_YEAR ) ) ) && ( PaxChronology . INSTANCE . isLeapYear ( prolepticYear ) ) ) { throw new java . time . DateTimeException ( ( ( "Invalid<sp>date<sp>during<sp>Pax<sp>as<sp>" + prolepticYear ) + "<sp>is<sp>a<sp>leap<sp>year" ) ) ; } return new org . threeten . extra . chrono . PaxDate ( prolepticYear , month , dayOfMonth ) ; }
org . junit . Assert . assertEquals ( java . time . LocalDate . of ( 2012 , 7 , 6 ) , test )
testSkip ( ) { org . apache . nifi . processors . evtx . parser . BinaryReader binaryReader = new org . apache . nifi . processors . evtx . parser . BinaryReader ( null ) ; binaryReader . skip ( 10 ) ; "<AssertPlaceHolder>" ; } getPosition ( ) { return position . get ( ) ; }
org . junit . Assert . assertEquals ( 10 , binaryReader . getPosition ( ) )
testCanDelete ( ) { this . policy = new com . taobao . metamorphosis . server . store . ArchiveDeletePolicy ( ) ; this . policy . setMaxReservedTime ( 1000L ) ; java . io . File file = org . easymock . classextension . EasyMock . createMock ( java . io . File . class ) ; org . easymock . classextension . EasyMock . expect ( file . lastModified ( ) ) . andReturn ( ( ( java . lang . System . currentTimeMillis ( ) ) - 2000 ) ) ; org . easymock . classextension . EasyMock . replay ( file ) ; "<AssertPlaceHolder>" ; org . easymock . classextension . EasyMock . verify ( file ) ; } canDelete ( java . io . File , long ) { return ( checkTimestamp - ( file . lastModified ( ) ) ) > ( this . maxReservedTime ) ; }
org . junit . Assert . assertTrue ( this . policy . canDelete ( file , java . lang . System . currentTimeMillis ( ) ) )
creatingGroupsFromEmptyEntryMaps ( ) { com . google . common . collect . ImmutableMultimap < java . nio . file . Path , java . lang . String > subgroups = com . google . common . collect . ImmutableMultimap . of ( ) ; com . google . common . collect . ImmutableMultimap < java . nio . file . Path , com . facebook . buck . apple . GroupedSource > entries = com . google . common . collect . ImmutableMultimap . of ( ) ; com . google . common . collect . ImmutableList < com . facebook . buck . apple . GroupedSource > expected = com . google . common . collect . ImmutableList . of ( ) ; com . facebook . buck . core . sourcepath . resolver . SourcePathResolver resolver = com . facebook . buck . core . sourcepath . resolver . impl . DefaultSourcePathResolver . from ( new com . facebook . buck . core . rules . SourcePathRuleFinder ( new com . facebook . buck . core . rules . resolver . impl . TestActionGraphBuilder ( ) ) ) ; com . google . common . collect . ImmutableList < com . facebook . buck . apple . GroupedSource > actual = com . facebook . buck . apple . RuleUtils . createGroupsFromEntryMaps ( subgroups , entries , new com . facebook . buck . apple . RuleUtils . GroupedSourceNameComparator ( resolver :: getRelativePath ) , java . nio . file . Paths . get ( "root" ) , java . nio . file . Paths . get ( "root" ) ) ; "<AssertPlaceHolder>" ; } get ( com . android . dx . rop . cst . Constant ) { if ( cst == null ) { throw new java . lang . NullPointerException ( "cst<sp>==<sp>null" ) ; } throwIfNotPrepared ( ) ; com . android . dx . dex . file . IndexedItem result = strings . get ( ( ( com . android . dx . rop . cst . CstString ) ( cst ) ) ) ; if ( result == null ) { throw new java . lang . IllegalArgumentException ( "not<sp>found" ) ; } return result ; }
org . junit . Assert . assertEquals ( expected , actual )
keepAliveEnabled ( ) { startServer ( ) ; io . grpc . netty . NettyClientTransport transport = newTransport ( newNegotiator ( ) , io . grpc . netty . DEFAULT_MAX_MESSAGE_SIZE , GrpcUtil . DEFAULT_MAX_HEADER_LIST_SIZE , null , true ) ; callMeMaybe ( transport . start ( clientTransportListener ) ) ; io . grpc . netty . NettyClientTransportTest . Rpc rpc = new io . grpc . netty . NettyClientTransportTest . Rpc ( transport ) . halfClose ( ) ; rpc . waitForResponse ( ) ; "<AssertPlaceHolder>" ; } keepAliveManager ( ) { return keepAliveManager ; }
org . junit . Assert . assertNotNull ( transport . keepAliveManager ( ) )
testWildcardRequest ( ) { try { final fr . gouv . vitam . common . database . builder . query . Query query = fr . gouv . vitam . common . database . builder . query . QueryHelper . wildcard ( "var" , "value" ) ; "<AssertPlaceHolder>" ; } catch ( final fr . gouv . vitam . common . database . builder . request . exception . InvalidCreateOperationException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } isReady ( ) { return ready ; }
org . junit . Assert . assertTrue ( query . isReady ( ) )
testDoPostInvalidFeed ( ) { java . util . List < java . util . Map < java . lang . String , java . lang . Object > > in = buildTestEvent ( "xxx" ) ; javax . ws . rs . core . Response resp = resource . doPost ( in , com . yahoo . druid . metriccollector . MetricCollectorResourceTest . TEST_CLUSTER ) ; "<AssertPlaceHolder>" ; } doPost ( java . util . List , java . lang . String ) { if ( com . google . common . base . Strings . isNullOrEmpty ( cluster ) ) { return javax . ws . rs . core . Response . status ( Response . Status . BAD_REQUEST ) . entity ( java . lang . String . format ( "request<sp>must<sp>have<sp>%s<sp>query<sp>param" , com . yahoo . druid . metriccollector . MetricCollectorResource . _CLUSTER ) ) . build ( ) ; } if ( ( events == null ) || ( events . isEmpty ( ) ) ) { return javax . ws . rs . core . Response . status ( Response . Status . BAD_REQUEST ) . entity ( "request<sp>must<sp>have<sp>one<sp>or<sp>more<sp>metric<sp>events" ) . build ( ) ; } final org . apache . kafka . clients . producer . Callback callback = new org . apache . kafka . clients . producer . Callback ( ) { @ com . yahoo . druid . metriccollector . Override public void onCompletion ( org . apache . kafka . clients . producer . RecordMetadata metadata , java . lang . Exception exception ) { if ( exception == null ) { eventLogger . countAsSent ( cluster ) ; } else { eventLogger . countAsLost ( cluster ) ; com . yahoo . druid . metriccollector . MetricCollectorResource . log . error ( exception , "Error<sp>to<sp>send<sp>kafka<sp>record<sp>from<sp>cluster<sp>[%s],<sp>error<sp>message<sp>[%s]<sp>" , cluster , exception . getMessage ( ) ) ; } } } ; for ( final java . util . Map < java . lang . String , java . lang . Object > event : events ) { java . lang . Object feedName = event . get ( com . yahoo . druid . metriccollector . MetricCollectorResource . METRIC_FEED_KEY ) ; if ( ( feedName == null ) || ( ! ( com . yahoo . druid . metriccollector . MetricCollectorResource . VALID_FEED_NAMES . contains ( feedName ) ) ) ) { return javax . ws . rs . core . Response . status ( Response . Status . BAD_REQUEST ) . entity ( "Each<sp>metric<sp>event<sp>must<sp>have<sp>a<sp>valid<sp>feed<sp>name" ) . build ( ) ; } event . put ( com . yahoo . druid . metriccollector . MetricCollectorResource . _CLUSTER , cluster ) ; final java . lang . String topic = ( ( kafkaTopicPrefix ) + "-" ) + feedName ; final java . lang . String eventString = jsonMapper . writeValueAsString ( event ) ; eventLogger . incrementEventSize ( cluster , eventString . getBytes ( ) . length ) ; final org . apache . kafka . clients . producer . ProducerRecord < java . lang . String , java . lang . String > record = new org . apache . kafka . clients . producer . ProducerRecord ( topic , null , eventString ) ; try { producer . send ( record , callback ) ; } catch ( java . lang . Exception exception ) { eventLogger . countAsLost ( cluster ) ; com . yahoo . druid . metriccollector . MetricCollectorResource . log . error ( exception , "Got<sp>Exception" ) ; return javax . ws . rs . core . Response . serverError ( ) . entity ( "Something<sp>went<sp>wrong<sp>in<sp>the<sp>POST<sp>request,<sp>emitter<sp>will<sp>retry<sp>!" ) . build ( ) ; } } return javax . ws . rs . core . Response . ok ( ) . build ( ) ; }
org . junit . Assert . assertEquals ( Response . Status . BAD_REQUEST . getStatusCode ( ) , resp . getStatus ( ) )
shouldUseExplicitSchemaName ( ) { final org . apache . kafka . connect . data . Schema schema = org . apache . kafka . connect . data . SchemaBuilder . struct ( ) . field ( "COLUMN_NAME" , Schema . OPTIONAL_INT64_SCHEMA ) . optional ( ) . build ( ) ; java . lang . String schemaFullName = "com.custom.schema" ; final io . confluent . ksql . serde . avro . AvroDataTranslator dataTranslator = new io . confluent . ksql . serde . avro . AvroDataTranslator ( schema , schemaFullName , true ) ; final io . confluent . ksql . GenericRow ksqlRow = new io . confluent . ksql . GenericRow ( java . util . Collections . singletonList ( 123L ) ) ; final org . apache . kafka . connect . data . Struct struct = dataTranslator . toConnectRow ( ksqlRow ) ; "<AssertPlaceHolder>" ; } schema ( ) { return schema ; }
org . junit . Assert . assertThat ( struct . schema ( ) . name ( ) , org . hamcrest . CoreMatchers . equalTo ( schemaFullName ) )
testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist ( ) { long pk1 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; long pk2 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; primaryKeys . add ( pk1 ) ; primaryKeys . add ( pk2 ) ; java . util . Map < java . io . Serializable , com . liferay . journal . model . JournalArticle > journalArticles = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( journalArticles . isEmpty ( ) )
testValidateFunctionNegative ( ) { net . objecthunter . exp4j . Expression exp = new net . objecthunter . exp4j . ExpressionBuilder ( "-sin(x)" ) . variable ( "x" ) . build ( ) ; net . objecthunter . exp4j . ValidationResult result = exp . validate ( false ) ; "<AssertPlaceHolder>" ; } isValid ( ) { return valid ; }
org . junit . Assert . assertTrue ( result . isValid ( ) )
simpleColumnMapping ( ) { java . util . Properties properties = new java . util . Properties ( ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; properties . setProperty ( AccumuloSerDeParameters . COLUMN_MAPPINGS , ":rowID,cf:f1,cf:f2,cf:f3" ) ; properties . setProperty ( serdeConstants . LIST_COLUMNS , "row,field1,field2,field3" ) ; serde . initialize ( conf , properties ) ; "<AssertPlaceHolder>" ; } getCachedRow ( ) { return cachedRow ; }
org . junit . Assert . assertNotNull ( serde . getCachedRow ( ) )
testGetEncodeGZipPropNotBoolean ( ) { java . util . Map < java . lang . String , java . lang . Object > properties = new java . util . HashMap ( ) ; properties . put ( org . eclipse . kura . core . cloud . CloudServiceOptionsTest . ENCODE_GZIP , "invalid" ) ; org . eclipse . kura . core . cloud . CloudServiceOptions options = new org . eclipse . kura . core . cloud . CloudServiceOptions ( properties , org . eclipse . kura . core . cloud . CloudServiceOptionsTest . systemService ) ; boolean gzip = options . getEncodeGzip ( ) ; "<AssertPlaceHolder>" ; } getEncodeGzip ( ) { boolean encodeGzip = false ; if ( ( ( this . properties ) != null ) && ( ( this . properties . get ( org . eclipse . kura . core . cloud . CloudServiceOptions . ENCODE_GZIP ) ) instanceof java . lang . Boolean ) ) { encodeGzip = ( ( java . lang . Boolean ) ( this . properties . get ( org . eclipse . kura . core . cloud . CloudServiceOptions . ENCODE_GZIP ) ) ) ; } return encodeGzip ; }
org . junit . Assert . assertFalse ( gzip )
shortenText_exactLength ( ) { java . lang . String shortenedText = org . oscm . string . Strings . shortenText ( "hello" , 5 ) ; "<AssertPlaceHolder>" ; } shortenText ( java . lang . String , int ) { if ( text == null ) { return null ; } java . lang . String trimmedText = text . trim ( ) ; if ( ( trimmedText . length ( ) ) > maxNumberOfChars ) { return ( trimmedText . substring ( 0 , ( maxNumberOfChars - 3 ) ) ) + "..." ; } return trimmedText ; }
org . junit . Assert . assertEquals ( "hello" , shortenedText )
testLambalClass ( ) { jetbrick . io . finder . AnnotationClassReader r = new jetbrick . io . finder . AnnotationClassReader ( ) ; r . addAnnotation ( javax . xml . bind . annotation . XmlRootElement . class ) ; java . io . InputStream is = jetbrick . io . finder . AnnotationClassReaderTest . class . getResourceAsStream ( "/jetbrick/files/Jdk8Lambda.class" ) ; "<AssertPlaceHolder>" ; } isAnnotationed ( java . io . File ) { try { return isAnnotationed ( new java . io . FileInputStream ( file ) , file . getName ( ) ) ; } catch ( java . io . FileNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } }
org . junit . Assert . assertTrue ( r . isAnnotationed ( is ) )
testShouldRetrieveNegativeDoubleValueWithLesserThanEqualsCondition ( ) { org . apache . hadoop . hbase . client . HBaseAdmin admin = org . apache . hadoop . hbase . index . coprocessor . regionserver . TestMultipleIndicesInScan . UTIL . getHBaseAdmin ( ) ; org . apache . hadoop . hbase . HBaseTestingUtility . getZooKeeperWatcher ( org . apache . hadoop . hbase . index . coprocessor . regionserver . TestMultipleIndicesInScan . UTIL ) ; org . apache . hadoop . conf . Configuration conf = org . apache . hadoop . hbase . index . coprocessor . regionserver . TestMultipleIndicesInScan . UTIL . getConfiguration ( ) ; java . lang . String userTableName = "testShouldRetrieveNegativeDoubleValueWithLesserThanEqualsCondition" ; org . apache . hadoop . hbase . index . IndexedHTableDescriptor ihtd = new org . apache . hadoop . hbase . index . IndexedHTableDescriptor ( userTableName ) ; org . apache . hadoop . hbase . HColumnDescriptor hcd = new org . apache . hadoop . hbase . HColumnDescriptor ( "cf1" ) ; ihtd . addFamily ( hcd ) ; org . apache . hadoop . hbase . index . IndexSpecification indexSpecification = createIndexSpecification ( hcd , ValueType . Double , 10 , new java . lang . String [ ] { "c1" } , "idx1" ) ; ihtd . addIndex ( indexSpecification ) ; admin . createTable ( ihtd ) ; org . apache . hadoop . hbase . client . HTable table = new org . apache . hadoop . hbase . client . HTable ( conf , userTableName ) ; rangePutForIdx2WithDouble ( table ) ; org . apache . hadoop . hbase . filter . FilterList masterFilter = new org . apache . hadoop . hbase . filter . FilterList ( org . apache . hadoop . hbase . filter . FilterList . Operator . MUST_PASS_ALL ) ; org . apache . hadoop . hbase . filter . SingleColumnValueFilter scvf = new org . apache . hadoop . hbase . filter . SingleColumnValueFilter ( "cf1" . getBytes ( ) , "c1" . getBytes ( ) , org . apache . hadoop . hbase . filter . CompareFilter . CompareOp . LESS_OR_EQUAL , new org . apache . hadoop . hbase . filter . DoubleComparator ( org . apache . hadoop . hbase . util . Bytes . toBytes ( ( - 5.3 ) ) ) ) ; masterFilter . addFilter ( scvf ) ; org . apache . hadoop . hbase . client . Scan scan = new org . apache . hadoop . hbase . client . Scan ( ) ; scan . setFilter ( masterFilter ) ; org . apache . hadoop . hbase . client . ResultScanner scanner = table . getScanner ( scan ) ; java . util . List < org . apache . hadoop . hbase . client . Result > testRes = new java . util . ArrayList < org . apache . hadoop . hbase . client . Result > ( ) ; org . apache . hadoop . hbase . client . Result [ ] result = scanner . next ( 1 ) ; while ( ( result != null ) && ( ( result . length ) > 0 ) ) { testRes . add ( result [ 0 ] ) ; result = scanner . next ( 1 ) ; } "<AssertPlaceHolder>" ; } size ( ) { if ( ( this . kvs ) == null ) { readFields ( ) ; } return ( this . kvs ) == null ? 0 : this . kvs . length ; }
org . junit . Assert . assertEquals ( testRes . size ( ) , 2 )
testUnknownRegionDefError ( ) { java . lang . String dir = getRandomDir ( ) ; java . lang . String g = ( "a()<sp>::=<sp><<\n" + ( ( "X<@r()>Y\n" + ">>\n" ) + "@a.q()<sp>::=<sp>\"foo\"" ) ) + ( newline ) ; org . stringtemplate . v4 . test . STErrorListener errors = new org . stringtemplate . v4 . misc . ErrorBuffer ( ) ; writeFile ( dir , "g.stg" , g ) ; org . stringtemplate . v4 . test . STGroupFile group = new org . stringtemplate . v4 . test . STGroupFile ( ( dir + "/g.stg" ) ) ; group . setListener ( errors ) ; org . stringtemplate . v4 . test . ST st = group . getInstanceOf ( "a" ) ; st . render ( ) ; java . lang . String result = errors . toString ( ) ; java . lang . String expecting = "g.stg<sp>4:3:<sp>template<sp>/a<sp>doesn't<sp>have<sp>a<sp>region<sp>called<sp>q" + ( newline ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( getClass ( ) . getSimpleName ( ) ) + "{" ) + "self=" ) + ( scope . st ) ) + ",<sp>start=" ) + ( outputStartChar ) ) + ",<sp>stop=" ) + ( outputStopChar ) ) + '}' ; }
org . junit . Assert . assertEquals ( expecting , result )
testOperator_lessThanNullNumber ( ) { java . lang . Number x = null ; java . lang . Number y = 123 ; boolean resutl = org . eclipse . smarthome . model . script . lib . NumberExtensions . operator_lessThan ( x , y ) ; "<AssertPlaceHolder>" ; } operator_lessThan ( java . lang . Number , java . lang . Number ) { java . math . BigDecimal leftValue = org . eclipse . smarthome . model . script . lib . NumberExtensions . numberToBigDecimal ( left ) ; java . math . BigDecimal rightValue = org . eclipse . smarthome . model . script . lib . NumberExtensions . numberToBigDecimal ( right ) ; if ( leftValue == null ) { return true ; } else if ( rightValue == null ) { return false ; } else { return ( leftValue . compareTo ( rightValue ) ) < 0 ; } }
org . junit . Assert . assertTrue ( resutl )
testFixedField ( ) { org . jivesoftware . smackx . FormField field = new org . jivesoftware . smackx . FormField ( "abc<sp>def" ) ; field . setType ( "fixed" ) ; field . addValue ( org . apache . vysper . console . HtmlFormBuilderTest . VALUE1 ) ; field . setLabel ( org . apache . vysper . console . HtmlFormBuilderTest . LABEL ) ; form . addField ( field ) ; java . lang . String actual = builder . build ( form ) ; java . lang . String expected = "<p>Some<sp>label<sp><span>Value<sp>1</span></p>" ; "<AssertPlaceHolder>" ; } build ( java . util . Map ) { org . jivesoftware . smackx . packet . AdHocCommandData commandData = new org . jivesoftware . smackx . packet . AdHocCommandData ( ) ; commandData . setSessionID ( getSingleValue ( parameters , AdminConsoleController . SESSION_FIELD ) ) ; org . jivesoftware . smackx . packet . DataForm form = new org . jivesoftware . smackx . packet . DataForm ( "submit" ) ; for ( java . util . Map . Entry < java . lang . String , java . lang . String [ ] > entry : parameters . entrySet ( ) ) { if ( ! ( AdminConsoleController . SESSION_FIELD . equals ( entry . getKey ( ) ) ) ) { org . jivesoftware . smackx . FormField field = new org . jivesoftware . smackx . FormField ( entry . getKey ( ) ) ; for ( java . lang . String value : entry . getValue ( ) ) { java . lang . String [ ] splitValues = value . split ( "[\\r\\n]+" ) ; for ( java . lang . String splitValue : splitValues ) { field . addValue ( splitValue ) ; } } form . addField ( field ) ; } } commandData . setForm ( form ) ; return commandData ; }
org . junit . Assert . assertEquals ( expected , actual )
allocatedEvaluatorStateHandlerTest ( ) { final org . apache . reef . webserver . ReefEventStateManager . AllocatedEvaluatorStateHandler h = this . injector . getInstance ( ReefEventStateManager . AllocatedEvaluatorStateHandler . class ) ; "<AssertPlaceHolder>" ; } getInstance ( java . lang . String ) { return getInstance ( newRmName , 0 , this . codec , this . errorHandler ) ; }
org . junit . Assert . assertNotNull ( h )
testDoNotStartEmbeddedH2Server ( ) { java . lang . Throwable exceptionResult = null ; java . util . Map myMap = new java . util . HashMap ( ) ; myMap . put ( "spring.datasource.url" , "jdbc:h2:tcp://localhost:19092/mem:dataflow" ) ; myMap . put ( "spring.dataflow.embedded.database.enabled" , "false" ) ; myMap . put ( "spring.jpa.database" , "H2" ) ; propertySources . addFirst ( new org . springframework . core . env . MapPropertySource ( "EnvironmentTestPropsource" , myMap ) ) ; context . setEnvironment ( environment ) ; try { context . refresh ( ) ; } catch ( org . springframework . beans . factory . BeanCreationException exception ) { exceptionResult = exception . getRootCause ( ) ; } "<AssertPlaceHolder>" ; throw exceptionResult ; } put ( java . lang . String , java . lang . String ) { this . deploymentProperties . put ( key , value . toString ( ) ) ; return this ; }
org . junit . Assert . assertNotNull ( exceptionResult )
testGetChildren_OnEmptyFileSystem ( ) { org . I0Itec . zkclient . InMemoryConnection connection = new org . I0Itec . zkclient . InMemoryConnection ( ) ; java . util . List < java . lang . String > children = connection . getChildren ( "/" , false ) ; "<AssertPlaceHolder>" ; } getChildren ( java . lang . String , boolean ) { try { return watch ? curator . getChildren ( ) . watched ( ) . forPath ( path ) : curator . getChildren ( ) . forPath ( path ) ; } catch ( java . lang . Exception e ) { adjustException ( e ) ; } return null ; }
org . junit . Assert . assertEquals ( 0 , children . size ( ) )
testIsOOXMLDocument2 ( ) { java . net . URL url = test . unit . be . fedict . eid . applet . service . signer . OOXMLSignatureVerifierTest . class . getResource ( "/signed-ooxml.docx" ) ; boolean result = be . fedict . eid . applet . service . signer . ooxml . OOXMLSignatureVerifier . isOOXML ( url ) ; "<AssertPlaceHolder>" ; } isOOXML ( java . net . URL ) { java . util . zip . ZipInputStream zipInputStream = new java . util . zip . ZipInputStream ( url . openStream ( ) ) ; java . util . zip . ZipEntry zipEntry ; while ( null != ( zipEntry = zipInputStream . getNextEntry ( ) ) ) { if ( false == ( "[Content_Types].xml" . equals ( zipEntry . getName ( ) ) ) ) { continue ; } return true ; } return false ; }
org . junit . Assert . assertTrue ( result )
create ( ) { org . syncope . client . to . ConfigurationTO configurationTO = new org . syncope . client . to . ConfigurationTO ( ) ; configurationTO . setKey ( "testKey" ) ; configurationTO . setValue ( "testValue" ) ; org . syncope . client . to . ConfigurationTO newConfigurationTO = restTemplate . postForObject ( ( ( BASE_URL ) + "configuration/create" ) , configurationTO , org . syncope . client . to . ConfigurationTO . class ) ; "<AssertPlaceHolder>" ; } setValue ( java . lang . String ) { this . value = value ; }
org . junit . Assert . assertEquals ( configurationTO , newConfigurationTO )
testEqualsEmptyObjects ( ) { entityVersion = new com . redhat . lightblue . EntityVersion ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final com . redhat . lightblue . query . Value other = ( ( com . redhat . lightblue . query . Value ) ( obj ) ) ; if ( ! ( java . util . Objects . equals ( this . value , other . value ) ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( entityVersion . equals ( new com . redhat . lightblue . EntityVersion ( ) ) )
testGetHostname ( ) { org . apache . tajo . master . cluster . ServerName server = new org . apache . tajo . master . cluster . ServerName ( "ex1.com" , 50030 ) ; "<AssertPlaceHolder>" ; } getHostname ( ) { return hostname ; }
org . junit . Assert . assertEquals ( "ex1.com" , server . getHostname ( ) )
testSearch_inrbilling_dt_billno ( ) { "<AssertPlaceHolder>" ; } search_inrbilling_dt_billno ( java . lang . Integer ) { java . lang . String sql = "from<sp>BillingInr<sp>b,<sp>Demographic<sp>d<sp>where<sp>d.DemographicNo=b.demographicNo<sp>and<sp>b.id=?<sp>and<sp>b.status<>'D'" ; javax . persistence . Query q = entityManager . createQuery ( sql ) ; q . setParameter ( 1 , billingInrNo ) ; java . util . List < java . lang . Object [ ] > results = q . getResultList ( ) ; return results ; }
org . junit . Assert . assertNotNull ( dao . search_inrbilling_dt_billno ( 1 ) )
testRunSqlite1 ( ) { sqlite . kripton58 . list . BindLongDataSource dataSource = sqlite . kripton58 . list . BindLongDataSource . getInstance ( ) ; dataSource . execute ( new sqlite . kripton58 . list . BindLongDataSource . Transaction ( ) { @ sqlite . kripton58 . list . Override public com . abubusoft . kripton . android . sqlite . TransactionResult onExecute ( sqlite . kripton58 . list . BindLongDaoFactory daoFactory ) { sqlite . kripton58 . list . LongDaoImpl dao = daoFactory . getLongDao ( ) ; java . util . ArrayList < java . lang . Long > value = new java . util . ArrayList < java . lang . Long > ( ) ; value . add ( 45L ) ; sqlite . kripton58 . list . LongBean bean = new sqlite . kripton58 . list . LongBean ( ) ; bean . value = value ; dao . insert ( bean ) ; java . util . List < sqlite . kripton58 . list . LongBean > result = dao . selectList ( value ) ; "<AssertPlaceHolder>" ; return com . abubusoft . kripton . android . sqlite . TransactionResult . COMMIT ; } } ) ; } size ( ) { return names . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( result . size ( ) ) == 1 ) )
testUpdate_workflow_run ( ) { logger . info ( "update_workflow_run" ) ; java . util . Date beforeDate = new java . sql . Timestamp ( java . lang . System . currentTimeMillis ( ) ) ; int workflowRunId = 32 ; java . lang . String pegasusCmd = "test<sp>pegasus<sp>cmd" ; java . lang . String workflowTemplate = "test<sp>template" ; io . seqware . common . model . WorkflowRunStatus status = io . seqware . common . model . WorkflowRunStatus . completed ; java . lang . String statusCmd = "test<sp>command" ; java . lang . String workingDirectory = "test<sp>working<sp>dir" ; java . lang . String dax = "update_tstmp" 0 ; java . lang . String ini = "test<sp>ini" ; java . lang . String host = "localhost" ; java . lang . String workflowEngine = "test<sp>engine" ; int expResult = 0 ; net . sourceforge . seqware . common . module . ReturnValue result = instance . update_workflow_run ( workflowRunId , pegasusCmd , workflowTemplate , status , statusCmd , workingDirectory , dax , ini , host , null , null , workflowEngine , null ) ; "<AssertPlaceHolder>" ; testTimestamp ( ( "select<sp>update_tstmp<sp>from<sp>workflow_run<sp>" + "update_tstmp" 1 ) , "update_tstmp" , beforeDate ) ; } getReturnValue ( ) { return returnValue ; }
org . junit . Assert . assertEquals ( expResult , result . getReturnValue ( ) )
shouldNotInjectIfUuidIsPresentInPayloadOnly ( ) { org . openqa . selenium . ImmutableCapabilities caps = new org . openqa . selenium . ImmutableCapabilities ( "browserName" , "firefox" , MARIONETTE , "cheese" , org . openqa . grid . internal . utils . configuration . GridNodeConfiguration . CONFIG_UUID_CAPABILITY , "123" ) ; org . openqa . selenium . Capabilities seen = new org . openqa . grid . selenium . node . FirefoxMutator ( defaultConfig ) . apply ( caps ) ; "<AssertPlaceHolder>" ; } getCapability ( java . lang . String ) { return caps . get ( capabilityName ) ; }
org . junit . Assert . assertEquals ( "cheese" , seen . getCapability ( org . openqa . grid . selenium . node . MARIONETTE ) )
paths_cyclophanelike2 ( ) { int [ ] [ ] g = org . openscience . cdk . graph . VertexShortCyclesTest . cyclophanelike2 ( ) ; org . openscience . cdk . graph . VertexShortCycles vsc = new org . openscience . cdk . graph . VertexShortCycles ( g ) ; int [ ] [ ] paths = vsc . paths ( ) ; int [ ] [ ] expected = new int [ ] [ ] { new int [ ] { 5 , 0 , 1 , 2 , 3 , 4 , 5 } , new int [ ] { 9 , 8 , 7 , 6 , 11 , 10 , 9 } , new int [ ] { 15 , 14 , 13 , 12 , 17 , 16 , 15 } , new int [ ] { 21 , 20 , 19 , 18 , 23 , 22 , 21 } } ; "<AssertPlaceHolder>" ; } paths ( ) { int [ ] [ ] paths = new int [ this . paths . size ( ) ] [ 0 ] ; for ( int i = 0 ; i < ( this . paths . size ( ) ) ; i ++ ) paths [ i ] = this . paths . get ( i ) ; return paths ; }
org . junit . Assert . assertThat ( paths , org . hamcrest . CoreMatchers . is ( expected ) )
whenRandomDices_0point1_returnsStrategy1 ( ) { com . graphhopper . jsprit . core . algorithm . SearchStrategyManager managerUnderTest = new com . graphhopper . jsprit . core . algorithm . SearchStrategyManager ( ) ; com . graphhopper . jsprit . core . algorithm . SearchStrategy mockedStrategy1 = mock ( com . graphhopper . jsprit . core . algorithm . SearchStrategy . class ) ; com . graphhopper . jsprit . core . algorithm . SearchStrategy mockedStrategy2 = mock ( com . graphhopper . jsprit . core . algorithm . SearchStrategy . class ) ; when ( mockedStrategy1 . getId ( ) ) . thenReturn ( "strat1" ) ; when ( mockedStrategy2 . getId ( ) ) . thenReturn ( "strat2" ) ; managerUnderTest . addStrategy ( mockedStrategy1 , 0.2 ) ; managerUnderTest . addStrategy ( mockedStrategy2 , 0.8 ) ; java . util . Random mockedRandom = mock ( java . util . Random . class ) ; managerUnderTest . setRandom ( mockedRandom ) ; stub ( mockedRandom . nextDouble ( ) ) . toReturn ( 0.1 ) ; "<AssertPlaceHolder>" ; } getRandomStrategy ( ) { if ( ( random ) == null ) throw new java . lang . IllegalStateException ( "randomizer<sp>is<sp>null.<sp>make<sp>sure<sp>you<sp>set<sp>random<sp>object<sp>correctly" ) ; double randomFig = random . nextDouble ( ) ; double sumProbabilities = 0.0 ; for ( int i = 0 ; i < ( weights . size ( ) ) ; i ++ ) { sumProbabilities += ( weights . get ( i ) ) / ( sumWeights ) ; if ( randomFig < sumProbabilities ) { return strategies . get ( i ) ; } } throw new java . lang . IllegalStateException ( "no<sp>search-strategy<sp>found" ) ; }
org . junit . Assert . assertThat ( managerUnderTest . getRandomStrategy ( ) , org . hamcrest . CoreMatchers . is ( mockedStrategy1 ) )
testStaticFinalMethodValid ( ) { "<AssertPlaceHolder>" ; goose . swim ( ) ; }
org . junit . Assert . assertNotNull ( goose )
testIsReadableDocument ( ) { org . powermock . api . mockito . PowerMockito . mockStatic ( org . silverpeas . core . sharing . model . EJBUtilitaire . class ) ; org . silverpeas . util . ForeignPK publicationPK = new org . silverpeas . util . ForeignPK ( "100" , "kmelia10" ) ; org . silverpeas . core . contribution . publication . control . PublicationService publicationService = org . powermock . api . mockito . PowerMockito . mock ( org . silverpeas . core . contribution . publication . control . PublicationService . class ) ; java . util . Collection < com . stratelia . webactiv . node . model . NodePK > fatherPks = new java . util . ArrayList < com . stratelia . webactiv . node . model . NodePK > ( java . util . Arrays . asList ( new com . stratelia . webactiv . node . model . NodePK ( "100" , "kmelia10" ) , new com . stratelia . webactiv . node . model . NodePK ( "110" , "12" 0 ) , new com . stratelia . webactiv . node . model . NodePK ( "12" 1 , "kmelia12" ) ) ) ; java . util . Collection < org . silverpeas . core . contribution . publication . model . Alias > aliasPks = new java . util . ArrayList < org . silverpeas . core . contribution . publication . model . Alias > ( fatherPks . size ( ) ) ; for ( com . stratelia . webactiv . node . model . NodePK nodePK : fatherPks ) { aliasPks . add ( new org . silverpeas . core . contribution . publication . model . Alias ( nodePK . getId ( ) , nodePK . getInstanceId ( ) ) ) ; } org . powermock . api . mockito . PowerMockito . when ( publicationService . getAllFatherPK ( new org . silverpeas . core . contribution . publication . model . PublicationPK ( "100" , "kmelia10" ) ) ) . thenReturn ( fatherPks ) ; org . powermock . api . mockito . PowerMockito . when ( publicationService . getAlias ( new org . silverpeas . core . contribution . publication . model . PublicationPK ( "100" , "kmelia10" ) ) ) . thenReturn ( aliasPks ) ; org . silverpeas . core . contribution . attachment . model . SimpleDocumentPK resourcePk = new org . silverpeas . core . contribution . attachment . model . SimpleDocumentPK ( "5" , "kmelia2" ) ; resourcePk . setOldSilverpeasId ( 5L ) ; org . silverpeas . core . contribution . attachment . model . HistorisedDocument document = new org . silverpeas . core . contribution . attachment . model . HistorisedDocument ( ) ; document . setPK ( resourcePk ) ; document . setForeignId ( publicationPK . getId ( ) ) ; final java . lang . String token = "965e985d-c711-47b3-a467-62779505965e985d-c711-47b3-a467-62779505" ; org . silverpeas . core . sharing . security . ShareableVersionDocument resource = new org . silverpeas . core . sharing . security . ShareableVersionDocument ( token , document ) ; org . powermock . api . mockito . PowerMockito . mockStatic ( org . silverpeas . core . sharing . services . SharingServiceProvider . class ) ; org . powermock . api . mockito . PowerMockito . when ( org . silverpeas . core . sharing . services . SharingServiceProvider . getSharingTicketService ( ) ) . thenReturn ( new com . silverpeas . sharing . mock . NodeSharingTicketService ( token , pk ) ) ; org . silverpeas . core . sharing . model . NodeAccessControl instance = new org . silverpeas . core . sharing . model . NodeAccessControl ( ) ; "<AssertPlaceHolder>" ; } isReadable ( org . silverpeas . core . sharing . security . ShareableResource ) { try { org . silverpeas . core . sharing . model . Ticket ticket = org . silverpeas . core . sharing . services . SharingServiceProvider . getSharingTicketService ( ) . getTicket ( resource . getToken ( ) ) ; return ( ! ( ( ticket == null ) || ( ! ( ticket . isValid ( ) ) ) ) ) && ( isReadable ( ( ( T ) ( ticket ) ) , resource . getAccessedObject ( ) ) ) ; } catch ( java . lang . Exception e ) { return false ; } }
org . junit . Assert . assertThat ( instance . isReadable ( resource ) , org . hamcrest . Matchers . is ( true ) )
enableOAuthForConsumer ( ) { com . t1t . apim . rest . KongConsumer consumer = new com . t1t . apim . rest . KongConsumer ( ) . withUsername ( "oauthconsumer1" ) ; consumer = com . t1t . apim . rest . KongClientIntegrationTest . kongClient . createConsumer ( consumer ) ; com . t1t . apim . rest . KongPluginOAuthConsumerResponse response = com . t1t . apim . rest . KongClientIntegrationTest . kongClient . enableOAuthForConsumer ( consumer . getId ( ) , "TestApplication" , "ABCCLIENTID" , "ABCCLIENTSECRET" , com . t1t . apim . rest . Collections . singleton ( "http://localhost:4000/" ) ) ; "<AssertPlaceHolder>" ; com . t1t . apim . rest . KongClientIntegrationTest . kongClient . deleteConsumer ( consumer . getId ( ) ) ; } getId ( ) { return id ; }
org . junit . Assert . assertTrue ( ( response != null ) )
testEncodePostgreSQLUpperCase ( ) { System . out . println ( ( ( com . telefonica . iot . cygnus . utils . CommonUtilsForTests . getTestTraceHead ( "[NGSICharsets.encodePostgreSQL]" ) ) + "--------<sp>Upper<sp>case<sp>not<sp>accented<sp>characters<sp>are<sp>encoded" ) ) ; java . lang . String in = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; java . lang . String expected = "x0041x0042x0043x0044x0045x0046x0047x0048x0049x004ax004bx004cx004dx004ex004f" + "x0050x0051x0052x0053x0054x0055x0056x0057x0058x0059x005a" ; java . lang . String out = com . telefonica . iot . cygnus . utils . NGSICharsets . encodePostgreSQL ( in ) ; try { "<AssertPlaceHolder>" ; System . out . println ( ( ( ( ( ( ( com . telefonica . iot . cygnus . utils . CommonUtilsForTests . getTestTraceHead ( "[NGSICharsets.encodePostgreSQL]" ) ) + "-<sp>OK<sp>-<sp>'" ) + in ) + "'<sp>has<sp>been<sp>encoded<sp>as<sp>'" ) + expected ) + "'" ) ) ; } catch ( java . lang . AssertionError e ) { System . out . println ( ( ( ( ( ( ( com . telefonica . iot . cygnus . utils . CommonUtilsForTests . getTestTraceHead ( "[NGSICharsets.encodePostgreSQL]" ) ) + "-<sp>FAIL<sp>-<sp>'" ) + in ) + "'<sp>has<sp>not<sp>been<sp>encoded<sp>as<sp>'" ) + expected ) + "'" ) ) ; throw e ; } encodePostgreSQL ( java . lang . String ) { java . lang . String out = "" ; for ( int i = 0 ; i < ( in . length ( ) ) ; i ++ ) { char c = in . charAt ( i ) ; int code = c ; if ( ( code >= 97 ) && ( code <= 119 ) ) { out += c ; } else if ( c == 'x' ) { java . lang . String next4 ; if ( ( i + 4 ) < ( in . length ( ) ) ) { next4 = in . substring ( ( i + 1 ) , ( i + 5 ) ) ; } else { next4 = "WXYZ" ; } if ( next4 . matches ( "^[0-9a-fA-F]{4}$" ) ) { out += "xx" ; } else { out += c ; } } else if ( ( code == 121 ) || ( code == 122 ) ) { out += c ; } else if ( ( code >= 48 ) && ( code <= 57 ) ) { out += c ; } else if ( c == '_' ) { out += c ; } else if ( c == '=' ) { out += "xffff" ; } else { java . lang . String hex = java . lang . Integer . toHexString ( code ) ; out += "x" + ( ( "0000" + hex ) . substring ( hex . length ( ) ) ) ; } } return out ; }
org . junit . Assert . assertEquals ( expected , out )
testWithDefaultWorkspaceName ( ) { org . apache . jackrabbit . oak . api . ContentRepository repo = new org . apache . jackrabbit . oak . Oak ( ) . with ( "test" ) . with ( new org . apache . jackrabbit . oak . spi . security . OpenSecurityProvider ( ) ) . createContentRepository ( ) ; java . lang . String [ ] valid = new java . lang . String [ ] { null , "test" } ; for ( java . lang . String wspName : valid ) { org . apache . jackrabbit . oak . api . ContentSession cs = null ; try { cs = repo . login ( null , wspName ) ; "<AssertPlaceHolder>" ; } finally { if ( cs != null ) { cs . close ( ) ; } } } java . lang . String [ ] invalid = new java . lang . String [ ] { "" , "another" , Oak . DEFAULT_WORKSPACE_NAME } ; for ( java . lang . String wspName : invalid ) { org . apache . jackrabbit . oak . api . ContentSession cs = null ; try { cs = repo . login ( null , wspName ) ; org . junit . Assert . fail ( "invalid<sp>workspace<sp>nam" ) ; } catch ( javax . jcr . NoSuchWorkspaceException e ) { } finally { if ( cs != null ) { cs . close ( ) ; } } } } getWorkspaceName ( ) { return workspaceName ; }
org . junit . Assert . assertEquals ( "test" , cs . getWorkspaceName ( ) )
search_selection ( ) { touch ( "a.csv" ) ; touch ( "b.csv" ) ; touch ( "c.csv" ) ; org . apache . hadoop . fs . FileSystem fs = getTempFileSystem ( ) ; java . util . List < org . apache . hadoop . fs . FileStatus > results = com . asakusafw . runtime . directio . hadoop . HadoopDataSourceUtil . search ( fs , getBase ( ) , com . asakusafw . runtime . directio . FilePattern . compile ( "{a|b}.csv" ) ) ; "<AssertPlaceHolder>" ; } normalize ( java . lang . String ) { assert url != null ; if ( url . endsWith ( "/" ) ) { return url ; } return url + "/" ; }
org . junit . Assert . assertThat ( normalize ( results ) , is ( path ( "a.csv" , "b.csv" ) ) )
testNewPDBMonomer ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . AbstractChemObjectBuilderTest . rootObject . getBuilder ( ) ; org . openscience . cdk . interfaces . IPDBMonomer monomer = builder . newInstance ( org . openscience . cdk . interfaces . IPDBMonomer . class ) ; "<AssertPlaceHolder>" ; } getBuilder ( ) { return org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ; }
org . junit . Assert . assertNotNull ( monomer )
testPreg_replace_3args_2 ( ) { logger . info ( "preg_replace" ) ; java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( "\\s+" ) ; java . lang . String replacement = "<sp>" ; java . lang . String subject = "a<sp>a" ; java . lang . String expResult = "a<sp>a" ; java . lang . String result = com . datumbox . framework . core . common . utilities . PHPMethods . preg_replace ( pattern , replacement , subject ) ; "<AssertPlaceHolder>" ; } preg_replace ( java . lang . String , java . lang . String , java . lang . String ) { java . util . regex . Pattern p = java . util . regex . Pattern . compile ( regex ) ; return com . datumbox . framework . core . common . utilities . PHPMethods . preg_replace ( p , replacement , subject ) ; }
org . junit . Assert . assertEquals ( expResult , result )
testHashCode ( ) { org . bff . javampd . MPDItem item1 = new org . bff . javampd . album . MPDAlbum ( "Album1" , "Artist1" ) ; org . bff . javampd . MPDItem item2 = new org . bff . javampd . album . MPDAlbum ( "Album1" , "Artist1" ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { int result = super . hashCode ( ) ; result = ( 31 * result ) + ( artistName . hashCode ( ) ) ; result = ( 31 * result ) + ( date . hashCode ( ) ) ; result = ( 31 * result ) + ( genre . hashCode ( ) ) ; return result ; }
org . junit . Assert . assertEquals ( item1 . hashCode ( ) , item2 . hashCode ( ) )
testCanNotValidateOutsideOfEdorg ( ) { org . slc . sli . domain . Entity sea = helper . generateEdorgWithParent ( null ) ; org . slc . sli . domain . Entity lea = helper . generateEdorgWithParent ( sea . getEntityId ( ) ) ; org . slc . sli . domain . Entity school2 = helper . generateEdorgWithParent ( null ) ; helper . generateStaffEdorg ( helper . STAFF_ID , lea . getEntityId ( ) , false ) ; org . slc . sli . domain . Entity sca = helper . generateStaffCohort ( "MOOP" , helper . generateCohort ( school2 . getEntityId ( ) ) . getEntityId ( ) , false , true ) ; cohortIds . add ( sca . getEntityId ( ) ) ; "<AssertPlaceHolder>" ; } validate ( java . lang . String , org . slc . sli . api . security . context . validator . Set ) { if ( ! ( areParametersValid ( EntityNames . STAFF , entityName , staffIds ) ) ) { return Collections . EMPTY_SET ; } org . slc . sli . api . security . context . validator . Set < java . lang . String > validIds = new org . slc . sli . api . security . context . validator . HashSet < java . lang . String > ( ) ; org . slc . sli . domain . NeutralQuery basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "staffReference" , org . slc . sli . domain . NeutralCriteria . CRITERIA_IN , staffIds ) ) ; basicQuery . setIncludeFields ( org . slc . sli . api . security . context . validator . Arrays . asList ( "educationOrganizationReference" , "staffReference" ) ) ; org . slc . sli . api . security . context . validator . TransitiveStaffToStaffValidator . LOG . info ( "Attempting<sp>to<sp>validate<sp>transitively<sp>from<sp>staff<sp>to<sp>staff<sp>with<sp>ids<sp>{}" , staffIds ) ; injectEndDateQuery ( basicQuery ) ; java . lang . Iterable < org . slc . sli . domain . Entity > edOrgAssoc = repo . findAll ( EntityNames . STAFF_ED_ORG_ASSOCIATION , basicQuery ) ; org . slc . sli . api . security . context . validator . Map < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > staffEdorgMap = new org . slc . sli . api . security . context . validator . HashMap < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > ( ) ; populateMapFromMongoResponse ( staffEdorgMap , edOrgAssoc ) ; org . slc . sli . api . security . context . validator . Set < java . lang . String > edOrgLineage = getStaffEdOrgLineage ( ) ; if ( ( edOrgLineage . isEmpty ( ) ) || ( staffEdorgMap . isEmpty ( ) ) ) { return Collections . EMPTY_SET ; } for ( java . util . Map . Entry < java . lang . String , org . slc . sli . api . security . context . validator . Set < java . lang . String > > entry : staffEdorgMap . entrySet ( ) ) { org . slc . sli . api . security . context . validator . Set < java . lang . String > tmpSet = new org . slc . sli . api . security . context . validator . HashSet < java . lang . String > ( entry . getValue ( ) ) ; tmpSet . retainAll ( edOrgLineage ) ; if ( ( tmpSet . size ( ) ) != 0 ) { validIds . add ( entry . getKey ( ) ) ; } } validIds . addAll ( validateThrough ( EntityNames . STAFF_PROGRAM_ASSOCIATION , "programId" ) ) ; validIds . addAll ( validateThrough ( EntityNames . STAFF_COHORT_ASSOCIATION , "cohortId" ) ) ; basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "_id" , "in" , edOrgLineage ) ) ; java . lang . Iterable < org . slc . sli . domain . Entity > edorgs = repo . findAll ( EntityNames . EDUCATION_ORGANIZATION , basicQuery ) ; org . slc . sli . api . security . context . validator . List < java . lang . String > programs = new org . slc . sli . api . security . context . validator . ArrayList < java . lang . String > ( ) ; for ( org . slc . sli . domain . Entity e : edorgs ) { java . lang . Object value = e . getBody ( ) . get ( "programReference" ) ; if ( value != null ) { if ( org . slc . sli . api . security . context . validator . List . class . isAssignableFrom ( value . getClass ( ) ) ) { programs . addAll ( ( ( org . slc . sli . api . security . context . validator . List < java . lang . String > ) ( value ) ) ) ; } else if ( java . lang . String . class . isAssignableFrom ( value . getClass ( ) ) ) { programs . add ( ( ( java . lang . String ) ( value ) ) ) ; } } } validIds . addAll ( getIds ( EntityNames . STAFF_PROGRAM_ASSOCIATION , "programId" , programs ) ) ; basicQuery = new org . slc . sli . domain . NeutralQuery ( new org . slc . sli . domain . NeutralCriteria ( "educationOrgId" , "in" , edOrgLineage ) ) ; org . slc . sli .
org . junit . Assert . assertFalse ( validator . validate ( EntityNames . STAFF_COHORT_ASSOCIATION , cohortIds ) . equals ( cohortIds ) )
testMustBlockCallBackRequestWhenActive ( ) { manager . activateServerPushFor ( org . eclipse . rap . rwt . internal . serverpush . ServerPushManager_Test . HANDLE_1 ) ; "<AssertPlaceHolder>" ; } mustBlockCallBackRequest ( ) { return ( isServerPushActive ( ) ) && ( ! ( hasRunnables ) ) ; }
org . junit . Assert . assertTrue ( manager . mustBlockCallBackRequest ( ) )
getValue_unknownErrorCode ( ) { final com . rapid7 . client . dcerpc . RPCException rpcException = new com . rapid7 . client . dcerpc . RPCException ( "test" , ( - 1 ) ) ; "<AssertPlaceHolder>" ; } getErrorCode ( ) { return errorCode ; }
org . junit . Assert . assertNull ( rpcException . getErrorCode ( ) )
testIsDispatchable ( ) { "<AssertPlaceHolder>" ; } isDispatchable ( ) { return dispatchable ; }
org . junit . Assert . assertTrue ( job . isDispatchable ( ) )
testOnException ( ) { java . util . concurrent . atomic . AtomicReference < org . slieb . throwables . java . lang . Throwable > reference = new java . util . concurrent . atomic . AtomicReference ( ) ; org . slieb . throwables . java . lang . Exception expected = new org . slieb . throwables . java . lang . Exception ( "expected" ) ; try { org . slieb . throwables . PredicateWithThrowable . castPredicateWithThrowable ( ( v1 ) -> { throw expected ; } ) . onException ( reference :: set ) . test ( null ) ; } catch ( java . lang . Throwable ignored ) { } "<AssertPlaceHolder>" ; } get ( ) { try { return getWithThrowable ( ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } }
org . junit . Assert . assertEquals ( expected , reference . get ( ) )
shouldChangeUserObject ( ) { java . lang . String userObject = "Hello<sp>World" ; entry . setUserObject ( userObject ) ; "<AssertPlaceHolder>" ; } getUserObject ( ) { return ( userObject ) == null ? null : userObject . get ( ) ; }
org . junit . Assert . assertThat ( entry . getUserObject ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( userObject ) ) )
testDeserialization ( ) { com . fasterxml . jackson . databind . ObjectMapper mapper = newMapper ( ) ; java . util . Map < java . time . LocalDate , java . lang . String > map = new java . util . HashMap ( ) ; map . put ( null , "test" ) ; java . util . Map < java . time . LocalDate , java . lang . String > value = mapper . readValue ( map ( Jsr310NullKeySerializer . NULL_KEY , "test" ) , com . fasterxml . jackson . datatype . jsr310 . TestNullKeySerialization . TYPE_REF ) ; "<AssertPlaceHolder>" ; } map ( java . lang . String , java . lang . String ) { return java . lang . String . format ( "{\"%s\":\"%s\"}" , key , value ) ; }
org . junit . Assert . assertEquals ( map , value )
testMultDimArray ( ) { net . sourceforge . pmd . lang . java . ast . ASTCompilationUnit cu = net . sourceforge . pmd . lang . java . ParserTstUtil . parseJava14 ( net . sourceforge . pmd . lang . java . ast . ASTLocalVariableDeclarationTest . TEST2 ) ; net . sourceforge . pmd . lang . java . ast . ASTLocalVariableDeclaration node = cu . findDescendantsOfType ( net . sourceforge . pmd . lang . java . ast . ASTLocalVariableDeclaration . class ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } getArrayDepth ( ) { return arrayDepth ; }
org . junit . Assert . assertEquals ( 2 , node . getArrayDepth ( ) )
datasetShouldNotBeDeaccessionedWithOneDraftVersion ( ) { java . util . List < edu . harvard . iq . dataverse . DatasetVersion > versionList = new java . util . ArrayList < edu . harvard . iq . dataverse . DatasetVersion > ( ) ; versionList . add ( this . draftVersion ) ; edu . harvard . iq . dataverse . Dataset dataset = new edu . harvard . iq . dataverse . Dataset ( ) ; dataset . setVersions ( versionList ) ; "<AssertPlaceHolder>" ; } isDeaccessioned ( ) { return versionState . equals ( edu . harvard . iq . dataverse . DatasetVersion . VersionState . DEACCESSIONED ) ; }
org . junit . Assert . assertFalse ( dataset . isDeaccessioned ( ) )
testOperator_lessThanNumberNull ( ) { java . lang . Number x = 12 ; java . lang . Number y = null ; boolean resutl = org . eclipse . smarthome . model . script . lib . NumberExtensions . operator_lessThan ( x , y ) ; "<AssertPlaceHolder>" ; } operator_lessThan ( java . lang . Number , java . lang . Number ) { java . math . BigDecimal leftValue = org . eclipse . smarthome . model . script . lib . NumberExtensions . numberToBigDecimal ( left ) ; java . math . BigDecimal rightValue = org . eclipse . smarthome . model . script . lib . NumberExtensions . numberToBigDecimal ( right ) ; if ( leftValue == null ) { return true ; } else if ( rightValue == null ) { return false ; } else { return ( leftValue . compareTo ( rightValue ) ) < 0 ; } }
org . junit . Assert . assertFalse ( resutl )
shouldListAllIndexRules ( ) { org . neo4j . kernel . impl . store . SchemaStorageTest . createSchema ( org . neo4j . kernel . impl . store . SchemaStorageTest . index ( org . neo4j . kernel . impl . store . SchemaStorageTest . LABEL1 , org . neo4j . kernel . impl . store . SchemaStorageTest . PROP1 ) , org . neo4j . kernel . impl . store . SchemaStorageTest . index ( org . neo4j . kernel . impl . store . SchemaStorageTest . LABEL1 , org . neo4j . kernel . impl . store . SchemaStorageTest . PROP2 ) , org . neo4j . kernel . impl . store . SchemaStorageTest . uniquenessConstraint ( org . neo4j . kernel . impl . store . SchemaStorageTest . LABEL2 , org . neo4j . kernel . impl . store . SchemaStorageTest . PROP1 ) ) ; java . util . Set < org . neo4j . storageengine . api . schema . StoreIndexDescriptor > listedRules = asSet ( org . neo4j . kernel . impl . store . SchemaStorageTest . storage . indexesGetAll ( ) ) ; java . util . Set < org . neo4j . storageengine . api . schema . StoreIndexDescriptor > expectedRules = new java . util . HashSet ( ) ; expectedRules . add ( makeIndexRule ( 0 , org . neo4j . kernel . impl . store . SchemaStorageTest . LABEL1 , org . neo4j . kernel . impl . store . SchemaStorageTest . PROP1 ) ) ; expectedRules . add ( makeIndexRule ( 1 , org . neo4j . kernel . impl . store . SchemaStorageTest . LABEL1 , org . neo4j . kernel . impl . store . SchemaStorageTest . PROP2 ) ) ; expectedRules . add ( makeIndexRuleForConstraint ( 2 , org . neo4j . kernel . impl . store . SchemaStorageTest . LABEL2 , org . neo4j . kernel . impl . store . SchemaStorageTest . PROP1 , 0L ) ) ; "<AssertPlaceHolder>" ; } makeIndexRuleForConstraint ( long , java . lang . String , java . lang . String , long ) { return uniqueForSchema ( forLabel ( org . neo4j . kernel . impl . store . SchemaStorageTest . labelId ( label ) , propId ( propertyKey ) ) , org . neo4j . kernel . impl . store . EMPTY . getProviderDescriptor ( ) ) . withIds ( ruleId , constraintId ) ; }
org . junit . Assert . assertEquals ( expectedRules , listedRules )
testFindByNaturalId ( ) { insertAnnotatedEntities ( 1 ) ; org . hibernate . Session session = sf . openSession ( ) ; com . hazelcast . hibernate . entity . AnnotatedEntity toBeUpdated = ( ( com . hazelcast . hibernate . entity . AnnotatedEntity ) ( session . byNaturalId ( com . hazelcast . hibernate . entity . AnnotatedEntity . class ) . using ( "title" , "dummy:0" ) . getReference ( ) ) ) ; "<AssertPlaceHolder>" ; session . close ( ) ; } getTitle ( ) { return title ; }
org . junit . Assert . assertEquals ( "dummy:0" , toBeUpdated . getTitle ( ) )
testGetNumberOfInlinksZero ( ) { int inlinks = fetchPage ( "Unconnected_page" ) . getNumberOfInlinks ( ) ; "<AssertPlaceHolder>" ; } getNumberOfInlinks ( ) { java . math . BigInteger nrOfInlinks = new java . math . BigInteger ( "0" ) ; long id = __getId ( ) ; org . hibernate . Session session = wiki . __getHibernateSession ( ) ; session . beginTransaction ( ) ; java . lang . Object returnValue = session . createNativeQuery ( "select<sp>count(pi.inLinks)<sp>from<sp>page_inlinks<sp>as<sp>pi<sp>where<sp>pi.id<sp>=<sp>:piid" ) . setParameter ( "piid" , id , LongType . INSTANCE ) . uniqueResult ( ) ; session . getTransaction ( ) . commit ( ) ; if ( returnValue != null ) { nrOfInlinks = ( ( java . math . BigInteger ) ( returnValue ) ) ; } return nrOfInlinks . intValue ( ) ; }
org . junit . Assert . assertEquals ( 0 , inlinks )
stressTest ( ) { final org . netbeans . lib . v8debug . connection . ServerConnection sn = new org . netbeans . lib . v8debug . connection . ServerConnection ( ) ; int port = sn . getPort ( ) ; org . netbeans . lib . v8debug . connection . ClientConnection cn = new org . netbeans . lib . v8debug . connection . ClientConnection ( null , port ) ; final org . netbeans . lib . v8debug . server . StressTest . StressTestListener listener = new org . netbeans . lib . v8debug . server . StressTest . StressTestListener ( sn , cn ) ; java . lang . Thread st = new java . lang . Thread ( ) { @ org . netbeans . lib . v8debug . server . Override public void run ( ) { try { sn . runConnectionLoop ( Collections . EMPTY_MAP , listener ) ; } catch ( java . io . IOException ex ) { java . util . logging . Logger . getLogger ( org . netbeans . lib . v8debug . server . V8ServerConnectionTest . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } } ; st . start ( ) ; try { java . lang . Thread . sleep ( 500 ) ; } catch ( java . lang . InterruptedException iex ) { } try { cn . runEventLoop ( listener ) ; } catch ( java . io . IOException ioex ) { ioex . printStackTrace ( ) ; } st . join ( ) ; "<AssertPlaceHolder>" ; sn . closeServer ( ) ; } success ( ) { return success ; }
org . junit . Assert . assertTrue ( listener . success ( ) )
testVoerStapUitZonderPersoon ( ) { final boolean stapResultaat = betrokkenheidBepaalMagLeverenStap . voerStapUit ( onderwerp , context , this . resultaat ) ; "<AssertPlaceHolder>" ; } voerStapUit ( nl . bzk . brp . model . basis . BrpObject , nl . bzk . brp . business . stappen . StappenContext , nl . bzk . brp . business . stappen . StappenResultaat ) { verwerkingsResultaat = new nl . bzk . brp . webservice . business . stappen . BerichtVerwerkingsResultaatImpl ( ) ; valideer ( onderwerp , verwerkingsResultaat ) ; return true ; }
org . junit . Assert . assertTrue ( stapResultaat )
getLabel_NullName ( ) { vMp1 . setName ( null ) ; java . lang . String label = umpb . getLabel ( vMp1 ) ; "<AssertPlaceHolder>" ; } getMarketplaceId ( ) { return marketplaceId ; }
org . junit . Assert . assertEquals ( vMp1 . getMarketplaceId ( ) , label )
testAddAccessConfig_Operation ( ) { com . google . cloud . compute . deprecated . NetworkInterface . AccessConfig accessConfig = com . google . cloud . compute . deprecated . NetworkInterface . AccessConfig . of ( "192.168.1.1" ) ; org . easymock . EasyMock . expect ( computeRpcMock . addAccessConfig ( com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID . getZone ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID . getInstance ( ) , "networkInterface" , accessConfig . toPb ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . EMPTY_RPC_OPTIONS ) ) . andReturn ( zoneOperation . toPb ( ) ) ; org . easymock . EasyMock . replay ( computeRpcMock ) ; compute = options . getService ( ) ; "<AssertPlaceHolder>" ; } addAccessConfig ( java . lang . String , com . google . cloud . compute . deprecated . NetworkInterface . AccessConfig , com . google . cloud . compute . deprecated . Compute . OperationOption [ ] ) { return compute . addAccessConfig ( getInstanceId ( ) , networkInterface , accessConfig , options ) ; }
org . junit . Assert . assertEquals ( zoneOperation , compute . addAccessConfig ( com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID , "networkInterface" , accessConfig ) )
testSingleView ( ) { com . streamsets . pipeline . stage . origin . jdbc . table . TableConfigBean tableConfigBean = new com . streamsets . pipeline . stage . origin . jdbc . table . TableJdbcSourceTestBuilder . TableConfigBeanTestBuilder ( ) . tablePattern ( "CRICKET_STARS_VIEW" ) . schema ( database ) . overrideDefaultOffsetColumns ( true ) . offsetColumns ( com . google . common . collect . ImmutableList . of ( "P_ID" ) ) . build ( ) ; com . streamsets . pipeline . stage . origin . jdbc . table . TableJdbcSource tableJdbcSource = new com . streamsets . pipeline . stage . origin . jdbc . table . TableJdbcSourceTestBuilder ( JDBC_URL , true , USER_NAME , PASSWORD ) . tableConfigBeans ( com . google . common . collect . ImmutableList . of ( tableConfigBean ) ) . build ( ) ; java . util . Map < java . lang . String , java . lang . String > offsets = new java . util . HashMap ( ) ; java . util . List < com . streamsets . pipeline . api . Record > records = runProduceSingleBatchAndGetRecords ( tableJdbcSource , offsets , 1000 ) ; "<AssertPlaceHolder>" ; checkRecords ( com . streamsets . pipeline . stage . origin . jdbc . table . BasicIT . EXPECTED_CRICKET_STARS_RECORDS , records ) ; } size ( ) { return delegate . size ( ) ; }
org . junit . Assert . assertEquals ( 10 , records . size ( ) )
testOTAIFrameFile ( ) { final java . lang . String appIdSuffix = com . sap . prd . mobile . ios . mios . StraightForwardLibAndAppTest . extractAppIdSuffixFromLogFile ( new java . io . File ( com . sap . prd . mobile . ios . mios . StraightForwardLibAndAppTest . appVerifier . getBasedir ( ) , com . sap . prd . mobile . ios . mios . StraightForwardLibAndAppTest . appVerifier . getLogFileName ( ) ) ) ; java . io . File otaHtmlFileActualRelease = new java . io . File ( com . sap . prd . mobile . ios . mios . StraightForwardLibAndAppTest . remoteRepositoryDirectory , ( ( com . sap . prd . mobile . ios . mios . StraightForwardLibAndAppTest . myAppArtifactFilePrefix ) + "-Release-iphoneos-ota.htm" ) ) ; "<AssertPlaceHolder>" ; final java . lang . String otaFileNameSuffix = ( appIdSuffix == null ) ? "-iphoneos-ota.htm" : ( "-" + appIdSuffix ) + "-iphoneos-ota.htm" ; com . sap . prd . mobile . ios . mios . StraightForwardLibAndAppTest . compareFilesContainingDynamicVersions ( com . sap . prd . mobile . ios . mios . StraightForwardLibAndAppTest . dynamicVersion , new java . io . File ( ( "src/test/resources/MyApp-Release-1.0.0" + otaFileNameSuffix ) ) , otaHtmlFileActualRelease ) ; }
org . junit . Assert . assertTrue ( otaHtmlFileActualRelease . exists ( ) )
testZeroReal ( ) { org . apache . commons . math3 . complex . Complex c = new org . apache . commons . math3 . complex . Complex ( 0.0 , ( - 1.4343 ) ) ; java . lang . String expected = ( "0<sp>-<sp>1" + ( getDecimalCharacter ( ) ) ) + "43i" ; java . lang . String actual = complexFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( java . lang . Object [ ] ) { return format . format ( arguments ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testTwoByteKey ( ) { final byte [ ] klvBytes = new byte [ ] { - 14 , 99 , 3 , - 1 , 0 , 1 } ; final byte [ ] value = getValueBytes ( KeyLength . TwoBytes , LengthEncoding . OneByte , klvBytes ) ; "<AssertPlaceHolder>" ; } getValueBytes ( org . codice . ddf . libs . klv . KeyLength , org . codice . ddf . libs . klv . LengthEncoding , byte [ ] ) { final byte [ ] key = java . util . Arrays . copyOf ( encodedBytes , keyLength . value ( ) ) ; final org . codice . ddf . libs . klv . data . raw . KlvBytes dataElement = new org . codice . ddf . libs . klv . data . raw . KlvBytes ( key , "test" ) ; final org . codice . ddf . libs . klv . KlvContext decodedKlvContext = decodeKLV ( keyLength , lengthEncoding , dataElement , encodedBytes ) ; return ( ( org . codice . ddf . libs . klv . data . raw . KlvBytes ) ( decodedKlvContext . getDataElementByName ( "test" ) ) ) . getValue ( ) ; }
org . junit . Assert . assertThat ( value , org . hamcrest . CoreMatchers . is ( new byte [ ] { - 1 , 0 , 1 } ) )
test_CompositionWithSource ( ) { java . util . ArrayList < java . lang . Double > input = new java . util . ArrayList < java . lang . Double > ( java . util . Arrays . asList ( 88.0 , 754.8 , 0.0 , 123456.2 ) ) ; java . util . ArrayList < java . lang . Integer > expectedResults = new java . util . ArrayList < java . lang . Integer > ( java . util . Arrays . asList ( 4 , 5 , 3 , 8 ) ) ; org . geolatte . common . transformer . TransformerSource < java . lang . Double > initialSource = new org . geolatte . common . transformer . DummyTransformerSource < java . lang . Double > ( input ) ; org . geolatte . common . transformer . OpenTransformerChain < java . lang . Integer > chain = org . geolatte . common . transformer . TransformerChainFactory . < java . lang . Double , java . lang . Integer > newChain ( ) . add ( initialSource ) . add ( numberTransformer ) . add ( capitalizeTransformer ) . last ( countTransformer ) ; int count = 0 ; for ( java . lang . Integer i : chain ) { "<AssertPlaceHolder>" ; count ++ ; } } last ( org . geolatte . common . transformer . Transformation ) { transformationChain . chain . add ( transformation ) ; return ( ( org . geolatte . common . transformer . Transformation < Source , Target > ) ( transformationChain ) ) ; }
org . junit . Assert . assertEquals ( expectedResults . get ( count ) , i )
testWithEmptyGraphWithVertices ( ) { org . apache . flink . graph . library . clustering . directed . TriadicCensus . Result expectedResult = new org . apache . flink . graph . library . clustering . directed . TriadicCensus . Result ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ) ; org . apache . flink . graph . library . clustering . directed . TriadicCensus . Result triadCensus = new org . apache . flink . graph . library . clustering . directed . TriadicCensus < org . apache . flink . types . LongValue , org . apache . flink . types . NullValue , org . apache . flink . types . NullValue > ( ) . run ( emptyGraphWithVertices ) . execute ( ) ; "<AssertPlaceHolder>" ; } execute ( ) { return execute ( org . apache . flink . streaming . api . environment . StreamExecutionEnvironment . DEFAULT_JOB_NAME ) ; }
org . junit . Assert . assertEquals ( expectedResult , triadCensus )
medianOfThreeSamplesIsMiddleSample ( ) { impl . addSample ( 42 ) ; impl . addSample ( 41 ) ; impl . addSample ( 43 ) ; "<AssertPlaceHolder>" ; } getPercentile ( int ) { return getPercentile ( requestedPercentile , new java . util . ArrayList < java . lang . Double > ( cslm . values ( ) ) ) ; }
org . junit . Assert . assertEquals ( 42 , impl . getPercentile ( 50 ) )
testResolveBean ( ) { org . camunda . bpm . engine . runtime . ProcessInstance processInstance = runtimeService . startProcessInstanceByKey ( "testRetry" ) ; org . camunda . bpm . engine . runtime . JobQuery query = managementService . createJobQuery ( ) . processInstanceId ( processInstance . getId ( ) ) ; org . camunda . bpm . engine . runtime . Job job = query . singleResult ( ) ; try { managementService . executeJob ( job . getId ( ) ) ; } catch ( java . lang . Exception e ) { } job = query . singleResult ( ) ; "<AssertPlaceHolder>" ; } getRetries ( ) { return retries ; }
org . junit . Assert . assertEquals ( 6 , job . getRetries ( ) )
test ( ) { org . fastcatsearch . ir . search . clause . MultiTermOperatedClause multiTermOperatedClause = new org . fastcatsearch . ir . search . clause . MultiTermOperatedClause ( ) ; int queryPosition = 0 ; int weight = 1 ; org . fastcatsearch . ir . search . PostingDoc [ ] data = createData ( new int [ ] { 1 , 2 , 3 , 4 , 7 , 8 } ) ; org . fastcatsearch . ir . search . PostingReader reader = new org . fastcatsearch . ir . search . DataPostingReader ( new org . fastcatsearch . ir . io . CharVector ( "abc" ) , ( queryPosition ++ ) , weight , data , data . length , 10 ) ; "<AssertPlaceHolder>" ; multiTermOperatedClause . addTerm ( reader ) ; data = createData ( new int [ ] { 2 , 3 , 7 , 10 , 11 } ) ; reader = new org . fastcatsearch . ir . search . DataPostingReader ( new org . fastcatsearch . ir . io . CharVector ( "123" ) , ( queryPosition ++ ) , weight , data , data . length , 10 ) ; multiTermOperatedClause . addTerm ( reader ) ; data = createData ( new int [ ] { 1 , 2 , 3 , 9 , 10 , 11 , 12 , 13 } ) ; reader = new org . fastcatsearch . ir . search . DataPostingReader ( new org . fastcatsearch . ir . io . CharVector ( "qqq" ) , ( queryPosition ++ ) , weight , data , data . length , 10 ) ; multiTermOperatedClause . addTerm ( reader ) ; org . fastcatsearch . ir . query . RankInfo rankInfo = new org . fastcatsearch . ir . query . RankInfo ( ) ; while ( multiTermOperatedClause . next ( rankInfo ) ) { System . out . println ( rankInfo ) ; } } hasNext ( ) { try { while ( true ) { if ( ( currentReader ) == null ) { return false ; } if ( currentReader . hasNext ( ) ) { return true ; } else { currentReader . close ( ) ; nextReader ( ) ; } } } catch ( java . lang . Throwable e ) { close ( ) ; throw new org . fastcatsearch . ir . common . IRException ( e ) ; } }
org . junit . Assert . assertTrue ( reader . hasNext ( ) )
convertAnODTDocumentToDoc ( ) { java . io . File convertedDocument = converter . convert ( document , inFormat ( doc ) ) ; "<AssertPlaceHolder>" ; } exists ( ) { return ( getId ( ) ) != null ; }
org . junit . Assert . assertThat ( convertedDocument . exists ( ) , org . hamcrest . Matchers . is ( true ) )
testScriptFunction3 ( ) { com . bj58 . oceanus . core . shard . Script script = new com . bj58 . oceanus . core . shard . Script ( ) ; script . setExecute ( "mod($age)" ) ; com . bj58 . oceanus . core . shard . ScriptFunction function = new com . bj58 . oceanus . core . shard . ScriptFunction ( script ) ; int size = 256 ; java . util . Map parameters = new java . util . HashMap ( ) ; parameters . put ( "age" , 257 ) ; int result = function . execute ( size , parameters ) ; "<AssertPlaceHolder>" ; } execute ( int , java . util . Map ) { int count = 0 ; for ( java . util . Map . Entry < java . lang . String , java . lang . Object > parameter : parameters . entrySet ( ) ) { java . lang . Object objValue = parameter . getValue ( ) ; count += objValue . hashCode ( ) ; } return ( java . lang . Math . abs ( count ) ) % size ; }
org . junit . Assert . assertEquals ( 1 , result )
testBuildUnconditionalRequestAddsCacheControlNoCache ( ) { final org . apache . hc . core5 . http . HttpRequest result = impl . buildUnconditionalRequest ( request ) ; boolean ccNoCacheFound = false ; final java . util . Iterator < org . apache . hc . core5 . http . HeaderElement > it = org . apache . hc . core5 . http . message . MessageSupport . iterate ( result , HeaderConstants . CACHE_CONTROL ) ; while ( it . hasNext ( ) ) { final org . apache . hc . core5 . http . HeaderElement elt = it . next ( ) ; if ( "no-cache" . equals ( elt . getName ( ) ) ) { ccNoCacheFound = true ; } } "<AssertPlaceHolder>" ; } getName ( ) { return "MyBasic" ; }
org . junit . Assert . assertTrue ( ccNoCacheFound )
proceedFromDelegateMethodIntoMethodInheritedFromBaseClass ( ) { final mockit . DelegateInvocationProceedTest . ClassToBeMocked obj = new mockit . DelegateInvocationProceedTest . ClassToBeMocked ( ) ; new mockit . Expectations ( obj ) { { obj . baseMethod ( anyInt ) ; result = new mockit . Delegate ( ) { @ mockit . Mock int baseMethod ( mockit . Invocation inv , int i ) { return inv . proceed ( ( i + 1 ) ) ; } } ; } } ; "<AssertPlaceHolder>" ; } baseMethod ( int ) { return i + 1 ; }
org . junit . Assert . assertEquals ( 3 , obj . baseMethod ( 1 ) )
shouldMergeEmptyModel ( ) { victim . merge ( new ro . isdc . wro . model . WroModel ( ) ) ; "<AssertPlaceHolder>" ; } buildValidModel ( ) { factory = new ro . isdc . wro . model . factory . XmlModelFactory ( ) { @ ro . isdc . wro . model . Override protected java . io . InputStream getModelResourceAsStream ( ) { return getClass ( ) . getResourceAsStream ( "wro.xml" ) ; } } ; return factory . create ( ) ; }
org . junit . Assert . assertEquals ( buildValidModel ( ) , victim )
viewEmpty ( ) { stateMachine . execute ( org . jboss . hal . ballroom . form . VIEW , org . jboss . hal . ballroom . form . EMPTY ) ; "<AssertPlaceHolder>" ; } current ( ) { return current ; }
org . junit . Assert . assertEquals ( org . jboss . hal . ballroom . form . EMPTY , stateMachine . current ( ) )
validate_shouldPassIfStartDateIsNotInFuture ( ) { org . openmrs . Relationship relationship = new org . openmrs . Relationship ( 1 ) ; java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap ( ) ; org . springframework . validation . MapBindingResult errors = new org . springframework . validation . MapBindingResult ( map , org . openmrs . Relationship . class . getName ( ) ) ; java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . add ( Calendar . YEAR , ( - 1 ) ) ; java . util . Date lastYear = cal . getTime ( ) ; relationship . setStartDate ( lastYear ) ; new org . openmrs . validator . RelationshipValidator ( ) . validate ( relationship , errors ) ; "<AssertPlaceHolder>" ; } hasErrors ( ) { return erroneous ; }
org . junit . Assert . assertFalse ( errors . hasErrors ( ) )
testMixAddIntIntIntUnsigned ( ) { int expected = 293055231 ; int actual = de . nx42 . maps4cim . map . texture . data . Texture . mixAdd ( 6689211 , 286331153 , 34867 ) ; "<AssertPlaceHolder>" ; } mixAdd ( int , int , int ) { return ( ( ( ( ( texture1 & 255 ) + ( texture2 & 255 ) ) + ( texture3 & 255 ) ) | ( ( ( ( ( texture1 > > > 8 ) & 255 ) + ( ( texture2 > > > 8 ) & 255 ) ) + ( ( texture3 > > > 8 ) & 255 ) ) << 8 ) ) | ( ( ( ( ( texture1 > > > 16 ) & 255 ) + ( ( texture2 > > > 16 ) & 255 ) ) + ( ( texture3 > > > 16 ) & 255 ) ) << 16 ) ) | ( ( ( ( ( texture1 > > > 24 ) & 255 ) + ( ( texture2 > > > 24 ) & 255 ) ) + ( ( texture3 > > > 24 ) & 255 ) ) << 24 ) ; }
org . junit . Assert . assertEquals ( expected , actual )
checkResetAndRestoreConfiguration ( ) { com . orange . cepheus . cep . model . Configuration configuration = getBasicConf ( ) ; esperEventProcessor . setConfiguration ( configuration ) ; esperEventProcessor . reset ( ) ; "<AssertPlaceHolder>" ; esperEventProcessor . setConfiguration ( configuration ) ; esperEventProcessor . processEvent ( buildBasicEvent ( 5.0 ) ) ; verify ( eventSinkListener ) . update ( any ( ) , eq ( null ) , any ( com . espertech . esper . client . EPStatement . class ) , any ( com . espertech . esper . client . EPServiceProvider . class ) ) ; } getConfiguration ( ) { return configuration ; }
org . junit . Assert . assertNull ( esperEventProcessor . getConfiguration ( ) )
findUpstreamEntitlementForStackNoResults ( ) { java . lang . String stackingId = "test_stack_id" ; org . candlepin . model . Product product = org . candlepin . test . TestUtil . createProduct ( ) ; product . setAttribute ( Product . Attributes . STACKING_ID , stackingId ) ; productCurator . create ( product ) ; org . candlepin . model . Entitlement result = entitlementCurator . findUpstreamEntitlementForStack ( consumer , stackingId ) ; "<AssertPlaceHolder>" ; } findUpstreamEntitlementForStack ( org . candlepin . model . Consumer , java . lang . String ) { java . util . Date currentDate = new java . util . Date ( ) ; org . hibernate . Criteria activeNowQuery = currentSession ( ) . createCriteria ( org . candlepin . model . Entitlement . class ) . add ( org . hibernate . criterion . Restrictions . eq ( "consumer" , consumer ) ) . createAlias ( "pool" , "ent_pool" ) . createAlias ( "attrs.indices" 2 , "product" ) . createAlias ( "product.attributes" , "attrs" ) . add ( org . hibernate . criterion . Restrictions . le ( "ent_pool.startDate" , currentDate ) ) . add ( org . hibernate . criterion . Restrictions . ge ( "attrs.indices" 0 , currentDate ) ) . add ( org . hibernate . criterion . Restrictions . eq ( "attrs.indices" , Product . Attributes . STACKING_ID ) ) . add ( org . hibernate . criterion . Restrictions . eq ( "attrs.elements" , stackId ) . ignoreCase ( ) ) . add ( org . hibernate . criterion . Restrictions . isNull ( "attrs.indices" 5 ) ) . createAlias ( "attrs.indices" 1 , "attrs.indices" 3 ) . add ( org . hibernate . criterion . Restrictions . isNotNull ( "sourceSub.id" ) ) . addOrder ( org . hibernate . criterion . Order . asc ( "attrs.indices" 4 ) ) . setMaxResults ( 1 ) ; return ( ( org . candlepin . model . Entitlement ) ( activeNowQuery . uniqueResult ( ) ) ) ; }
org . junit . Assert . assertNull ( result )
testGetItemDocument ( ) { org . wikidata . wdtk . datamodel . implementation . ItemDocument o1 = new org . wikidata . wdtk . datamodel . implementation . ItemDocumentImpl ( factory . getItemIdValue ( "Q42" , "foo" ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , 0 ) ; org . wikidata . wdtk . datamodel . implementation . ItemDocument o2 = factory . getItemDocument ( factory . getItemIdValue ( "Q42" , "foo" ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyMap ( ) , 0 ) ; "<AssertPlaceHolder>" ; } getItemIdValue ( java . lang . String , java . lang . String ) { return new org . wikidata . wdtk . datamodel . implementation . ItemIdValueImpl ( id , siteIri ) ; }
org . junit . Assert . assertEquals ( o1 , o2 )
testHalfStuff ( ) { if ( ! ( org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . getClass ( ) . getSimpleName ( ) . toLowerCase ( ) . contains ( "cuda" ) ) ) return ; lombok . val dtype = org . nd4j . linalg . factory . Nd4j . dataType ( ) ; org . nd4j . linalg . factory . Nd4j . setDataType ( DataBuffer . Type . HALF ) ; lombok . val arr = org . nd4j . linalg . factory . Nd4j . ones ( 3 , 3 ) ; arr . addi ( 2.0F ) ; lombok . val exp = org . nd4j . linalg . factory . Nd4j . create ( 3 , 3 ) . assign ( 3.0F ) ; "<AssertPlaceHolder>" ; org . nd4j . linalg . factory . Nd4j . setDataType ( dtype ) ; } assign ( org . nd4j . linalg . api . buffer . DataBuffer ) { org . nd4j . linalg . jcublas . buffer . BaseCudaDataBuffer . allocator . memcpy ( this , data ) ; }
org . junit . Assert . assertEquals ( exp , arr )
enabledConfigOnly ( ) { input . setConfig ( new org . apache . hadoop . fs . Path ( "." ) ) ; input . init ( ) ; com . hotels . bdp . circustrain . metrics . conf . ValidatedGraphite validated = validator . validate ( input ) ; "<AssertPlaceHolder>" ; } isEnabled ( ) { return validated . isEnabled ( ) ; }
org . junit . Assert . assertThat ( validated . isEnabled ( ) , org . hamcrest . CoreMatchers . is ( false ) )
popEldestTransactionToRequest ( ) { com . iota . iri . network . TransactionRequester txReq = new com . iota . iri . network . TransactionRequester ( com . iota . iri . network . TransactionRequesterTest . tangle , com . iota . iri . network . TransactionRequesterTest . snapshotProvider ) ; com . iota . iri . model . Hash eldest = com . iota . iri . TransactionTestUtils . getRandomTransactionHash ( ) ; txReq . requestTransaction ( eldest , false ) ; txReq . requestTransaction ( com . iota . iri . TransactionTestUtils . getRandomTransactionHash ( ) , false ) ; txReq . requestTransaction ( com . iota . iri . TransactionTestUtils . getRandomTransactionHash ( ) , false ) ; txReq . requestTransaction ( com . iota . iri . TransactionTestUtils . getRandomTransactionHash ( ) , false ) ; txReq . popEldestTransactionToRequest ( ) ; "<AssertPlaceHolder>" ; } isTransactionRequested ( com . iota . iri . model . Hash , boolean ) { return ( milestoneRequest && ( milestoneTransactionsToRequest . contains ( transactionHash ) ) ) || ( ( ( ! milestoneRequest ) && ( milestoneTransactionsToRequest . contains ( transactionHash ) ) ) || ( transactionsToRequest . contains ( transactionHash ) ) ) ; }
org . junit . Assert . assertFalse ( txReq . isTransactionRequested ( eldest , false ) )
showLogs_withLogConfigEnabled ( ) { final io . fabric8 . maven . docker . config . LogConfiguration logConfig = new io . fabric8 . maven . docker . config . LogConfiguration . Builder ( ) . enabled ( true ) . build ( ) ; final io . fabric8 . maven . docker . config . RunImageConfiguration runConfig = new io . fabric8 . maven . docker . config . RunImageConfiguration . Builder ( ) . exposedPropertyKey ( "key" ) . log ( logConfig ) . build ( ) ; final io . fabric8 . maven . docker . config . ImageConfiguration imageConfig = new io . fabric8 . maven . docker . config . ImageConfiguration . Builder ( ) . name ( "name" ) . alias ( "alias" ) . runConfig ( runConfig ) . build ( ) ; final io . fabric8 . maven . docker . service . helper . StartContainerExecutor executor = new io . fabric8 . maven . docker . service . helper . StartContainerExecutor . Builder ( ) . imageConfig ( imageConfig ) . build ( ) ; final boolean actual = executor . showLogs ( ) ; "<AssertPlaceHolder>" ; } showLogs ( ) { if ( ( showLogs ) != null ) { if ( showLogs . equalsIgnoreCase ( "true" ) ) { return true ; } else if ( showLogs . equalsIgnoreCase ( "false" ) ) { return false ; } else { return io . fabric8 . maven . docker . config . ConfigHelper . matchesConfiguredImages ( showLogs , imageConfig ) ; } } io . fabric8 . maven . docker . config . RunImageConfiguration runConfig = imageConfig . getRunConfiguration ( ) ; if ( runConfig != null ) { io . fabric8 . maven . docker . config . LogConfiguration logConfig = runConfig . getLogConfiguration ( ) ; if ( logConfig != null ) { return logConfig . isActivated ( ) ; } else { return follow ; } } return false ; }
org . junit . Assert . assertTrue ( actual )
compareTo_with_buildNumber ( ) { com . vdurmont . semver4j . Semver v3 = new com . vdurmont . semver4j . Semver ( "1.24.1-rc3+903423.234" ) ; com . vdurmont . semver4j . Semver v4 = new com . vdurmont . semver4j . Semver ( "1.24.1-rc3+903423.235" ) ; "<AssertPlaceHolder>" ; } compareTo ( com . vdurmont . semver4j . Semver ) { if ( this . isGreaterThan ( version ) ) return 1 ; else if ( this . isLowerThan ( version ) ) return - 1 ; return 0 ; }
org . junit . Assert . assertEquals ( 0 , v3 . compareTo ( v4 ) )
testSameProxy ( ) { if ( ! ( com . github . jmkgreen . morphia . mapping . lazy . LazyFeatureDependencies . testDependencyFullFilled ( ) ) ) { return ; } com . github . jmkgreen . morphia . mapping . lazy . TestLazySingleReference . RootEntity root = new com . github . jmkgreen . morphia . mapping . lazy . TestLazySingleReference . RootEntity ( ) ; com . github . jmkgreen . morphia . mapping . lazy . TestLazySingleReference . ReferencedEntity reference = new com . github . jmkgreen . morphia . mapping . lazy . TestLazySingleReference . ReferencedEntity ( ) ; root . r = reference ; root . secondReference = reference ; reference . setFoo ( "bar" ) ; ds . save ( reference ) ; ds . save ( root ) ; root = ds . get ( root ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Class ) { com . github . jmkgreen . morphia . logging . MorphiaLoggerFactory . init ( ) ; return com . github . jmkgreen . morphia . logging . MorphiaLoggerFactory . loggerFactory . get ( c ) ; }
org . junit . Assert . assertSame ( root . r , root . secondReference )
testItemPKUpdate ( ) { com . foundationdb . server . test . it . keyupdate . KeyUpdateRow order = testStore . find ( new com . foundationdb . server . test . it . keyupdate . HKey ( vendorRT , 1L , customerRT , 12L , orderRT , 122L ) ) ; "<AssertPlaceHolder>" ; com . foundationdb . server . test . it . keyupdate . KeyUpdateRow originalItem = testStore . find ( new com . foundationdb . server . test . it . keyupdate . HKey ( vendorRT , 1L , customerRT , 12L , orderRT , 122L , itemRT , 1222L ) ) ; com . foundationdb . server . test . it . keyupdate . KeyUpdateRow updatedItem = updateRow ( originalItem , i_iid , 0L , order ) ; startMonitoringHKeyPropagation ( ) ; dbUpdate ( originalItem , updatedItem ) ; checkHKeyPropagation ( 0 , 0 ) ; checkDB ( ) ; startMonitoringHKeyPropagation ( ) ; dbUpdate ( updatedItem , originalItem ) ; checkHKeyPropagation ( 0 , 0 ) ; checkDB ( ) ; checkInitialState ( ) ; }
org . junit . Assert . assertNotNull ( order )