input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testProcess6 ( ) { org . apache . uima . analysis_engine . AnalysisEngine seg = createEngine ( de . tudarmstadt . ukp . dkpro . core . tokit . PatternBasedTokenSegmenter . class , PatternBasedTokenSegmenter . PARAM_PATTERNS , de . tudarmstadt . ukp . dkpro . core . tokit . PatternBasedTokenSegmenterTest . PATTERNS ) ; java . lang . String content = "_This" ; org . apache . uima . jcas . JCas cas = seg . newJCas ( ) ; cas . setDocumentText ( content ) ; new de . tudarmstadt . ukp . dkpro . core . api . segmentation . type . Token ( cas , 0 , 1 ) . addToIndexes ( ) ; new de . tudarmstadt . ukp . dkpro . core . api . segmentation . type . Token ( cas , 1 , 5 ) . addToIndexes ( ) ; seg . process ( cas ) ; java . util . List < java . lang . String > ref = asList ( "This" ) ; java . util . List < java . lang . String > tokens = toText ( select ( cas , de . tudarmstadt . ukp . dkpro . core . api . segmentation . type . Token . class ) ) ; System . out . println ( tokens ) ; "<AssertPlaceHolder>" ; } select ( org . apache . uima . cas . CAS , java . lang . String ) { java . lang . String [ ] segments = aPath . split ( "/" , 2 ) ; java . lang . String typeName = segments [ 0 ] ; org . apache . uima . cas . Type t = aCas . getTypeSystem ( ) . getType ( typeName ) ; if ( t == null ) { throw new java . lang . IllegalStateException ( ( ( "Type<sp>[" + typeName ) + "]<sp>not<sp>found<sp>in<sp>type<sp>system" ) ) ; } java . lang . String path = ( ( segments . length ) > 1 ) ? segments [ 1 ] : "" ; return de . tudarmstadt . ukp . dkpro . core . api . featurepath . FeaturePathFactory . iterable ( de . tudarmstadt . ukp . dkpro . core . api . featurepath . FeaturePathFactory . FeaturePathIterator . create ( aCas , t , path ) ) ; }
|
org . junit . Assert . assertEquals ( ref , tokens )
|
testTranslate ( ) { io . motown . ocpp . v15 . soap . centralsystem . ValueFormatTranslator translator = new io . motown . ocpp . v15 . soap . centralsystem . ValueFormatTranslator ( input ) ; io . motown . domain . api . chargingstation . ValueFormat actual = translator . translate ( ) ; "<AssertPlaceHolder>" ; } translate ( ) { if ( ( this . readingContext ) == null ) { return io . motown . domain . api . chargingstation . ReadingContext . PERIODIC_SAMPLE ; } io . motown . domain . api . chargingstation . ReadingContext result ; switch ( this . readingContext ) { case INTERRUPTION_BEGIN : result = io . motown . domain . api . chargingstation . ReadingContext . BEGIN_INTERRUPTION ; break ; case INTERRUPTION_END : result = io . motown . domain . api . chargingstation . ReadingContext . END_INTERRUPTION ; break ; case SAMPLE_CLOCK : result = io . motown . domain . api . chargingstation . ReadingContext . CLOCK_SAMPLE ; break ; case SAMPLE_PERIODIC : result = io . motown . domain . api . chargingstation . ReadingContext . PERIODIC_SAMPLE ; break ; case TRANSACTION_BEGIN : result = io . motown . domain . api . chargingstation . ReadingContext . BEGIN_TRANSACTION ; break ; case TRANSACTION_END : result = io . motown . domain . api . chargingstation . ReadingContext . END_TRANSACTION ; break ; default : throw new java . lang . AssertionError ( java . lang . String . format ( "Unknown<sp>value<sp>for<sp>ReadingContext:<sp>'%s'" , readingContext ) ) ; } return result ; }
|
org . junit . Assert . assertEquals ( actual , expected )
|
testValidateTable_ok ( ) { final com . restlet . sqlimport . report . Report report = new com . restlet . sqlimport . report . Report ( ) ; final com . restlet . sqlimport . validation . DatabaseValidator databaseValidator = new com . restlet . sqlimport . validation . DatabaseValidator ( report ) ; final com . restlet . sqlimport . model . sql . Database database = new com . restlet . sqlimport . model . sql . Database ( ) ; final com . restlet . sqlimport . model . sql . Table table = new com . restlet . sqlimport . model . sql . Table ( ) ; database . getTables ( ) . add ( table ) ; databaseValidator . validateDatabase ( database ) ; "<AssertPlaceHolder>" ; } getReportLines ( ) { return reportLines ; }
|
org . junit . Assert . assertTrue ( report . getReportLines ( ) . isEmpty ( ) )
|
testNoEvidence ( ) { java . io . File file = new java . io . File ( "foo/bar.js" ) ; com . googlecode . jslint4java . Issue issue = new com . googlecode . jslint4java . Issue . IssueBuilder ( file . toString ( ) , 1 , 1 , "fatality" ) . build ( ) ; issues . add ( issue ) ; runFormatter ( file ) ; java . lang . String nl = java . lang . System . getProperty ( "line.separator" ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( file . toString ( ) ) ; sb . append ( ":1:1:<sp>fatality" ) ; sb . append ( nl ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( getSystemId ( ) ) + ":" ) + ( getLine ( ) ) ) + ":" ) + ( getCharacter ( ) ) ) + ":" ) + ( getReason ( ) ) ; }
|
org . junit . Assert . assertThat ( out . toString ( ) , org . hamcrest . CoreMatchers . is ( sb . toString ( ) ) )
|
testGetSigningTimeForDDOC ( ) { org . digidoc4j . Container container = org . digidoc4j . ContainerOpener . open ( "src/test/resources/testFiles/valid-containers/ddoc_for_testing.ddoc" ) ; org . digidoc4j . Signature signature = container . getSignatures ( ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } getClaimedSigningTime ( ) { return xadesSignature . getSigningTime ( ) ; }
|
org . junit . Assert . assertNotNull ( signature . getClaimedSigningTime ( ) )
|
testGetParametersWithDefaultEntityAndDisabledDefaults ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . mark . scale . value . MarkScaleValue entity = new org . lnu . is . domain . mark . scale . value . MarkScaleValue ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testCommentInfoRoundTrip ( ) { org . sagebionetworks . repo . model . message . Comment dto = new org . sagebionetworks . repo . model . message . Comment ( ) ; dto . setId ( "123" ) ; dto . setTargetId ( "456" ) ; dto . setTargetType ( ObjectType . ENTITY ) ; org . sagebionetworks . repo . model . dbo . persistence . DBOComment info = new org . sagebionetworks . repo . model . dbo . persistence . DBOComment ( ) ; org . sagebionetworks . repo . model . dbo . dao . MessageUtils . copyDTOToDBO ( dto , info ) ; org . sagebionetworks . repo . model . message . Comment dto2 = new org . sagebionetworks . repo . model . message . Comment ( ) ; org . sagebionetworks . repo . model . dbo . dao . MessageUtils . copyDBOToDTO ( info , dto2 ) ; "<AssertPlaceHolder>" ; } copyDBOToDTO ( org . sagebionetworks . repo . model . dbo . persistence . DBOMessageContent , org . sagebionetworks . repo . model . message . MessageContent ) { bundle . setId ( org . sagebionetworks . repo . model . dbo . dao . MessageUtils . toString ( content . getMessageId ( ) ) ) ; bundle . setCreatedBy ( org . sagebionetworks . repo . model . dbo . dao . MessageUtils . toString ( content . getCreatedBy ( ) ) ) ; bundle . setFileHandleId ( org . sagebionetworks . repo . model . dbo . dao . MessageUtils . toString ( content . getFileHandleId ( ) ) ) ; if ( ( content . getCreatedOn ( ) ) != null ) { bundle . setCreatedOn ( new java . util . Date ( content . getCreatedOn ( ) ) ) ; } }
|
org . junit . Assert . assertEquals ( dto , dto2 )
|
notifyPrivateMessageArrivedShouldNotAddNotificationIfMainChatIsVisible ( ) { final net . usikkert . kouchat . android . chatwindow . AndroidPrivateChatWindow privchat = mock ( net . usikkert . kouchat . android . chatwindow . AndroidPrivateChatWindow . class ) ; "<AssertPlaceHolder>" ; testUser . setPrivchat ( privchat ) ; when ( mainChatController . isVisible ( ) ) . thenReturn ( true ) ; androidUserInterface . notifyPrivateMessageArrived ( testUser ) ; verifyZeroInteractions ( notificationService ) ; } isVisible ( ) { return ( ( privateChatController ) != null ) && ( privateChatController . isVisible ( ) ) ; }
|
org . junit . Assert . assertFalse ( privchat . isVisible ( ) )
|
getSearchConfig_shouldReturnPatientByIdentifier_matchStart ( ) { org . springframework . mock . web . MockHttpServletRequest req = request ( RequestMethod . GET , getURI ( ) ) ; req . addParameter ( "identifier" , "7T" ) ; req . addParameter ( "searchType" , "start" ) ; org . openmrs . module . webservices . rest . SimpleObject result = deserialize ( handle ( req ) ) ; java . util . List < java . lang . Object > hits = ( ( java . util . List < java . lang . Object > ) ( result . get ( "results" ) ) ) ; "<AssertPlaceHolder>" ; } get ( org . springframework . web . context . request . WebRequest ) { boolean authenticated = org . openmrs . api . context . Context . isAuthenticated ( ) ; org . openmrs . module . webservices . rest . SimpleObject session = new org . openmrs . module . webservices . rest . SimpleObject ( ) ; session . add ( "sessionId" , request . getSessionId ( ) ) . add ( "authenticated" , authenticated ) ; if ( authenticated ) { java . lang . String repParam = request . getParameter ( RestConstants . REQUEST_PROPERTY_FOR_REPRESENTATION ) ; org . openmrs . module . webservices . rest . web . representation . Representation rep = ( repParam != null ) ? restService . getRepresentation ( repParam ) : org . openmrs . module . webservices . rest . web . representation . Representation . DEFAULT ; session . add ( "user" , org . openmrs . module . webservices . rest . web . ConversionUtil . convertToRepresentation ( org . openmrs . api . context . Context . getAuthenticatedUser ( ) , rep ) ) ; session . add ( "locale" , org . openmrs . api . context . Context . getLocale ( ) ) ; session . add ( "allowedLocales" , org . openmrs . api . context . Context . getAdministrationService ( ) . getAllowedLocales ( ) ) ; } return session ; }
|
org . junit . Assert . assertEquals ( 1 , hits . size ( ) )
|
testSync ( ) { java . lang . String grammar = "grammar<sp>T;\n" + ( ( ( ( ( ( "s\n" + "@init<sp>{setBuildParseTree(true);}\n" ) + "@after<sp>{System.out.println($r.ctx.toStringTree(this));}\n" ) + "s\n" 2 ) + "a<sp>:<sp>\'x\'<sp>\'y\'*<sp>\'!\'\n" ) + "<sp>;\n" ) + "Z<sp>:<sp>\'z\';<sp>\n" ) ; java . lang . String result = execParser ( "T.g4" , grammar , "TParser" , "s\n" 1 , "s\n" 3 , "s\n" 0 , false ) ; java . lang . String expecting = "(a<sp>x<sp>z<sp>y<sp>y<sp>!)\n" ; "<AssertPlaceHolder>" ; } execParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean ) { return execParser ( grammarFileName , grammarStr , parserName , lexerName , startRuleName , input , debug , false ) ; }
|
org . junit . Assert . assertEquals ( expecting , result )
|
checkCreation ( ) { info . smart_tools . smartactors . testing . interfaces . itest_runner . ITestRunner runner = new info . smart_tools . smartactors . testing . test_runner . HttpEndpointTestRunner ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( runner )
|
testGetInstance ( ) { java . lang . System . setProperty ( BusFactory . BUS_FACTORY_PROPERTY_NAME , org . apache . cxf . BusFactoryTest . TestBusFactory . class . getName ( ) ) ; org . apache . cxf . BusFactory factory = org . apache . cxf . BusFactory . newInstance ( ) ; "<AssertPlaceHolder>" ; } newInstance ( ) { if ( org . apache . cxf . ws . security . tokenstore . TokenStoreFactory . isEhCacheInstalled ( ) ) { return new org . apache . cxf . ws . security . tokenstore . EHCacheTokenStoreFactory ( ) ; } return new org . apache . cxf . ws . security . tokenstore . MemoryTokenStoreFactory ( ) ; }
|
org . junit . Assert . assertTrue ( ( factory instanceof org . apache . cxf . BusFactoryTest . TestBusFactory ) )
|
ifHasValleyItFillsIt ( ) { int [ ] result = org . libreplan . business . planner . entities . ValleyFiller . fillValley ( 2 , 4 , 8 , 5 , 6 , 10 ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . equalTo ( new int [ ] { 2 , 4 , 8 , 8 , 8 , 10 } ) )
|
testConvertAll ( ) { java . lang . Long id = 1L ; java . lang . String abbrName = "abbr<sp>Name" ; java . lang . String name = "n<sp>a<sp>m<sp>e" ; org . lnu . is . resource . enrolment . foreign . type . EnrolmentForeignTypeResource source = new org . lnu . is . resource . enrolment . foreign . type . EnrolmentForeignTypeResource ( ) ; source . setId ( id ) ; source . setAbbrName ( abbrName ) ; source . setName ( name ) ; java . util . List < org . lnu . is . resource . enrolment . foreign . type . EnrolmentForeignTypeResource > sources = java . util . Arrays . asList ( source ) ; org . lnu . is . domain . enrolment . foreign . type . EnrolmentForeignType expected = new org . lnu . is . domain . enrolment . foreign . type . EnrolmentForeignType ( ) ; expected . setId ( id ) ; expected . setAbbrName ( abbrName ) ; expected . setName ( name ) ; java . util . List < org . lnu . is . domain . enrolment . foreign . type . EnrolmentForeignType > expecteds = java . util . Arrays . asList ( expected ) ; java . util . List < org . lnu . is . domain . enrolment . foreign . type . EnrolmentForeignType > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; }
|
org . junit . Assert . assertEquals ( expecteds , actuals )
|
clearCache ( ) { for ( int i = 1 ; i < 3 ; i ++ ) { java . nio . file . Path p = com . sothawo . mapjfx . offline . OfflineCacheTest . cacheDirectory . resolve ( ( "file_" + i ) ) ; try ( java . io . PrintWriter w = new java . io . PrintWriter ( p . toFile ( ) ) ) { w . println ( "42" ) ; w . flush ( ) ; } } cache . clear ( ) ; boolean directoryIsEmpty = false ; try ( java . nio . file . DirectoryStream < java . nio . file . Path > s = java . nio . file . Files . newDirectoryStream ( com . sothawo . mapjfx . offline . OfflineCacheTest . cacheDirectory ) ) { directoryIsEmpty = ! ( s . iterator ( ) . hasNext ( ) ) ; } "<AssertPlaceHolder>" ; } clear ( ) { if ( null != ( cacheDirectory ) ) { com . sothawo . mapjfx . offline . OfflineCache . clearDirectory ( cacheDirectory ) ; } }
|
org . junit . Assert . assertThat ( directoryIsEmpty , org . hamcrest . CoreMatchers . is ( true ) )
|
string_set ( ) { final org . erlide . engine . util . PreferencesHelper helper = org . erlide . engine . util . PreferencesHelper . getHelper ( org . erlide . core . preferences . PreferencesHelperTest . QUALIFIER ) ; helper . putString ( org . erlide . core . preferences . PreferencesHelperTest . KEY , "smurf" ) ; final java . lang . String res = helper . getString ( org . erlide . core . preferences . PreferencesHelperTest . KEY , "default" ) ; "<AssertPlaceHolder>" ; } getString ( int , int ) { java . lang . String s = "" ; for ( final char c : org . erlide . wrangler . refactoring . util . ChangesetMaker . outFileCharArray ) { s += c ; } return s . substring ( from , ( to + 1 ) ) ; }
|
org . junit . Assert . assertEquals ( "smurf" , res )
|
testBean ( ) { org . jboss . metadata . ejb . spec . EjbJarMetaData metaData = unmarshalJboss ( org . jboss . metadata . ejb . spec . EjbJarMetaData . class , "/org/jboss/metadata/ejb/test/extension/jboss-ejb3-with-bean.xml" ) ; org . jboss . metadata . ejb . spec . SessionBean31MetaData bean = ( ( org . jboss . metadata . ejb . spec . SessionBean31MetaData ) ( metaData . getEnterpriseBean ( "Test" ) ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( bean )
|
test_incrementAndGetSchrijfKlaarTaken ( ) { final nl . bzk . brp . service . selectie . lezer . status . SelectieJobRunStatus selectieJobRunStatus = new nl . bzk . brp . service . selectie . lezer . status . SelectieJobRunStatus ( ) ; "<AssertPlaceHolder>" ; } incrementEnGetSchrijfKlaarTaken ( ) { return schrijfKlaarTaken . incrementAndGet ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , selectieJobRunStatus . incrementEnGetSchrijfKlaarTaken ( ) )
|
testConditionalCreate ( ) { ca . uhn . fhir . jaxrs . server . Patient toCreate = createPatient ( 1 ) ; ca . uhn . fhir . rest . api . MethodOutcome outcome = new ca . uhn . fhir . rest . api . MethodOutcome ( ) ; toCreate . getIdentifierFirstRep ( ) . setValue ( "myIdentifier" ) ; outcome . setResource ( toCreate ) ; when ( mock . create ( patientCaptor . capture ( ) , eq ( "/Patient?_format=json&identifier=2" ) ) ) . thenReturn ( outcome ) ; ca . uhn . fhir . jaxrs . server . AbstractJaxRsResourceProviderTest . client . setEncoding ( EncodingEnum . JSON ) ; ca . uhn . fhir . rest . api . MethodOutcome response = ca . uhn . fhir . jaxrs . server . AbstractJaxRsResourceProviderTest . client . create ( ) . resource ( toCreate ) . conditional ( ) . where ( Patient . IDENTIFIER . exactly ( ) . identifier ( "2" ) ) . prefer ( PreferReturnEnum . REPRESENTATION ) . execute ( ) ; "<AssertPlaceHolder>" ; ca . uhn . fhir . model . api . IResource resource = ( ( ca . uhn . fhir . model . api . IResource ) ( response . getResource ( ) ) ) ; compareResultId ( 1 , resource ) ; } getValue ( ) { return myValue ; }
|
org . junit . Assert . assertEquals ( "myIdentifier" , patientCaptor . getValue ( ) . getIdentifierFirstRep ( ) . getValue ( ) )
|
testClone ( ) { final org . esa . beam . visat . actions . masktools . MagicWandModel model = new org . esa . beam . visat . actions . masktools . MagicWandModel ( ) ; model . setBandNames ( "b1" , "b2" , "b3" , "a1" , "a2" , "a3" ) ; model . setTolerance ( 0.005 ) ; model . setMinTolerance ( 0.0 ) ; model . setMaxTolerance ( 0.01 ) ; model . setNormalize ( true ) ; model . setPickMode ( MagicWandModel . PickMode . PLUS ) ; model . addSpectrum ( 1 , 2 , 3 , 4 , 5 , 6 ) ; model . addSpectrum ( 2 , 3 , 4 , 5 , 6 , 7 ) ; model . setPickMode ( MagicWandModel . PickMode . MINUS ) ; model . addSpectrum ( 3 , 4 , 5 , 6 , 7 , 8 ) ; model . addSpectrum ( 4 , 5 , 6 , 7 , 8 , 9 ) ; final org . esa . beam . visat . actions . masktools . MagicWandModel modelCopy = model . clone ( ) ; "<AssertPlaceHolder>" ; } clone ( ) { try { org . esa . beam . framework . datamodel . ImageInfo imageInfo = ( ( org . esa . beam . framework . datamodel . ImageInfo ) ( super . clone ( ) ) ) ; if ( ( colorPaletteDef ) != null ) { imageInfo . colorPaletteDef = ( ( org . esa . beam . framework . datamodel . ColorPaletteDef ) ( colorPaletteDef . clone ( ) ) ) ; } if ( ( rgbChannelDef ) != null ) { imageInfo . rgbChannelDef = ( ( org . esa . beam . framework . datamodel . RGBChannelDef ) ( rgbChannelDef . clone ( ) ) ) ; } return imageInfo ; } catch ( java . lang . CloneNotSupportedException e ) { throw new java . lang . RuntimeException ( e ) ; } }
|
org . junit . Assert . assertEquals ( model , modelCopy )
|
testListDockerCommitsLimitOffset ( ) { long now = java . lang . System . currentTimeMillis ( ) ; org . sagebionetworks . repo . model . docker . DockerCommit commitA = org . sagebionetworks . repo . model . dbo . dao . DockerCommitDaoImplTest . createCommit ( new java . util . Date ( now ) , "A" , java . util . UUID . randomUUID ( ) . toString ( ) ) ; dockerCommitDao . createDockerCommit ( dockerRepository1 . getId ( ) , creatorUserGroupId , commitA ) ; org . sagebionetworks . repo . model . docker . DockerCommit commitB = org . sagebionetworks . repo . model . dbo . dao . DockerCommitDaoImplTest . createCommit ( new java . util . Date ( ( now + 1000L ) ) , "B" , java . util . UUID . randomUUID ( ) . toString ( ) ) ; dockerCommitDao . createDockerCommit ( dockerRepository1 . getId ( ) , creatorUserGroupId , commitB ) ; java . util . List < org . sagebionetworks . repo . model . docker . DockerCommit > commits = dockerCommitDao . listDockerTags ( dockerRepository1 . getId ( ) , DockerCommitSortBy . TAG , true , 10 , 3 ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( ( ( ( ( stringAnnotations ) == null ) || ( stringAnnotations . isEmpty ( ) ) ) && ( ( ( doubleAnnotations ) == null ) || ( doubleAnnotations . isEmpty ( ) ) ) ) && ( ( ( longAnnotations ) == null ) || ( longAnnotations . isEmpty ( ) ) ) ) && ( ( ( dateAnnotations ) == null ) || ( dateAnnotations . isEmpty ( ) ) ) ) && ( ( ( blobAnnotations ) == null ) || ( blobAnnotations . isEmpty ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( commits . isEmpty ( ) )
|
shouldCallIsReadOnly ( ) { "<AssertPlaceHolder>" ; } isReadOnly ( ) { return cache ( ) . isReadOnly ( ) ; }
|
org . junit . Assert . assertThat ( conn . isReadOnly ( ) , org . hamcrest . core . Is . is ( true ) )
|
testComputeEnhancements ( ) { org . apache . stanbol . enhancer . servicesapi . ContentItem ci = org . apache . stanbol . enhancer . engines . opennlp . impl . TestNamedEntityExtractionEnhancementEngine . wrapAsContentItem ( "urn:test:content-item:single:sentence" , org . apache . stanbol . enhancer . engines . opennlp . impl . TestNamedEntityExtractionEnhancementEngine . SINGLE_SENTENCE , "en" ) ; nerEngine . computeEnhancements ( ci ) ; java . util . Map < org . apache . clerezza . commons . rdf . IRI , org . apache . clerezza . commons . rdf . RDFTerm > expectedValues = new java . util . HashMap < org . apache . clerezza . commons . rdf . IRI , org . apache . clerezza . commons . rdf . RDFTerm > ( ) ; expectedValues . put ( Properties . ENHANCER_EXTRACTED_FROM , ci . getUri ( ) ) ; expectedValues . put ( Properties . DC_CREATOR , org . apache . clerezza . rdf . core . LiteralFactory . getInstance ( ) . createTypedLiteral ( nerEngine . getClass ( ) . getName ( ) ) ) ; expectedValues . put ( Properties . ENHANCER_CONFIDENCE , null ) ; org . apache . clerezza . commons . rdf . Graph g = ci . getMetadata ( ) ; int textAnnotationCount = validateAllTextAnnotations ( g , org . apache . stanbol . enhancer . engines . opennlp . impl . TestNamedEntityExtractionEnhancementEngine . SINGLE_SENTENCE , expectedValues ) ; "<AssertPlaceHolder>" ; } validateAllTextAnnotations ( org . apache . clerezza . commons . rdf . Graph , java . lang . String , java . util . Map ) { return org . apache . stanbol . enhancer . test . helper . EnhancementStructureHelper . validateAllTextAnnotations ( enhancements , content , expectedValues , false ) ; }
|
org . junit . Assert . assertEquals ( 3 , textAnnotationCount )
|
testCas_2 ( ) { lombok . val v0 = new org . nd4j . linalg . primitives . Atomic < java . lang . String > ( "beta" ) ; v0 . cas ( null , "alpha" ) ; "<AssertPlaceHolder>" ; } get ( ) { try { lock . readLock ( ) . lock ( ) ; return value ; } finally { lock . readLock ( ) . unlock ( ) ; } }
|
org . junit . Assert . assertEquals ( "beta" , v0 . get ( ) )
|
test ( ) { org . tests . model . basic . TSMaster master0 = new org . tests . model . basic . TSMaster ( ) ; io . ebean . Ebean . save ( master0 ) ; org . tests . model . basic . TSMaster master1 = io . ebean . Ebean . find ( master0 . getClass ( ) , master0 . getId ( ) ) ; org . tests . model . basic . TSDetail tsDetail = new org . tests . model . basic . TSDetail ( ) ; master1 . getDetails ( ) . add ( tsDetail ) ; master1 . getDetails ( ) . remove ( tsDetail ) ; io . ebean . Ebean . save ( master1 ) ; org . tests . model . basic . TSMaster master2 = io . ebean . Ebean . find ( master1 . getClass ( ) , master1 . getId ( ) ) ; "<AssertPlaceHolder>" ; } getDetails ( ) { return details ; }
|
org . junit . Assert . assertTrue ( master2 . getDetails ( ) . isEmpty ( ) )
|
testIsConfigChangedOneNull ( ) { org . eclipse . kura . net . admin . monitor . EthernetMonitorServiceImpl svc = new org . eclipse . kura . net . admin . monitor . EthernetMonitorServiceImpl ( ) ; java . util . List < org . eclipse . kura . net . NetInterfaceAddressConfig > newConfig = null ; java . util . List < org . eclipse . kura . net . NetInterfaceAddressConfig > currentConfig = new java . util . ArrayList ( ) ; boolean result = ( ( boolean ) ( org . eclipse . kura . core . testutil . TestUtil . invokePrivate ( svc , "isConfigChanged" , newConfig , currentConfig ) ) ) ; "<AssertPlaceHolder>" ; } invokePrivate ( java . lang . Object , java . lang . String , org . eclipse . kura . core . testutil . Class [ ] , java . lang . Object [ ] ) { java . lang . reflect . Method method = org . eclipse . kura . core . testutil . TestUtil . getMethod ( svc , methodName , paramTypes ) ; method . setAccessible ( true ) ; try { java . lang . Object result = method . invoke ( svc , params ) ; return result ; } catch ( java . lang . IllegalAccessException e ) { org . eclipse . kura . core . testutil . TestUtil . logger . warn ( e . getMessage ( ) , e ) ; } catch ( java . lang . IllegalArgumentException e ) { org . eclipse . kura . core . testutil . TestUtil . logger . warn ( e . getMessage ( ) , e ) ; } catch ( java . lang . reflect . InvocationTargetException e ) { throw e . getCause ( ) ; } return null ; }
|
org . junit . Assert . assertTrue ( result )
|
handleMessageValidToken ( ) { when ( wsTrustClient . validateToken ( any ( org . w3c . dom . Element . class ) ) ) . thenReturn ( true ) ; final javax . xml . soap . SOAPHeaderElement securityHeader = addSecurityHeader ( soapMessage . getSOAPHeader ( ) ) ; addSecurityAssertionElement ( securityHeader ) ; when ( soapMessageContext . get ( javax . xml . ws . handler . MessageContext . MESSAGE_OUTBOUND_PROPERTY ) ) . thenReturn ( false ) ; when ( soapMessageContext . getMessage ( ) ) . thenReturn ( soapMessage ) ; boolean result = samlHandler . handleMessage ( soapMessageContext ) ; "<AssertPlaceHolder>" ; } handleMessage ( javax . xml . ws . handler . MessageContext ) { java . lang . Boolean outbound = ( ( java . lang . Boolean ) ( msgContext . get ( MessageContext . MESSAGE_OUTBOUND_PROPERTY ) ) ) ; if ( outbound == null ) throw new java . lang . IllegalStateException ( ( "Cannot<sp>obtain<sp>required<sp>property:<sp>" + ( javax . xml . ws . handler . MessageContext . MESSAGE_OUTBOUND_PROPERTY ) ) ) ; return outbound ? handleOutbound ( msgContext ) : handleInbound ( msgContext ) ; }
|
org . junit . Assert . assertTrue ( result )
|
testTextOnlyGetEditorJSON ( ) { com . adobe . cq . wcm . core . components . extension . contentfragment . models . ContentFragment fragment = getTestContentFragment ( com . adobe . cq . wcm . core . components . extension . contentfragment . internal . models . v1 . ContentFragmentImplTest . CF_TEXT_ONLY_MULTIPLE_ELEMENTS ) ; java . lang . String expectedJSON = "{\"title\":\"Test<sp>Content<sp>Fragment\",\"path\":\"/content/dam/contentfragments/text-only\"" + ( ",\"elements\":[\"second\",\"non-existing\",\"main\"],\"associatedContent\":[{\"title\":\"Test<sp>Collection\"" + ",\"path\":\"/content/dam/collections/X/X7v6pJAcy5qtkUdXdIxR/test\"}]}" ) ; "<AssertPlaceHolder>" ; } getEditorJSON ( ) { javax . json . JsonObjectBuilder jsonObjectBuilder = javax . json . Json . createObjectBuilder ( ) ; jsonObjectBuilder . add ( "title" , fragment . getTitle ( ) ) ; jsonObjectBuilder . add ( "path" , path ) ; if ( ( variationName ) != null ) { jsonObjectBuilder . add ( "variation" , variationName ) ; } if ( ( elementNames ) != null ) { javax . json . JsonArrayBuilder arrayBuilder = javax . json . Json . createArrayBuilder ( ) ; for ( java . lang . String ele : elementNames ) { arrayBuilder . add ( ele ) ; } jsonObjectBuilder . add ( "elements" , arrayBuilder ) ; } java . util . Iterator < org . apache . sling . api . resource . Resource > associatedContentIter = fragment . getAssociatedContent ( ) ; if ( associatedContentIter . hasNext ( ) ) { javax . json . JsonArrayBuilder associatedContentArray = javax . json . Json . createArrayBuilder ( ) ; while ( associatedContentIter . hasNext ( ) ) { org . apache . sling . api . resource . Resource resource = associatedContentIter . next ( ) ; org . apache . sling . api . resource . ValueMap vm = resource . adaptTo ( org . apache . sling . api . resource . ValueMap . class ) ; javax . json . JsonObjectBuilder contentObject = javax . json . Json . createObjectBuilder ( ) ; if ( ( vm != null ) && ( vm . containsKey ( com . adobe . cq . wcm . core . components . extension . contentfragment . internal . models . v1 . JCR_TITLE ) ) ) { contentObject . add ( "title" , vm . get ( com . adobe . cq . wcm . core . components . extension . contentfragment . internal . models . v1 . JCR_TITLE , java . lang . String . class ) ) ; } contentObject . add ( "path" , resource . getPath ( ) ) ; associatedContentArray . add ( contentObject ) ; } jsonObjectBuilder . add ( "associatedContent" , associatedContentArray ) ; } return jsonObjectBuilder . build ( ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( fragment . getEditorJSON ( ) , expectedJSON )
|
test ( ) { name . dlazerka . gm . util . LinkedSet < java . lang . String > set = new name . dlazerka . gm . util . LinkedSet < java . lang . String > ( ) ; set . add ( "asdfsdf234" ) ; set . add ( "asdfsdf" ) ; set . add ( "asdfsd3646f" ) ; "<AssertPlaceHolder>" ; } add ( name . dlazerka . gm . ui . VertexMarkPanel ) { return name . dlazerka . gm . ui . GraphPanel . super . add ( panel ) ; }
|
org . junit . Assert . assertFalse ( set . add ( "asdfsdf" ) )
|
testGetTimePrecisionMillis ( ) { record . set ( "/time" , com . streamsets . pipeline . api . Field . create ( 0L ) ) ; "<AssertPlaceHolder>" ; } getTimePrecision ( com . streamsets . pipeline . api . Record ) { if ( record . has ( ( ( com . streamsets . pipeline . stage . destination . influxdb . CollectdRecordConverter . FIELD_PATH_PREFIX ) + ( com . streamsets . pipeline . stage . destination . influxdb . CollectdRecordConverter . TIME_HIRES ) ) ) ) { return java . util . concurrent . TimeUnit . NANOSECONDS ; } else if ( record . has ( ( ( com . streamsets . pipeline . stage . destination . influxdb . CollectdRecordConverter . FIELD_PATH_PREFIX ) + ( com . streamsets . pipeline . stage . destination . influxdb . CollectdRecordConverter . TIME ) ) ) ) { return java . util . concurrent . TimeUnit . MILLISECONDS ; } throw new com . streamsets . pipeline . api . base . OnRecordErrorException ( Errors . INFLUX_04 ) ; }
|
org . junit . Assert . assertEquals ( TimeUnit . MILLISECONDS , com . streamsets . pipeline . stage . destination . influxdb . CollectdRecordConverter . getTimePrecision ( record ) )
|
testEncodeWFS1_0FeatureCollection ( ) { org . geotools . feature . simple . SimpleFeatureTypeBuilder tb = new org . geotools . feature . simple . SimpleFeatureTypeBuilder ( ) ; tb . setName ( "feature" ) ; tb . setNamespaceURI ( "http://geotools.org" ) ; tb . add ( "geometry" , com . vividsolutions . jts . geom . Point . class ) ; tb . add ( "name" , java . lang . String . class ) ; org . opengis . feature . simple . SimpleFeatureType TYPE = tb . buildFeatureType ( ) ; org . geotools . data . simple . SimpleFeatureCollection collection = org . geotools . feature . FeatureCollections . newCollection ( "internal" ) ; org . geotools . geometry . jts . WKTReader2 wkt = new org . geotools . geometry . jts . WKTReader2 ( ) ; collection . add ( org . geotools . feature . simple . SimpleFeatureBuilder . build ( TYPE , new java . lang . Object [ ] { wkt . read ( "POINT<sp>(1<sp>2)" ) , "<gml:Point>" 0 } , null ) ) ; collection . add ( org . geotools . feature . simple . SimpleFeatureBuilder . build ( TYPE , new java . lang . Object [ ] { wkt . read ( "POINT<sp>(4<sp>4)" ) , "name2" } , null ) ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; org . geotools . GML encode = new org . geotools . GML ( org . geotools . GML . Version . WFS1_0 ) ; encode . setNamespace ( "geotools" , "http://geotools.org" ) ; encode . encode ( out , collection ) ; out . close ( ) ; java . lang . String gml = out . toString ( ) ; "<AssertPlaceHolder>" ; } indexOf ( java . lang . String ) { return indexOf ( new javax . media . jai . util . CaselessStringKey ( key ) ) ; }
|
org . junit . Assert . assertTrue ( ( ( gml . indexOf ( "<gml:Point>" ) ) != ( - 1 ) ) )
|
toAvroParquetFileTarget ( ) { org . apache . avro . generic . GenericRecord savedRecord = new org . apache . avro . generic . GenericData . Record ( org . apache . crunch . test . Person . SCHEMA$ ) ; savedRecord . put ( "name" , "John<sp>Doe" ) ; savedRecord . put ( "age" , 42 ) ; savedRecord . put ( "siblingnames" , com . google . common . collect . Lists . newArrayList ( "Jimmy" , "Jane" ) ) ; populateGenericFile ( com . google . common . collect . Lists . newArrayList ( savedRecord ) , Person . SCHEMA . ) ; org . apache . crunch . Pipeline pipeline = new org . apache . crunch . impl . mr . MRPipeline ( org . apache . crunch . io . parquet . AvroParquetPipelineIT . class , tmpDir . getDefaultConfiguration ( ) ) ; org . apache . crunch . PCollection < org . apache . crunch . test . Person > genericCollection = pipeline . read ( org . apache . crunch . io . At . avroFile ( avroFile . getAbsolutePath ( ) , org . apache . crunch . types . avro . Avros . records ( org . apache . crunch . test . Person . class ) ) ) ; java . io . File outputFile = tmpDir . getFile ( "output" ) ; org . apache . crunch . Target parquetFileTarget = new org . apache . crunch . io . parquet . AvroParquetFileTarget ( outputFile . getAbsolutePath ( ) ) ; pipeline . write ( genericCollection , parquetFileTarget ) ; pipeline . run ( ) ; org . apache . crunch . test . Person person = genericCollection . materialize ( ) . iterator ( ) . next ( ) ; org . apache . hadoop . fs . Path parquetFile = new org . apache . hadoop . fs . Path ( new java . io . File ( outputFile , "part-m-00000.parquet" ) . getPath ( ) ) ; org . apache . parquet . avro . AvroParquetReader < org . apache . crunch . test . Person > reader = new org . apache . parquet . avro . AvroParquetReader < org . apache . crunch . test . Person > ( parquetFile ) ; try { org . apache . crunch . test . Person readPerson = reader . read ( ) ; "<AssertPlaceHolder>" ; } finally { reader . close ( ) ; } } getPath ( ) { return path ; }
|
org . junit . Assert . assertThat ( readPerson , org . hamcrest . core . Is . is ( person ) )
|
testGetStartAndEndDatesWithRubbish ( ) { org . alfresco . util . Pair < org . joda . time . LocalDate , org . joda . time . LocalDate > dates = org . alfresco . repo . web . scripts . solr . StatsGet . getStartAndEndDates ( "rubbish" , "more" ) ; "<AssertPlaceHolder>" ; } getStartAndEndDates ( java . lang . String , java . lang . String ) { if ( start == null ) return null ; org . joda . time . LocalDate startDate = org . joda . time . LocalDate . parse ( start ) ; org . joda . time . LocalDate endDate = ( end != null ) ? org . joda . time . LocalDate . parse ( end ) : org . joda . time . LocalDate . now ( ) ; return new org . alfresco . util . Pair < org . joda . time . LocalDate , org . joda . time . LocalDate > ( startDate , endDate ) ; }
|
org . junit . Assert . assertNotNull ( dates )
|
shouldNotAllowObjectWithoutDataSet ( ) { try { this . factoryBean . getObject ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . IllegalArgumentException ex ) { "<AssertPlaceHolder>" ; } } getObject ( ) { org . springframework . util . Assert . notNull ( this . dataSource , "The<sp>dataSource<sp>is<sp>required" ) ; org . dbunit . database . DatabaseDataSourceConnection dataSourceConnection = new org . dbunit . database . DatabaseDataSourceConnection ( makeTransactionAware ( this . dataSource ) , this . schema , this . username , this . password ) ; if ( ( this . databaseConfig ) != null ) { this . databaseConfig . apply ( dataSourceConnection . getConfig ( ) ) ; } return dataSourceConnection ; }
|
org . junit . Assert . assertEquals ( "The<sp>dataSource<sp>is<sp>required" , ex . getMessage ( ) )
|
testWriteKeyStoreSuccess ( ) { org . apache . nifi . toolkit . tls . util . TlsHelperTest . setUnlimitedCrypto ( false ) ; java . lang . String testPassword = "testPassword" ; "<AssertPlaceHolder>" ; verify ( keyStoreSpi , times ( 1 ) ) . engineStore ( eq ( tmpFileOutputStream ) , org . mockito . AdditionalMatchers . aryEq ( testPassword . toCharArray ( ) ) ) ; } writeKeyStore ( java . security . KeyStore , org . apache . nifi . toolkit . tls . util . OutputStreamFactory , java . io . File , java . lang . String , boolean ) { try ( java . io . OutputStream fileOutputStream = outputStreamFactory . create ( file ) ) { keyStore . store ( fileOutputStream , password . toCharArray ( ) ) ; } catch ( java . io . IOException e ) { if ( ( e . getMessage ( ) . toLowerCase ( ) . contains ( org . apache . nifi . toolkit . tls . util . TlsHelper . ILLEGAL_KEY_SIZE ) ) && ( ! ( org . apache . nifi . toolkit . tls . util . TlsHelper . isUnlimitedStrengthCryptographyEnabled ( ) ) ) ) { if ( generatedPassword ) { file . delete ( ) ; java . lang . String truncatedPassword = password . substring ( 0 , 7 ) ; try ( java . io . OutputStream fileOutputStream = outputStreamFactory . create ( file ) ) { keyStore . store ( fileOutputStream , truncatedPassword . toCharArray ( ) ) ; } org . apache . nifi . toolkit . tls . util . TlsHelper . logTruncationWarning ( file ) ; return truncatedPassword ; } else { throw new java . security . GeneralSecurityException ( ( ( ( ( ( "Specified<sp>password<sp>for<sp>" + file ) + "<sp>too<sp>long<sp>to<sp>work<sp>without<sp>unlimited<sp>JCE<sp>policy<sp>installed." ) + ( java . lang . System . lineSeparator ( ) ) ) + "Please<sp>see<sp>" ) + ( org . apache . nifi . toolkit . tls . util . TlsHelper . JCE_URL ) ) ) ; } } else { throw e ; } } return password ; }
|
org . junit . Assert . assertEquals ( testPassword , org . apache . nifi . toolkit . tls . util . TlsHelper . writeKeyStore ( keyStore , outputStreamFactory , file , testPassword , false ) )
|
shouldRemoveDelegateSelectItemsComponentOnDetatch ( ) { javax . faces . component . UIComponent parent = mockParent ( javax . faces . component . UIComponent . class ) ; this . selectItems . setParent ( parent ) ; this . selectItems . setParent ( mockParent ( javax . faces . component . UIComponent . class ) ) ; "<AssertPlaceHolder>" ; } mockParent ( java . lang . Class ) { T parent = mock ( componentClass ) ; java . util . List < javax . faces . component . UIComponent > children = new java . util . ArrayList < javax . faces . component . UIComponent > ( ) ; given ( parent . getChildren ( ) ) . willReturn ( children ) ; return parent ; }
|
org . junit . Assert . assertThat ( parent . getChildren ( ) . size ( ) , org . hamcrest . Matchers . is ( 0 ) )
|
shouldReturnRelativeResource ( ) { final java . lang . String resourceUri = ( ( "/" + ( packagePath ) ) + "/" ) + "test.css" ; when ( mockAuthorizationManager . isAuthorized ( resourceUri ) ) . thenReturn ( true ) ; when ( mockUriLocator . locate ( resourceUri ) ) . thenReturn ( getInputStream ( "test.css" ) ) ; when ( request . getParameter ( ResourceProxyRequestHandler . PARAM_RESOURCE_ID ) ) . thenReturn ( resourceUri ) ; victim . handle ( request , response ) ; final java . lang . String body = outputStream . toString ( ) ; final java . lang . String expectedBody = org . apache . commons . io . IOUtils . toString ( getInputStream ( "test.css" ) ) ; verify ( mockUriLocator , times ( 1 ) ) . locate ( resourceUri ) ; "<AssertPlaceHolder>" ; } locate ( java . lang . String ) { return new java . io . ByteArrayInputStream ( message . getBytes ( ) ) ; }
|
org . junit . Assert . assertEquals ( expectedBody , body )
|
matchMaterialByLowerCaseAndSpaces ( ) { for ( org . bukkit . Material material : org . bukkit . Material . values ( ) ) { java . lang . String name = material . toString ( ) . replaceAll ( "_" , "<sp>" ) . toLowerCase ( java . util . Locale . ENGLISH ) ; "<AssertPlaceHolder>" ; } } matchMaterial ( java . lang . String ) { org . apache . commons . lang . Validate . notNull ( name , "Name<sp>cannot<sp>be<sp>null" ) ; org . bukkit . Material result = null ; try { result = org . bukkit . Material . getMaterial ( java . lang . Integer . parseInt ( name ) ) ; } catch ( java . lang . NumberFormatException ex ) { } if ( result == null ) { java . lang . String filtered = name . toUpperCase ( java . util . Locale . ENGLISH ) ; filtered = filtered . replaceAll ( "\\s+" , "_" ) . replaceAll ( "\\W" , "" ) ; result = org . bukkit . Material . BY_NAME . get ( filtered ) ; } return result ; }
|
org . junit . Assert . assertThat ( org . bukkit . Material . matchMaterial ( name ) , is ( material ) )
|
testName ( ) { org . apache . olingo . odata2 . ref . model . Employee employee1 = new org . apache . olingo . odata2 . ref . model . Employee ( 1 , org . apache . olingo . odata2 . ref . model . EmployeeTest . VALUE_NAME ) ; "<AssertPlaceHolder>" ; } getEmployeeName ( ) { return employeeName ; }
|
org . junit . Assert . assertEquals ( org . apache . olingo . odata2 . ref . model . EmployeeTest . VALUE_NAME , employee1 . getEmployeeName ( ) )
|
testBlockingGet ( ) { final com . aldebaran . qi . Promise < java . lang . Integer > promise = new com . aldebaran . qi . Promise < java . lang . Integer > ( ) ; com . aldebaran . qi . Future < java . lang . Integer > future = promise . getFuture ( ) ; new java . lang . Thread ( new java . lang . Runnable ( ) { @ com . aldebaran . qi . Override public void run ( ) { try { java . lang . Thread . sleep ( 100 ) ; promise . setValue ( 42 ) ; } catch ( java . lang . InterruptedException e ) { } } } ) . start ( ) ; try { future . get ( 50 , TimeUnit . MILLISECONDS ) ; org . junit . Assert . fail ( "Value<sp>should<sp>not<sp>be<sp>available<sp>yet" ) ; } catch ( java . util . concurrent . TimeoutException e ) { } int value = future . get ( ) ; "<AssertPlaceHolder>" ; } run ( ) { try { java . lang . Thread . sleep ( 100 ) ; promise . setValue ( 42 ) ; } catch ( java . lang . InterruptedException e ) { } }
|
org . junit . Assert . assertEquals ( 42 , value )
|
testEmpty ( ) { final java . util . List < org . openrdf . model . URI > contexts = org . apache . marmotta . platform . core . test . triplestore . ContextServiceTest . contextService . listContexts ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return delegate . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , contexts . size ( ) )
|
testPushQueueInWhenReceiveData ( ) { java . util . List < java . lang . String > messagesIn = new java . util . ArrayList ( ) ; java . lang . String message = "8=FIX.4.49=8335=A49=021.01GW56=HNX34=052=xx:yy:zz369=098=0108=30553=021.01GW554=27216810=138" ; messagesIn . add ( message ) ; tcpReceiver . receive ( null , messagesIn ) ; java . lang . Thread . sleep ( 1000 ) ; "<AssertPlaceHolder>" ; } size ( ) { return queue . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , messages . size ( ) )
|
newResponse ( ) { org . jboss . elasticsearch . river . jira . mgm . incrementalupdate . IncrementalUpdateResponse rb = IncrementalUpdateAction . INSTANCE . newResponse ( ) ; "<AssertPlaceHolder>" ; } newResponse ( ) { return new org . jboss . elasticsearch . river . jira . mgm . incrementalupdate . IncrementalUpdateResponse ( ) ; }
|
org . junit . Assert . assertNotNull ( rb )
|
testWithWrongPackage1 ( ) { com . google . inject . Injector injector = com . google . inject . Guice . createInjector ( de . devsurf . injection . guice . scanner . StartupModule . create ( de . devsurf . injection . guice . scanner . asm . ASMClasspathScanner . class , de . devsurf . injection . guice . scanner . PackageFilter . create ( "java" ) ) ) ; "<AssertPlaceHolder>" ; try { de . devsurf . injection . guice . scanner . asm . tests . autobind . multiple . MultibindTests . FirstContainer container = injector . getInstance ( de . devsurf . injection . guice . scanner . asm . tests . autobind . multiple . MultibindTests . FirstContainer . class ) ; org . junit . Assert . fail ( ( "The<sp>Scanner<sp>scanned<sp>the<sp>wrong<sp>package,<sp>so<sp>no<sp>Implementation<sp>should<sp>be<sp>bound<sp>to<sp>this<sp>Interface.<sp>Instance<sp>null?<sp>" + ( container == null ) ) ) ; } catch ( com . google . inject . ConfigurationException e ) { } } create ( java . lang . Class ) { return new de . devsurf . injection . guice . scanner . PackageFilter ( clazz . getPackage ( ) . getName ( ) , true ) ; }
|
org . junit . Assert . assertNotNull ( injector )
|
testConfigureJarsNoExtraJars ( ) { final org . apache . hadoop . mapred . JobConf conf = new org . apache . hadoop . mapred . JobConf ( ) ; conf . set ( org . apache . hadoop . hive . ql . plan . TestTezWork . MR_JAR_PROPERTY , "file:///tmp/foo1.jar" ) ; org . apache . hadoop . hive . ql . plan . BaseWork baseWork = org . mockito . Mockito . mock ( org . apache . hadoop . hive . ql . plan . BaseWork . class ) ; work . add ( baseWork ) ; work . configureJobConfAndExtractJars ( conf ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return map . get ( k ) ; }
|
org . junit . Assert . assertEquals ( "file:///tmp/foo1.jar" , conf . get ( org . apache . hadoop . hive . ql . plan . TestTezWork . MR_JAR_PROPERTY ) )
|
getMaxInactiveInterval ( ) { this . validate ( ( session ) -> session . getMaxInactiveInterval ( ) ) ; org . wildfly . clustering . web . session . SessionManager < org . wildfly . clustering . web . undertow . session . LocalSessionContext , org . wildfly . clustering . ee . Batch > manager = mock ( org . wildfly . clustering . web . session . SessionManager . class ) ; org . wildfly . clustering . ee . Batcher < org . wildfly . clustering . ee . Batch > batcher = mock ( org . wildfly . clustering . ee . Batcher . class ) ; org . wildfly . clustering . ee . BatchContext context = mock ( org . wildfly . clustering . ee . BatchContext . class ) ; org . wildfly . clustering . web . session . SessionMetaData metaData = mock ( org . wildfly . clustering . web . session . SessionMetaData . class ) ; long expected = 3600L ; when ( this . manager . getSessionManager ( ) ) . thenReturn ( manager ) ; when ( manager . getBatcher ( ) ) . thenReturn ( batcher ) ; when ( batcher . resumeBatch ( this . batch ) ) . thenReturn ( context ) ; when ( this . session . getMetaData ( ) ) . thenReturn ( metaData ) ; when ( metaData . getMaxInactiveInterval ( ) ) . thenReturn ( java . time . Duration . ofSeconds ( expected ) ) ; long result = this . adapter . getMaxInactiveInterval ( ) ; "<AssertPlaceHolder>" ; verify ( context ) . close ( ) ; } getMaxInactiveInterval ( ) { return this . metaData . getMaxInactiveInterval ( ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
checkLockInfoDoesNotAffectHashCode ( ) { this . metadata = new org . guvnor . common . services . shared . metadata . model . Metadata ( path , path , "checkinComment" , "lastContributor" , "creator" , date , date , "subject" , "type" , "externalRelation" , "externalSource" , "description" , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , java . util . Collections . emptyList ( ) , new org . uberfire . backend . vfs . impl . LockInfo ( false , "" , path ) , false ) ; final int originalHashCode = metadata . hashCode ( ) ; metadata . setLockInfo ( new org . uberfire . backend . vfs . impl . LockInfo ( true , "admin" , path ) ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return getName ( ) . hashCode ( ) ; }
|
org . junit . Assert . assertEquals ( originalHashCode , metadata . hashCode ( ) )
|
testOnConnectionChangedAddedPreWithNetwotk ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
|
testDeleteWithHas ( ) { ca . uhn . fhir . jpa . dao . r4 . Observation obs1 = new ca . uhn . fhir . jpa . dao . r4 . Observation ( ) ; obs1 . setStatus ( ObservationStatus . FINAL ) ; org . hl7 . fhir . instance . model . api . IIdType obs1id = myObservationDao . create ( obs1 ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . dao . r4 . Observation obs2 = new ca . uhn . fhir . jpa . dao . r4 . Observation ( ) ; obs2 . setStatus ( ObservationStatus . FINAL ) ; org . hl7 . fhir . instance . model . api . IIdType obs2id = myObservationDao . create ( obs2 ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . dao . r4 . DiagnosticReport rpt = new ca . uhn . fhir . jpa . dao . r4 . DiagnosticReport ( ) ; rpt . addIdentifier ( ) . setSystem ( "foo" ) . setValue ( "IDENTIFIER" ) ; rpt . addResult ( new ca . uhn . fhir . jpa . dao . r4 . Reference ( obs2id ) ) ; org . hl7 . fhir . instance . model . api . IIdType rptId = myDiagnosticReportDao . create ( rpt ) . getId ( ) . toUnqualifiedVersionless ( ) ; myObservationDao . read ( obs1id ) ; myObservationDao . read ( obs2id ) ; rpt = new ca . uhn . fhir . jpa . dao . r4 . DiagnosticReport ( ) ; rpt . addIdentifier ( ) . setSystem ( "foo" ) . setValue ( "IDENTIFIER" ) ; org . hl7 . fhir . r4 . model . Bundle b = new org . hl7 . fhir . r4 . model . Bundle ( ) ; b . addEntry ( ) . getRequest ( ) . setMethod ( HTTPVerb . DELETE ) . setUrl ( "Observation?_has:DiagnosticReport:result:identifier=foo|IDENTIFIER" ) ; b . addEntry ( ) . setResource ( rpt ) . getRequest ( ) . setMethod ( HTTPVerb . PUT ) . setUrl ( "DiagnosticReport?identifier=foo|IDENTIFIER" ) ; mySystemDao . transaction ( mySrd , b ) ; myObservationDao . read ( obs1id ) ; try { myObservationDao . read ( obs2id ) ; org . junit . Assert . fail ( ) ; } catch ( ca . uhn . fhir . jpa . dao . r4 . ResourceGoneException e ) { } rpt = myDiagnosticReportDao . read ( rptId ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return myResult ; }
|
org . junit . Assert . assertThat ( rpt . getResult ( ) , empty ( ) )
|
testCMYKIsTypeCMYK ( ) { "<AssertPlaceHolder>" ; } getColorSpace ( int ) { java . awt . color . ICC_Profile profile ; switch ( colorSpace ) { case com . twelvemonkeys . imageio . color . ColorSpaces . CS_ADOBE_RGB_1998 : synchronized ( com . twelvemonkeys . imageio . color . ColorSpaces . class ) { profile = com . twelvemonkeys . imageio . color . ColorSpaces . adobeRGB1998 . get ( ) ; if ( profile == null ) { profile = com . twelvemonkeys . imageio . color . ColorSpaces . readProfileFromPath ( com . twelvemonkeys . imageio . color . ColorSpaces . Profiles . getPath ( "ADOBE_RGB_1998" ) ) ; if ( profile == null ) { profile = com . twelvemonkeys . imageio . color . ColorSpaces . readProfileFromClasspathResource ( "/profiles/ClayRGB1998.icc" ) ; if ( profile == null ) { throw new java . lang . IllegalStateException ( "Could<sp>not<sp>read<sp>AdobeRGB1998<sp>profile" ) ; } } if ( ( profile . getColorSpaceType ( ) ) != ( java . awt . color . ColorSpace . TYPE_RGB ) ) { throw new java . lang . IllegalStateException ( "Configured<sp>AdobeRGB1998<sp>profile<sp>is<sp>not<sp>TYPE_RGB" ) ; } com . twelvemonkeys . imageio . color . ColorSpaces . adobeRGB1998 = new java . lang . ref . WeakReference ( profile ) ; } } return com . twelvemonkeys . imageio . color . ColorSpaces . createColorSpace ( profile ) ; case com . twelvemonkeys . imageio . color . ColorSpaces . CS_GENERIC_CMYK : synchronized ( com . twelvemonkeys . imageio . color . ColorSpaces . class ) { profile = com . twelvemonkeys . imageio . color . ColorSpaces . genericCMYK . get ( ) ; if ( profile == null ) { profile = com . twelvemonkeys . imageio . color . ColorSpaces . readProfileFromPath ( com . twelvemonkeys . imageio . color . ColorSpaces . Profiles . getPath ( "GENERIC_CMYK" ) ) ; if ( profile == null ) { if ( com . twelvemonkeys . imageio . color . ColorSpaces . DEBUG ) { System . out . println ( "Using<sp>fallback<sp>profile" ) ; } return com . twelvemonkeys . imageio . color . CMYKColorSpace . getInstance ( ) ; } if ( ( profile . getColorSpaceType ( ) ) != ( java . awt . color . ColorSpace . TYPE_CMYK ) ) { throw new java . lang . IllegalStateException ( "Configured<sp>Generic<sp>CMYK<sp>profile<sp>is<sp>not<sp>TYPE_CMYK" ) ; } com . twelvemonkeys . imageio . color . ColorSpaces . genericCMYK = new java . lang . ref . WeakReference ( profile ) ; } } return com . twelvemonkeys . imageio . color . ColorSpaces . createColorSpace ( profile ) ; default : return java . awt . color . ColorSpace . getInstance ( colorSpace ) ; } }
|
org . junit . Assert . assertEquals ( ColorSpace . TYPE_CMYK , com . twelvemonkeys . imageio . color . ColorSpaces . getColorSpace ( ColorSpaces . CS_GENERIC_CMYK ) . getType ( ) )
|
findOfflineTest ( ) { me . xiezefan . easyim . server . model . Message msg = messageDao . findById ( Contact . MESSAGE_ID1 ) ; me . xiezefan . easyim . server . model . Message msg2 = new me . xiezefan . easyim . server . model . Message ( ) ; msg2 . setId ( Contact . MESSAGE_ID2 ) ; msg2 . setFromId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; msg2 . setToId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; msg2 . setType ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; java . util . Map < java . lang . String , java . lang . Object > content = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; content . put ( "key1" , "value1" ) ; content . put ( "key2" , "value2" ) ; msg2 . setContent ( content ) ; msg2 . setCreateTime ( new java . util . Date ( ) ) ; messageDao . save ( msg2 ) ; me . xiezefan . easyim . server . model . Message msg3 = new me . xiezefan . easyim . server . model . Message ( ) ; msg3 . setId ( Contact . MESSAGE_ID3 ) ; msg3 . setFromId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; msg3 . setToId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; msg3 . setType ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; msg3 . setContent ( content ) ; msg3 . setCreateTime ( new java . util . Date ( ) ) ; messageDao . save ( msg3 ) ; me . xiezefan . easyim . server . model . OfflineMessage offlineMsg = new me . xiezefan . easyim . server . model . OfflineMessage ( ) ; offlineMsg . setId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; offlineMsg . setUserId ( Contact . USER_ID ) ; offlineMsg . setMessage ( msg ) ; offlineMsg . setStatus ( MessageStatus . SEND ) ; offlineMsg . setCreateTime ( new java . util . Date ( ) ) ; offlineMessageDao . save ( offlineMsg ) ; me . xiezefan . easyim . server . model . OfflineMessage offlineMsg2 = new me . xiezefan . easyim . server . model . OfflineMessage ( ) ; offlineMsg2 . setId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; offlineMsg2 . setUserId ( Contact . USER_ID ) ; offlineMsg2 . setMessage ( msg2 ) ; offlineMsg2 . setStatus ( MessageStatus . READ ) ; offlineMsg2 . setCreateTime ( new java . util . Date ( ) ) ; offlineMessageDao . save ( offlineMsg2 ) ; me . xiezefan . easyim . server . model . OfflineMessage offlineMsg3 = new me . xiezefan . easyim . server . model . OfflineMessage ( ) ; offlineMsg3 . setId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; offlineMsg3 . setUserId ( Contact . USER_ID ) ; offlineMsg3 . setMessage ( msg3 ) ; offlineMsg3 . setStatus ( MessageStatus . SEND ) ; offlineMsg3 . setCreateTime ( new java . util . Date ( ) ) ; offlineMessageDao . save ( offlineMsg3 ) ; java . util . List < me . xiezefan . easyim . server . model . OfflineMessage > list = offlineMessageDao . findOffline ( Contact . USER_ID ) ; "<AssertPlaceHolder>" ; } setCreateTime ( java . util . Date ) { this . createTime = createTime ; }
|
org . junit . Assert . assertTrue ( ( ( list . size ( ) ) == 2 ) )
|
donotDeleteObjectFactoryNSOtherThanMP2 ( ) { java . io . File wsdl = getCodegenQEDataFileInput ( "-dest" 5 ) ; java . lang . String [ ] testArgs = new java . lang . String [ ] { "-dest" 0 , "-dest" 9 , "-genType" , "-dest" 6 , "-wsdl" , wsdl . getAbsolutePath ( ) , "-dest" 8 , "http://www.ebayopensource.org/turmeric/runtime/types" , "-dest" , destDir . getAbsolutePath ( ) , "-mdest" 0 , destDir . getAbsolutePath ( ) , "-mdest" , ( destDir . getAbsolutePath ( ) ) + "-dest" 3 , "-dest" 4 , "-mdest" 1 , "-dest" 2 , "COMMON" , "-bin" , binDir . getAbsolutePath ( ) , "-dest" 7 , prDir . getAbsolutePath ( ) , "-noObjectFactoryGeneration" , "true" } ; createInterfacePropsFile ( intfProper , destDir . getAbsolutePath ( ) ) ; performDirectCodeGen ( testArgs , binDir ) ; java . io . File file = new java . io . File ( ( ( destDir . getAbsolutePath ( ) ) + "/gen-src/org/ebayopensource/turmeric/common/v1/types/ObjectFactory.java" ) ) ; "<AssertPlaceHolder>" ; } exists ( ) { return legacyPropertiesFile . exists ( ) ; }
|
org . junit . Assert . assertFalse ( file . exists ( ) )
|
testNumberFunction ( ) { this . runtime . execute ( "var<sp>x<sp>=<sp>Number(8)" ) ; org . dynjs . runtime . Reference result = this . runtime . getDefaultExecutionContext ( ) . resolve ( "x" ) ; java . lang . Long value = ( ( java . lang . Long ) ( result . getValue ( getContext ( ) ) ) ) ; "<AssertPlaceHolder>" . isEqualTo ( 8L ) ; } getContext ( ) { return this . runtime . getDefaultExecutionContext ( ) ; }
|
org . junit . Assert . assertThat ( value )
|
testClear ( ) { typeStack . clear ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return index . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , typeStack . size ( ) )
|
testMoveAndRenNotExistingSuperiorNoReferralAncestor ( ) { try { WWCtx . rename ( "cn=Emmanuel<sp>Lecharny,o=MNN" , "cn=Emmanuel,o=PNN" ) ; org . junit . Assert . fail ( ) ; } catch ( javax . naming . NameNotFoundException nnfe ) { "<AssertPlaceHolder>" ; } } rename ( org . apache . directory . api . ldap . model . message . ModifyDnRequest , org . apache . directory . server . core . api . changelog . LogChange ) { org . apache . directory . server . core . api . interceptor . context . RenameOperationContext renameContext = new org . apache . directory . server . core . api . interceptor . context . RenameOperationContext ( this , modifyDnRequest ) ; renameContext . setLogChange ( log ) ; org . apache . directory . server . core . api . OperationManager operationManager = directoryService . getOperationManager ( ) ; try { operationManager . rename ( renameContext ) ; } catch ( org . apache . directory . api . ldap . model . exception . LdapException e ) { modifyDnRequest . getResultResponse ( ) . addAllControls ( renameContext . getResponseControls ( ) ) ; throw e ; } modifyDnRequest . getResultResponse ( ) . addAllControls ( renameContext . getResponseControls ( ) ) ; }
|
org . junit . Assert . assertTrue ( true )
|
testRemoveDropletsFromLoadBalancer ( ) { com . myjeeva . digitalocean . pojo . Delete result = apiClient . removeDropletsFromLoadBalancer ( loadBalancerIdForInfo , java . util . Arrays . asList ( dropletIdForInfo ) ) ; "<AssertPlaceHolder>" ; } removeDropletsFromLoadBalancer ( java . lang . String , java . util . List ) { validateLoadBalancerId ( loadBalancerId ) ; if ( ( null == dropletIds ) || ( dropletIds . isEmpty ( ) ) ) { throw new java . lang . IllegalArgumentException ( "Missing<sp>required<sp>parameters<sp>[dropletIds]." ) ; } java . lang . Object [ ] params = new java . lang . Object [ ] { loadBalancerId } ; java . util . Map < java . lang . String , java . util . List < java . lang . Integer > > data = new java . util . HashMap ( ) ; data . put ( "droplet_ids" , dropletIds ) ; return ( ( com . myjeeva . digitalocean . pojo . Delete ) ( perform ( new com . myjeeva . digitalocean . impl . ApiRequest ( com . myjeeva . digitalocean . common . ApiAction . REMOVE_DROPLET_FROM_LOAD_BALANCER , data , params ) ) . getData ( ) ) ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
lazyLoadingByEnhancer ( ) { java . util . List < org . springframework . data . rest . example . Person > list = ( ( java . util . List < org . springframework . data . rest . example . Person > ) ( net . sf . cglib . proxy . Enhancer . create ( java . util . List . class , lazyloader ) ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 1 , list . size ( ) )
|
testGetValueWhenUnconfigured ( ) { java . lang . String value = _fallbackSettings . getValue ( "key1" , "default" ) ; "<AssertPlaceHolder>" ; verifyGetValue ( "key1" , "key2" , "key3" ) ; } getValue ( com . liferay . blogs . model . BlogsEntry , java . util . Locale ) { return _contentTransformerHandler . transform ( ContentTransformerContentTypes . HTML , blogsEntry . getContent ( ) ) ; }
|
org . junit . Assert . assertEquals ( "default" , value )
|
test ( ) { org . tests . model . basic . ResetBasicData . reset ( ) ; java . util . List < org . tests . model . basic . Customer > list = io . ebean . Ebean . find ( org . tests . model . basic . Customer . class ) . where ( ) . idIn ( "1" , "2" ) . findList ( ) ; "<AssertPlaceHolder>" ; } findList ( ) { org . tests . model . basic . ResetBasicData . reset ( ) ; io . ebean . EbeanServer server = io . ebean . Ebean . getDefaultServer ( ) ; io . ebean . Query < org . tests . model . basic . Customer > query = server . find ( org . tests . model . basic . Customer . class ) . where ( ) . startsWith ( "name" , "Rob" ) . query ( ) ; try ( io . ebean . Transaction transaction = server . beginTransaction ( ) ) { java . util . List < org . tests . model . basic . Customer > customers = server . extended ( ) . findList ( query , transaction ) ; assertThat ( customers ) . isNotEmpty ( ) ; transaction . commit ( ) ; } }
|
org . junit . Assert . assertNotNull ( list )
|
testInstancesAndProcesses ( ) { autoScalingGroupName = "java-integ-test-scaling-group-" + ( new java . util . Date ( ) . getTime ( ) ) ; launchConfigurationName = "java-integ-test-launch-configuration-" + ( new java . util . Date ( ) . getTime ( ) ) ; createLaunchConfiguration ( launchConfigurationName ) ; software . amazon . awssdk . services . autoscaling . model . CreateAutoScalingGroupRequest createRequest = software . amazon . awssdk . services . autoscaling . model . CreateAutoScalingGroupRequest . builder ( ) . autoScalingGroupName ( autoScalingGroupName ) . launchConfigurationName ( launchConfigurationName ) . availabilityZones ( software . amazon . awssdk . services . autoscaling . AVAILABILITY_ZONE ) . maxSize ( 2 ) . minSize ( 1 ) . build ( ) ; autoscaling . createAutoScalingGroup ( createRequest ) ; software . amazon . awssdk . services . autoscaling . model . DescribeAutoScalingInstancesResponse describeAutoScalingInstancesResult = autoscaling . describeAutoScalingInstances ( software . amazon . awssdk . services . autoscaling . model . DescribeAutoScalingInstancesRequest . builder ( ) . build ( ) ) ; "<AssertPlaceHolder>" ; software . amazon . awssdk . services . autoscaling . model . SuspendProcessesRequest suspendProcessesRequest = software . amazon . awssdk . services . autoscaling . model . SuspendProcessesRequest . builder ( ) . autoScalingGroupName ( autoScalingGroupName ) . build ( ) ; autoscaling . suspendProcesses ( suspendProcessesRequest ) ; software . amazon . awssdk . services . autoscaling . model . ResumeProcessesRequest resumeProcessesRequest = software . amazon . awssdk . services . autoscaling . model . ResumeProcessesRequest . builder ( ) . autoScalingGroupName ( autoScalingGroupName ) . build ( ) ; autoscaling . resumeProcesses ( resumeProcessesRequest ) ; } build ( ) { return new software . amazon . awssdk . http . apache . internal . ApacheHttpRequestConfig ( this ) ; }
|
org . junit . Assert . assertNotNull ( describeAutoScalingInstancesResult )
|
passCase2 ( ) { org . openstack . atlas . api . validation . verifiers . VerifierResult result = hostNameVerifier . verify ( "www.hostname.com" ) ; "<AssertPlaceHolder>" ; } passed ( ) { return passed ; }
|
org . junit . Assert . assertTrue ( result . passed ( ) )
|
startProcess ( ) { org . activiti . engine . RepositoryService repositoryService = activitiRule . getRepositoryService ( ) ; repositoryService . createDeployment ( ) . addInputStream ( "GetFieldOfTaskListener.bpmn20.xml" , new java . io . FileInputStream ( filename ) ) . deploy ( ) ; org . activiti . engine . RuntimeService runtimeService = activitiRule . getRuntimeService ( ) ; java . util . Map < java . lang . String , java . lang . Object > variableMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; variableMap . put ( "name" , "Activiti" ) ; org . activiti . engine . runtime . ProcessInstance processInstance = runtimeService . startProcessInstanceByKey ( "GetFieldOfTaskListener" , variableMap ) ; "<AssertPlaceHolder>" ; System . out . println ( ( ( ( "id<sp>" + ( processInstance . getId ( ) ) ) + "<sp>" ) + ( processInstance . getProcessDefinitionId ( ) ) ) ) ; }
|
org . junit . Assert . assertNotNull ( processInstance . getId ( ) )
|
testCallback ( ) { org . apache . jackrabbit . oak . spi . security . authentication . callback . CredentialsCallback cb = new org . apache . jackrabbit . oak . spi . security . authentication . callback . CredentialsCallback ( ) ; javax . jcr . Credentials creds = new javax . jcr . Credentials ( ) { } ; cb . setCredentials ( creds ) ; "<AssertPlaceHolder>" ; } getCredentials ( ) { return credentials ; }
|
org . junit . Assert . assertSame ( creds , cb . getCredentials ( ) )
|
runs_fixed_pcap_filter_job_with_full_argument_list ( ) { java . lang . String [ ] args = new java . lang . String [ ] { "6" 7 , "-start_time" , "6" 2 , "-end_time" , "2016-06-15-18:35.00" , "-yq" 4 , "6" 3 , "-yq" 6 , "6" 5 , "6" 9 , "6" 1 , "-yq" 3 , "2016-06-15-18:35.00" 0 , "6" 8 , "-yq" 0 , "-ip_src_port" , "6" 4 , "-yq" 5 , "-yq" 1 , "6" 6 , "6" , "-include_reverse" , "-num_reducers" , "-yq" 7 , "6" 0 , "1000" , "-yq" , "-yq" 9 , "-finalizer_threads" , "-yq" 7 } ; java . util . Map < java . lang . String , java . lang . String > query = new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( Constants . Fields . SRC_ADDR . getName ( ) , "2016-06-15-18:35.00" 0 ) ; put ( Constants . Fields . DST_ADDR . getName ( ) , "-yq" 0 ) ; put ( Constants . Fields . SRC_PORT . getName ( ) , "6" 4 ) ; put ( Constants . Fields . DST_PORT . getName ( ) , "-yq" 1 ) ; put ( Constants . Fields . PROTOCOL . getName ( ) , "6" ) ; put ( Constants . Fields . INCLUDES_REVERSE_TRAFFIC . getName ( ) , "-yq" 2 ) ; } } ; long startAsNanos = asNanos ( "6" 2 , "6" 3 ) ; long endAsNanos = asNanos ( "2016-06-15-18:35.00" , "6" 3 ) ; org . apache . metron . pcap . config . FixedPcapConfig config = new org . apache . metron . pcap . config . FixedPcapConfig ( prefixStrategy ) ; PcapOptions . BASE_PATH . put ( config , "6" 5 ) ; PcapOptions . BASE_INTERIM_RESULT_PATH . put ( config , "6" 1 ) ; PcapOptions . FIELDS . put ( config , query ) ; PcapOptions . NUM_REDUCERS . put ( config , 10 ) ; PcapOptions . START_TIME_MS . put ( config , ( startAsNanos / 1000000L ) ) ; PcapOptions . END_TIME_MS . put ( config , ( endAsNanos / 1000000L ) ) ; PcapOptions . NUM_RECORDS_PER_FILE . put ( config , 1000 ) ; PcapOptions . PRINT_JOB_STATUS . put ( config , true ) ; PcapOptions . HADOOP_CONF . put ( config , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( MRJobConfig . QUEUE_NAME , "-yq" 9 ) ; } } ) ; PcapOptions . FINALIZER_THREADPOOL_SIZE . put ( config , "-yq" 7 ) ; when ( jobRunner . submit ( isA ( org . apache . metron . job . Finalizer . class ) , argThat ( mapContaining ( config ) ) ) ) . thenReturn ( jobRunner ) ; org . apache . metron . pcap . query . PcapCli cli = new org . apache . metron . pcap . query . PcapCli ( jobRunner , prefixStrategy ) ; "<AssertPlaceHolder>" ; verify ( jobRunner ) . get ( ) ; } run ( org . apache . commons . cli . CommandLine ) { try ( org . apache . curator . framework . CuratorFramework client = org . apache . metron . common . configuration . ConfigurationsUtils . getClient ( org . apache . metron . common . cli . ConfigurationManager . ConfigurationOptions . ZK_QUORUM . get ( cli ) ) ) { client . start ( ) ; run ( client , cli ) ; } }
|
org . junit . Assert . assertThat ( "-yq" 8 , cli . run ( args ) , org . hamcrest . CoreMatchers . equalTo ( 0 ) )
|
moveDirectory_theTargetDirectoryShouldBeDirectory ( ) { initRepository ( ) ; writeToCache ( "/source/file.txt" ) ; commitToMaster ( ) ; initGitFileSystem ( ) ; com . beijunyi . parallelgit . filesystem . GitPath source = gfs . getPath ( "/source" ) ; com . beijunyi . parallelgit . filesystem . GitPath target = gfs . getPath ( "/target" ) ; com . beijunyi . parallelgit . filesystem . Files . move ( source , target ) ; "<AssertPlaceHolder>" ; } isDirectory ( org . eclipse . jgit . treewalk . TreeWalk ) { return com . beijunyi . parallelgit . utils . TREE . equals ( com . beijunyi . parallelgit . utils . TreeUtils . getFileMode ( tw ) ) ; }
|
org . junit . Assert . assertTrue ( com . beijunyi . parallelgit . filesystem . Files . isDirectory ( target ) )
|
shouldExcludePort80v2 ( ) { final java . lang . String expected = "GET&http%3A%2F%2Fexample.com%2Ftest&oauth_callback%3Dhttp%253A%252F%252Fexample" + ( "%252Fcallback%26oauth_consumer_key%3DAS%2523%2524%255E%252A%2540%2526%26oauth_signature" + "%3DOAuth-Signature%26oauth_timestamp%3D123456" ) ; final java . lang . String baseString = extractor . extract ( requestPort80v2 ) ; "<AssertPlaceHolder>" ; } extract ( com . github . scribejava . core . model . Response ) { if ( ( response . getCode ( ) ) != 200 ) { throw new com . github . scribejava . core . exceptions . OAuthException ( ( ( "Response<sp>code<sp>is<sp>not<sp>200<sp>but<sp>'" + ( response . getCode ( ) ) ) + '\'' ) ) ; } final java . lang . String body = response . getBody ( ) ; com . github . scribejava . core . utils . Preconditions . checkEmptyString ( body , "Response<sp>body<sp>is<sp>incorrect.<sp>Can't<sp>extract<sp>a<sp>token<sp>from<sp>an<sp>empty<sp>string" ) ; final java . lang . String accessToken = com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . extractParameter ( body , com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . ACCESS_TOKEN_REGEX_PATTERN , true ) ; final java . lang . String tokenType = com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . extractParameter ( body , com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . TOKEN_TYPE_REGEX_PATTERN , false ) ; final java . lang . String expiresInString = com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . extractParameter ( body , com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . EXPIRES_IN_REGEX_PATTERN , false ) ; java . lang . Integer expiresIn ; try { expiresIn = ( expiresInString == null ) ? null : java . lang . Integer . valueOf ( expiresInString ) ; } catch ( java . lang . NumberFormatException nfe ) { expiresIn = null ; } final java . lang . String refreshToken = com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . extractParameter ( body , com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . REFRESH_TOKEN_REGEX_PATTERN , false ) ; final java . lang . String scope = com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . extractParameter ( body , com . github . scribejava . core . extractors . OAuth2AccessTokenExtractor . SCOPE_REGEX_PATTERN , false ) ; return new com . github . scribejava . core . model . OAuth2AccessToken ( accessToken , tokenType , expiresIn , refreshToken , scope , body ) ; }
|
org . junit . Assert . assertEquals ( expected , baseString )
|
tupled_A$ ( ) { com . m3 . scalaflavor4j . Function3 < java . lang . String , java . lang . String , java . lang . String , java . lang . Integer > f = new com . m3 . scalaflavor4j . F3 < java . lang . String , java . lang . String , java . lang . String , java . lang . Integer > ( ) { public com . m3 . scalaflavor4j . Integer apply ( java . lang . String v1 , java . lang . String v2 , java . lang . String v3 ) { return ( ( v1 + v2 ) + v3 ) . length ( ) ; } } ; com . m3 . scalaflavor4j . Function1 < com . m3 . scalaflavor4j . Tuple3 < java . lang . String , java . lang . String , java . lang . String > , java . lang . Integer > f2 = new com . m3 . scalaflavor4j . RichFunction3 ( f ) . tupled ( ) ; java . lang . Integer result = f2 . apply ( com . m3 . scalaflavor4j . Tuple . apply ( "a" , "bc" , "def" ) ) ; "<AssertPlaceHolder>" ; } apply ( T1 , T2 , T3 ) { return new com . m3 . scalaflavor4j . Tuple3 < T1 , T2 , T3 > ( _1 , _2 , _3 ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( 6 ) ) )
|
testRondConversieVanuitLO3MetMillis ( ) { final nl . moderniseringgba . migratie . conversie . model . lo3 . element . Lo3Datumtijdstempel lo3bron = new nl . moderniseringgba . migratie . conversie . model . lo3 . element . Lo3Datumtijdstempel ( 20121204072930888L ) ; final nl . moderniseringgba . migratie . conversie . model . brp . attribuut . BrpDatumTijd brp = lo3bron . converteerNaarBrpDatumTijd ( ) ; final nl . moderniseringgba . migratie . conversie . model . lo3 . element . Lo3Datumtijdstempel lo3resultaat = brp . converteerNaarLo3Datumtijdstempel ( ) ; "<AssertPlaceHolder>" ; } converteerNaarLo3Datumtijdstempel ( ) { return new nl . moderniseringgba . migratie . conversie . model . lo3 . element . Lo3Datumtijdstempel ( datumTijdMillis ) ; }
|
org . junit . Assert . assertEquals ( lo3bron , lo3resultaat )
|
testNormalizeUrl_EndWithSlash ( ) { java . lang . String url = ( org . jenkinsci . plugins . gitbucket . GitBucketProjectPropertyTest . GITBUCKET_URL ) + '/' ; target = new org . jenkinsci . plugins . gitbucket . GitBucketProjectProperty ( url , true ) ; java . lang . String actual = target . getUrl ( ) ; "<AssertPlaceHolder>" ; } getUrl ( ) { return url ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . jenkinsci . plugins . gitbucket . GitBucketProjectPropertyTest . GITBUCKET_URL ) )
|
testVisitAddMonthsFunction ( ) { es . ieci . tecdoc . fwktd . sql . node . expression . DateValue value = new es . ieci . tecdoc . fwktd . sql . node . expression . DateValue ( "1998-01-01" ) ; es . ieci . tecdoc . fwktd . sql . node . expression . functions . date . AddMonthsFunction function = new es . ieci . tecdoc . fwktd . sql . node . expression . functions . date . AddMonthsFunction ( value , new es . ieci . tecdoc . fwktd . sql . node . expression . LongValue ( new java . lang . Long ( 5 ) ) ) ; expressionRenderer . visit ( function ) ; "<AssertPlaceHolder>" ; } getSqlString ( ) { return sqlString ; }
|
org . junit . Assert . assertNotNull ( function . getSqlString ( ) )
|
testAPIOutputModeEnumValues ( ) { for ( com . digi . xbee . api . models . APIOutputMode apiOutputMode : apiOutputModeValues ) "<AssertPlaceHolder>" ; } getValue ( ) { return idValue ; }
|
org . junit . Assert . assertTrue ( ( ( apiOutputMode . getValue ( ) ) >= 0 ) )
|
testForBooleanArray ( ) { java . lang . Boolean [ ] boolArr = new java . lang . Boolean [ 2 ] ; boolArr [ 0 ] = true ; boolArr [ 1 ] = false ; com . salesforce . phoenix . schema . PhoenixArray arr = com . salesforce . phoenix . schema . PArrayDataType . instantiatePhoenixArray ( PDataType . BOOLEAN , boolArr ) ; PDataType . BOOLEAN_ARRAY . toObject ( arr , PDataType . BOOLEAN_ARRAY ) ; byte [ ] bytes = PDataType . BOOLEAN_ARRAY . toBytes ( arr ) ; com . salesforce . phoenix . schema . PhoenixArray resultArr = ( ( com . salesforce . phoenix . schema . PhoenixArray ) ( PDataType . BOOLEAN_ARRAY . toObject ( bytes , 0 , bytes . length ) ) ) ; "<AssertPlaceHolder>" ; } toObject ( java . lang . Object , com . salesforce . phoenix . schema . PDataType , com . salesforce . phoenix . schema . ColumnModifier ) { return toObject ( object , actualType ) ; }
|
org . junit . Assert . assertEquals ( arr , resultArr )
|
shouldFindCorrectMin ( ) { final io . confluent . ksql . function . udaf . min . LongMinKudaf longMinKudaf = getLongMinKudaf ( ) ; final long [ ] values = new long [ ] { 3L , 5L , 8L , 2L , 3L , 4L , 5L } ; long currentMin = Long . MAX_VALUE ; for ( final long i : values ) { currentMin = longMinKudaf . aggregate ( i , currentMin ) ; } "<AssertPlaceHolder>" ; } aggregate ( java . lang . Double , java . util . Map ) { final java . lang . Double sampleSize = 1.0 + ( aggregateValue . getOrDefault ( "sample_size" , 0.0 ) ) ; final java . lang . Double sum = newValue + ( aggregateValue . getOrDefault ( "sum" , 0.0 ) ) ; aggregateValue . put ( "mean" , ( sum / sampleSize ) ) ; aggregateValue . put ( "sample_size" , sampleSize ) ; aggregateValue . put ( "sum" , sum ) ; return aggregateValue ; }
|
org . junit . Assert . assertThat ( 2L , org . hamcrest . CoreMatchers . equalTo ( currentMin ) )
|
withNoResultTest ( ) { secondEntryPoint . insert ( new org . drools . compiler . integrationtests . QueryCepTest . TestEvent ( "minusOne" ) ) ; clock . advanceTime ( 5 , TimeUnit . SECONDS ) ; firstEntryPoint . insert ( new org . drools . compiler . integrationtests . QueryCepTest . TestEvent ( "zero" ) ) ; secondEntryPoint . insert ( new org . drools . compiler . integrationtests . QueryCepTest . TestEvent ( "one" ) ) ; clock . advanceTime ( 10 , TimeUnit . SECONDS ) ; secondEntryPoint . insert ( new org . drools . compiler . integrationtests . QueryCepTest . TestEvent ( "two" ) ) ; clock . advanceTime ( 10 , TimeUnit . SECONDS ) ; secondEntryPoint . insert ( new org . drools . compiler . integrationtests . QueryCepTest . TestEvent ( "three" ) ) ; org . kie . api . runtime . rule . QueryResults results = ksession . getQueryResults ( "ZeroToNineteenSeconds" ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , results . size ( ) )
|
testExport ( ) { org . esa . beam . util . kmz . KmlScreenOverlay screenOverlay = new org . esa . beam . util . kmz . KmlScreenOverlay ( "Legend" , new org . esa . beam . util . kmz . DummyTestOpImage ( 2 , 2 ) ) ; java . lang . String expected = getExpected ( ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; screenOverlay . createKml ( builder ) ; "<AssertPlaceHolder>" ; } toString ( ) { return java . util . Arrays . toString ( java . util . Arrays . copyOfRange ( elements , offset , ( ( offset ) + ( size ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( expected , builder . toString ( ) )
|
hasSameHashCodeAsEqualTest ( ) { org . junit . runners . parameterized . TestWithParameters firstTest = new org . junit . runners . parameterized . TestWithParameters ( org . junit . runners . parameterized . TestWithParametersTest . DUMMY_NAME , org . junit . runners . parameterized . TestWithParametersTest . DUMMY_TEST_CLASS , org . junit . runners . parameterized . TestWithParametersTest . DUMMY_PARAMETERS ) ; org . junit . runners . parameterized . TestWithParameters secondTest = new org . junit . runners . parameterized . TestWithParameters ( org . junit . runners . parameterized . TestWithParametersTest . DUMMY_NAME , org . junit . runners . parameterized . TestWithParametersTest . DUMMY_TEST_CLASS , org . junit . runners . parameterized . TestWithParametersTest . DUMMY_PARAMETERS ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return method . hashCode ( ) ; }
|
org . junit . Assert . assertEquals ( firstTest . hashCode ( ) , secondTest . hashCode ( ) )
|
testListAllTypeResourcesProviders ( ) { java . lang . String command = java . lang . String . format ( Constants . LIST_ALL_PROVIDER_TYPE_RESOURCES_COMMAND , Constants . PROVIDER_TYPE_JOYENT_NAME , ClientTestEntities . KEYS_RESOURCE_TYPE . getTypeName ( ) , ResourceStatus . ACTIVE . toString ( ) ) ; execute ( command ) ; java . util . Map < java . lang . String , java . util . Set < co . cask . coopr . provisioner . plugin . ResourceMeta > > resultMap = getMapFromOutput ( new com . google . gson . reflect . TypeToken < java . util . Map < java . lang . String , java . util . Set < co . cask . coopr . provisioner . plugin . ResourceMeta > > > ( ) { } . getType ( ) ) ; java . util . Map < java . lang . String , com . google . common . collect . ImmutableSet < co . cask . coopr . provisioner . plugin . ResourceMeta > > expectedMap = com . google . common . collect . ImmutableMap . of ( "dev" , com . google . common . collect . ImmutableSet . of ( ClientTestEntities . DEV_KEY_RESOURCE_META_V1 , ClientTestEntities . DEV_KEY_RESOURCE_META_V2 ) , "research" , com . google . common . collect . ImmutableSet . of ( ClientTestEntities . RESEARCH_KEY_RESOURCE_META ) ) ; "<AssertPlaceHolder>" ; } of ( A , B ) { return new co . cask . coopr . common . utils . ImmutablePair < A , B > ( first , second ) ; }
|
org . junit . Assert . assertEquals ( expectedMap , resultMap )
|
testDateInteger ( ) { java . lang . Class < com . j256 . ormlite . field . types . DateIntegerTypeTest . LocalDateInteger > clazz = com . j256 . ormlite . field . types . DateIntegerTypeTest . LocalDateInteger . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . DateIntegerTypeTest . LocalDateInteger , java . lang . Object > dao = createDao ( clazz , true ) ; long now = java . lang . System . currentTimeMillis ( ) ; java . util . Date val = new java . util . Date ( ( now - ( now % 1000 ) ) ) ; int sqlVal = ( ( int ) ( ( val . getTime ( ) ) / 1000L ) ) ; java . lang . String valStr = java . lang . Integer . toString ( sqlVal ) ; com . j256 . ormlite . field . types . DateIntegerTypeTest . LocalDateInteger foo = new com . j256 . ormlite . field . types . DateIntegerTypeTest . LocalDateInteger ( ) ; foo . date = val ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , val , sqlVal , sqlVal , valStr , DataType . DATE_INTEGER , com . j256 . ormlite . field . types . DateIntegerTypeTest . DATE_COLUMN , false , true , false , false , false , false , true , false ) ; } create ( T ) { checkForInitialized ( ) ; if ( data == null ) { return 0 ; } if ( data instanceof com . j256 . ormlite . misc . BaseDaoEnabled ) { @ com . j256 . ormlite . dao . SuppressWarnings ( "unchecked" ) com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > daoEnabled = ( ( com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > ) ( data ) ) ; daoEnabled . setDao ( this ) ; } com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . create ( connection , data , objectCache ) ; } finally { connectionSource . releaseConnection ( connection ) ; } }
|
org . junit . Assert . assertEquals ( 1 , dao . create ( foo ) )
|
designDocCompare ( ) { org . lightcouch . DesignDocument designDoc1 = org . lightcouch . tests . DesignDocumentsTest . dbClient . design ( ) . getFromDesk ( "example" ) ; org . lightcouch . tests . DesignDocumentsTest . dbClient . design ( ) . synchronizeWithDb ( designDoc1 ) ; org . lightcouch . DesignDocument designDoc11 = org . lightcouch . tests . DesignDocumentsTest . dbClient . design ( ) . getFromDb ( "_design/example" ) ; "<AssertPlaceHolder>" ; } getFromDb ( java . lang . String ) { org . lightcouch . CouchDbUtil . assertNotEmpty ( id , "id" ) ; final java . net . URI uri = org . lightcouch . URIBuilder . buildUri ( dbc . getDBUri ( ) ) . path ( id ) . build ( ) ; return dbc . get ( uri , org . lightcouch . DesignDocument . class ) ; }
|
org . junit . Assert . assertEquals ( designDoc1 , designDoc11 )
|
testSerialization ( ) { org . jfree . chart . renderer . xy . ClusteredXYBarRenderer r1 = new org . jfree . chart . renderer . xy . ClusteredXYBarRenderer ( ) ; org . jfree . chart . renderer . xy . ClusteredXYBarRenderer r2 = ( ( org . jfree . chart . renderer . xy . ClusteredXYBarRenderer ) ( org . jfree . chart . TestUtils . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( r1 , r2 )
|
shouldReturnOriginalValueIfInputIsAnEdge ( ) { final uk . gov . gchq . gaffer . data . element . Edge input = new uk . gov . gchq . gaffer . data . element . Edge ( "group" ) ; final uk . gov . gchq . gaffer . operation . function . ToElementId function = new uk . gov . gchq . gaffer . operation . function . ToElementId ( ) ; final uk . gov . gchq . gaffer . data . element . id . ElementId output = function . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . Object ) { if ( null == value ) { return null ; } if ( value instanceof java . lang . Number ) { return ( ( java . lang . Number ) ( value ) ) . intValue ( ) ; } if ( value instanceof java . lang . String ) { return java . lang . Integer . valueOf ( ( ( java . lang . String ) ( value ) ) ) ; } throw new java . lang . IllegalArgumentException ( ( "Could<sp>not<sp>convert<sp>value<sp>to<sp>Integer:<sp>" + value ) ) ; }
|
org . junit . Assert . assertSame ( input , output )
|
getPreferedNameShouldReturnFullyQualyfiedNameIfExists ( ) { action . setFeatureId ( "3" ) ; java . lang . String fullyQualifedName = "fully" ; com . gisgraphy . fulltext . SolrResponseDto mockSolrResponseDto = org . easymock . EasyMock . createMock ( com . gisgraphy . fulltext . SolrResponseDto . class ) ; org . easymock . EasyMock . expect ( mockSolrResponseDto . getFeature_id ( ) ) . andReturn ( 123456L ) ; org . easymock . EasyMock . expect ( mockSolrResponseDto . getFully_qualified_name ( ) ) . andReturn ( fullyQualifedName ) ; org . easymock . EasyMock . replay ( mockSolrResponseDto ) ; results . add ( mockSolrResponseDto ) ; org . easymock . EasyMock . replay ( mockResultDTO ) ; org . easymock . EasyMock . expect ( mockSearchEngine . executeQuery ( ( ( com . gisgraphy . fulltext . FulltextQuery ) ( org . easymock . EasyMock . anyObject ( ) ) ) ) ) . andReturn ( mockResultDTO ) ; org . easymock . EasyMock . replay ( mockSearchEngine ) ; action . execute ( ) ; "<AssertPlaceHolder>" ; } getPreferedName ( ) { if ( ( result ) == null ) { return "" ; } else { java . lang . String prefered = "" ; if ( ! ( org . apache . commons . lang . StringUtils . isEmpty ( result . getLabel ( ) ) ) ) { prefered = result . getLabel ( ) ; } else if ( ! ( org . apache . commons . lang . StringUtils . isEmpty ( result . getName ( ) ) ) ) { prefered = result . getName ( ) ; } else if ( ! ( org . apache . commons . lang . StringUtils . isEmpty ( result . getStreetRef ( ) ) ) ) { prefered = result . getStreetRef ( ) ; } else { prefered = getText ( com . gisgraphy . webapp . action . DisplayStreetAction . GLOBAL_STREET_NONAME ) ; } return prefered ; } }
|
org . junit . Assert . assertEquals ( fullyQualifedName , action . getPreferedName ( ) )
|
getEncountersByVisit_shouldIncludeVoidedEncountersWhenIncludeVoidedIsTrue ( ) { java . util . List < org . openmrs . Encounter > encounters = org . openmrs . api . context . Context . getEncounterService ( ) . getEncountersByVisit ( new org . openmrs . Visit ( 1 ) , true ) ; "<AssertPlaceHolder>" ; } size ( ) { return getMemberships ( ) . stream ( ) . filter ( ( m ) -> ! ( m . getVoided ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( 2 , encounters . size ( ) )
|
testUserIdActorConnector ( ) { org . foxbpm . engine . impl . identity . Authentication . setAuthenticatedUserId ( "a" ) ; runtimeService . startProcessInstanceByKey ( "UserIdActorConnectorTest_1" ) ; org . foxbpm . engine . task . Task task = taskService . createTaskQuery ( ) . processDefinitionKey ( "UserIdActorConnectorTest_1" ) . taskNotEnd ( ) . singleResult ( ) ; "<AssertPlaceHolder>" ; } getAssignee ( ) { return assignee ; }
|
org . junit . Assert . assertEquals ( "a" , task . getAssignee ( ) )
|
testSampledBetweennessCentralityStream ( ) { org . neo4j . graphdb . Result result = org . neo4j . graphalgo . algo . EmptyGraphIntegrationTest . db . execute ( ( ( "CALL<sp>algo.betweenness.sampled.stream('',<sp>'',<sp>{graph:'" + ( graphImpl ) ) + "'})" ) ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( offset ) < ( nodeCount ) ; }
|
org . junit . Assert . assertFalse ( result . hasNext ( ) )
|
testGetParametersWithDefaultEntityAndDisabledStatus ( ) { unit . setActive ( false ) ; org . lnu . is . domain . person . type . PersonType entity = new org . lnu . is . domain . person . type . PersonType ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "userGroups" , groups ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testReportPoller ( ) { com . cloudera . flume . conf . SourceFactory . SourceBuilder bld = com . cloudera . flume . core . PollingSource . reporterPollBuilder ( ) ; com . cloudera . flume . core . EventSource src = bld . build ( "50" ) ; com . cloudera . flume . core . EventSink snk = new com . cloudera . flume . core . CompositeSink ( new com . cloudera . flume . conf . ReportTestingContext ( ) , "[<sp>console<sp>,<sp>counter(\"count\")<sp>]" ) ; src . open ( ) ; snk . open ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { com . cloudera . flume . core . Event e = src . next ( ) ; snk . append ( e ) ; } snk . close ( ) ; src . close ( ) ; com . cloudera . flume . reporter . aggregator . CounterSink cnt = ( ( com . cloudera . flume . reporter . aggregator . CounterSink ) ( com . cloudera . flume . reporter . ReportManager . get ( ) . getReportable ( "count" ) ) ) ; "<AssertPlaceHolder>" ; } getCount ( ) { return cnt . get ( ) ; }
|
org . junit . Assert . assertEquals ( 10 , cnt . getCount ( ) )
|
testJarInvalid ( ) { final java . io . File txt = folder . newFile ( "refs.txt" ) ; txt . delete ( ) ; final java . lang . String args = ( ( "-wt<sp>" + ( txt . getAbsolutePath ( ) ) ) + "<sp>-jar<sp>" ) + ( thinJar . getAbsolutePath ( ) ) ; org . openimaj . util . processes . JavaProcess . runProcess ( org . openimaj . tools . ReferencesTool . class , args ) ; "<AssertPlaceHolder>" ; } runProcess ( java . lang . Class , java . lang . String [ ] ) { final org . openimaj . util . processes . JavaProcess . ProcessOptions opts = new org . openimaj . util . processes . JavaProcess . ProcessOptions ( clz ) ; opts . setArgs ( args ) ; org . openimaj . util . processes . JavaProcess . runProcess ( opts ) ; }
|
org . junit . Assert . assertTrue ( ( ! ( txt . exists ( ) ) ) )
|
testCompareToEqualTo ( ) { au . gov . ga . earthsci . core . temporal . timescale . BasicTimeScaleLevel l1 = new au . gov . ga . earthsci . core . temporal . timescale . BasicTimeScaleLevel ( "name1" , "description1" , java . math . BigInteger . TEN , 1 ) ; au . gov . ga . earthsci . core . temporal . timescale . BasicTimeScaleLevel l2 = new au . gov . ga . earthsci . core . temporal . timescale . BasicTimeScaleLevel ( "name2" , "description2" , java . math . BigInteger . ONE , 1 ) ; "<AssertPlaceHolder>" ; } compareTo ( au . gov . ga . earthsci . common . ui . color . ColorMapEditor$Marker ) { return ( o . zIndex ) - ( zIndex ) ; }
|
org . junit . Assert . assertTrue ( ( ( l1 . compareTo ( l2 ) ) == 0 ) )
|
testNullAuthor ( ) { nl . topicus . bitbucket . persistence . WebHookConfiguration dummyConfiguration = createDummyConfiguration ( ) ; dummyConfiguration . setCommittersToIgnore ( "foo" ) ; nl . topicus . bitbucket . api . PushEventService pushEventService = new nl . topicus . bitbucket . api . PushEventService ( dummyConfiguration ) ; nl . topicus . bitbucket . events . BitbucketPushEvent dummyEvent = createDummyEvent ( ) ; dummyEvent . setActor ( null ) ; com . google . common . collect . ImmutableList < nl . topicus . bitbucket . events . BitbucketPushChange > changes = com . google . common . collect . ImmutableList . of ( createDummyChange ( "feature/foo" ) , createDummyChange ( "bar" ) ) ; dummyEvent . getPush ( ) . setChanges ( changes ) ; "<AssertPlaceHolder>" ; } isValidEvent ( nl . topicus . bitbucket . events . Event , nl . topicus . bitbucket . persistence . WebHookConfiguration ) { return ( ! ( event instanceof nl . topicus . bitbucket . events . Ignorable ) ) || ( ! ( isIgnoredEvent ( ( ( nl . topicus . bitbucket . events . Ignorable ) ( event ) ) , configuration ) ) ) ; }
|
org . junit . Assert . assertThat ( pushEventService . isValidEvent ( dummyEvent , dummyConfiguration ) , org . hamcrest . Matchers . is ( true ) )
|
whenCustomDeserialize_thenCorrect ( ) { final java . lang . String jsonInput = "{\"imdbId\":\"tt0472043\",\"actors\":" + ( "[{\"imdbId\":\"nm2199632\",\"dateOfBirth\":\"1982-09-21T12:00:00+01:00\",\"filmography\":" + "[\"Apocalypto\",\"Beatdown\",\"Wind<sp>Walkers\"]}]}" ) ; final com . google . gson . Gson gson = new com . google . gson . GsonBuilder ( ) . registerTypeAdapter ( org . baeldung . gson . entities . ActorGson . class , new org . baeldung . gson . serialization . ActorGsonDeserializer ( ) ) . create ( ) ; final org . baeldung . gson . entities . Movie outputMovie = gson . fromJson ( jsonInput , org . baeldung . gson . entities . Movie . class ) ; final java . lang . String expectedOutput = "Movie<sp>[imdbId=tt0472043,<sp>director=null,<sp>actors=[ActorGson<sp>[imdbId=nm2199632,<sp>dateOfBirth=Tue<sp>Sep<sp>21<sp>11:00:00<sp>GMT<sp>1982,<sp>filmography=[Apocalypto,<sp>Beatdown,<sp>Wind<sp>Walkers]]]]" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( "Movie<sp>[imdbId=" + ( imdbId ) ) + ",<sp>director=" ) + ( director ) ) + ",<sp>actors=" ) + ( actors ) ) + "]" ; }
|
org . junit . Assert . assertEquals ( outputMovie . toString ( ) , expectedOutput )
|
testValue ( ) { java . lang . String str = "hello<sp>world" ; java . lang . Boolean ret = null ; try { ret = proxy . < java . lang . Boolean > call ( "generic" , str ) . get ( ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Call<sp>Error<sp>must<sp>not<sp>be<sp>thrown<sp>:<sp>" + ( e . getMessage ( ) ) ) ) ; } "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( ret )
|
getSetIgnoreSSLCert ( ) { com . aliyuncs . http . CompositeX509TrustManager trustManager = new com . aliyuncs . http . CompositeX509TrustManager ( java . util . Collections . < javax . net . ssl . X509TrustManager > emptyList ( ) ) ; trustManager . setIgnoreSSLCert ( true ) ; "<AssertPlaceHolder>" ; } isIgnoreSSLCert ( ) { return ignoreSSLCert ; }
|
org . junit . Assert . assertTrue ( trustManager . isIgnoreSSLCert ( ) )
|
testGetCollectionsSharedWithMe ( ) { java . util . List < com . ibm . sbt . services . client . connections . cmisfiles . CMISFile > fileEntries = fileService . getCollectionsSharedWithMe ( ) ; if ( ( fileEntries != null ) && ( ! ( fileEntries . isEmpty ( ) ) ) ) { for ( com . ibm . sbt . services . client . connections . cmisfiles . CMISFile fEntry : fileEntries ) { "<AssertPlaceHolder>" ; } } } getTitle ( ) { return dataHandler . getAsString ( AtomXPath . title ) ; }
|
org . junit . Assert . assertNotNull ( fEntry . getTitle ( ) )
|
testGetKeyName ( ) { org . pentaho . hbase . shim . api . Mapping mapping = getMapping ( ) ; mapping . m_keyName = "test" ; "<AssertPlaceHolder>" ; } getKeyName ( ) { return m_keyName ; }
|
org . junit . Assert . assertEquals ( "test" , mapping . getKeyName ( ) )
|
shouldChangeConceptAnswerReferenceToParentConcept ( ) { org . openmrs . Concept c = new org . openmrs . Concept ( 123 ) ; c . addAnswer ( new org . openmrs . ConceptAnswer ( 1 ) ) ; c . addAnswer ( new org . openmrs . ConceptAnswer ( 2 ) ) ; org . openmrs . ConceptNumeric cn = new org . openmrs . ConceptNumeric ( c ) ; for ( org . openmrs . ConceptAnswer cAnswer : cn . getAnswers ( ) ) { "<AssertPlaceHolder>" ; } } getConcept ( ) { return concept ; }
|
org . junit . Assert . assertSame ( cn , cAnswer . getConcept ( ) )
|
licenseEntriesForUserByContentId ( ) { try { java . lang . String encryptedContentId = getDynamicEncryptedString ( sernet . verinice . service . test . LicenseManagementTier3Test . CONTENT_ID , sernet . verinice . service . test . LicenseManagementTier3Test . cryptoPassword . toCharArray ( ) , sernet . verinice . service . test . LicenseManagementTier3Test . cryptoSalt ) ; int count = 0 ; for ( sernet . verinice . model . licensemanagement . LicenseManagementEntry entry : licenseManagementService . getExistingLicenses ( ) ) { java . lang . String plainContentId = licenseManagementService . decrypt ( entry , LicenseManagementEntry . COLUMN_CONTENTID ) ; if ( sernet . verinice . service . test . LicenseManagementTier3Test . CONTENT_ID . equals ( plainContentId ) ) { java . lang . String plainLicenseId = licenseManagementService . decrypt ( entry , LicenseManagementEntry . COLUMN_LICENSEID ) ; licenseManagementService . addLicenseIdAuthorisation ( getConfiguration ( sernet . verinice . service . test . LicenseManagementTier3Test . TEST_USERNAME ) , plainLicenseId ) ; count ++ ; } } java . util . Set < sernet . verinice . model . licensemanagement . LicenseManagementEntry > entriesForUser = licenseManagementService . getLicenseEntriesForUserByContentId ( sernet . verinice . service . test . LicenseManagementTier3Test . TEST_USERNAME , encryptedContentId ) ; "<AssertPlaceHolder>" ; } catch ( sernet . verinice . model . licensemanagement . LicenseManagementException e ) { sernet . verinice . service . test . LicenseManagementTier3Test . LOG . error ( ( ( ( "Something<sp>went<sp>wrong<sp>getting<sp>licenseEntries<sp>for<sp>user:\t" + ( sernet . verinice . service . test . LicenseManagementTier3Test . TEST_USERNAME ) ) + "and<sp>contentId:\t" ) + ( sernet . verinice . service . test . LicenseManagementTier3Test . CONTENT_ID ) ) ) ; } catch ( sernet . verinice . interfaces . CommandException e ) { sernet . verinice . service . test . LicenseManagementTier3Test . LOG . error ( ( ( "Something<sp>went<sp>wrong<sp>with<sp>assigning<sp>a<sp>licenseId<sp>to<sp>" + "user:\t" ) + ( sernet . verinice . service . test . LicenseManagementTier3Test . TEST_USERNAME ) ) ) ; } } size ( ) { return objectList . size ( ) ; }
|
org . junit . Assert . assertTrue ( ( ( entriesForUser . size ( ) ) == count ) )
|
testGetWikiPage ( ) { System . out . println ( "getWikiPage" ) ; kg . apc . jmeter . vizualizers . SynthesisReportGui instance = new kg . apc . jmeter . vizualizers . SynthesisReportGui ( ) ; java . lang . String expResult = "SynthesisReport" ; java . lang . String result = instance . getWikiPage ( ) ; "<AssertPlaceHolder>" ; } getWikiPage ( ) { return "ResponseCodesPerSecond" ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
getName ( ) { java . lang . String name = new org . apache . mina . session . AttributeKey < java . lang . Number > ( org . apache . mina . session . Number . class , "keyName" ) . getName ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { java . lang . String name = new org . apache . mina . session . AttributeKey < java . lang . Number > ( org . apache . mina . session . Number . class , "keyName" ) . getName ( ) ; org . junit . Assert . assertThat ( name , org . hamcrest . CoreMatchers . is ( "keyName" ) ) ; }
|
org . junit . Assert . assertThat ( name , org . hamcrest . CoreMatchers . is ( "keyName" ) )
|
defaultTlsVersionJdk18ShouldTakePrefered ( ) { java . lang . String [ ] supportedProtocols = new java . lang . String [ ] { "SSLv2Hello" , "SSLv3" , "TLSv1" , "TLSv1.1" , "TLSv1.2" } ; java . lang . String tlsProtocol = com . rabbitmq . client . ConnectionFactory . computeDefaultTlsProtocol ( supportedProtocols ) ; "<AssertPlaceHolder>" ; } computeDefaultTlsProtocol ( java . lang . String [ ] ) { if ( supportedProtocols != null ) { for ( java . lang . String supportedProtocol : supportedProtocols ) { if ( com . rabbitmq . client . ConnectionFactory . PREFERRED_TLS_PROTOCOL . equalsIgnoreCase ( supportedProtocol ) ) { return supportedProtocol ; } } } return com . rabbitmq . client . ConnectionFactory . FALLBACK_TLS_PROTOCOL ; }
|
org . junit . Assert . assertEquals ( "TLSv1.2" , tlsProtocol )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.