input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testMainNoConfig ( ) { java . lang . System . setProperty ( "config" , "config.properties" ) ; final java . lang . String [ ] args = new java . lang . String [ ] { } ; nl . moderniseringgba . migratie . controle . runtime . Main . setSpringConfig ( "classpath:controle-beans-test.xml" ) ; try { nl . moderniseringgba . migratie . controle . runtime . Main . main ( args ) ; org . junit . Assert . fail ( "Er<sp>had<sp>een<sp>IllegalArgumentException<sp>op<sp>moeten<sp>treden." ) ; } catch ( final java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } main ( java . lang . String [ ] ) { final java . lang . String configFileProperty = java . lang . System . getProperty ( "config" ) ; final boolean doesConfigFileExist = ( configFileProperty != null ) && ( new java . io . File ( configFileProperty ) . exists ( ) ) ; nl . moderniseringgba . migratie . controle . runtime . Main . LOG . info ( ( ( ( "Using<sp>config<sp>file:<sp>" + configFileProperty ) + "<sp>Exists?<sp>" ) + doesConfigFileExist ) ) ; if ( ! doesConfigFileExist ) { throw new java . lang . IllegalArgumentException ( "Config<sp>file<sp>kan<sp>niet<sp>worden<sp>gelezen." ) ; } final nl . moderniseringgba . migratie . controle . rapport . Opties opties = nl . moderniseringgba . migratie . controle . runtime . OptionsUtils . parseOpties ( args ) ; nl . moderniseringgba . migratie . controle . runtime . Main . LOG . info ( "Starting<sp>application<sp>context" ) ; final org . springframework . context . ConfigurableApplicationContext context = new org . springframework . context . support . ClassPathXmlApplicationContext ( nl . moderniseringgba . migratie . controle . runtime . Main . springConfig . split ( "," ) ) ; final nl . moderniseringgba . migratie . controle . ControleService controleService = ( ( nl . moderniseringgba . migratie . controle . ControleService ) ( context . getBean ( "controleServiceImpl" ) ) ) ; final nl . moderniseringgba . migratie . controle . SelectieService selectieService = ( ( nl . moderniseringgba . migratie . controle . SelectieService ) ( context . getBean ( "selectieServiceImpl" ) ) ) ; final nl . moderniseringgba . migratie . controle . rapport . ControleRapport controleRapport = new nl . moderniseringgba . migratie . controle . rapport . ControleRapport ( ) ; final java . util . Set < java . lang . Long > anummers = selectieService . selecteerPLen ( opties , controleRapport ) ; controleService . controleerPLen ( new java . util . ArrayList < java . lang . Long > ( anummers ) , opties , controleRapport ) ; nl . moderniseringgba . migratie . controle . runtime . Main . LOG . info ( controleRapport . formatRapport ( ) ) ; nl . moderniseringgba . migratie . controle . runtime . Main . LOG . info ( "Controle<sp>klaar." ) ; } | org . junit . Assert . assertTrue ( ( e instanceof java . lang . IllegalArgumentException ) ) |
testputandget ( ) { geodeStore . put ( "test4_abc" , "123" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { java . lang . Object primaryVal = primary . get ( key ) ; if ( primaryVal != null ) { if ( primaryVal == ( org . apache . apex . malhar . contrib . enrich . NullValuesCacheManager . NULL ) ) { return null ; } return primaryVal ; } java . lang . Object backupVal = backup . get ( key ) ; if ( backupVal != null ) { primary . put ( key , backupVal ) ; } else { primary . put ( key , org . apache . apex . malhar . contrib . enrich . NullValuesCacheManager . NULL ) ; } return backupVal ; } | org . junit . Assert . assertEquals ( "123" , geodeStore . get ( "test4_abc" ) ) |
shouldConsumeMultipleTokensWithAnyValueConstant ( ) { makeCaseInsensitive ( ) ; tokens . consume ( "SELECT" , "ALL" , TokenStream . ANY_VALUE ) ; tokens . consume ( "FROM" , "THIS" , "TABLE" ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( index ) < ( size ) ; } | org . junit . Assert . assertThat ( tokens . hasNext ( ) , org . hamcrest . core . Is . is ( false ) ) |
testCount ( ) { org . apache . uima . collection . CollectionReader cr = ch . epfl . bbp . uima . cr . PubmedCentralCollectionReader . getCR ( "pmc_test_archive" ) ; int i = 0 ; while ( cr . hasNext ( ) ) { org . apache . uima . cas . CAS cas = org . apache . uima . util . CasCreationUtils . createCas ( cr . getProcessingResourceMetaData ( ) ) ; cr . getNext ( cas ) ; i ++ ; } cr . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { for ( org . apache . uima . collection . CollectionReader reader : readers ) { reader . close ( ) ; } } | org . junit . Assert . assertEquals ( 6 , i ) |
sendHasCorrectHttpsMethod ( ) { final com . microsoft . azure . sdk . iot . service . transport . http . HttpMethod expectedMethod = com . microsoft . azure . sdk . iot . service . transport . http . HttpMethod . GET ; final byte [ ] body = new byte [ 0 ] ; new tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . MockUp < com . microsoft . azure . sdk . iot . service . transport . http . HttpConnection > ( ) { com . microsoft . azure . sdk . iot . service . transport . http . HttpMethod testMethod ; @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public void $init ( java . net . URL url , com . microsoft . azure . sdk . iot . service . transport . http . HttpMethod method ) { this . testMethod = method ; } @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public void connect ( ) throws java . io . IOException { "<AssertPlaceHolder>" ; } @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public void setRequestMethod ( com . microsoft . azure . sdk . iot . service . transport . http . HttpMethod method ) { this . testMethod = method ; } @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public void setRequestHeader ( java . lang . String field , java . lang . String value ) { } @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public void writeOutput ( byte [ ] body ) { } @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public byte [ ] readInput ( ) throws java . io . IOException { return new byte [ 0 ] ; } @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public byte [ ] readError ( ) throws java . io . IOException { return new byte [ 0 ] ; } @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public int getResponseStatus ( ) throws java . io . IOException { return 0 ; } @ tests . unit . com . microsoft . azure . sdk . iot . service . transport . http . Mock public java . util . Map < java . lang . String , java . util . List < java . lang . String > > getResponseHeaders ( ) throws java . io . IOException { return new java . util . HashMap ( ) ; } } ; com . microsoft . azure . sdk . iot . service . transport . http . HttpRequest request = new com . microsoft . azure . sdk . iot . service . transport . http . HttpRequest ( new java . net . URL ( "http://www.microsoft.com" ) , expectedMethod , body ) ; request . send ( ) ; } connect ( ) { if ( ( this . body . length ) > 0 ) { this . connection . setDoOutput ( true ) ; this . connection . getOutputStream ( ) . write ( this . body ) ; } this . connection . connect ( ) ; } | org . junit . Assert . assertThat ( testMethod , org . hamcrest . CoreMatchers . is ( expectedMethod ) ) |
testProcessImgTagWithAttributesAndSimpleImageURL ( ) { com . liferay . document . library . document . conversion . internal . DocumentHTMLProcessor documentHTMLProcessor = new com . liferay . document . library . document . conversion . internal . DocumentHTMLProcessor ( ) ; java . lang . String originalHTML = com . liferay . petra . string . StringBundler . concat ( "<html><head><title>test-title</title></head><body>" , "<img<sp>class=\"test\"<sp>src=\"/image" , "/image_gallery?uuid=f17b2a6b-70ee-4121-ae6e-61c22ff47" , "&groupId=807138&t=12798459506\"/></body></html>" ) ; java . io . InputStream originalIS = new java . io . ByteArrayInputStream ( originalHTML . getBytes ( ) ) ; java . io . InputStream processedIS = documentHTMLProcessor . process ( originalIS ) ; java . lang . String processedHTML = org . apache . commons . io . IOUtils . toString ( processedIS , "UTF-8" ) ; java . lang . String expectedHTML = com . liferay . petra . string . StringBundler . concat ( "<html><head><title>test-title</title></head><body>" , "<img<sp>class=\"test\"<sp>src=\"/image" , "/image_gallery?uuid=f17b2a6b-70ee-4121-ae6e-61c22ff47" , "&groupId=807138&t=12798459506&auth_token=authtoken\"/>" , "</body></html>" ) ; "<AssertPlaceHolder>" ; } toString ( java . lang . String , java . lang . String ) { org . xml . sax . XMLReader xmlReader = null ; if ( ( com . liferay . portal . kernel . security . xml . SecureXMLFactoryProviderUtil . getSecureXMLFactoryProvider ( ) ) != null ) { xmlReader = com . liferay . portal . kernel . security . xml . SecureXMLFactoryProviderUtil . newXMLReader ( ) ; } org . dom4j . io . SAXReader saxReader = new org . dom4j . io . SAXReader ( xmlReader ) ; org . dom4j . Document document = saxReader . read ( new com . liferay . portal . kernel . io . unsync . UnsyncStringReader ( xml ) ) ; return com . liferay . petra . xml . Dom4jUtil . toString ( document , indent ) ; } | org . junit . Assert . assertEquals ( expectedHTML , processedHTML ) |
testEncryptionPlusSig ( ) { wsIn . setProperty ( ConfigurationConstants . ACTION , ( ( ( org . apache . wss4j . common . ConfigurationConstants . ENCRYPT ) + "<sp>" ) + ( org . apache . wss4j . common . ConfigurationConstants . SIGNATURE ) ) ) ; wsOut . setProperty ( ConfigurationConstants . ACTION , ( ( ( org . apache . wss4j . common . ConfigurationConstants . ENCRYPT ) + "<sp>" ) + ( org . apache . wss4j . common . ConfigurationConstants . SIGNATURE ) ) ) ; "<AssertPlaceHolder>" ; } echo ( int ) { return i ; } | org . junit . Assert . assertEquals ( "test" , echo . echo ( "test" ) ) |
testPatchRemovesParentLink ( ) { com . vmware . admiral . compute . container . network . ContainerNetworkDescriptionService . ContainerNetworkDescription containerNetworkDescription = createContainerNetworkDescription ( ) ; containerNetworkDescription . parentDescriptionLink = "parent" ; containerNetworkDescription = doPost ( containerNetworkDescription , ContainerNetworkDescriptionService . FACTORY_LINK ) ; containerNetworkDescription . parentDescriptionLink = "" ; com . vmware . admiral . compute . container . network . ContainerNetworkDescriptionService . ContainerNetworkDescription patch = doPatch ( containerNetworkDescription , containerNetworkDescription . documentSelfLink ) ; "<AssertPlaceHolder>" ; } doPatch ( java . lang . Object , java . lang . String ) { com . vmware . xenon . common . test . TestContext ctx = testCreate ( 1 ) ; com . vmware . xenon . common . Operation patch = com . vmware . xenon . common . Operation . createPatch ( host , documentSelfLink ) . setBody ( state ) . setReferer ( host . getUri ( ) ) . setCompletion ( ( o , ex ) -> { if ( ex != null ) { ctx . failIteration ( ex ) ; return ; } ctx . completeIteration ( ) ; } ) ; host . send ( patch ) ; ctx . await ( ) ; } | org . junit . Assert . assertEquals ( null , patch . parentDescriptionLink ) |
testInstantaitionOfPackagePrivateClass ( ) { hu . elte . txtuml . utils . InstanceCreatorTests . PackagePrivateTestClass inst = hu . elte . txtuml . utils . InstanceCreator . create ( hu . elte . txtuml . utils . InstanceCreatorTests . PackagePrivateTestClass . class ) ; "<AssertPlaceHolder>" ; } create ( java . lang . String ) { return new hu . elte . txtuml . api . model . execution . impl . DefaultModelExecutor ( name ) ; } | org . junit . Assert . assertTrue ( ( inst != null ) ) |
testFormat ( ) { final java . lang . String p = com . sun . mail . util . logging . CompactFormatter . class . getName ( ) ; com . sun . mail . util . logging . Properties props = new com . sun . mail . util . logging . Properties ( ) ; props . put ( p . concat ( ".format" ) , "%9$s" ) ; java . util . logging . LogManager manager = java . util . logging . LogManager . getLogManager ( ) ; try { read ( manager , props ) ; com . sun . mail . util . logging . CompactFormatter cf = new com . sun . mail . util . logging . CompactFormatter ( ) ; java . util . logging . LogRecord first = new java . util . logging . LogRecord ( java . util . logging . Level . SEVERE , Level . INFO . getName ( ) ) ; first . setSequenceNumber ( Short . MAX_VALUE ) ; java . lang . String result = cf . format ( first ) ; "<AssertPlaceHolder>" ; } finally { manager . reset ( ) ; } } format ( java . util . logging . LogRecord ) { java . lang . String data = format . format ( record ) ; footer . format ( record ) ; return data ; } | org . junit . Assert . assertEquals ( java . lang . String . valueOf ( ( ( int ) ( Short . MAX_VALUE ) ) ) , result ) |
testEmpty ( ) { net . hydromatic . optiq . test . OptiqAssert . that ( ) . with ( OptiqAssert . Config . JDBC_FOODMART ) . doWithConnection ( new net . hydromatic . linq4j . function . Function1 < net . hydromatic . optiq . jdbc . OptiqConnection , java . lang . Object > ( ) { public java . lang . Object apply ( net . hydromatic . optiq . jdbc . OptiqConnection a0 ) { try { java . sql . ResultSet rset = a0 . getMetaData ( ) . getPrimaryKeys ( null , null , "sales_fact_1997" ) ; "<AssertPlaceHolder>" ; } catch ( java . sql . SQLException e ) { throw new java . lang . RuntimeException ( e ) ; } return null ; } } ) ; } next ( ) { return enumeration . nextElement ( ) ; } | org . junit . Assert . assertFalse ( rset . next ( ) ) |
testCorrectedReceivedAgeIsApparentAgeIfLarger ( ) { final org . apache . hc . core5 . http . Header [ ] headers = new org . apache . hc . core5 . http . Header [ ] { new org . apache . hc . core5 . http . message . BasicHeader ( "Age" , "6" ) } ; final org . apache . hc . client5 . http . cache . HttpCacheEntry entry = org . apache . hc . client5 . http . impl . cache . HttpTestUtils . makeCacheEntry ( headers ) ; impl = new org . apache . hc . client5 . http . impl . cache . CacheValidityPolicy ( ) { @ org . apache . hc . client5 . http . impl . cache . Override protected long getApparentAgeSecs ( final org . apache . hc . client5 . http . cache . HttpCacheEntry ent ) { return 10 ; } } ; "<AssertPlaceHolder>" ; } getCorrectedReceivedAgeSecs ( org . apache . hc . client5 . http . cache . HttpCacheEntry ) { return 7 ; } | org . junit . Assert . assertEquals ( 10 , impl . getCorrectedReceivedAgeSecs ( entry ) ) |
testAdministratorRolePermissionFilter ( ) { _user = com . liferay . portal . kernel . test . util . UserTestUtil . addOmniAdminUser ( ) ; com . liferay . portal . kernel . security . permission . PermissionThreadLocal . setPermissionChecker ( com . liferay . portal . kernel . security . permission . PermissionCheckerFactoryUtil . create ( _user ) ) ; com . liferay . portal . kernel . search . filter . BooleanFilter booleanFilter = getBooleanFilter ( null ) ; "<AssertPlaceHolder>" ; } hasClauses ( ) { if ( ! ( _filterQueryClauses . isEmpty ( ) ) ) { return true ; } if ( ! ( _mustQueryClauses . isEmpty ( ) ) ) { return true ; } if ( ! ( _mustNotQueryClauses . isEmpty ( ) ) ) { return true ; } if ( ! ( _shouldQueryClauses . isEmpty ( ) ) ) { return true ; } return false ; } | org . junit . Assert . assertFalse ( booleanFilter . hasClauses ( ) ) |
testRegexText3 ( ) { java . lang . String query = "([a-zA-Z])+o[a-z]a[a-z]o" ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > exactResults = edu . uci . ics . texera . dataflow . regexmatcher . RegexMatcherTestHelper . getQueryResults ( edu . uci . ics . texera . dataflow . regexmatcher . RegexMatcherTest . TEXT_TABLE , query , java . util . Arrays . asList ( RegexTestConstantsText . CONTENT ) ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > expectedResults = new java . util . ArrayList < edu . uci . ics . texera . api . tuple . Tuple > ( ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > data = edu . uci . ics . texera . dataflow . regexmatcher . RegexTestConstantsText . getSampleTextTuples ( ) ; edu . uci . ics . texera . api . schema . Schema spanSchema = new edu . uci . ics . texera . api . schema . Schema . Builder ( ) . add ( RegexTestConstantsText . SCHEMA_TEXT ) . add ( edu . uci . ics . texera . dataflow . regexmatcher . RegexMatcherTest . RESULTS , AttributeType . LIST ) . build ( ) ; java . util . List < edu . uci . ics . texera . api . span . Span > spans = new java . util . ArrayList < edu . uci . ics . texera . api . span . Span > ( ) ; spans . add ( new edu . uci . ics . texera . api . span . Span ( RegexTestConstantsText . CONTENT , 0 , 6 , query , "Tomato" ) ) ; spans . add ( new edu . uci . ics . texera . api . span . Span ( RegexTestConstantsText . CONTENT , 94 , 100 , query , "tomato" ) ) ; edu . uci . ics . texera . api . field . IField spanField = new edu . uci . ics . texera . api . field . ListField < edu . uci . ics . texera . api . span . Span > ( new java . util . ArrayList < edu . uci . ics . texera . api . span . Span > ( spans ) ) ; java . util . List < edu . uci . ics . texera . api . field . IField > fields = new java . util . ArrayList < edu . uci . ics . texera . api . field . IField > ( data . get ( 7 ) . getFields ( ) ) ; fields . add ( spanField ) ; expectedResults . add ( new edu . uci . ics . texera . api . tuple . Tuple ( spanSchema , fields . toArray ( new edu . uci . ics . texera . api . field . IField [ fields . size ( ) ] ) ) ) ; spans . clear ( ) ; spans . add ( new edu . uci . ics . texera . api . span . Span ( RegexTestConstantsText . CONTENT , 0 , 6 , query , "Potato" ) ) ; spanField = new edu . uci . ics . texera . api . field . ListField < edu . uci . ics . texera . api . span . Span > ( new java . util . ArrayList < edu . uci . ics . texera . api . span . Span > ( spans ) ) ; fields = new java . util . ArrayList < edu . uci . ics . texera . api . field . IField > ( data . get ( 8 ) . getFields ( ) ) ; fields . add ( spanField ) ; expectedResults . add ( new edu . uci . ics . texera . api . tuple . Tuple ( spanSchema , fields . toArray ( new edu . uci . ics . texera . api . field . IField [ fields . size ( ) ] ) ) ) ; spans . clear ( ) ; spans . add ( new edu . uci . ics . texera . api . span . Span ( RegexTestConstantsText . CONTENT , 53 , 60 , query , "avocado" ) ) ; spanField = new edu . uci . ics . texera . api . field . ListField < edu . uci . ics . texera . api . span . Span > ( new java . util . ArrayList < edu . uci . ics . texera . api . span . Span > ( spans ) ) ; fields = new java . util . ArrayList < edu . uci . ics . texera . api . field . IField > ( data . get ( 9 ) . getFields ( ) ) ; fields . add ( spanField ) ; expectedResults . add ( new edu . uci . ics . texera . api . tuple . Tuple ( spanSchema , fields . toArray ( new edu . uci . ics . texera . api . field . IField [ fields . size ( ) ] ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . util . List , java . util . List ) { expectedResults = Tuple . Builder . removeIfExists ( expectedResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; exactResults = Tuple . Builder . removeIfExists ( exactResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; if ( ( expectedResults . size ( ) ) != ( exactResults . size ( ) ) ) return false ; return ( expectedResults . containsAll ( exactResults ) ) && | org . junit . Assert . assertTrue ( edu . uci . ics . texera . api . utils . TestUtils . equals ( expectedResults , exactResults ) ) |
removeStyleAttribute ( ) { com . vaadin . flow . dom . Element element = com . vaadin . flow . dom . ElementFactory . createDiv ( ) ; com . vaadin . flow . dom . Style style = element . getStyle ( ) ; style . set ( "border" , "1px<sp>solid<sp>green" ) ; element . removeAttribute ( "style" ) ; "<AssertPlaceHolder>" ; } getNames ( ) { return propertyMap . getPropertyNames ( ) ; } | org . junit . Assert . assertEquals ( 0 , style . getNames ( ) . count ( ) ) |
shouldGetAssignmentsWithoutHours ( ) { java . util . List < net . rrm . ehour . persistence . report . dao . ProjectAssignment > assignments = reportAggregatedDAO . getAssignmentsWithoutBookings ( net . rrm . ehour . persistence . report . dao . ReportAggregatedDaoHibernateImplTest . OCT_1_TO_4 ) ; java . util . List < java . lang . Integer > assignmentIds = net . rrm . ehour . util . DomainUtil . getIdsFromDomainObjects ( assignments ) ; java . util . Collections . sort ( assignmentIds ) ; "<AssertPlaceHolder>" ; } getIdsFromDomainObjects ( java . util . Collection ) { java . util . List < PK > pks = com . google . common . collect . Lists . newArrayList ( ) ; if ( domainObjects == null ) { return pks ; } for ( net . rrm . ehour . domain . DomainObject < PK , ? > domainObject : domainObjects ) { pks . add ( domainObject . getPK ( ) ) ; } return pks ; } | org . junit . Assert . assertArrayEquals ( new java . lang . Integer [ ] { 3 , 6 , 10 } , assignmentIds . toArray ( ) ) |
isOnlyNameChanged_True ( ) { org . oscm . internal . vo . VOTriggerDefinition voTriggerDefinition = new org . oscm . internal . vo . VOTriggerDefinition ( ) ; voTriggerDefinition . setName ( "name1" ) ; voTriggerDefinition . setTarget ( "target" ) ; voTriggerDefinition . setTargetType ( TriggerTargetType . WEB_SERVICE ) ; voTriggerDefinition . setType ( TriggerType . ACTIVATE_SERVICE ) ; org . oscm . domobjects . TriggerDefinition triggerDefinition = new org . oscm . domobjects . TriggerDefinition ( ) ; triggerDefinition . setName ( "name2" ) ; triggerDefinition . setTarget ( "target" ) ; triggerDefinition . setTargetType ( TriggerTargetType . WEB_SERVICE ) ; triggerDefinition . setType ( TriggerType . ACTIVATE_SERVICE ) ; boolean result = org . oscm . triggerservice . assembler . TriggerDefinitionAssembler . isOnlyNameChanged ( voTriggerDefinition , triggerDefinition ) ; "<AssertPlaceHolder>" ; } isOnlyNameChanged ( org . oscm . internal . vo . VOTriggerDefinition , org . oscm . domobjects . TriggerDefinition ) { if ( ! ( vo . getTarget ( ) . equals ( triggerDefinition . getTarget ( ) ) ) ) { return false ; } if ( ! ( vo . getTargetType ( ) . equals ( triggerDefinition . getTargetType ( ) ) ) ) { return false ; } if ( ! ( vo . getType ( ) . equals ( triggerDefinition . getType ( ) ) ) ) { return false ; } if ( ( ! ( vo . isSuspendProcess ( ) ) ) && ( triggerDefinition . isSuspendProcess ( ) ) ) { return false ; } if ( ( vo . isSuspendProcess ( ) ) && ( ! ( triggerDefinition . isSuspendProcess ( ) ) ) ) { return false ; } return true ; } | org . junit . Assert . assertTrue ( result ) |
getToClass ( ) { "<AssertPlaceHolder>" ; } getToClass ( ) { org . junit . Assert . assertSame ( org . eclipse . collections . impl . block . factory . Integer . class , org . eclipse . collections . impl . block . factory . Functions . getToClass ( ) . valueOf ( 0 ) ) ; } | org . junit . Assert . assertSame ( org . eclipse . collections . impl . block . factory . Integer . class , org . eclipse . collections . impl . block . factory . Functions . getToClass ( ) . valueOf ( 0 ) ) |
multiplyQuantityTest ( ) { tec . uom . se . quantity . ShortQuantity < javax . measure . quantity . ElectricResistance > quantity1 = new tec . uom . se . quantity . ShortQuantity ( java . lang . Short . valueOf ( "3" ) . shortValue ( ) , tec . uom . se . unit . Units . OHM ) ; tec . uom . se . quantity . ShortQuantity < javax . measure . quantity . ElectricResistance > quantity2 = new tec . uom . se . quantity . ShortQuantity ( java . lang . Short . valueOf ( "2" ) . shortValue ( ) , tec . uom . se . unit . Units . OHM ) ; javax . measure . Quantity < ? > result = quantity1 . multiply ( quantity2 ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( 6 , result . getValue ( ) ) |
testBizDataObject ( ) { org . foxbpm . engine . impl . identity . Authentication . setAuthenticatedUserId ( "admin" ) ; org . foxbpm . engine . impl . task . command . ExpandTaskCommand expandTaskCommand = new org . foxbpm . engine . impl . task . command . ExpandTaskCommand ( ) ; expandTaskCommand . setProcessDefinitionKey ( "TestDataImport_1" ) ; expandTaskCommand . setTaskCommandId ( "HandleCommand_2" ) ; expandTaskCommand . setCommandType ( "startandsubmit" ) ; expandTaskCommand . setBusinessKey ( "admin" ) ; taskService . expandTaskComplete ( expandTaskCommand , null ) ; org . foxbpm . engine . task . TaskQuery taskQuery = taskService . createTaskQuery ( ) ; java . util . List < org . foxbpm . engine . task . Task > taskList = taskQuery . processDefinitionKey ( "TestDataImport_1" ) . list ( ) ; org . foxbpm . engine . task . Task task = null ; for ( org . foxbpm . engine . task . Task t : taskList ) { if ( "UserTask_1" . equals ( t . getNodeId ( ) ) ) { task = t ; break ; } } org . foxbpm . engine . datavariable . VariableQuery variableQuery = runtimeService . createVariableQuery ( ) ; org . foxbpm . engine . datavariable . VariableInstance variableInstance = variableQuery . processInstanceId ( task . getProcessInstanceId ( ) ) . addVariableKey ( "Test" ) . singleResult ( ) ; "<AssertPlaceHolder>" ; } getValueObject ( ) { if ( ( value ) == null ) { return null ; } return org . foxbpm . engine . impl . entity . VariableInstanceEntity . bytesToObject ( value ) ; } | org . junit . Assert . assertEquals ( "admin" , variableInstance . getValueObject ( ) ) |
testLeafRefRelativeAndAbsoluteWithSameTarget ( ) { final org . opendaylight . yangtools . yang . model . api . TypeDefinition < ? > targetNodeForAbsname = getTargetNodeForLeafRef ( "absname" , org . opendaylight . yangtools . yang . model . api . type . InstanceIdentifierTypeDefinition . class ) ; final org . opendaylight . yangtools . yang . model . api . TypeDefinition < ? > targetNodeForRelname = getTargetNodeForLeafRef ( "relname" , org . opendaylight . yangtools . yang . model . api . type . InstanceIdentifierTypeDefinition . class ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( targetNodeForAbsname , targetNodeForRelname ) |
testSuccess ( ) { runner . forBenchmark ( com . google . caliper . runner . instrument . ArbitraryMeasurmentInstrumentTest . TestBenchmark . class ) . instrument ( "arbitrary" ) . run ( ) ; com . google . caliper . model . Measurement measurement = com . google . common . collect . Iterables . getOnlyElement ( com . google . common . collect . Iterables . getOnlyElement ( runner . trials ( ) ) . measurements ( ) ) ; com . google . caliper . model . Measurement expected = new com . google . caliper . model . Measurement . Builder ( ) . description ( "fake<sp>measurment" ) . weight ( 1 ) . value ( com . google . caliper . model . Value . create ( 1.0 , "hz" ) ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { return new com . google . caliper . runner . testing . FakeWorkerSpec ( mainClass , vmOptions , args ) ; } | org . junit . Assert . assertEquals ( expected , measurement ) |
serverErrorMessage ( ) { expected . expect ( com . airhacks . rulz . jaxrsclient . AssertionError . class ) ; expected . expectMessage ( org . hamcrest . CoreMatchers . containsString ( "Internal<sp>server<sp>error(500)" ) ) ; expected . expectMessage ( org . hamcrest . CoreMatchers . containsString ( "OK<sp>200<sp>returned" ) ) ; javax . ws . rs . core . Response response = this . tut . request ( ) . header ( "status" , 200 ) . get ( ) ; "<AssertPlaceHolder>" ; } serverError ( ) { final int statusCode = Response . Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) ; return new org . hamcrest . CustomMatcher < javax . ws . rs . core . Response > ( ( ( "Internal<sp>server<sp>error(" + statusCode ) + ")" ) ) { @ com . airhacks . rulz . jaxrsclient . Override public boolean matches ( java . lang . Object o ) { return ( o instanceof javax . ws . rs . core . Response ) && ( ( ( ( javax . ws . rs . core . Response ) ( o ) ) . getStatus ( ) ) == statusCode ) ; } @ com . airhacks . rulz . jaxrsclient . Override public void describeMismatch ( java . lang . Object item , org . hamcrest . Description description ) { javax . ws . rs . core . Response response = ( ( javax . ws . rs . core . Response ) ( item ) ) ; com . airhacks . rulz . jaxrsclient . HttpMatchers . provideDescription ( response , description ) ; } } ; } | org . junit . Assert . assertThat ( response , org . hamcrest . CoreMatchers . is ( com . airhacks . rulz . jaxrsclient . HttpMatchers . serverError ( ) ) ) |
testSimpleSerializationDeserialization ( ) { java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; map . put ( "key1" , "val1" ) ; map . put ( "key2" , "5" ) ; map . put ( "key3" , "10" ) ; map . put ( "key4" , "1.0" ) ; map . put ( "key5" , "true" ) ; byte [ ] bytes = metadataSerDe . serialize ( map ) ; java . util . Map < java . lang . String , java . lang . String > actualMap = metadataSerDe . deserialize ( bytes ) ; "<AssertPlaceHolder>" ; } deserialize ( byte [ ] ) { java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( bytes ) ; java . io . DataInputStream dis = new java . io . DataInputStream ( bais ) ; java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; try { int count = dis . readInt ( ) ; for ( int j = 0 ; j < count ; j ++ ) { java . lang . String key = dis . readUTF ( ) ; java . lang . String encodedVal = dis . readUTF ( ) ; map . put ( key , encodedVal ) ; } } catch ( java . lang . Exception e ) { } finally { try { bais . close ( ) ; dis . close ( ) ; } catch ( java . io . IOException e ) { } } return map ; } | org . junit . Assert . assertEquals ( map , actualMap ) |
testRollOneDice ( ) { java . util . Random random = org . mockito . Mockito . mock ( java . util . Random . class ) ; org . mockito . Mockito . when ( random . nextInt ( 6 ) ) . thenReturn ( 3 ) ; dice . setRandom ( random ) ; int result = dice . roll ( 6 ) ; "<AssertPlaceHolder>" ; } roll ( int ) { return ( random . nextInt ( diceFaces ) ) + 1 ; } | org . junit . Assert . assertEquals ( 4 , result ) |
committed_quiet ( ) { add ( "root" , "/" ) ; addTransaction ( "testing" , true ) ; java . io . File stage = useStageDir ( "testing" , "root" ) ; java . io . File file = touch ( stage , "a.txt" ) ; invoke ( "transaction" , "abort" , "testing" , "--quiet" ) ; "<AssertPlaceHolder>" ; } exists ( ) { return new org . hamcrest . BaseMatcher < java . io . File > ( ) { @ com . asakusafw . operation . tools . directio . Override public boolean matches ( java . lang . Object item ) { return ( ( java . io . File ) ( item ) ) . exists ( ) ; } @ com . asakusafw . operation . tools . directio . Override public void describeTo ( org . hamcrest . Description description ) { description . appendText ( "exists" ) ; } } ; } | org . junit . Assert . assertThat ( file , exists ( ) ) |
testCreate ( ) { java . util . Optional < com . gh . mygreen . xlsmapper . fieldaccessor . MapLabelSetter > labelSetter = setterFactory . create ( com . gh . mygreen . xlsmapper . fieldaccessor . MapLabelSetterFactoryTest . NotLabel . SampleRecord . class , "test" ) ; "<AssertPlaceHolder>" . isEmpty ( ) ; } create ( java . lang . String , java . lang . String ) { com . gh . mygreen . xlsmapper . xml . bind . AnnotationInfo . AttributeInfo attr = new com . gh . mygreen . xlsmapper . xml . bind . AnnotationInfo . AttributeInfo ( ) ; attr . name = name ; attr . value = value ; return attr ; } | org . junit . Assert . assertThat ( labelSetter ) |
getNumDimensions ( ) { cn . edu . hit . ir . JNN . Dim dim = new cn . edu . hit . ir . JNN . Dim ( java . util . Arrays . asList ( 100 , 200 ) , 1 ) ; "<AssertPlaceHolder>" ; } getNumDimensions ( ) { return nd ; } | org . junit . Assert . assertEquals ( dim . getNumDimensions ( ) , 2 ) |
applyDefaultAddsOutputDirectoryWhenAbsent ( ) { com . github . timm . cucumber . generate . Plugin plugin = new com . github . timm . cucumber . generate . Plugin ( ) ; plugin . setName ( "path.to.my.XmlFormatter" ) ; plugin . applyDefaults ( new java . io . File ( "path/to/output" ) ) ; "<AssertPlaceHolder>" ; } getOutputDirectory ( ) { return outputDirectory ; } | org . junit . Assert . assertThat ( plugin . getOutputDirectory ( ) , org . hamcrest . CoreMatchers . equalTo ( new java . io . File ( "path/to/output" ) ) ) |
testEmpty ( ) { com . taobao . tddl . executor . repo . RepositoryHolder repoHolder = new com . taobao . tddl . executor . repo . RepositoryHolder ( ) ; com . taobao . tddl . optimizer . config . table . StaticSchemaManager sm = new com . taobao . tddl . optimizer . config . table . StaticSchemaManager ( "test_schema.xml" , null , null ) ; sm . init ( ) ; com . taobao . tddl . executor . spi . IRepository bdbRepo = repoHolder . getOrCreateRepository ( "BDB_JE" , Collections . EMPTY_MAP ) ; com . taobao . tddl . executor . spi . ICursorFactory cf = new com . taobao . tddl . executor . spi . CursorFactoryDefaultImpl ( ) ; com . taobao . tddl . executor . cursor . SchematicCursor subCursor = new com . taobao . tddl . executor . cursor . SchematicCursor ( this . getCursor ( "T1" , new java . lang . Integer [ ] { } ) ) ; com . taobao . tddl . optimizer . core . expression . IOrderBy order = new com . taobao . tddl . optimizer . core . expression . bean . OrderBy ( ) ; order . setColumn ( new com . taobao . tddl . optimizer . core . expression . bean . Column ( ) . setColumnName ( "ID" ) . setTableName ( "T1" ) . setDataType ( DataType . IntegerType ) ) ; java . util . List < com . taobao . tddl . optimizer . core . expression . IOrderBy > orderBys = new java . util . ArrayList ( ) ; orderBys . add ( order ) ; com . taobao . tddl . executor . cursor . impl . TempTableSortCursor c = new com . taobao . tddl . executor . cursor . impl . TempTableSortCursor ( cf , bdbRepo , subCursor , orderBys , true , 0 , new com . taobao . tddl . executor . common . ExecutionContext ( ) ) ; java . lang . Object [ ] expected = new java . lang . Object [ ] { } ; java . util . List actual = new java . util . ArrayList ( ) ; com . taobao . tddl . executor . rowset . IRowSet row = null ; while ( ( row = c . next ( ) ) != null ) { System . out . println ( row ) ; actual . add ( row . getObject ( 0 ) ) ; } "<AssertPlaceHolder>" ; } toArray ( ) { return sqls . toArray ( ) ; } | org . junit . Assert . assertArrayEquals ( expected , actual . toArray ( ) ) |
handleMessageNotRequestor ( ) { org . talend . esb . security . saml . STSRESTOutInterceptor i = new org . talend . esb . security . saml . STSRESTOutInterceptor ( ) ; org . apache . cxf . message . Message message = createMock ( org . apache . cxf . message . Message . class ) ; message . get ( Message . REQUESTOR_ROLE ) ; expectLastCall ( ) . andReturn ( false ) . anyTimes ( ) ; org . apache . cxf . ws . security . trust . STSClient stsClient = createMock ( org . apache . cxf . ws . security . trust . STSClient . class ) ; i . setStsClient ( stsClient ) ; "<AssertPlaceHolder>" ; replay ( message ) ; i . handleMessage ( message ) ; verify ( message ) ; } getStsClient ( ) { return stsClient ; } | org . junit . Assert . assertSame ( stsClient , i . getStsClient ( ) ) |
testGetDeploymentInfoForDeployedDriver ( ) { deployDriver ( driverDef1 ) ; org . kie . workbench . common . screens . datasource . management . model . DriverDeploymentInfo deploymentInfo = driverProvider . getDeploymentInfo ( org . kie . workbench . common . screens . datasource . management . backend . core . DRIVER1_UUID ) ; "<AssertPlaceHolder>" ; } getDeploymentInfo ( java . lang . String ) { for ( org . kie . workbench . common . screens . datasource . management . model . DataSourceDeploymentInfo deploymentInfo : getDeploymentsInfo ( ) ) { if ( uuid . equals ( deploymentInfo . getUuid ( ) ) ) { return deploymentInfo ; } } return null ; } | org . junit . Assert . assertNotNull ( deploymentInfo ) |
testEmptyPagination ( ) { com . hm . achievement . command . pagination . CommandPagination pagination = new com . hm . achievement . command . pagination . CommandPagination ( java . util . Collections . emptyList ( ) , 18 , langConfig ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( getPaginationHeader ( 0 , 0 ) , getPaginationFooter ( ) ) ; java . util . List < java . lang . String > result = new java . util . ArrayList ( ) ; pagination . sendPage ( 1 , result :: add ) ; "<AssertPlaceHolder>" ; } sendPage ( int , org . bukkit . command . CommandSender ) { sendPage ( page , to :: sendMessage ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
savesAndRetrievesWindowBounds ( ) { java . awt . Rectangle windowBounds = new java . awt . Rectangle ( 150 , 120 , 1024 , 768 ) ; preferences . setSoapUIWindowBounds ( windowBounds ) ; com . eviware . soapui . support . preferences . UserPreferences independentPreferences = new com . eviware . soapui . support . preferences . UserPreferences ( ) ; "<AssertPlaceHolder>" ; } getSoapUIWindowBounds ( ) { if ( hasAllIntProperties ( com . eviware . soapui . support . preferences . UserPreferences . WINDOW_X , com . eviware . soapui . support . preferences . UserPreferences . WINDOW_Y , com . eviware . soapui . support . preferences . UserPreferences . WINDOW_WIDTH , com . eviware . soapui . support . preferences . UserPreferences . WINDOW_HEIGHT ) ) { return new java . awt . Rectangle ( preferences . getInt ( com . eviware . soapui . support . preferences . UserPreferences . WINDOW_X , 0 ) , preferences . getInt ( com . eviware . soapui . support . preferences . UserPreferences . WINDOW_Y , 0 ) , preferences . getInt ( com . eviware . soapui . support . preferences . UserPreferences . WINDOW_WIDTH , 800 ) , preferences . getInt ( com . eviware . soapui . support . preferences . UserPreferences . WINDOW_HEIGHT , 600 ) ) ; } else { return null ; } } | org . junit . Assert . assertThat ( independentPreferences . getSoapUIWindowBounds ( ) , org . hamcrest . CoreMatchers . is ( windowBounds ) ) |
testTransactionEventException2 ( ) { org . hyperledger . fabric . sdk . exception . TransactionEventException e = new org . hyperledger . fabric . sdk . exception . TransactionEventException ( org . hyperledger . fabric . sdk . exception . FabricExceptionsTest . MESSAGE , null ) ; "<AssertPlaceHolder>" ; } getTransactionEvent ( ) { return this . transactionEvent ; } | org . junit . Assert . assertNull ( e . getTransactionEvent ( ) ) |
exportOrganizationWithDisabledUsers ( ) { final org . bonitasoft . engine . identity . User persistedUser = getIdentityAPI ( ) . createUser ( org . bonitasoft . engine . identity . OrganizationIT . LIUYANYAN_USERNAME , "bpm" ) ; final org . bonitasoft . engine . identity . UserUpdater updater = new org . bonitasoft . engine . identity . UserUpdater ( ) ; updater . setEnabled ( false ) ; getIdentityAPI ( ) . updateUser ( persistedUser . getId ( ) , updater ) ; final java . lang . String organizationContent = getIdentityAPI ( ) . exportOrganization ( ) ; "<AssertPlaceHolder>" . contains ( "false" ) ; getIdentityAPI ( ) . deleteUser ( persistedUser . getId ( ) ) ; } exportOrganization ( ) { final org . bonitasoft . engine . identity . User persistedUser1 = getIdentityAPI ( ) . createUser ( org . bonitasoft . engine . identity . OrganizationIT . LIUYANYAN_USERNAME , "bpm" ) ; final org . bonitasoft . engine . identity . UserCreator creator = new org . bonitasoft . engine . identity . UserCreator ( org . bonitasoft . engine . identity . OrganizationIT . ANTHONY_USERNAME , "bpm" ) ; creator . setJobTitle ( org . bonitasoft . engine . identity . OrganizationIT . WEB_TEAM_MANAGER ) ; final org . bonitasoft . engine . identity . User persistedUser2 = getIdentityAPI ( ) . createUser ( creator ) ; final org . bonitasoft . engine . identity . RoleCreator rc1 = new org . bonitasoft . engine . identity . RoleCreator ( org . bonitasoft . engine . identity . OrganizationIT . DEVELOPER ) ; rc1 . setDisplayName ( "Bonita<sp>developer" ) ; rc1 . setIcon ( "myIcon.jpg" , new byte [ ] { 1 , 2 , 3 } ) ; final org . bonitasoft . engine . identity . Role persistedRole1 = getIdentityAPI ( ) . createRole ( rc1 ) ; final org . bonitasoft . engine . identity . RoleCreator rc2 = new org . bonitasoft . engine . identity . RoleCreator ( org . bonitasoft . engine . identity . OrganizationIT . MANAGER ) ; rc2 . setDisplayName ( org . bonitasoft . engine . identity . OrganizationIT . BONITA_MANAGER ) ; final org . bonitasoft . engine . identity . Role persistedRole2 = getIdentityAPI ( ) . createRole ( rc2 ) ; final org . bonitasoft . engine . identity . GroupCreator groupCreator1 = new org . bonitasoft . engine . identity . GroupCreator ( org . bonitasoft . engine . identity . OrganizationIT . ENGINE ) ; groupCreator1 . setDisplayName ( "engine<sp>team" ) ; final org . bonitasoft . engine . identity . Group persistedGroup1 = getIdentityAPI ( ) . createGroup ( groupCreator1 ) ; final org . bonitasoft . engine . identity . GroupCreator groupCreator2 = new org . bonitasoft . engine . identity . GroupCreator ( org . bonitasoft . engine . identity . OrganizationIT . WEB_GROUP_NAME ) ; groupCreator2 . setDisplayName ( org . bonitasoft . engine . identity . OrganizationIT . WEB_TEAM ) ; final org . bonitasoft . engine . identity . Group persistedGroup2 = getIdentityAPI ( ) . createGroup ( groupCreator2 ) ; final org . bonitasoft . engine . identity . UserMembership membership1 = getIdentityAPI ( ) . addUserMembership ( persistedUser1 . getId ( ) , persistedGroup1 . getId ( ) , persistedRole1 . getId ( ) ) ; final org . bonitasoft . engine . identity . UserMembership membership2 = getIdentityAPI ( ) . addUserMembership ( persistedUser2 . getId ( ) , persistedGroup2 . getId ( ) , persistedRole2 . getId ( ) ) ; final org . bonitasoft . engine . identity . CustomUserInfoDefinition skills = getIdentityAPI ( ) . createCustomUserInfoDefinition ( new org . bonitasoft . engine . identity . CustomUserInfoDefinitionCreator ( org . bonitasoft . engine . identity . OrganizationIT . SKILLS_NAME , org . bonitasoft . engine . identity . OrganizationIT . SKILLS_DESCRIPTION ) ) ; getIdentityAPI ( ) . createCustomUserInfoDefinition ( new org . bonitasoft . engine . identity . CustomUserInfoDefinitionCreator ( org . bonitasoft . engine . identity . OrganizationIT . LOCATION_NAME ) ) ; getIdentityAPI ( ) . setCustomUserInfoValue ( skills . getId ( ) , persistedUser1 . getId ( ) , org . bonitasoft . engine . identity . OrganizationIT . SKILLS_VALUE ) ; final java . lang . String organizationContent = getIdentityAPI ( ) . exportOrganization ( ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( org . bonitasoft . engine . identity . OrganizationIT . DEVELOPER ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( "Bonita<sp>developer" ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( org . bonitasoft . engine . identity . OrganizationIT . ENGINE ) ; org . junit . Assert . assertThat ( organizationContent ) . doesNotContain ( "<iconName/>" ) ; org . junit . Assert . assertThat ( organizationContent ) . doesNotContain ( "<iconPath/>" ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( "engine<sp>team" ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( getIdentityAPI ( ) . getUserMembership ( membership1 . getId ( ) ) . getGroupName ( ) ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( getIdentityAPI ( ) . getUserMembership ( membership2 . getId ( ) ) . getGroupName ( ) ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( org . bonitasoft . engine . identity . OrganizationIT . SKILLS_NAME ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( org . bonitasoft . engine . identity . OrganizationIT . SKILLS_DESCRIPTION ) ; org . junit . Assert . assertThat ( organizationContent ) . contains ( org . bonitasoft . engine . identity . OrganizationIT . LOCATION_NAME ) ; org . junit . Assert . assertThat ( | org . junit . Assert . assertThat ( organizationContent ) |
testGetSessionId_SessionCookieNotFound ( ) { request . setCookies ( irrelevantCookie ) ; "<AssertPlaceHolder>" ; } getSessionId ( javax . servlet . http . HttpServletRequest ) { if ( ( request . getCookies ( ) ) == null ) { return null ; } for ( javax . servlet . http . Cookie cookie : request . getCookies ( ) ) { if ( org . sagebionetworks . repo . web . HttpRequestIdentifierUtils . SESSION_ID_COOKIE_NAME . equals ( cookie . getName ( ) ) ) { return cookie . getValue ( ) ; } } return null ; } | org . junit . Assert . assertNull ( org . sagebionetworks . repo . web . HttpRequestIdentifierUtils . getSessionId ( request ) ) |
copyRBForExcludeNull ( ) { org . slim3 . tester . MockServletContext servletContext = new org . slim3 . tester . MockServletContext ( ) ; org . slim3 . tester . MockHttpServletRequest src = new org . slim3 . tester . MockHttpServletRequest ( servletContext ) ; src . setAttribute ( "aaa" , null ) ; org . slim3 . util . BeanUtilTest . DestRB dest = new org . slim3 . util . BeanUtilTest . DestRB ( ) ; dest . aaa = "111" ; org . slim3 . util . BeanUtil . copy ( src , dest , new org . slim3 . util . CopyOptions ( ) . excludeNull ( ) ) ; "<AssertPlaceHolder>" ; } excludeNull ( ) { excludeNull = true ; return this ; } | org . junit . Assert . assertThat ( dest . aaa , org . hamcrest . CoreMatchers . is ( "111" ) ) |
testSimpleWidgetRead ( ) { org . eclipse . thym . core . config . WidgetModel model = org . eclipse . thym . core . config . WidgetModel . getModel ( project . hybridProject ( ) ) ; org . eclipse . thym . core . config . Widget rm = model . getWidgetForRead ( ) ; "<AssertPlaceHolder>" ; } getWidgetForRead ( ) { long enter = java . lang . System . currentTimeMillis ( ) ; if ( ( ( this . configFile ) == null ) || ( ! ( this . configFile . exists ( ) ) ) ) { return null ; } if ( ( ( readonlyWidget ) == null ) || ( ( readonlyTimestamp ) != ( configFile . lastModified ( ) ) ) ) { synchronized ( this ) { javax . xml . parsers . DocumentBuilderFactory dbf = javax . xml . parsers . DocumentBuilderFactory . newInstance ( ) ; dbf . setNamespaceAware ( true ) ; dbf . setValidating ( false ) ; javax . xml . parsers . DocumentBuilder db ; try { db = dbf . newDocumentBuilder ( ) ; org . w3c . dom . Document configDocument = db . parse ( configFile ) ; readonlyWidget = load ( configDocument ) ; readonlyTimestamp = configFile . lastModified ( ) ; } catch ( javax . xml . parsers . ParserConfigurationException e ) { throw new org . eclipse . core . runtime . CoreException ( new org . eclipse . core . runtime . Status ( org . eclipse . core . runtime . IStatus . ERROR , org . eclipse . thym . core . HybridCore . PLUGIN_ID , "Parser<sp>error<sp>when<sp>parsing<sp>config.xml" , e ) ) ; } catch ( org . xml . sax . SAXException e ) { throw new org . eclipse . core . runtime . CoreException ( new org . eclipse . core . runtime . Status ( org . eclipse . core . runtime . IStatus . ERROR , org . eclipse . thym . core . HybridCore . PLUGIN_ID , "Failed<sp>to<sp>parse<sp>config.xml" , e ) ) ; } catch ( java . io . IOException e ) { throw new org . eclipse . core . runtime . CoreException ( new org . eclipse . core . runtime . Status ( org . eclipse . core . runtime . IStatus . ERROR , org . eclipse . thym . core . HybridCore . PLUGIN_ID , "IO<sp>error<sp>when<sp>parsing<sp>config.xml" , e ) ) ; } } } org . eclipse . thym . core . HybridCore . trace ( ( ( "Completed<sp>WidgetModel.getWidgetForRead<sp>it<sp>" + ( java . lang . Long . toString ( ( ( java . lang . System . currentTimeMillis ( ) ) - enter ) ) ) ) + "ms" ) ) ; return readonlyWidget ; } | org . junit . Assert . assertNotNull ( rm ) |
testLogResetsNamedLoggersWithPastTimeout ( ) { try ( org . apache . storm . utils . Time . SimulatedTime t = new org . apache . storm . utils . Time . SimulatedTime ( ) ) { long past = ( org . apache . storm . utils . Time . currentTimeMillis ( ) ) - 1000 ; java . util . TreeMap < java . lang . String , org . apache . storm . generated . LogLevel > config = new java . util . TreeMap ( ) ; config . put ( "my_debug_logger" , org . apache . storm . daemon . worker . LogConfigManagerTest . ll ( "DEBUG" , "INFO" , past ) ) ; config . put ( "my_info_logger" , org . apache . storm . daemon . worker . LogConfigManagerTest . ll ( "INFO" , "WARN" , past ) ) ; config . put ( "my_error_logger" , org . apache . storm . daemon . worker . LogConfigManagerTest . ll ( "ERROR" , "INFO" , past ) ) ; java . util . concurrent . atomic . AtomicReference < java . util . TreeMap < java . lang . String , org . apache . storm . generated . LogLevel > > atomConf = new java . util . concurrent . atomic . AtomicReference ( config ) ; org . apache . storm . daemon . worker . LogConfigManager underTest = spy ( new org . apache . storm . daemon . worker . LogConfigManagerTest . LogConfigManagerUnderTest ( atomConf ) ) ; underTest . resetLogLevels ( ) ; "<AssertPlaceHolder>" ; verify ( underTest ) . setLoggerLevel ( anyObject ( ) , eq ( "my_debug_logger" ) , eq ( "INFO" ) ) ; verify ( underTest ) . setLoggerLevel ( anyObject ( ) , eq ( "my_info_logger" ) , eq ( "WARN" ) ) ; verify ( underTest ) . setLoggerLevel ( anyObject ( ) , eq ( "my_error_logger" ) , eq ( "INFO" ) ) ; } } get ( ) { return isExpired ( ) ? 0L : mem ; } | org . junit . Assert . assertEquals ( new java . util . TreeMap ( ) , atomConf . get ( ) ) |
isEmpty_isTrueAfterCreation ( ) { "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( childCollections . size ( ) ) == 0 ) && ( ( cheatsheets . size ( ) ) == 0 ) ; } | org . junit . Assert . assertTrue ( array . isEmpty ( ) ) |
getLongShouldWorkLittleEndianIndex0 ( ) { java . nio . ByteBuffer buf = java . nio . ByteBuffer . allocate ( 8 ) ; buf . order ( org . kaazing . gateway . util . LITTLE_ENDIAN ) ; buf . putLong ( 1234567890123456789L ) ; buf . flip ( ) ; long result = org . kaazing . gateway . util . Utils . getLong ( buf , 0 ) ; long expected = buf . getLong ( ) ; "<AssertPlaceHolder>" ; } getLong ( ) { return buf . getLong ( ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
testIsEmpty ( ) { owl2vcs . changeset . MutableChangeSet target = new owl2vcs . changeset . MutableChangeSet ( ) ; boolean expected = true ; boolean actual = target . isEmpty ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( ( ( ( ( formatChange ) == null ) && ( ( ( prefixChanges ) == null ) || ( prefixChanges . isEmpty ( ) ) ) ) && ( ( ontologyIdChange ) == null ) ) && ( ( ( importChanges ) == null ) || ( importChanges . isEmpty ( ) ) ) ) && ( ( ( annotationChanges ) == null ) || ( annotationChanges . isEmpty ( ) ) ) ) && ( ( ( axiomChanges ) == null ) || ( axiomChanges . isEmpty ( ) ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
manageModificationProcess_VSERVER_UPDATED ( ) { paramHandler . getIaasContext ( ) . setVSystemStatus ( "NORMAL" ) ; doReturn ( Boolean . TRUE ) . when ( vServerProcessor . vserverComm ) . startVServer ( paramHandler ) ; org . oscm . app . iaas . data . FlowState newState = vServerProcessor . manageModificationProcess ( null , null , paramHandler , FlowState . VSERVER_UPDATED , null ) ; "<AssertPlaceHolder>" ; } manageModificationProcess ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState , org . oscm . app . iaas . data . FlowState ) { boolean vSysInNormalState = VSystemStatus . NORMAL . equals ( paramHandler . getIaasContext ( ) . getVSystemStatus ( ) ) ; switch ( flowState ) { case VSERVER_MODIFICATION_REQUESTED : if ( vSysInNormalState ) { newState = vserverComm . modifyVServerAttributes ( paramHandler ) ; } break ; case VSERVER_STOPPING_FOR_MODIFICATION : if ( vSysInNormalState && ( VServerStatus . STOPPED . equals ( vserverComm . getNonErrorVServerStatus ( paramHandler ) ) ) ) { if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_UPDATING , paramHandler ) ) { newState = vserverComm . modifyVServerAttributes ( paramHandler ) ; } } break ; case VSERVER_UPDATING : if ( vSysInNormalState ) { java . util . Set < java . lang . String > toBeStarted = paramHandler . getVserversToBeStarted ( ) ; if ( ( toBeStarted . contains ( paramHandler . getVserverId ( ) ) ) && ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTING , paramHandler ) ) ) { if ( vserverComm . startVServer ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } else { checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTED , paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } paramHandler . removeVserverToBeStarted ( paramHandler . getVserverId ( ) ) ; } else { newState = org . oscm . app . iaas . data . FlowState . VSERVER_RETRIEVEGUEST ; } } break ; case VSERVER_UPDATED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTING , paramHandler ) ) ) { if ( vserverComm . startVServer ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } } break ; case VSERVER_STARTING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_RETRIEVEGUEST ; } } break ; case VSERVER_RETRIEVEGUEST : java . lang . String mail = paramHandler . getMailForCompletion ( ) ; if ( mail != null ) { newState = dispatchVServerManualOperation ( controllerId , instanceId , paramHandler , mail ) ; } else if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; default : } return newState ; } | org . junit . Assert . assertEquals ( FlowState . VSERVER_STARTING , newState ) |
testNPathsTo_Int_OutOfBoundIndex ( ) { org . openscience . cdk . interfaces . IAtomContainer simple = org . openscience . cdk . graph . ShortestPathsTest . simple ( ) ; org . openscience . cdk . graph . ShortestPaths paths = new org . openscience . cdk . graph . ShortestPaths ( simple , simple . getAtom ( 0 ) ) ; "<AssertPlaceHolder>" ; } nPathsTo ( org . openscience . cdk . interfaces . IAtom ) { return nPathsTo ( container . indexOf ( end ) ) ; } | org . junit . Assert . assertThat ( paths . nPathsTo ( 20 ) , org . hamcrest . CoreMatchers . is ( 0 ) ) |
test_toDate ( ) { java . util . GregorianCalendar calendarActual = new java . util . GregorianCalendar ( 2018 , 6 , 28 ) ; javax . xml . datatype . DatatypeFactory datatypeFactory = javax . xml . datatype . DatatypeFactory . newInstance ( ) ; javax . xml . datatype . XMLGregorianCalendar expectedXMLGregorianCalendar = datatypeFactory . newXMLGregorianCalendar ( calendarActual ) ; expectedXMLGregorianCalendar . toGregorianCalendar ( ) . getTime ( ) ; "<AssertPlaceHolder>" ; } getTime ( ) { return time ; } | org . junit . Assert . assertEquals ( calendarActual . getTime ( ) , expectedXMLGregorianCalendar . toGregorianCalendar ( ) . getTime ( ) ) |
testTaggedTimer ( ) { taggedMetric = new com . github . sps . metrics . TaggedTimer ( tags ) ; "<AssertPlaceHolder>" ; } getTags ( ) { return tags ; } | org . junit . Assert . assertEquals ( tags , taggedMetric . getTags ( ) ) |
testFactoryAllNull ( ) { "<AssertPlaceHolder>" ; } getInstance ( java . util . List ) { java . util . ArrayList < java . util . List < java . lang . String > > key = new java . util . ArrayList < java . util . List < java . lang . String > > ( 1 ) ; key . add ( columnNames ) ; org . apache . hadoop . hive . serde2 . objectinspector . MetadataListStructObjectInspector result = org . apache . hadoop . hive . serde2 . objectinspector . MetadataListStructObjectInspector . cached . get ( key ) ; if ( result == null ) { result = new org . apache . hadoop . hive . serde2 . objectinspector . MetadataListStructObjectInspector ( columnNames ) ; org . apache . hadoop . hive . serde2 . objectinspector . MetadataListStructObjectInspector prev = org . apache . hadoop . hive . serde2 . objectinspector . MetadataListStructObjectInspector . cached . putIfAbsent ( key , result ) ; if ( prev != null ) { result = prev ; } } return result ; } | org . junit . Assert . assertNull ( factory . getInstance ( conf ) ) |
testSetLink ( ) { item . setLink ( "value" ) ; "<AssertPlaceHolder>" ; } getLink ( ) { return link ; } | org . junit . Assert . assertEquals ( "value" , item . getLink ( ) ) |
getUserSize_oneUser_oneSize ( ) { dbHandler . createUser ( new io . github . data4all . model . data . User ( "foo" , "bar" , "42" ) ) ; "<AssertPlaceHolder>" ; } getAllUser ( ) { final java . util . List < io . github . data4all . model . data . User > users = new java . util . ArrayList < io . github . data4all . model . data . User > ( ) ; final android . database . sqlite . SQLiteDatabase db = getReadableDatabase ( ) ; final android . database . Cursor cursor = db . rawQuery ( ( ( io . github . data4all . handler . DataBaseHandler . SELECT_ALL ) + ( io . github . data4all . handler . DataBaseHandler . TABLE_USER ) ) , null ) ; if ( cursor != null ) { while ( cursor . moveToNext ( ) ) { final io . github . data4all . model . data . User user = new io . github . data4all . model . data . User ( cursor . getString ( 0 ) , cursor . getString ( 1 ) , cursor . getString ( ( 1 + 1 ) ) ) ; users . add ( user ) ; } } io . github . data4all . logger . Log . i ( io . github . data4all . handler . DataBaseHandler . TAG , ( ( users . size ( ) ) + "<sp>users<sp>were<sp>retrieved<sp>from<sp>the<sp>database." ) ) ; return users ; } | org . junit . Assert . assertEquals ( 1 , dbHandler . getAllUser ( ) . size ( ) ) |
testPriorityHashOverNonHash ( ) { final com . orientechnologies . orient . core . index . OIndexUnique expectedResult = mockUniqueHashIndex ( ) ; final java . util . List < com . orientechnologies . orient . core . index . OIndex < ? > > indexes = java . util . Arrays . < com . orientechnologies . orient . core . index . OIndex < ? > > asList ( mockUniqueIndex ( ) , mockUniqueCompositeIndex ( ) , expectedResult , mockUniqueIndex ( ) , mockUniqueCompositeIndex ( ) ) ; final com . orientechnologies . orient . core . index . OIndex < ? > result = com . orientechnologies . orient . core . sql . OChainedIndexProxy . findBestIndex ( indexes ) ; "<AssertPlaceHolder>" ; } findBestIndex ( java . lang . Iterable ) { com . orientechnologies . orient . core . index . OIndex < ? > bestIndex = null ; for ( com . orientechnologies . orient . core . index . OIndex < ? > index : indexes ) { if ( ( com . orientechnologies . orient . core . sql . OChainedIndexProxy . priorityOfUsage ( index ) ) > ( com . orientechnologies . orient . core . sql . OChainedIndexProxy . priorityOfUsage ( bestIndex ) ) ) bestIndex = index ; } return bestIndex ; } | org . junit . Assert . assertSame ( result , expectedResult ) |
testFromEbXMLNull ( ) { org . openehealth . ipf . commons . ihe . xds . core . requests . query . SqlQuery result = new org . openehealth . ipf . commons . ihe . xds . core . requests . query . SqlQuery ( ) ; transformer . fromEbXML ( result , null ) ; "<AssertPlaceHolder>" ; } fromEbXML ( org . openehealth . ipf . commons . ihe . xds . core . requests . query . GetAllQuery , org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLAdhocQueryRequest ) { if ( ( query == null ) || ( ebXML == null ) ) { return ; } org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper slots = new org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper ( ebXML ) ; java . lang . String patientId = slots . toString ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . PATIENT_ID ) ; query . setPatientId ( org . openehealth . ipf . commons . ihe . xds . core . metadata . Hl7v2Based . parse ( patientId , org . openehealth . ipf . commons . ihe . xds . core . metadata . Identifiable . class ) ) ; query . setStatusDocuments ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_STATUS ) ) ; query . setStatusFolders ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . FOLDER_STATUS ) ) ; query . setStatusSubmissionSets ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . SUBMISSION_SET_STATUS ) ) ; query . setConfidentialityCodes ( slots . toCodeQueryList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE , org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE_SCHEME ) ) ; query . setFormatCodes ( slots . toCodeList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_FORMAT_CODE ) ) ; query . setHomeCommunityId ( ebXML . getHome ( ) ) ; query . setDocumentEntryTypes ( slots . toDocumentEntryType ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_TYPE ) ) ; } | org . junit . Assert . assertEquals ( new org . openehealth . ipf . commons . ihe . xds . core . requests . query . SqlQuery ( ) , result ) |
testDigestAuthenticationQopIntOnlyNonRepeatableEntity ( ) { final org . apache . hc . core5 . http . ClassicHttpRequest request = new org . apache . hc . core5 . http . message . BasicClassicHttpRequest ( "Post" , "/" ) ; request . setEntity ( new org . apache . hc . core5 . http . io . entity . InputStreamEntity ( new java . io . ByteArrayInputStream ( new byte [ ] { 'a' } ) , ( - 1 ) , org . apache . hc . core5 . http . ContentType . DEFAULT_TEXT ) ) ; final org . apache . hc . core5 . http . HttpHost host = new org . apache . hc . core5 . http . HttpHost ( "somehost" , 80 ) ; final org . apache . hc . client5 . http . auth . AuthScope authScope = new org . apache . hc . client5 . http . auth . AuthScope ( host , "realm1" , null ) ; final org . apache . hc . client5 . http . impl . auth . BasicCredentialsProvider credentialsProvider = new org . apache . hc . client5 . http . impl . auth . BasicCredentialsProvider ( ) ; final org . apache . hc . client5 . http . auth . Credentials creds = new org . apache . hc . client5 . http . auth . UsernamePasswordCredentials ( "username" , "username" 0. toCharArray ( ) ) ; credentialsProvider . setCredentials ( authScope , creds ) ; final java . lang . String challenge = "Digest<sp>realm=\"realm1\",<sp>nonce=\"f2a3f18799759d4f1a1c068b92b573cb\",<sp>" + "qop=\"auth-int\"" ; final org . apache . hc . client5 . http . auth . AuthChallenge authChallenge = org . apache . hc . client5 . http . impl . auth . TestDigestScheme . parse ( challenge ) ; final org . apache . hc . client5 . http . impl . auth . DigestScheme authscheme = new org . apache . hc . client5 . http . impl . auth . DigestScheme ( ) ; authscheme . processChallenge ( authChallenge , null ) ; "<AssertPlaceHolder>" ; authscheme . generateAuthResponse ( host , request , null ) ; } isResponseReady ( org . apache . hc . core5 . http . HttpHost , org . apache . hc . client5 . http . auth . CredentialsProvider , org . apache . hc . core5 . http . protocol . HttpContext ) { org . apache . hc . core5 . util . Args . notNull ( host , "Auth<sp>host" ) ; org . apache . hc . core5 . util . Args . notNull ( credentialsProvider , "CredentialsProvider" ) ; final org . apache . hc . client5 . http . auth . Credentials credentials = credentialsProvider . getCredentials ( new org . apache . hc . client5 . http . auth . AuthScope ( host , getRealm ( ) , getName ( ) ) , context ) ; if ( credentials != null ) { this . username = credentials . getUserPrincipal ( ) . getName ( ) ; this . password = credentials . getPassword ( ) ; return true ; } this . username = null ; this . password = null ; return false ; } | org . junit . Assert . assertTrue ( authscheme . isResponseReady ( host , credentialsProvider , null ) ) |
testToFromStringWithMapping ( ) { java . util . Map < java . lang . String , java . lang . String > tableMappingTo = new java . util . HashMap ( ) ; tableMappingTo . put ( "table1" , "1.column3" 7 ) ; tableMappingTo . put ( "1.column3" 4 , "2" ) ; java . util . Map < java . lang . String , java . lang . String > columnMappingTo = new java . util . HashMap ( ) ; columnMappingTo . put ( "1.column1" , "1.column3" 7 ) ; columnMappingTo . put ( "2.column2" , "2" ) ; columnMappingTo . put ( "1.column3" , "1.column3" 5 ) ; columnMappingTo . put ( "1.column3" 2 , "1.column3" 9 ) ; columnMappingTo . put ( "1.column7" , "5" ) ; columnMappingTo . put ( "2.column8" , "6" ) ; java . util . Map < java . lang . String , java . lang . String > tableMappingFrom = new java . util . HashMap ( ) ; tableMappingFrom . put ( "1.column3" 7 , "table1" ) ; tableMappingFrom . put ( "2" , "1.column3" 4 ) ; java . util . Map < java . lang . String , java . lang . String > columnMappingFrom = new java . util . HashMap ( ) ; columnMappingFrom . put ( "1.column3" 7 , "1.column1" ) ; columnMappingFrom . put ( "2" , "2.column2" ) ; columnMappingFrom . put ( "1.column3" 5 , "1.column3" ) ; columnMappingFrom . put ( "1.column3" 9 , "1.column3" 2 ) ; columnMappingFrom . put ( "5" , "1.column7" ) ; columnMappingFrom . put ( "6" , "2.column8" ) ; de . metanome . algorithm_integration . MatchingCombination expectedDeterminant = new de . metanome . algorithm_integration . MatchingCombination ( new de . metanome . algorithm_integration . MatchingIdentifier ( new de . metanome . algorithm_integration . ColumnIdentifier ( "table1" , "column1" ) , new de . metanome . algorithm_integration . ColumnIdentifier ( "1.column3" 4 , "1.column3" 6 ) , "1.column1" 0 , 0.5 ) , new de . metanome . algorithm_integration . MatchingIdentifier ( new de . metanome . algorithm_integration . ColumnIdentifier ( "table1" , "1.column3" 8 ) , new de . metanome . algorithm_integration . ColumnIdentifier ( "1.column3" 4 , "1.column3" 1 ) , "1.column1" 0 , 0.5 ) ) ; de . metanome . algorithm_integration . MatchingIdentifier expectedDependant = new de . metanome . algorithm_integration . MatchingIdentifier ( new de . metanome . algorithm_integration . ColumnIdentifier ( "table1" , "1.column3" 0 ) , new de . metanome . algorithm_integration . ColumnIdentifier ( "1.column3" 4 , "1.column3" 3 ) , "1.column1" 0 , 0.5 ) ; de . metanome . algorithm_integration . results . MatchingDependency expectedMD = new de . metanome . algorithm_integration . results . MatchingDependency ( expectedDeterminant , expectedDependant , 10 ) ; java . lang . String actualString = expectedMD . toString ( tableMappingTo , columnMappingTo ) ; de . metanome . algorithm_integration . results . MatchingDependency actualMD = de . metanome . algorithm_integration . results . MatchingDependency . fromString ( tableMappingFrom , columnMappingFrom , actualString ) ; "<AssertPlaceHolder>" ; } fromString ( java . util . Map , java . util . Map , java . lang . String ) { java . lang . String [ ] supportParts = str . split ( de . metanome . algorithm_integration . results . MatchingDependency . SUPPORT_SEPARATOR ) ; long support = java . lang . Long . parseLong ( supportParts [ 1 ] ) ; java . lang . String [ ] parts = supportParts [ 0 ] . split ( de . metanome . algorithm_integration . results . MatchingDependency . MD_SEPARATOR ) ; de . metanome . algorithm_integration . MatchingCombination determinant = de . metanome . algorithm_integration . MatchingCombination . fromString ( tableMapping , columnMapping , parts [ 0 ] ) ; de . metanome . algorithm_integration . MatchingIdentifier dependant = de . metanome . algorithm_integration . MatchingIdentifier . fromString ( tableMapping , columnMapping , parts [ 1 ] ) ; return new de . metanome . algorithm_integration . results . MatchingDependency ( determinant , dependant , support ) ; } | org . junit . Assert . assertEquals ( expectedMD , actualMD ) |
testExtractTenantFromBGHeaderInvalid ( ) { java . lang . String businessGroup = "test" ; com . vmware . xenon . common . Operation op = new com . vmware . xenon . common . Operation ( ) ; op . addRequestHeader ( OperationUtil . PROJECT_ADMIRAL_HEADER , businessGroup ) ; java . lang . String tenantLink = com . vmware . admiral . common . util . OperationUtil . extractTenantFromProjectHeader ( op ) ; "<AssertPlaceHolder>" ; } extractTenantFromProjectHeader ( com . vmware . xenon . common . Operation ) { java . lang . String businessGroup = op . getRequestHeader ( com . vmware . admiral . common . util . OperationUtil . PROJECT_ADMIRAL_HEADER ) ; if ( businessGroup == null ) { return null ; } int index = businessGroup . indexOf ( "/" , ( ( businessGroup . indexOf ( "/" , 1 ) ) + 1 ) ) ; if ( index == ( - 1 ) ) { return null ; } java . lang . String tenantLink = businessGroup . substring ( 0 , index ) ; return tenantLink ; } | org . junit . Assert . assertTrue ( ( tenantLink == null ) ) |
testShortAnd ( ) { short theValue = 3 ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 2 , ( theValue & 2 ) , 0 ) |
testTransform ( ) { java . lang . String expected = "beginDocument<sp>[[syntax]=[XWiki<sp>2.1]]\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "beginParagraph\n" + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[cancel]]<sp>[true]\n" 5 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 0 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[cancel]]<sp>[true]\n" 1 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 0 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[cancel]]<sp>[true]\n" 0 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[emoticon_unhappy]]<sp>[true]\n" ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 4 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[cancel]]<sp>[true]\n" 4 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[cancel]]<sp>[true]\n" 2 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 9 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 2 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[information]]<sp>[true]\n" ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[accept]]<sp>[true]\n" ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[cancel]]<sp>[true]\n" ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[error]]<sp>[true]\n" ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[cancel]]<sp>[true]\n" 6 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 6 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 3 ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[lightbulb_off]]<sp>[true]\n" ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 5 ) + "endParagraph\n" ) + "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 8 ) ; org . xwiki . rendering . parser . Parser parser = getComponentManager ( ) . getInstance ( org . xwiki . rendering . parser . Parser . class , "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[cancel]]<sp>[true]\n" 3 ) ; org . xwiki . rendering . block . XDOM xdom = parser . parse ( new java . io . StringReader ( "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 7 ) ) ; this . getMockedComponent ( ) . transform ( xdom , new org . xwiki . rendering . transformation . TransformationContext ( ) ) ; org . xwiki . rendering . renderer . printer . WikiPrinter printer = new org . xwiki . rendering . renderer . printer . DefaultWikiPrinter ( ) ; org . xwiki . rendering . renderer . BlockRenderer eventBlockRenderer = getComponentManager ( ) . getInstance ( org . xwiki . rendering . renderer . BlockRenderer . class , "onImage<sp>[Typed<sp>=<sp>[true]<sp>Type<sp>=<sp>[icon]<sp>Reference<sp>=<sp>[delete]]<sp>[true]\n" 1 ) ; eventBlockRenderer . render ( xdom , printer ) ; "<AssertPlaceHolder>" ; } toString ( ) { return getBuffer ( ) . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , printer . toString ( ) ) |
testConfigureGridAtNotNull_8_8_8_8 ( ) { final org . jtrfp . trcl . obj . MiniMap mm = getSubject ( ) ; mm . configureGridAt ( 8 , 8 , 16 ) ; "<AssertPlaceHolder>" ; } getGrid ( ) { if ( ( grid ) == null ) { final int diameterInTiles = getDiameterInTiles ( ) ; grid = new org . jtrfp . trcl . gpu . SettableTexture [ diameterInTiles ] [ diameterInTiles ] ; } return grid ; } | org . junit . Assert . assertNotNull ( mm . getGrid ( ) [ 8 ] [ 8 ] ) |
testPerfGetRootDse ( ) { org . apache . directory . server . core . api . interceptor . context . GetRootDseOperationContext getRootDseContext = new org . apache . directory . server . core . api . interceptor . context . GetRootDseOperationContext ( getService ( ) . getAdminSession ( ) ) ; org . apache . directory . api . ldap . model . entry . Entry rootDse = getService ( ) . getOperationManager ( ) . getRootDse ( getRootDseContext ) ; "<AssertPlaceHolder>" ; int nbIterations = 1500000 ; long t0 = java . lang . System . currentTimeMillis ( ) ; long t00 = 0L ; long tt0 = java . lang . System . currentTimeMillis ( ) ; for ( int i = 0 ; i < nbIterations ; i ++ ) { getRootDseContext . setCurrentInterceptor ( 0 ) ; if ( ( i % 100000 ) == 0 ) { long tt1 = java . lang . System . currentTimeMillis ( ) ; System . out . println ( ( ( i + ",<sp>" ) + ( tt1 - tt0 ) ) ) ; tt0 = tt1 ; } if ( i == 500000 ) { t00 = java . lang . System . currentTimeMillis ( ) ; } rootDse = getService ( ) . getOperationManager ( ) . getRootDse ( getRootDseContext ) ; } long t1 = java . lang . System . currentTimeMillis ( ) ; java . lang . Long deltaWarmed = t1 - t00 ; System . out . println ( ( ( ( ( ( "Delta<sp>getRootDSE:<sp>" + deltaWarmed ) + "(<sp>" ) + ( ( ( nbIterations - 500000 ) * 1000 ) / deltaWarmed ) ) + "<sp>per<sp>s<sp>)<sp>/" ) + ( t1 - t0 ) ) ) ; } getRootDse ( org . apache . directory . server . core . api . interceptor . context . GetRootDseOperationContext ) { long t0 = java . lang . System . nanoTime ( ) ; org . apache . directory . api . ldap . model . entry . Entry rootDse = next ( getRootDseContext ) ; long delta = ( java . lang . System . nanoTime ( ) ) - t0 ; if ( org . apache . directory . server . core . logger . TimerInterceptor . IS_DEBUG_STATS ) { org . apache . directory . server . core . logger . TimerInterceptor . nbGetRootDseCalls . incrementAndGet ( ) ; org . apache . directory . server . core . logger . TimerInterceptor . totalGetRootDse . getAndAdd ( delta ) ; if ( ( ( org . apache . directory . server . core . logger . TimerInterceptor . nbGetRootDseCalls . get ( ) ) % 1000 ) == 0 ) { long average = ( org . apache . directory . server . core . logger . TimerInterceptor . totalGetRootDse . get ( ) ) / ( ( org . apache . directory . server . core . logger . TimerInterceptor . nbGetRootDseCalls . get ( ) ) * 1000 ) ; org . apache . directory . server . core . logger . TimerInterceptor . OPERATION_STATS . debug ( "{}<sp>:<sp>Average<sp>getRootDSE<sp>=<sp>{}<sp>microseconds,<sp>nb<sp>getRootDSEs<sp>=<sp>{}" , getName ( ) , average , org . apache . directory . server . core . logger . TimerInterceptor . nbGetRootDseCalls . get ( ) ) ; } } if ( org . apache . directory . server . core . logger . TimerInterceptor . IS_DEBUG_TIME ) { org . apache . directory . server . core . logger . TimerInterceptor . OPERATION_TIME . debug ( "{}<sp>:<sp>Delta<sp>getRootDSE<sp>=<sp>{}" , getName ( ) , delta ) ; } return rootDse ; } | org . junit . Assert . assertNotNull ( rootDse ) |
testGetEventInstancesOrderByNameDesc ( ) { final org . bonitasoft . engine . core . process . instance . model . SProcessInstance processInstance = createSProcessInstance ( ) ; final org . bonitasoft . engine . core . process . instance . model . event . SEventInstance eventInstance1 = createSEndEventInstance ( "EndEvent1" , 1 , processInstance . getId ( ) , 5 , processInstance . getId ( ) ) ; final org . bonitasoft . engine . core . process . instance . model . event . SEventInstance eventInstance2 = createSEndEventInstance ( "EndEvent2" , 1 , processInstance . getId ( ) , 5 , processInstance . getId ( ) ) ; final java . util . List < org . bonitasoft . engine . core . process . instance . model . event . SEventInstance > eventInstances = getEventInstances ( processInstance . getId ( ) , 0 , 5 , org . bonitasoft . engine . builder . BuilderFactory . get ( org . bonitasoft . engine . core . process . instance . model . builder . event . SEndEventInstanceBuilderFactory . class ) . getNameKey ( ) , OrderByType . DESC ) ; "<AssertPlaceHolder>" ; checkEndEventInstance ( eventInstance2 , eventInstances . get ( 0 ) ) ; checkEndEventInstance ( eventInstance1 , eventInstances . get ( 1 ) ) ; deleteSProcessInstance ( processInstance ) ; } getNameKey ( ) { return org . bonitasoft . engine . core . process . definition . model . builder . impl . SProcessDefinitionDeployInfoBuilderFactoryImpl . NAME_KEY ; } | org . junit . Assert . assertEquals ( 2 , eventInstances . size ( ) ) |
syncPropertyDefinitions ( ) { org . apache . jackrabbit . oak . plugins . index . search . util . IndexDefinitionBuilder defnb = new org . apache . jackrabbit . oak . plugins . index . search . util . IndexDefinitionBuilder ( ) ; defnb . indexRule ( "nt:base" ) . property ( "foo" ) . sync ( ) ; org . apache . jackrabbit . oak . plugins . index . search . IndexDefinition defn = org . apache . jackrabbit . oak . plugins . index . search . IndexDefinition . newBuilder ( root , defnb . build ( ) , "/foo" ) . build ( ) ; "<AssertPlaceHolder>" ; } hasSyncPropertyDefinitions ( ) { return syncPropertyIndexes ; } | org . junit . Assert . assertTrue ( defn . hasSyncPropertyDefinitions ( ) ) |
param ( ) { tester . request . setParameter ( "aaa" , "111" ) ; "<AssertPlaceHolder>" ; } param ( java . lang . CharSequence ) { if ( name == null ) { throw new java . lang . NullPointerException ( "The<sp>name<sp>parameter<sp>must<sp>not<sp>be<sp>null." ) ; } return request . getParameter ( name . toString ( ) ) ; } | org . junit . Assert . assertThat ( controller . param ( "aaa" ) , org . hamcrest . CoreMatchers . is ( "111" ) ) |
testSetChecked_marksItemCached ( ) { grid = new org . eclipse . nebula . widgets . grid . Grid ( shell , org . eclipse . swt . SWT . VIRTUAL ) ; org . eclipse . nebula . widgets . grid . GridItem item = new org . eclipse . nebula . widgets . grid . GridItem ( grid , org . eclipse . swt . SWT . NONE ) ; item . setChecked ( true ) ; "<AssertPlaceHolder>" ; } isCached ( ) { return parent . isVirtual ( ) ? cached : true ; } | org . junit . Assert . assertTrue ( item . isCached ( ) ) |
test_map_use_int_key_issue_1332 ( ) { java . lang . String str = "{abc<sp>:<sp>{1:1}}" ; org . nutz . json . generic . IntKeyMap map = org . nutz . json . Json . fromJson ( org . nutz . json . generic . IntKeyMap . class , str ) ; System . out . println ( map ) ; "<AssertPlaceHolder>" ; } getAbc ( ) { return "ABC" ; } | org . junit . Assert . assertTrue ( map . getAbc ( ) . containsKey ( 1 ) ) |
testStringMatchesReservedString ( ) { java . lang . String reserved = "fb" ; org . dataconservancy . packaging . tool . impl . support . validation . GenericCharacterMatcher underTest = new org . dataconservancy . packaging . tool . impl . support . validation . GenericCharacterMatcher ( reserved ) ; java . lang . String toTest = "foo" ; "<AssertPlaceHolder>" ; } matches ( java . lang . Object ) { if ( o == null ) { throw new java . lang . IllegalArgumentException ( "Supplied<sp>Character<sp>must<sp>not<sp>be<sp>null." ) ; } if ( ! ( o instanceof java . lang . Character ) ) { throw new java . lang . IllegalArgumentException ( "Supplied<sp>object<sp>must<sp>be<sp>an<sp>instanceof<sp>Character" ) ; } java . lang . Character ch = ( ( java . lang . Character ) ( o ) ) ; return org . dataconservancy . packaging . tool . impl . support . validation . ValidationUtils . isInvalidUf8Char ( ch ) ; } | org . junit . Assert . assertTrue ( underTest . matches ( toTest ) ) |
likelyhoodRatioForAnySampleIs50PercentWithSingleEntryAvailable ( ) { final double [ ] voiceSample2 = new double [ 1024 ] ; fillWithNoise ( voiceSample2 ) ; recognito . createVoicePrint ( "1" , voiceSample ) ; java . util . List < com . bitsinharmony . recognito . MatchResult < java . lang . String > > matches = recognito . identify ( voiceSample2 ) ; com . bitsinharmony . recognito . MatchResult < java . lang . String > match = matches . get ( 0 ) ; "<AssertPlaceHolder>" ; } getLikelihoodRatio ( ) { return likelihoodRatio ; } | org . junit . Assert . assertThat ( match . getLikelihoodRatio ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( 50 ) ) ) |
withListenerMethodShouldReturnSameInstanceOfBuilder ( ) { java . lang . String url = "http://test" ; com . navercorp . volleyextensions . volleyer . http . HttpMethod method = com . navercorp . volleyextensions . volleyer . http . HttpMethod . GET ; com . navercorp . volleyextensions . volleyer . http . HttpContent httpContent = new com . navercorp . volleyextensions . volleyer . http . HttpContent ( url , method ) ; com . navercorp . volleyextensions . volleyer . VolleyerConfiguration configuration = com . navercorp . volleyextensions . volleyer . factory . DefaultVolleyerConfigurationFactory . create ( ) ; java . lang . Class < java . lang . String > clazz = java . lang . String . class ; com . navercorp . volleyextensions . volleyer . builder . ResponseBuilder < java . lang . String > builder = new com . navercorp . volleyextensions . volleyer . builder . ResponseBuilder < java . lang . String > ( requestQueue , configuration , httpContent , clazz ) ; com . android . volley . Response . Listener < java . lang . String > listener = new com . android . volley . Response . Listener < java . lang . String > ( ) { @ com . navercorp . volleyextensions . volleyer . builder . Override public void onResponse ( java . lang . String response ) { } } ; com . navercorp . volleyextensions . volleyer . builder . ResponseBuilder < java . lang . String > newBuilder = builder . withListener ( listener ) ; "<AssertPlaceHolder>" ; } withListener ( com . android . volley . Response . Listener ) { assertFinishState ( ) ; com . navercorp . volleyextensions . volleyer . builder . ResponseBuilder < java . lang . String > builder = withTargetClass ( java . lang . String . class ) ; builder . withListener ( listener ) ; return builder ; } | org . junit . Assert . assertTrue ( ( builder == newBuilder ) ) |
testSameProcessBagsAreEquals_shouldSucceed ( ) { org . openengsb . core . workflow . api . model . ProcessBag processBag = new org . openengsb . core . workflow . api . model . ProcessBag ( ) ; processBag . setContext ( "blub" ) ; processBag . setProcessId ( "lala" ) ; processBag . setUser ( "cool" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( obj instanceof org . openengsb . domain . userprojects . model . Role ) ) { return false ; } final org . openengsb . domain . userprojects . model . Role other = ( ( org . openengsb . domain . userprojects . model . Role ) ( obj ) ) ; return ( ( java . util . Objects . equals ( name , other . name ) ) && ( java . util . Objects . equals ( roles , other . roles ) ) ) && ( java . util . Objects . equals ( permissions , other . permissions ) ) ; } | org . junit . Assert . assertTrue ( processBag . equals ( processBag ) ) |
testMatchRules ( ) { System . out . println ( "*****<sp>testMatchRules<sp>*****" ) ; int matchCount = 0 ; for ( com . codemagi . burp . MatchRule rule : matchRules ) { java . util . regex . Matcher matcher = rule . getPattern ( ) . matcher ( testResponse ) ; int expectedMatches = ( ( rule . getExpectedMatches ( ) ) != null ) ? rule . getExpectedMatches ( ) : 1 ; int foundMatches = 0 ; System . out . println ( ( ( ( "Testing<sp>rule:<sp>" + ( rule . getPattern ( ) ) ) + "<sp>expected:<sp>" ) + expectedMatches ) ) ; while ( matcher . find ( ) ) { System . out . println ( ( "<sp>matches:<sp>" + ( matcher . group ( 0 ) ) ) ) ; System . out . println ( ( "<sp>version:<sp>" + ( matcher . group ( rule . getMatchGroup ( ) ) ) ) ) ; foundMatches ++ ; } System . out . println ( ( "<sp>TOTAL:<sp>" + foundMatches ) ) ; if ( foundMatches >= expectedMatches ) { matchCount ++ ; } else { System . out . println ( ( "Unable<sp>to<sp>find<sp>match<sp>for:<sp>" + ( rule . getPattern ( ) ) ) ) ; } } System . out . println ( java . lang . String . format ( "Found<sp>%d<sp>matches<sp>out<sp>of<sp>%d" , matchCount , matchRules . size ( ) ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( matchRules . size ( ) , matchCount ) |
testConvertWithNoRelations ( ) { org . lnu . is . resource . specoffer . benefit . SpecOfferBenefitResource source = new org . lnu . is . resource . specoffer . benefit . SpecOfferBenefitResource ( ) ; org . lnu . is . domain . specoffer . SpecOfferBenefit expected = new org . lnu . is . domain . specoffer . SpecOfferBenefit ( ) ; org . lnu . is . domain . specoffer . SpecOfferBenefit actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testListUsers ( ) { org . osgi . service . useradmin . User user1 = org . mockito . Mockito . mock ( org . osgi . service . useradmin . User . class ) ; org . mockito . Mockito . when ( user1 . getType ( ) ) . thenReturn ( Role . USER ) ; org . mockito . Mockito . when ( user1 . getName ( ) ) . thenReturn ( "user1" ) ; org . osgi . service . useradmin . User user2 = org . mockito . Mockito . mock ( org . osgi . service . useradmin . User . class ) ; org . mockito . Mockito . when ( user2 . getType ( ) ) . thenReturn ( Role . USER ) ; org . mockito . Mockito . when ( user2 . getName ( ) ) . thenReturn ( "user2" ) ; org . mockito . Mockito . when ( userAdmin . getRoles ( null ) ) . thenReturn ( new org . osgi . service . useradmin . Role [ ] { user1 , user2 } ) ; java . lang . String [ ] roles = mbean . listUsers ( ) ; "<AssertPlaceHolder>" ; } listUsers ( ) { org . osgi . service . useradmin . Role [ ] roles = null ; try { roles = userAdmin . getRoles ( null ) ; } catch ( org . osgi . framework . InvalidSyntaxException e ) { } if ( roles == null ) { return null ; } return getRoleByType ( roles , Role . USER ) ; } | org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "user1" , "user2" } , roles ) |
testCreateParametersEntries ( ) { "<AssertPlaceHolder>" ; } createParametersEntries ( ) { return new org . pentaho . platform . plugin . services . importexport . exportManifest . bindings . Parameters . Entries ( ) ; } | org . junit . Assert . assertNotNull ( factory . createParametersEntries ( ) ) |
test_pass_out_unsigned_short ( ) { org . omg . CORBA . ShortHolder x = new org . omg . CORBA . ShortHolder ( ) ; server . pass_out_unsigned_short ( x ) ; "<AssertPlaceHolder>" ; } pass_out_unsigned_short ( org . omg . CORBA . ShortHolder ) { x . value = 79 ; } | org . junit . Assert . assertEquals ( 79 , x . value ) |
testSharedAlertWhenTwoSharedAlert ( ) { com . salesforce . dva . argus . service . UserService userService = system . getServiceFactory ( ) . getUserService ( ) ; com . salesforce . dva . argus . service . AlertService alertService = system . getServiceFactory ( ) . getAlertService ( ) ; com . salesforce . dva . argus . entity . PrincipalUser user1 = userService . updateUser ( new com . salesforce . dva . argus . entity . PrincipalUser ( admin , "test1" , "test1@salesforce.com" ) ) ; com . salesforce . dva . argus . entity . PrincipalUser user2 = userService . updateUser ( new com . salesforce . dva . argus . entity . PrincipalUser ( admin , "test2" , "test2@salesforce.com" ) ) ; com . salesforce . dva . argus . entity . Alert alertSharedUser1 = alertService . updateAlert ( new com . salesforce . dva . argus . entity . Alert ( user1 , user1 , "alert-name_shared1" , com . salesforce . dva . argus . service . AlertServiceTest . EXPRESSION , "*<sp>*<sp>*<sp>*<sp>*" ) ) ; com . salesforce . dva . argus . entity . Alert alertSharedUser2 = alertService . updateAlert ( new com . salesforce . dva . argus . entity . Alert ( user2 , user2 , "alert-name-shared2" , com . salesforce . dva . argus . service . AlertServiceTest . EXPRESSION , "*<sp>*<sp>*<sp>*<sp>*" ) ) ; alertSharedUser1 . setShared ( true ) ; alertService . updateAlert ( alertSharedUser1 ) ; alertSharedUser2 . setShared ( true ) ; alertService . updateAlert ( alertSharedUser2 ) ; java . util . List < com . salesforce . dva . argus . entity . Alert > expectedSharedResult = new java . util . ArrayList ( ) ; expectedSharedResult . add ( alertSharedUser1 ) ; expectedSharedResult . add ( alertSharedUser2 ) ; "<AssertPlaceHolder>" ; } findSharedAlerts ( boolean , com . salesforce . dva . argus . entity . PrincipalUser , java . lang . Integer ) { requireNotDisposed ( ) ; return metadataOnly ? com . salesforce . dva . argus . entity . Alert . findSharedAlertsMeta ( _emProvider . get ( ) , owner , limit ) : com . salesforce . dva . argus . entity . Alert . findSharedAlerts ( _emProvider . get ( ) , owner , limit ) ; } | org . junit . Assert . assertEquals ( expectedSharedResult , alertService . findSharedAlerts ( false , null , null ) ) |
testBuildWithParametersAndDisabledDefaultConstraintsWithOrderBy ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String name = "name" ; org . lnu . is . domain . education . form . type . EducationFormType context = new org . lnu . is . domain . education . form . type . EducationFormType ( ) ; context . setName ( name ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "name" , org . lnu . is . pagination . OrderByType . ASC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>EducationFormType<sp>e<sp>WHERE<sp>(<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>)<sp>ORDER<sp>BY<sp>e.name<sp>ASC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . education . form . type . EducationFormType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
createLayoutTemplate ( ) { wizardAction . openNewLiferayModuleWizard ( ) ; wizardAction . newModule . prepareGradle ( project . getName ( ) , com . liferay . ide . ui . layouttpl . tests . LAYOUT_TEMPLATE ) ; wizardAction . finish ( ) ; jobAction . waitForNoRunningProjectBuildingJobs ( ) ; viewAction . project . refreshGradleProject ( com . liferay . ide . ui . layouttpl . tests . NewLayoutTemplateModuleWizardLiferayWorkspaceGradleTests . liferayWorkspace . getName ( ) ) ; "<AssertPlaceHolder>" ; viewAction . project . closeAndDeleteFromDisk ( com . liferay . ide . ui . layouttpl . tests . NewLayoutTemplateModuleWizardLiferayWorkspaceGradleTests . liferayWorkspace . getWarFiles ( project . getName ( ) ) ) ; } visibleFileTry ( java . lang . String [ ] ) { try { return _getProjects ( ) . isVisible ( files ) ; } catch ( java . lang . Exception e ) { _getProjects ( ) . setFocus ( ) ; try { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - 1 ) ) ; _getProjects ( ) . expand ( parents ) ; _getProjects ( ) . contextMenu ( com . liferay . ide . ui . liferay . action . REFRESH , parents ) ; ide . sleep ( 2000 ) ; } catch ( java . lang . Exception e1 ) { } for ( int i = ( files . length ) - 1 ; i > 0 ; i -- ) { java . lang . String [ ] parents = java . util . Arrays . copyOfRange ( files , 0 , ( ( files . length ) - i ) ) ; org . eclipse . swtbot . swt . finder . widgets . SWTBotTreeItem parent = _getProjects ( ) . getTreeItem ( parents ) ; _getProjects ( ) . expand ( parents ) ; java . lang . String subnode = files [ ( ( files . length ) - i ) ] ; _jobAction . waitForSubnode ( parent , subnode , com . liferay . ide . ui . liferay . action . REFRESH ) ; } return _getProjects ( ) . isVisible ( files ) ; } } | org . junit . Assert . assertTrue ( viewAction . project . visibleFileTry ( com . liferay . ide . ui . layouttpl . tests . NewLayoutTemplateModuleWizardLiferayWorkspaceGradleTests . liferayWorkspace . getWarFiles ( project . getName ( ) ) ) ) |
testSendingNodeId ( ) { try { i5 . las2peer . security . UserAgentImpl eve = i5 . las2peer . testing . MockAgentFactory . getEve ( ) ; i5 . las2peer . security . UserAgentImpl adam = i5 . las2peer . testing . MockAgentFactory . getAdam ( ) ; eve . unlock ( "evespass" ) ; i5 . las2peer . communication . Message message = new i5 . las2peer . communication . Message ( eve , adam , "A<sp>content<sp>String" ) ; message . setSendingNodeId ( new java . lang . Long ( 100 ) ) ; java . lang . String xml = message . toXmlString ( ) ; i5 . las2peer . communication . Message andBack = i5 . las2peer . communication . Message . createFromXml ( xml ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . toString ( ) ) ; } } getSendingNodeId ( ) { return sendingNodeId ; } | org . junit . Assert . assertEquals ( new java . lang . Long ( 100 ) , andBack . getSendingNodeId ( ) ) |
model_6 ( ) { org . apache . jena . rdf . model . Model assem = org . apache . jena . util . FileManager . get ( ) . loadModel ( ( ( org . apache . jena . sdb . test . misc . TestAssembler . dir ) + "graph-assembler.ttl" ) ) ; org . apache . jena . rdf . model . Resource xNamed = assem . getResource ( "http://example/test#graphNamed" ) ; org . apache . jena . sdb . Store store = create ( assem ) ; org . apache . jena . rdf . model . Model model2 = ( ( org . apache . jena . rdf . model . Model ) ( Assembler . general . open ( xNamed ) ) ) ; org . apache . jena . rdf . model . Model model3 = ( ( org . apache . jena . rdf . model . Model ) ( Assembler . general . open ( xNamed ) ) ) ; org . apache . jena . rdf . model . Resource s = model2 . createResource ( ) ; org . apache . jena . rdf . model . Property p = model2 . createProperty ( "http://example/p" ) ; org . apache . jena . rdf . model . Literal o2 = model2 . createLiteral ( "xyz" ) ; model2 . add ( s , p , o2 ) ; "<AssertPlaceHolder>" ; } contains ( org . apache . jena . permissions . model . impl . Resource , org . apache . jena . permissions . model . impl . Property , java . lang . String ) { checkRead ( ) ; final org . apache . jena . permissions . model . impl . SecuredStatementIterator iter = new org . apache . jena . permissions . model . impl . SecuredStatementIterator ( holder . getSecuredItem ( ) , holder . getBaseItem ( ) . listStatements ( s , p , o ) ) ; try { return iter . hasNext ( ) ; } finally { iter . close ( ) ; } } | org . junit . Assert . assertTrue ( model3 . contains ( s , p , o2 ) ) |
testHashCode ( ) { if ( value1 . equals ( value2 ) ) { "<AssertPlaceHolder>" ; } } hashCode ( ) { return getBusinessKey ( ) . hashCode ( ) ; } | org . junit . Assert . assertEquals ( value1 . hashCode ( ) , value2 . hashCode ( ) ) |
mustExecutOnAbortOrCancelProcess_return_false_if_stable ( ) { boundary . setStable ( true ) ; "<AssertPlaceHolder>" ; } mustExecuteOnAbortOrCancelProcess ( ) { return false ; } | org . junit . Assert . assertFalse ( boundary . mustExecuteOnAbortOrCancelProcess ( ) ) |
shouldValidateAndReturnFalseForOrFilterWithIncompatibleProperties ( ) { final uk . gov . gchq . gaffer . store . schema . ViewValidator validator = new uk . gov . gchq . gaffer . store . schema . ViewValidator ( ) ; final uk . gov . gchq . gaffer . data . elementdefinition . view . View view = new uk . gov . gchq . gaffer . data . elementdefinition . view . View . Builder ( ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . data . elementdefinition . view . ViewElementDefinition . Builder ( ) . preAggregationFilter ( new uk . gov . gchq . gaffer . data . element . function . ElementFilter . Builder ( ) . select ( TestPropertyNames . PROP_1 , TestPropertyNames . PROP_2 ) . execute ( new uk . gov . gchq . koryphe . impl . predicate . Or . Builder ( ) . select ( 0 ) . execute ( new uk . gov . gchq . koryphe . impl . predicate . IsMoreThan ( 2 ) ) . select ( 1 ) . execute ( new uk . gov . gchq . koryphe . impl . predicate . IsEqual ( "some<sp>other<sp>value" ) ) . build ( ) ) . build ( ) ) . build ( ) ) . build ( ) ; final uk . gov . gchq . gaffer . store . schema . Schema schema = new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . type ( "obj" , java . lang . Object . class ) . type ( "string" , java . lang . String . class ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . store . schema . SchemaEntityDefinition . Builder ( ) . property ( TestPropertyNames . PROP_1 , "obj" ) . property ( TestPropertyNames . PROP_2 , "string" ) . build ( ) ) . build ( ) ; final uk . gov . gchq . koryphe . ValidationResult result = validator . validate ( view , schema , uk . gov . gchq . gaffer . store . schema . ViewValidatorTest . ALL_STORE_TRAITS ) ; "<AssertPlaceHolder>" ; } validate ( uk . gov . gchq . gaffer . data . elementdefinition . view . View , uk . gov . gchq . gaffer . store . schema . Schema , java . util . Set ) { final boolean isStoreOrdered = storeTraits . contains ( StoreTrait . ORDERED ) ; final uk . gov . gchq . koryphe . ValidationResult result = new uk . gov . gchq . koryphe . ValidationResult ( ) ; if ( null != view ) { final uk . gov . gchq . koryphe . ValidationResult entitiesResult = new uk . gov . gchq . koryphe . ValidationResult ( ) ; validateEntities ( view , schema , storeTraits , isStoreOrdered , result ) ; if ( ! ( entitiesResult . isValid ( ) ) ) { result . add ( entitiesResult ) ; final uk . gov . gchq . koryphe . ValidationResult edgeResult = new uk . gov . gchq . koryphe . ValidationResult ( ) ; validateEdge ( view , schema , storeTraits , isStoreOrdered , result ) ; if ( ! ( edgeResult . isValid ( ) ) ) { result . add ( edgeResult ) ; } } } return result ; } | org . junit . Assert . assertFalse ( result . isValid ( ) ) |
multipleAndSingleSupportedValidator ( ) { final org . springframework . validation . Validator validator1 = mock ( org . springframework . validation . Validator . class , "v1" ) ; final org . springframework . validation . Validator validator2 = mock ( org . springframework . validation . Validator . class , "v2" ) ; when ( validator1 . supports ( any ( java . lang . Class . class ) ) ) . thenReturn ( false ) ; when ( validator2 . supports ( any ( java . lang . Class . class ) ) ) . thenReturn ( true ) ; final biz . deinum . validation . CompositeValidator cv = new biz . deinum . validation . CompositeValidator ( new org . springframework . validation . Validator [ ] { validator1 , validator2 } ) ; "<AssertPlaceHolder>" ; cv . validate ( new java . util . Date ( ) , new org . springframework . validation . MapBindingResult ( new java . util . HashMap ( ) , "command" ) ) ; verify ( validator1 , times ( 0 ) ) . validate ( any ( java . lang . Object . class ) , any ( org . springframework . validation . Errors . class ) ) ; verify ( validator2 , times ( 1 ) ) . validate ( any ( java . lang . Object . class ) , any ( org . springframework . validation . Errors . class ) ) ; } supports ( java . net . URI ) { return delegate . supports ( uri ) ; } | org . junit . Assert . assertTrue ( cv . supports ( java . util . Date . class ) ) |
testCallInvokedWithCorrectService ( ) { com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . Service expectedService = mock ( com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . Service . class ) ; when ( _serviceFactory . create ( com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . FOO_ENDPOINT ) ) . thenReturn ( expectedService ) ; com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . Service actualService = _pool . execute ( com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . NEVER_RETRY , new com . bazaarvoice . ostrich . ServiceCallback < com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . Service , com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . Service > ( ) { @ com . bazaarvoice . ostrich . pool . Override public com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . Service call ( com . bazaarvoice . ostrich . pool . AbstractServicePoolTestingHarness . Service s ) { return s ; } } ) ; "<AssertPlaceHolder>" ; } call ( S ) { try { return method . invoke ( service , args ) ; } catch ( java . lang . IllegalAccessException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . reflect . InvocationTargetException e ) { com . google . common . base . Throwables . throwIfUnchecked ( e . getTargetException ( ) ) ; throw new java . lang . RuntimeException ( e . getTargetException ( ) ) ; } } | org . junit . Assert . assertSame ( expectedService , actualService ) |
testGetJavaPOSIX ( ) { jnr . posix . POSIX posix = jnr . posix . POSIXFactory . getJavaPOSIX ( ) ; "<AssertPlaceHolder>" ; } isNative ( ) { org . junit . Assert . assertFalse ( "JavaPOSIX<sp>isNative<sp>should<sp>be<sp>false" , posix . isNative ( ) ) ; } | org . junit . Assert . assertFalse ( posix . isNative ( ) ) |
testDatatypeValue11 ( ) { java . lang . String init = "insert<sp>data<sp>{" + ( ( "graph<sp>us:g1<sp>{<sp><Jack><sp>rdf:value<sp>1,<sp>1.0,<sp>01,<sp>'1'^^xsd:long,<sp>'01'^^xsd:byte,<sp>1e0,<sp>2<sp>}" + "graph<sp>us:g2<sp>{<sp><Jack><sp>rdf:value<sp>1,<sp>1.0,<sp>01,<sp>'1'^^xsd:long,<sp>'01'^^xsd:byte,<sp>1e0,<sp>2<sp>}" ) + "}<sp>" ) ; java . lang . String q = "delete<sp>data<sp>{<sp><Jack><sp>rdf:value<sp>01<sp>}" ; java . lang . String q2 = "delete<sp>where<sp>{<sp><Jack><sp>rdf:value<sp>01<sp>}" ; java . lang . String q3 = "delete<sp>where<sp>{<sp>?x<sp>rdf:value<sp>01<sp>}" ; java . lang . String q4 = "select<sp>where<sp>{<sp><Jack><sp>rdf:value<sp>01<sp>}" ; fr . inria . corese . core . Graph g = createGraph ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; exec . query ( init ) ; exec . query ( q ) ; "<AssertPlaceHolder>" ; } size ( ) { return varList . size ( ) ; } | org . junit . Assert . assertEquals ( 12 , g . size ( ) ) |
testLangProfile ( ) { com . cybozu . labs . langdetect . util . LangProfile profile = new com . cybozu . labs . langdetect . util . LangProfile ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( profile . name , null ) |
testWDAbsolute ( ) { org . apache . hadoop . fs . Path absoluteDir = getTestRootPath ( fSys , "test/existingDir" ) ; fSys . mkdirs ( absoluteDir ) ; fSys . setWorkingDirectory ( absoluteDir ) ; "<AssertPlaceHolder>" ; } getWorkingDirectory ( ) { return new org . apache . hadoop . fs . Path ( "/" ) . makeQualified ( getUri ( ) , null ) ; } | org . junit . Assert . assertEquals ( absoluteDir , fSys . getWorkingDirectory ( ) ) |
testCreateSampleWithDotInName ( ) { java . lang . String name = "HG007.sample" ; org . opencb . commons . datastore . core . QueryResult < org . opencb . opencga . catalog . managers . Sample > sampleQueryResult = catalogManager . getSampleManager ( ) . create ( studyFqn , new org . opencb . opencga . catalog . managers . Sample ( ) . setId ( name ) , null , sessionIdUser ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( name , sampleQueryResult . first ( ) . getId ( ) ) |
testToString ( ) { java . lang . String name = "name" ; org . bff . javampd . MPDItem item = new org . bff . javampd . MPDItemTest . TestItem ( name ) ; "<AssertPlaceHolder>" ; } toString ( ) { return getFile ( ) ; } | org . junit . Assert . assertEquals ( name , item . toString ( ) ) |
test_adjust_toLocalDate ( ) { org . threeten . extra . chrono . Symmetry454Date sym454 = org . threeten . extra . chrono . Symmetry454Date . of ( 2000 , 1 , 4 ) ; org . threeten . extra . chrono . Symmetry454Date test = sym454 . with ( java . time . LocalDate . of ( 2012 , 7 , 6 ) ) ; "<AssertPlaceHolder>" ; } of ( int , int , int ) { return org . threeten . extra . chrono . Symmetry454Date . create ( prolepticYear , month , dayOfMonth ) ; } | org . junit . Assert . assertEquals ( org . threeten . extra . chrono . Symmetry454Date . of ( 2012 , 7 , 5 ) , test ) |
testResponseAsImage ( ) { request . setResponseAsImage ( true ) ; "<AssertPlaceHolder>" ; } getResponseAsImage ( ) { return getBooleanParameter ( org . piwik . java . tracking . PiwikRequest . RESPONSE_AS_IMAGE ) ; } | org . junit . Assert . assertEquals ( true , request . getResponseAsImage ( ) ) |
diskUuidToSerialTest ( ) { final java . lang . String uuid = "38400000-8cf0-11bd-b24e-10b96e4ef00d" ; final java . lang . String expected = "384000008cf011bdb24e" ; final com . cloud . agent . resource . kvm . LibvirtComputingResource lcr = new com . cloud . agent . resource . kvm . LibvirtComputingResource ( ) ; "<AssertPlaceHolder>" ; } diskUuidToSerial ( java . lang . String ) { final java . lang . String uuidWithoutHyphen = uuid . replace ( "-" , "" ) ; return uuidWithoutHyphen . substring ( 0 , java . lang . Math . min ( uuidWithoutHyphen . length ( ) , 20 ) ) ; } | org . junit . Assert . assertEquals ( expected , lcr . diskUuidToSerial ( uuid ) ) |
testContain ( ) { org . locationtech . jts . geom . GeometryFactory fact = new org . locationtech . jts . geom . GeometryFactory ( ) ; final org . locationtech . jts . geom . LinearRing ring = fact . createLinearRing ( new org . locationtech . jts . geom . Coordinate [ ] { new org . locationtech . jts . geom . Coordinate ( 0.0 , 0.0 ) , new org . locationtech . jts . geom . Coordinate ( 0.0 , 10.0 ) , new org . locationtech . jts . geom . Coordinate ( 5.0 , 10.0 ) , new org . locationtech . jts . geom . Coordinate ( 5.0 , 0.0 ) , new org . locationtech . jts . geom . Coordinate ( 0.0 , 0.0 ) } ) ; final org . locationtech . jts . geom . Geometry geom1 = fact . createPolygon ( ring , null ) ; final org . locationtech . jts . geom . Geometry geom2 = fact . createPoint ( new org . locationtech . jts . geom . Coordinate ( 4 , 5 ) ) ; final org . geotoolkit . process . ProcessDescriptor desc = org . geotoolkit . process . ProcessFinder . getProcessDescriptor ( GeotkProcessingRegistry . NAME , "jts:contain" ) ; final org . opengis . parameter . ParameterValueGroup in = desc . getInputDescriptor ( ) . createValue ( ) ; in . parameter ( "geom1" ) . setValue ( geom1 ) ; in . parameter ( "geom2" ) . setValue ( geom2 ) ; final org . geotoolkit . process . Process proc = desc . createProcess ( in ) ; final java . lang . Boolean result = ( ( java . lang . Boolean ) ( proc . call ( ) . parameter ( "result" ) . getValue ( ) ) ) ; final java . lang . Boolean expected = geom1 . contains ( geom2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final org . geotoolkit . pending . demo . symbology . DemoFrame . PanelNode other = ( ( org . geotoolkit . pending . demo . symbology . DemoFrame . PanelNode ) ( obj ) ) ; if ( ( this . name ) == null ? ( other . name ) != null : ! ( this . name . equals ( other . name ) ) ) { return false ; } if ( ( ( this . candidate ) != ( other . candidate ) ) && ( ( ( this . candidate ) == null ) || ( ! ( this . candidate . equals ( other . candidate ) ) ) ) ) { return false ; } return true ; } | org . junit . Assert . assertTrue ( expected . equals ( result ) ) |
testSimpleQuery ( ) { final java . util . Collection c = this . store . getQueryManager ( ) . createQuery ( ( "SELECT<sp>FROM<sp>org.xwiki.store.legacy.internal.datanucleus.PersistableXWikiDocument<sp>WHERE<sp>" + "fullName<sp>==<sp>\"XWiki.XWikiPreferences\"" ) , "jdoql" ) . execute ( ) ; "<AssertPlaceHolder>" ; } getQueryManager ( ) { return this . queryManager ; } | org . junit . Assert . assertTrue ( ( ( c . size ( ) ) == 1 ) ) |
testClose ( ) { System . out . println ( "close" ) ; com . bixly . pastevid . download . DownloadManager instance = com . bixly . pastevid . download . DownloadManager . getInstance ( ) ; instance . start ( ) ; com . bixly . pastevid . util . TimeUtil . skipToMyLou ( 1 ) ; instance . close ( ) ; "<AssertPlaceHolder>" ; } isRunning ( ) { return this . isRunning ; } | org . junit . Assert . assertFalse ( instance . isRunning ( ) ) |
testSearchPub1 ( ) { jannovar . interval . IntervalTree < java . lang . String > tree = new jannovar . interval . IntervalTree < java . lang . String > ( getIntervalList2 ( ) ) ; java . util . List < java . lang . String > qy = tree . search ( 1 , 1 ) ; "<AssertPlaceHolder>" ; } get ( int ) { return _objects . get ( index ) ; } | org . junit . Assert . assertEquals ( "a" , qy . get ( 0 ) ) |
testWordsWithCircumflex ( ) { zemberek . morphology . TurkishMorphology morphology = getMorphology ( "zek" ) ; zemberek . morphology . analysis . WordAnalysis result = morphology . analyze ( "zek" ) ; "<AssertPlaceHolder>" ; } analysisCount ( ) { return analysisResults . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , result . analysisCount ( ) ) |
shouldThrowLockExceptionIfThrowExceptionIsTrue ( ) { com . mongodb . MongoClient mongoClient = mock ( com . mongodb . MongoClient . class ) ; com . mongodb . client . MongoDatabase db = new com . github . fakemongo . Fongo ( com . github . mongobee . dao . ChangeEntryDaoTest . TEST_SERVER ) . getDatabase ( com . github . mongobee . dao . ChangeEntryDaoTest . DB_NAME ) ; when ( mongoClient . getDatabase ( anyString ( ) ) ) . thenReturn ( db ) ; com . github . mongobee . dao . ChangeEntryDao dao = new com . github . mongobee . dao . ChangeEntryDao ( com . github . mongobee . dao . ChangeEntryDaoTest . CHANGELOG_COLLECTION_NAME , com . github . mongobee . dao . ChangeEntryDaoTest . LOCK_COLLECTION_NAME , com . github . mongobee . dao . ChangeEntryDaoTest . WAIT_FOR_LOCK , com . github . mongobee . dao . ChangeEntryDaoTest . CHANGE_LOG_LOCK_WAIT_TIME , com . github . mongobee . dao . ChangeEntryDaoTest . CHANGE_LOG_LOCK_POLL_RATE , true ) ; com . github . mongobee . dao . LockDao lockDao = mock ( com . github . mongobee . dao . LockDao . class ) ; when ( lockDao . acquireLock ( any ( com . mongodb . client . MongoDatabase . class ) ) ) . thenReturn ( false ) ; dao . setLockDao ( lockDao ) ; dao . connectMongoDb ( mongoClient , com . github . mongobee . dao . ChangeEntryDaoTest . DB_NAME ) ; boolean hasLock = dao . acquireProcessLock ( ) ; "<AssertPlaceHolder>" ; } acquireProcessLock ( ) { verifyDbConnection ( ) ; boolean acquired = lockDao . acquireLock ( getMongoDatabase ( ) ) ; if ( ( ! acquired ) && ( waitForLock ) ) { long timeToGiveUp = ( new java . util . Date ( ) . getTime ( ) ) + ( ( ( changeLogLockWaitTime ) * 1000 ) * 60 ) ; while ( ( ! acquired ) && ( ( new java . util . Date ( ) . getTime ( ) ) < timeToGiveUp ) ) { acquired = lockDao . acquireLock ( getMongoDatabase ( ) ) ; if ( ! acquired ) { com . github . mongobee . dao . ChangeEntryDao . logger . info ( "Waiting<sp>for<sp>changelog<sp>lock...." ) ; try { java . lang . Thread . sleep ( ( ( changeLogLockPollRate ) * 1000 ) ) ; } catch ( java . lang . InterruptedException e ) { } } } } if ( ( ! acquired ) && ( throwExceptionIfCannotObtainLock ) ) { com . github . mongobee . dao . ChangeEntryDao . logger . info ( "Mongobee<sp>did<sp>not<sp>acquire<sp>process<sp>lock.<sp>Throwing<sp>exception." ) ; throw new com . github . mongobee . exception . MongobeeLockException ( "Could<sp>not<sp>acquire<sp>process<sp>lock" ) ; } return acquired ; } | org . junit . Assert . assertFalse ( hasLock ) |
testInputWithInvalidKey ( ) { java . net . URI resource = getClass ( ) . getResource ( "/illegal_key_in_input.sl" ) . toURI ( ) ; io . cloudslang . lang . compiler . modeller . result . ExecutableModellingResult result = compiler . preCompileSource ( io . cloudslang . lang . compiler . SlangSource . fromFile ( resource ) ) ; "<AssertPlaceHolder>" ; exception . expect ( io . cloudslang . lang . compiler . RuntimeException . class ) ; exception . expectMessage ( ( "For<sp>operation<sp>\'illegal_key_in_input\'<sp>syntax<sp>is<sp>illegal.\n" + "key:<sp>karambula<sp>in<sp>input:<sp>input_with_illegal_key<sp>is<sp>not<sp>a<sp>known<sp>property" ) ) ; throw result . getErrors ( ) . get ( 0 ) ; } getErrors ( ) { return errors ; } | org . junit . Assert . assertTrue ( ( ( result . getErrors ( ) . size ( ) ) > 0 ) ) |
testConvertReplyOneDoc ( ) { final java . util . List < com . allanbank . mongodb . bson . Document > docs = java . util . Arrays . asList ( com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . build ( ) ) ; final com . allanbank . mongodb . client . message . Reply reply = new com . allanbank . mongodb . client . message . Reply ( 0 , 0 , 0 , docs , false , false , false , true ) ; final com . allanbank . mongodb . Callback < com . allanbank . mongodb . bson . Document > mockCallback = createMock ( com . allanbank . mongodb . Callback . class ) ; replay ( mockCallback ) ; final com . allanbank . mongodb . client . callback . ReplyCommandCallback callback = new com . allanbank . mongodb . client . callback . ReplyCommandCallback ( mockCallback ) ; "<AssertPlaceHolder>" ; verify ( mockCallback ) ; } get ( long ) { if ( ! ( com . allanbank . mongodb . client . FutureCallback . Sync . tryAcquireSharedNanos ( com . allanbank . mongodb . client . FutureCallback . Sync . UNUSED , nanos ) ) ) { throw new java . util . concurrent . TimeoutException ( "Timeout<sp>waiting<sp>for<sp>task." ) ; } return getValue ( ) ; } | org . junit . Assert . assertSame ( docs . get ( 0 ) , callback . convert ( reply ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.