input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
noNewEntryTest ( ) { final com . sun . syndication . feed . synd . SyndFeed feed = new com . sun . syndication . feed . synd . SyndFeedImpl ( ) ; feed . setEntries ( java . util . Arrays . asList ( createEntry ( "third" , "ccc" ) , createEntry ( "second" , "bbb" ) , createEntry ( "first" , "aaa" ) ) ) ; final java . util . List < net . violet . platform . datamodel . FeedItem > knownItems = new java . util . ArrayList < net . violet . platform . datamodel . FeedItem > ( ) ; knownItems . add ( createItem ( "ccc" , "third" ) ) ; knownItems . add ( createItem ( "bbb" , "second" ) ) ; knownItems . add ( createItem ( "aaa" , "first" ) ) ; final net . violet . platform . feeds . analyzers . HistoryAnalyzer analyzer = new net . violet . platform . feeds . analyzers . HistoryAnalyzer ( 10 , knownItems ) ; final java . util . List < com . sun . syndication . feed . synd . SyndEntry > entries = analyzer . getNewEntries ( feed ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( this . mRecordRef ) == null ; }
org . junit . Assert . assertTrue ( entries . isEmpty ( ) )
testGetVolumeId ( ) { java . lang . Long vId = ssc . getVolumeId ( ) ; java . lang . Long expected = 103L ; "<AssertPlaceHolder>" ; } getVolumeId ( ) { return volumeId ; }
org . junit . Assert . assertEquals ( expected , vId )
testCorrectedReceivedAgeIsAgeHeaderIfLarger ( ) { final org . apache . hc . core5 . http . Header [ ] headers = new org . apache . hc . core5 . http . Header [ ] { new org . apache . hc . core5 . http . message . BasicHeader ( "Age" , "10" ) } ; final org . apache . hc . client5 . http . cache . HttpCacheEntry entry = org . apache . hc . client5 . http . impl . cache . HttpTestUtils . makeCacheEntry ( headers ) ; impl = new org . apache . hc . client5 . http . impl . cache . CacheValidityPolicy ( ) { @ org . apache . hc . client5 . http . impl . cache . Override protected long getApparentAgeSecs ( final org . apache . hc . client5 . http . cache . HttpCacheEntry ent ) { return 6 ; } } ; "<AssertPlaceHolder>" ; } getCorrectedReceivedAgeSecs ( org . apache . hc . client5 . http . cache . HttpCacheEntry ) { return 7 ; }
org . junit . Assert . assertEquals ( 10 , impl . getCorrectedReceivedAgeSecs ( entry ) )
testQueryListAccessAll ( ) { authRule . createGrantAuthorization ( Resources . BATCH , "*" , "user" , Permissions . READ ) ; authRule . enableAuthorization ( "user" ) ; java . util . List < org . camunda . bpm . engine . batch . Batch > batches = engineRule . getManagementService ( ) . createBatchQuery ( ) . list ( ) ; authRule . disableAuthorization ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( ( ( historicProcessInstanceIds . size ( ) ) + ( historicDecisionInstanceIds . size ( ) ) ) + ( historicCaseInstanceIds . size ( ) ) ) + ( historicBatchIds . size ( ) ) ; }
org . junit . Assert . assertEquals ( 2 , batches . size ( ) )
testTranscriptDuplicationOma1 ( ) { final java . lang . String outPath = runJannovarOnVCFLine ( "/sv_header.vcf" , "1\t58929878\t.\tN\t<DUP>\t.\t.\tSVTYPE=DUP;END=59028960" ) ; final java . lang . String expected = "1\t58929878\t.\tN\t<DUP>\t.\t.\tEND=59028960;" + ( "SVANN=transcript_amplification&structural_variant&coding_transcript_variant|HIGH|OMA1|115209|transcript|NM_145243.3|Coding|;" + "SVTYPE=DUP" ) ; final java . lang . String actual = loadVcfBody ( outPath ) ; "<AssertPlaceHolder>" ; } loadVcfBody ( java . lang . String ) { return java . util . Arrays . asList ( com . google . common . io . Files . asCharSource ( new de . charite . compbio . jannovar . cmd . annotate_vcf . File ( outPath ) , Charsets . UTF_8 ) . read ( ) . split ( "\r?\n" ) ) . stream ( ) . filter ( ( line ) -> ! ( line . startsWith ( "#" ) ) ) . collect ( java . util . stream . Collectors . joining ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testTransactionDDLCommitNonCommitInsert ( ) { tableDAO . drop ( com . splicemachine . derby . test . TransactionIT . CLASS_NAME , com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ; methodWatcher . setAutoCommit ( false ) ; java . sql . Statement s = methodWatcher . getStatement ( ) ; s . execute ( format ( "create<sp>table<sp>%s<sp>(num<sp>int,<sp>addr<sp>varchar(50),<sp>zip<sp>char(5))" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; s . execute ( format ( "insert<sp>into<sp>%s<sp>values(100,<sp>'100:<sp>101<sp>Califronia<sp>St',<sp>'94114')" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; s . execute ( format ( "insert<sp>into<sp>%s<sp>values(200,<sp>'200:<sp>908<sp>Glade<sp>Ct.',<sp>'94509')" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; s . execute ( format ( "insert<sp>into<sp>%s<sp>values(300,<sp>'300:<sp>my<sp>addr',<sp>'34166')" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; s . execute ( format ( "insert<sp>into<sp>%s<sp>values(400,<sp>'400:<sp>182<sp>Second<sp>St.',<sp>'94114')" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; s . execute ( format ( "insert<sp>into<sp>%s(num)<sp>values(500)" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; s . execute ( format ( "insert<sp>into<sp>%s<sp>values(600,<sp>'new<sp>addr',<sp>'34166')" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; methodWatcher . commit ( ) ; s . execute ( format ( "insert<sp>into<sp>%s(num)<sp>values(700)" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; java . sql . ResultSet rs = s . executeQuery ( format ( "select<sp>*<sp>from<sp>%s" , this . getTableReference ( com . splicemachine . derby . test . TransactionIT . TABLE_NAME_6 ) ) ) ; int i = 0 ; while ( rs . next ( ) ) { i ++ ; } "<AssertPlaceHolder>" ; } next ( ) { return stepNext ( true ) ; }
org . junit . Assert . assertEquals ( 7 , i )
testEscapeChar ( ) { java . io . StringWriter sw = new java . io . StringWriter ( ) ; org . apache . felix . utils . json . JSONWriter js = new org . apache . felix . utils . json . JSONWriter ( sw ) ; js . object ( ) . key ( "foo" ) . value ( "/bar" ) . endObject ( ) . flush ( ) ; org . apache . felix . utils . json . JSONParser jp = new org . apache . felix . utils . json . JSONParser ( sw . toString ( ) ) ; "<AssertPlaceHolder>" ; } getParsed ( ) { if ( ( parsed ) instanceof java . util . Map ) return ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( parsed ) ) ; else return null ; }
org . junit . Assert . assertEquals ( "/bar" , jp . getParsed ( ) . get ( "foo" ) )
testRmEpsilon ( ) { System . out . println ( "Testing<sp>RmEpsilon..." ) ; edu . cmu . sphinx . fst . Fst fst = edu . cmu . sphinx . fst . openfst . Convert . importFst ( "src/test/edu/cmu/sphinx/fst/data/tests/algorithms/rmepsilon/A" , new edu . cmu . sphinx . fst . semiring . ProbabilitySemiring ( ) ) ; edu . cmu . sphinx . fst . Fst fstRmEps = edu . cmu . sphinx . fst . Fst . loadModel ( "src/test/edu/cmu/sphinx/fst/data/tests/algorithms/rmepsilon/fstrmepsilon.fst.ser" ) ; edu . cmu . sphinx . fst . Fst rmEpsilon = edu . cmu . sphinx . fst . operations . RmEpsilon . get ( fst ) ; "<AssertPlaceHolder>" ; System . out . println ( "Testing<sp>RmEpsilon<sp>Completed!\n" ) ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; edu . cmu . sphinx . fst . Fst other = ( ( edu . cmu . sphinx . fst . Fst ) ( obj ) ) ; if ( ! ( java . util . Arrays . equals ( isyms , other . isyms ) ) ) return false ; if ( ! ( java . util . Arrays . equals ( osyms , other . osyms ) ) ) return false ; if ( ( start ) == null ) { if ( ( other . start ) != null ) return false ; } else if ( ! ( start . equals ( other . start ) ) ) return false ; if ( ( states ) == null ) { if ( ( other . states ) != null ) return false ; } else if ( ! ( states . equals ( other . states ) ) ) return false ; if ( ( semiring ) == null ) { if ( ( other . semiring ) != null ) return false ; } else if ( ! ( semiring . equals ( other . semiring ) ) ) return false ; return true ; }
org . junit . Assert . assertTrue ( fstRmEps . equals ( rmEpsilon ) )
testFindByNameAndNoPublicNamespace ( ) { com . ctrip . framework . apollo . common . entity . AppNamespace appNamespace = repository . findByNameAndIsPublicTrue ( "application" ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNull ( appNamespace )
testIsValidFileNotReadable ( ) { java . io . File file = new java . io . File ( "file" ) { @ net . holmes . core . common . Override public boolean isFile ( ) { return true ; } @ net . holmes . core . common . Override public boolean canRead ( ) { return false ; } } ; "<AssertPlaceHolder>" ; } isValidFile ( java . io . File ) { return ( ( file . isFile ( ) ) && ( file . canRead ( ) ) ) && ( ! ( file . isHidden ( ) ) ) ; }
org . junit . Assert . assertFalse ( isValidFile ( file ) )
testParseNegativeZ ( ) { java . lang . String source = ( ( ( ( ( "{1" + ( getDecimalCharacter ( ) ) ) + "2323;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "4343;<sp>-1" ) + ( getDecimalCharacter ( ) ) ) + "6333}" ; org . apache . commons . math3 . linear . ArrayRealVector expected = new org . apache . commons . math3 . linear . ArrayRealVector ( new double [ ] { 1.2323 , 1.4343 , - 1.6333 } ) ; org . apache . commons . math3 . linear . ArrayRealVector actual = realVectorFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( com . google . javascript . jscomp . AbstractCompiler ) { try { com . google . javascript . jscomp . JsAst . logger_ . fine ( ( "Parsing:<sp>" + ( sourceFile . getName ( ) ) ) ) ; com . google . javascript . jscomp . parsing . ParserRunner . ParseResult result = com . google . javascript . jscomp . parsing . ParserRunner . parse ( sourceFile , sourceFile . getCode ( ) , compiler . getParserConfig ( ) , compiler . getDefaultErrorReporter ( ) , com . google . javascript . jscomp . JsAst . logger_ ) ; root = result . ast ; compiler . setOldParseTree ( sourceFile . getName ( ) , result . oldAst ) ; } catch ( java . io . IOException e ) { compiler . report ( com . google . javascript . jscomp . JSError . make ( AbstractCompiler . READ_ERROR , sourceFile . getName ( ) ) ) ; } if ( ( ( root ) == null ) || ( compiler . hasHaltingErrors ( ) ) ) { root = com . google . javascript . rhino . IR . script ( ) ; } else { compiler . prepareAst ( root ) ; } root . setStaticSourceFile ( sourceFile ) ; }
org . junit . Assert . assertEquals ( expected , actual )
listJobsWithJobFilter ( ) { final java . util . Map < com . spotify . helios . common . descriptors . JobId , com . spotify . helios . common . descriptors . Job > jobs = com . spotify . helios . client . HeliosClientTest . fakeJobs ( com . spotify . helios . common . descriptors . JobId . parse ( "foobar:v1" ) ) ; mockResponse ( "GET" , org . hamcrest . Matchers . allOf ( com . spotify . helios . client . HeliosClientTest . hasPath ( "/jobs" ) , com . spotify . helios . client . HeliosClientTest . containsQuery ( "q=foo" ) ) , com . spotify . helios . client . HeliosClientTest . response ( "GET" , 200 , jobs ) ) ; "<AssertPlaceHolder>" ; } jobs ( java . lang . String ) { return jobs ( jobQuery , null ) ; }
org . junit . Assert . assertThat ( client . jobs ( "foo" ) . get ( ) , org . hamcrest . Matchers . is ( jobs ) )
testFollowRedirects ( ) { final java . net . URL redirect = getUrl ( "redirect" ) ; com . google . appengine . api . urlfetch . FetchOptions options = buildFetchOptions ( ) ; options . followRedirects ( ) ; testOptions ( redirect , options , new com . google . appengine . tck . urlfetch . ResponseHandler ( ) { public void handle ( com . google . appengine . api . urlfetch . HTTPResponse response ) throws com . google . appengine . tck . urlfetch . Exception { java . net . URL finalURL = response . getFinalUrl ( ) ; "<AssertPlaceHolder>" ; } } ) ; } getUrl ( java . lang . String ) { com . google . apphosting . api . ApiProxy . Environment env = com . google . apphosting . api . ApiProxy . getCurrentEnvironment ( ) ; java . lang . Object localhost = env . getAttributes ( ) . get ( "com.google.appengine.runtime.default_version_hostname" ) ; return new java . net . URL ( ( ( ( "http://" + localhost ) + "/" ) + path ) ) ; }
org . junit . Assert . assertEquals ( getUrl ( "" ) , finalURL )
testGetParameters ( ) { java . lang . Long enrolmentSubjectId = 1L ; org . lnu . is . domain . enrolment . subject . EnrolmentSubject enrolmentSubject = new org . lnu . is . domain . enrolment . subject . EnrolmentSubject ( ) ; enrolmentSubject . setId ( enrolmentSubjectId ) ; java . lang . Long enrolmentId = 2L ; org . lnu . is . domain . enrolment . Enrolment enrolment = new org . lnu . is . domain . enrolment . Enrolment ( ) ; enrolment . setId ( enrolmentId ) ; java . lang . Long personEnrolmentSubjectId = 3L ; org . lnu . is . domain . person . enrolment . subject . PersonEnrolmentSubject personEnrolmentSubject = new org . lnu . is . domain . person . enrolment . subject . PersonEnrolmentSubject ( ) ; personEnrolmentSubject . setId ( personEnrolmentSubjectId ) ; java . lang . Double mark = 4.0 ; org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject entity = new org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject ( ) ; entity . setEnrolment ( enrolment ) ; entity . setEnrolmentSubject ( enrolmentSubject ) ; entity . setPersonEnrolmentSubject ( personEnrolmentSubject ) ; entity . setMark ( mark ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "enrolmentSubject" , enrolmentSubject ) ; expected . put ( "enrolment" , enrolment ) ; expected . put ( "personEnrolmentSubject" , personEnrolmentSubject ) ; expected . put ( "mark" , mark ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; expected . put ( "userGroups" , groups ) ; when ( enrolmentSubjectDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( enrolmentSubject ) ; when ( enrolmentDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( enrolment ) ; when ( personEnrolmentSubjectDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( personEnrolmentSubject ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; verify ( enrolmentSubjectDao ) . getEntityById ( enrolmentSubjectId ) ; verify ( enrolmentDao ) . getEntityById ( enrolmentId ) ; verify ( personEnrolmentSubjectDao ) . getEntityById ( personEnrolmentSubjectId ) ; "<AssertPlaceHolder>" ; } getEntityById ( KEY ) { org . lnu . is . dao . dao . DefaultDao . LOG . info ( "Getting<sp>{}.entity<sp>wit<sp>id" , getEntityClass ( ) . getSimpleName ( ) , id ) ; return persistenceManager . findById ( getEntityClass ( ) , id ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testINDArrayIndexingLessThanRankFourDimension ( ) { org . nd4j . linalg . api . ndarray . INDArray x = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 16 , 16 , DataType . DOUBLE ) . reshape ( 'c' , 2 , 2 , 2 , 2 ) . castTo ( DataType . DOUBLE ) ; org . nd4j . linalg . api . ndarray . INDArray indexes = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] [ ] { new double [ ] { 0 } , new double [ ] { 1 } } ) ; org . nd4j . linalg . api . ndarray . INDArray assertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 5 , 6 , 7 , 8 } ) . reshape ( 'c' , 1 , 2 , 2 ) ; org . nd4j . linalg . api . ndarray . INDArray getTest = x . get ( indexes ) ; "<AssertPlaceHolder>" ; } get ( int ) { return list . get ( i ) ; }
org . junit . Assert . assertEquals ( assertion , getTest )
simple ( ) { org . jboss . hal . dmr . ResourceAddress input = new org . jboss . hal . dmr . ResourceAddress ( ) . add ( "foo" , "bar" ) ; org . jboss . hal . dmr . ResourceAddress expected = new org . jboss . hal . dmr . ResourceAddress ( ) . add ( "foo" , "bar" ) ; org . jboss . hal . dmr . ResourceAddress result = processor . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( org . jboss . hal . meta . AddressTemplate ) { org . jboss . hal . meta . AddressTemplate modified = org . jboss . hal . meta . AddressTemplate . ROOT ; if ( ( template != null ) && ( ! ( AddressTemplate . ROOT . equals ( template ) ) ) ) { java . util . List < java . lang . String [ ] > segments = stream ( template . spliterator ( ) , false ) . map ( ( segment ) -> { if ( segment . contains ( "=" ) ) { return com . google . common . base . Splitter . on ( '=' ) . omitEmptyStrings ( ) . trimResults ( ) . limit ( 2 ) . splitToList ( segment ) . toArray ( new java . lang . String [ 2 ] ) ; } return new java . lang . String [ ] { segment , null } ; } ) . collect ( toList ( ) ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; org . jboss . hal . meta . description . SegmentProcessor . process ( segments , ( segment ) -> { builder . append ( "/" ) . append ( segment [ 0 ] ) ; if ( ( segment [ 1 ] ) != null ) { builder . append ( "=" ) . append ( segment [ 1 ] ) ; } } ) ; modified = org . jboss . hal . meta . AddressTemplate . of ( builder . toString ( ) ) ; } org . jboss . hal . meta . description . ResourceDescriptionTemplateProcessor . logger . debug ( "{}<sp>-><sp>{}" , template , modified ) ; return modified ; }
org . junit . Assert . assertEquals ( expected , result )
testGetAll ( ) { productList . add ( new org . esa . beam . dataio . TestProduct ( ) ) ; final java . util . List < org . esa . beam . dataio . TestProduct > testProducts = productList . getAll ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; }
org . junit . Assert . assertEquals ( 1 , testProducts . size ( ) )
toString_heatMapTurboThresholdIsSet_plotOptionsSerializedWithTurboThreshold ( ) { com . vaadin . addon . charts . model . PlotOptionsHeatmap plotOptions = new com . vaadin . addon . charts . model . PlotOptionsHeatmap ( ) ; plotOptions . setTurboThreshold ( 0 ) ; java . lang . String json = toJSON ( plotOptions ) ; java . lang . String expected = "{\"turboThreshold\":0}" ; "<AssertPlaceHolder>" ; } toJSON ( com . vaadin . addon . charts . model . AbstractConfigurationObject ) { try { return com . vaadin . addon . charts . util . ChartSerialization . jsonWriter . writeValueAsString ( object ) ; } catch ( com . fasterxml . jackson . core . JsonProcessingException e ) { e . printStackTrace ( ) ; throw new java . lang . RuntimeException ( ( "Error<sp>while<sp>serializing<sp>" + ( object . getClass ( ) . getSimpleName ( ) ) ) , e ) ; } }
org . junit . Assert . assertEquals ( expected , json )
testPutGetRangeBuilder ( ) { java . lang . String indexName = "put-index" ; java . lang . String docId = "testPutDocs" ; com . google . appengine . api . search . Index index = createIndex ( indexName , docId ) ; com . google . appengine . api . search . GetIndexesRequest request = com . google . appengine . api . search . GetIndexesRequest . newBuilder ( ) . setIndexNamePrefix ( indexName ) . build ( ) ; com . google . appengine . api . search . GetResponse < com . google . appengine . api . search . Index > response = searchService . getIndexes ( request ) ; java . util . List < com . google . appengine . api . search . Index > listIndexes = response . getResults ( ) ; for ( com . google . appengine . api . search . Index oneIndex : listIndexes ) { com . google . appengine . api . search . GetResponse < com . google . appengine . api . search . Document > docs = oneIndex . getRange ( com . google . appengine . api . search . GetRequest . newBuilder ( ) . setStartId ( ( docId + "1" ) ) . setLimit ( 10 ) ) ; sync ( ) ; "<AssertPlaceHolder>" ; } } sync ( ) { com . google . appengine . tck . base . TestBase . sync ( com . google . appengine . tck . base . TestBase . DEFAULT_SLEEP ) ; }
org . junit . Assert . assertEquals ( docs . getResults ( ) . size ( ) , 2 )
testIsComplete_isTimely_assertComplete ( ) { org . nhindirect . monitor . condition . TxCompletionCondition timelyCond = mock ( org . nhindirect . monitor . condition . TxCompletionCondition . class ) ; when ( timelyCond . isComplete ( ( ( java . util . Collection < org . nhindirect . common . tx . model . Tx > ) ( any ( ) ) ) ) ) . thenReturn ( true ) ; org . nhindirect . monitor . condition . TxCompletionCondition generalCond = mock ( org . nhindirect . monitor . condition . TxCompletionCondition . class ) ; org . nhindirect . monitor . condition . impl . VariableCompletionCondition cond = new org . nhindirect . monitor . condition . impl . VariableCompletionCondition ( timelyCond , generalCond ) ; org . nhindirect . monitor . condition . impl . VariableCompletionCondition spy = spy ( cond ) ; org . nhindirect . common . tx . model . Tx msgToTrack = mock ( org . nhindirect . common . tx . model . Tx . class ) ; when ( spy . getMessageToTrackInternal ( ( ( java . util . Collection < org . nhindirect . common . tx . model . Tx > ) ( any ( ) ) ) ) ) . thenReturn ( msgToTrack ) ; when ( spy . isRelAndTimelyRequired ( ( ( org . nhindirect . common . tx . model . Tx ) ( any ( ) ) ) ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; verify ( timelyCond , times ( 1 ) ) . isComplete ( ( ( java . util . Collection < org . nhindirect . common . tx . model . Tx > ) ( any ( ) ) ) ) ; verify ( generalCond , never ( ) ) . isComplete ( ( ( java . util . Collection < org . nhindirect . common . tx . model . Tx > ) ( any ( ) ) ) ) ; }
org . junit . Assert . assertTrue ( spy . isComplete ( null ) )
testParseAclChangeSetId ( ) { java . lang . Long expectedAclChangeSetId = 94032903249L ; java . lang . String aclChangeSetDocumentId = org . alfresco . solr . AlfrescoSolrDataModel . getAclChangeSetDocumentId ( expectedAclChangeSetId ) ; java . lang . Long actualAclChangeSetId = org . alfresco . solr . AlfrescoSolrDataModel . parseAclChangeSetId ( aclChangeSetDocumentId ) ; "<AssertPlaceHolder>" ; } parseAclChangeSetId ( java . lang . String ) { return org . alfresco . solr . AlfrescoSolrDataModel . parseIdFromDocumentId ( aclChangeSetDocumentId ) ; }
org . junit . Assert . assertEquals ( expectedAclChangeSetId , actualAclChangeSetId )
whenIsStrictRequested_thenReturnIsStrict ( ) { when ( runtimeOptions . isStrict ( ) ) . thenReturn ( true ) ; jiraRuntimeOptions = new rest . RestRuntimeOptions ( runtimeOptions ) ; "<AssertPlaceHolder>" ; } isStrict ( ) { return runtimeOptions . isStrict ( ) ; }
org . junit . Assert . assertTrue ( jiraRuntimeOptions . isStrict ( ) )
getUserMembershipsOfRole ( ) { final org . bonitasoft . engine . identity . model . SUserMembership userMembership = mock ( org . bonitasoft . engine . identity . model . SUserMembership . class ) ; when ( persistenceService . selectList ( org . bonitasoft . engine . identity . recorder . SelectDescriptorBuilder . getUserMembershipsByRole ( 1L , 0 , 20 ) ) ) . thenReturn ( java . util . Collections . singletonList ( userMembership ) ) ; final java . util . List < org . bonitasoft . engine . identity . model . SUserMembership > userMemberships = identityServiceImpl . getUserMembershipsOfRole ( 1L , 0 , 20 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Class ) { final T factoryImplementation = org . bonitasoft . engine . builder . BuilderFactory . getInstance ( ) . getInternalBuilderFactory ( clazz ) ; if ( factoryImplementation == null ) { throw new java . lang . RuntimeException ( ( "No<sp>factory<sp>found<sp>for<sp>interface:<sp>" + clazz ) ) ; } return factoryImplementation ; }
org . junit . Assert . assertEquals ( userMembership , userMemberships . get ( 0 ) )
testInsertEvictUpdate ( ) { insertDummyEntities ( 1 ) ; org . hibernate . Session session = sf . openSession ( ) ; org . hibernate . Transaction tx = session . beginTransaction ( ) ; com . hazelcast . hibernate . entity . DummyEntity ent = session . get ( com . hazelcast . hibernate . entity . DummyEntity . class , 0L ) ; sf . getCache ( ) . evictEntity ( "com.hazelcast.hibernate.entity.DummyEntity" , 0L ) ; ent . setName ( "updatedName" ) ; session . update ( ent ) ; tx . commit ( ) ; session . close ( ) ; com . hazelcast . hibernate . ArrayList < com . hazelcast . hibernate . entity . DummyEntity > list = getDummyEntities ( 1 ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( "updatedName" , list . get ( 0 ) . getName ( ) )
handleIllegalStateExceptionThrowableShouldReturnIt ( ) { java . lang . Throwable e = new java . lang . IllegalStateException ( ) ; "<AssertPlaceHolder>" ; } handle ( java . lang . Throwable ) { if ( e instanceof org . codegist . crest . CRestException ) { return org . codegist . crest . CRestException . handle ( ( ( org . codegist . crest . CRestException ) ( e ) ) ) ; } else if ( e instanceof org . codegist . crest . io . RequestException ) { return org . codegist . crest . CRestException . handle ( ( ( org . codegist . crest . io . RequestException ) ( e ) ) ) ; } else if ( e instanceof java . lang . IllegalArgumentException ) { return org . codegist . crest . CRestException . handle ( ( ( java . lang . IllegalArgumentException ) ( e ) ) ) ; } else if ( e instanceof java . lang . IllegalStateException ) { return org . codegist . crest . CRestException . handle ( ( ( java . lang . IllegalStateException ) ( e ) ) ) ; } else if ( e instanceof java . lang . reflect . InvocationTargetException ) { return org . codegist . crest . CRestException . handle ( ( ( java . lang . reflect . InvocationTargetException ) ( e ) ) ) ; } else { return new org . codegist . crest . CRestException ( e . getMessage ( ) , e ) ; } }
org . junit . Assert . assertSame ( e , org . codegist . crest . CRestException . handle ( e ) )
testAtomType_IElement ( ) { org . openscience . cdk . interfaces . IElement element = new org . openscience . cdk . silent . Element ( "C" ) ; org . openscience . cdk . interfaces . IAtomType at = element . getBuilder ( ) . newInstance ( org . openscience . cdk . interfaces . IAtomType . class , element ) ; "<AssertPlaceHolder>" ; } getSymbol ( ) { return this . symbol ; }
org . junit . Assert . assertEquals ( "C" , at . getSymbol ( ) )
testSdkVersion ( ) { soot . jimple . infoflow . android . manifest . ProcessManifest manifest = null ; try { manifest = new soot . jimple . infoflow . android . manifest . ProcessManifest ( "testAPKs/enriched1.apk" ) ; } catch ( java . io . IOException | org . xmlpull . v1 . XmlPullParserException e ) { e . printStackTrace ( ) ; } boolean throwsException = false ; try { manifest . getMinSdkVersion ( ) ; manifest . targetSdkVersion ( ) ; } catch ( java . lang . Exception ex ) { throwsException = true ; } "<AssertPlaceHolder>" ; } targetSdkVersion ( ) { java . util . List < soot . jimple . infoflow . android . axml . AXmlNode > usesSdk = this . manifest . getChildrenWithTag ( "uses-sdk" ) ; if ( ( usesSdk == null ) || ( usesSdk . isEmpty ( ) ) ) return - 1 ; soot . jimple . infoflow . android . axml . AXmlAttribute < ? > attr = usesSdk . get ( 0 ) . getAttribute ( "targetSdkVersion" ) ; if ( attr == null ) return - 1 ; if ( ( attr . getValue ( ) ) instanceof java . lang . Integer ) return ( ( java . lang . Integer ) ( attr . getValue ( ) ) ) ; return java . lang . Integer . parseInt ( ( "" + ( attr . getValue ( ) ) ) ) ; }
org . junit . Assert . assertFalse ( throwsException )
findFunctionsByNameInNamespaceForSubResourceTypeWithFunctionsWithSameNameOnResourceOneShouldReturnOtherResource ( ) { ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity rootResourceType = createRootResourceType ( ) ; ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity subResourceType = createSubResourceType ( rootResourceType ) ; ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceEntity resource = createResourceWithType ( "amw" , 1000 , subResourceType , OTHER_FUNCTION_A ) ; when ( resourceRepositoryMock . loadWithFunctionsAndMiksForId ( resource . getId ( ) ) ) . thenReturn ( resource ) ; ch . puzzle . itc . mobiliar . business . function . control . List < ch . puzzle . itc . mobiliar . business . function . entity . AmwFunctionEntity > functionsWithName = functionService . findFunctionsByNameInNamespace ( subResourceType , FUNCTION_A . getName ( ) ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { ch . puzzle . itc . mobiliar . common . util . DefaultResourceTypeDefinition [ ] values = ch . puzzle . itc . mobiliar . common . util . DefaultResourceTypeDefinition . values ( ) ; for ( ch . puzzle . itc . mobiliar . common . util . DefaultResourceTypeDefinition value : values ) { if ( value . name ( ) . equals ( name ) ) { return true ; } } return false ; }
org . junit . Assert . assertTrue ( functionsWithName . contains ( OTHER_FUNCTION_A ) )
should_report_correct_category ( ) { au . edu . wehi . idsv . ReferenceCoverageLookup lookup = init ( new java . util . ArrayList < htsjdk . samtools . SAMRecord > ( ) , 1 ) ; "<AssertPlaceHolder>" ; } getCategory ( ) { return category ; }
org . junit . Assert . assertEquals ( 5 , lookup . getCategory ( ) )
testR ( ) { org . apache . activemq . artemis . api . core . SimpleString s1 = new org . apache . activemq . artemis . api . core . SimpleString ( "a.b.c.d" ) ; org . apache . activemq . artemis . api . core . SimpleString s3 = new org . apache . activemq . artemis . api . core . SimpleString ( "#*a.b.c" ) ; org . apache . activemq . artemis . core . postoffice . Address a1 = new org . apache . activemq . artemis . core . postoffice . impl . AddressImpl ( s1 ) ; org . apache . activemq . artemis . core . postoffice . Address w = new org . apache . activemq . artemis . core . postoffice . impl . AddressImpl ( s3 ) ; "<AssertPlaceHolder>" ; } matches ( org . apache . activemq . artemis . core . postoffice . Address ) { if ( otherAddr == null ) return false ; if ( address . equals ( otherAddr . getAddress ( ) ) ) return true ; final char sepAnyWords = wildcardConfiguration . getAnyWords ( ) ; final char sepSingleWord = wildcardConfiguration . getSingleWord ( ) ; final int thisAddrPartsLen = addressParts . length ; final int thisAddrPartsLastIdx = thisAddrPartsLen - 1 ; final org . apache . activemq . artemis . api . core . SimpleString [ ] otherAddrParts = otherAddr . getAddressParts ( ) ; final int otherAddrPartsLen = otherAddrParts . length ; final int otherAddrPartsLastIdx = otherAddrPartsLen - 1 ; int thisIdx = 0 ; int otherIdx = 0 ; while ( otherIdx < otherAddrPartsLen ) { if ( thisIdx > thisAddrPartsLastIdx ) { if ( otherIdx == otherAddrPartsLastIdx ) { final org . apache . activemq . artemis . api . core . SimpleString otherAddrLastPart = otherAddrParts [ otherAddrPartsLastIdx ] ; return ( ( otherAddrLastPart . length ( ) ) > 0 ) && ( ( otherAddrLastPart . charAt ( 0 ) ) == sepAnyWords ) ; } return false ; } org . apache . activemq . artemis . api . core . SimpleString thisCurr = addressParts [ thisIdx ] ; final org . apache . activemq . artemis . api . core . SimpleString otherCurr = otherAddrParts [ otherIdx ] ; final boolean otherCurrPartIsSingleChar = ( otherCurr . length ( ) ) == 1 ; if ( otherCurrPartIsSingleChar && ( ( otherCurr . charAt ( 0 ) ) == sepSingleWord ) ) { thisIdx ++ ; otherIdx ++ ; continue ; } if ( otherCurrPartIsSingleChar && ( ( otherCurr . charAt ( 0 ) ) == sepAnyWords ) ) { if ( otherIdx == otherAddrPartsLastIdx ) return true ; org . apache . activemq . artemis . api . core . SimpleString thisNext ; if ( thisIdx < thisAddrPartsLastIdx ) { thisNext = addressParts [ ( thisIdx + 1 ) ] ; } else { thisNext = thisCurr ; } final org . apache . activemq . artemis . api . core . SimpleString otherNext = otherAddrParts [ ( otherIdx + 1 ) ] ; while ( thisCurr != null ) { if ( thisCurr . equals ( otherNext ) ) { break ; } thisIdx ++ ; thisCurr = thisNext ; thisNext = ( thisAddrPartsLastIdx > thisIdx ) ? addressParts [ ( thisIdx + 1 ) ] : null ; } if ( thisCurr == null ) return false ; otherIdx ++ ; continue ; } if ( ! ( thisCurr . equals ( otherCurr ) ) ) return false ; thisIdx ++ ; otherIdx ++ ; } return thisIdx == thisAddrPartsLen ; }
org . junit . Assert . assertFalse ( a1 . matches ( w ) )
testAddTypeBeforeFormatJavaTypeGeneratesCorrectFQNs ( ) { final java . lang . String baseType = "myType" ; final java . lang . String fullyQualifiedType = "org.myPackage." + baseType ; importUtils . addType ( fullyQualifiedType ) ; "<AssertPlaceHolder>" ; } formatJavaType ( java . lang . String ) { if ( typeName != null ) { org . apache . cayenne . gen . StringUtils stringUtils = org . apache . cayenne . gen . StringUtils . getInstance ( ) ; java . lang . String typeClassName = stringUtils . stripPackageName ( typeName ) ; if ( ( ( ! ( reservedImportTypesMap . containsKey ( typeClassName ) ) ) && ( importTypesMap . containsKey ( typeClassName ) ) ) && ( typeName . equals ( importTypesMap . get ( typeClassName ) ) ) ) { return typeClassName ; } java . lang . String typePackageName = stringUtils . stripClass ( typeName ) ; if ( "java.lang" . equals ( typePackageName ) ) { return typeClassName ; } if ( ( null != ( packageName ) ) && ( packageName . equals ( typePackageName ) ) ) { return typeClassName ; } } return typeName ; }
org . junit . Assert . assertEquals ( baseType , importUtils . formatJavaType ( fullyQualifiedType ) )
getMaxCopyAttempts ( ) { copierOptions . put ( S3S3CopierOptions . Keys . MAX_COPY_ATTEMPTS . keyName ( ) , 3 ) ; com . hotels . bdp . circustrain . s3s3copier . S3S3CopierOptions options = new com . hotels . bdp . circustrain . s3s3copier . S3S3CopierOptions ( copierOptions ) ; "<AssertPlaceHolder>" ; } getMaxCopyAttempts ( ) { java . lang . Integer maxCopyAttempts = org . apache . commons . collections . MapUtils . getInteger ( copierOptions , com . hotels . bdp . circustrain . s3s3copier . S3S3CopierOptions . Keys . MAX_COPY_ATTEMPTS . keyName ( ) , 3 ) ; return maxCopyAttempts < 1 ? 3 : maxCopyAttempts ; }
org . junit . Assert . assertThat ( options . getMaxCopyAttempts ( ) , org . hamcrest . CoreMatchers . is ( 3 ) )
MDC ( ) { org . slf4j . MDC . put ( "key" , "testValue" ) ; ch . qos . logback . classic . spi . ILoggingEvent event = createLoggingEvent ( ) ; ch . qos . logback . classic . spi . ILoggingEvent remoteEvent = writeAndRead ( event ) ; checkForEquality ( event , remoteEvent ) ; java . util . Map < java . lang . String , java . lang . String > MDCPropertyMap = remoteEvent . getMDCPropertyMap ( ) ; "<AssertPlaceHolder>" ; } get ( int ) { if ( ( i < 0 ) || ( i >= ( numElems ) ) ) return null ; return ea [ ( ( ( first ) + i ) % ( maxSize ) ) ] ; }
org . junit . Assert . assertEquals ( "testValue" , MDCPropertyMap . get ( "key" ) )
settingsShouldSupportUnsignedShort ( ) { char key = ( ( char ) ( ( Short . MAX_VALUE ) + 1 ) ) ; settings . put ( key , ( ( java . lang . Long ) ( 123L ) ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . CharSequence ) { return get0 ( name ) ; }
org . junit . Assert . assertEquals ( 123L , ( ( long ) ( settings . get ( key ) ) ) )
testEvalException ( ) { com . streamsets . datacollector . runner . FilterRecordBatch . Predicate predicate = new com . streamsets . datacollector . runner . PreconditionsPredicate ( createContext ( ) , java . util . Collections . singletonList ( "${str:truncate(\"abcd\",<sp>-4)<sp>!=<sp>\"abcd\"}" ) ) ; com . streamsets . pipeline . api . Record record = new com . streamsets . datacollector . record . RecordImpl ( "" , "" , null , null ) ; record . set ( com . streamsets . pipeline . api . Field . create ( "Hello" ) ) ; predicate . evaluate ( record ) ; "<AssertPlaceHolder>" ; } getRejectedMessage ( ) { com . google . common . base . Preconditions . checkState ( ( ! ( missingFields . isEmpty ( ) ) ) , "Called<sp>for<sp>record<sp>that<sp>passed<sp>the<sp>predicate<sp>check" ) ; return new com . streamsets . pipeline . api . impl . ErrorMessage ( com . streamsets . datacollector . util . ContainerError . CONTAINER_0050 , missingFields ) ; }
org . junit . Assert . assertNotNull ( predicate . getRejectedMessage ( ) )
testUnderscoreField ( ) { db . command ( new com . orientechnologies . orient . core . sql . OCommandSQL ( "create<sp>class<sp>Test<sp>extends<sp>V" ) ) . execute ( ) ; db . command ( new com . orientechnologies . orient . core . sql . OCommandSQL ( "create<sp>property<sp>V._attr1<sp>string" ) ) . execute ( ) ; db . command ( new com . orientechnologies . orient . core . sql . OCommandSQL ( "create<sp>index<sp>V._attr1<sp>on<sp>V<sp>(_attr1)<sp>fulltext<sp>engine<sp>lucene" ) ) . execute ( ) ; db . command ( new com . orientechnologies . orient . core . sql . OCommandSQL ( "insert<sp>into<sp>Test<sp>set<sp>_attr1='anyPerson',<sp>attr2='bar'" ) ) . execute ( ) ; com . orientechnologies . orient . core . sql . query . OSQLSynchQuery query = new com . orientechnologies . orient . core . sql . query . OSQLSynchQuery ( "select<sp>from<sp>Test<sp>where<sp>_attr1<sp>lucene<sp>:name" ) ; java . util . Map params = new java . util . HashMap ( ) ; params . put ( "name" , "anyPerson" ) ; java . util . List results = db . command ( query ) . execute ( params ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented<sp>yet" ) ; }
org . junit . Assert . assertEquals ( results . size ( ) , 1 )
copyFile_FileValid ( ) { java . io . File fileSrc = new java . io . File ( com . archimatetool . editor . TestSupport . getTestDataFolder ( ) , "filetest/readme.txt" ) ; java . io . File fileTgt = com . archimatetool . tests . TestUtils . createTempFile ( ".txt" ) ; com . archimatetool . editor . utils . FileUtils . copyFile ( fileSrc , fileTgt , false ) ; com . archimatetool . editor . TestSupport . checkSourceAndTargetFileSame ( fileSrc , fileTgt ) ; "<AssertPlaceHolder>" ; } checkSourceAndTargetFileSame ( java . io . File , java . io . File ) { if ( ! ( srcFile . exists ( ) ) ) { throw new java . io . IOException ( ( "Source<sp>File<sp>doesn't<sp>exist:<sp>" + targetFile ) ) ; } if ( ! ( targetFile . exists ( ) ) ) { throw new java . io . IOException ( ( "Target<sp>File<sp>doesn't<sp>exist:<sp>" + targetFile ) ) ; } if ( ( targetFile . length ( ) ) != ( srcFile . length ( ) ) ) { throw new java . io . IOException ( ( ( ( "Files<sp>don't<sp>compare<sp>in<sp>size:<sp>" + srcFile ) + "<sp>and<sp>" ) + targetFile ) ) ; } }
org . junit . Assert . assertTrue ( true )
testUnmarshal22 ( ) { slash . navigation . kml . Reader reader = new slash . navigation . kml . FileReader ( ( ( TEST_PATH ) + "from22.kml" ) ) ; slash . navigation . kml . binding22 . KmlType kml = unmarshal22 ( reader ) ; "<AssertPlaceHolder>" ; } unmarshal22 ( java . io . Reader ) { slash . navigation . kml . binding22 . KmlType result ; try { javax . xml . bind . JAXBElement element = ( ( javax . xml . bind . JAXBElement ) ( slash . navigation . kml . KmlUtil . newUnmarshaller22 ( ) . unmarshal ( reader ) ) ) ; result = ( ( slash . navigation . kml . binding22 . KmlType ) ( element . getValue ( ) ) ) ; } catch ( java . lang . ClassCastException e ) { throw new javax . xml . bind . JAXBException ( ( "Parse<sp>error:<sp>" + e ) ) ; } return result ; }
org . junit . Assert . assertNotNull ( kml )
testEmpty ( ) { soot . SootClass scJLO = getSootClass ( "java.lang.Object" ) ; soot . SootClass scEmpty = getSootClass ( "org.robovm.compiler.a.Empty" ) ; org . robovm . compiler . VTable . Cache cache = new org . robovm . compiler . VTable . Cache ( ) ; org . robovm . compiler . VTable vtableJLO = cache . get ( scJLO ) ; org . robovm . compiler . VTable vtableEmpty = cache . get ( scEmpty ) ; "<AssertPlaceHolder>" ; } getEntries ( ) { return java . util . Arrays . copyOf ( entries , entries . length ) ; }
org . junit . Assert . assertArrayEquals ( vtableJLO . getEntries ( ) , vtableEmpty . getEntries ( ) )
find_max_value_from_list_of_integers_guava ( ) { java . util . List < java . lang . Integer > top10CentersNumbers = com . google . common . collect . Lists . newArrayList ( 63 , 52 , 62 , 0 , 66 , 0 , 57 , 51 , 60 ) ; java . lang . Integer maxJerseyNumber = com . google . common . collect . Ordering . natural ( ) . max ( top10CentersNumbers ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( new java . lang . Integer ( 66 ) , maxJerseyNumber )
testScan ( ) { int recordcount = 10 ; java . util . Set < java . lang . String > fields = com . yahoo . ycsb . db . ElasticsearchClientTest . MOCK_DATA . keySet ( ) ; java . util . Vector < java . util . HashMap < java . lang . String , com . yahoo . ycsb . ByteIterator > > resultParam = new java . util . Vector ( 10 ) ; com . yahoo . ycsb . Status result = com . yahoo . ycsb . db . ElasticsearchClientTest . instance . scan ( com . yahoo . ycsb . db . ElasticsearchClientTest . MOCK_TABLE , com . yahoo . ycsb . db . ElasticsearchClientTest . MOCK_KEY1 , recordcount , fields , resultParam ) ; "<AssertPlaceHolder>" ; } scan ( java . lang . String , java . lang . String , int , java . util . Set , java . util . Vector ) { try { com . yahoo . ycsb . db . Query query = new com . yahoo . ycsb . db . Query ( ) . setRangeStart ( startkey ) . setLimit ( recordcount ) . setIncludeDocs ( true ) . setStale ( stale ) ; com . yahoo . ycsb . db . ViewResponse response = client . query ( view , query ) ; for ( com . yahoo . ycsb . db . ViewRow row : response ) { java . util . HashMap < java . lang . String , com . yahoo . ycsb . ByteIterator > rowMap = new java . util . HashMap ( ) ; decode ( row . getDocument ( ) , fields , rowMap ) ; result . add ( rowMap ) ; } return com . yahoo . ycsb . Status . OK ; } catch ( java . lang . Exception e ) { log . error ( e . getMessage ( ) ) ; } return com . yahoo . ycsb . Status . ERROR ; }
org . junit . Assert . assertEquals ( Status . OK , result )
testGet_InZK ( ) { org . apache . accumulo . core . conf . Property p = org . apache . accumulo . core . conf . Property . INSTANCE_SECRET ; expect ( zc . get ( ( ( ( ( ( ( ( org . apache . accumulo . fate . zookeeper . ZooUtil . getRoot ( iid ) ) + ( org . apache . accumulo . core . Constants . ZNAMESPACES ) ) + "/" ) + ( org . apache . accumulo . server . conf . NamespaceConfigurationTest . NSID ) ) + ( org . apache . accumulo . core . Constants . ZNAMESPACE_CONF ) ) + "/" ) + ( p . getKey ( ) ) ) ) ) . andReturn ( "sekrit" . getBytes ( org . apache . accumulo . server . conf . UTF_8 ) ) ; replay ( zc ) ; "<AssertPlaceHolder>" ; } get ( org . apache . accumulo . core . conf . Property ) { java . lang . String v = props . get ( property . getKey ( ) ) ; if ( ( v == null ) & ( ( parent ) != null ) ) { v = parent . get ( property ) ; } return v ; }
org . junit . Assert . assertEquals ( "sekrit" , c . get ( Property . INSTANCE_SECRET ) )
testWriteValueSubPortsNull ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( true ) )
testMacroInvocationWithoutAllArguments ( ) { com . mitchellbosecke . pebble . PebbleEngine pebble = new com . mitchellbosecke . pebble . PebbleEngine . Builder ( ) . loader ( new com . mitchellbosecke . pebble . loader . StringLoader ( ) ) . strictVariables ( false ) . build ( ) ; com . mitchellbosecke . pebble . template . PebbleTemplate template = pebble . getTemplate ( "{{<sp>test('1')<sp>}}{%<sp>macro<sp>test(one,two)<sp>%}{{<sp>one<sp>}}{{<sp>two<sp>}}{%<sp>endmacro<sp>%}" ) ; java . io . Writer writer = new java . io . StringWriter ( ) ; template . evaluate ( writer ) ; "<AssertPlaceHolder>" ; } toString ( ) { return sb . toString ( ) ; }
org . junit . Assert . assertEquals ( "1" , writer . toString ( ) )
getName ( ) { "<AssertPlaceHolder>" ; } getName ( ) { return cache . getName ( ) ; }
org . junit . Assert . assertEquals ( name , cache . getName ( ) )
testEvalListener ( ) { javax . el . ELProcessor elp = new javax . el . ELProcessor ( ) ; javax . el . ELManager elm = elp . getELManager ( ) ; final java . util . ArrayList < java . lang . String > msgs = new java . util . ArrayList < java . lang . String > ( ) ; elm . addEvaluationListener ( new javax . el . EvaluationListener ( ) { @ org . glassfish . el . test . Override public void beforeEvaluation ( javax . el . ELContext ctxt , java . lang . String expr ) { System . out . println ( ( "Before:<sp>" + expr ) ) ; msgs . add ( ( "Before:<sp>" + expr ) ) ; } @ org . glassfish . el . test . Override public void afterEvaluation ( javax . el . ELContext ctxt , java . lang . String expr ) { System . out . println ( ( "After:<sp>" + expr ) ) ; msgs . add ( ( "After:<sp>" + expr ) ) ; } } ) ; elp . eval ( "100<sp>+<sp>10" ) ; elp . eval ( "x<sp>=<sp>5;<sp>x*101" ) ; java . lang . String [ ] expected = new java . lang . String [ ] { "Before:<sp>${100<sp>+<sp>10}" , "After:<sp>${100<sp>+<sp>10}" , "Before:<sp>${x<sp>=<sp>5;<sp>x*101}" , "After:<sp>${x<sp>=<sp>5;<sp>x*101}" } ; for ( int i = 0 ; i < ( expected . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } get ( java . lang . Object ) { cleanup ( ) ; javax . el . BeanELResolver . BPSoftReference BPRef = map . get ( key ) ; if ( BPRef == null ) { return null ; } if ( ( BPRef . get ( ) ) == null ) { map . remove ( key ) ; return null ; } return BPRef . get ( ) ; }
org . junit . Assert . assertEquals ( expected [ i ] , msgs . get ( i ) )
testFindEmptySet ( ) { com . rapleaf . jack . test_project . database_1 . iface . IUserPersistence users = dbs . getDatabase1 ( ) . users ( ) ; java . util . List < com . rapleaf . jack . test_project . database_1 . models . User > foundValues = users . find ( new java . util . HashSet ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return jsRecords . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , foundValues . size ( ) )
testFullyQualifiedDeclarativeTypeName ( ) { java . lang . String declaration = "package<sp>org.drools.compiler;\n" + "public<sp>class<sp>Bean<sp>{}" ; java . lang . String drl = "declare<sp>org.drools.compiler.Bean\n" + ( "<sp>@role(event)\n" + "end" ) ; org . kie . api . KieServices ks = KieServices . Factory . get ( ) ; org . kie . api . builder . KieFileSystem kfs = ks . newKieFileSystem ( ) . write ( "src/main/java/org/drools/compiler/Bean.java" , declaration ) . write ( "src/main/resources/bean1.drl" , drl ) ; final org . kie . api . builder . KieBuilder kieBuilder = ks . newKieBuilder ( kfs ) ; final org . kie . api . builder . KieModule kieModule = kieBuilder . buildAll ( ) . getKieModule ( ) ; final org . kie . scanner . KieModuleMetaData kieModuleMetaData = KieModuleMetaData . Factory . newKieModuleMetaData ( kieModule ) ; final java . lang . String packageName = "org.drools.compiler" ; final java . lang . String className = "Bean" ; final java . lang . Class clazz = kieModuleMetaData . getClass ( packageName , className ) ; final org . drools . core . rule . TypeMetaInfo typeMetaInfo = kieModuleMetaData . getTypeMetaInfo ( clazz ) ; "<AssertPlaceHolder>" ; } isEvent ( ) { return ( this . classType ) == ( org . drools . core . common . EventFactHandle . class ) ; }
org . junit . Assert . assertTrue ( typeMetaInfo . isEvent ( ) )
shouldAllPattern ( ) { java . lang . String regex = "[a-z]{2}-[0-9]{2}-[abc123]{2}-\\w{2}-\\d{2}@\\s{1}-\\S{1}\\.?-." ; for ( int i = 0 ; i < 100 ; i ++ ) { java . lang . String text = com . github . jsonzou . jmockdata . util . RandomUtils . nextStringFromRegex ( regex ) ; System . out . println ( text ) ; "<AssertPlaceHolder>" ; } } nextStringFromRegex ( java . lang . String ) { return com . github . jsonzou . jmockdata . util . RandomUtils . REGEX_GENERATOR . generateByRegex ( regex ) ; }
org . junit . Assert . assertTrue ( text . matches ( regex ) )
testSetCellToolTipText ( ) { org . eclipse . swt . internal . widgets . ICellToolTipAdapter adapter = table . getAdapter ( org . eclipse . swt . internal . widgets . ICellToolTipAdapter . class ) ; adapter . setCellToolTipText ( "foo" ) ; "<AssertPlaceHolder>" ; } getCellToolTipText ( ) { return toolTipText ; }
org . junit . Assert . assertEquals ( "foo" , adapter . getCellToolTipText ( ) )
testColorIsCached ( ) { org . eclipse . swt . graphics . Color color1 = com . archimatetool . editor . ui . ColorFactory . get ( 11 , 22 , 33 ) ; org . eclipse . swt . graphics . Color color2 = com . archimatetool . editor . ui . ColorFactory . get ( 11 , 22 , 33 ) ; "<AssertPlaceHolder>" ; } get ( int , int , int ) { return com . archimatetool . editor . ui . ColorFactory . get ( new org . eclipse . swt . graphics . RGB ( red , green , blue ) ) ; }
org . junit . Assert . assertSame ( color1 , color2 )
testSamlConditionsNotBeforeIsNull ( ) { final gov . hhs . fha . nhinc . callback . opensaml . CallbackProperties callbackProps = mock ( gov . hhs . fha . nhinc . callback . opensaml . CallbackProperties . class ) ; final gov . hhs . fha . nhinc . callback . opensaml . HOKSAMLAssertionBuilder builder = new gov . hhs . fha . nhinc . callback . opensaml . HOKSAMLAssertionBuilder ( ) { @ gov . hhs . fha . nhinc . callback . opensaml . Override protected boolean isConditionsDefaultValueEnabled ( ) { return false ; } } ; final org . joda . time . DateTime conditionNotAfter = new org . joda . time . DateTime ( ) ; when ( callbackProps . getSamlConditionsNotAfter ( ) ) . thenReturn ( conditionNotAfter ) ; when ( callbackProps . getSamlConditionsNotBefore ( ) ) . thenReturn ( null ) ; final org . opensaml . saml . saml2 . core . Conditions conditions = builder . createConditions ( callbackProps ) ; "<AssertPlaceHolder>" ; } createConditions ( gov . hhs . fha . nhinc . callback . opensaml . CallbackProperties ) { org . joda . time . DateTime issueInstant = new org . joda . time . DateTime ( ) ; org . joda . time . DateTime beginValidTime = properties . getSamlConditionsNotBefore ( ) ; org . joda . time . DateTime endValidTime = properties . getSamlConditionsNotAfter ( ) ; if ( ( beginValidTime != null ) && ( endValidTime != null ) ) { if ( ( isConditionsDefaultValueEnabled ( ) ) || ( beginValidTime . isAfter ( endValidTime ) ) ) { beginValidTime = gov . hhs . fha . nhinc . callback . opensaml . HOKSAMLAssertionBuilder . setBeginValidTime ( beginValidTime , issueInstant ) ; endValidTime = gov . hhs . fha . nhinc . callback . opensaml . HOKSAMLAssertionBuilder . setEndValidTime ( endValidTime , issueInstant ) ; } return componentBuilder . createConditions ( beginValidTime , endValidTime ) ; } return null ; }
org . junit . Assert . assertNull ( conditions )
appendJsonAttributeGoodCaseNameNull ( ) { java . lang . StringBuilder stringBuilder = new java . lang . StringBuilder ( ) ; stringBuilder . append ( "prefix_" ) ; java . lang . String expResult = "prefix_\"\":value," ; com . microsoft . azure . sdk . iot . deps . util . Tools . appendJsonAttribute ( stringBuilder , null , "value" , false , false ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . google . gson . Gson gson = new com . google . gson . GsonBuilder ( ) . disableHtmlEscaping ( ) . setPrettyPrinting ( ) . create ( ) ; return gson . toJson ( this ) ; }
org . junit . Assert . assertEquals ( expResult , stringBuilder . toString ( ) )
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . social . kernel . model . SocialActivity > socialActivities = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( socialActivities . isEmpty ( ) )
testGetMessageSupplierReturnsNullIfSupplierNull ( ) { final java . lang . Object actual = org . apache . logging . log4j . util . LambdaUtil . get ( ( ( org . apache . logging . log4j . util . MessageSupplier ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } get ( org . apache . logging . log4j . util . Supplier ) { if ( supplier == null ) { return null ; } final java . lang . Object result = supplier . get ( ) ; return result instanceof org . apache . logging . log4j . message . Message ? ( ( org . apache . logging . log4j . message . Message ) ( result ) ) . getFormattedMessage ( ) : result ; }
org . junit . Assert . assertNull ( actual )
whenUpdateUserInStorageByIdThenUpdateInStorage ( ) { ru . szhernovoy . storage . User userFirst = new ru . szhernovoy . storage . User ( "Sergey" ) ; ru . szhernovoy . storage . User userSecond = new ru . szhernovoy . storage . User ( "Julia" ) ; java . lang . String key = userFirst . getId ( ) ; ru . szhernovoy . storage . UserStorage myStorage = new ru . szhernovoy . storage . UserStorage ( ) ; myStorage . add ( userFirst ) ; userSecond . setId ( key ) ; myStorage . update ( userSecond ) ; "<AssertPlaceHolder>" ; } read ( java . lang . String ) { if ( this . storage . containsKey ( key ) ) { return this . storage . get ( key ) ; } else { throw new java . util . NoSuchElementException ( java . lang . String . format ( "No<sp>such<sp>User<sp>with<sp>id<sp>%s" , key ) ) ; } }
org . junit . Assert . assertThat ( "Julia" , org . hamcrest . core . Is . is ( myStorage . read ( key ) . getName ( ) ) )
testAcceptInValidParameter2 ( ) { final org . openspotlight . graph . query . console . ConsoleState state = new org . openspotlight . graph . query . console . ConsoleState ( null ) ; state . setInput ( "savex<sp>property" ) ; "<AssertPlaceHolder>" ; } accept ( org . openspotlight . graph . query . console . ConsoleState ) { org . openspotlight . common . util . Assertions . checkNotNull ( "state" , state ) ; if ( ( ( state . getActiveCommand ( ) ) == null ) && ( state . getInput ( ) . trim ( ) . equals ( "display<sp>properties" ) ) ) { return true ; } return false ; }
org . junit . Assert . assertThat ( command . accept ( state ) , org . hamcrest . core . Is . is ( false ) )
testClientGetTimeout ( ) { org . apache . hadoop . conf . Configuration config = new org . apache . hadoop . conf . Configuration ( ) ; "<AssertPlaceHolder>" ; } getTimeout ( org . apache . hadoop . conf . Configuration ) { int timeout = org . apache . hadoop . ipc . Client . getRpcTimeout ( conf ) ; if ( timeout > 0 ) { return timeout ; } if ( ! ( conf . getBoolean ( CommonConfigurationKeys . IPC_CLIENT_PING_KEY , CommonConfigurationKeys . IPC_CLIENT_PING_DEFAULT ) ) ) { return org . apache . hadoop . ipc . Client . getPingInterval ( conf ) ; } return - 1 ; }
org . junit . Assert . assertEquals ( org . apache . hadoop . ipc . Client . getTimeout ( config ) , ( - 1 ) )
testEnhanceParamsWithNull ( ) { "<AssertPlaceHolder>" ; } generateQuery ( org . apache . solr . client . solrj . SolrQuery , java . util . Map ) { if ( originalParams == null ) { return null ; } org . apache . solr . client . solrj . SolrQuery result = new org . apache . solr . client . solrj . SolrQuery ( ) ; result . setStart ( 0 ) ; result . setRows ( 1000 ) ; result . setIncludeScore ( true ) ; if ( queryOptions != null ) { for ( Map . Entry < java . lang . String , java . lang . String > item : queryOptions . entrySet ( ) ) { result . set ( item . getKey ( ) , item . getValue ( ) ) ; } } for ( Map . Entry < java . lang . String , java . lang . Object > item : originalParams . toNamedList ( ) ) { if ( ( ( item . getValue ( ) ) != null ) && ( ( item . getValue ( ) ) instanceof java . lang . String [ ] ) ) { result . set ( item . getKey ( ) , ( ( java . lang . String [ ] ) ( item . getValue ( ) ) ) ) ; } else { result . set ( item . getKey ( ) , java . lang . String . valueOf ( item . getValue ( ) ) ) ; } } if ( ( result . get ( org . phenotips . vocabulary . internal . solr . SolrQueryUtils . SPELLCHECK ) ) == null ) { result . set ( org . phenotips . vocabulary . internal . solr . SolrQueryUtils . SPELLCHECK , java . lang . Boolean . toString ( true ) ) ; result . set ( SpellingParams . SPELLCHECK_COLLATE , java . lang . Boolean . toString ( true ) ) ; } return result ; }
org . junit . Assert . assertNull ( org . phenotips . vocabulary . internal . solr . SolrQueryUtils . generateQuery ( null , null ) )
testToTerm_2 ( ) { final org . erlide . core . builder . CompilerOption . BooleanOption option = org . erlide . core . builder . CompilerOptions . WARN_EXPORT_ALL ; final com . ericsson . otp . erlang . OtpErlangObject actual = option . toTerm ( false ) ; final java . lang . String expected = "nowarn_export_all" ; "<AssertPlaceHolder>" ; } toString ( ) { return label ; }
org . junit . Assert . assertEquals ( expected , actual . toString ( ) )
testThatNoVariableCanBeExtractedFromEmptyDDS ( ) { org . esa . snap . opendap . datamodel . OpendapLeaf leaf = new org . esa . snap . opendap . datamodel . OpendapLeaf ( "empty" , new thredds . catalog . InvDataset ( null , "" ) { } ) ; final org . esa . snap . opendap . datamodel . DAPVariable [ ] dapVariables = new org . esa . snap . opendap . utils . VariableExtractor ( ) . extractVariables ( leaf ) ; "<AssertPlaceHolder>" ; } extractVariables ( org . esa . snap . opendap . datamodel . OpendapLeaf ) { opendap . dap . DDS dds = getDDS ( leaf . getDdsUri ( ) ) ; return extractVariables ( dds ) ; }
org . junit . Assert . assertEquals ( 0 , dapVariables . length )
testGetPropertyAccessorApplicationScope ( ) { ognl . PropertyAccessor objectPropertyAccessor = createMock ( ognl . PropertyAccessor . class ) ; ognl . PropertyAccessor applicationContextPropertyAccessor = createMock ( ognl . PropertyAccessor . class ) ; ognl . PropertyAccessor requestScopePropertyAccessor = createMock ( ognl . PropertyAccessor . class ) ; ognl . PropertyAccessor sessionScopePropertyAccessor = createMock ( ognl . PropertyAccessor . class ) ; ognl . PropertyAccessor applicationScopePropertyAccessor = createMock ( ognl . PropertyAccessor . class ) ; org . apache . tiles . request . Request request = createMock ( org . apache . tiles . request . Request . class ) ; org . apache . tiles . request . ApplicationContext applicationContext = createMock ( org . apache . tiles . request . ApplicationContext . class ) ; java . util . Map < java . lang . String , java . lang . Object > map = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; map . put ( "attribute" , 1 ) ; replay ( objectPropertyAccessor , applicationContextPropertyAccessor , requestScopePropertyAccessor , sessionScopePropertyAccessor , applicationScopePropertyAccessor , request , applicationContext ) ; org . apache . tiles . ognl . PropertyAccessorDelegateFactory < org . apache . tiles . request . Request > factory = new org . apache . tiles . ognl . TilesContextPropertyAccessorDelegateFactory ( objectPropertyAccessor , applicationContextPropertyAccessor , requestScopePropertyAccessor , sessionScopePropertyAccessor ) ; "<AssertPlaceHolder>" ; verify ( objectPropertyAccessor , applicationContextPropertyAccessor , requestScopePropertyAccessor , sessionScopePropertyAccessor , applicationScopePropertyAccessor , request , applicationContext ) ; } getPropertyAccessor ( java . lang . String , org . apache . tiles . request . Request ) { ognl . PropertyAccessor retValue ; if ( propertyName . endsWith ( "Scope" ) ) { java . lang . String scopeName = propertyName . substring ( 0 , ( ( propertyName . length ( ) ) - ( ScopePropertyAccessor . SCOPE_SUFFIX_LENGTH ) ) ) ; if ( ( request . getContext ( scopeName ) ) != null ) { return scopePropertyAccessor ; } } if ( beanInfo . getMappedDescriptors ( org . apache . tiles . request . Request . class ) . containsKey ( propertyName ) ) { retValue = objectPropertyAccessor ; } else if ( beanInfo . getMappedDescriptors ( org . apache . tiles . request . ApplicationContext . class ) . containsKey ( propertyName ) ) { retValue = applicationContextPropertyAccessor ; } else { return anyScopePropertyAccessor ; } return retValue ; }
org . junit . Assert . assertEquals ( requestScopePropertyAccessor , factory . getPropertyAccessor ( "attribute" , request ) )
testCodec ( ) { boolean testPassed = false ; try { final int packetSize = 480 ; java . io . File outputFile = java . io . File . createTempFile ( "opustest" , ".tmp" ) ; java . net . URL inputFileUrl = this . getClass ( ) . getResource ( "/test_sound_mono_48.pcm" ) ; org . restcomm . media . core . codec . opus . Encoder encoder = new org . restcomm . media . core . codec . opus . Encoder ( ) ; org . restcomm . media . core . codec . opus . Decoder decoder = new org . restcomm . media . core . codec . opus . Decoder ( ) ; try ( java . io . FileInputStream inputStream = new java . io . FileInputStream ( inputFileUrl . getFile ( ) ) ; java . io . FileOutputStream outputStream = new java . io . FileOutputStream ( outputFile , false ) ) { byte [ ] input = new byte [ 2 * packetSize ] ; short [ ] inputData = new short [ packetSize ] ; while ( ( inputStream . read ( input ) ) == ( 2 * packetSize ) ) { org . restcomm . media . core . spi . memory . Frame inputFrame = org . restcomm . media . core . spi . memory . Memory . allocate ( ( 2 * packetSize ) ) ; inputFrame . setOffset ( 0 ) ; inputFrame . setLength ( ( 2 * packetSize ) ) ; inputFrame . setFormat ( encoder . getSupportedInputFormat ( ) ) ; inputFrame . setTimestamp ( java . lang . System . currentTimeMillis ( ) ) ; inputFrame . setDuration ( 10 ) ; java . lang . System . arraycopy ( input , 0 , inputFrame . getData ( ) , 0 , ( 2 * packetSize ) ) ; org . restcomm . media . core . spi . memory . Frame encodedFrame = encoder . process ( inputFrame ) ; org . restcomm . media . core . spi . memory . Frame decodedFrame = decoder . process ( encodedFrame ) ; outputStream . write ( decodedFrame . getData ( ) ) ; } testPassed = true ; } finally { outputFile . delete ( ) ; } outputFile . delete ( ) ; } catch ( java . io . IOException exc ) { org . restcomm . media . core . codec . opus . OpusCodecTest . log . error ( ( "IOException:<sp>" + ( exc . getMessage ( ) ) ) ) ; org . junit . Assert . fail ( "Opus<sp>test<sp>file<sp>access<sp>error" ) ; } "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; }
org . junit . Assert . assertTrue ( testPassed )
test_getManifest_nonExisted ( ) { java . util . jar . Manifest manifest = org . talend . commons . utils . resource . BundleFileUtil . getManifest ( new java . io . File ( "abc.txt" ) ) ; "<AssertPlaceHolder>" ; } getManifest ( java . io . File ) { if ( ( ( ( f == null ) || ( ! ( f . exists ( ) ) ) ) || ( ! ( f . isFile ( ) ) ) ) || ( ! ( f . getName ( ) . endsWith ( FileExtensions . JAR_FILE_SUFFIX ) ) ) ) { return null ; } java . util . jar . JarFile jarFile = null ; try { jarFile = new java . util . jar . JarFile ( f ) ; return jarFile . getManifest ( ) ; } finally { if ( jarFile != null ) { try { jarFile . close ( ) ; } catch ( java . io . IOException e ) { } } } }
org . junit . Assert . assertNull ( manifest )
testStatisticsConsiderAllMeasurements ( ) { org . openehealth . ipf . commons . test . performance . MeasurementHistory measurementHistory = org . openehealth . ipf . commons . test . performance . PerformanceMeasurementTestUtils . createMeasurementHistory ( ) ; statistics . update ( measurementHistory ) ; long elementsInTheFrequencies = statistics . getElementCount ( statistics . calcuateProcessedSystemTime ( measurementHistory ) ) ; "<AssertPlaceHolder>" ; } calcuateProcessedSystemTime ( org . openehealth . ipf . commons . test . performance . MeasurementHistory ) { org . openehealth . ipf . commons . test . performance . Timestamp from = history . getFirstMeasurementTimestamp ( ) ; org . openehealth . ipf . commons . test . performance . Timestamp to = history . getLastMeasurementTimestamp ( ) ; java . util . Date referenceDate = history . getReferenceDate ( ) ; long differenceMs = ( to . getValue ( TimeUnit . MILLISECONDS ) ) - ( from . getValue ( TimeUnit . MILLISECONDS ) ) ; return ( referenceDate . getTime ( ) ) + differenceMs ; }
org . junit . Assert . assertEquals ( 1 , elementsInTheFrequencies )
loadWithExceptionReturnsNull ( ) { when ( this . patient . getXDocument ( ) ) . thenThrow ( new java . lang . RuntimeException ( ) ) ; "<AssertPlaceHolder>" ; } load ( org . xwiki . bridge . DocumentModelBridge ) { try { return getEntityConstructor ( ) . newInstance ( document ) ; } catch ( java . lang . IllegalArgumentException | java . lang . reflect . InvocationTargetException ex ) { this . logger . info ( "Tried<sp>to<sp>load<sp>invalid<sp>entity<sp>of<sp>type<sp>[{}]<sp>from<sp>document<sp>[{}]" , getEntityXClassReference ( ) , ( document == null ? null : document . getDocumentReference ( ) ) ) ; } catch ( java . lang . InstantiationException | java . lang . IllegalAccessException ex ) { this . logger . error ( "Failed<sp>to<sp>instantiate<sp>primary<sp>entity<sp>of<sp>type<sp>[{}]<sp>from<sp>document<sp>[{}]:<sp>{}" , getEntityXClassReference ( ) , ( document == null ? null : document . getDocumentReference ( ) ) , ex . getMessage ( ) ) ; } return null ; }
org . junit . Assert . assertNull ( this . component . load ( this . patient ) )
testChangeIndicationUnsetEndpoint ( ) { d_wizard . getIndicationModel ( ) . setValue ( org . drugis . addis . ExampleData . buildIndicationDepression ( ) ) ; d_wizard . getOutcomeMeasureModel ( ) . setValue ( org . drugis . addis . ExampleData . buildEndpointHamd ( ) ) ; java . beans . PropertyChangeListener l = org . drugis . common . JUnitUtil . mockListener ( d_wizard . getOutcomeMeasureModel ( ) , "value" , org . drugis . addis . ExampleData . buildEndpointHamd ( ) , null ) ; d_wizard . getOutcomeMeasureModel ( ) . addValueChangeListener ( l ) ; d_wizard . getIndicationModel ( ) . setValue ( org . drugis . addis . ExampleData . buildIndicationChronicHeartFailure ( ) ) ; "<AssertPlaceHolder>" ; verify ( l ) ; } getOutcomeMeasureModel ( ) { return d_mgr . getLabeledModel ( org . drugis . addis . presentation . AbstractMetaAnalysisPresentation . getBean ( ) . getOutcomeMeasure ( ) ) ; }
org . junit . Assert . assertNull ( d_wizard . getOutcomeMeasureModel ( ) . getValue ( ) )
calendarUtils_getEndOfDayFromDate_calendarAsEndOfDayReturned ( ) { java . util . Calendar testInput = java . util . Calendar . getInstance ( ) ; testInput . set ( 2014 , Calendar . MARCH , 10 ) ; java . util . Calendar expResult = ( ( java . util . Calendar ) ( testInput . clone ( ) ) ) ; expResult . set ( Calendar . HOUR_OF_DAY , 23 ) ; expResult . set ( Calendar . MINUTE , 59 ) ; expResult . set ( Calendar . SECOND , 59 ) ; expResult . set ( Calendar . MILLISECOND , 999 ) ; java . util . Calendar result = dk . i2m . converge . core . utils . CalendarUtils . getEndOfDay ( testInput . getTime ( ) ) ; "<AssertPlaceHolder>" ; } getEndOfDay ( java . util . Calendar ) { java . util . Calendar result = ( ( java . util . Calendar ) ( c . clone ( ) ) ) ; result . set ( Calendar . HOUR_OF_DAY , 23 ) ; result . set ( Calendar . MINUTE , 59 ) ; result . set ( Calendar . SECOND , 59 ) ; result . set ( Calendar . MILLISECOND , 999 ) ; return result ; }
org . junit . Assert . assertEquals ( expResult , result )
writeTo ( ) { com . baidu . unbiz . common . io . ByteArray ba ; ba = new com . baidu . unbiz . common . io . ByteArray ( data ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; ba . writeTo ( baos ) ; "<AssertPlaceHolder>" ; } toByteArray ( ) { shared = true ; return new com . baidu . unbiz . common . io . ByteArray ( buffer , 0 , index ) ; }
org . junit . Assert . assertArrayEquals ( data , baos . toByteArray ( ) )
testInvalidParameterValueHTTTPStatusErrorCode ( ) { exceptionReport = new org . n52 . wps . server . ExceptionReport ( "Test<sp>error" , org . n52 . wps . server . ExceptionReport . INVALID_PARAMETER_VALUE ) ; "<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 ) ) )
staticFactoryMethodShouldReturnSameAsConstructor ( ) { io . cereebro . core . Component b = io . cereebro . core . TestHelper . componentB ( ) ; io . cereebro . core . Dependency expected = new io . cereebro . core . Dependency ( b ) ; io . cereebro . core . Dependency actual = io . cereebro . core . Dependency . on ( b ) ; "<AssertPlaceHolder>" ; } on ( io . cereebro . core . Component ) { return new io . cereebro . core . Dependency ( component ) ; }
org . junit . Assert . assertEquals ( expected , actual )
convertToSyntaxObjectWhenNull ( ) { org . xwiki . rendering . syntax . Syntax syntax = ( ( org . xwiki . rendering . syntax . Syntax ) ( this . mocker . getComponentUnderTest ( ) . convert ( org . xwiki . rendering . syntax . Syntax . class , null ) ) ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . reflect . Type , java . lang . Object ) { return this . converter . convert ( targetType , sourceValue ) ; }
org . junit . Assert . assertNull ( syntax )
testString ( ) { java . lang . String l2 = ( ( java . lang . String ) ( org . mapdb . elsa . ElsaSerializerBaseTest . clone ( "Abcd" ) ) ) ; "<AssertPlaceHolder>" ; } clone ( E ) { return org . mapdb . elsa . ElsaSerializerBaseTest . clonePojo ( value ) ; }
org . junit . Assert . assertEquals ( l2 , "Abcd" )
test ( ) { org . psjava . ds . geometry . Point2D < java . lang . Integer > p1 = org . psjava . formula . geometry . PointByDirectionComparatorTest . toPoint ( 10 , 0 ) ; org . psjava . ds . geometry . Point2D < java . lang . Integer > p2 = org . psjava . formula . geometry . PointByDirectionComparatorTest . toPoint ( ( - 10 ) , 0 ) ; org . psjava . ds . geometry . Point2D < java . lang . Integer > p3 = org . psjava . formula . geometry . PointByDirectionComparatorTest . toPoint ( 0 , 10 ) ; org . psjava . ds . geometry . Point2D < java . lang . Integer > p4 = org . psjava . formula . geometry . PointByDirectionComparatorTest . toPoint ( 0 , ( - 10 ) ) ; java . util . ArrayList < org . psjava . ds . geometry . Point2D < java . lang . Integer > > list = org . psjava . TestUtil . toArrayList ( p1 , p2 , p3 , p4 ) ; java . util . Collections . sort ( list , org . psjava . formula . geometry . PointByDirectionComparatorTest . COMP ) ; "<AssertPlaceHolder>" ; } sort ( org . psjava . ds . array . MutableArray , java . util . Comparator ) { for ( int i = 0 ; i < ( a . size ( ) ) ; i ++ ) for ( int j = 0 ; j < ( ( a . size ( ) ) - 1 ) ; j ++ ) if ( ( comparator . compare ( a . get ( j ) , a . get ( ( j + 1 ) ) ) ) > 0 ) org . psjava . ds . array . ArraySwapper . swap ( a , j , ( j + 1 ) ) ; }
org . junit . Assert . assertEquals ( org . psjava . TestUtil . toArrayList ( p1 , p3 , p2 , p4 ) , list )
testGetAttributeValueGroupAdmin ( ) { System . out . println ( "testGetAttributeValue()<sp>-<sp>isGroupAdmin" ) ; attribute . setValue ( true ) ; cz . metacentrum . perun . core . api . Attribute testAttr = cz . metacentrum . perun . core . impl . modules . attributes . urn_perun_member_group_attribute_def_virt_isGroupAdminTest . classInstance . getAttributeValue ( session , member , group , attrDef ) ; "<AssertPlaceHolder>" ; } getAttributeValue ( cz . metacentrum . perun . core . impl . PerunSessionImpl , cz . metacentrum . perun . core . api . Group , cz . metacentrum . perun . core . api . Resource , cz . metacentrum . perun . core . api . AttributeDefinition ) { cz . metacentrum . perun . core . api . Attribute attribute = new cz . metacentrum . perun . core . api . Attribute ( attributeDefinition ) ; cz . metacentrum . perun . core . api . Attribute unixGIDNamespaceAttribute ; try { unixGIDNamespaceAttribute = sess . getPerunBl ( ) . getModulesUtilsBl ( ) . getUnixGIDNamespaceAttributeWithNotNullValue ( sess , resource ) ; } catch ( cz . metacentrum . perun . core . api . exceptions . WrongReferenceAttributeValueException ex ) { return attribute ; } try { cz . metacentrum . perun . core . api . Attribute gidAttribute = sess . getPerunBl ( ) . getAttributesManagerBl ( ) . getAttribute ( sess , group , ( ( ( cz . metacentrum . perun . core . api . AttributesManager . NS_GROUP_ATTR_DEF ) + ":unixGID-namespace:" ) + ( unixGIDNamespaceAttribute . getValue ( ) ) ) ) ; return cz . metacentrum . perun . core . impl . Utils . copyAttributeToVirtualAttributeWithValue ( gidAttribute , attribute ) ; } catch ( cz . metacentrum . perun . core . api . exceptions . WrongAttributeAssignmentException ex ) { throw new cz . metacentrum . perun . core . api . exceptions . InternalErrorException ( ex ) ; } catch ( cz . metacentrum . perun . core . api . exceptions . AttributeNotExistsException ex ) { throw new cz . metacentrum . perun . core . api . exceptions . ConsistencyErrorException ( ex ) ; } }
org . junit . Assert . assertEquals ( testAttr , attribute )
testGetInstance_withCache ( ) { com . hazelcast . simulator . worker . loadsupport . Streamer streamer = com . hazelcast . simulator . worker . loadsupport . StreamerFactory . getInstance ( cache ) ; "<AssertPlaceHolder>" ; } getInstance ( com . hazelcast . core . IMap ) { return com . hazelcast . simulator . worker . loadsupport . StreamerFactory . getInstance ( map , com . hazelcast . simulator . worker . loadsupport . Streamer . DEFAULT_CONCURRENCY_LEVEL ) ; }
org . junit . Assert . assertNotNull ( streamer )
detect_A$String_null ( ) { java . lang . String sourceCodeString = "foobar" ; org . junithelper . core . meta . CurrentLineBreak actual = org . junithelper . core . extractor . CurrentLineBreakDetector . detect ( sourceCodeString ) ; org . junithelper . core . meta . CurrentLineBreak expected = null ; "<AssertPlaceHolder>" ; } detect ( java . lang . String ) { if ( sourceCodeString == null ) { return null ; } else if ( sourceCodeString . contains ( "\r\n" ) ) { return org . junithelper . core . meta . CurrentLineBreak . CRLF ; } else if ( sourceCodeString . contains ( "\n" ) ) { return org . junithelper . core . meta . CurrentLineBreak . LF ; } return null ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
testSingleValue ( ) { com . liferay . dynamic . data . mapping . form . evaluator . internal . function . DefaultDDMExpressionFieldAccessor ddmExpressionFieldAccessor = new com . liferay . dynamic . data . mapping . form . evaluator . internal . function . DefaultDDMExpressionFieldAccessor ( ) ; com . liferay . dynamic . data . mapping . expression . GetFieldPropertyResponse . Builder builder = GetFieldPropertyResponse . Builder . newBuilder ( new java . math . BigDecimal ( 10 ) ) ; ddmExpressionFieldAccessor . setGetFieldPropertyResponseFunction ( ( getFieldPropertyRequest ) -> builder . build ( ) ) ; _getValueFunction . setDDMExpressionFieldAccessor ( ddmExpressionFieldAccessor ) ; java . lang . Object result = _getValueFunction . apply ( "field" ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . String ) { return _getUrlTitle ( languageId ) ; }
org . junit . Assert . assertEquals ( new java . math . BigDecimal ( 10 ) , result )
testGetItemAfterRemoveReturnsNull ( ) { com . eclipsesource . tabris . widgets . swipe . SwipeItem item = mock ( com . eclipsesource . tabris . widgets . swipe . SwipeItem . class ) ; swipeItemHolder . addItem ( 0 , item ) ; swipeItemHolder . removeItem ( 0 ) ; com . eclipsesource . tabris . widgets . swipe . SwipeItem actualItem = swipeItemHolder . getItem ( 0 ) ; "<AssertPlaceHolder>" ; } getItem ( int ) { return items . get ( getKey ( index ) ) ; }
org . junit . Assert . assertNull ( actualItem )
testPlaceHolderWithFullShape ( ) { lombok . val sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; lombok . val placeholder = sd . placeHolder ( "somevar" , DataType . FLOAT , 2 , 2 ) ; "<AssertPlaceHolder>" ; sd . resolveVariablesWith ( org . nd4j . autodiff . samediff . Collections . singletonMap ( placeholder . getVarName ( ) , org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 4 , 4 ) ) ) ; } isPlaceHolder ( org . nd4j . imports . graphmapper . tf . NodeDef ) { return nodeDef . getOp ( ) . startsWith ( "Placeholder" ) ; }
org . junit . Assert . assertTrue ( sd . isPlaceHolder ( placeholder . getVarName ( ) ) )
testConvertToRuleActionOut ( ) { org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentConsumer im = new org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentConsumer ( ) ; im . setEndpointTypeExpression ( "\"MyEndpoint\"" ) ; im . setUriExpression ( "\"MyUri\"" ) ; im . setOperationExpression ( "\"MyOperation\"" ) ; im . setDirection ( Direction . Out ) ; org . hawkular . apm . instrumenter . rules . InstrumentConsumerTransformer transformer = new org . hawkular . apm . instrumenter . rules . InstrumentConsumerTransformer ( ) ; java . lang . String transformed = transformer . convertToRuleAction ( im ) ; java . lang . String expected = ( org . hawkular . apm . instrumenter . rules . InstrumentConsumerTransformerTest . ACTION_PREFIX ) + "consumerEnd(getRuleName(),\"MyUri\",\"MyEndpoint\",\"MyOperation\")" ; "<AssertPlaceHolder>" ; } convertToRuleAction ( org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentAction ) { return "unlink()" ; }
org . junit . Assert . assertEquals ( expected , transformed )
shouldFindAllMethodsWithMyAnnotation ( ) { final java . util . List < java . lang . reflect . Method > result = de . akquinet . jbosscc . needle . reflection . ReflectionUtil . getAllMethodsWithAnnotation ( de . akquinet . jbosscc . needle . reflection . DerivedClass . class , de . akquinet . jbosscc . needle . reflection . MyAnnotation . class ) ; "<AssertPlaceHolder>" ; } getAllMethodsWithAnnotation ( java . lang . Class , java . lang . Class ) { final java . util . List < java . lang . reflect . Method > result = new java . util . ArrayList < java . lang . reflect . Method > ( ) ; new de . akquinet . jbosscc . needle . reflection . DerivedClassIterator ( clazz ) { @ de . akquinet . jbosscc . needle . reflection . Override protected boolean handleClass ( final java . lang . Class < ? > clazz ) { for ( final java . lang . reflect . Method method : clazz . getDeclaredMethods ( ) ) { if ( method . isAnnotationPresent ( annotation ) ) { result . add ( method ) ; } } return true ; } } . iterate ( ) ; return result ; }
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . CoreMatchers . is ( 2 ) )
testGetSeriesKey ( ) { double [ ] values = new double [ ] { 1.0 , 2.0 , 3.0 , 4.0 , 6.0 , 12.0 , 5.0 , 6.3 , 4.5 } ; org . jfree . data . statistics . HistogramDataset d1 = new org . jfree . data . statistics . HistogramDataset ( ) ; d1 . addSeries ( "Series<sp>1" , values , 5 ) ; "<AssertPlaceHolder>" ; } getSeriesKey ( int ) { return getSeries ( series ) . getKey ( ) ; }
org . junit . Assert . assertEquals ( "Series<sp>1" , d1 . getSeriesKey ( 0 ) )
testOutputPrefix_Specified ( ) { org . sejda . model . parameter . RotateParameters parameters = defaultCommandLine ( ) . with ( "-p" , "fooPrefix" ) . invokeSejdaConsole ( ) ; "<AssertPlaceHolder>" ; } getOutputPrefix ( ) { return outputPrefix ; }
org . junit . Assert . assertEquals ( "fooPrefix" , parameters . getOutputPrefix ( ) )
testGetStreamNamesWithNoItems ( ) { when ( mockResult . getStreams ( ) ) . thenReturn ( new java . util . ArrayList < com . amazonaws . services . dynamodbv2 . model . Stream > ( ) ) ; java . util . List < java . lang . String > actual = adapter . getStreamNames ( ) ; "<AssertPlaceHolder>" ; } getStreamNames ( ) { java . util . List < com . amazonaws . services . dynamodbv2 . model . Stream > streams = internalResult . getStreams ( ) ; java . util . List < java . lang . String > streamArns = new java . util . ArrayList ( streams . size ( ) ) ; for ( com . amazonaws . services . dynamodbv2 . model . Stream stream : streams ) { streamArns . add ( stream . getStreamArn ( ) ) ; } return streamArns ; }
org . junit . Assert . assertTrue ( actual . isEmpty ( ) )
testMongo ( ) { java . lang . Long id = 1L ; System . out . println ( "testMongo<sp>start" ) ; userService . saveToMongo ( id , "ttt" , 34 ) ; com . ubankers . userservice . business . domain . UserMongo userMongo = userService . findOneFromMongo ( 1L ) ; System . out . println ( ( userMongo == null ) ) ; "<AssertPlaceHolder>" ; userService . deleteMongo ( id ) ; System . out . println ( "testMongo<sp>over" ) ; } findOneFromMongo ( java . lang . Long ) { return userRepository . findById ( id ) ; }
org . junit . Assert . assertNotNull ( userMongo )
testGetPreviousVisibleColumn_WithColumnOrder ( ) { org . eclipse . nebula . widgets . grid . GridColumn [ ] columns = org . eclipse . nebula . widgets . grid . GridTestUtil . createGridColumns ( grid , 5 , SWT . NONE ) ; grid . setColumnOrder ( new int [ ] { 4 , 0 , 2 , 1 , 3 } ) ; "<AssertPlaceHolder>" ; } getPreviousVisibleColumn ( org . eclipse . nebula . widgets . grid . GridColumn ) { checkWidget ( ) ; org . eclipse . nebula . widgets . grid . GridColumn result = null ; int index = 0 ; if ( column == null ) { index = displayOrderedColumns . size ( ) ; } else { index = displayOrderedColumns . indexOf ( column ) ; } if ( index > 0 ) { result = displayOrderedColumns . get ( ( index - 1 ) ) ; while ( ( result != null ) && ( ! ( result . isVisible ( ) ) ) ) { index -- ; if ( index > 0 ) { result = displayOrderedColumns . get ( ( index - 1 ) ) ; } else { result = null ; } } } return result ; }
org . junit . Assert . assertSame ( columns [ 0 ] , grid . getPreviousVisibleColumn ( columns [ 2 ] ) )
test7getServiceDefs ( ) { javax . servlet . http . HttpServletRequest request = org . mockito . Mockito . mock ( javax . servlet . http . HttpServletRequest . class ) ; org . apache . ranger . plugin . util . SearchFilter filter = new org . apache . ranger . plugin . util . SearchFilter ( ) ; filter . setParam ( SearchFilter . POLICY_NAME , "policyName" ) ; filter . setParam ( SearchFilter . SERVICE_NAME , "serviceName" ) ; org . mockito . Mockito . when ( searchUtil . getSearchFilter ( request , serviceDefService . sortFields ) ) . thenReturn ( filter ) ; java . util . List < org . apache . ranger . plugin . model . RangerServiceDef > serviceDefsList = new java . util . ArrayList < org . apache . ranger . plugin . model . RangerServiceDef > ( ) ; org . apache . ranger . plugin . model . RangerServiceDef serviceDef = rangerServiceDef ( ) ; serviceDefsList . add ( serviceDef ) ; org . apache . ranger . plugin . store . PList < org . apache . ranger . plugin . model . RangerServiceDef > serviceDefList = new org . apache . ranger . plugin . store . PList < org . apache . ranger . plugin . model . RangerServiceDef > ( ) ; serviceDefList . setPageSize ( 0 ) ; serviceDefList . setResultSize ( 1 ) ; serviceDefList . setSortBy ( "asc" ) ; serviceDefList . setSortType ( "1" ) ; serviceDefList . setStartIndex ( 0 ) ; serviceDefList . setTotalCount ( 10 ) ; serviceDefList . setList ( serviceDefsList ) ; org . mockito . Mockito . when ( bizUtil . hasModuleAccess ( RangerConstants . MODULE_RESOURCE_BASED_POLICIES ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( svcStore . getPaginatedServiceDefs ( filter ) ) . thenReturn ( serviceDefList ) ; org . apache . ranger . view . RangerServiceDefList dbRangerServiceDef = serviceREST . getServiceDefs ( request ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( searchUtil ) . getSearchFilter ( request , serviceDefService . sortFields ) ; org . mockito . Mockito . verify ( svcStore ) . getPaginatedServiceDefs ( filter ) ; } getServiceDefs ( javax . servlet . http . HttpServletRequest ) { if ( org . apache . ranger . rest . ServiceREST . LOG . isDebugEnabled ( ) ) { org . apache . ranger . rest . ServiceREST . LOG . debug ( "==><sp>ServiceREST.getServiceDefs()" ) ; } if ( ! ( bizUtil . hasModuleAccess ( RangerConstants . MODULE_RESOURCE_BASED_POLICIES ) ) ) { throw restErrorUtil . createRESTException ( HttpServletResponse . SC_FORBIDDEN , ( ( "User<sp>is<sp>not<sp>having<sp>permissions<sp>on<sp>the<sp>" + ( org . apache . ranger . common . RangerConstants . MODULE_RESOURCE_BASED_POLICIES ) ) + "<sp>module." ) , true ) ; } org . apache . ranger . view . RangerServiceDefList ret = null ; org . apache . ranger . plugin . util . RangerPerfTracer perf = null ; org . apache . ranger . plugin . store . PList < org . apache . ranger . plugin . model . RangerServiceDef > paginatedSvcDefs = null ; org . apache . ranger . plugin . util . SearchFilter filter = searchUtil . getSearchFilter ( request , serviceDefService . sortFields ) ; java . lang . String pageSource = null ; pageSource = request . getParameter ( "pageSource" ) ; if ( pageSource != null ) filter . setParam ( "pageSource" , pageSource ) ; try { if ( org . apache . ranger . plugin . util . RangerPerfTracer . isPerfTraceEnabled ( org . apache . ranger . rest . ServiceREST . PERF_LOG ) ) { perf = org . apache . ranger . plugin . util . RangerPerfTracer . getPerfTracer ( org . apache . ranger . rest . ServiceREST . PERF_LOG , "ServiceREST.getServiceDefs()" ) ; } paginatedSvcDefs = svcStore . getPaginatedServiceDefs ( filter ) ; if ( paginatedSvcDefs != null ) { ret = new org . apache . ranger . view . RangerServiceDefList ( ) ; ret . setServiceDefs ( paginatedSvcDefs . getList ( ) ) ; ret . setPageSize ( paginatedSvcDefs . getPageSize ( ) ) ; ret . setResultSize ( paginatedSvcDefs . getResultSize ( ) ) ; ret . setStartIndex ( paginatedSvcDefs . getStartIndex ( ) ) ; ret . setTotalCount ( paginatedSvcDefs . getTotalCount ( ) ) ; ret . setSortBy ( paginatedSvcDefs . getSortBy ( ) ) ; ret . setSortType ( paginatedSvcDefs . getSortType ( ) ) ; } } catch ( javax . ws . rs . WebApplicationException excp ) { throw excp ; } catch ( java . lang . Throwable excp ) { org . apache . ranger . rest . ServiceREST . LOG . error ( "getServiceDefs()<sp>failed" , excp ) ; throw restErrorUtil . createRESTException ( excp . getMessage ( ) ) ; } finally { org . apache . ranger . plugin . util . RangerPerfTracer . log ( perf ) ; } if ( org . apache . ranger . rest . ServiceREST . LOG . isDebugEnabled ( ) ) { org . apache . ranger . rest . ServiceREST . LOG . debug ( ( "<==<sp>ServiceREST.getServiceDefs():<sp>count=" + ( ret == null ? 0 : ret . getListSize ( ) ) ) ) ; } return ret ; }
org . junit . Assert . assertNotNull ( dbRangerServiceDef )
reindexCase ( ) { rootBuilder . child ( "oak:index" ) . child ( "fooIndex" ) ; builder . setProperty ( IndexConstants . DISABLE_INDEXES_ON_NEXT_CYCLE , true ) ; builder . setProperty ( IndexConstants . SUPERSEDED_INDEX_PATHS , asList ( "/oak:index/fooIndex" , "/oak:index/barIndex" ) , Type . STRINGS ) ; java . util . List < java . lang . String > disabledIndexes = disabler . disableOldIndexes ( "/oak:index/foo" , builder ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ) == 0 ; }
org . junit . Assert . assertTrue ( disabledIndexes . isEmpty ( ) )
testDeleteChannelSuccessful ( ) { org . mockito . Mockito . when ( longPollingDelegateMock . deleteChannel ( "channel-123" ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; } deleteChannel ( java . lang . String ) { try { io . joynr . messaging . service . ChannelServiceRestAdapter . log . info ( "DELETE<sp>channel<sp>for<sp>cluster<sp>controller:<sp>{}" , ccid ) ; if ( channelService . deleteChannel ( ccid ) ) { return javax . ws . rs . core . Response . ok ( ) . build ( ) ; } return javax . ws . rs . core . Response . noContent ( ) . build ( ) ; } catch ( javax . ws . rs . WebApplicationException e ) { throw e ; } catch ( java . lang . Exception e ) { io . joynr . messaging . service . ChannelServiceRestAdapter . log . error ( "DELETE<sp>channel<sp>for<sp>cluster<sp>controller:<sp>error:<sp>{}" , e . getMessage ( ) , e ) ; throw new javax . ws . rs . WebApplicationException ( javax . ws . rs . core . Response . Status . INTERNAL_SERVER_ERROR ) ; } }
org . junit . Assert . assertTrue ( channelService . deleteChannel ( "channel-123" ) )
testLines ( ) { java . io . File f = new java . io . File ( "src/test/resources/test.txt" ) ; org . walkmod . javalang . ast . CompilationUnit cu = org . walkmod . javalang . ASTManager . parse ( f ) ; "<AssertPlaceHolder>" ; System . out . println ( cu . toString ( ) ) ; } parse ( java . io . File ) { return org . walkmod . javalang . ASTManager . parse ( file , "UTF-8" ) ; }
org . junit . Assert . assertNotNull ( cu )
deveObterItensComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfo notaInfo = new com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfo ( ) ; final java . util . List < com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoItem > itens = java . util . Collections . singletonList ( com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFNotaInfoItem ( ) ) ; notaInfo . setItens ( itens ) ; "<AssertPlaceHolder>" ; } getItens ( ) { return this . itens ; }
org . junit . Assert . assertEquals ( itens , notaInfo . getItens ( ) )
shouldThrowExceptionIfAddingNullValue ( ) { try { uk . gov . gchq . gaffer . cache . impl . JcsCacheTest . cache . put ( "test" , null ) ; org . junit . Assert . fail ( "Expected<sp>an<sp>exception" ) ; } catch ( final uk . gov . gchq . gaffer . cache . exception . CacheOperationException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return ( ( ( ( super . getMessage ( ) ) + "<sp>in<sp>string<sp>\'" ) + ( this . visibility ) ) + "\'<sp>at<sp>position<sp>" ) + ( super . getErrorOffset ( ) ) ; }
org . junit . Assert . assertNotNull ( e . getMessage ( ) )
testHeartbeat_nullClient ( ) { net . roboconf . agent . internal . Agent agent = new net . roboconf . agent . internal . Agent ( ) ; "<AssertPlaceHolder>" ; net . roboconf . agent . internal . misc . HeartbeatTask task = new net . roboconf . agent . internal . misc . HeartbeatTask ( agent ) ; task . run ( ) ; } getMessagingClient ( ) { return this . messagingClient ; }
org . junit . Assert . assertNull ( agent . getMessagingClient ( ) )
getProbeEmptyTest ( ) { probeConfig = null ; probe = probeHandler . getProbe ( probeConfig ) ; "<AssertPlaceHolder>" ; } getProbe ( io . fabric8 . maven . core . config . ProbeConfig ) { if ( probeConfig == null ) { return null ; } io . fabric8 . kubernetes . api . model . Probe probe = new io . fabric8 . kubernetes . api . model . Probe ( ) ; java . lang . Integer initialDelaySeconds = probeConfig . getInitialDelaySeconds ( ) ; if ( initialDelaySeconds != null ) { probe . setInitialDelaySeconds ( initialDelaySeconds ) ; } java . lang . Integer timeoutSeconds = probeConfig . getTimeoutSeconds ( ) ; if ( timeoutSeconds != null ) { probe . setTimeoutSeconds ( timeoutSeconds ) ; } java . lang . Integer failureThreshold = probeConfig . getFailureThreshold ( ) ; if ( failureThreshold != null ) { probe . setFailureThreshold ( failureThreshold ) ; } java . lang . Integer successThreshold = probeConfig . getSuccessThreshold ( ) ; if ( successThreshold != null ) { probe . setSuccessThreshold ( successThreshold ) ; } io . fabric8 . kubernetes . api . model . HTTPGetAction getAction = getHTTPGetAction ( probeConfig . getGetUrl ( ) ) ; if ( getAction != null ) { probe . setHttpGet ( getAction ) ; return probe ; } io . fabric8 . kubernetes . api . model . ExecAction execAction = getExecAction ( probeConfig . getExec ( ) ) ; if ( execAction != null ) { probe . setExec ( execAction ) ; return probe ; } io . fabric8 . kubernetes . api . model . TCPSocketAction tcpSocketAction = getTCPSocketAction ( probeConfig . getGetUrl ( ) , probeConfig . getTcpPort ( ) ) ; if ( tcpSocketAction != null ) { probe . setTcpSocket ( tcpSocketAction ) ; return probe ; } return null ; }
org . junit . Assert . assertNull ( probe )
givenMorningTime_ifMorningMessage_thenSuccess ( ) { java . lang . String expected = "Hello<sp>World,<sp>Good<sp>Morning" ; com . baeldung . greeter . library . Greeter greeter = new com . baeldung . greeter . library . Greeter ( com . baeldung . greeter . GreeterIntegrationTest . greetingConfig ) ; java . lang . String actual = greeter . greet ( java . time . LocalDateTime . of ( 2017 , 3 , 1 , 6 , 0 ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expected , actual )
testBadSimpleAppend ( ) { org . apache . flume . sink . hdfs . TestHDFSEventSink . LOG . debug ( "." 5 ) ; final java . lang . String fileName = "." 0 ; final long rollCount = 5 ; final long batchSize = 2 ; final int numBatches = 4 ; java . lang . String newPath = ( testPath ) + "/singleBucket" ; int totalEvents = 0 ; int i = 1 ; int j = 1 ; org . apache . flume . sink . hdfs . HDFSTestWriterFactory badWriterFactory = new org . apache . flume . sink . hdfs . HDFSTestWriterFactory ( ) ; sink = new org . apache . flume . sink . hdfs . HDFSEventSink ( badWriterFactory ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . fs . FileSystem . get ( conf ) ; org . apache . hadoop . fs . Path dirPath = new org . apache . hadoop . fs . Path ( newPath ) ; fs . delete ( dirPath , true ) ; fs . mkdirs ( dirPath ) ; org . apache . flume . Context context = new org . apache . flume . Context ( ) ; context . put ( "hdfs.path" , newPath ) ; context . put ( "." 8 , fileName ) ; context . put ( "." 6 , java . lang . String . valueOf ( rollCount ) ) ; context . put ( "." 1 , java . lang . String . valueOf ( batchSize ) ) ; context . put ( "hdfs.fileType" , HDFSTestWriterFactory . TestSequenceFileType ) ; org . apache . flume . conf . Configurables . configure ( sink , context ) ; org . apache . flume . Channel channel = new org . apache . flume . channel . MemoryChannel ( ) ; org . apache . flume . conf . Configurables . configure ( channel , context ) ; sink . setChannel ( channel ) ; sink . start ( ) ; java . util . Calendar eventDate = java . util . Calendar . getInstance ( ) ; java . util . List < java . lang . String > bodies = com . google . common . collect . Lists . newArrayList ( ) ; for ( i = 1 ; i < numBatches ; i ++ ) { org . apache . flume . Transaction txn = channel . getTransaction ( ) ; txn . begin ( ) ; for ( j = 1 ; j <= batchSize ; j ++ ) { org . apache . flume . Event event = new org . apache . flume . event . SimpleEvent ( ) ; eventDate . clear ( ) ; eventDate . set ( 2011 , i , i , i , 0 ) ; event . getHeaders ( ) . put ( "." 3 , java . lang . String . valueOf ( eventDate . getTimeInMillis ( ) ) ) ; event . getHeaders ( ) . put ( "." 2 , ( "." 9 + i ) ) ; java . lang . String body = ( ( "Test." + i ) + "." ) + j ; event . setBody ( body . getBytes ( ) ) ; bodies . add ( body ) ; if ( ( totalEvents % 30 ) == 1 ) { event . getHeaders ( ) . put ( "fault-once" , "" ) ; } channel . put ( event ) ; totalEvents ++ ; } txn . commit ( ) ; txn . close ( ) ; org . apache . flume . sink . hdfs . TestHDFSEventSink . LOG . info ( ( "." 4 + ( sink . process ( ) ) ) ) ; } org . apache . flume . sink . hdfs . TestHDFSEventSink . LOG . info ( ( "Process<sp>events<sp>to<sp>end<sp>of<sp>transaction<sp>max:<sp>" + ( sink . process ( ) ) ) ) ; org . apache . flume . sink . hdfs . TestHDFSEventSink . LOG . info ( ( "Process<sp>events<sp>to<sp>injected<sp>fault:<sp>" + ( sink . process ( ) ) ) ) ; org . apache . flume . sink . hdfs . TestHDFSEventSink . LOG . info ( ( "Process<sp>events<sp>remaining<sp>events:<sp>" + ( sink . process ( ) ) ) ) ; sink . stop ( ) ; verifyOutputSequenceFiles ( fs , conf , dirPath . toUri ( ) . getPath ( ) , fileName , bodies ) ; org . apache . flume . instrumentation . SinkCounter sc = ( ( org . apache . flume . instrumentation . SinkCounter ) ( org . mockito . internal . util . reflection . Whitebox . getInternalState ( sink , "." 7 ) ) ) ; "<AssertPlaceHolder>" ; } getEventWriteFail ( ) { return get ( org . apache . flume . instrumentation . SinkCounter . COUNTER_EVENT_WRITE_FAIL ) ; }
org . junit . Assert . assertEquals ( 1 , sc . getEventWriteFail ( ) )
detectResultType_for_multiple_selected_attributes_should_return_LIST_OF_LIST_OF_OBJECT ( ) { org . springframework . data . simpledb . query . SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest ( "selectFields" , org . springframework . data . simpledb . query . SampleEntity . class ) ; org . springframework . data . simpledb . query . executions . MultipleResultExecution multipleResultExecution = new org . springframework . data . simpledb . query . executions . MultipleResultExecution ( null ) ; "<AssertPlaceHolder>" ; } detectResultType ( org . springframework . data . simpledb . query . SimpleDbQueryMethod ) { java . lang . String query = method . getAnnotatedQuery ( ) ; if ( method . returnsCollectionOfDomainClass ( ) ) { return org . springframework . data . simpledb . query . executions . MultipleResultExecution . MultipleResultType . COLLECTION_OF_DOMAIN_ENTITIES ; } else if ( ( org . springframework . data . simpledb . query . QueryUtils . getQueryPartialFieldNames ( query ) . size ( ) ) > 1 ) { return org . springframework . data . simpledb . query . executions . MultipleResultExecution . MultipleResultType . LIST_OF_LIST_OF_OBJECT ; } else { if ( method . returnsListOfListOfObject ( ) ) { return org . springframework . data . simpledb . query . executions . MultipleResultExecution . MultipleResultType . LIST_OF_LIST_OF_OBJECT ; } else if ( method . returnsFieldOfTypeCollection ( ) ) { return org . springframework . data . simpledb . query . executions . MultipleResultExecution . MultipleResultType . FIELD_OF_TYPE_COLLECTION ; } else if ( java . util . List . class . isAssignableFrom ( method . getReturnType ( ) ) ) { return org . springframework . data . simpledb . query . executions . MultipleResultExecution . MultipleResultType . LIST_OF_FIELDS ; } else if ( java . util . Set . class . isAssignableFrom ( method . getReturnType ( ) ) ) { return org . springframework . data . simpledb . query . executions . MultipleResultExecution . MultipleResultType . SET_OF_FIELDS ; } else { throw new java . lang . IllegalArgumentException ( ( "Wrong<sp>return<sp>type<sp>for<sp>query:<sp>" + query ) ) ; } } }
org . junit . Assert . assertEquals ( MultipleResultExecution . MultipleResultType . LIST_OF_LIST_OF_OBJECT , multipleResultExecution . detectResultType ( repositoryMethod ) )
testNotMatchesEither ( ) { when ( left . matches ( typeDescription , classLoader , module , net . bytebuddy . agent . builder . AgentBuilderRawMatcherDisjunctionTest . Foo . class , protectionDomain ) ) . thenReturn ( false ) ; when ( right . matches ( typeDescription , classLoader , module , net . bytebuddy . agent . builder . AgentBuilderRawMatcherDisjunctionTest . Foo . class , protectionDomain ) ) . thenReturn ( false ) ; net . bytebuddy . agent . builder . AgentBuilder . RawMatcher rawMatcher = new net . bytebuddy . agent . builder . AgentBuilder . RawMatcher . Disjunction ( left , right ) ; "<AssertPlaceHolder>" ; verify ( left ) . matches ( typeDescription , classLoader , module , net . bytebuddy . agent . builder . AgentBuilderRawMatcherDisjunctionTest . Foo . class , protectionDomain ) ; verifyNoMoreInteractions ( left ) ; verify ( right ) . matches ( typeDescription , classLoader , module , net . bytebuddy . agent . builder . AgentBuilderRawMatcherDisjunctionTest . Foo . class , protectionDomain ) ; verifyNoMoreInteractions ( right ) ; } is ( java . lang . annotation . Annotation ) { return is ( AnnotationDescription . ForLoadedAnnotation . of ( annotation ) ) ; }
org . junit . Assert . assertThat ( rawMatcher . matches ( typeDescription , classLoader , module , net . bytebuddy . agent . builder . AgentBuilderRawMatcherDisjunctionTest . Foo . class , protectionDomain ) , org . hamcrest . CoreMatchers . is ( false ) )
Prioritynull3 ( ) { org . odata4j . core . OProperty < ? > expected = org . odata4j . core . OProperties . int32 ( SentMessage . P_PRIORITY . getName ( ) , 3 ) ; org . odata4j . core . OProperty < ? > result = this . setDefaultValue ( SentMessage . P_PRIORITY . build ( ) , SentMessage . P_PRIORITY . getName ( ) , org . odata4j . core . OProperties . string ( SentMessage . P_PRIORITY . getName ( ) , "" ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( expected . getValue ( ) , result . getValue ( ) )