input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
test ( ) { java . time . LocalDate referenceDate = java . time . LocalDate . of ( 2010 , 8 , 1 ) ; double [ ] strike1 = new double [ ] { 5500 , 5600 , 5700 , 5800 , 5900 , 6000 , 6100 , 6200 , 6300 , 6400 } ; double [ ] firstSmile = new double [ ] { 0.277475758170766 , 0.269515340374296 , 0.261571882863362 , 0.253276716037966 , 0.246026095740043 , 0.238654656319249 , 0.23116183944298 , 0.223598439942633 , 0.216448858389314 , 0.209586497365038 } ; double [ ] secondSmile = new double [ ] { 0.278915422959662 , 0.271901489924065 , 0.265156150952273 , 0.258805052234575 , 0.252251857517556 , 0.246778487031158 , 0.240218126189617 , 0.23407389543181 , 0.228093463234625 , 0.222039563314172 } ; net . finmath . marketdata . model . volatilities . VolatilitySurface . QuotingConvention convention = net . finmath . marketdata . model . volatilities . VolatilitySurface . QuotingConvention . VOLATILITYLOGNORMAL ; double riskFreeRate = 0.05 ; net . finmath . marketdata . model . curves . CurveInterpolation . ExtrapolationMethod exMethod = net . finmath . marketdata . model . curves . CurveInterpolation . ExtrapolationMethod . CONSTANT ; net . finmath . marketdata . model . curves . CurveInterpolation . InterpolationMethod intMethod = net . finmath . marketdata . model . curves . CurveInterpolation . InterpolationMethod . LINEAR ; net . finmath . marketdata . model . curves . CurveInterpolation . InterpolationEntity intEntity = net . finmath . marketdata . model . curves . CurveInterpolation . InterpolationEntity . LOG_OF_VALUE ; net . finmath . marketdata . model . curves . DiscountCurve discountCurve = net . finmath . fouriermethod . calibration . HestonDaxCalibrationTest . getDiscountCurve ( "discountCurve" , referenceDate , riskFreeRate ) ; double initialValue = 6149.62 ; net . finmath . marketdata . model . curves . DiscountCurve equityForwardCurve = net . finmath . fouriermethod . products . smile . EuropeanOptionSmileByCarrMadan pricer = new net . finmath . fouriermethod . products . smile . EuropeanOptionSmileByCarrMadan ( maturity , strike1 ) ; net . finmath . fouriermethod . calibration . CalibratedModel problem = new net . finmath . fouriermethod . calibration . CalibratedModel ( surface , model , optimizerFactory , pricer , initialParameters , parameterStep ) ; System . out . println ( "Calibration<sp>started" ) ; long startMillis = java . lang . System . currentTimeMillis ( ) ; net . finmath . fouriermethod . calibration . CalibratedModel . OptimizationResult result = problem . getCalibration ( ) ; long endMillis = java . lang . System . currentTimeMillis ( ) ; double calculationTime = ( endMillis - startMillis ) / 1000.0 ; System . out . println ( ( ( "Calibration<sp>completed<sp>in:<sp>" + calculationTime ) + "<sp>seconds" ) ) ; System . out . println ( ( ( "The<sp>solver<sp>required<sp>" + ( result . getIterations ( ) ) ) + "<sp>iterations." ) ) ; System . out . println ( ( "<sp>iterations." 0 + ( result . getRootMeanSquaredError ( ) ) ) ) ; net . finmath . modelling . descriptor . HestonModelDescriptor hestonDescriptor = ( ( net . finmath . modelling . descriptor . HestonModelDescriptor ) ( result . getModel ( ) . getModelDescriptor ( ) ) ) ; System . out . println ( hestonDescriptor . getVolatility ( ) ) ; System . out . println ( hestonDescriptor . getTheta ( ) ) ; System . out . println ( hestonDescriptor . getKappa ( ) ) ; System . out . println ( hestonDescriptor . getXi ( ) ) ; System . out . println ( hestonDescriptor . getRho ( ) ) ; java . util . ArrayList < java . lang . String > errorsOverview = result . getCalibrationOutput ( ) ; for ( java . lang . String myString : errorsOverview ) { System . out . println ( myString ) ; } "<AssertPlaceHolder>" ; } getRootMeanSquaredError ( ) { return rootMeanSquaredError ; }
|
org . junit . Assert . assertEquals ( ( ( result . getRootMeanSquaredError ( ) ) < 1.0 ) , true )
|
passwordOptionalPresent ( ) { final io . trane . ndbc . Config c = io . trane . ndbc . Config . create ( dataSourceSupplierClass , host , port , user ) ; final java . lang . String password = "password" ; "<AssertPlaceHolder>" ; } password ( java . lang . String ) { return password ( java . util . Optional . of ( password ) ) ; }
|
org . junit . Assert . assertEquals ( java . util . Optional . of ( password ) , c . password ( java . util . Optional . of ( password ) ) . password ( ) )
|
adapter_supports_handler_returns_empty_output ( ) { when ( mockAdapter . execute ( any ( com . amazon . ask . dispatcher . request . handler . HandlerInput . class ) , any ( com . amazon . ask . dispatcher . request . handler . RequestHandler . class ) ) ) . thenReturn ( java . util . Optional . empty ( ) ) ; java . util . Optional < com . amazon . ask . model . Response > output = dispatcher . dispatch ( handlerInput ) ; "<AssertPlaceHolder>" ; } execute ( Input , java . lang . Object ) { return handlerType . cast ( handler ) . handle ( input ) ; }
|
org . junit . Assert . assertEquals ( output , java . util . Optional . empty ( ) )
|
createdMessage ( ) { expected . expect ( com . airhacks . rulz . jaxrsclient . AssertionError . class ) ; expected . expectMessage ( org . hamcrest . CoreMatchers . containsString ( "Internal<sp>Server<sp>Error<sp>500<sp>returned" ) ) ; expected . expectMessage ( org . hamcrest . CoreMatchers . containsString ( "created<sp>status<sp>(201)<sp>with<sp>location<sp>header" ) ) ; javax . ws . rs . core . Response response = this . tut . request ( ) . header ( "status" , 500 ) . get ( ) ; "<AssertPlaceHolder>" ; } created ( ) { final int statusCode = Response . Status . CREATED . getStatusCode ( ) ; return new org . hamcrest . CustomMatcher < javax . ws . rs . core . Response > ( ( ( "created<sp>status<sp>(" + statusCode ) + ")<sp>with<sp>location<sp>header" ) ) { @ com . airhacks . rulz . jaxrsclient . Override public boolean matches ( java . lang . Object o ) { if ( ! ( o instanceof javax . ws . rs . core . Response ) ) { return false ; } javax . ws . rs . core . Response response = ( ( javax . ws . rs . core . Response ) ( o ) ) ; if ( ( response . getStatus ( ) ) == statusCode ) { java . lang . String header = response . getHeaderString ( "Location" ) ; return header != null ; } else { return false ; } } @ com . airhacks . rulz . jaxrsclient . Override public void describeMismatch ( java . lang . Object item , org . hamcrest . Description description ) { javax . ws . rs . core . Response response = ( ( javax . ws . rs . core . Response ) ( item ) ) ; com . airhacks . rulz . jaxrsclient . HttpMatchers . provideDescription ( response , description ) ; } } ; }
|
org . junit . Assert . assertThat ( response , org . hamcrest . CoreMatchers . is ( com . airhacks . rulz . jaxrsclient . HttpMatchers . created ( ) ) )
|
testBatchSize ( ) { org . hibernate . search . FullTextSession s = org . hibernate . search . Search . getFullTextSession ( openSession ( ) ) ; org . hibernate . Transaction tx = s . beginTransaction ( ) ; final int loop = 14 ; s . doWork ( new org . hibernate . jdbc . Work ( ) { @ org . hibernate . search . test . session . Override public void execute ( java . sql . Connection connection ) throws java . sql . SQLException { for ( int i = 0 ; i < loop ; i ++ ) { java . sql . Statement statmt = connection . createStatement ( ) ; statmt . executeUpdate ( ( ( ( ( "insert<sp>into<sp>Domain(id,<sp>name)<sp>values(<sp>+<sp>" + ( i + 1 ) ) + ",<sp>'sponge" ) + i ) + "')" ) ) ; statmt . executeUpdate ( ( ( ( ( "insert<sp>into<sp>Email(id,<sp>title,<sp>body,<sp>header,<sp>domain_id)<sp>values(<sp>+<sp>" + ( i + 1 ) ) + ",<sp>'Bob<sp>Sponge',<sp>'Meet<sp>the<sp>guys<sp>who<sp>create<sp>the<sp>software',<sp>'nope',<sp>" ) + ( i + 1 ) ) + ")" ) ) ; statmt . close ( ) ; } } } ) ; tx . commit ( ) ; s . close ( ) ; s = org . hibernate . search . Search . getFullTextSession ( openSession ( ) ) ; tx = s . beginTransaction ( ) ; org . hibernate . ScrollableResults results = s . createCriteria ( org . hibernate . search . test . session . Email . class ) . scroll ( ScrollMode . FORWARD_ONLY ) ; int index = 0 ; while ( results . next ( ) ) { index ++ ; s . index ( results . get ( 0 ) ) ; if ( ( index % 5 ) == 0 ) { s . clear ( ) ; } } tx . commit ( ) ; s . clear ( ) ; tx = s . beginTransaction ( ) ; org . apache . lucene . queryparser . classic . QueryParser parser = new org . apache . lucene . queryparser . classic . QueryParser ( "id" , org . hibernate . search . testsupport . TestConstants . stopAnalyzer ) ; java . util . List result = s . createFullTextQuery ( parser . parse ( "body:create" ) ) . list ( ) ; "<AssertPlaceHolder>" ; for ( java . lang . Object object : result ) { s . delete ( object ) ; } tx . commit ( ) ; s . close ( ) ; } size ( ) { return size ; }
|
org . junit . Assert . assertEquals ( 14 , result . size ( ) )
|
testMBeanCreationFailsWithoutManagementInterface ( ) { final com . picocontainer . gems . jmx . DynamicMBeanFactory factory = new com . picocontainer . gems . jmx . mx4j . MX4JDynamicMBeanFactory ( ) ; final javax . management . MBeanInfo mBeanInfo = com . picocontainer . gems . jmx . testmodel . Person . createMBeanInfo ( ) ; final javax . management . DynamicMBean mBean = factory . create ( new com . picocontainer . testmodel . SimpleTouchable ( ) , null , mBeanInfo ) ; "<AssertPlaceHolder>" ; } create ( java . lang . Object , java . lang . Class , javax . management . MBeanInfo ) { try { if ( mBeanInfo == null ) { final java . lang . Class managementInterface = getManagementInterface ( componentInstance . getClass ( ) , management , null ) ; return new javax . management . StandardMBean ( componentInstance , managementInterface ) ; } else if ( mBeanInfo instanceof javax . management . modelmbean . ModelMBeanInfo ) { final javax . management . modelmbean . ModelMBean mBean = new javax . management . modelmbean . RequiredModelMBean ( ( ( javax . management . modelmbean . ModelMBeanInfo ) ( mBeanInfo ) ) ) ; try { mBean . setManagedResource ( componentInstance , "ObjectReference" ) ; } catch ( final javax . management . modelmbean . InvalidTargetObjectTypeException e ) { } catch ( final javax . management . InstanceNotFoundException e ) { } return mBean ; } else { final java . lang . Class < ? > managementInterface = getManagementInterface ( componentInstance . getClass ( ) , management , mBeanInfo ) ; return new com . picocontainer . gems . jmx . StandardNanoMBean ( componentInstance , managementInterface , mBeanInfo ) ; } } catch ( final java . lang . ClassNotFoundException e ) { throw new com . picocontainer . gems . jmx . JMXRegistrationException ( "Cannot<sp>load<sp>management<sp>interface<sp>for<sp>StandardMBean" , e ) ; } catch ( final javax . management . NotCompliantMBeanException e ) { throw new com . picocontainer . gems . jmx . JMXRegistrationException ( "Cannot<sp>create<sp>StandardMBean" , e ) ; } catch ( final javax . management . RuntimeOperationsException e ) { throw new com . picocontainer . gems . jmx . JMXRegistrationException ( "Cannot<sp>create<sp>ModelMBean" , e ) ; } catch ( final javax . management . MBeanException e ) { throw new com . picocontainer . gems . jmx . JMXRegistrationException ( "Cannot<sp>create<sp>ModelMBean" , e ) ; } }
|
org . junit . Assert . assertNotNull ( mBean )
|
testWithPredefinedMeasuringPoints ( ) { org . matsim . core . config . Config config = createTestConfig ( ) ; java . io . File f = new java . io . File ( ( ( this . utils . getInputDirectory ( ) ) + "measuringPoints.xml" ) ) ; if ( ! ( f . exists ( ) ) ) { org . matsim . contrib . accessibility . run . AccessibilityIntegrationTest . LOG . error ( "Facilities<sp>file<sp>with<sp>measuring<sp>points<sp>not<sp>found!<sp>testWithMeasuringPointsInFacilitiesFile<sp>could<sp>not<sp>be<sp>performed..." ) ; "<AssertPlaceHolder>" ; } org . matsim . api . core . v01 . Scenario measuringPointsSc = org . matsim . core . scenario . ScenarioUtils . createScenario ( org . matsim . core . config . ConfigUtils . createConfig ( ) ) ; new org . matsim . facilities . MatsimFacilitiesReader ( measuringPointsSc ) . readFile ( f . getAbsolutePath ( ) ) ; org . matsim . facilities . ActivityFacilities measuringPoints = ( ( org . matsim . facilities . ActivityFacilities ) ( org . matsim . contrib . accessibility . utils . AccessibilityUtils . collectActivityFacilitiesWithOptionOfType ( measuringPointsSc , null ) ) ) ; final org . matsim . contrib . accessibility . AccessibilityConfigGroup acg = org . matsim . core . config . ConfigUtils . addOrGetModule ( config , org . matsim . contrib . accessibility . AccessibilityConfigGroup . class ) ; acg . setTileSize_m ( 100 ) ; acg . setEnvelope ( new org . locationtech . jts . geom . Envelope ( 0 , 200 , 0 , 200 ) ) ; acg . setMeasuringPointsFacilities ( measuringPoints ) ; acg . setAreaOfAccessibilityComputation ( AreaOfAccesssibilityComputation . fromFacilitiesObject ) ; final org . matsim . api . core . v01 . Scenario sc = org . matsim . contrib . accessibility . run . AccessibilityIntegrationTest . createTestScenario ( config ) ; org . matsim . contrib . matrixbasedptrouter . MatrixBasedPtRouterConfigGroup mbConfig = org . matsim . core . config . ConfigUtils . addOrGetModule ( config , org . matsim . contrib . matrixbasedptrouter . MatrixBasedPtRouterConfigGroup . class ) ; final org . matsim . contrib . matrixbasedptrouter . PtMatrix ptMatrix = org . matsim . contrib . matrixbasedptrouter . PtMatrix . createPtMatrix ( config . plansCalcRoute ( ) , org . matsim . contrib . matrixbasedptrouter . utils . BoundingBox . createBoundingBox ( sc . getNetwork ( ) ) , mbConfig ) ; sc . addScenarioElement ( PtMatrix . NAME , ptMatrix ) ; org . matsim . core . controler . Controler controler = new org . matsim . core . controler . Controler ( sc ) ; final org . matsim . contrib . accessibility . AccessibilityModule module = new org . matsim . contrib . accessibility . AccessibilityModule ( ) ; final org . matsim . contrib . accessibility . run . AccessibilityIntegrationTest . ResultsComparator resultsComparator = new org . matsim . contrib . accessibility . run . AccessibilityIntegrationTest . ResultsComparator ( false ) ; module . addFacilityDataExchangeListener ( resultsComparator ) ; controler . addOverridingModule ( module ) ; controler . addOverridingModule ( new org . matsim . core . controler . AbstractModule ( ) { @ org . matsim . contrib . accessibility . run . Override public void install ( ) { bind ( org . matsim . contrib . matrixbasedptrouter . PtMatrix . class ) . toInstance ( ptMatrix ) ; } } ) ; controler . run ( ) ; } getInputDirectory ( ) { return this . inputDirectory ; }
|
org . junit . Assert . assertTrue ( f . exists ( ) )
|
testRemoveAttributeUnknownKey ( ) { java . lang . String key = "key_does_not_exist" ; store . removeAttribute ( key ) ; "<AssertPlaceHolder>" ; } getAttribute ( java . lang . String ) { org . eclipse . rap . rwt . internal . util . ParamCheck . notNull ( name , "name" ) ; return props . getProperty ( name ) ; }
|
org . junit . Assert . assertNull ( store . getAttribute ( key ) )
|
getOrElse_A$Integer ( ) { java . lang . Integer actual = com . m3 . scalaflavor4j . SInt . apply ( 123 ) . getOrElse ( 0 ) ; java . lang . Integer expected = 123 ; "<AssertPlaceHolder>" ; } getOrElse ( java . lang . Integer ) { if ( ( value ) == null ) { return defaultValue ; } else { return value ; } }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
testTezSysStagingPath ( ) { java . lang . String strAppId = "testAppId" ; org . apache . hadoop . fs . Path stageDir = org . apache . tez . common . TezCommonUtils . getTezSystemStagingPath ( org . apache . tez . common . TestTezCommonUtils . conf , strAppId ) ; java . lang . String expectedStageDir = ( ( ( ( org . apache . tez . common . TestTezCommonUtils . RESOLVED_STAGE_DIR ) + ( java . io . File . separatorChar ) ) + ( org . apache . tez . common . TezCommonUtils . TEZ_SYSTEM_SUB_DIR ) ) + ( java . io . File . separatorChar ) ) + strAppId ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( "vertexName=" + ( vertexName ) ) + ",<sp>vertexId=" ) + ( vertexID ) ) + ",<sp>initRequestedTime=" ) + ( initRequestedTime ) ) + ",<sp>initedTime=" ) + ( initedTime ) ) + ",<sp>numTasks=" ) + ( numTasks ) ) + ",<sp>processorName=" ) + ( processorName ) ) + ",<sp>additionalInputsCount=" ) + ( ( additionalInputs ) != null ? additionalInputs . size ( ) : 0 ) ; }
|
org . junit . Assert . assertEquals ( stageDir . toString ( ) , expectedStageDir )
|
testValuesSource ( ) { int [ ] [ ] targetVals = new int [ ] [ ] { new int [ ] { 2 , 1 } , new int [ ] { 4 , 3 } , new int [ ] { 5 , 6 } , new int [ ] { 7 , 8 } } ; runStatementOnDriver ( ( ( ( "insert<sp>into<sp>" + ( org . apache . hadoop . hive . ql . TestTxnCommands2 . Table . ACIDTBL ) ) + "<sp>" ) + ( org . apache . hadoop . hive . ql . TestTxnCommands2 . makeValuesClause ( targetVals ) ) ) ) ; java . lang . String query = ( ( ( ( "merge<sp>into<sp>" + ( org . apache . hadoop . hive . ql . TestTxnCommands2 . Table . ACIDTBL ) ) + "<sp>as<sp>t<sp>using<sp>(select<sp>*<sp>from<sp>(values<sp>(2,2),(4,44),(5,5),(11,11))<sp>as<sp>F(a,b))<sp>s<sp>ON<sp>t.a<sp>=<sp>s.a<sp>" ) + "WHEN<sp>MATCHED<sp>and<sp>s.a<sp><<sp>5<sp>THEN<sp>DELETE<sp>" ) + "WHEN<sp>MATCHED<sp>AND<sp>s.a<sp><<sp>3<sp>THEN<sp>update<sp>set<sp>b<sp>=<sp>0<sp>" ) + "WHEN<sp>NOT<sp>MATCHED<sp>THEN<sp>INSERT<sp>VALUES(s.a,<sp>s.b)<sp>" ; runStatementOnDriver ( query ) ; java . util . List < java . lang . String > r = runStatementOnDriver ( ( ( "select<sp>a,b<sp>from<sp>" + ( org . apache . hadoop . hive . ql . TestTxnCommands2 . Table . ACIDTBL ) ) + "<sp>order<sp>by<sp>a,b" ) ) ; int [ ] [ ] rExpected = new int [ ] [ ] { new int [ ] { 5 , 6 } , new int [ ] { 7 , 8 } , new int [ ] { 11 , 11 } } ; "<AssertPlaceHolder>" ; } stringifyValues ( int [ ] [ ] ) { assert ( rowsIn . length ) > 0 ; int [ ] [ ] rows = rowsIn . clone ( ) ; java . util . Arrays . sort ( rows , new org . apache . hadoop . hive . ql . TestTxnCommands2 . RowComp ( ) ) ; java . util . List < java . lang . String > rs = new java . util . ArrayList < java . lang . String > ( ) ; for ( int [ ] row : rows ) { assert ( row . length ) > 0 ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; for ( int value : row ) { sb . append ( value ) . append ( "\t" ) ; } sb . setLength ( ( ( sb . length ( ) ) - 1 ) ) ; rs . add ( sb . toString ( ) ) ; } return rs ; }
|
org . junit . Assert . assertEquals ( org . apache . hadoop . hive . ql . TestTxnCommands2 . stringifyValues ( rExpected ) , r )
|
givenExistingHashMap_whenFrom_thenCreateHashPMap ( ) { java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap ( ) ; map . put ( "mkey1" , "mval1" ) ; map . put ( "mkey2" , "mval2" ) ; org . pcollections . HashPMap < java . lang . String , java . lang . String > pmap2 = org . pcollections . HashTreePMap . from ( map ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
|
org . junit . Assert . assertEquals ( pmap2 . size ( ) , 2 )
|
removeIndexFrontRemovedTest ( ) { org . threadly . concurrent . collections . ConcurrentArrayList . DataSet < java . lang . Integer > result = org . threadly . concurrent . collections . ConcurrentArrayListDataSetTest . removedFromFront . remove ( 8 ) . remove ( 5 ) . remove ( 0 ) ; java . lang . Integer [ ] expectedResult = new java . lang . Integer [ ] { 2 , 3 , 4 , 5 , 7 , 8 } ; "<AssertPlaceHolder>" ; } makeDataSet ( java . lang . Object [ ] , int , int ) { return new org . threadly . concurrent . collections . ConcurrentArrayList . DataSet ( dataArray , startPosition , endPosition , 0 , 0 ) ; }
|
org . junit . Assert . assertTrue ( result . equals ( org . threadly . concurrent . collections . ConcurrentArrayListDataSetTest . makeDataSet ( expectedResult , 0 , expectedResult . length ) ) )
|
testRemoveContent ( ) { try ( org . silverpeas . core . persistence . jcr . JcrSession session = openSystemSession ( ) ) { org . silverpeas . core . contribution . attachment . model . SimpleAttachment attachment = createEnglishSimpleAttachment ( ) ; org . silverpeas . core . contribution . attachment . model . SimpleDocumentPK emptyId = new org . silverpeas . core . contribution . attachment . model . SimpleDocumentPK ( "-1" , org . silverpeas . core . contribution . attachment . repository . DocumentRepositoryIT . instanceId ) ; java . lang . String foreignId = "node18" ; org . silverpeas . core . contribution . attachment . model . SimpleDocument document = new org . silverpeas . core . contribution . attachment . model . SimpleDocument ( emptyId , foreignId , 10 , false , attachment ) ; java . io . InputStream content = new java . io . ByteArrayInputStream ( "This<sp>is<sp>a<sp>test" . getBytes ( Charsets . UTF_8 ) ) ; org . silverpeas . core . contribution . attachment . model . SimpleDocumentPK result = documentRepository . createDocument ( session , document ) ; documentRepository . storeContent ( document , content ) ; org . silverpeas . core . contribution . attachment . model . SimpleDocumentPK expResult = new org . silverpeas . core . contribution . attachment . model . SimpleDocumentPK ( result . getId ( ) , org . silverpeas . core . contribution . attachment . repository . DocumentRepositoryIT . instanceId ) ; "<AssertPlaceHolder>" ; content = new java . io . ByteArrayInputStream ( "Ceci<sp>est<sp>un<sp>test" . getBytes ( Charsets . UTF_8 ) ) ; attachment = createFrenchSimpleAttachment ( ) ; documentRepository . addContent ( session , result , attachment ) ; document . setLanguage ( attachment . getLanguage ( ) ) ; documentRepository . storeContent ( document , content ) ; session . save ( ) ; documentRepository . removeContent ( session , result , "fr" ) ; org . silverpeas . core . contribution . attachment . model . SimpleDocument doc = documentRepository . findDocumentById ( session , result , "fr" ) ; checkEnglishSimpleDocument ( doc ) ; doc = documentRepository . findDocumentById ( session , result , "en" ) ; checkEnglishSimpleDocument ( doc ) ; } } is ( T ) { return java . util . Objects . equals ( this . value , value ) ; }
|
org . junit . Assert . assertThat ( result , is ( expResult ) )
|
tooManyArgsForFuncParam ( ) { org . abs_models . frontend . ast . Model m = parse ( "apply(tooFew)(0);" , applyFunction ( ) , "def<sp>Int<sp>tooFew()<sp>=<sp>0;" ) ; m . expandPartialFunctions ( ) ; org . abs_models . frontend . analyser . SemanticConditionList conditions = m . typeCheck ( ) ; "<AssertPlaceHolder>" ; } containsErrors ( ) { return containsErrors ; }
|
org . junit . Assert . assertTrue ( conditions . containsErrors ( ) )
|
testSearchWithNoResults ( ) { viafService = mock ( com . codefork . refine . viaf . VIAFService . class ) ; java . net . HttpURLConnection conn = mock ( java . net . HttpURLConnection . class ) ; java . io . InputStream is = getClass ( ) . getResourceAsStream ( "/nonsense.xml" ) ; when ( viafService . doSearch ( anyString ( ) , anyInt ( ) ) ) . thenReturn ( conn ) ; when ( conn . getInputStream ( ) ) . thenReturn ( is ) ; config = mock ( com . codefork . refine . Config . class ) ; when ( config . getProperties ( ) ) . thenReturn ( new java . util . Properties ( ) ) ; viaf = new com . codefork . refine . viaf . VIAF ( viafService , config ) ; com . codefork . refine . SearchQuery query = new com . codefork . refine . SearchQuery ( "ncjecerence" , 3 , null , "should" ) ; java . util . List < com . codefork . refine . resources . Result > results = viaf . search ( query ) ; "<AssertPlaceHolder>" ; } search ( java . util . Map ) { java . util . Map < java . lang . String , com . codefork . refine . resources . SearchResponse > allResults = new java . util . HashMap < java . lang . String , com . codefork . refine . resources . SearchResponse > ( ) ; java . util . Map < java . lang . String , com . codefork . refine . SearchResult > results = doSearchInThreadPool ( queryEntries ) ; for ( Map . Entry < java . lang . String , com . codefork . refine . SearchResult > queryEntry : results . entrySet ( ) ) { com . codefork . refine . SearchResult searchResult = queryEntry . getValue ( ) ; if ( ! ( searchResult . isSuccessful ( ) ) ) { if ( SearchResult . ErrorType . TOO_MANY_REQUESTS . equals ( searchResult . getErrorType ( ) ) ) { threadPool . shrink ( ) ; } } } java . util . Map < java . lang . String , com . codefork . refine . SearchQuery > secondTries = new java . util . HashMap < java . lang . String , com . codefork . refine . SearchQuery > ( ) ; for ( Map . Entry < java . lang . String , com . codefork . refine . SearchQuery > queryEntry : queryEntries . entrySet ( ) ) { java . lang . String indexKey = queryEntry . getKey ( ) ; if ( ! ( results . containsKey ( indexKey ) ) ) { com . codefork . refine . SearchQuery searchQuery = queryEntry . getValue ( ) ; log . info ( ( "Submitting<sp>second<sp>try<sp>for<sp>query:<sp>" + ( searchQuery . getQuery ( ) ) ) ) ; secondTries . put ( indexKey , searchQuery ) ; } } if ( ( secondTries . size ( ) ) > 0 ) { try { java . lang . Thread . sleep ( 1500 ) ; } catch ( java . lang . InterruptedException e ) { log . error ( "sleep<sp>interrupted<sp>before<sp>doing<sp>second<sp>tries" ) ; } java . util . Map < java . lang . String , com . codefork . refine . SearchResult > resultsFromSecondTries = doSearchInThreadPool ( secondTries ) ; results . putAll ( resultsFromSecondTries ) ; } for ( Map . Entry < java . lang . String , com . codefork . refine . SearchResult > queryEntry : results . entrySet ( ) ) { java . lang . String indexKey = queryEntry . getKey ( ) ; com . codefork . refine . SearchResult searchResult = queryEntry . getValue ( ) ; if ( searchResult . isSuccessful ( ) ) { allResults . put ( indexKey , new com . codefork . refine . resources . SearchResponse ( searchResult . getResults ( ) ) ) ; } else { allResults . put ( indexKey , new com . codefork . refine . resources . SearchResponse ( new java . util . ArrayList < com . codefork . refine . resources . Result > ( ) ) ) ; } } return allResults ; }
|
org . junit . Assert . assertEquals ( 0 , results . size ( ) )
|
shouldReturnTrueWhenShouldOverrideTranslation ( ) { java . lang . String key = "key" ; java . util . Locale locale = new java . util . Locale ( "pl" ) ; org . springframework . test . util . ReflectionTestUtils . setField ( translationServiceOverrideUtil , "useCustomTranslations" , true ) ; given ( pluginStateResolver . isEnabled ( CustomTranslationContants . PLUGIN_IDENTIFIER ) ) . willReturn ( true ) ; given ( customTranslationResolver . isCustomTranslationActive ( key , locale ) ) . willReturn ( true ) ; boolean result = translationServiceOverrideUtil . shouldOverrideTranslation ( key , locale ) ; "<AssertPlaceHolder>" ; } shouldOverrideTranslation ( java . lang . String , java . util . Locale ) { return ( ( useCustomTranslations ) && ( pluginStateResolver . isEnabled ( CustomTranslationContants . PLUGIN_IDENTIFIER ) ) ) && ( customTranslationResolver . isCustomTranslationActive ( key , locale ) ) ; }
|
org . junit . Assert . assertTrue ( result )
|
testCreateWithErrors ( ) { try { org . hl7 . fhir . instance . model . AdverseReaction adverseReaction = new org . hl7 . fhir . instance . model . AdverseReaction ( ) ; adverseReaction . setDateSimple ( new org . hl7 . fhir . instance . model . DateAndTime ( "2013-01-10" ) ) ; org . hl7 . fhir . instance . model . AtomEntry < org . hl7 . fhir . instance . model . OperationOutcome > result = null ; try { result = testClient . create ( org . hl7 . fhir . instance . model . AdverseReaction . class , adverseReaction ) ; } catch ( org . hl7 . fhir . instance . client . EFhirClientException e ) { "<AssertPlaceHolder>" ; e . printStackTrace ( ) ; } if ( ( ( result . getResource ( ) ) != null ) && ( ( result . getResource ( ) . getIssue ( ) . size ( ) ) == 0 ) ) { org . junit . Assert . fail ( ) ; } } catch ( java . text . ParseException e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ) ; } } getServerErrors ( ) { return errors ; }
|
org . junit . Assert . assertEquals ( 1 , e . getServerErrors ( ) . size ( ) )
|
testLispToCamelNull ( ) { try { com . twelvemonkeys . lang . StringUtil . lispToCamel ( null ) ; org . junit . Assert . fail ( "should<sp>not<sp>accept<sp>null" ) ; } catch ( java . lang . IllegalArgumentException iae ) { "<AssertPlaceHolder>" ; } } lispToCamel ( java . lang . String ) { return com . twelvemonkeys . lang . StringUtil . lispToCamel ( pString , false ) ; }
|
org . junit . Assert . assertNotNull ( iae . getMessage ( ) )
|
testParameter2 ( ) { testcase . function . Person1 p = new testcase . function . Person1 ( ) ; p . setId ( 1L ) ; com . jd . dd . glowworm . util . Parameters parameters = new com . jd . dd . glowworm . util . Parameters ( ) ; parameters . setNeedWriteClassName ( false ) ; byte [ ] bytes = com . jd . dd . glowworm . PB . toPBBytes ( p , parameters ) ; testcase . function . Person1 result = com . jd . dd . glowworm . PB . parsePBBytes ( bytes , testcase . function . Person1 . class ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( "1" , result . getId ( ) . toString ( ) )
|
testPortletProviderGradleTemplates ( ) { if ( ! ( com . liferay . blade . sample . test . functional . utils . BladeSampleFunctionalActionUtil . getPortalVersion ( ) . equals ( "7.0" ) ) ) { _projectPath = com . liferay . blade . samples . integration . test . utils . BladeCLIUtil . createProject ( _testDir , "portlet-provider" , "pphelloworld" , "-v" , "7.1" ) ; } else { _projectPath = com . liferay . blade . samples . integration . test . utils . BladeCLIUtil . createProject ( _testDir , "portlet-provider" , "pphelloworld" ) ; } org . gradle . testkit . runner . BuildTask buildtask = com . liferay . blade . samples . integration . test . utils . GradleRunnerUtil . executeGradleRunner ( _projectPath , "build" ) ; com . liferay . blade . samples . integration . test . utils . GradleRunnerUtil . verifyGradleRunnerOutput ( buildtask ) ; java . io . File buildOutput = new java . io . File ( ( ( _projectPath ) + "/build/libs/pphelloworld-1.0.0.jar" ) ) ; "<AssertPlaceHolder>" ; java . lang . String bundleID = com . liferay . blade . samples . integration . test . utils . BladeCLIUtil . installBundle ( buildOutput ) ; com . liferay . blade . samples . integration . test . utils . BladeCLIUtil . startBundle ( bundleID ) ; com . liferay . blade . samples . integration . test . utils . BladeCLIUtil . uninstallBundle ( bundleID ) ; } verifyGradleRunnerOutput ( org . gradle . testkit . runner . BuildTask ) { org . junit . Assert . assertNotNull ( buildtask ) ; org . junit . Assert . assertEquals ( TaskOutcome . SUCCESS , buildtask . getOutcome ( ) ) ; }
|
org . junit . Assert . assertTrue ( buildOutput . exists ( ) )
|
testEncodeDecode ( ) { com . kuxhausen . huemore . state . BulbState [ ] states = new com . kuxhausen . huemore . state . BulbState [ 10 ] ; for ( int i = 0 ; i < ( states . length ) ; i ++ ) { states [ i ] = new com . kuxhausen . huemore . state . BulbState ( ) ; } states [ 0 ] . setOn ( true ) ; states [ 1 ] . set255Bri ( 44 ) ; states [ 2 ] . setTransitionTime ( 33 ) ; states [ 3 ] . setMiredCT ( 321 ) ; states [ 4 ] . setXY ( new float [ ] { 0.5F , 0.5F } ) ; states [ 5 ] . setEffect ( BulbState . Effect . NONE ) ; states [ 6 ] . setEffect ( BulbState . Effect . COLORLOOP ) ; states [ 7 ] . setAlert ( BulbState . Alert . NONE ) ; states [ 8 ] . setAlert ( BulbState . Alert . FLASH_ONCE ) ; states [ 8 ] . setAlert ( BulbState . Alert . FLASH_30SEC ) ; states [ 9 ] . setOn ( false ) ; states [ 9 ] . set255Bri ( 0 ) ; states [ 9 ] . setTransitionTime ( 0 ) ; states [ 9 ] . setMiredCT ( 400 ) ; states [ 9 ] . setXY ( new float [ ] { 0.1F , 0.9F } ) ; states [ 9 ] . setEffect ( BulbState . Effect . NONE ) ; states [ 9 ] . setAlert ( BulbState . Alert . NONE ) ; try { for ( int i = 0 ; i < ( states . length ) ; i ++ ) { com . kuxhausen . huemore . state . Mood m = new com . kuxhausen . huemore . state . Mood . Builder ( states [ i ] ) . build ( ) ; java . lang . String encodedM = com . kuxhausen . huemore . persistence . HueUrlEncoder . encode ( m ) ; com . kuxhausen . huemore . state . Mood decodedM = com . kuxhausen . huemore . persistence . HueUrlEncoder . decode ( encodedM ) . second . first ; "<AssertPlaceHolder>" ; } } catch ( com . kuxhausen . huemore . persistence . InvalidEncodingException e ) { org . junit . Assert . fail ( ) ; } catch ( com . kuxhausen . huemore . persistence . FutureEncodingException e ) { org . junit . Assert . fail ( ) ; } } decode ( java . lang . String ) { try { com . kuxhausen . huemore . state . Mood . Builder moodBuilder = new com . kuxhausen . huemore . state . Mood . Builder ( ) ; int numChannels = 0 ; java . util . ArrayList < java . lang . Integer > bList = new java . util . ArrayList < java . lang . Integer > ( ) ; java . lang . Integer brightness = null ; com . kuxhausen . huemore . persistence . ManagedBitSet mBitSet = new com . kuxhausen . huemore . persistence . ManagedBitSet ( code ) ; int encodingVersion = mBitSet . extractNumber ( 3 ) ; boolean hasBulbs = mBitSet . incrementingGet ( ) ; if ( hasBulbs ) { for ( int i = 0 ; i < 50 ; i ++ ) { if ( mBitSet . incrementingGet ( ) ) { bList . add ( ( i + 1 ) ) ; } } } if ( ( ( ( encodingVersion == 1 ) || ( encodingVersion == 2 ) ) || ( encodingVersion == 3 ) ) || ( encodingVersion == 4 ) ) { boolean hasBrightness = false ; if ( encodingVersion >= 3 ) { hasBrightness = mBitSet . incrementingGet ( ) ; if ( hasBrightness ) { brightness = mBitSet . extractNumber ( 8 ) ; } } numChannels = mBitSet . extractNumber ( 6 ) ; moodBuilder . setNumChannels ( numChannels ) ; boolean isRelativeToMidnight = mBitSet . incrementingGet ( ) ; int numLoops = mBitSet . extractNumber ( 7 ) ; boolean isLooping = numLoops == 127 ; int numTimestamps = mBitSet . extractNumber ( 6 ) ; int [ ] timeArray = new int [ numTimestamps ] ; for ( int i = 0 ; i < numTimestamps ; i ++ ) { timeArray [ i ] = mBitSet . extractNumber ( 20 ) ; } boolean usesTiming = ! ( ( ( timeArray . length ) == 0 ) || ( ( ( timeArray . length ) == 1 ) && ( ( timeArray [ 0 ] ) == 0 ) ) ) ; if ( usesTiming && isRelativeToMidnight ) { moodBuilder . setTimingPolicy ( Mood . TimingPolicy . DAILY ) ; } else if ( usesTiming && isLooping ) { moodBuilder . setTimingPolicy ( Mood . TimingPolicy . LOOPING ) ; } else { moodBuilder . setTimingPolicy ( Mood . TimingPolicy . BASIC ) ; } moodBuilder . setUsesTiming ( usesTiming ) ; int numStates ; if ( encodingVersion >= 4 ) { numStates = mBitSet . extractNumber ( 12 ) ; } else { numStates = mBitSet . extractNumber ( 6 ) ; } com . kuxhausen . huemore . state . BulbState [ ] stateArray = new com . kuxhausen . huemore . state . BulbState [ numStates ] ; for ( int i = 0 ; i < numStates ; i ++ ) { stateArray [ i ] = com . kuxhausen . huemore . persistence . HueUrlEncoder . extractState ( mBitSet ) ; if ( encodingVersion < 3 ) { if ( ( stateArray [ i ] . get255Bri ( ) ) != null ) { brightness = stateArray [ i ] . get255Bri ( ) ;
|
org . junit . Assert . assertEquals ( m , decodedM )
|
testSerialization ( ) { org . jfree . chart . ChartRenderingInfo i1 = new org . jfree . chart . ChartRenderingInfo ( ) ; i1 . setChartArea ( new java . awt . geom . Rectangle2D . Double ( 1.0 , 2.0 , 3.0 , 4.0 ) ) ; org . jfree . chart . ChartRenderingInfo i2 = ( ( org . jfree . chart . ChartRenderingInfo ) ( org . jfree . chart . TestUtilities . serialised ( i1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( i1 , i2 )
|
test_plusDays_noChange ( ) { java . time . LocalDateTime t = TEST_2007_07_15_12_30_40_987654321 . plusDays ( 0 ) ; "<AssertPlaceHolder>" ; } plusDays ( long ) { if ( daysToAdd == 0 ) { return this ; } return java . time . Period . create ( years , months , java . lang . Math . toIntExact ( java . lang . Math . addExact ( days , daysToAdd ) ) ) ; }
|
org . junit . Assert . assertSame ( t , TEST_2007_07_15_12_30_40_987654321 )
|
testPropertyUpdatable ( ) { java . lang . String newValue = "new<sp>value" ; _standardProperties . setProperty ( org . dcache . util . configuration . ConfigurationPropertiesTests . SIMPLE_PROPERTY_NAME , newValue ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return name . equals ( "arguments" ) ? arguments : null ; }
|
org . junit . Assert . assertEquals ( newValue , _standardProperties . getProperty ( org . dcache . util . configuration . ConfigurationPropertiesTests . SIMPLE_PROPERTY_NAME ) )
|
getArrayFirstStringFromArray ( ) { org . spincast . core . json . JsonArray array2 = getJsonManager ( ) . createArray ( ) ; array2 . add ( "toto" ) ; array2 . add ( "titi" ) ; org . spincast . core . json . JsonArray array = getJsonManager ( ) . createArray ( ) ; array . add ( "nope" ) ; array . add ( array2 ) ; java . lang . String arrayFirst = array . getArrayFirstString ( 1 ) ; "<AssertPlaceHolder>" ; } getArrayFirstString ( java . lang . String ) { return getArrayFirstString ( key , true , false , null ) ; }
|
org . junit . Assert . assertEquals ( "toto" , arrayFirst )
|
testTraceDownload ( ) { org . eclipse . tracecompass . internal . tmf . ui . project . wizards . importtrace . TraceDownloadStatus status = org . eclipse . tracecompass . internal . tmf . ui . project . wizards . importtrace . DownloadTraceHttpHelper . downloadTrace ( org . eclipse . tracecompass . tmf . ui . tests . actions . DownloadTraceHttpHelperTest . fTestTrace1Url , org . eclipse . tracecompass . tmf . ui . tests . actions . DownloadTraceHttpHelperTest . fDestinationDirectory ) ; org . junit . Assume . assumeFalse ( status . isTimeout ( ) ) ; "<AssertPlaceHolder>" ; org . eclipse . tracecompass . tmf . ui . tests . actions . DownloadTraceHttpHelperTest . validateSingleDownload ( status . getDownloadedFile ( ) , "syslog" ) ; } isOk ( ) { return ( fSeverity ) == ( org . eclipse . tracecompass . internal . tmf . ui . project . wizards . importtrace . TraceDownloadStatus . OK ) ; }
|
org . junit . Assert . assertTrue ( status . isOk ( ) )
|
testGetRecordSerializer ( ) { "<AssertPlaceHolder>" ; } getRecordSerializer ( ) { return new de . rub . nds . tlsattacker . core . record . serializer . BlobRecordSerializer ( this ) ; }
|
org . junit . Assert . assertEquals ( record . getRecordSerializer ( ) . getClass ( ) , de . rub . nds . tlsattacker . core . record . serializer . BlobRecordSerializer . class )
|
testConvertQueryResponse ( ) { org . openehealth . ipf . commons . ihe . xds . core . responses . QueryResponse org = org . openehealth . ipf . commons . ihe . xds . core . SampleData . createQueryResponseWithLeafClass ( ) ; org . openehealth . ipf . commons . ihe . xds . core . stub . ebrs30 . query . AdhocQueryResponse converted = org . openehealth . ipf . platform . camel . ihe . xds . core . converters . EbXML30Converters . convert ( org ) ; org . openehealth . ipf . commons . ihe . xds . core . responses . QueryResponse copy = org . openehealth . ipf . platform . camel . ihe . xds . core . converters . EbXML30Converters . convertToQueryResponse ( converted ) ; "<AssertPlaceHolder>" ; } convertToQueryResponse ( org . openehealth . ipf . commons . ihe . xds . core . stub . ebrs30 . query . AdhocQueryResponse ) { org . openehealth . ipf . commons . ihe . xds . core . transform . responses . QueryResponseTransformer transformer = new org . openehealth . ipf . commons . ihe . xds . core . transform . responses . QueryResponseTransformer ( org . openehealth . ipf . platform . camel . ihe . xds . core . converters . EbXML30Converters . factory ) ; return transformer . fromEbXML ( new org . openehealth . ipf . platform . camel . ihe . xds . core . converters . EbXMLQueryResponse30 ( in ) ) ; }
|
org . junit . Assert . assertEquals ( org , copy )
|
testBuildWithParametersAndDisabledDefaultsWithOrderBy ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . department . Department department = new org . lnu . is . domain . department . Department ( ) ; org . lnu . is . domain . language . Language language = new org . lnu . is . domain . language . Language ( ) ; java . lang . String name = "fdfds" ; java . lang . String abbrName = "asfasf" ; org . lnu . is . domain . department . name . DepartmentName context = new org . lnu . is . domain . department . name . DepartmentName ( ) ; context . setDepartment ( department ) ; context . setLanguage ( language ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "department" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "language" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy3 = new org . lnu . is . pagination . OrderBy ( "abbrName" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy4 = new org . lnu . is . pagination . OrderBy ( "name" , org . lnu . is . pagination . OrderByType . DESC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 , orderBy3 , orderBy4 ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>DepartmentName<sp>e<sp>WHERE<sp>(<sp>e.department<sp>=<sp>:department<sp>AND<sp>e.language<sp>=<sp>:language<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>AND<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>)<sp>ORDER<sp>BY<sp>e.department<sp>ASC,<sp>e.language<sp>DESC,<sp>e.abbrName<sp>ASC,<sp>e.name<sp>DESC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . department . name . DepartmentName > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testHashCodeForPrimitiveArray ( ) { double [ ] array = new double [ getArrayLength ( ) ] ; for ( int i = 0 ; i < ( array . length ) ; i ++ ) { array [ i ] = cz . zcu . kiv . jop . util . ArrayUtilsTest . rand . nextDouble ( ) ; } "<AssertPlaceHolder>" ; } hashCode ( java . lang . Object ) { if ( array == null ) { return 0 ; } java . lang . Class < ? > objType = array . getClass ( ) ; if ( ! ( objType . isArray ( ) ) ) { throw new java . lang . IllegalArgumentException ( "Given<sp>object<sp>has<sp>to<sp>be<sp>array" ) ; } int result = 1 ; java . lang . Class < ? > compType = objType . getComponentType ( ) ; int len = java . lang . reflect . Array . getLength ( array ) ; for ( int i = 0 ; i < len ; i ++ ) { int elementHash = 0 ; java . lang . Object value = java . lang . reflect . Array . get ( array , i ) ; if ( value != null ) { if ( ! ( compType . isArray ( ) ) ) { elementHash = value . hashCode ( ) ; } else { elementHash = cz . zcu . kiv . jop . util . ArrayUtils . hashCode ( value ) ; } } result = ( 31 * result ) + elementHash ; } return result ; }
|
org . junit . Assert . assertEquals ( java . util . Arrays . hashCode ( array ) , cz . zcu . kiv . jop . util . ArrayUtils . hashCode ( array ) )
|
testStdevBP ( ) { for ( boolean biasCorrected : new boolean [ ] { true , false } ) { for ( boolean keepDims : new boolean [ ] { false , true } ) { org . nd4j . linalg . api . ndarray . INDArray preReduceInput = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 12 , 12 ) . reshape ( 3 , 4 ) ; org . nd4j . linalg . api . ndarray . INDArray dLdOut ; if ( keepDims ) { dLdOut = org . nd4j . linalg . factory . Nd4j . valueArrayOf ( new long [ ] { 1 , 1 } , 0.5 ) ; } else { dLdOut = org . nd4j . linalg . factory . Nd4j . trueScalar ( 0.5 ) ; } double stdev = preReduceInput . stdNumber ( biasCorrected ) . doubleValue ( ) ; double mean = preReduceInput . meanNumber ( ) . doubleValue ( ) ; long divisor = ( biasCorrected ) ? ( preReduceInput . length ( ) ) - 1 : preReduceInput . length ( ) ; org . nd4j . linalg . api . ndarray . INDArray dLdInExp = preReduceInput . dup ( ) . subi ( mean ) . divi ( ( stdev * divisor ) ) . muli ( 0.5 ) ; org . nd4j . linalg . api . ndarray . INDArray dLdIn = org . nd4j . linalg . factory . Nd4j . createUninitialized ( 3 , 4 ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( new org . nd4j . autodiff . validation . OpTestCase ( new org . nd4j . autodiff . opvalidation . StandardDeviationBp ( preReduceInput , dLdOut , dLdIn , biasCorrected , keepDims ) ) . expectedOutput ( 0 , dLdInExp ) ) ; "<AssertPlaceHolder>" ; } } } expectedOutput ( int , org . nd4j . linalg . api . ndarray . INDArray ) { testFns . put ( outputNum , new org . nd4j . autodiff . validation . functions . EqualityFn ( expected ) ) ; expShapes . put ( outputNum , expected . shapeDescriptor ( ) ) ; return this ; }
|
org . junit . Assert . assertNull ( err )
|
compare ( ) { org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . itemString = setString ( ) ; org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . ctx = javax . xml . bind . JAXBContext . newInstance ( org . jboss . resteasy . test . providers . jaxb . resource . JaxbMarshallingSoakItem . class ) ; org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . counter . set ( 0 ) ; java . lang . Thread [ ] threads = new java . lang . Thread [ org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . iterator ] ; for ( int i = 0 ; i < ( org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . iterator ) ; i ++ ) { java . lang . Thread thread = new java . lang . Thread ( ) { @ org . jboss . resteasy . test . providers . jaxb . Override public void run ( ) { byte [ ] bytes = org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . itemString . getBytes ( ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( bytes ) ; org . jboss . resteasy . test . providers . jaxb . resource . JaxbMarshallingSoakItem item = null ; try { item = ( ( org . jboss . resteasy . test . providers . jaxb . resource . JaxbMarshallingSoakItem ) ( org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . ctx . createUnmarshaller ( ) . unmarshal ( bais ) ) ) ; } catch ( javax . xml . bind . JAXBException e ) { throw new java . lang . RuntimeException ( e ) ; } item . toString ( ) ; org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . counter . incrementAndGet ( ) ; } } ; threads [ i ] = thread ; } java . util . concurrent . ExecutorService threadPool = java . util . concurrent . Executors . newFixedThreadPool ( 100 ) ; for ( int i = 0 ; i < ( org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . iterator ) ; i ++ ) { threadPool . submit ( threads [ i ] ) ; } threadPool . shutdown ( ) ; try { if ( ! ( threadPool . awaitTermination ( timeout , TimeUnit . SECONDS ) ) ) { org . junit . Assert . fail ( java . lang . String . format ( "Clients<sp>did<sp>not<sp>terminate<sp>in<sp>%s<sp>seconds" , timeout ) ) ; } } catch ( java . lang . InterruptedException e ) { org . junit . Assert . fail ( "ExecutorService[threadPool]<sp>was<sp>interrupted" ) ; } java . lang . String message = java . lang . String . format ( new java . lang . StringBuilder ( ) . append ( "RESTEasy<sp>should<sp>successes<sp>with<sp>marshalling<sp>%d<sp>times." ) . append ( "But<sp>RESTEasy<sp>successes<sp>only<sp>%d<sp>times." ) . toString ( ) , org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . iterator , org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . counter . get ( ) ) ; "<AssertPlaceHolder>" ; } get ( ) { org . jboss . resteasy . test . providers . jaxb . resource . GenericSuperInterfaceDataCenter dc = new org . jboss . resteasy . test . providers . jaxb . resource . GenericSuperInterfaceDataCenter ( ) ; dc . setName ( "Bill" ) ; return dc ; }
|
org . junit . Assert . assertEquals ( message , org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . iterator , org . jboss . resteasy . test . providers . jaxb . JaxbMarshallingSoakTest . counter . get ( ) )
|
testCamelCaseToWordsTwoChars ( ) { java . lang . String result = org . sculptor . generator . util . CamelCaseConverter . camelCaseToWords ( "ab" ) ; "<AssertPlaceHolder>" ; } camelCaseToWords ( java . lang . String ) { return org . sculptor . generator . util . CamelCaseConverter . camelCaseToWords ( camelCase , '<sp>' ) ; }
|
org . junit . Assert . assertEquals ( "ab" , result )
|
testConvertAll ( ) { java . lang . Long parentId = 1L ; java . lang . Long benefitTypeId = 2L ; java . lang . String abbrName = "fdsf" ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date endDate = new java . util . Date ( ) ; java . lang . String description = "descriptipp" ; org . lnu . is . domain . benefit . Benefit source = new org . lnu . is . domain . benefit . Benefit ( ) ; source . setAbbrName ( abbrName ) ; org . lnu . is . domain . benefit . BenefitType benefitType = new org . lnu . is . domain . benefit . BenefitType ( ) ; benefitType . setId ( benefitTypeId ) ; source . setBenefitType ( benefitType ) ; source . setBegDate ( begDate ) ; source . setDescription ( description ) ; source . setEndDate ( endDate ) ; source . setName ( source . getName ( ) ) ; org . lnu . is . domain . benefit . Benefit parent = new org . lnu . is . domain . benefit . Benefit ( ) ; parent . setId ( parentId ) ; source . setParent ( parent ) ; org . lnu . is . resource . benefit . BenefitResource expected = new org . lnu . is . resource . benefit . BenefitResource ( ) ; expected . setAbbrName ( abbrName ) ; expected . setBenefitTypeId ( benefitTypeId ) ; expected . setBegDate ( begDate ) ; expected . setDescription ( description ) ; expected . setEndDate ( endDate ) ; expected . setName ( source . getName ( ) ) ; expected . setParentId ( parentId ) ; java . lang . String abbrName1 = "fdsf" ; java . util . Date begDate1 = new java . util . Date ( ) ; java . util . Date endDate1 = new java . util . Date ( ) ; java . lang . String description1 = "descriptipp" ; org . lnu . is . domain . benefit . Benefit source1 = new org . lnu . is . domain . benefit . Benefit ( ) ; source1 . setAbbrName ( abbrName1 ) ; source1 . setBegDate ( begDate1 ) ; source1 . setDescription ( description1 ) ; source1 . setEndDate ( endDate1 ) ; source1 . setName ( source1 . getName ( ) ) ; org . lnu . is . resource . benefit . BenefitResource expected1 = new org . lnu . is . resource . benefit . BenefitResource ( ) ; expected1 . setAbbrName ( abbrName1 ) ; expected1 . setBegDate ( begDate1 ) ; expected1 . setDescription ( description1 ) ; expected1 . setEndDate ( endDate1 ) ; expected1 . setName ( source1 . getName ( ) ) ; java . util . List < org . lnu . is . domain . benefit . Benefit > sources = java . util . Arrays . asList ( source , source1 ) ; java . util . List < org . lnu . is . resource . benefit . BenefitResource > expecteds = java . util . Arrays . asList ( expected , expected1 ) ; java . util . List < org . lnu . is . resource . benefit . BenefitResource > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( expecteds , actuals )
|
test_minusWeeks_zero ( ) { java . time . OffsetDateTime base = java . time . OffsetDateTime . of ( java . time . LocalDate . of ( 2008 , 6 , 30 ) , java . time . LocalTime . of ( 11 , 30 , 59 ) , test . java . time . TestOffsetDateTime . OFFSET_PONE ) ; java . time . OffsetDateTime test = base . minusWeeks ( 0 ) ; "<AssertPlaceHolder>" ; } minusWeeks ( long ) { return weeksToSubtract == ( Long . MIN_VALUE ) ? plusWeeks ( Long . MAX_VALUE ) . plusWeeks ( 1 ) : plusWeeks ( ( - weeksToSubtract ) ) ; }
|
org . junit . Assert . assertSame ( test , base )
|
testLoadFromModelNulls ( ) { dayEntry . setHours ( null ) ; dayEntry . setProject ( null ) ; presenterImpl . loadFromModel ( ) ; "<AssertPlaceHolder>" ; verify ( view ) . setProject ( null ) ; verify ( view ) . setHours ( "00:00" ) ; } loadFromModel ( ) { oldProject = ( ( getTimesheetDayEntry ( ) ) == null ) ? null : getTimesheetDayEntry ( ) . getProject ( ) ; if ( ( ( getTimesheetDayEntry ( ) ) != null ) && ( ( getTimesheetDayEntry ( ) . getHours ( ) ) == null ) ) { getTimesheetDayEntry ( ) . setHours ( "00:00" ) ; } super . loadFromModel ( ) ; }
|
org . junit . Assert . assertNull ( presenterImpl . oldProject )
|
orderedLeafListFromNormalized ( ) { org . opendaylight . yangtools . yang . data . api . schema . ContainerNode topWithLeafList = org . opendaylight . yangtools . yang . data . impl . schema . builder . impl . ImmutableContainerNodeBuilder . create ( ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( org . opendaylight . mdsal . binding . dom . codec . test . NormalizedNodeSerializeDeserializeTest . TOP_QNAME ) ) . withChild ( org . opendaylight . yangtools . yang . data . impl . schema . builder . impl . ImmutableOrderedLeafSetNodeBuilder . create ( ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( org . opendaylight . mdsal . binding . dom . codec . test . NormalizedNodeSerializeDeserializeTest . TOP_LEVEL_ORDERED_LEAF_LIST_QNAME ) ) . withChild ( org . opendaylight . yangtools . yang . data . impl . schema . builder . impl . ImmutableLeafSetEntryNodeBuilder . create ( ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeWithValue ( org . opendaylight . mdsal . binding . dom . codec . test . NormalizedNodeSerializeDeserializeTest . TOP_LEVEL_ORDERED_LEAF_LIST_QNAME , "foo" ) ) . withValue ( "foo" ) . build ( ) ) . build ( ) ) . build ( ) ; java . util . Map . Entry < org . opendaylight . yangtools . yang . binding . InstanceIdentifier < ? > , org . opendaylight . yangtools . yang . binding . DataObject > entry = registry . fromNormalizedNode ( org . opendaylight . mdsal . binding . dom . codec . test . NormalizedNodeSerializeDeserializeTest . BI_TOP_PATH , topWithLeafList ) ; java . util . List < java . lang . String > topLevelLeafList = new java . util . ArrayList ( ) ; topLevelLeafList . add ( "foo" ) ; org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . mdsal . test . binding . rev140701 . Top top = new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . mdsal . test . binding . rev140701 . TopBuilder ( ) . setTopLevelOrderedLeafList ( topLevelLeafList ) . build ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertEquals ( top , entry . getValue ( ) )
|
switchId ( ) { org . openkilda . messaging . command . flow . DefaultFlowsCommandData defaultFlowsCommandData = new org . openkilda . messaging . command . flow . DefaultFlowsCommandData ( ) ; defaultFlowsCommandData . setSwitchId ( org . openkilda . messaging . command . Constants . switchId ) ; "<AssertPlaceHolder>" ; } getSwitchId ( ) { return switchId ; }
|
org . junit . Assert . assertEquals ( org . openkilda . messaging . command . Constants . switchId , defaultFlowsCommandData . getSwitchId ( ) )
|
testRFC5424WithoutVersion ( ) { final java . lang . String pri = "34" ; final java . lang . String version = "-" ; final java . lang . String stamp = "2003-10-11T22:14:15.003Z" ; final java . lang . String host = "mymachine.example.com" ; final java . lang . String appName = "su" ; final java . lang . String procId = "-" ; final java . lang . String msgId = "ID17" ; final java . lang . String structuredData = "-" ; final java . lang . String body = "BOM'su<sp>root'<sp>failed<sp>for<sp>lonvick<sp>on<sp>/dev/pts/8" ; final java . lang . String message = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<" + pri ) + ">" ) + version ) + "<sp>" ) + stamp ) + "<sp>" ) + host ) + "<sp>" ) + appName ) + "<sp>" ) + procId ) + "<sp>" ) + msgId ) + "<sp>" ) + "-" ) + "<sp>" ) + body ; final byte [ ] bytes = message . getBytes ( org . apache . nifi . syslog . BaseStrictSyslog5424ParserTest . CHARSET ) ; final java . nio . ByteBuffer buffer = java . nio . ByteBuffer . allocate ( bytes . length ) ; buffer . clear ( ) ; buffer . put ( bytes ) ; final org . apache . nifi . syslog . events . Syslog5424Event event = parser . parseEvent ( buffer ) ; "<AssertPlaceHolder>" ; } isValid ( ) { return valid ; }
|
org . junit . Assert . assertFalse ( event . isValid ( ) )
|
verify_success ( ) { final net . ripe . db . whois . update . keycert . PgpSignedMessage pgpSignedMessage = net . ripe . db . whois . update . keycert . PgpSignedMessage . parse ( ( "-----BEGIN<sp>PGP<sp>SIGNED<sp>MESSAGE-----\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "Hash:<sp>SHA1\n" + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 7 ) + "\t<sp>\n" ) + "person:<sp>Admin<sp>Person\n" ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 8 ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 9 ) + "\t<sp>\n" 3 ) + "phone:<sp>+44<sp>282<sp>411141\n" ) + "nic-hdl:<sp>TEST-RIPE\n" ) + "mnt-by:<sp>ADMIN-MNT\n" ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 1 ) + "-----BEGIN<sp>PGP<sp>SIGNATURE-----\n" ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 4 ) + "\t<sp>\n" 0 ) + "\t<sp>\n" 1 ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 0 ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 3 ) + "\t<sp>\n" 2 ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 6 ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" ) + "RuoAPlts+k6fPx/BjVUvY47N65jQOg0AF0dquMgybc9zdOvo1x+18rTtt/t5Amw=\n" ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 5 ) + "F2kTjjlAoJPTDGOxLnK8IOVaPwaIdTwMlpRHftv3tgmOp90ozvbImIx0j8GPT+Px\n" 2 ) ) ) ; final boolean result = pgpSignedMessage . verify ( getPublicKey_5763950D ( ) ) ; "<AssertPlaceHolder>" ; } getPublicKey_5763950D ( ) { net . ripe . db . whois . update . keycert . PgpPublicKeyWrapper wrapper = net . ripe . db . whois . update . keycert . PgpPublicKeyWrapper . parse ( net . ripe . db . whois . common . rpsl . RpslObject . parse ( ( "key-cert:<sp>PGPKEY-5763950D\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "notify:<sp>noreply@ripe.net\n" 8 + "key-cert:<sp>PGPKEY-5763950D\n" 3 ) + "notify:<sp>noreply@ripe.net\n" 4 ) + "certif:<sp>-----BEGIN<sp>PGP<sp>PUBLIC<sp>KEY<sp>BLOCK-----\n" ) + "notify:<sp>noreply@ripe.net\n" 0 ) + "certif:\n" ) + "certif:<sp>2kZciQYxC1NY9J3CNIZxgw6zcghJhtm+LT7OzPS8s3qp+w5nj+vKY09A+BK8yHBN\n" 0 ) + "certif:<sp>yO68swuow09jsrh2DAl2nKQ7YaODEipis0d4H2i0mSswlsC7xbmpx3dRP/yOu4WH\n" ) + "certif:<sp>2kZciQYxC1NY9J3CNIZxgw6zcghJhtm+LT7OzPS8s3qp+w5nj+vKY09A+BK8yHBN\n" ) + "certif:<sp>E+VPeLOAi+D97s+Da/UZWkZxFJHdV+cAzQ05ARqXKXeadfFdbkx0Eq2R0RZm9R+L\n" ) + "notify:<sp>noreply@ripe.net\n" 2 ) + "key-cert:<sp>PGPKEY-5763950D\n" 0 ) + "key-cert:<sp>PGPKEY-5763950D\n" 7 ) + "key-cert:<sp>PGPKEY-5763950D\n" 5 ) + "certif:<sp>Vukj8xhaM5f5MGb9FjMKClo6ezT4hLjQ8hfxAAZxndwAXoz46RbDUsAe/aBwdwKB\n" ) + "certif:<sp>2kZciQYxC1NY9J3CNIZxgw6zcghJhtm+LT7OzPS8s3qp+w5nj+vKY09A+BK8yHBN\n" 1 ) + "key-cert:<sp>PGPKEY-5763950D\n" 2 ) + "notify:<sp>noreply@ripe.net\n" 1 ) + "key-cert:<sp>PGPKEY-5763950D\n" 6 ) + "certif:<sp>2kZciQYxC1NY9J3CNIZxgw6zcghJhtm+LT7OzPS8s3qp+w5nj+vKY09A+BK8yHBN\n" 5 ) + "key-cert:<sp>PGPKEY-5763950D\n" 1 ) + "notify:<sp>noreply@ripe.net\n" 5 ) + "key-cert:<sp>PGPKEY-5763950D\n" 8 ) + "certif:<sp>YHsKINlZKh60dA/Br+CC7fClBycEsR4Z7akw9cPLWIGnjvw2+nq9miE005QLqRy4\n" ) + "key-cert:<sp>PGPKEY-5763950D\n" 4 ) + "notify:<sp>noreply@ripe.net\n" 3 ) + "key-cert:<sp>PGPKEY-5763950D\n" 9 ) + "certif:<sp>2kZciQYxC1NY9J3CNIZxgw6zcghJhtm+LT7OzPS8s3qp+w5nj+vKY09A+BK8yHBN\n" 3 ) + "notify:<sp>noreply@ripe.net\n" 6 ) + "certif:<sp>2kZciQYxC1NY9J3CNIZxgw6zcghJhtm+LT7OzPS8s3qp+w5nj+vKY09A+BK8yHBN\n" 6 ) + "notify:<sp>noreply@ripe.net\n" 7 ) + "certif:<sp>2kZciQYxC1NY9J3CNIZxgw6zcghJhtm+LT7OzPS8s3qp+w5nj+vKY09A+BK8yHBN\n" 2 ) + "notify:<sp>noreply@ripe.net\n" 9 ) + "notify:<sp>noreply@ripe.net\n" ) + "mnt-by:<sp>ADMIN-MNT\n" ) + "certif:<sp>2kZciQYxC1NY9J3CNIZxgw6zcghJhtm+LT7OzPS8s3qp+w5nj+vKY09A+BK8yHBN\n" 4 ) ) ) ) ; return wrapper . getPublicKey ( ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( true ) )
|
testAsErrorWithOk ( ) { final java . util . List < com . allanbank . mongodb . bson . Document > docs = java . util . Collections . singletonList ( com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . addInteger ( "ok" , ( - 23 ) ) . build ( ) ) ; final com . allanbank . mongodb . client . message . Reply reply = new com . allanbank . mongodb . client . message . Reply ( 0 , 0 , 0 , docs , false , false , false , true ) ; final com . allanbank . mongodb . Callback < com . allanbank . mongodb . MongoIterator < com . allanbank . mongodb . bson . Element > > mockCallback = createMock ( com . allanbank . mongodb . Callback . class ) ; replay ( mockCallback ) ; final com . allanbank . mongodb . client . callback . ReplyArrayCallback callback = new com . allanbank . mongodb . client . callback . ReplyArrayCallback ( mockCallback ) ; final com . allanbank . mongodb . error . ReplyException error = ( ( com . allanbank . mongodb . error . ReplyException ) ( callback . asError ( reply , true ) ) ) ; "<AssertPlaceHolder>" ; verify ( mockCallback ) ; } getOkValue ( ) { return myOkValue ; }
|
org . junit . Assert . assertEquals ( ( - 23 ) , error . getOkValue ( ) )
|
testReadListFloat ( ) { final info . michaelwittig . javaq . query . ListResult < java . lang . Double > res = ( ( info . michaelwittig . javaq . query . ListResult < java . lang . Double > ) ( this . c ( ) . execute ( "enlist<sp>1f" ) ) ) ; "<AssertPlaceHolder>" ; } getList ( ) { return this . list ; }
|
org . junit . Assert . assertArrayEquals ( new java . lang . Double [ ] { 1.0 } , res . getList ( ) )
|
givenQueryMethod_whenEmailIsAbsent_thenIgnoreEmail ( ) { java . util . List < com . baeldung . customer . Customer > customers = repository . findByName ( "D" ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , customers . size ( ) )
|
testServerTemplateWithoutProcessCapability ( ) { final org . kie . server . controller . api . model . spec . ServerTemplate serverTemplate = new org . kie . server . controller . api . model . spec . ServerTemplate ( "testId" , null , emptyList ( ) , emptyMap ( ) , emptyList ( ) ) ; presenter . setSelectedServerTemplate ( serverTemplate ) ; "<AssertPlaceHolder>" ; verify ( presenter , never ( ) ) . refreshGrid ( ) ; verify ( listView ) . clearBlockingError ( ) ; verify ( listView ) . displayBlockingError ( Constants . INSTANCE . MissingServerCapability ( ) , Constants . INSTANCE . MissingProcessCapability ( ) ) ; } getSelectedServerTemplate ( ) { final java . lang . String serverTemplate = serverTemplateButton . getText ( ) ; return serverTemplate . equals ( constants . ServerTemplates ( ) ) ? null : serverTemplate ; }
|
org . junit . Assert . assertEquals ( "" , presenter . getSelectedServerTemplate ( ) )
|
setsTrackOnV2TagOnly ( ) { com . mpatric . mp3agic . ID3v2 id3v2Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v2TagForTesting ( ) ; com . mpatric . mp3agic . ID3Wrapper wrapper = new com . mpatric . mp3agic . ID3Wrapper ( null , id3v2Tag ) ; wrapper . setTrack ( "a<sp>track" ) ; "<AssertPlaceHolder>" ; } getTrack ( ) { if ( ( ( ( id3v2Tag ) != null ) && ( ( id3v2Tag . getTrack ( ) ) != null ) ) && ( ( id3v2Tag . getTrack ( ) . length ( ) ) > 0 ) ) { return id3v2Tag . getTrack ( ) ; } else if ( ( id3v1Tag ) != null ) { return id3v1Tag . getTrack ( ) ; } else { return null ; } }
|
org . junit . Assert . assertEquals ( "a<sp>track" , id3v2Tag . getTrack ( ) )
|
testNewerThan ( ) { com . sun . enterprise . util . JavaVersion jv1 = com . sun . enterprise . util . JavaVersion . getVersion ( "1.7.0_10-ea" ) ; com . sun . enterprise . util . JavaVersion jv2 = com . sun . enterprise . util . JavaVersion . getVersion ( "1.7.0_11" ) ; "<AssertPlaceHolder>" ; } newerThan ( com . sun . enterprise . util . JavaVersion ) { if ( ( getMajor ( ) ) > ( version . getMajor ( ) ) ) return true ; if ( ( getMajor ( ) ) < ( version . getMajor ( ) ) ) return false ; if ( ( getMinor ( ) ) > ( version . getMinor ( ) ) ) return true ; if ( ( getMinor ( ) ) < ( version . getMinor ( ) ) ) return false ; if ( ( getMicro ( ) ) > ( version . getMicro ( ) ) ) return true ; if ( ( getMicro ( ) ) < ( version . getMicro ( ) ) ) return false ; if ( ( getUpdate ( ) ) > ( version . getUpdate ( ) ) ) return true ; if ( ( getUpdate ( ) ) < ( version . getUpdate ( ) ) ) return false ; if ( ( getBuild ( ) ) > ( version . getBuild ( ) ) ) return true ; if ( ( getBuild ( ) ) < ( version . getBuild ( ) ) ) return true ; return false ; }
|
org . junit . Assert . assertTrue ( jv2 . newerThan ( jv1 ) )
|
shouldExecuteSimpleScript ( ) { org . nuxeo . ecm . core . api . DocumentModelList docs = scripting . run ( "simpleAutomationScript.js" , session , org . nuxeo . ecm . core . api . DocumentModelList . class ) ; "<AssertPlaceHolder>" ; } size ( ) { return getCollectedDocumentIds ( ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( 10 , docs . size ( ) )
|
testTwoNull ( ) { org . openscience . cdk . tools . diff . tree . IDifference result = org . openscience . cdk . tools . diff . tree . BondOrderDifference . construct ( "Foo" , null , null ) ; "<AssertPlaceHolder>" ; } construct ( java . lang . String , org . openscience . cdk . interfaces . IBond$Order , org . openscience . cdk . interfaces . IBond$Order ) { if ( first == second ) { return null ; } return new org . openscience . cdk . tools . diff . tree . BondOrderDifference ( name , first , second ) ; }
|
org . junit . Assert . assertNull ( result )
|
testForeignTable ( ) { java . lang . String ddl = "UNIQUE0" 4 + ( ( ( ( ( ( ( ( ( ( ( "Test<sp>Table" 4 + "12" 4 ) + "\te3<sp>date<sp>NOT<sp>NULL<sp>DEFAULT<sp>current_date()<sp>OPTIONS<sp>(\"teiid_rel:default_handling\"<sp>\'expression\'),\n" ) + "Test<sp>Table" 1 ) + "model" 5 ) + "Test<sp>Table" 5 ) + "Test<sp>Table" 9 ) + "UNIQUE0" 9 ) + "model" 3 ) + "12" 0 ) + "\tINDEX(e6)\n" ) + "UNIQUE0" 1 ) ; org . teiid . metadata . MetadataFactory mf = new org . teiid . metadata . MetadataFactory ( "Test<sp>Table" 8 , 1 , "model" , org . teiid . query . parser . TestDDLParser . getDataTypes ( ) , new java . util . Properties ( ) , null ) ; org . teiid . metadata . Table table = mf . addTable ( "Test<sp>Table" 6 ) ; table . setVirtual ( false ) ; mf . addColumn ( "12" 9 , "UNIQUE0" 6 , table ) ; org . teiid . metadata . Column e2 = mf . addColumn ( "UNIQUE0" 5 , "Test<sp>Table" 2 , table ) ; e2 . setLength ( 10 ) ; org . teiid . metadata . Column e3 = mf . addColumn ( "model" 4 , "Test<sp>Table" 0 , table ) ; e3 . setNullType ( NullType . No_Nulls ) ; org . teiid . query . parser . SQLParserUtil . setDefault ( e3 , new org . teiid . query . sql . symbol . Function ( "UNIQUE0" 2 , new org . teiid . query . sql . symbol . Expression [ 0 ] ) ) ; org . teiid . metadata . Column e4 = mf . addColumn ( "12" 2 , "12" 8 , table ) ; e4 . setPrecision ( 12 ) ; e4 . setScale ( 3 ) ; org . teiid . metadata . Column e5 = mf . addColumn ( "UNIQUE0" 8 , "UNIQUE0" 6 , table ) ; e5 . setAutoIncremented ( true ) ; e5 . setUUID ( "Test<sp>Table" 3 ) ; e5 . setNameInSource ( "UNIQUE0" 3 ) ; e5 . setSelectable ( false ) ; org . teiid . metadata . Column e6 = mf . addColumn ( "Test<sp>Table" 7 , "Test<sp>Table" 2 , table ) ; e6 . setDefaultValue ( "model" 0 ) ; mf . addPrimaryKey ( "model" 1 , java . util . Arrays . asList ( "12" 9 ) , table ) ; mf . addIndex ( "UNIQUE0" , false , java . util . Arrays . asList ( "UNIQUE0" 5 ) , table ) ; mf . addIndex ( "12" 5 , false , java . util . Arrays . asList ( "model" 4 ) , table ) ; mf . addIndex ( "model" 2 , true , java . util . Arrays . asList ( "UNIQUE0" 8 ) , table ) ; mf . addIndex ( "UNIQUE0" 0 , true , java . util . Arrays . asList ( "Test<sp>Table" 7 ) , table ) ; java . util . Map < java . lang . String , java . lang . String > options = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; options . put ( "CARDINALITY" , "12" ) ; options . put ( "UUID" , "12" 6 ) ; options . put ( "12" 1 , "12" 7 ) ; options . put ( "12" 3 , "UNIQUE0" 7 ) ; options . put ( "ANNOTATION" , "Test<sp>Table" ) ; table . setProperties ( options ) ; java . lang . String metadataDDL = org . teiid . query . metadata . DDLStringVisitor . getDDLString ( mf . getSchema ( ) , null , null ) ; "<AssertPlaceHolder>" ; } getSchema ( ) { return null ; }
|
org . junit . Assert . assertEquals ( ddl , metadataDDL )
|
testGetZooCacheWatcher ( ) { java . lang . String zks1 = "zk1" ; int timeout1 = 1000 ; org . apache . zookeeper . Watcher watcher = createMock ( org . apache . zookeeper . Watcher . class ) ; org . apache . accumulo . fate . zookeeper . ZooCache zc1 = zcf . getZooCache ( zks1 , timeout1 , watcher ) ; "<AssertPlaceHolder>" ; } getZooCache ( java . lang . String , int , org . apache . zookeeper . Watcher ) { if ( watcher == null ) { return getZooCache ( zooKeepers , sessionTimeout ) ; } return new org . apache . accumulo . fate . zookeeper . ZooCache ( zooKeepers , sessionTimeout , watcher ) ; }
|
org . junit . Assert . assertNotNull ( zc1 )
|
testConcurrentRenameCommandReopen ( ) { final org . kie . workbench . common . widgets . metadata . client . TestDocument document = createTestDocument ( ) ; final org . uberfire . backend . vfs . ObservablePath path = document . getLatestPath ( ) ; concurrentRenameCommand = editor . getConcurrentRenameOnReopenCommand ( document ) ; editor . setupMenuBar ( ) ; registerDocument ( document ) ; final org . mockito . ArgumentCaptor < org . uberfire . mvp . ParameterizedCommand > renameCommandCaptor = org . mockito . ArgumentCaptor . forClass ( org . uberfire . mvp . ParameterizedCommand . class ) ; verify ( path , times ( 1 ) ) . onConcurrentRename ( renameCommandCaptor . capture ( ) ) ; final org . uberfire . mvp . ParameterizedCommand renameCommand = renameCommandCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; final org . uberfire . backend . vfs . ObservablePath . OnConcurrentRenameEvent info = mock ( ObservablePath . OnConcurrentRenameEvent . class ) ; renameCommand . execute ( info ) ; verify ( document , times ( 1 ) ) . setConcurrentUpdateSessionInfo ( eq ( null ) ) ; verify ( editorView , times ( 2 ) ) . refreshTitle ( any ( java . lang . String . class ) ) ; verify ( editorView , times ( 1 ) ) . showBusyIndicator ( any ( java . lang . String . class ) ) ; verify ( editor , times ( 2 ) ) . getDocumentTitle ( eq ( document ) ) ; verify ( editor , times ( 1 ) ) . refreshDocument ( eq ( document ) ) ; verify ( changeTitleEvent , times ( 1 ) ) . fire ( any ( org . uberfire . client . workbench . events . ChangeTitleWidgetEvent . class ) ) ; } getValue ( ) { return rootPath ; }
|
org . junit . Assert . assertNotNull ( renameCommand )
|
testRoundValueZeroNoFactors ( ) { java . math . BigDecimal value = java . math . BigDecimal . ZERO ; java . lang . String rounded = org . oscm . reportingservice . business . ValueRounder . roundValue ( formatter , value , new java . math . BigDecimal [ 0 ] ) ; "<AssertPlaceHolder>" ; } roundValue ( org . oscm . converter . PriceConverter , java . math . BigDecimal , java . math . BigDecimal [ ] ) { if ( ( BigDecimal . ZERO . compareTo ( value ) ) == 0 ) { if ( ( factors . length ) == 0 ) { return org . oscm . reportingservice . business . ValueRounder . EMPTY_STRING ; } else if ( org . oscm . reportingservice . business . ValueRounder . containsZeroFactor ( factors ) ) { return org . oscm . reportingservice . business . ValueRounder . EMPTY_STRING ; } } return formatter . getValueToDisplay ( value . setScale ( PriceConverter . NORMALIZED_PRICE_SCALING , RoundingMode . HALF_UP ) , true ) ; }
|
org . junit . Assert . assertEquals ( "" , rounded )
|
testWithErrorsNotArray ( ) { builder . withErrors ( com . redhat . lightblue . util . JsonObject . getFactory ( ) . objectNode ( ) ) ; "<AssertPlaceHolder>" ; } buildResponse ( ) { if ( ( status ) == null ) { status = OperationStatus . ERROR ; } com . redhat . lightblue . Response response = new com . redhat . lightblue . Response ( jsonNodeFactory , status ) ; response . setModifiedCount ( modifiedCount ) ; response . setMatchCount ( matchCount ) ; response . setTaskHandle ( taskHandle ) ; response . setSessionInfo ( session ) ; response . setEntityData ( entityData ) ; response . getDataErrors ( ) . addAll ( dataErrors ) ; response . getErrors ( ) . addAll ( errors ) ; return response ; }
|
org . junit . Assert . assertEquals ( builder . buildResponse ( ) . getErrors ( ) . size ( ) , 0 )
|
isDisabled_ServiceKeyZero ( ) { ctrl . initializePartnerServiceView ( ) ; ctrl . getModel ( ) . setSelectedServiceKey ( 0 ) ; boolean b = ctrl . isDisabled ( ) ; "<AssertPlaceHolder>" ; } isDisabled ( ) { return ( ( ( model . getSelectedServiceKey ( ) ) <= 0 ) || ( ( ( model . getPartnerServiceDetails ( ) ) != null ) && ( ServiceStatus . ACTIVE . equals ( model . getPartnerServiceDetails ( ) . getStatus ( ) ) ) ) ) || ( ! ( ui . findUserBean ( ) . getUserFromSessionWithoutException ( ) . getUserRoles ( ) . contains ( UserRoleType . RESELLER_MANAGER ) ) ) ; }
|
org . junit . Assert . assertTrue ( b )
|
loopTest ( ) { System . out . println ( "loopTest" ) ; java . lang . String result = com . rhythm . louie . services . status . StatusServiceTest . client . loopTest ( com . rhythm . louie . services . status . StatusServiceTest . HOSTS ) ; "<AssertPlaceHolder>" ; System . out . println ( result ) ; } loopTest ( java . util . List ) { if ( hosts . isEmpty ( ) ) { return "Done" ; } java . util . List < java . lang . String > args = new java . util . ArrayList ( hosts ) ; java . lang . String host = args . remove ( 0 ) ; com . rhythm . louie . services . status . StatusClient client = com . rhythm . louie . services . status . StatusClientFactory . getClient ( com . rhythm . louie . connection . LouieConnectionFactory . getConnection ( host ) ) ; return client . loopTest ( args ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
testAddPosition_01 ( ) { acceptor . addPosition ( 0 , 1 , "1" ) ; java . util . List < ? extends org . eclipse . xtext . ide . editor . syntaxcoloring . LightweightPosition > positions = acceptor . getPositions ( ) ; "<AssertPlaceHolder>" ; checkPosition ( positions . get ( 0 ) , 0 , 1 , 0 , "1" ) ; checkPosition ( positions . get ( 0 ) , ( - 1 ) , ( - 1 ) , ( - 1 ) , "1" ) ; } size ( ) { return 1 ; }
|
org . junit . Assert . assertEquals ( 1 , positions . size ( ) )
|
testOnNodeDeletePreConnTypeErr ( ) { java . util . Map < java . lang . String , org . o3project . odenos . core . component . network . topology . Port > ports1 = new java . util . HashMap < java . lang . String , org . o3project . odenos . core . component . network . topology . Port > ( ) ; org . o3project . odenos . core . component . network . topology . Node node1 = new org . o3project . odenos . core . component . network . topology . Node ( "0" , "node1" , ports1 , new java . util . HashMap < java . lang . String , java . lang . String > ( ) ) ; org . o3project . odenos . core . component . ConversionTable conversionTable = org . powermock . api . mockito . PowerMockito . spy ( new org . o3project . odenos . core . component . ConversionTable ( ) ) ; org . powermock . api . mockito . PowerMockito . doReturn ( "aggregated" ) . when ( conversionTable , "getConnectionType" , org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID ) ; org . powermock . api . mockito . PowerMockito . doReturn ( conversionTable ) . when ( target , "conversionTable" ) ; "<AssertPlaceHolder>" ; } onNodeDeletePre ( java . lang . String , org . o3project . odenos . core . component . network . topology . Node ) { org . o3project . odenos . component . aggregator . Aggregator . log . debug ( "" ) ; java . lang . String connType = conversionTable ( ) . getConnectionType ( networkId ) ; if ( ( connType != null ) && ( connType . equals ( org . o3project . odenos . component . aggregator . Aggregator . AGGREGATED ) ) ) { return false ; } java . lang . String aggNetworkId = getNetworkIdByType ( org . o3project . odenos . component . aggregator . Aggregator . AGGREGATED ) ; if ( aggNetworkId == null ) { return false ; } org . o3project . odenos . core . component . NetworkInterface aggNetworkIf = networkInterfaces ( ) . get ( aggNetworkId ) ; if ( ( ( node . getPortMap ( ) ) != null ) && ( ( node . getPortMap ( ) . size ( ) ) != 0 ) ) { for ( java . lang . String pid : node . getPortMap ( ) . keySet ( ) ) { org . o3project . odenos . core . component . network . topology . Port orgPort = node . getPort ( pid ) ; java . lang . String aggPortId = getConvPortId ( networkId , orgPort . getNode ( ) , orgPort . getId ( ) ) ; if ( aggPortId == null ) { continue ; } java . lang . String [ ] aggPortList = aggPortId . split ( "::" ) ; aggNetworkIf . delPort ( aggPortList [ 1 ] , aggPortList [ 2 ] ) ; } } java . util . List < java . lang . String > aggNodes = conversionTable ( ) . getNode ( aggNetworkId , this . getObjectId ( ) ) ; if ( ( aggNodes . size ( ) ) == 1 ) { return true ; } conversionTable ( ) . delEntryNode ( networkId , node . getId ( ) ) ; return false ; }
|
org . junit . Assert . assertThat ( target . onNodeDeletePre ( org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID , node1 ) , org . hamcrest . CoreMatchers . is ( false ) )
|
size ( ) { "<AssertPlaceHolder>" ; } size ( ) { org . junit . Assert . assertEquals ( 5 , r . size ( ) ) ; }
|
org . junit . Assert . assertEquals ( 5 , r . size ( ) )
|
testFreeFormExpressions ( ) { final java . lang . String drl = ( ( ( ( ( ( ( ( "package<sp>org.drools.compiler\n" + "import<sp>" ) + ( org . drools . testcoverage . common . model . Cell . class . getCanonicalName ( ) ) ) + "\n" ) + "rule<sp>r1\n" ) + "when\n" ) + "<sp>$p1<sp>:<sp>Cell(<sp>row<sp>==<sp>2<sp>)\n" ) + "<sp>$p2<sp>:<sp>Cell(<sp>row<sp>==<sp>$p1.row<sp>+<sp>1,<sp>row<sp>==<sp>($p1.row<sp>+<sp>1),<sp>row<sp>==<sp>1<sp>+<sp>$p1.row,<sp>row<sp>==<sp>(1<sp>+<sp>$p1.row)<sp>)\n" ) + "then\n" ) + "end\n" ; final org . kie . api . KieBase kbase = org . drools . testcoverage . common . util . KieBaseUtil . getKieBaseFromKieModuleFromDrl ( "cell-test" , kieBaseTestConfiguration , drl ) ; final org . kie . api . runtime . KieSession ksession = kbase . newKieSession ( ) ; try { final org . drools . testcoverage . common . model . Cell c1 = new org . drools . testcoverage . common . model . Cell ( 1 , 2 , 0 ) ; final org . drools . testcoverage . common . model . Cell c2 = new org . drools . testcoverage . common . model . Cell ( 1 , 3 , 0 ) ; ksession . insert ( c1 ) ; ksession . insert ( c2 ) ; final int rules = ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } finally { ksession . dispose ( ) ; } } fireAllRules ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 1 , rules )
|
testJobFuture ( ) { final org . joda . time . DateTime now = new org . joda . time . DateTime ( ) . withMillisOfSecond ( 0 ) . withSecondOfMinute ( 0 ) . withZone ( DateTimeZone . UTC ) ; org . joda . time . DateTime t1 = now . plusHours ( 1 ) ; com . huffingtonpost . chronos . servlet . JobSpec job1 = com . huffingtonpost . chronos . servlet . TestChronosController . getTestJob ( "should<sp>be<sp>first" ) ; job1 . setCronString ( java . lang . String . format ( "%d<sp>%d<sp>*<sp>*<sp>*" , t1 . getMinuteOfHour ( ) , t1 . getHourOfDay ( ) ) ) ; job1 . setId ( 1L ) ; com . huffingtonpost . chronos . servlet . JobSpec job2 = com . huffingtonpost . chronos . servlet . TestChronosController . getTestJob ( "should<sp>be<sp>second" ) ; org . joda . time . DateTime t2 = t1 . plusMinutes ( 59 ) ; job2 . setCronString ( java . lang . String . format ( "%d<sp>%d<sp>*<sp>*<sp>*" , t2 . getMinuteOfHour ( ) , t2 . getHourOfDay ( ) ) ) ; job2 . setId ( 2L ) ; com . huffingtonpost . chronos . servlet . List < com . huffingtonpost . chronos . servlet . JobSpec > jobs = new com . huffingtonpost . chronos . servlet . ArrayList ( ) ; jobs . add ( job2 ) ; jobs . add ( job1 ) ; when ( jobDao . getJobs ( ) ) . thenReturn ( jobs ) ; com . huffingtonpost . chronos . servlet . List < com . huffingtonpost . chronos . servlet . FutureRunInfo > expected = new com . huffingtonpost . chronos . servlet . ArrayList ( ) ; com . huffingtonpost . chronos . servlet . FutureRunInfo fri1 = new com . huffingtonpost . chronos . servlet . FutureRunInfo ( job1 . getName ( ) , com . huffingtonpost . chronos . servlet . ChronosController . calcNextRunTime ( now , job1 ) ) ; com . huffingtonpost . chronos . servlet . FutureRunInfo fri2 = new com . huffingtonpost . chronos . servlet . FutureRunInfo ( job2 . getName ( ) , com . huffingtonpost . chronos . servlet . ChronosController . calcNextRunTime ( now , job2 ) ) ; expected . add ( fri1 ) ; expected . add ( fri2 ) ; com . huffingtonpost . chronos . servlet . FutureRunInfo fri3 = new com . huffingtonpost . chronos . servlet . FutureRunInfo ( job1 . getName ( ) , com . huffingtonpost . chronos . servlet . ChronosController . calcNextRunTime ( fri2 . getTime ( ) , job1 ) ) ; com . huffingtonpost . chronos . servlet . FutureRunInfo fri4 = new com . huffingtonpost . chronos . servlet . FutureRunInfo ( job2 . getName ( ) , com . huffingtonpost . chronos . servlet . ChronosController . calcNextRunTime ( fri2 . getTime ( ) , job2 ) ) ; expected . add ( fri3 ) ; expected . add ( fri4 ) ; int limit = 4 ; "<AssertPlaceHolder>" ; org . springframework . test . web . servlet . request . MockHttpServletRequestBuilder jobsFutureReq = get ( java . lang . String . format ( "/api/jobs/future?limit=%d" , limit ) ) ; mockMvc . perform ( jobsFutureReq ) . andExpect ( content ( ) . string ( OM . writeValueAsString ( expected ) ) ) . andExpect ( status ( ) . isOk ( ) ) ; when ( jobDao . getJob ( job1 . getId ( ) ) ) . thenReturn ( job1 ) ; com . huffingtonpost . chronos . servlet . List < com . huffingtonpost . chronos . servlet . FutureRunInfo > expectedId = new com . huffingtonpost . chronos . servlet . ArrayList ( ) ; expectedId . add ( fri1 ) ; expectedId . add ( fri3 ) ; limit = 2 ; org . springframework . test . web . servlet . request . MockHttpServletRequestBuilder jobsFutureIdReq = get ( java . lang . String . format ( "/api/jobs/future?limit=%d&id=%d" , limit , job1 . getId ( ) ) ) ; mockMvc . perform ( jobsFutureIdReq ) . andExpect ( content ( ) . string ( OM . writeValueAsString ( expectedId ) ) ) . andExpect ( status ( ) . isOk ( ) ) ; } getJobFuture ( java . lang . Long , int ) { com . huffingtonpost . chronos . servlet . List < com . huffingtonpost . chronos . servlet . FutureRunInfo > toRet = new com . huffingtonpost . chronos . servlet . ArrayList ( ) ; com . huffingtonpost . chronos . servlet . List < com . huffingtonpost . chronos . servlet . JobSpec > iterJobs ; if ( id == null ) { iterJobs = jobDao . getJobs ( ) ; } else { iterJobs = com . huffingtonpost . chronos . servlet . Arrays . asList ( new com . huffingtonpost . chronos . servlet . JobSpec [ ] { jobDao . getJob ( id ) } ) ; } if ( ( iterJobs . size ( ) ) == 0 ) { return toRet ; } org . joda . time . DateTime from = new org . joda . time . DateTime ( ) . withZone ( DateTimeZone . UTC ) ; while ( ( toRet . size ( ) ) < limit ) { innerJobFuture ( toRet , from , iterJobs ) ; com . huffingtonpost . chronos . servlet . Collections . sort ( toRet ) ; from = toRet . get ( ( ( toRet . size ( ) ) - 1 ) ) . getTime ( ) ; } return toRet ; }
|
org . junit . Assert . assertEquals ( expected , controller . getJobFuture ( null , limit ) )
|
testExclusiveProfile ( ) { java . util . List < org . apache . metron . profiler . MessageRoute > routes = router . route ( messageOne , createConfig ( exclusiveProfile ) , context ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( java . util . Map m : variableMappings ) { size += m . size ( ) ; } return size ; }
|
org . junit . Assert . assertEquals ( 0 , routes . size ( ) )
|
testRevokeClassBasedPermission ( ) { org . picketlink . idm . model . basic . User bob = createUser ( "bob" ) ; org . picketlink . idm . PermissionManager permissionManager = getPermissionManager ( ) ; permissionManager . grantPermission ( bob , org . picketlink . idm . model . basic . Role . class , "read" ) ; org . picketlink . idm . IdentityManager identityManager = getIdentityManager ( ) ; identityManager . remove ( bob ) ; java . util . List < org . picketlink . idm . permission . Permission > permissions = permissionManager . listPermissions ( bob ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( context ) == null ) || ( context . isEmpty ( ) ) ; }
|
org . junit . Assert . assertTrue ( permissions . isEmpty ( ) )
|
doAnyPeopleHaveCatsUsingStreams ( ) { boolean result = this . people . stream ( ) . anyMatch ( ( person ) -> person . hasPet ( PetType . CAT ) ) ; "<AssertPlaceHolder>" ; } hasPet ( com . gs . collections . impl . PersonAndPetKataTest$PetType ) { return this . pets . anySatisfyWith ( com . gs . collections . impl . block . factory . Predicates2 . attributeEqual ( com . gs . collections . impl . PersonAndPetKataTest . Pet :: getType ) , petType ) ; }
|
org . junit . Assert . assertTrue ( result )
|
itConvertsUTF16BE ( ) { java . lang . String ecProperty = "utf-16be" ; java . lang . String expected = "UTF-16BE" ; com . welovecoding . nbeditorconfig . io . model . MappedCharset charset = com . welovecoding . nbeditorconfig . mapper . EditorConfigPropertyMapper . mapCharset ( ecProperty ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertEquals ( expected , charset . getName ( ) )
|
testProofOfWork ( ) { org . bitcoinj . core . NetworkParameters params = org . bitcoinj . params . UnitTestParams . get ( ) ; org . bitcoinj . core . Block block = params . getDefaultSerializer ( ) . makeBlock ( org . bitcoinj . core . BlockTest . blockBytes ) ; block . setNonce ( 12346 ) ; try { block . verify ( Block . BLOCK_HEIGHT_GENESIS , java . util . EnumSet . noneOf ( Block . VerifyFlag . class ) ) ; org . junit . Assert . fail ( ) ; } catch ( org . bitcoinj . core . VerificationException e ) { } block . setDifficultyTarget ( Block . EASIEST_DIFFICULTY_TARGET ) ; block . verify ( Block . BLOCK_HEIGHT_GENESIS , java . util . EnumSet . noneOf ( Block . VerifyFlag . class ) ) ; block . setNonce ( 1 ) ; try { block . verify ( Block . BLOCK_HEIGHT_GENESIS , java . util . EnumSet . noneOf ( Block . VerifyFlag . class ) ) ; org . junit . Assert . fail ( ) ; } catch ( org . bitcoinj . core . VerificationException e ) { } block . solve ( ) ; block . verify ( Block . BLOCK_HEIGHT_GENESIS , java . util . EnumSet . noneOf ( Block . VerifyFlag . class ) ) ; "<AssertPlaceHolder>" ; } getNonce ( ) { return nonce ; }
|
org . junit . Assert . assertEquals ( block . getNonce ( ) , 2 )
|
testScenario1 ( ) { be . e_contract . mycarenet . etk . EtkDepotClient etkDepotClient = new be . e_contract . mycarenet . etk . EtkDepotClient ( "https://services-acpt.ehealth.fgov.be/EtkDepot/v1" ) ; byte [ ] etk = etkDepotClient . getEtk ( "NIHII-HOSPITAL" , "71089815" ) ; "<AssertPlaceHolder>" ; } getEtk ( java . lang . String , java . lang . String ) { return getEtk ( identifierType , identifierValue , "" ) ; }
|
org . junit . Assert . assertNotNull ( etk )
|
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . asset . kernel . model . AssetCategory . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "categoryId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "categoryId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
zouGeenMeldingMoetenGevenWantIdentificatienummersGroepIsNull ( ) { final nl . bzk . brp . model . bericht . kern . PersoonBericht persoon = new nl . bzk . brp . model . bericht . kern . PersoonBericht ( ) ; final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > objecten = bral0013 . voerRegelUit ( null , persoon , null , null ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( persoonRepository , org . mockito . Mockito . never ( ) ) . isAdministratienummerAlInGebruik ( isA ( nl . bzk . brp . model . algemeen . attribuuttype . kern . AdministratienummerAttribuut . class ) ) ; } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , objecten . size ( ) )
|
shouldReturnStateBadRequestIfResourceIdIsInvalid ( ) { ch . mobi . itc . mobiliar . rest . dtos . RestrictionDTO restrictionDTO = new ch . mobi . itc . mobiliar . rest . dtos . RestrictionDTO ( null , "valid" , null , ch . puzzle . itc . mobiliar . business . security . entity . Permission . RESOURCE , 1 , null , null , null , null ) ; when ( rest . permissionBoundary . createRestriction ( "valid" , null , ch . puzzle . itc . mobiliar . business . security . entity . Permission . RESOURCE . name ( ) , 1 , null , null , null , null , false , true ) ) . thenThrow ( new ch . puzzle . itc . mobiliar . common . exception . AMWException ( "bad" ) ) ; javax . ws . rs . core . Response response = rest . addRestriction ( restrictionDTO , false , true ) ; "<AssertPlaceHolder>" ; } addRestriction ( ch . mobi . itc . mobiliar . rest . dtos . RestrictionDTO , boolean , boolean ) { java . lang . Integer id ; if ( ( request . getId ( ) ) != null ) { return javax . ws . rs . core . Response . status ( ch . mobi . itc . mobiliar . rest . permissions . BAD_REQUEST ) . entity ( new ch . mobi . itc . mobiliar . rest . exceptions . ExceptionDto ( "Id<sp>must<sp>be<sp>null" ) ) . build ( ) ; } if ( ( request . getPermission ( ) ) == null ) { return javax . ws . rs . core . Response . status ( ch . mobi . itc . mobiliar . rest . permissions . BAD_REQUEST ) . entity ( new ch . mobi . itc . mobiliar . rest . exceptions . ExceptionDto ( "Permission<sp>must<sp>not<sp>be<sp>null" ) ) . build ( ) ; } try { id = permissionBoundary . createRestriction ( request . getRoleName ( ) , request . getUserName ( ) , request . getPermission ( ) . getName ( ) , request . getResourceGroupId ( ) , request . getResourceTypeName ( ) , request . getResourceTypePermission ( ) , request . getContextName ( ) , request . getAction ( ) , delegation , reload ) ; } catch ( ch . puzzle . itc . mobiliar . common . exception . AMWException e ) { return javax . ws . rs . core . Response . status ( ch . mobi . itc . mobiliar . rest . permissions . BAD_REQUEST ) . entity ( new ch . mobi . itc . mobiliar . rest . exceptions . ExceptionDto ( e . getMessage ( ) ) ) . build ( ) ; } if ( id == null ) { return javax . ws . rs . core . Response . status ( ch . mobi . itc . mobiliar . rest . permissions . PRECONDITION_FAILED ) . entity ( new ch . mobi . itc . mobiliar . rest . exceptions . ExceptionDto ( "A<sp>similar<sp>permission<sp>already<sp>exists" ) ) . build ( ) ; } return javax . ws . rs . core . Response . status ( ch . mobi . itc . mobiliar . rest . permissions . CREATED ) . header ( "Location" , ( "/permissions/restrictions/" + id ) ) . build ( ) ; }
|
org . junit . Assert . assertEquals ( ch . mobi . itc . mobiliar . rest . permissions . BAD_REQUEST . getStatusCode ( ) , response . getStatus ( ) )
|
paste_special_formulas_and_number_formats ( ) { int tRow = 15 ; int lCol = 6 ; int bRow = 18 ; int rCol = 7 ; org . zkoss . test . zss . CellCacheAggeration . Builder builder = getCellCacheAggerationBuilder ( tRow , lCol , bRow , rCol ) ; org . zkoss . test . zss . CellCacheAggeration copyFrom = builder . build ( ) ; keyboardDirector . ctrlCopy ( tRow , lCol , bRow , rCol ) ; mouseDirector . openCellContextMenu ( 11 , 10 ) ; click ( ".z-menupopup:visible<sp>.zsmenuitem-pasteSpecial" ) ; jq ( "$formulaWithNum<sp>input" ) . getWebElement ( ) . click ( ) ; click ( "$_pasteSpecialDialog<sp>$okBtn" ) ; org . zkoss . test . zss . CellCacheAggeration pasteTo = builder . offset ( 11 , 10 ) . build ( ) ; copyFrom . merge ( pasteTo , CellCache . Field . VERTICAL_ALIGN , CellCache . Field . HORIZONTAL_ALIGN , CellCache . Field . FONT_COLOR , CellCache . Field . FILL_COLOR , CellCache . Field . BOTTOM_BORDER , CellCache . Field . RIGHT_BORDER ) ; "<AssertPlaceHolder>" ; } click ( org . zkoss . test . JQuery ) { timeBlocker . waitUntil ( new com . google . common . base . Predicate < java . lang . Void > ( ) { @ org . zkoss . test . zss . Override public boolean apply ( java . lang . Void input ) { return target . isVisible ( ) ; } } ) ; try { new org . zkoss . test . JavascriptActions ( webDriver ) . mouseOver ( target , MouseButton . LEFT ) . mouseDown ( target , MouseButton . LEFT ) . mouseUp ( target , MouseButton . LEFT ) . click ( target ) . perform ( ) ; } catch ( org . openqa . selenium . WebDriverException ex ) { } if ( ( browser . isSafari ( ) ) || ( browser . isGecko ( ) ) ) { timeBlocker . waitUntil ( 1 ) ; } timeBlocker . waitResponse ( ) ; }
|
org . junit . Assert . assertEquals ( copyFrom , pasteTo )
|
testFindByName ( ) { final org . feuyeux . jaxrs2 . atup . core . domain . AtupTestSuite suite = dao . findBySuiteName ( CreatTestSuite . SUITE_NAME ) ; "<AssertPlaceHolder>" ; } getSuiteName ( ) { return suiteName ; }
|
org . junit . Assert . assertEquals ( CreatTestSuite . SUITE_NAME , suite . getSuiteName ( ) )
|
testThreadLocked_tryAcquire ( ) { final com . eclipsesource . v8 . V8Locker v8Locker = new com . eclipsesource . v8 . V8Locker ( v8 ) ; final boolean [ ] result = new boolean [ 1 ] ; java . lang . Thread t = new java . lang . Thread ( new java . lang . Runnable ( ) { @ com . eclipsesource . v8 . Override public void run ( ) { result [ 0 ] = v8Locker . tryAcquire ( ) ; } } ) ; t . start ( ) ; t . join ( ) ; "<AssertPlaceHolder>" ; } start ( ) { if ( ( server ) == null ) { return ; } boolean waitForConnection = this . waitForConnection ; java . lang . Thread clientThread = new java . lang . Thread ( new com . eclipsesource . v8 . debug . V8DebugServer . ClientLoop ( ) , "J2V8<sp>Debugger<sp>Server" ) ; clientThread . setDaemon ( true ) ; clientThread . start ( ) ; setupEventHandler ( ) ; runningStateDcp = runtime . executeObjectScript ( ( ( "(function()<sp>{return<sp>new<sp>" + ( com . eclipsesource . v8 . debug . V8DebugServer . DEBUG_OBJECT_NAME ) ) + ".DebugCommandProcessor(null,<sp>true)})()" ) ) ; if ( waitForConnection ) { synchronized ( clientLock ) { while ( this . waitForConnection ) { try { clientLock . wait ( ) ; } catch ( java . lang . InterruptedException e ) { } } } try { processRequests ( 100 ) ; } catch ( java . lang . InterruptedException e ) { } } }
|
org . junit . Assert . assertFalse ( result [ 0 ] )
|
requestWithBadServerResponseOnceShouldReturnResponse ( ) { server . enqueue ( new okhttp3 . mockwebserver . MockResponse ( ) . setResponseCode ( 543 ) . setBody ( "<!--<sp>this<sp>is<sp>not<sp>json<sp>-->" ) ) ; server . enqueue ( new okhttp3 . mockwebserver . MockResponse ( ) . setResponseCode ( 201 ) . setBody ( "ok" ) ) ; com . tinify . Client . Response response = new com . tinify . Client ( key ) . request ( Client . Method . POST , "/shrink" ) ; "<AssertPlaceHolder>" ; } request ( com . tinify . Client$Method , java . lang . String ) { if ( method . equals ( com . tinify . Client . Method . POST ) ) { return request ( method , endpoint , okhttp3 . RequestBody . create ( null , new byte [ ] { } ) ) ; } else { return request ( method , endpoint , ( ( okhttp3 . RequestBody ) ( null ) ) ) ; } }
|
org . junit . Assert . assertEquals ( "ok" , new java . lang . String ( response . body ) )
|
testAddWebElement ( ) { io . selendroid . server . model . KnownElements ke = new io . selendroid . server . model . KnownElements ( ) ; java . lang . String webElementId = ":wdc:123456789" ; java . lang . String id = ke . add ( createWebElement ( webElementId , ke ) ) ; "<AssertPlaceHolder>" ; } createWebElement ( java . lang . String , io . selendroid . server . model . KnownElements ) { android . webkit . WebView view = mock ( android . webkit . WebView . class ) ; io . selendroid . server . model . SelendroidWebDriver driver = mock ( io . selendroid . server . model . SelendroidWebDriver . class ) ; return new io . selendroid . server . model . AndroidWebElement ( id , view , driver , ke ) ; }
|
org . junit . Assert . assertEquals ( webElementId , id )
|
testGetTasksAssignedAsRecipientWithUserLangOneTask ( ) { java . lang . String str = "(with<sp>(new<sp>Task())<sp>{<sp>priority<sp>=<sp>55,<sp>taskData<sp>=<sp>(with(<sp>new<sp>TaskData())<sp>{<sp>}<sp>),<sp>" ; str += "peopleAssignments<sp>=<sp>(with<sp>(<sp>new<sp>PeopleAssignments()<sp>)<sp>{<sp>recipients<sp>=<sp>[new<sp>User('Bobba<sp>Fet')],businessAdministrators<sp>=<sp>[<sp>new<sp>User('Administrator')<sp>],<sp>})," ; str += "name<sp>=<sp>'This<sp>is<sp>my<sp>task<sp>name'})" ; org . kie . api . task . model . Task task = org . jbpm . services . task . impl . factories . TaskFactory . evalTask ( new java . io . StringReader ( str ) ) ; taskService . addTask ( task , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; java . util . List < org . kie . api . task . model . TaskSummary > tasks = taskService . getTasksAssignedAsRecipient ( "Bobba<sp>Fet" ) ; "<AssertPlaceHolder>" ; } size ( ) { return data . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , tasks . size ( ) )
|
reverseIterationFromKeyIsInOrder ( ) { for ( java . util . Map < java . lang . Integer , java . lang . Integer > any : net . java . quickcheck . generator . CombinedGeneratorsIterables . someMaps ( net . java . quickcheck . generator . PrimitiveGenerators . integers ( ) , net . java . quickcheck . generator . PrimitiveGenerators . integers ( ) ) ) { java . util . List < java . lang . Integer > expectedKeys = new java . util . ArrayList ( any . keySet ( ) ) ; java . lang . Integer fromKey = ( ( expectedKeys . isEmpty ( ) ) || ( net . java . quickcheck . generator . PrimitiveGenerators . booleans ( ) . next ( ) ) ) ? net . java . quickcheck . generator . PrimitiveGenerators . integers ( ) . next ( ) : expectedKeys . get ( 0 ) ; java . util . Collections . sort ( expectedKeys ) ; java . util . Collections . reverse ( expectedKeys ) ; java . util . Iterator < java . lang . Integer > iterator = expectedKeys . iterator ( ) ; while ( iterator . hasNext ( ) ) { java . lang . Integer next = iterator . next ( ) ; if ( ( next . compareTo ( fromKey ) ) > 0 ) { iterator . remove ( ) ; } } com . google . firebase . database . collection . ImmutableSortedMap < java . lang . Integer , java . lang . Integer > map = com . google . firebase . database . collection . RBTreeSortedMap . fromMap ( any , com . google . firebase . database . collection . RBTreeSortedMapTest . IntComparator ) ; java . util . List < java . lang . Integer > actualKeys = new java . util . ArrayList ( ) ; java . util . Iterator < Map . Entry < java . lang . Integer , java . lang . Integer > > mapIterator = map . reverseIteratorFrom ( fromKey ) ; while ( mapIterator . hasNext ( ) ) { actualKeys . add ( mapIterator . next ( ) . getKey ( ) ) ; } "<AssertPlaceHolder>" ; } } getKey ( ) { return null ; }
|
org . junit . Assert . assertEquals ( expectedKeys , actualKeys )
|
elem_match_returns_true_when_at_least_one_value_in_array_matches ( ) { com . redhat . lightblue . query . QueryExpression expr = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'array':'field7','elemMatch':{'field':'elemf3','op':'>','rvalue':3}}" ) ; com . redhat . lightblue . eval . QueryEvaluator eval = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( expr , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext context = eval . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; }
|
org . junit . Assert . assertTrue ( context . getResult ( ) )
|
testSortOverProjectSort ( ) { final org . apache . calcite . tools . RelBuilder builder = org . apache . calcite . tools . RelBuilder . create ( org . apache . calcite . test . RelBuilderTest . config ( ) . build ( ) ) ; builder . scan ( "EMP" ) . sort ( 0 ) . project ( builder . field ( 1 ) ) . limit ( 0 , 1 ) . build ( ) ; org . apache . calcite . rel . RelNode root = builder . scan ( "EMP" ) . sort ( 0 ) . project ( com . google . common . collect . Lists . newArrayList ( builder . field ( 1 ) ) , com . google . common . collect . Lists . newArrayList ( "F1" ) ) . limit ( 0 , 1 ) . project ( builder . field ( "F1" ) ) . build ( ) ; java . lang . String expected = "LogicalProject(F1=[$1])\n" + ( "<sp>LogicalSort(sort0=[$0],<sp>dir0=[ASC],<sp>fetch=[1])\n" + "<sp>LogicalTableScan(table=[[scott,<sp>EMP]])\n" ) ; "<AssertPlaceHolder>" ; } hasTree ( java . lang . String ) { return org . apache . calcite . test . Matchers . compose ( org . hamcrest . core . Is . is ( value ) , ( input ) -> { return org . apache . calcite . util . Util . toLinux ( org . apache . calcite . plan . RelOptUtil . toString ( input ) ) ; } ) ; }
|
org . junit . Assert . assertThat ( root , org . apache . calcite . test . Matchers . hasTree ( expected ) )
|
testGetTbResultObservations ( ) { "<AssertPlaceHolder>" ; org . junit . Assert . fail ( "Not<sp>implemented." ) ; } getTbResultObservations ( org . openhealthtools . mdht . uml . cda . pilot . TBResultsSection ) { if ( ( org . openhealthtools . mdht . uml . cda . pilot . operations . TBResultsSectionOperations . GET_TB_RESULT_OBSERVATIONS__EOCL_QRY ) == null ) { org . eclipse . ocl . ecore . OCL . Helper helper = org . openhealthtools . mdht . uml . cda . pilot . operations . EOCL_ENV . createOCLHelper ( ) ; helper . setOperationContext ( TBPNPackage . Literals . TB_RESULTS_SECTION , TBPNPackage . Literals . TB_RESULTS_SECTION . getEAllOperations ( ) . get ( 58 ) ) ; try { org . openhealthtools . mdht . uml . cda . pilot . operations . TBResultsSectionOperations . GET_TB_RESULT_OBSERVATIONS__EOCL_QRY = helper . createQuery ( org . openhealthtools . mdht . uml . cda . pilot . operations . TBResultsSectionOperations . GET_TB_RESULT_OBSERVATIONS__EOCL_EXP ) ; } catch ( org . eclipse . ocl . ParserException pe ) { throw new java . lang . UnsupportedOperationException ( pe . getLocalizedMessage ( ) ) ; } } org . eclipse . ocl . ecore . OCL . Query query = org . openhealthtools . mdht . uml . cda . pilot . operations . EOCL_ENV . createQuery ( org . openhealthtools . mdht . uml . cda . pilot . operations . TBResultsSectionOperations . GET_TB_RESULT_OBSERVATIONS__EOCL_QRY ) ; @ org . openhealthtools . mdht . uml . cda . pilot . operations . SuppressWarnings ( "unchecked" ) java . util . Collection < org . openhealthtools . mdht . uml . cda . pilot . TBResultObservation > result = ( ( java . util . Collection < org . openhealthtools . mdht . uml . cda . pilot . TBResultObservation > ) ( query . evaluate ( tbResultsSection ) ) ) ; return new org . eclipse . emf . common . util . BasicEList . UnmodifiableEList < org . openhealthtools . mdht . uml . cda . pilot . TBResultObservation > ( result . size ( ) , result . toArray ( ) ) ; }
|
org . junit . Assert . assertNotNull ( org . openhealthtools . mdht . uml . cda . pilot . operations . TBResultsSectionOperations . getTbResultObservations ( null ) )
|
testACosh ( ) { org . nd4j . linalg . api . ndarray . INDArray in = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 3 , 20 , DataType . DOUBLE ) ; org . nd4j . linalg . api . ndarray . INDArray out = org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . api . ops . impl . transforms . strict . ACosh ( in . dup ( ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( in . shape ( ) ) ; for ( int i = 0 ; i < ( in . length ( ) ) ; i ++ ) { double x = in . getDouble ( i ) ; double y = java . lang . Math . log ( ( x + ( ( java . lang . Math . sqrt ( ( x - 1 ) ) ) * ( java . lang . Math . sqrt ( ( x + 1 ) ) ) ) ) ) ; exp . putScalar ( i , y ) ; } "<AssertPlaceHolder>" ; } putScalar ( long [ ] , int ) { return putScalar ( indexes , ( ( double ) ( value ) ) ) ; }
|
org . junit . Assert . assertEquals ( exp , out )
|
hasToStringWhichPrintsMethodName ( ) { java . lang . reflect . Method method = org . junit . runners . model . FrameworkMethodTest . ClassWithDummyMethod . class . getMethod ( "dummyMethod" ) ; org . junit . runners . model . FrameworkMethod frameworkMethod = new org . junit . runners . model . FrameworkMethod ( method ) ; "<AssertPlaceHolder>" ; } toString ( ) { return method . toString ( ) ; }
|
org . junit . Assert . assertTrue ( frameworkMethod . toString ( ) . contains ( "dummyMethod" ) )
|
filtersResourcesDuplicatedInAppAndPluginClassLoader ( ) { appClassLoader . addResource ( org . mule . runtime . core . internal . util . CompositeClassLoaderTestCase . RESOURCE_NAME , APP_LOADED_RESOURCE ) ; pluginClassLoader . addResource ( org . mule . runtime . core . internal . util . CompositeClassLoaderTestCase . RESOURCE_NAME , APP_LOADED_RESOURCE ) ; org . mule . runtime . core . internal . util . CompositeClassLoader compositeApplicationClassLoader = new org . mule . runtime . core . internal . util . CompositeClassLoader ( appClassLoader , pluginClassLoader ) ; java . util . Enumeration < java . net . URL > resources = compositeApplicationClassLoader . getResources ( org . mule . runtime . core . internal . util . CompositeClassLoaderTestCase . RESOURCE_NAME ) ; java . util . List < java . net . URL > expectedResources = new java . util . LinkedList < java . net . URL > ( ) ; expectedResources . add ( APP_LOADED_RESOURCE ) ; expectedResources . add ( APP_LOADED_RESOURCE ) ; "<AssertPlaceHolder>" ; } equalTo ( java . util . Collection ) { return new org . mule . tck . util . EnumerationMatcher ( items ) ; }
|
org . junit . Assert . assertThat ( resources , org . mule . tck . util . EnumerationMatcher . equalTo ( expectedResources ) )
|
updateProperty ( ) { org . apache . jackrabbit . oak . plugins . document . Path path = org . apache . jackrabbit . oak . plugins . document . Path . fromString ( "/foo" ) ; org . apache . jackrabbit . oak . plugins . document . CommitBuilder builder = new org . apache . jackrabbit . oak . plugins . document . CommitBuilder ( ns , null ) ; builder . updateProperty ( path , "p" , "v" ) ; org . apache . jackrabbit . oak . plugins . document . Commit c = builder . build ( ns . newRevision ( ) ) ; org . apache . jackrabbit . oak . plugins . document . UpdateOp up = c . getUpdateOperationForNode ( path ) ; org . apache . jackrabbit . oak . plugins . document . UpdateOp . Operation op = up . getChanges ( ) . get ( new org . apache . jackrabbit . oak . plugins . document . UpdateOp . Key ( "p" , c . getRevision ( ) ) ) ; "<AssertPlaceHolder>" ; } getRevision ( ) { return revision ; }
|
org . junit . Assert . assertNotNull ( op )
|
testFindWithBadPatternPathNotMatchingSubelement ( ) { final com . allanbank . mongodb . bson . element . BooleanElement subElement = new com . allanbank . mongodb . bson . element . BooleanElement ( "1" , false ) ; final com . allanbank . mongodb . bson . impl . RootDocument element = new com . allanbank . mongodb . bson . impl . RootDocument ( subElement ) ; final java . util . List < com . allanbank . mongodb . bson . Element > elements = element . find ( com . allanbank . mongodb . bson . Element . class , "(" ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = ( HEADER_SIZE ) + 10 ; size += com . allanbank . mongodb . bson . io . StringEncoder . utf8Size ( myDatabaseName ) ; size += com . allanbank . mongodb . bson . io . StringEncoder . utf8Size ( myCollectionName ) ; size += myQuery . size ( ) ; return size ; }
|
org . junit . Assert . assertEquals ( 0 , elements . size ( ) )
|
testPostDeserialize ( ) { org . talend . components . marketo . wizard . MarketoComponentWizardBaseProperties mprops = mock ( org . talend . components . marketo . wizard . MarketoComponentWizardBaseProperties . class ) ; when ( mprops . postDeserialize ( eq ( 0 ) , any ( org . talend . daikon . serialize . PostDeserializeSetup . class ) , eq ( false ) ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; } postDeserialize ( int , org . talend . daikon . serialize . PostDeserializeSetup , boolean ) { boolean result = super . postDeserialize ( version , setup , persistent ) ; setupMainSchemaListener ( ) ; return result ; }
|
org . junit . Assert . assertTrue ( props . postDeserialize ( 0 , null , false ) )
|
testInstatiationOfStringValueAndCastToValue ( ) { eu . stratosphere . types . StringValue stringValue = eu . stratosphere . util . InstantiationUtil . instantiate ( eu . stratosphere . types . StringValue . class , eu . stratosphere . types . Value . class ) ; "<AssertPlaceHolder>" ; } instantiate ( java . lang . Class , java . lang . Class ) { if ( clazz == null ) { throw new java . lang . NullPointerException ( ) ; } if ( ( castTo != null ) && ( ! ( castTo . isAssignableFrom ( clazz ) ) ) ) { throw new java . lang . RuntimeException ( ( ( ( ( "The<sp>class<sp>'" + ( clazz . getName ( ) ) ) + "'<sp>is<sp>not<sp>a<sp>subclass<sp>of<sp>'" ) + ( castTo . getName ( ) ) ) + "'<sp>as<sp>is<sp>required." ) ) ; } return eu . stratosphere . util . InstantiationUtil . instantiate ( clazz ) ; }
|
org . junit . Assert . assertNotNull ( stringValue )
|
clearEmptyStringSetMap ( ) { com . emc . storageos . db . client . model . StringSetMap map = new com . emc . storageos . db . client . model . StringSetMap ( ) ; map . clear ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return _list . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , map . size ( ) )
|
stringFormat1 ( ) { final org . exist . xquery . value . DurationValue dv = new org . exist . xquery . value . DurationValue ( "P1Y2M3DT1H2M3S" ) ; "<AssertPlaceHolder>" ; } getStringValue ( ) { if ( ( ( prefix ) != null ) && ( ( prefix . length ( ) ) > 0 ) ) { return ( ( prefix ) + ( org . exist . dom . QName . COLON ) ) + ( localPart ) ; } return localPart ; }
|
org . junit . Assert . assertEquals ( "P1Y2M3DT1H2M3S" , dv . getStringValue ( ) )
|
delegatesToJDKForNextBoolean ( ) { "<AssertPlaceHolder>" ; } nextBoolean ( ) { return delegate . nextBoolean ( ) ; }
|
org . junit . Assert . assertTrue ( source . nextBoolean ( ) )
|
shouldPassBecauseCorrectSecret ( ) { byte [ ] secret = new byte [ 20 ] ; java . util . Random r = new java . security . SecureRandom ( ) ; r . nextBytes ( secret ) ; byte [ ] hash = network . thunder . core . etc . Tools . hashSecret ( secret ) ; network . thunder . core . communication . layer . high . RevocationHash revocationHash = new network . thunder . core . communication . layer . high . RevocationHash ( 10 , 10 , secret , hash ) ; "<AssertPlaceHolder>" ; } check ( ) { if ( ( child ) == 0 ) { return true ; } if ( ( secret ) == null ) { return false ; } return java . util . Arrays . equals ( secretHash , network . thunder . core . etc . Tools . hashSecret ( secret ) ) ; }
|
org . junit . Assert . assertTrue ( revocationHash . check ( ) )
|
testGetDate ( ) { java . util . Date now = new java . util . Date ( ) ; java . lang . String date = org . zalando . catwatch . backend . util . StringParser . getISO8601StringForDate ( now ) ; java . util . Date d = org . zalando . catwatch . backend . util . StringParser . parseIso8601Date ( date ) ; "<AssertPlaceHolder>" ; d = org . zalando . catwatch . backend . util . StringParser . parseIso8601Date ( "2015-05-28T14:09:17+02:00" ) ; d = org . zalando . catwatch . backend . util . StringParser . parseIso8601Date ( "1990-12-31T15:59:59-08:00" ) ; d = org . zalando . catwatch . backend . util . StringParser . parseIso8601Date ( "1996-12-19T16:39:57-08:00" ) ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "class<sp>Language<sp>{\n" ) ; sb . append ( "<sp>name:<sp>" ) . append ( name ) . append ( "\n" ) ; sb . append ( "<sp>projectsCount:<sp>" ) . append ( projectsCount ) . append ( "\n" ) ; sb . append ( "<sp>percentage:<sp>" ) . append ( percentage ) . append ( "\n" ) ; sb . append ( "}\n" ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( now . toString ( ) , d . toString ( ) )
|
testConstructor ( ) { org . openhealthtools . mdht . uml . cda . ihe . operations . FamilyMedicalHistorySectionOperations obj = new org . openhealthtools . mdht . uml . cda . ihe . operations . FamilyMedicalHistorySectionOperations ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
testCoverBoundingBoxWithMaxHashesThrowsException ( ) { com . github . davidmoten . geo . Coverage coverage = com . github . davidmoten . geo . GeoHash . coverBoundingBoxMaxHashes ( com . github . davidmoten . geo . GeoHashTest . SCHENECTADY_LAT , com . github . davidmoten . geo . GeoHashTest . SCHENECTADY_LON , com . github . davidmoten . geo . GeoHashTest . HARTFORD_LAT , com . github . davidmoten . geo . GeoHashTest . HARTFORD_LON , 0 ) ; "<AssertPlaceHolder>" ; } coverBoundingBoxMaxHashes ( double , double , double , double , int ) { com . github . davidmoten . geo . CoverageLongs coverage = null ; int startLength = com . github . davidmoten . geo . GeoHash . hashLengthToCoverBoundingBox ( topLeftLat , topLeftLon , bottomRightLat , bottomRightLon ) ; if ( startLength == 0 ) startLength = 1 ; for ( int length = startLength ; length <= ( com . github . davidmoten . geo . GeoHash . MAX_HASH_LENGTH ) ; length ++ ) { com . github . davidmoten . geo . CoverageLongs c = com . github . davidmoten . geo . GeoHash . coverBoundingBoxLongs ( topLeftLat , topLeftLon , bottomRightLat , bottomRightLon , length ) ; if ( ( c . getCount ( ) ) > maxHashes ) return coverage == null ? null : new com . github . davidmoten . geo . Coverage ( coverage ) ; else coverage = c ; } return new com . github . davidmoten . geo . Coverage ( coverage ) ; }
|
org . junit . Assert . assertNull ( coverage )
|
TestMembershipSparse ( ) { org . hillview . table . api . IMutableMembershipSet mms = org . hillview . table . membership . MembershipSetFactory . create ( 100 , 10 ) ; for ( int i = 5 ; i < 100 ; i += 2 ) mms . add ( i ) ; org . hillview . table . api . IMembershipSet MS = mms . seal ( ) ; final org . hillview . table . api . IRowIterator iter = MS . getIterator ( ) ; int tmp = iter . getNextRow ( ) ; final org . hillview . utils . IntSet IS1 = new org . hillview . utils . IntSet ( ) ; while ( tmp >= 0 ) { tmp = iter . getNextRow ( ) ; IS1 . add ( tmp ) ; } "<AssertPlaceHolder>" ; final org . hillview . table . api . IMembershipSet mySample = MS . sample ( 20 , 0 ) ; final org . hillview . table . api . IRowIterator sIter = mySample . getIterator ( ) ; int curr = sIter . getNextRow ( ) ; while ( curr >= 0 ) { curr = sIter . getNextRow ( ) ; } } size ( ) { return this . size ; }
|
org . junit . Assert . assertTrue ( ( ( mms . size ( ) ) == ( IS1 . size ( ) ) ) )
|
testIsReparentable ( ) { org . eclipse . swt . widgets . Control control = new org . eclipse . swt . widgets . Button ( shell , org . eclipse . swt . SWT . NONE ) ; "<AssertPlaceHolder>" ; } isReparentable ( ) { checkWidget ( ) ; return false ; }
|
org . junit . Assert . assertTrue ( control . isReparentable ( ) )
|
testIsNotEmptyWithNull ( ) { final java . util . Collection < ? > coll = null ; "<AssertPlaceHolder>" ; } isNotEmpty ( java . util . Collection ) { return ! ( org . apache . commons . collections4 . CollectionUtils . isEmpty ( coll ) ) ; }
|
org . junit . Assert . assertEquals ( false , org . apache . commons . collections4 . CollectionUtils . isNotEmpty ( coll ) )
|
testBuildDate ( ) { "<AssertPlaceHolder>" ; } getBuildDate ( ) { return org . apache . openmeetings . util . Version . buildDate ; }
|
org . junit . Assert . assertNotNull ( org . apache . openmeetings . util . Version . getBuildDate ( ) )
|
currentNodeInPipes ( ) { io . burt . jmespath . Expression < java . lang . Object > expected = Sequence ( Sequence ( Sequence ( Sequence ( Current ( ) , Property ( "foo" ) ) , Current ( ) ) , Property ( "bar" ) ) , Current ( ) ) ; io . burt . jmespath . Expression < java . lang . Object > actual = compile ( "@<sp>|<sp>foo<sp>|<sp>@<sp>|<sp>bar<sp>|<sp>@" ) ; "<AssertPlaceHolder>" ; } compile ( java . lang . String ) { return runtime . compile ( str ) ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) )
|
findFunctionsByNameInNamespaceForRootResourceTypeWithoutFunctionsOnSubTypeAndSubTypResourceShouldReturnEmptyList ( ) { ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity rootResourceType = createRootResourceType ( ) ; ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity subResourceType = createSubResourceType ( rootResourceType ) ; ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceEntity resource = createResourceWithType ( "amw" , 1000 , subResourceType ) ; when ( resourceRepositoryMock . loadWithFunctionsAndMiksForId ( resource . getId ( ) ) ) . thenReturn ( resource ) ; ch . puzzle . itc . mobiliar . business . function . control . List < ch . puzzle . itc . mobiliar . business . function . entity . AmwFunctionEntity > functionsWithName = functionService . findFunctionsByNameInNamespace ( rootResourceType , FUNCTION_A . getName ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { if ( ( ( asProperties ) != null ) && ( ! ( asProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( nodeProperties ) != null ) && ( ! ( nodeProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( consumerUnit ) != null ) && ( ! ( consumerUnit . isEmpty ( ) ) ) ) { return false ; } return true ; }
|
org . junit . Assert . assertTrue ( functionsWithName . isEmpty ( ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.