input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testStaticContent ( ) { requestBuilder = org . springframework . test . web . servlet . request . MockMvcRequestBuilders . get ( "/tdsCat.css" ) ; org . springframework . test . web . servlet . MvcResult mvc = this . mockMvc . perform ( requestBuilder ) . andReturn ( ) ; "<AssertPlaceHolder>" ; java . lang . String content = mvc . getResponse ( ) . getContentAsString ( ) ; System . out . printf ( "content='%s'%n" , content ) ; } getResponse ( ) { return this . response ; }
org . junit . Assert . assertEquals ( 200 , mvc . getResponse ( ) . getStatus ( ) )
testParse ( ) { java . lang . String e = "EOD-Pair-Strategy:123:Exit:Long*" ; com . sumzerotrading . eod . trading . strategy . TradeReferenceLine expected = new com . sumzerotrading . eod . trading . strategy . TradeReferenceLine ( ) ; expected . correlationId = "123" ; expected . strategy = "EOD-Pair-Strategy" ; expected . side = Side . EXIT ; expected . direction = Direction . LONG ; doReturn ( Direction . LONG ) . when ( testLine ) . parseDirection ( "Long" ) ; doReturn ( Side . EXIT ) . when ( testLine ) . parseSide ( "Exit" ) ; testLine . parse ( e ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( "RoundTrip{" + "correlationId=" ) + ( correlationId ) ) + ",<sp>longEntry=" ) + ( longEntry ) ) + ",<sp>longExit=" ) + ( longExit ) ) + ",<sp>shortEntry=" ) + ( shortEntry ) ) + ",<sp>shortExit=" ) + ( shortExit ) ) + '}' ; }
org . junit . Assert . assertEquals ( expected . toString ( ) , testLine . toString ( ) )
t005UnzipArchive ( ) { java . lang . String fileName = ( at . htl . common . FileUtilsTest . TEMP_PATH ) + "test1_unzip" ; java . lang . String zipFileName = ( at . htl . common . FileUtilsTest . TEMP_PATH ) + "test1.zip" ; "<AssertPlaceHolder>" ; } unzip ( java . lang . String , java . lang . String ) { boolean finished = false ; if ( ! ( zipFileName . contains ( ".zip" ) ) ) { at . htl . common . io . FileUtils . log ( Level . ERROR , ( fileName + "<sp>can<sp>not<sp>be<sp>unzipped!" ) ) ; } else if ( new java . io . File ( fileName ) . exists ( ) ) { at . htl . common . io . FileUtils . log ( Level . ERROR , java . lang . String . format ( "Directory<sp>%s<sp>already<sp>exists!" , fileName ) ) ; } else { at . htl . common . io . FileUtils . createDirectory ( fileName ) ; int length ; byte [ ] buffer = new byte [ 8192 ] ; try { java . util . zip . ZipInputStream zis = new java . util . zip . ZipInputStream ( new java . io . FileInputStream ( zipFileName ) ) ; java . util . zip . ZipEntry ze = zis . getNextEntry ( ) ; while ( ze != null ) { java . io . File newFile = new java . io . File ( ( ( fileName + ( java . io . File . separator ) ) + ( ze . getName ( ) ) ) ) ; at . htl . common . io . FileUtils . log ( Level . INFO , ( "Unzipping<sp>to<sp>" + ( newFile . getAbsolutePath ( ) ) ) ) ; at . htl . common . io . FileUtils . createDirectory ( newFile . getParent ( ) ) ; java . io . FileOutputStream fos = new java . io . FileOutputStream ( newFile ) ; while ( ( length = zis . read ( buffer ) ) > 0 ) { fos . write ( buffer , 0 , length ) ; } fos . close ( ) ; zis . closeEntry ( ) ; ze = zis . getNextEntry ( ) ; } zis . closeEntry ( ) ; zis . close ( ) ; at . htl . common . io . FileUtils . log ( Level . INFO , ( "finished<sp>unzipping<sp>" + zipFileName ) ) ; finished = true ; } catch ( java . io . IOException e ) { at . htl . common . io . FileUtils . log ( Level . ERROR , ( "error<sp>by<sp>unzipping<sp>" + zipFileName ) ) ; e . printStackTrace ( ) ; } } return finished ; }
org . junit . Assert . assertTrue ( at . htl . common . io . FileUtils . unzip ( zipFileName , fileName ) )
testRemoveObsFromEmpty ( ) { org . hipparchus . stat . regression . SimpleRegression regression = new org . hipparchus . stat . regression . SimpleRegression ( ) ; regression . removeData ( removeX , removeY ) ; "<AssertPlaceHolder>" ; } getN ( ) { return n ; }
org . junit . Assert . assertEquals ( regression . getN ( ) , 0 )
testAcceptNoDeletedFile ( ) { java . io . File file = new java . io . File ( "123" ) ; "<AssertPlaceHolder>" ; } accepts ( java . io . File ) { return hudson . plugins . jobConfigHistory . NonDeletedFileFilter . INSTANCE . accept ( file ) ; }
org . junit . Assert . assertTrue ( hudson . plugins . jobConfigHistory . NonDeletedFileFilter . accepts ( file ) )
testFlagIsAllowed ( ) { Flags . LIQUIDS_FLOWING_OUT . setSetting ( world , true ) ; new world . bentobox . bentobox . listeners . flags . worldsettings . LiquidsFlowingOutListener ( ) . onLiquidFlow ( event ) ; "<AssertPlaceHolder>" ; } isCancelled ( ) { return cancelled ; }
org . junit . Assert . assertFalse ( event . isCancelled ( ) )
testFileBody ( ) { System . out . println ( "testFileBody" ) ; org . wiztools . restclient . RequestBean expResult = getRequestBeanWithoutBody ( ) ; org . wiztools . restclient . ContentType ct = new org . wiztools . restclient . ContentTypeBean ( "text/plain" , org . wiztools . commons . Charsets . UTF_8 ) ; org . wiztools . restclient . ReqEntityFileBean body = new org . wiztools . restclient . ReqEntityFileBean ( new java . io . File ( "/etc/hosts" ) , ct ) ; expResult . setBody ( body ) ; org . wiztools . restclient . Request actual = p . getRequestFromFile ( new java . io . File ( "src/test/resources/reqBodyFile.rcq" ) ) ; "<AssertPlaceHolder>" ; } getRequestFromFile ( java . io . File ) { nu . xom . Document doc = getDocumentFromFile ( f ) ; return xml2Request ( doc ) ; }
org . junit . Assert . assertEquals ( expResult , actual )
testListSnapshotsRequest ( ) { try { com . fit2cloud . aliyun . ecs . model . request . ListSnapshotsRequest r = new com . fit2cloud . aliyun . ecs . model . request . ListSnapshotsRequest ( "cn-beijing" ) ; r . setSnapshotIds ( "['s-25mikyl6y']" ) ; com . fit2cloud . aliyun . ecs . model . response . ListSnapshotsResponse response = client . listSnapshots ( r ) ; System . out . println ( ( "testListSnapshotsRequest<sp>::<sp>" + response ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } listSnapshots ( com . fit2cloud . aliyun . ecs . model . request . ListSnapshotsRequest ) { return ( ( com . fit2cloud . aliyun . ecs . model . response . ListSnapshotsResponse ) ( listPageableData ( listSnapshotsRequest , "DescribeSnapshots" , com . fit2cloud . aliyun . ecs . model . response . ListSnapshotsResponse . class ) ) ) ; }
org . junit . Assert . assertTrue ( true )
testGetConceptsWithNoChildren ( ) { org . mockito . Mockito . when ( thesaurusConceptService . getTopTermThesaurusConceptsCount ( "fake1" ) ) . thenReturn ( ( ( long ) ( 0 ) ) ) ; fr . mcc . ginco . extjs . view . node . IThesaurusListNode actualNode = folderGenerator . getConcepts ( "fake1" ) ; "<AssertPlaceHolder>" ; } getChildren ( ) { return children ; }
org . junit . Assert . assertNotNull ( actualNode . getChildren ( ) )
testMultipleOffers ( ) { com . sun . sgs . test . app . util . TestScalableDeque . txnScheduler . runTask ( new com . sun . sgs . test . util . TestAbstractKernelRunnable ( ) { public void run ( ) throws com . sun . sgs . test . app . util . Exception { com . sun . sgs . app . util . ScalableDeque < java . lang . Integer > d = new com . sun . sgs . app . util . ScalableDeque < java . lang . Integer > ( ) ; for ( int i = 0 ; i < 10 ; ++ i ) d . offer ( i ) ; for ( int i = 0 ; i < 10 ; ++ i ) "<AssertPlaceHolder>" ; } } , com . sun . sgs . test . app . util . TestScalableDeque . taskOwner ) ; } remove ( ) { checkRemoved ( ) ; java . lang . Object obj = ref . get ( ) ; if ( obj instanceof com . sun . sgs . impl . util . WrappedSerializable . Wrapper ) { com . sun . sgs . app . AppContext . getDataManager ( ) . removeObject ( obj ) ; } ref = null ; }
org . junit . Assert . assertEquals ( i , ( ( int ) ( d . remove ( ) ) ) )
testConstant ( ) { final org . hipparchus . linear . RealMatrix a = org . hipparchus . linear . MatrixUtils . createRealIdentityMatrix ( 1 ) ; final org . hipparchus . linear . RealMatrix b = null ; final org . hipparchus . linear . RealVector u = null ; final org . hipparchus . linear . RealMatrix q = org . hipparchus . linear . MatrixUtils . createRealDiagonalMatrix ( new double [ ] { 1.0E-5 } ) ; final org . hipparchus . filtering . kalman . ProcessEstimate initial = new org . hipparchus . filtering . kalman . ProcessEstimate ( 0 , org . hipparchus . linear . MatrixUtils . createRealVector ( new double [ ] { 10.0 } ) , q ) ; "<AssertPlaceHolder>" ; final java . util . List < org . hipparchus . filtering . kalman . Reference > referenceData = org . hipparchus . filtering . kalman . Reference . loadReferenceData ( 1 , 1 , "constant-value.txt" ) ; final java . util . stream . Stream < org . hipparchus . filtering . kalman . SimpleMeasurement > measurements = referenceData . stream ( ) . map ( ( r ) -> new org . hipparchus . filtering . kalman . SimpleMeasurement ( r . getTime ( ) , r . getZ ( ) , org . hipparchus . linear . MatrixUtils . createRealDiagonalMatrix ( new double [ ] { 0.1 } ) ) ) ; final org . hipparchus . filtering . kalman . linear . LinearKalmanFilter < org . hipparchus . filtering . kalman . SimpleMeasurement > filter = new org . hipparchus . filtering . kalman . linear . LinearKalmanFilter ( new org . hipparchus . linear . CholeskyDecomposer ( 1.0E-15 , 1.0E-15 ) , ( measurement ) -> new org . hipparchus . filtering . kalman . linear . LinearEvolution ( a , b , u , q , org . hipparchus . linear . MatrixUtils . createRealMatrix ( new double [ ] [ ] { { 1.0 } } ) ) , initial ) ; measurements . map ( ( measurement ) -> filter . estimationStep ( measurement ) ) . forEach ( ( estimate ) -> { for ( org . hipparchus . filtering . kalman . Reference r : referenceData ) { if ( r . sameTime ( estimate . getTime ( ) ) ) { r . checkState ( estimate . getState ( ) , 1.0E-15 ) ; r . checkCovariance ( estimate . getCovariance ( ) , 3.0E-19 ) ; return ; } } } ) ; } getInnovationCovariance ( ) { return innovationCovarianceMatrix ; }
org . junit . Assert . assertNull ( initial . getInnovationCovariance ( ) )
testTrainC_RegressionDataSet ( ) { System . out . println ( "train" ) ; for ( jsat . distributions . multivariate . MultivariateKDE kde : new jsat . distributions . multivariate . MultivariateKDE [ ] { new jsat . distributions . multivariate . MetricKDE ( ) , new jsat . distributions . multivariate . ProductKDE ( ) } ) { jsat . regression . NadarayaWatson instance = new jsat . regression . NadarayaWatson ( kde ) ; int tries = 3 ; do { if ( jsat . TestTools . regressEvalLinear ( instance ) ) break ; } while ( ( tries -- ) > 0 ) ; "<AssertPlaceHolder>" ; } } regressEvalLinear ( jsat . regression . Regressor ) { return jsat . TestTools . regressEvalLinear ( instance , 500 , 100 ) ; }
org . junit . Assert . assertTrue ( ( tries >= 0 ) )
publishWithNoModuleAtForge ( ) { org . apache . maven . execution . MavenSession session = packageModule ( "test_module_d" ) ; com . puppetlabs . geppetto . forge . maven . plugin . Publish publish = ( ( com . puppetlabs . geppetto . forge . maven . plugin . Publish ) ( lookupConfiguredMojo ( session , newMojoExecution ( "publish" ) ) ) ) ; "<AssertPlaceHolder>" ; try { publish . execute ( ) ; } catch ( org . apache . maven . plugin . MojoFailureException e ) { org . junit . Assert . fail ( ( "Publishing<sp>of<sp>OK<sp>releaase<sp>failed<sp>when<sp>there<sp>was<sp>no<sp>module:<sp>" + ( e . getMessage ( ) ) ) ) ; } } newMojoExecution ( java . lang . String ) { org . apache . maven . plugin . descriptor . MojoDescriptor mojoDescriptor = getMojoDescriptors ( ) . get ( goal ) ; org . junit . Assert . assertNotNull ( mojoDescriptor ) ; org . apache . maven . plugin . MojoExecution execution = new org . apache . maven . plugin . MojoExecution ( mojoDescriptor ) ; finalizeMojoConfiguration ( execution ) ; return execution ; }
org . junit . Assert . assertNotNull ( publish )
testMissingBasePath ( ) { java . io . File baseDir = new java . io . File ( com . google . common . io . Files . createTempDir ( ) , "subdir" ) ; org . apache . uima . analysis_engine . AnalysisEngine consumer = org . apache . uima . fit . factory . AnalysisEngineFactory . createEngine ( uk . gov . dstl . baleen . consumers . utils . TestFileConsumer . class , uk . gov . dstl . baleen . uima . utils . TypeSystemSingleton . getTypeSystemDescriptionInstance ( ) , uk . gov . dstl . baleen . consumers . utils . AbstractBaleenFileConsumerTest . BASE_PATH , baseDir . getPath ( ) ) ; jCas . setDocumentText ( uk . gov . dstl . baleen . consumers . utils . AbstractBaleenFileConsumerTest . TEXT ) ; org . apache . uima . jcas . tcas . DocumentAnnotation da = ( ( org . apache . uima . jcas . tcas . DocumentAnnotation ) ( jCas . getDocumentAnnotationFs ( ) ) ) ; da . setSourceUri ( uk . gov . dstl . baleen . consumers . utils . AbstractBaleenFileConsumerTest . FILENAME ) ; consumer . process ( jCas ) ; java . lang . String s = org . apache . uima . util . FileUtils . file2String ( new java . io . File ( baseDir , uk . gov . dstl . baleen . consumers . utils . AbstractBaleenFileConsumerTest . FILENAME ) ) ; "<AssertPlaceHolder>" ; } process ( org . apache . uima . jcas . JCas ) { monitor . trace ( ( "Starting:<sp>" + ( getClass ( ) . getSimpleName ( ) ) ) ) ; monitor . startFunction ( "process" ) ; doProcess ( aJCas ) ; monitor . finishFunction ( "process" ) ; monitor . persistCounts ( ) ; monitor . trace ( ( "Finished:<sp>" + ( getClass ( ) . getSimpleName ( ) ) ) ) ; }
org . junit . Assert . assertEquals ( uk . gov . dstl . baleen . consumers . utils . AbstractBaleenFileConsumerTest . TEXT , s )
testUniqueOnUpdate ( ) { final com . orientechnologies . orient . core . metadata . schema . OSchema schema = db . getMetadata ( ) . getSchema ( ) ; com . orientechnologies . orient . core . metadata . schema . OClass userClass = schema . createClass ( "User" ) ; userClass . createProperty ( "MailAddress" , OType . STRING ) . createIndex ( OClass . INDEX_TYPE . UNIQUE ) ; com . orientechnologies . orient . core . record . impl . ODocument john = new com . orientechnologies . orient . core . record . impl . ODocument ( "User" ) ; john . field ( "MailAddress" , "john@doe.com" ) ; db . save ( john ) ; com . orientechnologies . orient . core . record . impl . ODocument jane = new com . orientechnologies . orient . core . record . impl . ODocument ( "User" ) ; jane . field ( "MailAddress" , "jane@doe.com" ) ; com . orientechnologies . orient . core . record . impl . ODocument id = jane . save ( ) ; db . save ( jane ) ; try { com . orientechnologies . orient . core . record . impl . ODocument toUp = db . load ( id . getIdentity ( ) ) ; toUp . field ( "MailAddress" , "john@doe.com" ) ; db . save ( toUp ) ; org . junit . Assert . fail ( "Expected<sp>record<sp>duplicate<sp>exception" ) ; } catch ( com . orientechnologies . orient . core . storage . ORecordDuplicatedException ex ) { } com . orientechnologies . orient . core . record . impl . ODocument fromDb = db . load ( id . getIdentity ( ) ) ; "<AssertPlaceHolder>" ; } field ( java . lang . Object ) { if ( ! ( fields . contains ( iField ) ) ) fields . add ( iField ) ; return this ; }
org . junit . Assert . assertEquals ( fromDb . field ( "MailAddress" ) , "jane@doe.com" )
testSet_IMolecule_IMolecule ( ) { org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; org . openscience . cdk . interfaces . IAtomContainer target = sp . parseSmiles ( "C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C" ) ; org . openscience . cdk . interfaces . IAtomContainer query = sp . parseSmiles ( "Nc1ccccc1" ) ; org . openscience . smsd . algorithm . rgraph . CDKMCSHandler smsd1 = new org . openscience . smsd . algorithm . rgraph . CDKMCSHandler ( query , target , true , false , false ) ; "<AssertPlaceHolder>" ; } getFirstAtomMapping ( ) { if ( allAtomMCS . iterator ( ) . hasNext ( ) ) { return allAtomMCS . iterator ( ) . next ( ) ; } return new org . openscience . smsd . AtomAtomMapping ( source , target ) ; }
org . junit . Assert . assertNotNull ( smsd1 . getFirstAtomMapping ( ) )
getJoinedFolderDeeperLeftFolder ( ) { java . io . File lhsFolder = new java . io . File ( org . apache . maven . shared . project . utils . ProjectUtilsTest . ROOT_FOLDER , "src" ) ; java . io . File rhsFolder = org . apache . maven . shared . project . utils . ProjectUtilsTest . ROOT_FOLDER ; "<AssertPlaceHolder>" ; } getJoinedFolder ( java . io . File , org . apache . maven . model . Model ) { java . io . File joinedFolder = baseDirectory ; for ( java . lang . String module : org . apache . maven . shared . project . utils . ProjectUtils . getAllModules ( model ) . keySet ( ) ) { java . io . File moduleFile = org . apache . maven . shared . project . utils . ProjectUtils . getModuleFile ( baseDirectory , module ) ; org . apache . maven . model . Model submodel = org . apache . maven . shared . project . utils . ProjectUtils . readModel ( moduleFile ) ; java . io . File modulesJoinedFolder = org . apache . maven . shared . project . utils . ProjectUtils . getJoinedFolder ( moduleFile . getParentFile ( ) , submodel ) ; joinedFolder = org . apache . maven . shared . project . utils . ProjectUtils . getJoinedFolder ( joinedFolder , modulesJoinedFolder ) ; } return joinedFolder ; }
org . junit . Assert . assertEquals ( rhsFolder , org . apache . maven . shared . project . utils . ProjectUtils . getJoinedFolder ( lhsFolder , rhsFolder ) )
testGetLocale_fallsBackToSystemLocale_withoutClientInfo ( ) { fakeClient ( mock ( org . eclipse . rap . rwt . client . Client . class ) ) ; java . util . Locale locale = uiSession . getLocale ( ) ; "<AssertPlaceHolder>" ; } getDefault ( ) { return org . eclipse . ui . internal . UIPlugin . inst ; }
org . junit . Assert . assertSame ( java . util . Locale . getDefault ( ) , locale )
printWriterTest ( ) { com . sap . hcp . cf . logging . common . converter . LineWriter lineWriter = new com . sap . hcp . cf . logging . common . converter . LineWriter ( ) ; java . io . PrintWriter printWriter = new java . io . PrintWriter ( lineWriter ) ; printWriter . print ( "this<sp>is<sp>the<sp>first<sp>line" ) ; printWriter . print ( "this<sp>is<sp>the<sp>second<sp>line" ) ; java . util . List < java . lang . String > lines = lineWriter . getLines ( ) ; "<AssertPlaceHolder>" ; printWriter . close ( ) ; } getLines ( ) { return lines ; }
org . junit . Assert . assertThat ( lines , org . hamcrest . Matchers . contains ( "this<sp>is<sp>the<sp>first<sp>line" , "this<sp>is<sp>the<sp>second<sp>line" ) )
getCatalogOps ( ) { "<AssertPlaceHolder>" ; } getCatalogOps ( ) { return catalogOps ; }
org . junit . Assert . assertEquals ( template . getCatalogOps ( ) , catalogOps )
testGenerateNameIdException ( ) { java . lang . String nameId = com . onelogin . saml2 . util . Util . generateNameId ( null , null , null ) ; "<AssertPlaceHolder>" ; } generateNameId ( java . lang . String , java . lang . String , java . lang . String ) { return com . onelogin . saml2 . util . Util . generateNameId ( value , spnq , format , null ) ; }
org . junit . Assert . assertNull ( nameId )
testInvestigateNonEffectiveQueries ( ) { java . io . File file = builder . addLocLocation ( testFileName , "1" ) . buildInvestigateSQlQueries ( "DefUser" , "test" ) . writeToXmlFile ( ) ; "<AssertPlaceHolder>" ; } writeToXmlFile ( ) { org . v8LogScanner . logsCfg . File logFile = null ; for ( java . nio . file . Path path : cfgPaths ) { logFile = new org . v8LogScanner . logsCfg . File ( path . toUri ( ) ) ; fsys . writeInNewFile ( content , path . toString ( ) ) ; } return logFile ; }
org . junit . Assert . assertTrue ( file . exists ( ) )
testCreate ( ) { org . oscarehr . common . model . DemographicCust entity = new org . oscarehr . common . model . DemographicCust ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . setId ( 1 ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
org . junit . Assert . assertNotNull ( entity . getId ( ) )
insertParagraphWithInvalidReplNameTest ( ) { when ( interpreterFactory . getInterpreter ( anyString ( ) , anyString ( ) , eq ( "invalid" ) , anyString ( ) ) ) . thenReturn ( null ) ; org . apache . zeppelin . notebook . Note note = new org . apache . zeppelin . notebook . Note ( "test" , "" , interpreterFactory , interpreterSettingManager , paragraphJobListener , credentials , noteEventListener ) ; org . apache . zeppelin . notebook . Paragraph p1 = note . addNewParagraph ( AuthenticationInfo . ANONYMOUS ) ; p1 . setText ( "%invalid<sp>" ) ; org . apache . zeppelin . notebook . Paragraph p2 = note . insertNewParagraph ( note . getParagraphs ( ) . size ( ) , AuthenticationInfo . ANONYMOUS ) ; "<AssertPlaceHolder>" ; } getText ( ) { return text ; }
org . junit . Assert . assertNull ( p2 . getText ( ) )
shouldAddTermsFromRedisOnGetCommand ( ) { when ( localParamsMock . get ( "command" ) ) . thenReturn ( "get" ) ; when ( localParamsMock . get ( "key" ) ) . thenReturn ( "simpleKey" ) ; when ( localParamsMock . get ( QueryParsing . V ) ) . thenReturn ( "string_field" ) ; when ( jedisMock . get ( any ( byte [ ] . class ) ) ) . thenReturn ( "val" . getBytes ( ) ) ; when ( requestMock . getSchema ( ) ) . thenReturn ( schema ) ; when ( schema . getQueryAnalyzer ( ) ) . thenReturn ( new org . apache . lucene . analysis . standard . StandardAnalyzer ( ) ) ; redisQParser = new com . sematext . solr . redis . RedisQParser ( "string_field" , localParamsMock , paramsMock , requestMock , commandHandler ) ; final org . apache . lucene . search . Query query = redisQParser . parse ( ) ; verify ( jedisMock ) . get ( "simpleKey" . getBytes ( ) ) ; org . apache . lucene . search . IndexSearcher searcher = new org . apache . lucene . search . IndexSearcher ( new org . apache . lucene . index . MultiReader ( ) ) ; final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = com . sematext . solr . redis . TestRedisQParser . extractTerms ( searcher , query ) ; "<AssertPlaceHolder>" ; } extractTerms ( org . apache . lucene . search . IndexSearcher , org . apache . lucene . search . Query ) { final com . sematext . solr . redis . Set < org . apache . lucene . index . Term > terms = new com . sematext . solr . redis . HashSet ( ) ; org . apache . lucene . search . Query rewrittenQuery = searcher . rewrite ( query ) ; if ( rewrittenQuery instanceof org . apache . lucene . search . ConstantScoreQuery ) { org . apache . lucene . search . ConstantScoreQuery constantScoreQuery = ( ( org . apache . lucene . search . ConstantScoreQuery ) ( rewrittenQuery ) ) ; rewrittenQuery = constantScoreQuery . getQuery ( ) ; } searcher . createNormalizedWeight ( rewrittenQuery , true ) . extractTerms ( terms ) ; return terms ; }
org . junit . Assert . assertEquals ( 1 , terms . size ( ) )
testAggregate1 ( ) { org . nd4j . linalg . api . ndarray . INDArray arrayX = org . nd4j . linalg . factory . Nd4j . ones ( 10 ) ; org . nd4j . linalg . api . ndarray . INDArray arrayY = org . nd4j . linalg . factory . Nd4j . zeros ( 10 ) ; org . nd4j . linalg . api . ndarray . INDArray exp1 = org . nd4j . linalg . factory . Nd4j . ones ( 10 ) ; org . nd4j . linalg . api . ops . aggregates . impl . AggregateAxpy axpy = new org . nd4j . linalg . api . ops . aggregates . impl . AggregateAxpy ( arrayX , arrayY , 1.0F ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( axpy ) ; "<AssertPlaceHolder>" ; } exec ( org . nd4j . linalg . cpu . nativecpu . ops . Op ) { checkForCompression ( op ) ; if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp ) { org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp s = ( ( org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp ) ( op ) ) ; exec ( s ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . GradientOp ) { op . exec ( ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . TransformOp ) { org . nd4j . linalg . cpu . nativecpu . ops . TransformOp t = ( ( org . nd4j . linalg . cpu . nativecpu . ops . TransformOp ) ( op ) ) ; exec ( t ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ) { org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ac = ( ( org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ) ( op ) ) ; exec ( ac ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation ) { org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation iac = ( ( org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation ) ( op ) ) ; exec ( iac ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp ) { org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp broadcastOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp ) ( op ) ) ; exec ( broadcastOp , broadcastOp . getDimension ( ) ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp ) { org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp shapeOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp ) ( op ) ) ; exec ( shapeOp ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . RandomOp ) { org . nd4j . linalg . cpu . nativecpu . ops . RandomOp rngOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . RandomOp ) ( op ) ) ; exec ( rngOp , org . nd4j . linalg . factory . Nd4j . getRandom ( ) ) ; } return op ; }
org . junit . Assert . assertEquals ( exp1 , arrayY )
testRemoveProject ( ) { final org . kie . workbench . common . screens . examples . model . ImportProject project = mock ( org . kie . workbench . common . screens . examples . model . ImportProject . class ) ; model . addProject ( project ) ; page . removeProject ( project ) ; "<AssertPlaceHolder>" ; verify ( pageStatusChangedEvent , times ( 1 ) ) . fire ( any ( org . uberfire . ext . widgets . core . client . wizards . WizardPageStatusChangeEvent . class ) ) ; } getProjects ( ) { return projects ; }
org . junit . Assert . assertEquals ( 0 , model . getProjects ( ) . size ( ) )
testcalculateBalance ( ) { sessionStatefull = util . KnowledgeSessionHelper . getStatefulKnowledgeSessionWithCallback ( droolscours . Testlesson2bis . kieContainer , "lesson2-session" ) ; droolscours . util . OutputDisplay display = new droolscours . util . OutputDisplay ( ) ; sessionStatefull . setGlobal ( "showResults" , display ) ; droolscours . Account a = new droolscours . Account ( ) ; a . setAccountno ( 1 ) ; a . setBalance ( 0 ) ; sessionStatefull . insert ( a ) ; droolscours . CashFlow cash1 = new droolscours . CashFlow ( ) ; cash1 . setAccountNo ( 1 ) ; cash1 . setAmount ( 1000 ) ; cash1 . setMvtDate ( util . DateHelper . getDate ( "2016-01-15" ) ) ; cash1 . setType ( CashFlow . CREDIT ) ; sessionStatefull . insert ( cash1 ) ; droolscours . CashFlow cash2 = new droolscours . CashFlow ( ) ; cash2 . setAccountNo ( 1 ) ; cash2 . setAmount ( 500 ) ; cash2 . setMvtDate ( util . DateHelper . getDate ( "2016-02-15" ) ) ; cash2 . setType ( CashFlow . DEBIT ) ; sessionStatefull . insert ( cash2 ) ; droolscours . CashFlow cash3 = new droolscours . CashFlow ( ) ; cash3 . setAccountNo ( 1 ) ; cash3 . setAmount ( 1000 ) ; cash3 . setMvtDate ( util . DateHelper . getDate ( "2016-04-15" ) ) ; cash3 . setType ( CashFlow . CREDIT ) ; sessionStatefull . insert ( cash3 ) ; droolscours . AccountingPeriod period = new droolscours . AccountingPeriod ( ) ; period . setStartDate ( util . DateHelper . getDate ( "2016-01-01" ) ) ; period . setEndDate ( util . DateHelper . getDate ( "2016-03-31" ) ) ; sessionStatefull . insert ( period ) ; sessionStatefull . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } getBalance ( ) { return balance ; }
org . junit . Assert . assertTrue ( ( ( a . getBalance ( ) ) == 500 ) )
testForEachLambda ( ) { org . apache . commons . jexl3 . JexlScript e = org . apache . commons . jexl3 . JEXL . createScript ( "(x)->{<sp>for<sp>(i<sp>:<sp>1..2)<sp>{<sp>continue;<sp>var<sp>y<sp>=<sp>function()<sp>{<sp>42;<sp>}<sp>break;<sp>}<sp>}" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( e )
testReadInt ( ) { int n = ( ( int ) ( ( java . lang . Math . random ( ) ) * 1000 ) ) ; write ( java . lang . Integer . toString ( n ) ) ; "<AssertPlaceHolder>" ; } readInt ( ) { return java . lang . Integer . valueOf ( org . kocakosm . pitaya . io . Scanf . readString ( ) ) ; }
org . junit . Assert . assertEquals ( n , org . kocakosm . pitaya . io . Scanf . readInt ( ) )
testNullableFieldSchemaValidation ( ) { io . cdap . plugin . CSVParser . Config config = new io . cdap . plugin . CSVParser . Config ( "DEFAULT" , null , "body" , io . cdap . plugin . CSVParserTest . OUTPUT1 . toString ( ) ) ; io . cdap . plugin . CSVParser csvParser = new io . cdap . plugin . CSVParser ( config ) ; csvParser . validateInputSchema ( io . cdap . plugin . CSVParserTest . NULLABLE_INPUT ) ; "<AssertPlaceHolder>" ; } parseAndValidateOutputSchema ( io . cdap . cdap . api . data . schema . Schema ) { try { io . cdap . cdap . api . data . schema . Schema outputSchema = io . cdap . cdap . api . data . schema . Schema . parseJson ( this . config . schema ) ; if ( inputSchema != null ) { for ( io . cdap . cdap . api . data . schema . Schema . Field field : inputSchema . getFields ( ) ) { if ( ( outputSchema . getField ( field . getName ( ) ) ) != null ) { io . cdap . cdap . api . data . schema . Schema out = outputSchema . getField ( field . getName ( ) ) . getSchema ( ) ; io . cdap . cdap . api . data . schema . Schema in = field . getSchema ( ) ; if ( ! ( in . equals ( out ) ) ) { throw new java . lang . IllegalArgumentException ( ( ( "Input<sp>field<sp>'" + ( field . getName ( ) ) ) + "'<sp>does<sp>not<sp>have<sp>same<sp>output<sp>schema<sp>as<sp>input." ) ) ; } } } } return outputSchema ; } catch ( java . io . IOException e ) { throw new java . lang . IllegalArgumentException ( "Format<sp>of<sp>schema<sp>specified<sp>is<sp>invalid.<sp>Please<sp>check<sp>the<sp>format." ) ; } }
org . junit . Assert . assertEquals ( io . cdap . plugin . CSVParserTest . OUTPUT1 , csvParser . parseAndValidateOutputSchema ( io . cdap . plugin . CSVParserTest . NULLABLE_INPUT ) )
testHashCodeDeterministic ( ) { hw4 . hash . ComplexOomage so = hw4 . hash . ComplexOomage . randomComplexOomage ( ) ; int hashCode = so . hashCode ( ) ; for ( int i = 0 ; i < 100 ; i += 1 ) { "<AssertPlaceHolder>" ; } } hashCode ( ) { int hashCode = 1 ; for ( int i = 0 ; i < ( length ( ) ) ; i += 1 ) { hashCode *= 31 ; } return hashCode ; }
org . junit . Assert . assertEquals ( hashCode , so . hashCode ( ) )
getLoggedInUserId ( ) { java . lang . String userId = ctrl . getLoggedInUserId ( ) ; "<AssertPlaceHolder>" ; } getLoggedInUserId ( ) { java . lang . String userId = ctrl . getLoggedInUserId ( ) ; org . junit . Assert . assertEquals ( "mockUserId" , userId ) ; }
org . junit . Assert . assertEquals ( "mockUserId" , userId )
embeddedNoTx ( ) { com . orientechnologies . orient . core . record . impl . ODocument doc = new com . orientechnologies . orient . core . record . impl . ODocument ( "City" ) ; doc . field ( "name" , "London" ) ; db . save ( doc ) ; doc = new com . orientechnologies . orient . core . record . impl . ODocument ( "City" ) ; doc . field ( "name" , "Rome" ) ; db . save ( doc ) ; java . util . List < com . orientechnologies . orient . core . record . impl . ODocument > results = db . command ( new com . orientechnologies . orient . core . sql . OCommandSQL ( "select<sp>from<sp>City<sp>where<sp>name<sp>lucene<sp>'London'" ) ) . execute ( ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented<sp>yet" ) ; }
org . junit . Assert . assertEquals ( results . size ( ) , 1 )
test_no_acks_register_listener ( ) { java . lang . String topic = "test_no_acks_register_listener" ; createTopic ( topic , 1 ) ; com . github . milenkovicm . kafka . ProducerProperties properties = new com . github . milenkovicm . kafka . ProducerProperties ( ) ; properties . override ( ProducerProperties . NETTY_DEBUG_PIPELINE , true ) ; properties . override ( ProducerProperties . DATA_ACK , Acknowledgment . WAIT_FOR_NO_ONE ) ; com . github . milenkovicm . kafka . KafkaProducer producer = new com . github . milenkovicm . kafka . KafkaProducer ( "localhost" , START_PORT , topic , properties ) ; producer . connect ( ) . sync ( ) ; com . github . milenkovicm . kafka . KafkaTopic kafkaTopic = producer . topic ( ) ; final io . netty . util . concurrent . Future send = kafkaTopic . send ( null , freeLaterBuffer ( com . github . milenkovicm . kafka . ListenerTest . TEST_MESSAGE . getBytes ( ) ) ) ; send . addListener ( new io . netty . util . concurrent . FutureListener ( ) { @ com . github . milenkovicm . kafka . Override public void operationComplete ( io . netty . util . concurrent . Future future ) throws com . github . milenkovicm . kafka . Exception { org . junit . Assert . fail ( "shouldn't<sp>get<sp>here" ) ; } } ) ; final java . util . List < kafka . consumer . KafkaStream < byte [ ] , byte [ ] > > consume = consume ( topic ) ; final kafka . consumer . KafkaStream < byte [ ] , byte [ ] > stream = consume . get ( 0 ) ; final kafka . consumer . ConsumerIterator < byte [ ] , byte [ ] > messages = stream . iterator ( ) ; "<AssertPlaceHolder>" ; producer . disconnect ( ) . sync ( ) ; } get ( com . github . milenkovicm . kafka . ProducerProperties$ProducerProperty ) { java . util . Objects . requireNonNull ( property , "property" ) ; V v = ( ( V ) ( properties . get ( property ) ) ) ; return v == null ? property . defaultValue ( ) : v ; }
org . junit . Assert . assertThat ( com . github . milenkovicm . kafka . ListenerTest . TEST_MESSAGE , org . hamcrest . CoreMatchers . is ( new java . lang . String ( messages . next ( ) . message ( ) ) ) )
testCompressNullReference ( ) { "<AssertPlaceHolder>" ; } compressReference ( org . sagebionetworks . repo . model . Reference ) { if ( dto == null ) { return null ; } try ( java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; java . io . BufferedOutputStream buff = new java . io . BufferedOutputStream ( out ) ; java . util . zip . GZIPOutputStream zipper = new java . util . zip . GZIPOutputStream ( buff ) ; java . io . Writer zipWriter = new java . io . OutputStreamWriter ( zipper , org . sagebionetworks . repo . model . jdo . JDOSecondaryPropertyUtils . UTF8 ) ) { com . thoughtworks . xstream . XStream xstream = org . sagebionetworks . repo . model . jdo . JDOSecondaryPropertyUtils . createXStream ( ) ; xstream . toXML ( dto , zipWriter ) ; zipWriter . close ( ) ; return out . toByteArray ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . IllegalArgumentException ( e ) ; } }
org . junit . Assert . assertNull ( org . sagebionetworks . repo . model . jdo . JDOSecondaryPropertyUtils . compressReference ( null ) )
simpleQueryWithoutBindingSetInvalidProperty ( ) { final org . apache . rya . mongodb . MongoDBRyaDAO dao = new org . apache . rya . mongodb . MongoDBRyaDAO ( ) ; try { dao . setConf ( conf ) ; dao . init ( ) ; final org . apache . rya . api . domain . StatementMetadata metadata = new org . apache . rya . api . domain . StatementMetadata ( ) ; metadata . addMetadata ( new org . apache . rya . api . domain . RyaIRI ( "http://createdBy" ) , new org . apache . rya . api . domain . RyaType ( "Doug" ) ) ; metadata . addMetadata ( new org . apache . rya . api . domain . RyaIRI ( "http://createdOn" ) , new org . apache . rya . api . domain . RyaType ( org . eclipse . rdf4j . model . vocabulary . XMLSchema . DATE , "2017-02-15" ) ) ; final org . apache . rya . api . domain . RyaStatement statement = new org . apache . rya . api . domain . RyaStatement ( new org . apache . rya . api . domain . RyaIRI ( "http://Joe" ) , new org . apache . rya . api . domain . RyaIRI ( "http://worksAt" ) , new org . apache . rya . api . domain . RyaType ( "CoffeeShop" ) , new org . apache . rya . api . domain . RyaIRI ( "http://context" ) , "" , metadata ) ; dao . add ( statement ) ; final org . eclipse . rdf4j . query . parser . sparql . SPARQLParser parser = new org . eclipse . rdf4j . query . parser . sparql . SPARQLParser ( ) ; final org . eclipse . rdf4j . query . parser . ParsedQuery pq = parser . parseQuery ( query , null ) ; final java . util . List < org . eclipse . rdf4j . query . algebra . StatementPattern > spList = org . eclipse . rdf4j . query . algebra . helpers . StatementPatternCollector . process ( pq . getTupleExpr ( ) ) ; final org . apache . rya . indexing . statement . metadata . matching . StatementMetadataNode < org . apache . rya . mongodb . MongoDBRdfConfiguration > node = new org . apache . rya . indexing . statement . metadata . matching . StatementMetadataNode ( spList , conf ) ; final org . eclipse . rdf4j . common . iteration . CloseableIteration < org . eclipse . rdf4j . query . BindingSet , org . eclipse . rdf4j . query . QueryEvaluationException > iteration = node . evaluate ( new org . eclipse . rdf4j . query . algebra . evaluation . QueryBindingSet ( ) ) ; final java . util . List < org . eclipse . rdf4j . query . BindingSet > bsList = new java . util . ArrayList ( ) ; while ( iteration . hasNext ( ) ) { bsList . add ( iteration . next ( ) ) ; } "<AssertPlaceHolder>" ; dao . delete ( statement , conf ) ; } finally { dao . destroy ( ) ; } } size ( ) { if ( ! ( init ) ) { indexCache = org . apache . rya . indexing . pcj . matching . PCJOptimizerUtilities . getValidPCJs ( getIndices ( ) ) ; init = true ; } return indexCache . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , bsList . size ( ) )
originalSmazCTest ( ) { java . lang . String [ ] strings = new java . lang . String [ ] { "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" 2 , "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" 3 , "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" 7 , "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 4 , "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 7 , "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 3 , "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 8 , "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 1 , "Mi<sp>illumino<sp>di<sp>immenso" , "try<sp>it<sp>against<sp>urls" , "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" 5 , "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 2 , "http://github.com/antirez/smaz/tree/master" } ; java . lang . String expectedOutput = "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" + ( ( ( ( ( ( ( ( ( ( ( "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" 4 + "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 5 ) + "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 9 ) + "\'Smaz<sp>is<sp>a<sp>simple<sp>compression<sp>library\'<sp>compressed<sp>by<sp>39%\n" ) + "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 0 ) + "\'and<sp>now<sp>a<sp>few<sp>italian<sp>sentences:\'<sp>compressed<sp>by<sp>41%\n" ) + "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" 0 ) + "\'This<sp>is<sp>a<sp>small<sp>string\'<sp>compressed<sp>by<sp>50%\n" 6 ) + "\'try<sp>it<sp>against<sp>urls\'<sp>compressed<sp>by<sp>37%\n" ) + "\'http://google.com\'<sp>compressed<sp>by<sp>59%\n" ) + "\'http://programming.reddit.com\'<sp>compressed<sp>by<sp>52%\n" ) + "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" 1 ) ; java . lang . StringBuilder output = new java . lang . StringBuilder ( ) ; for ( java . lang . String str : strings ) { byte [ ] origBytes = str . getBytes ( ) ; System . out . println ( str ) ; byte [ ] compressedBytes = smaz . compress ( str ) ; int comprlevel = 100 - ( ( 100 * ( compressedBytes . length ) ) / ( origBytes . length ) ) ; if ( comprlevel < 0 ) { output . append ( java . lang . String . format ( "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" 6 , str , ( - comprlevel ) ) ) ; } else { output . append ( java . lang . String . format ( "\'%s\'<sp>compressed<sp>by<sp>%d%%\n" , str , comprlevel ) ) ; } } "<AssertPlaceHolder>" ; } compress ( java . lang . String ) { confirmOnlyAscii ( inString ) ; java . lang . StringBuilder verb = new java . lang . StringBuilder ( ) ; com . github . icedrake . jsmaz . ByteArrayOutputStream output = new com . github . icedrake . jsmaz . ByteArrayOutputStream ( ) ; java . nio . CharBuffer charBuffer = java . nio . CharBuffer . wrap ( inString ) ; int inlen ; while ( ( inlen = charBuffer . remaining ( ) ) > 0 ) { int h1 ; int h2 ; int h3 ; charBuffer . mark ( ) ; h1 = h2 = ( charBuffer . get ( ) ) << 3 ; if ( inlen > 1 ) h2 += charBuffer . get ( ) ; if ( inlen > 2 ) { h3 = h2 ^ ( charBuffer . get ( ) ) ; } else { h3 = 0 ; } charBuffer . reset ( ) ; int j = 7 ; if ( j > inlen ) j = inlen ; boolean found = false ; for ( ; j > 0 ; j -- ) { java . nio . CharBuffer slot ; if ( j == 1 ) { slot = java . nio . CharBuffer . wrap ( com . github . icedrake . jsmaz . Smaz . CODEBOOK [ ( h1 % 241 ) ] ) ; } else if ( j == 2 ) { slot = java . nio . CharBuffer . wrap ( com . github . icedrake . jsmaz . Smaz . CODEBOOK [ ( h2 % 241 ) ] ) ; } else { slot = java . nio . CharBuffer . wrap ( com . github . icedrake . jsmaz . Smaz . CODEBOOK [ ( h3 % 241 ) ] ) ; } int slotLength = slot . length ( ) ; int slotIndex = 0 ; int slotEndIndex = ( slotIndex + j ) + 1 ; while ( ( slotLength > 0 ) && ( slotEndIndex <= slotLength ) ) { if ( ( ( ( slot . get ( slotIndex ) ) == j ) && ( inlen >= j ) ) && ( slot . subSequence ( ( slotIndex + 1 ) , slotEndIndex ) . toString ( ) . equals ( charBuffer . subSequence ( 0 , j ) . toString ( ) ) ) ) { if ( ( verb . length ( ) ) > 0 ) { outputVerb ( output , verb . toString ( ) ) ; verb . setLength ( 0 ) ; } output . write ( slot . get ( ( ( ( slot . get ( slotIndex ) ) + 1 ) + slotIndex ) ) ) ; charBuffer . position ( ( ( charBuffer . position ( ) ) + j ) ) ; inlen -= j ; found = true ; break ; } else { slotIndex ++ ; slotEndIndex = ( slotIndex + j ) + 1 ; } } } if ( ! found ) { if ( inlen > 0 ) { inlen -- ; verb . append ( charBuffer . subSequence ( 0 , 1 ) . toString ( ) ) ; } charBuffer . position ( ( ( charBuffer . position ( ) ) + 1 ) ) ; } int verbLength = verb . length ( ) ; if ( ( verbLength == 256 ) || ( ( verbLength > 0 ) && ( inlen == 0 ) ) ) { outputVerb ( output , verb . toString ( ) ) ; verb . setLength ( 0 ) ; } } return output . toByteArray ( ) ; }
org . junit . Assert . assertEquals ( expectedOutput , output . toString ( ) )
shouldAppendEnvironmentFromDirectory ( ) { createFileWithContent ( "devenv.goenvironment.json" , this . devenvString ) ; com . tw . go . config . json . JsonConfigCollection result = parser . parseDirectory ( directory ) ; "<AssertPlaceHolder>" ; } getEnvironments ( ) { return environments ; }
org . junit . Assert . assertThat ( result . getEnvironments ( ) . size ( ) , org . hamcrest . core . Is . is ( 1 ) )
testDec9999Next ( ) { org . jfree . data . time . Month next = ( ( org . jfree . data . time . Month ) ( this . dec9999 . next ( ) ) ) ; "<AssertPlaceHolder>" ; } next ( ) { final java . lang . String line = this . buffer ; this . buffer = null ; return line ; }
org . junit . Assert . assertNull ( next )
printsOutKeyMatchingRules ( ) { com . facebook . buck . tools . consistency . RuleKeyLogFilePrinter printer = new com . facebook . buck . tools . consistency . RuleKeyLogFilePrinter ( stream , reader , java . util . Optional . empty ( ) , java . util . Optional . of ( "hash3" ) , Integer . MAX_VALUE ) ; printer . printFile ( logPath ) ; java . lang . String [ ] lines = stream . getOutputLines ( ) ; "<AssertPlaceHolder>" ; validateLines ( ruleKeys . get ( 2 ) , lines [ 0 ] , lines [ 1 ] , lines [ 2 ] ) ; validateLines ( ruleKeys . get ( 3 ) , lines [ 3 ] , lines [ 4 ] , lines [ 5 ] ) ; } getOutputLines ( ) { this . flush ( ) ; return new java . lang . String ( outBytesStream . toByteArray ( ) , 0 , outBytesStream . toByteArray ( ) . length , java . nio . charset . StandardCharsets . UTF_8 ) . split ( java . lang . System . lineSeparator ( ) ) ; }
org . junit . Assert . assertEquals ( 6 , lines . length )
testParseSuccess ( ) { actions = new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( "type" , "aaa" ) ; put ( "edge_node" , "node_01" ) ; } } ; target = new org . o3project . odenos . core . component . network . flow . query . OFPFlowActionCopyTtlOutQuery ( actions ) ; "<AssertPlaceHolder>" ; } parse ( ) { if ( ! ( super . parse ( ) ) ) { return false ; } if ( ! ( org . o3project . odenos . core . component . network . BasicQuery . checkMapExactly ( this . actions , new java . lang . String [ ] { } ) ) ) { return false ; } return true ; }
org . junit . Assert . assertThat ( target . parse ( ) , org . hamcrest . CoreMatchers . is ( true ) )
shouldReturnFalseIfNoNextEvenIfHasNextIsCalledMultipleTimes ( ) { dk . brics . automaton . State initialState = dk . brics . automaton . Automaton . makeEmpty ( ) . getInitialState ( ) ; com . mifmif . common . regex . GenerexIterator iterator = new com . mifmif . common . regex . GenerexIterator ( initialState ) ; boolean hasNext = ( ( iterator . hasNext ( ) ) | ( iterator . hasNext ( ) ) ) | ( iterator . hasNext ( ) ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { if ( found ) { return true ; } if ( steps . isEmpty ( ) ) { return false ; } nextImpl ( ) ; return found ; }
org . junit . Assert . assertThat ( hasNext , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( false ) ) )
testTrashVersionParentBaseModelAndRestoreIsVisible ( ) { org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenHasParent ) ) ; org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenIsAssetableBaseModel ) ) ; org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenIsMoveableFromTrashBaseModel ) ) ; org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenIsUpdatableBaseModel ) ) ; org . junit . Assume . assumeTrue ( ( ( this ) instanceof com . liferay . trash . test . util . WhenIsVersionableBaseModel ) ) ; com . liferay . trash . test . util . WhenIsVersionableBaseModel whenIsVersionableBaseModel = ( ( com . liferay . trash . test . util . WhenIsVersionableBaseModel ) ( this ) ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( group . getGroupId ( ) ) ; com . liferay . portal . kernel . model . BaseModel < ? > parentBaseModel = getParentBaseModel ( group , serviceContext ) ; baseModel = addBaseModel ( parentBaseModel , serviceContext ) ; baseModel = whenIsVersionableBaseModel . expireBaseModel ( baseModel , serviceContext ) ; com . liferay . trash . test . util . WhenIsUpdatableBaseModel whenIsUpdatableBaseModel = ( ( com . liferay . trash . test . util . WhenIsUpdatableBaseModel ) ( this ) ) ; com . liferay . portal . kernel . model . WorkflowedModel workflowedModel = getWorkflowedModel ( baseModel ) ; java . util . List < java . lang . Integer > originalStatuses = new java . util . ArrayList ( ) ; originalStatuses . add ( workflowedModel . getStatus ( ) ) ; serviceContext . setWorkflowAction ( WorkflowConstants . ACTION_PUBLISH ) ; baseModel = whenIsUpdatableBaseModel . updateBaseModel ( ( ( java . lang . Long ) ( baseModel . getPrimaryKeyObj ( ) ) ) , serviceContext ) ; workflowedModel = getWorkflowedModel ( baseModel ) ; originalStatuses . add ( workflowedModel . getStatus ( ) ) ; serviceContext . setWorkflowAction ( WorkflowConstants . ACTION_SAVE_DRAFT ) ; baseModel = whenIsUpdatableBaseModel . updateBaseModel ( ( ( java . lang . Long ) ( baseModel . getPrimaryKeyObj ( ) ) ) , serviceContext ) ; com . liferay . trash . test . util . WhenHasParent whenHasParent = ( ( com . liferay . trash . test . util . WhenHasParent ) ( this ) ) ; workflowedModel = getWorkflowedModel ( baseModel ) ; originalStatuses . add ( workflowedModel . getStatus ( ) ) ; whenHasParent . moveParentBaseModelToTrash ( ( ( java . lang . Long ) ( parentBaseModel . getPrimaryKeyObj ( ) ) ) ) ; com . liferay . trash . test . util . WhenIsMoveableFromTrashBaseModel whenIsMoveableFromTrashBaseModel = ( ( com . liferay . trash . test . util . WhenIsMoveableFromTrashBaseModel ) ( this ) ) ; whenIsMoveableFromTrashBaseModel . moveBaseModelFromTrash ( baseModel , group , serviceContext ) ; com . liferay . trash . test . util . WhenIsAssetableBaseModel whenIsAssetableModel = ( ( com . liferay . trash . test . util . WhenIsAssetableBaseModel ) ( this ) ) ; baseModel = getBaseModel ( ( ( java . lang . Long ) ( baseModel . getPrimaryKeyObj ( ) ) ) ) ; "<AssertPlaceHolder>" ; } isAssetEntryVisible ( com . liferay . portal . kernel . model . ClassedModel , long ) { com . liferay . message . boards . model . MBMessage rootMessage = com . liferay . message . boards . service . MBMessageLocalServiceUtil . getMBMessage ( ( ( com . liferay . message . boards . model . MBThread ) ( classedModel ) ) . getRootMessageId ( ) ) ; return _whenIsAssetable . isAssetEntryVisible ( rootMessage , getAssetClassPK ( rootMessage ) ) ; }
org . junit . Assert . assertTrue ( whenIsAssetableModel . isAssetEntryVisible ( baseModel , getAssetClassPK ( baseModel ) ) )
testGetShardId ( ) { when ( mockRequest . getShardId ( ) ) . thenReturn ( TEST_STRING ) ; java . lang . String actual = adapter . getShardId ( ) ; "<AssertPlaceHolder>" ; } getShardId ( ) { return shard . getShardId ( ) ; }
org . junit . Assert . assertEquals ( TEST_STRING , actual )
testCalculateNextTherapyAdministrationTimeSimple3xNextDay ( ) { final com . marand . thinkmed . medications . dto . TherapyDto therapy = getSimpleConstantTherapy3X500mg ( null ) ; final org . joda . time . DateTime nextTherapyAdministrationTime = administrationTaskCreator . calculateNextTherapyAdministrationTime ( therapy , true , new org . joda . time . DateTime ( 2014 , 2 , 4 , 21 , 0 ) ) ; "<AssertPlaceHolder>" ; } getSimpleConstantTherapy3X500mg ( org . joda . time . DateTime ) { final com . marand . thinkmed . medications . dto . ConstantSimpleTherapyDto therapy = new com . marand . thinkmed . medications . dto . ConstantSimpleTherapyDto ( ) ; therapy . setCompositionUid ( "uid1" ) ; therapy . setEhrOrderName ( "1" ) ; therapy . setStart ( therapyStart ) ; therapy . setDosingFrequency ( new com . marand . thinkmed . medications . dto . DosingFrequencyDto ( com . marand . thinkmed . medications . DosingFrequencyTypeEnum . DAILY_COUNT , 3 ) ) ; therapy . setQuantityUnit ( "mg" ) ; therapy . setMedication ( getMedication ( 222L , "Aspirin" ) ) ; final java . util . List < com . marand . maf . core . data . object . HourMinuteDto > doseTimes = new java . util . ArrayList ( ) ; doseTimes . add ( new com . marand . maf . core . data . object . HourMinuteDto ( 8 , 0 ) ) ; doseTimes . add ( new com . marand . maf . core . data . object . HourMinuteDto ( 13 , 0 ) ) ; doseTimes . add ( new com . marand . maf . core . data . object . HourMinuteDto ( 20 , 0 ) ) ; therapy . setDoseTimes ( doseTimes ) ; therapy . setDoseElement ( getSimpleDoseElement ( 500.0 , null ) ) ; return therapy ; }
org . junit . Assert . assertEquals ( new org . joda . time . DateTime ( 2014 , 2 , 5 , 8 , 0 ) , nextTherapyAdministrationTime )
parseNullTimestamp ( ) { "<AssertPlaceHolder>" ; } parseTimestamp ( java . lang . String ) { final java . util . Date date = org . sentilo . common . utils . DateUtils . stringToDate ( timestamp ) ; return date != null ? date . getTime ( ) : null ; }
org . junit . Assert . assertNull ( org . sentilo . common . utils . DateUtils . parseTimestamp ( null ) )
testRefToAnotherTemplateInSameGroup ( ) { java . lang . String dir = getRandomDir ( ) ; writeFile ( dir , "a.st" , "a()<sp>::=<sp><<<sp><b()><sp>>>\n" ) ; writeFile ( dir , "b.st" , "b()<sp>::=<sp><<bar>>\n" ) ; org . stringtemplate . v4 . test . STGroup group = new org . stringtemplate . v4 . test . STGroupDir ( dir ) ; org . stringtemplate . v4 . test . ST st = group . getInstanceOf ( "a" ) ; java . lang . String expected = "<sp>bar<sp>" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
org . junit . Assert . assertEquals ( expected , result )
shouldRequireDestinationText ( ) { given ( this . navigationContext . getOutcome ( ) ) . willReturn ( "spring:" ) ; "<AssertPlaceHolder>" ; this . thrown . expect ( org . springframework . springfaces . mvc . navigation . IllegalStateException . class ) ; this . thrown . expectMessage ( "The<sp>destination<sp>must<sp>be<sp>specified<sp>for<sp>an<sp>implicit<sp>MVC<sp>navigation<sp>prefixed<sp>'spring:'" ) ; this . resolver . resolve ( this . facesContext , this . navigationContext ) ; } canResolve ( javax . faces . context . FacesContext , org . springframework . springfaces . mvc . navigation . NavigationContext ) { return ( findResolver ( facesContext , navigationContext ) ) != null ; }
org . junit . Assert . assertThat ( this . resolver . canResolve ( this . facesContext , this . navigationContext ) , org . hamcrest . Matchers . is ( true ) )
testPropertyJsonBeanFromScratch ( ) { org . ff4j . property . util . PropertyJsonBean jb = new org . ff4j . property . util . PropertyJsonBean ( ) ; jb . setName ( "name" ) ; jb . setType ( org . ff4j . property . PropertyString . class . getName ( ) ) ; jb . setFixedValues ( org . ff4j . utils . Util . set ( "AMER" , "EUROP" ) ) ; jb . setValue ( "AMER" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( this . getType ( ) ) + "," ) + ( org . ff4j . utils . MappingUtil . fromMap ( getInitParams ( ) ) ) ; }
org . junit . Assert . assertNotNull ( jb . toString ( ) )
testUseText ( ) { final java . util . function . Consumer textConsumer = mock ( java . util . function . Consumer . class ) ; org . kie . workbench . common . stunner . lienzo . toolbox . items . tooltip . PrimitiveTextTooltip cascade = tested . withText ( textConsumer ) ; "<AssertPlaceHolder>" ; verify ( tooltip , times ( 1 ) ) . withText ( eq ( textConsumer ) ) ; } withText ( java . util . function . Consumer ) { text . accept ( this . text ) ; return checkRefresh ( ) ; }
org . junit . Assert . assertEquals ( tested , cascade )
testRootPath ( ) { org . apache . beam . sdk . transforms . display . DisplayData . Path root = DisplayData . Path . root ( ) ; "<AssertPlaceHolder>" ; } getComponents ( ) { return components ; }
org . junit . Assert . assertThat ( root . getComponents ( ) , org . hamcrest . Matchers . empty ( ) )
testWriteImpl ( ) { java . lang . String expected = "package<sp>com.google.gwt.angtulargwt.jsr303;\n" + ( ( ( ( ( ( ( ( "\n" + "import<sp>javax.validation.Validator;\n" ) + "import<sp>com.google.gwt.validation.client.GwtValidation;\n" ) + "import<sp>com.google.gwt.angtulargwt.jsr303.rebind.test.TipModel;\n" ) + "import<sp>com.google.gwt.angtulargwt.jsr303.rebind.test.TopModel;\n" ) + "\n" ) + "@GwtValidation({TipModel.class,TopModel.class})\n" ) + "public<sp>interface<sp>AngularValidatorImpl<sp>extends<sp>javax.validation.Validator<sp>{\n" ) + "}" ) ; java . io . StringWriter sw = new java . io . StringWriter ( ) ; java . io . PrintWriter pw = new java . io . PrintWriter ( sw ) ; java . util . List < java . lang . Class < ? > > input = new java . util . LinkedList < java . lang . Class < ? > > ( ) ; input . add ( com . google . gwt . angtulargwt . jsr303 . rebind . test . TipModel . class ) ; input . add ( com . google . gwt . angtulargwt . jsr303 . rebind . test . TopModel . class ) ; fixture . writeImpl ( null , pw , input ) ; java . lang . String generated = sw . toString ( ) ; System . out . println ( generated ) ; "<AssertPlaceHolder>" ; } writeImpl ( com . google . gwt . core . ext . GeneratorContext , java . io . PrintWriter , java . util . List ) { com . google . gwt . user . rebind . SourceWriter sw = null ; com . google . gwt . user . rebind . ClassSourceFileComposerFactory fac = new com . google . gwt . user . rebind . ClassSourceFileComposerFactory ( com . google . gwt . angtulargwt . jsr303 . rebind . AngularValidatorGenerator . TARGET_PKG , com . google . gwt . angtulargwt . jsr303 . rebind . AngularValidatorGenerator . TARGET_NAME ) ; fac . addImport ( javax . validation . Validator . class . getName ( ) ) ; fac . addImport ( com . google . gwt . validation . client . GwtValidation . class . getName ( ) ) ; for ( java . lang . Class < ? > clazz : beanlist ) { fac . addImport ( clazz . getName ( ) ) ; } fac . makeInterface ( ) ; fac . addImplementedInterface ( javax . validation . Validator . class . getName ( ) ) ; fac . addAnnotationDeclaration ( createAnnotation ( beanlist ) ) ; if ( pw != null ) { sw = fac . createSourceWriter ( context , pw ) ; } sw . outdent ( ) ; sw . print ( "}" ) ; return sw ; }
org . junit . Assert . assertEquals ( expected , generated )
testAdjacentVerticesIteratorRemove ( ) { edu . ucla . sspace . graph . Graph < edu . ucla . sspace . graph . DirectedEdge > g = new edu . ucla . sspace . graph . SparseDirectedGraph ( ) ; for ( int i = 0 ; i < 10 ; ++ i ) { for ( int j = i + 1 ; j < 10 ; ++ j ) { edu . ucla . sspace . graph . DirectedEdge e = new edu . ucla . sspace . graph . SimpleDirectedEdge ( i , j ) ; g . add ( e ) ; } } edu . ucla . sspace . graph . Set < java . lang . Integer > test = new edu . ucla . sspace . graph . HashSet < java . lang . Integer > ( ) ; edu . ucla . sspace . graph . Set < java . lang . Integer > adjacent = g . getNeighbors ( 0 ) ; edu . ucla . sspace . graph . Iterator < java . lang . Integer > it = adjacent . iterator ( ) ; "<AssertPlaceHolder>" ; it . next ( ) ; it . remove ( ) ; } hasNext ( ) { return iter . hasNext ( ) ; }
org . junit . Assert . assertTrue ( it . hasNext ( ) )
testEscapeIgnoresSpaces ( ) { final java . lang . String ctx = "a<sp>c" ; final java . lang . String ctxName = org . apache . logging . log4j . core . jmx . Server . escape ( ctx ) ; "<AssertPlaceHolder>" ; new javax . management . ObjectName ( java . lang . String . format ( LoggerContextAdminMBean . PATTERN , ctxName ) ) ; }
org . junit . Assert . assertEquals ( "a<sp>c" , ctxName )
loadStoredSettingsShouldSetWakeLockToTrueIfSetToTrue ( ) { net . usikkert . kouchat . android . util . RobolectricTestUtils . setWakeLockInTheAndroidSettingsTo ( true ) ; settingsLoader . loadStoredSettings ( context , settings ) ; "<AssertPlaceHolder>" ; } isWakeLockEnabled ( ) { return wakeLockEnabled ; }
org . junit . Assert . assertTrue ( settings . isWakeLockEnabled ( ) )
createValueFactoryWrongType ( ) { org . glassfish . jersey . server . model . Parameter parameter = getParameter ( "test3" , java . lang . String . class ) ; io . robe . common . service . search . SearchFactoryProvider provider = org . mockito . Mockito . mock ( io . robe . common . service . search . SearchFactoryProvider . class ) ; org . mockito . Mockito . when ( provider . createValueFactory ( parameter ) ) . thenCallRealMethod ( ) ; io . robe . common . service . search . SearchFactory factory = ( ( io . robe . common . service . search . SearchFactory ) ( provider . createValueFactory ( parameter ) ) ) ; "<AssertPlaceHolder>" ; } createValueFactory ( org . glassfish . jersey . server . model . Parameter ) { java . lang . Class < ? > paramType = parameter . getRawType ( ) ; io . robe . common . service . search . SearchParam annotation = parameter . getAnnotation ( io . robe . common . service . search . SearchParam . class ) ; if ( ( annotation != null ) && ( paramType . isAssignableFrom ( io . robe . common . service . search . model . SearchModel . class ) ) ) { return new io . robe . common . service . search . SearchFactory ( ) ; } return null ; }
org . junit . Assert . assertNull ( factory )
a_getAllValidImplementorsTest ( ) { java . util . Set < org . geosdi . geoplatform . gml . api . parser . base . parameter . bridge . implementor . BaseParameterValue < ? extends java . lang . Object > > baseParameterValueImplementors = org . geosdi . geoplatform . gml . api . parameter . bridge . BaseParameterValueStoreTest . store . getAllImplementors ( ) ; org . geosdi . geoplatform . gml . api . parameter . bridge . BaseParameterValueStoreTest . logger . info ( "############################BASE_PARAMETER_VALUE_ALL_IMPLEMENTORS<sp>:<sp>{}\n" , baseParameterValueImplementors ) ; "<AssertPlaceHolder>" ; } size ( ) { return list . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( baseParameterValueImplementors . size ( ) ) == 16 ) )
testGetCommandValue ( ) { com . impetus . ankush . agent . utils . Result fixture = new com . impetus . ankush . agent . utils . Result ( ) ; fixture . setError ( "jps<sp>command<sp>not<sp>found" ) ; fixture . setOutput ( "" ) ; fixture . setCommand ( "jps" ) ; fixture . setExitVal ( 1 ) ; java . lang . String result = fixture . getCommand ( ) ; "<AssertPlaceHolder>" ; } getCommand ( ) { return ( ( "echo<sp>\"" + ( this . line ) ) + "\"<sp>>><sp>" ) + ( this . filePath ) ; }
org . junit . Assert . assertEquals ( "jps" , result )
testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist ( ) { long pk1 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; long pk2 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; primaryKeys . add ( pk1 ) ; primaryKeys . add ( pk2 ) ; java . util . Map < java . io . Serializable , com . liferay . invitation . invite . members . model . MemberRequest > memberRequests = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( memberRequests . isEmpty ( ) )
whenResourceIteratorIsCreated_andHasNextIsCalled_thenTrueIsReturned ( ) { rest . RestResource jr = new rest . RestResource ( rest . RestResourceIteratorTest . ISSUE_KEY , rest . RestResourceIteratorTest . BASE_URL ) ; java . util . List < rest . RestResource > jrList = new java . util . ArrayList < rest . RestResource > ( ) ; jrList . add ( jr ) ; it = new rest . RestResourceIterator ( jrList ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return aTestCaseIt . hasNext ( ) ; }
org . junit . Assert . assertTrue ( it . hasNext ( ) )
testListen ( ) { final java . lang . String ID = "new-id" ; org . meridor . perspective . beans . Project project = org . meridor . perspective . backend . EntityGenerator . getProject ( ) ; project . setId ( ID ) ; project . setCloudId ( org . meridor . perspective . worker . fetcher . impl . ProjectModificationListenerTest . CLOUD_ID ) ; project . setTimestamp ( java . time . ZonedDateTime . now ( ) . minus ( 1 , ChronoUnit . DAYS ) ) ; projectsAware . saveProject ( project ) ; java . util . Set < java . lang . String > ids = projectModificationListener . getIds ( org . meridor . perspective . worker . fetcher . impl . ProjectModificationListenerTest . CLOUD_ID , LastModified . LONG_AGO ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { for ( org . meridor . perspective . shell . common . validator . Field c : org . meridor . perspective . shell . common . validator . Field . values ( ) ) { if ( c . name ( ) . equals ( name ) ) { return true ; } } return false ; }
org . junit . Assert . assertThat ( ids , org . hamcrest . Matchers . contains ( ID ) )
testSwapNullShortArray ( ) { final short [ ] array = null ; org . apache . commons . lang3 . ArrayUtils . swap ( array , 0 , 2 ) ; "<AssertPlaceHolder>" ; } swap ( java . lang . Object [ ] , int , int ) { if ( ( array == null ) || ( ( array . length ) == 0 ) ) { return ; } org . apache . commons . lang3 . ArrayUtils . swap ( array , offset1 , offset2 , 1 ) ; }
org . junit . Assert . assertNull ( array )
testGetParametersWithDisabledDefaults ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String name = "LieToMe" ; java . lang . String abbrName = "LTM" ; org . lnu . is . domain . job . type . JobType entity = new org . lnu . is . domain . job . type . JobType ( ) ; entity . setName ( name ) ; entity . setAbbrName ( abbrName ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "name" , name ) ; expected . put ( "abbrName" , abbrName ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
org . junit . Assert . assertEquals ( expected , actual )
testAcquireUsingWithIntValueKey ( ) { net . openhft . chronicle . map . ChronicleMapBuilder < net . openhft . chronicle . map . IntValue , java . lang . CharSequence > builder = net . openhft . chronicle . map . ChronicleMapBuilder . of ( net . openhft . chronicle . map . IntValue . class , net . openhft . chronicle . map . CharSequence . class ) . entries ( 3 ) ; try ( net . openhft . chronicle . map . ChronicleMap < net . openhft . chronicle . map . IntValue , java . lang . CharSequence > map = newInstance ( builder ) ) { net . openhft . chronicle . map . IntValue key = net . openhft . chronicle . values . Values . newHeapInstance ( net . openhft . chronicle . map . IntValue . class ) ; key . setValue ( 1 ) ; java . lang . CharSequence using = new java . lang . StringBuilder ( ) ; try ( net . openhft . chronicle . core . io . Closeable c = map . acquireContext ( key , using ) ) { key . setValue ( 3 ) ; ( ( java . lang . StringBuilder ) ( using ) ) . append ( "Hello" ) ; } key . setValue ( 2 ) ; try ( net . openhft . chronicle . core . io . Closeable c = map . acquireContext ( key , using ) ) { ( ( java . lang . StringBuilder ) ( using ) ) . append ( "World" ) ; } key . setValue ( 1 ) ; "<AssertPlaceHolder>" ; mapChecks ( ) ; } } get ( java . lang . Object ) { return check ( new net . openhft . chronicle . map . ReplicationCheckingMap . Call < K , V > ( ) { @ net . openhft . chronicle . map . Override public java . lang . Object method ( java . util . concurrent . ConcurrentMap < K , V > map ) { return map . get ( key ) ; } } ) ; }
org . junit . Assert . assertEquals ( "Hello" , map . get ( key ) . toString ( ) )
testBepaalTeVervallenVoorkomen ( ) { final nl . bzk . brp . bijhouding . bericht . model . BijhoudingPersoon partner = mock ( nl . bzk . brp . bijhouding . bericht . model . BijhoudingPersoon . class ) ; when ( bericht . getEntiteitVoorObjectSleutel ( nl . bzk . brp . bijhouding . bericht . model . BijhoudingPersoon . class , nl . bzk . brp . bijhouding . bericht . model . CorrectieVervalIdentificatienummersGerelateerdeTest . PARTNER_OBJ_SLEUTEL ) ) . thenReturn ( partner ) ; final nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . PersoonParameters persoonParams = new nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . PersoonParameters ( ) ; final java . lang . String voorkomenSleutel = "1234" ; final nl . bzk . brp . bijhouding . bericht . model . IdentificatienummersElement identElement = builder . maakIdentificatienummersElementVoorVerval ( "ident" , voorkomenSleutel ) ; persoonParams . identificatienummers ( identElement ) ; final nl . bzk . brp . bijhouding . bericht . model . CorrectieVervalIdentificatienummersGerelateerde actie = maakBasisActie ( persoonParams ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonIDHistorie historie = new nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonIDHistorie ( partner ) ; when ( partner . zoekRelatieHistorieVoorVoorkomenSleutel ( voorkomenSleutel , nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonIDHistorie . class ) ) . thenReturn ( historie ) ; "<AssertPlaceHolder>" ; } bepaalTeVervallenVoorkomen ( ) { nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonGeboorteHistorie result = null ; final nl . bzk . brp . bijhouding . bericht . model . BijhoudingPersoon persoon = getPartner ( ) . getPersoonEntiteit ( ) ; final java . lang . String voorkomenSleutel = getPartner ( ) . getGeboorte ( ) . getVoorkomenSleutel ( ) ; if ( ( persoon != null ) && ( voorkomenSleutel != null ) ) { result = persoon . zoekRelatieHistorieVoorVoorkomenSleutel ( voorkomenSleutel , nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonGeboorteHistorie . class ) ; } return result ; }
org . junit . Assert . assertEquals ( historie , actie . bepaalTeVervallenVoorkomen ( ) )
passesQueryParams ( ) { "<AssertPlaceHolder>" ; } sum ( int , int ) { return a + b ; }
org . junit . Assert . assertEquals ( 5 , service . sum ( 2 , 3 ) )
testRemoveAll ( ) { org . geotools . data . DataStore csv = this . getDataStore ( ) ; org . geotools . data . simple . SimpleFeatureStore rows = ( ( org . geotools . data . simple . SimpleFeatureStore ) ( csv . getFeatureSource ( org . geotools . data . csv . CSVDataStoreTest . TYPE_NAME ) ) ) ; rows . removeFeatures ( Filter . INCLUDE ) ; csv = this . getDataStore ( ) ; rows = ( ( org . geotools . data . simple . SimpleFeatureStore ) ( csv . getFeatureSource ( org . geotools . data . csv . CSVDataStoreTest . TYPE_NAME ) ) ) ; org . geotools . data . simple . SimpleFeatureCollection features = rows . getFeatures ( ) ; "<AssertPlaceHolder>" ; } size ( ) { createCollection ( ) ; return imageCollection . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , features . size ( ) )
delete ( ) { final org . apache . rya . indexing . entity . model . Entity entity = org . apache . rya . indexing . entity . model . Entity . builder ( ) . setSubject ( new org . apache . rya . api . domain . RyaIRI ( "urn:GTIN-14/00012345600012" ) ) . setExplicitType ( new org . apache . rya . api . domain . RyaIRI ( "urn:icecream" ) ) . setProperty ( new org . apache . rya . api . domain . RyaIRI ( "urn:icecream" ) , new org . apache . rya . indexing . entity . model . Property ( new org . apache . rya . api . domain . RyaIRI ( "urn:brand" ) , new org . apache . rya . api . domain . RyaType ( org . eclipse . rdf4j . model . vocabulary . XMLSchema . STRING , "Awesome<sp>Icecream" ) ) ) . setProperty ( new org . apache . rya . api . domain . RyaIRI ( "urn:icecream" ) , new org . apache . rya . indexing . entity . model . Property ( new org . apache . rya . api . domain . RyaIRI ( "urn:flavor" ) , new org . apache . rya . api . domain . RyaType ( org . eclipse . rdf4j . model . vocabulary . XMLSchema . STRING , "Chocolate" ) ) ) . build ( ) ; final org . apache . rya . indexing . entity . storage . EntityStorage storage = new org . apache . rya . indexing . entity . storage . mongo . MongoEntityStorage ( super . getMongoClient ( ) , org . apache . rya . indexing . entity . storage . mongo . MongoEntityStorageIT . RYA_INSTANCE_NAME ) ; storage . create ( entity ) ; final boolean deleted = storage . delete ( new org . apache . rya . api . domain . RyaIRI ( "urn:GTIN-14/00012345600012" ) ) ; "<AssertPlaceHolder>" ; } delete ( org . apache . rya . api . domain . RyaIRI ) { requireNonNull ( typeId ) ; try { final org . bson . Document deleted = mongo . getDatabase ( ryaInstanceName ) . getCollection ( org . apache . rya . indexing . entity . storage . mongo . MongoTypeStorage . COLLECTION_NAME ) . findOneAndDelete ( org . apache . rya . indexing . entity . storage . mongo . MongoTypeStorage . makeIdFilter ( typeId ) ) ; return deleted != null ; } catch ( final com . mongodb . MongoException e ) { throw new org . apache . rya . indexing . entity . storage . mongo . TypeStorageException ( ( ( "Could<sp>not<sp>delete<sp>the<sp>Type<sp>with<sp>ID<sp>'" + ( typeId . getData ( ) ) ) + "'." ) , e ) ; } }
org . junit . Assert . assertTrue ( deleted )
test18 ( ) { net . pms . formats . ASS aSS0 = new net . pms . formats . ASS ( ) ; java . lang . String [ ] str_array1 = aSS0 . getSupportedExtensions ( ) ; "<AssertPlaceHolder>" ; } getSupportedExtensions ( ) { return new java . lang . String [ ] { "ogg" , "ogm" , "ogv" } ; }
org . junit . Assert . assertNotNull ( str_array1 )
shouldOptionallyExcludeFields ( ) { java . lang . String expectedResult = "{\"order\":{\"comments\":\"pack<sp>it<sp>nicely,<sp>please\"}}" ; br . com . caelum . vraptor . serialization . gson . GsonJSONSerializationTest . Order order = new br . com . caelum . vraptor . serialization . gson . GsonJSONSerializationTest . Order ( new br . com . caelum . vraptor . serialization . gson . GsonJSONSerializationTest . Client ( "guilherme<sp>silveira" ) , 15.0 , "pack<sp>it<sp>nicely,<sp>please" ) ; serialization . from ( order ) . exclude ( "price" ) . serialize ( ) ; "<AssertPlaceHolder>" ; } result ( ) { return new java . lang . String ( stream . toByteArray ( ) ) ; }
org . junit . Assert . assertThat ( result ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( expectedResult ) ) )
isNotPrimitive ( ) { nl . jqno . equalsverifier . internal . reflection . ObjectContainer foo = new nl . jqno . equalsverifier . internal . reflection . ObjectContainer ( ) ; nl . jqno . equalsverifier . internal . reflection . FieldAccessor fieldAccessor = getAccessorFor ( foo , nl . jqno . equalsverifier . internal . reflection . FieldAccessorTest . FIELD_NAME ) ; "<AssertPlaceHolder>" ; } fieldIsPrimitive ( ) { return getFieldType ( ) . isPrimitive ( ) ; }
org . junit . Assert . assertFalse ( fieldAccessor . fieldIsPrimitive ( ) )
testUseParameterObservable ( ) { int count = db ( ) . select ( "select<sp>name<sp>from<sp>person<sp>where<sp>name<sp>>?" ) . parameters ( rx . Observable . just ( "ALEX" ) ) . count ( ) . toBlocking ( ) . single ( ) ; "<AssertPlaceHolder>" ; } count ( ) { return rx . Observable . create ( new rx . Observable . OnSubscribe < java . lang . Long > ( ) { @ com . github . davidmoten . rx . Override public void call ( rx . Subscriber < ? super java . lang . Long > subscriber ) { subscriber . onNext ( count . get ( ) ) ; subscriber . onCompleted ( ) ; } } ) ; }
org . junit . Assert . assertEquals ( 3 , count )
testAdductionProtonPBReaction ( ) { org . openscience . cdk . reaction . IReactionProcess type = new org . openscience . cdk . reaction . type . AdductionProtonPBReaction ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( type )
testVersionNegotiationFailedHTTTPStatusErrorCode ( ) { exceptionReport = new org . n52 . wps . server . ExceptionReport ( "Test<sp>error" , org . n52 . wps . server . ExceptionReport . VERSION_NEGOTIATION_FAILED ) ; "<AssertPlaceHolder>" ; } getHTTPStatusCode ( ) { switch ( errorKey ) { case org . n52 . wps . server . ExceptionReport . OPERATION_NOT_SUPPORTED : return javax . servlet . http . HttpServletResponse . SC_NOT_IMPLEMENTED ; case org . n52 . wps . server . ExceptionReport . MISSING_PARAMETER_VALUE : return javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ; case org . n52 . wps . server . ExceptionReport . INVALID_PARAMETER_VALUE : return javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ; case org . n52 . wps . server . ExceptionReport . VERSION_NEGOTIATION_FAILED : return javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ; case org . n52 . wps . server . ExceptionReport . INVALID_UPDATE_SEQUENCE : return javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ; case org . n52 . wps . server . ExceptionReport . NO_APPLICABLE_CODE : return javax . servlet . http . HttpServletResponse . SC_INTERNAL_SERVER_ERROR ; default : return javax . servlet . http . HttpServletResponse . SC_INTERNAL_SERVER_ERROR ; } }
org . junit . Assert . assertTrue ( ( ( exceptionReport . getHTTPStatusCode ( ) ) == ( javax . servlet . http . HttpServletResponse . SC_BAD_REQUEST ) ) )
first_loadSysPropFirst_ignoreEnvVars ( ) { org . aeonbits . owner . loaders . SystemLoaderTest . FirstConfig config = org . aeonbits . owner . ConfigFactory . create ( org . aeonbits . owner . loaders . SystemLoaderTest . FirstConfig . class ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNull ( config . path ( ) )
testGetProperties_Resource_Config ( ) { io . vertx . core . json . JsonObject rc = new io . vertx . core . json . JsonObject ( ) . put ( "prop1" , "a" ) ; config . put ( DefaultJerseyOptions . CONFIG_RESOURCE_CONFIG , rc ) ; "<AssertPlaceHolder>" ; } getProperties ( ) { io . vertx . core . json . JsonObject json = null ; io . vertx . core . json . JsonObject tmp ; tmp = config . getJsonObject ( com . englishtown . vertx . jersey . impl . DefaultJerseyOptions . CONFIG_PROPERTIES ) ; if ( tmp != null ) { json = tmp ; } tmp = config . getJsonObject ( com . englishtown . vertx . jersey . impl . DefaultJerseyOptions . CONFIG_RESOURCE_CONFIG ) ; if ( tmp != null ) { if ( json == null ) { json = tmp ; } else { json . mergeIn ( tmp ) ; } } return json == null ? null : json . getMap ( ) ; }
org . junit . Assert . assertEquals ( rc . getMap ( ) , options . getProperties ( ) )
build_response_with_play_directive ( ) { java . util . Optional < com . amazon . ask . model . Response > responseWithBuilder = builder . addAudioPlayerPlayDirective ( PlayBehavior . REPLACE_ALL , 0L , "fooPreviousToken" , "fooToken" , "fooUrl" ) . build ( ) ; com . amazon . ask . model . interfaces . audioplayer . Stream stream = com . amazon . ask . model . interfaces . audioplayer . Stream . builder ( ) . withUrl ( "fooUrl" ) . withToken ( "fooToken" ) . withExpectedPreviousToken ( "fooPreviousToken" ) . withOffsetInMilliseconds ( 0L ) . build ( ) ; com . amazon . ask . model . interfaces . audioplayer . AudioItem audioItem = com . amazon . ask . model . interfaces . audioplayer . AudioItem . builder ( ) . withStream ( stream ) . build ( ) ; com . amazon . ask . model . interfaces . audioplayer . PlayDirective playDirective = com . amazon . ask . model . interfaces . audioplayer . PlayDirective . builder ( ) . withPlayBehavior ( PlayBehavior . REPLACE_ALL ) . withAudioItem ( audioItem ) . build ( ) ; com . amazon . ask . model . Response response = com . amazon . ask . model . Response . builder ( ) . withDirectives ( java . util . Collections . singletonList ( playDirective ) ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { com . amazon . ask . attributes . persistence . impl . DynamoDbPersistenceAdapter persistenceAdapter = null ; if ( ( tableName ) != null ) { com . amazon . ask . attributes . persistence . impl . DynamoDbPersistenceAdapter . Builder persistenceAdapterBuilder = com . amazon . ask . attributes . persistence . impl . DynamoDbPersistenceAdapter . builder ( ) . withTableName ( tableName ) ; if ( ( autoCreateTable ) != null ) { persistenceAdapterBuilder . withAutoCreateTable ( autoCreateTable ) ; } if ( ( partitionKeyGenerator ) != null ) { persistenceAdapterBuilder . withPartitionKeyGenerator ( partitionKeyGenerator ) ; } if ( ( customDynamoDBClient ) != null ) { persistenceAdapterBuilder . withDynamoDbClient ( customDynamoDBClient ) ; } persistenceAdapter = persistenceAdapterBuilder . build ( ) ; } com . amazon . ask . services . ApacheHttpApiClient apiClient = com . amazon . ask . services . ApacheHttpApiClient . custom ( ) . withHttpClient ( ( ( customHttpClient ) != null ? customHttpClient : org . apache . http . impl . client . HttpClients . createDefault ( ) ) ) . build ( ) ; return new com . amazon . ask . module . StandardSdkModule ( apiClient , persistenceAdapter ) ; }
org . junit . Assert . assertEquals ( responseWithBuilder . get ( ) , response )
testLoadLegacyJsonFile ( ) { org . apache . hadoop . hdfs . protocol . DatanodeAdminProperties [ ] all = org . apache . hadoop . hdfs . util . CombinedHostsFileReader . readFile ( legacyFile . getAbsolutePath ( ) ) ; "<AssertPlaceHolder>" ; } getAbsolutePath ( ) { final java . lang . String path = getValue ( ) ; return path == null ? null : "/" + path ; }
org . junit . Assert . assertEquals ( 7 , all . length )
testMasterCoprocessorService ( ) { org . apache . hadoop . hbase . client . Admin admin = org . apache . hadoop . hbase . coprocessor . TestCoprocessorEndpoint . util . getAdmin ( ) ; final org . apache . hadoop . hbase . ipc . protobuf . generated . TestProtos . EchoRequestProto request = TestProtos . EchoRequestProto . newBuilder ( ) . setMessage ( "hello" ) . build ( ) ; org . apache . hadoop . hbase . ipc . protobuf . generated . TestRpcServiceProtos . TestProtobufRpcProto . BlockingInterface service = TestRpcServiceProtos . TestProtobufRpcProto . newBlockingStub ( admin . coprocessorService ( ) ) ; "<AssertPlaceHolder>" ; } echo ( org . apache . hbase . thirdparty . com . google . protobuf . RpcController , org . apache . hadoop . hbase . shaded . ipc . protobuf . generated . TestProtos . EchoRequestProto ) { if ( controller instanceof org . apache . hadoop . hbase . ipc . HBaseRpcController ) { org . apache . hadoop . hbase . ipc . HBaseRpcController pcrc = ( ( org . apache . hadoop . hbase . ipc . HBaseRpcController ) ( controller ) ) ; org . apache . hadoop . hbase . CellScanner cellScanner = pcrc . cellScanner ( ) ; java . util . List < org . apache . hadoop . hbase . Cell > list = null ; if ( cellScanner != null ) { list = new java . util . ArrayList ( ) ; try { while ( cellScanner . advance ( ) ) { list . add ( cellScanner . current ( ) ) ; } } catch ( java . io . IOException e ) { throw new org . apache . hbase . thirdparty . com . google . protobuf . ServiceException ( e ) ; } } cellScanner = org . apache . hadoop . hbase . CellUtil . createCellScanner ( list ) ; pcrc . setCellScanner ( cellScanner ) ; } return org . apache . hadoop . hbase . shaded . ipc . protobuf . generated . TestProtos . EchoResponseProto . newBuilder ( ) . setMessage ( request . getMessage ( ) ) . build ( ) ; }
org . junit . Assert . assertEquals ( "hello" , service . echo ( null , request ) . getMessage ( ) )
test_checkPassFailorWarning ( ) { com . att . aro . core . bestpractice . pojo . BPResultType bpResultType = com . att . aro . core . util . Util . checkPassFailorWarning ( 0.2 , 0.1 , 0.4 ) ; "<AssertPlaceHolder>" ; } checkPassFailorWarning ( int , int , int ) { com . att . aro . core . bestpractice . pojo . BPResultType bpResultType = com . att . aro . core . bestpractice . pojo . BPResultType . PASS ; if ( resultSize >= warning ) { if ( resultSize >= fail ) { bpResultType = com . att . aro . core . bestpractice . pojo . BPResultType . FAIL ; } else { bpResultType = com . att . aro . core . bestpractice . pojo . BPResultType . WARNING ; } } return bpResultType ; }
org . junit . Assert . assertEquals ( bpResultType , BPResultType . WARNING )
concurrentInsertionsAndReads ( ) { org . apache . bookkeeper . util . collections . ConcurrentLongLongHashMap map = new org . apache . bookkeeper . util . collections . ConcurrentLongLongHashMap ( ) ; java . util . concurrent . ExecutorService executor = java . util . concurrent . Executors . newCachedThreadPool ( ) ; final int nThreads = 16 ; final int n = 100000 ; final long value = 55 ; java . util . List < java . util . concurrent . Future < ? > > futures = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < nThreads ; i ++ ) { final int threadIdx = i ; futures . add ( executor . submit ( ( ) -> { java . util . Random random = new java . util . Random ( ) ; for ( int j = 0 ; j < n ; j ++ ) { long key = java . lang . Math . abs ( random . nextLong ( ) ) ; key -= key % ( threadIdx + 1 ) ; map . put ( key , value ) ; } } ) ) ; } for ( java . util . concurrent . Future < ? > future : futures ) { future . get ( ) ; } "<AssertPlaceHolder>" ; executor . shutdown ( ) ; } size ( ) { lock . readLock ( ) . lock ( ) ; try { long size = 0 ; for ( int i = 0 ; i < ( cacheIndexes . size ( ) ) ; i ++ ) { if ( i == ( currentSegmentIdx ) ) { size += currentSegmentOffset . get ( ) ; } else if ( ! ( cacheIndexes . get ( i ) . isEmpty ( ) ) ) { size += segmentSize ; } else { } } return size ; } finally { lock . readLock ( ) . unlock ( ) ; } }
org . junit . Assert . assertEquals ( map . size ( ) , ( n * nThreads ) )
complexCollectionWithSelectProperty ( ) { final org . apache . olingo . commons . api . edm . EdmEntitySet edmEntitySet = org . apache . olingo . server . core . serializer . xml . ODataXmlSerializerTest . entityContainer . getEntitySet ( "ESKeyNav" ) ; final org . apache . olingo . commons . api . edm . EdmProperty edmProperty = ( ( org . apache . olingo . commons . api . edm . EdmProperty ) ( edmEntitySet . getEntityType ( ) . getProperty ( "CollPropertyComp" ) ) ) ; final org . apache . olingo . commons . api . data . Property property = data . readAll ( edmEntitySet ) . getEntities ( ) . get ( 0 ) . getProperty ( edmProperty . getName ( ) ) ; final org . apache . olingo . commons . api . edm . EdmComplexType complexType = org . apache . olingo . server . core . serializer . xml . ODataXmlSerializerTest . metadata . getEdm ( ) . getComplexType ( new org . apache . olingo . commons . api . edm . FullQualifiedName ( "ESKeyNav" 7 , "ESKeyNav" 6 ) ) ; final org . apache . olingo . commons . api . edm . EdmProperty propertyWithinCT = ( ( org . apache . olingo . commons . api . edm . EdmProperty ) ( complexType . getProperty ( "ESKeyNav" 3 ) ) ) ; final org . apache . olingo . server . api . uri . UriInfoResource resource = org . apache . olingo . server . core . serializer . ExpandSelectMock . mockComplexTypeResource ( propertyWithinCT ) ; final org . apache . olingo . server . api . uri . queryoption . SelectItem selectItem = org . apache . olingo . server . core . serializer . ExpandSelectMock . mockSelectItemForColComplexProperty ( resource ) ; final org . apache . olingo . server . api . uri . queryoption . SelectOption selectOption = org . apache . olingo . server . core . serializer . ExpandSelectMock . mockSelectOption ( java . util . Arrays . asList ( selectItem ) ) ; final java . lang . String resultString = org . apache . commons . io . IOUtils . toString ( serializer . complexCollection ( org . apache . olingo . server . core . serializer . xml . ODataXmlSerializerTest . metadata , ( ( org . apache . olingo . commons . api . edm . EdmComplexType ) ( edmProperty . getType ( ) ) ) , property , org . apache . olingo . server . api . serializer . ComplexSerializerOptions . with ( ) . contextURL ( org . apache . olingo . commons . api . data . ContextURL . with ( ) . entitySet ( edmEntitySet ) . keyPath ( "ESKeyNav" 5 ) . navOrPropertyPath ( "CollPropertyComp" ) . build ( ) ) . select ( selectOption ) . build ( ) ) . getContent ( ) ) ; final java . lang . String expectedResult = "<?xml<sp>version='1.0'<sp>encoding='UTF-8'?>" + ( ( ( ( ( ( ( ( "ESKeyNav" 0 http : "<AssertPlaceHolder>" ; } getContent ( ) { return new java . io . ByteArrayInputStream ( content . toByteArray ( ) ) ; }
org . junit . Assert . assertEquals ( expectedResult , resultString )
testDoOCR_File ( ) { net . sourceforge . tess4j . TesseractTest . logger . info ( "doOCR<sp>on<sp>a<sp>PNG<sp>image" ) ; java . io . File imageFile = new java . io . File ( this . testResourcesDataPath , "eurotext.png" ) ; java . lang . String expResult = "The<sp>(quick)<sp>[brown]<sp>{fox}<sp>jumps!\nOver<sp>the<sp>$43,456.78<sp><lazy><sp>#90<sp>dog" ; java . lang . String result = instance . doOCR ( imageFile ) ; net . sourceforge . tess4j . TesseractTest . logger . info ( result ) ; "<AssertPlaceHolder>" ; } doOCR ( net . sourceforge . tess4j . BufferedImage ) { return doOCR ( bi , null ) ; }
org . junit . Assert . assertEquals ( expResult , result . substring ( 0 , expResult . length ( ) ) )
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . asset . list . model . AssetListEntryUsage . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "assetListEntryUsageId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "assetListEntryUsageId" , 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 ( ) )
putByPath_path_single_level ( ) { java . util . Map < java . lang . String , java . lang . Object > input = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > expect = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( "a" , "value" ) ; } } ; com . psddev . dari . util . CollectionUtils . putByPath ( input , "a" , "value" ) ; "<AssertPlaceHolder>" ; } putByPath ( java . util . Map , java . lang . String , java . lang . Object ) { if ( path == null ) { return map . put ( null , value ) ; } java . lang . String [ ] names = com . psddev . dari . util . StringUtils . split ( path , "/" ) ; int len = ( names . length ) - 1 ; for ( int i = 0 ; i < len ; i ++ ) { java . lang . String name = names [ i ] ; java . lang . Object newMap = map . get ( name ) ; if ( ! ( newMap instanceof java . util . Map ) ) { newMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; map . put ( name , newMap ) ; } map = ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( newMap ) ) ; } return map . put ( names [ len ] , value ) ; }
org . junit . Assert . assertEquals ( expect , input )
testAddExcludes ( ) { org . walkmod . commands . AddTransformationCommand command = new org . walkmod . commands . AddTransformationCommand ( "imports-cleaner" , "mychain" , false , null , null , null , null , false ) ; java . io . File file = new java . io . File ( "src/test/resources/yaml/addExcludes.yml" ) ; if ( file . exists ( ) ) { file . delete ( ) ; } file . createNewFile ( ) ; org . apache . commons . io . FileUtils . write ( file , "" ) ; org . walkmod . conf . providers . YAMLConfigurationProvider prov = new org . walkmod . conf . providers . YAMLConfigurationProvider ( file . getPath ( ) ) ; try { prov . createConfig ( ) ; org . walkmod . conf . entities . TransformationConfig transfCfg = command . buildTransformationCfg ( ) ; prov . addTransformationConfig ( "mychain" , null , transfCfg , false , null , null ) ; prov . setWriter ( "mychain" , "eclipse-writer" , null , false , null ) ; prov . addExcludesToChain ( "mychain" , java . util . Arrays . asList ( "foo" ) , false , true , false ) ; java . lang . String output = org . apache . commons . io . FileUtils . readFileToString ( file ) ; System . out . println ( output ) ; "<AssertPlaceHolder>" ; } finally { if ( file . exists ( ) ) { file . delete ( ) ; } } } addExcludesToChain ( java . lang . String , java . util . List , boolean , boolean , boolean ) { org . walkmod . conf . providers . yml . AddIncludesOrExcludesYMLAction action = new org . walkmod . conf . providers . yml . AddIncludesOrExcludesYMLAction ( excludes , chain , recursive , setToReader , setToWriter , true , this ) ; action . execute ( ) ; }
org . junit . Assert . assertTrue ( output . contains ( "foo" ) )
testLargeImport ( ) { try { automata . svpa . SVPA < theory . characters . ICharPred , java . lang . Character > bigAutomaton = getBigIntersection ( ) ; automata . svpa . ImportCharSVPA . importSVPA ( bigAutomaton . toString ( ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } } toString ( ) { java . lang . String s = "" ; s = ( ( ( ( "SFT<sp>product:<sp>" + ( getMoves ( ) . size ( ) ) ) + "<sp>transitions,<sp>" ) + ( getStates ( ) . size ( ) ) ) + "<sp>states" ) + "\n" ; s += "Transitions<sp>\n" ; for ( automata . Move < P , S > t : getMoves ( ) ) s = ( s + t ) + "\n" ; s += "Initial<sp>State<sp>\n" ; s = ( s + ( getInitialState ( ) ) ) + "\n" ; s += "Final<sp>States<sp>\n" ; for ( java . lang . Integer fs : getFinalStates ( ) ) if ( ( getFinalStatesAndTails ( ) . get ( fs ) ) == null ) s = ( s + fs ) + "\n" ; else s = ( ( ( s + fs ) + "<sp>" ) + ( getFinalStatesAndTails ( ) . get ( fs ) ) ) + "\n" ; return s ; }
org . junit . Assert . assertTrue ( false )
execute_noSwallowException ( ) { org . mitre . data . AbstractPageOperationTemplateTest . CountingPageOperation op = new org . mitre . data . AbstractPageOperationTemplateTest . EvenExceptionCountingPageOperation ( 1 , 1000L ) ; op . setSwallowExceptions ( false ) ; try { op . execute ( ) ; } finally { "<AssertPlaceHolder>" ; } } getCounter ( ) { return counter ; }
org . junit . Assert . assertEquals ( 1L , op . getCounter ( ) )
testAvailableWithNonExistentClass ( ) { boolean available = org . aeonbits . owner . util . Reflection . isClassAvailable ( "foo.bar.baz.FooBar" ) ; "<AssertPlaceHolder>" ; } isClassAvailable ( java . lang . String ) { return ( org . aeonbits . owner . util . Reflection . forName ( className ) ) != null ; }
org . junit . Assert . assertFalse ( available )
isPrimitive_A$String_argNull ( ) { org . junithelper . core . meta . ClassMeta classMeta = null ; org . junithelper . core . extractor . AvailableTypeDetector target = new org . junithelper . core . extractor . AvailableTypeDetector ( classMeta ) ; java . lang . String typeName = null ; boolean actual = target . isPrimitive ( typeName ) ; boolean expected = false ; "<AssertPlaceHolder>" ; } isPrimitive ( java . lang . String ) { return ( typeName != null ) && ( org . junithelper . core . util . PrimitiveTypeUtil . isPrimitive ( typeName ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testSetData_forCancelKeys_preservesCancelKeys ( ) { org . eclipse . swt . widgets . Control control = new org . eclipse . swt . widgets . Control ( shell , org . eclipse . swt . SWT . NONE ) { } ; control . setData ( RWT . CANCEL_KEYS , new java . lang . String [ ] { "foo" } ) ; org . eclipse . swt . internal . widgets . ControlRemoteAdapter adapter = ( ( org . eclipse . swt . internal . widgets . ControlRemoteAdapter ) ( control . getAdapter ( org . eclipse . rap . rwt . internal . lifecycle . RemoteAdapter . class ) ) ) ; "<AssertPlaceHolder>" ; } hasPreservedCancelKeys ( ) { return hasPreserved ( org . eclipse . swt . internal . widgets . ControlRemoteAdapter . CANCEL_KEYS ) ; }
org . junit . Assert . assertTrue ( adapter . hasPreservedCancelKeys ( ) )
testClearingDefaultGraph ( ) { java . lang . String queryStr = "CLEAR<sp>SILENT<sp>DEFAULT" ; org . apache . clerezza . rdf . core . sparql . SparqlPreParser parser ; parser = new org . apache . clerezza . rdf . core . sparql . SparqlPreParser ( org . apache . clerezza . rdf . core . access . TcManager . getInstance ( ) ) ; java . util . Set < org . apache . clerezza . commons . rdf . IRI > referredGraphs = parser . getReferredGraphs ( queryStr , org . apache . clerezza . rdf . core . sparql . SparqlPreParserTest . DEFAULT_GRAPH ) ; "<AssertPlaceHolder>" ; } toArray ( ) { java . lang . Object [ ] result = base . toArray ( ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { org . apache . clerezza . commons . rdf . Triple triple = ( ( org . apache . clerezza . commons . rdf . Triple ) ( result [ i ] ) ) ; result [ i ] = toTargetTriple ( triple ) ; } return result ; }
org . junit . Assert . assertTrue ( referredGraphs . toArray ( ) [ 0 ] . equals ( org . apache . clerezza . rdf . core . sparql . SparqlPreParserTest . DEFAULT_GRAPH ) )
testValidateQuestionnaire ( ) { java . lang . String input = org . apache . commons . io . IOUtils . toString ( getClass ( ) . getResourceAsStream ( "/questionnaire_jon_z_20160506.xml" ) ) ; ca . uhn . fhir . validation . FhirValidator val = org . hl7 . fhir . dstu2016may . hapi . validation . ResourceValidatorDstu2_1Test . ourCtx . newValidator ( ) ; val . registerValidatorModule ( new org . hl7 . fhir . dstu2016may . hapi . validation . FhirInstanceValidator ( ) ) ; ca . uhn . fhir . validation . ValidationResult result = val . validateWithResult ( input ) ; org . hl7 . fhir . dstu2016may . model . OperationOutcome operationOutcome = ( ( org . hl7 . fhir . dstu2016may . model . OperationOutcome ) ( result . toOperationOutcome ( ) ) ) ; java . lang . String ooencoded = org . hl7 . fhir . dstu2016may . hapi . validation . ResourceValidatorDstu2_1Test . ourCtx . newXmlParser ( ) . setPrettyPrint ( true ) . encodeResourceToString ( operationOutcome ) ; org . hl7 . fhir . dstu2016may . hapi . validation . ResourceValidatorDstu2_1Test . ourLog . info ( ooencoded ) ; "<AssertPlaceHolder>" ; } isSuccessful ( ) { return myIsSuccessful ; }
org . junit . Assert . assertTrue ( result . isSuccessful ( ) )
handleOverrideRequestScope ( ) { request . setAttribute ( "aaa" , "222" ) ; request . setParameter ( "aaa" , "111" ) ; org . slim3 . controller . RequestHandler handler = new org . slim3 . controller . RequestHandler ( request ) ; handler . handle ( ) ; "<AssertPlaceHolder>" ; } getAttribute ( java . lang . String ) { return attributeMap . get ( name ) ; }
org . junit . Assert . assertThat ( ( ( java . lang . String ) ( request . getAttribute ( "aaa" ) ) ) , org . hamcrest . CoreMatchers . is ( "222" ) )
testParsePositiveInfinity ( ) { java . lang . String source = "(Infinity)<sp>+<sp>(Infinity)i" ; org . apache . commons . numbers . complex . Complex expected = org . apache . commons . numbers . complex . Complex . ofCartesian ( Double . POSITIVE_INFINITY , Double . POSITIVE_INFINITY ) ; org . apache . commons . numbers . complex . Complex actual = complexFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . text . ParsePosition parsePosition = new java . text . ParsePosition ( 0 ) ; org . apache . commons . math4 . geometry . euclidean . twod . Vector2D result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { throw new org . apache . commons . math4 . exception . MathParseException ( source , parsePosition . getErrorIndex ( ) , org . apache . commons . math4 . geometry . euclidean . twod . Vector2D . class ) ; } return result ; }
org . junit . Assert . assertEquals ( expected , actual )
testIndexOf ( ) { org . jfree . data . xy . XIntervalSeries s1 = new org . jfree . data . xy . XIntervalSeries ( "Series<sp>1" ) ; s1 . add ( 1.0 , 1.0 , 1.0 , 2.0 ) ; s1 . add ( 2.0 , 2.0 , 2.0 , 3.0 ) ; s1 . add ( 3.0 , 3.0 , 3.0 , 4.0 ) ; "<AssertPlaceHolder>" ; } indexOf ( java . lang . Comparable ) { return this . seriesKeys . indexOf ( seriesKey ) ; }
org . junit . Assert . assertEquals ( 0 , s1 . indexOf ( 1.0 ) )
getTagsByLocale_differentLocale ( ) { java . util . List < org . oscm . vo . VOTag > tags = org . oscm . ws . TagServiceWSTest . tagService . getTagsByLocale ( "ja" ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , tags . size ( ) )
indexIsNotReadyForIndexerDuringCommit ( ) { when ( provider . isFreshIndex ( cluster ) ) . thenReturn ( false ) ; when ( lock . isLockedBy ( org . uberfire . ext . metadata . io . common . MetadataIndexEngineBatchTest . TEST_INDEXER ) ) . thenReturn ( true ) ; indexEngine . startBatch ( cluster ) ; "<AssertPlaceHolder>" ; } isIndexReady ( org . uberfire . ext . metadata . model . KCluster , java . lang . String ) { final org . uberfire . ext . metadata . io . util . MultiIndexerLock lock ; return ( ! ( provider . isFreshIndex ( cluster ) ) ) && ( ( ( lock = batchLocks . get ( cluster ) ) == null ) || ( ! ( lock . isLockedBy ( indexerId ) ) ) ) ; }
org . junit . Assert . assertFalse ( indexEngine . isIndexReady ( cluster , org . uberfire . ext . metadata . io . common . MetadataIndexEngineBatchTest . TEST_INDEXER ) )
testServerMultipleClients ( ) { org . simplesockets . server . SimpleServer server ; int port = 34343 ; int numClients = 10 ; int numMessages = 10 ; java . lang . String hostname = "localhost" ; java . util . List < org . simplesockets . client . SimpleClient > clientList = new java . util . ArrayList < org . simplesockets . client . SimpleClient > ( ) ; server = new org . simplesockets . server . SimpleServer ( port , org . simplesockets . unittests . SimpleSocketsTest . echoProtocol ) ; server . startServer ( ) ; java . lang . Thread . sleep ( 200 ) ; for ( int i = 0 ; i < numClients ; i ++ ) { clientList . add ( new org . simplesockets . client . SimpleClient ( hostname , server . getPort ( ) , org . simplesockets . unittests . SimpleSocketsTest . echoProtocol ) ) ; } for ( int i = 0 ; i < numMessages ; i ++ ) { java . lang . String message = "Message<sp>" + i ; for ( int j = 0 ; j < ( clientList . size ( ) ) ; j ++ ) { org . simplesockets . client . SimpleClient client = clientList . get ( j ) ; java . lang . String clientReq = ( message + "<sp>from<sp>client<sp>" ) + j ; client . sendRequest ( clientReq ) ; } java . lang . Thread . sleep ( 200 ) ; for ( int j = 0 ; j < ( clientList . size ( ) ) ; j ++ ) { org . simplesockets . client . SimpleClient client = clientList . get ( j ) ; java . lang . String expected = ( message + "<sp>from<sp>client<sp>" ) + j ; java . lang . String reply = ( ( java . lang . String ) ( client . getReply ( ) ) ) ; "<AssertPlaceHolder>" ; } } for ( org . simplesockets . client . SimpleClient client : clientList ) { client . disconnect ( ) ; } server . stopServer ( ) ; } getReply ( ) { if ( ( socket ) == null ) return null ; java . lang . Object reply = null ; try { reply = fromServer . readObject ( ) ; protocol . receive ( reply ) ; } catch ( java . io . IOException | java . lang . ClassNotFoundException e ) { e . printStackTrace ( ) ; } return reply ; }
org . junit . Assert . assertEquals ( reply . compareTo ( expected ) , 0 )