Repository: juddi Updated Branches: refs/heads/master ad8ecf462 -> 7ccb68295
JUDDI-899 adding test cases for this issue. It appears to be a non-issue. JUDDI-881 adding additional checks to ensure correct operation in openjpa and hibernate Project: http://git-wip-us.apache.org/repos/asf/juddi/repo Commit: http://git-wip-us.apache.org/repos/asf/juddi/commit/7ccb6829 Tree: http://git-wip-us.apache.org/repos/asf/juddi/tree/7ccb6829 Diff: http://git-wip-us.apache.org/repos/asf/juddi/diff/7ccb6829 Branch: refs/heads/master Commit: 7ccb68295ace2e1ce5bb98f026a3645448c47de3 Parents: ad8ecf4 Author: Alex <[email protected]> Authored: Fri Dec 26 22:18:43 2014 -0500 Committer: Alex <[email protected]> Committed: Fri Dec 26 22:18:43 2014 -0500 ---------------------------------------------------------------------- juddi-core-openjpa/pom.xml | 30 ++- .../src/test/resources/META-INF/persistence.xml | 2 +- .../resources/juddiv3DisabledTModelKeybag.xml | 200 ++++++++++++++++++ .../main/java/org/apache/juddi/Registry.java | 1 + .../apache/juddi/api/impl/InquiryHelper.java | 4 +- .../apache/juddi/api/impl/UDDIInquiryImpl.java | 10 + .../java/org/apache/juddi/config/AppConfig.java | 9 +- .../impl/API_040_BusinessServiceLoadTest.java | 205 +++++++++++-------- .../api/impl/API_050_BindingTemplateTest.java | 62 +++--- .../resources/juddiv3DisabledTModelKeybag.xml | 200 ++++++++++++++++++ .../org/apache/juddi/v3/tck/TckFindEntity.java | 2 +- 11 files changed, 600 insertions(+), 125 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core-openjpa/pom.xml ---------------------------------------------------------------------- diff --git a/juddi-core-openjpa/pom.xml b/juddi-core-openjpa/pom.xml index bf5759b..92c2b79 100644 --- a/juddi-core-openjpa/pom.xml +++ b/juddi-core-openjpa/pom.xml @@ -68,7 +68,7 @@ <plugin> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-maven-plugin</artifactId> - <version>2.2.1</version> + <version>2.3.0</version> <configuration> <includes>**/org/apache/juddi/model/*.class</includes> <addDefaultConstructor>true</addDefaultConstructor> @@ -88,10 +88,34 @@ <dependency> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa</artifactId> - <version>2.2.1</version> + <version>2.3.0</version> </dependency> </dependencies> </plugin> + + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <version>2.6.1</version> + <configuration> + <filesets> + <fileset> + <directory>src/main/java</directory> + <includes> + <include>**/*</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>src/test/java</directory> + <includes> + <include>**/*</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + </filesets> + </configuration> + </plugin> + </plugins> </build> <dependencies> @@ -123,7 +147,7 @@ <dependency> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa</artifactId> - <version>2.2.1</version> + <version>2.3.0</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core-openjpa/src/test/resources/META-INF/persistence.xml ---------------------------------------------------------------------- diff --git a/juddi-core-openjpa/src/test/resources/META-INF/persistence.xml b/juddi-core-openjpa/src/test/resources/META-INF/persistence.xml index f42c65f..92d777f 100644 --- a/juddi-core-openjpa/src/test/resources/META-INF/persistence.xml +++ b/juddi-core-openjpa/src/test/resources/META-INF/persistence.xml @@ -93,7 +93,7 @@ <property name="openjpa.ConnectionURL" value="jdbc:derby:memory:juddi-derby-test-db;create=true"/> <property name="openjpa.ConnectionUserName" value=""/> <property name="openjpa.ConnectionPassword" value=""/> - + <!--<property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>--> <!-- mysql connection properties <property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost:3306/juddi"/> http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core-openjpa/src/test/resources/juddiv3DisabledTModelKeybag.xml ---------------------------------------------------------------------- diff --git a/juddi-core-openjpa/src/test/resources/juddiv3DisabledTModelKeybag.xml b/juddi-core-openjpa/src/test/resources/juddiv3DisabledTModelKeybag.xml new file mode 100644 index 0000000..879933c --- /dev/null +++ b/juddi-core-openjpa/src/test/resources/juddiv3DisabledTModelKeybag.xml @@ -0,0 +1,200 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- +################################################################ +# jUDDI-v3.0 configuration. # +################################################################ +# Note that the property settings in this # +# file can be overriden by system parameters # +# # +################################################################ +--> +<config> + <juddi> + <!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. --> + <server> + <baseurl>http://localhost:8080/juddiv3</baseurl> + <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure> + </server> + <!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API + don't worry, jUDDI doesn't implement it right now, but it may come in the future --> + <nodeId>uddi:juddi.apache.org:node1</nodeId> + <!-- The key of the root business that all of the UDDI services are registered in, as defined in the install_data --> + <root> + <!-- this is the 'root' username, or owner of the node --> + <publisher>root</publisher> + <!-- The key of the root business that all of the UDDI services are registered in, as defined in the install_data --> + <businessId>uddi:juddi.apache.org:businesses-asf</businessId> + <partition>uddi:juddi.apache.org</partition> + </root> + <seed> + <always>false</always> + </seed> + + <!-- Name of the persistence unit to use (the default, "juddiDatabase" refers to the unit compiled into the juddi library)--> + <persistenceunit> + <name>juddiDatabase</name> + </persistenceunit> + + <!-- Check-the-time-stamp-on-this-file Interval in milli seconds --> + <configuration> + <reload> + <delay>2000</delay> + </reload> + </configuration> + <!--Default locale--> + <locale>en_US</locale> + + <!--The UDDI Operator Contact Email Address--> + <operatorEmailAddress>[email protected]</operatorEmailAddress> + + <!-- The maximum name size and maximum number of name elements allows in several of the FindXxxx and SaveXxxx UDDI functions.--> + <maxNameLength>255</maxNameLength> + <maxNameElementsAllowed>5</maxNameElementsAllowed> + + + <!-- The maximum number of rows returned in a find_* operation. Each call can set this independently, but this property defines a global maximum.--> + <maxRows>1000</maxRows> + <!-- The maximum number of "IN" clause parameters. Some RDMBS limit the number of parameters allowed in a SQL "IN" clause.--> + <maxInClause>1000</maxInClause> + + <!-- The maximum number of UDDI artifacts allowed per publisher. A value of '-1' indicates any number of artifacts is valid (These values can be overridden at the individual publisher level).--> + <maxBusinessesPerPublisher>100</maxBusinessesPerPublisher> + <maxServicesPerBusiness>100</maxServicesPerBusiness> + <maxBindingsPerService>100</maxBindingsPerService> + <maxTModelsPerPublisher>100</maxTModelsPerPublisher> + + <!-- Days before a transfer request expires--> + <transfer> + <expiration> + <days>3</days> + </expiration> + </transfer> + + <!-- Days before a subscription expires--> + <subscription> + <expiration> + <days>30</days> + </expiration> + + <!-- Minutes before a "chunked" subscription call expires--> + <chunkexpiration> + <minutes>5</minutes> + </chunkexpiration> + + <!--Since 3.1.5 the maxium ammount of returned subscription entities allowed--> + <maxentities>1000</maxentities> + </subscription> + + <!-- jUDDI UUIDGen implementation to use--> + <uuidgen>org.apache.juddi.uuidgen.DefaultUUIDGen</uuidgen> + + <!-- jUDDI Cryptor implementation to use--> + <cryptor>org.apache.juddi.v3.client.cryptor.DefaultCryptor</cryptor> + + <!-- jUDDI Key Generator to use--> + <keygenerator>org.apache.juddi.keygen.DefaultKeyGenerator</keygenerator> + + <notification> + <!-- Specifies the interval at which the notification timer triggers--> + <interval>5000</interval> + <!-- Specifies the amount of time to wait before the notification timer initially fires--> + <start> + <buffer>0</buffer> + </start> + <acceptableLagtime>1000</acceptableLagtime> + <maxTries>3</maxTries> + <!-- 10 minutes --> + <maxTriesResetInterval>600000</maxTriesResetInterval> + <sendAuthTokenWithResultList>false</sendAuthTokenWithResultList> + </notification> + <!-- All Authentication related settings --> + <auth> + <!-- Specifies whether the inquiry API requires authentication, all other APIs require authN--> + <Inquiry>false</Inquiry> + + <!-- When using file based authentication, this is the filename to use + <usersfile>juddi-users.xml</usersfile>--> + <!-- jUDDI Authentication module to use--> + <authenticator> + <!-- build in Authenticators: + org.apache.juddi.v3.auth.JUDDIAuthenticator - no authentication + LDAP Based + org.apache.juddi.v3.auth.LdapSimpleAuthenticator - use LDAP + org.apache.juddi.v3.auth.LdapExpandedAuthenticator - use LDAP + + File based, see usersfile + org.apache.juddi.v3.auth.XMLDocAuthenticator - XML doc, clear text + org.apache.juddi.v3.auth.CryptedXMLDocAuthenticator - XML doc, encrypted + org.apache.juddi.v3.auth.MD5XMLDocAuthenticator - XML doc, Hashed + + See also, the Jboss Authenticator + --> + <class>org.apache.juddi.v3.auth.JUDDIAuthenticator</class> + <!-- other settings (mostly used by Ldap based auth mods + url + initialcontext + style + ldapexp + --> + </authenticator> + + <token> + <!-- Time in minutes to expire tokes after inactivity--> + <Timeout>15</Timeout> + <!-- As of 3.1.5 Duration of time for tokens to expire, regardless of inactivity --> + <Expiration>15</Expiration> + <!-- As of 3.2, when set to true, tokens can only be used from the same IP address they were issued to --> + <enforceSameIPRule>true</enforceSameIPRule> + </token> + </auth> + + + + + <validation> + <!-- As of 3.1.5 This setting will force referential integrity for all tModels (except keyGenerators), category bags, bindingTemplate/AccessPoint/hostingRedirector (referencing another host), tModelinstanceparms and anything else that references a KeyName default value is true. set to false for backwards compatibility or for a more lax registry--> + <enforceReferentialIntegrity>true</enforceReferentialIntegrity> + </validation> + + <!--As of 3.1.5 Email delivery options for subscription API functions--> + <mail> + <smtp> + <!--The Operatorâs Email address + <from>[email protected]</from>--> + + <!--the hostname of the SMTP server + <host>localhost</host>--> + + <!--The portname of the SMTP server + <port>25</port>--> + + <!--If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create SMTP sockets.--> + <socketFactory> + <!--<class></class>--> + + <!--If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true. + <fallback>true</fallback>--> + <!--Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. + <port>25</port>--> + </socketFactory> + <!--if true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Note that an appropriate trust store must configured so that the client will trust the serverâs certificate. Defaults to false. + <starttls> + <enabled>false</enabled> + </starttls>--> + + <!--If true, attempt to authenticate the user using the AUTH command. Defaults to false. + <auth>false</auth>--> + + <!--Username used to authenticate to the SMTP server used only if mail.smtp.auth is true + <user>user</user>--> + + <!--Password used to authenticate to the SMTP server, used only if mail.smtp.auth is true + <password encrypted="false">pass</password>--> + </smtp> + </mail> + + <preformance> + <enableFindBusinessTModelBagFiltering>false</enableFindBusinessTModelBagFiltering> + </preformance> + </juddi> +</config> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core/src/main/java/org/apache/juddi/Registry.java ---------------------------------------------------------------------- diff --git a/juddi-core/src/main/java/org/apache/juddi/Registry.java b/juddi-core/src/main/java/org/apache/juddi/Registry.java index 60477ef..eaaff53 100644 --- a/juddi-core/src/main/java/org/apache/juddi/Registry.java +++ b/juddi-core/src/main/java/org/apache/juddi/Registry.java @@ -81,6 +81,7 @@ public class Registry { log.info("Starting jUDDI registry..."); registry = new Registry(); replicationNotifier = new ReplicationNotifier(); + AppConfig.triggerReload(); if (AppConfig.getConfiguration().getBoolean(Property.JUDDI_SUBSCRIPTION_NOTIFICATION, true)) { subscriptionNotifier = new SubscriptionNotifier(); } http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java ---------------------------------------------------------------------- diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java index 90e4eb8..1b3b9b9 100644 --- a/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java +++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java @@ -234,11 +234,13 @@ public class InquiryHelper { boolean enabled = true; try { - AppConfig.getConfiguration().getBoolean(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING, true); + //AppConfig.reloadConfig(); + enabled= AppConfig.getConfiguration().getBoolean(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING, true); } catch (ConfigurationException ex) { logger.error(ex); } if (enabled) { + logger.info("FindBusiness by tModelBag is enabled! Loaded from " + AppConfig.getConfigFileURL()); List<?> serviceResults = null; for (int i = 0; i < queryResults.size(); i++) { org.apache.juddi.model.BusinessEntity be = (org.apache.juddi.model.BusinessEntity) queryResults.get(i); http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java ---------------------------------------------------------------------- diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java index c043298..2f47e43 100644 --- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java +++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java @@ -20,6 +20,8 @@ package org.apache.juddi.api.impl; import java.io.File; import java.io.FileOutputStream; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.jws.WebService; import javax.persistence.EntityManager; import javax.persistence.EntityTransaction; @@ -190,6 +192,14 @@ public class UDDIInquiryImpl extends AuthenticatedService implements UDDIInquiry EntityManager em = PersistenceManager.getEntityManager(); EntityTransaction tx = em.getTransaction(); try { + try { + //AppConfig.reloadConfig(); + logger.info("FindBusiness with tModel bag filtering is enabled: " + + AppConfig.getConfiguration().getBoolean(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING,true) + + " loaded from " + AppConfig.getConfigFileURL()); + } catch (ConfigurationException ex) { + ex.printStackTrace(); + } tx.begin(); if (isAuthenticated()) http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java ---------------------------------------------------------------------- diff --git a/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java b/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java index fcfaeaf..47c11a9 100644 --- a/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java +++ b/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java @@ -21,8 +21,6 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.List; import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.persistence.EntityManager; import javax.persistence.EntityTransaction; @@ -31,7 +29,6 @@ import org.apache.commons.configuration.CompositeConfiguration; import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.MapConfiguration; -import org.apache.commons.configuration.PropertiesConfiguration; import org.apache.commons.configuration.SystemConfiguration; import org.apache.commons.configuration.XMLConfiguration; import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy; @@ -88,7 +85,7 @@ public class AppConfig } /** * Does the actual work of reading the configuration from System - * Properties and/or juddiv3.properties file. When the juddiv3.properties + * Properties and/or juddiv3.xml file. When the juddiv3.xml * file is updated the file will be reloaded. By default the reloadDelay is * set to 1 second to prevent excessive date stamp checking. */ @@ -249,6 +246,10 @@ public class AppConfig getInstance().loadConfiguration(); Registry.start(); } + + public static void triggerReload() throws ConfigurationException{ + getInstance().loadConfiguration(); + } /** * The object from which property values can be obtained. * @return the commons Configuration interface http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core/src/test/java/org/apache/juddi/api/impl/API_040_BusinessServiceLoadTest.java ---------------------------------------------------------------------- diff --git a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_040_BusinessServiceLoadTest.java b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_040_BusinessServiceLoadTest.java index 9062a79..15aef45 100644 --- a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_040_BusinessServiceLoadTest.java +++ b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_040_BusinessServiceLoadTest.java @@ -14,6 +14,7 @@ */ package org.apache.juddi.api.impl; +import java.io.File; import java.rmi.RemoteException; import org.apache.commons.configuration.ConfigurationException; @@ -21,6 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.juddi.Registry; import org.apache.juddi.config.AppConfig; +import static org.apache.juddi.config.AppConfig.JUDDI_CONFIGURATION_FILE_SYSTEM_PROPERTY; import org.apache.juddi.config.Property; import org.apache.juddi.query.util.FindQualifiers; import org.apache.juddi.v3.tck.TckBusiness; @@ -43,103 +45,126 @@ import org.uddi.v3_service.UDDISecurityPortType; /** * @author <a href="mailto:[email protected]">Kurt T Stam</a> + * @author <a href="mailto:[email protected]">Alex O'Ree</a> */ -public class API_040_BusinessServiceLoadTest -{ - private static Log logger = LogFactory.getLog(API_040_BusinessServiceTest.class); - - private static API_010_PublisherTest api010 = new API_010_PublisherTest(); - protected static TckTModel tckTModel = new TckTModel(new UDDIPublicationImpl(), new UDDIInquiryImpl()); - protected static TckBusiness tckBusiness = new TckBusiness(new UDDIPublicationImpl(), new UDDIInquiryImpl()); - protected static TckBusinessService tckBusinessService = new TckBusinessService(new UDDIPublicationImpl(), new UDDIInquiryImpl()); - private static UDDIInquiryImpl inquiry = new UDDIInquiryImpl(); - - int numberOfBusinesses=100; - int numberOfServices=100; - - protected static String authInfoJoe = null; - protected static String authInfoSam = null; - - @BeforeClass - public static void setup() throws ConfigurationException { - Registry.start(); +public class API_040_BusinessServiceLoadTest { + + private static Log logger = LogFactory.getLog(API_040_BusinessServiceTest.class); + + private static API_010_PublisherTest api010 = new API_010_PublisherTest(); + protected static TckTModel tckTModel = new TckTModel(new UDDIPublicationImpl(), new UDDIInquiryImpl()); + protected static TckBusiness tckBusiness = new TckBusiness(new UDDIPublicationImpl(), new UDDIInquiryImpl()); + protected static TckBusinessService tckBusinessService = new TckBusinessService(new UDDIPublicationImpl(), new UDDIInquiryImpl()); + private static UDDIInquiryImpl inquiry = new UDDIInquiryImpl(); + + int numberOfBusinesses = 100; + int numberOfServices = 100; + + protected static String authInfoJoe = null; + protected static String authInfoSam = null; + + @BeforeClass + public static void setup() throws ConfigurationException { + File f = new File("."); + System.out.println("Current working dir is " + f.getAbsolutePath()); + System.setProperty(JUDDI_CONFIGURATION_FILE_SYSTEM_PROPERTY, f.getAbsolutePath()+"/src/test/resources/juddiv3DisabledTModelKeybag.xml"); + Registry.start(); logger.info("API_040_BusinessServiceTestPerformance"); - logger.debug("Getting auth tokens.."); - try { - api010.saveJoePublisher(); - UDDISecurityPortType security = new UDDISecurityImpl(); - authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword()); - String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword()); - tckTModel.saveUDDIPublisherTmodel(authInfoUDDI); - tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML); - } catch (RemoteException e) { - logger.error(e.getMessage(), e); - Assert.fail("Could not obtain authInfo token."); - } - } - + logger.debug("Getting auth tokens.."); + try { + api010.saveJoePublisher(); + UDDISecurityPortType security = new UDDISecurityImpl(); + authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword()); + String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword()); + tckTModel.saveUDDIPublisherTmodel(authInfoUDDI); + tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML); + } catch (RemoteException e) { + logger.error(e.getMessage(), e); + Assert.fail("Could not obtain authInfo token."); + } + } + @AfterClass - public static void shutdown() throws ConfigurationException{ + public static void shutdown() throws ConfigurationException { tckTModel.deleteCreatedTModels(authInfoJoe); Registry.stop(); + System.clearProperty(JUDDI_CONFIGURATION_FILE_SYSTEM_PROPERTY); } - - @Test + + /** + * loads the database with 100x100 services, runs a basic query, then + * deletes the records + * + * @throws DispositionReportFaultMessage + * @throws ConfigurationException + */ + @Test //@Ignore - public void find20Businesses() throws DispositionReportFaultMessage, ConfigurationException { + public void find20Businesses() throws DispositionReportFaultMessage, ConfigurationException { //disable TModelBag filtering - logger.info("Disabling findBusiness tModelBag filtering...."); - AppConfig.getConfiguration().setProperty(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING, false); - logger.info("findBusiness tModelBag filtering is enabled: " + - AppConfig.getConfiguration().getProperty(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING)); - tckTModel.saveJoePublisherTmodel(authInfoJoe); - long startSave = System.currentTimeMillis(); - //loading up 100 businesses, with a 100 services each - tckBusiness.saveJoePublisherBusinesses(authInfoJoe, numberOfBusinesses); - for (int i=0; i<numberOfBusinesses; i++) { - tckBusinessService.saveJoePublisherServices(authInfoJoe, i, numberOfServices); - } - long saveDuration = System.currentTimeMillis() - startSave; - System.out.println("Saved " + numberOfBusinesses + " businesses with each " + numberOfServices + " services in " + saveDuration + "ms"); - System.out.println("Tiggering findBusiness query..."); - //find 20 businesses by name - FindBusiness fb = new FindBusiness(); - org.uddi.api_v3.FindQualifiers apiFq = new org.uddi.api_v3.FindQualifiers(); - apiFq.getFindQualifier().add(FindQualifiers.APPROXIMATE_MATCH); - apiFq.getFindQualifier().add(FindQualifiers.CASE_INSENSITIVE_MATCH); - fb.setFindQualifiers(apiFq); - Name name = new Name(); - name.setValue("John%"); - fb.getName().add(name); - fb.setMaxRows(20); - long startFind = System.currentTimeMillis(); - BusinessList result = inquiry.findBusiness(fb); - long findDuration = System.currentTimeMillis() - startFind; - System.out.println("Find 20 businesses took " + findDuration + "ms. Size=" + result.getBusinessInfos().getBusinessInfo().size()); - // it takes less then 1 second, make sure it stays faster then 5 seconds - //Assert.assertTrue(findDuration < 5000); - System.out.println("Tiggering findService query..."); - FindService fs = new FindService(); - fs.setFindQualifiers(apiFq); - name.setValue("Service One%"); - fs.getName().add(name); - startFind = System.currentTimeMillis(); - //this will match ALL services (100 * 100 =) 10,000 services - int all = numberOfBusinesses * numberOfServices; - System.out.println("Matching " + all+ " services"); - ServiceList serviceList = inquiry.findService(fs); - findDuration = System.currentTimeMillis() - startFind; - System.out.println("Find " + all + " services took " + findDuration + "ms. Size=" + serviceList.getServiceInfos().getServiceInfo().size()); + try { + //logger.info("Disabling findBusiness tModelBag filtering...."); + //AppConfig.getConfiguration().setProperty(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING, false); + //logger.info("findBusiness tModelBag filtering is enabled: " + // + AppConfig.getConfiguration().getProperty(Property.JUDDI_ENABLE_FIND_BUSINESS_TMODEL_BAG_FILTERING)); + System.setProperty(JUDDI_CONFIGURATION_FILE_SYSTEM_PROPERTY, "/src/test/resources/juddiv3DisabledTModelKeybag.xml"); + tckTModel.saveJoePublisherTmodel(authInfoJoe); + long startSave = System.currentTimeMillis(); + //loading up 100 businesses, with a 100 services each + tckBusiness.saveJoePublisherBusinesses(authInfoJoe, numberOfBusinesses); + for (int i = 0; i < numberOfBusinesses; i++) { + tckBusinessService.saveJoePublisherServices(authInfoJoe, i, numberOfServices); + } + long saveDuration = System.currentTimeMillis() - startSave; + System.out.println("Saved " + numberOfBusinesses + " businesses with each " + numberOfServices + " services in " + saveDuration + "ms"); + System.out.println("Tiggering findBusiness query..."); + //find 20 businesses by name + FindBusiness fb = new FindBusiness(); + org.uddi.api_v3.FindQualifiers apiFq = new org.uddi.api_v3.FindQualifiers(); + apiFq.getFindQualifier().add(FindQualifiers.APPROXIMATE_MATCH); + apiFq.getFindQualifier().add(FindQualifiers.CASE_INSENSITIVE_MATCH); + fb.setFindQualifiers(apiFq); + Name name = new Name(); + name.setValue("John%"); + fb.getName().add(name); + fb.setMaxRows(20); + long startFind = System.currentTimeMillis(); + BusinessList result = inquiry.findBusiness(fb); + long findDuration = System.currentTimeMillis() - startFind; + System.out.println("Find 20 businesses took " + findDuration + "ms. Size=" + result.getBusinessInfos().getBusinessInfo().size()); + // it takes less then 1 second, make sure it stays faster then 5 seconds + if (findDuration > 20000) { + Assert.fail("This operation took too long to process"); + } + //Assert.assertTrue(findDuration < 5000); + System.out.println("Tiggering findService query..."); + FindService fs = new FindService(); + fs.setFindQualifiers(apiFq); + name.setValue("Service One%"); + fs.getName().add(name); + startFind = System.currentTimeMillis(); + //this will match ALL services (100 * 100 =) 10,000 services + int all = numberOfBusinesses * numberOfServices; + System.out.println("Matching " + all + " services"); + ServiceList serviceList = inquiry.findService(fs); + findDuration = System.currentTimeMillis() - startFind; + System.out.println("Find " + all + " services took " + findDuration + "ms. Size=" + serviceList.getServiceInfos().getServiceInfo().size()); + if (findDuration > 20000) { + Assert.fail("This operation took too long to process"); + } + + } finally { + System.out.println("Tiggering deletion..."); + long startDelete = System.currentTimeMillis(); + for (int i = 0; i < numberOfBusinesses; i++) { + tckBusinessService.deleteJoePublisherServices(authInfoJoe, i, numberOfServices); + } + long deleteDuration = System.currentTimeMillis() - startDelete; + System.out.println("Delete all business and services in " + deleteDuration + "ms"); + tckBusiness.deleteJoePublisherBusinesses(authInfoJoe, numberOfBusinesses); + tckTModel.deleteJoePublisherTmodel(authInfoJoe); + } + + } - System.out.println("Tiggering deletion..."); - long startDelete = System.currentTimeMillis(); - for (int i=0; i<numberOfBusinesses; i++) { - tckBusinessService.deleteJoePublisherServices(authInfoJoe, i, numberOfServices); - } - long deleteDuration = System.currentTimeMillis() - startDelete; - System.out.println("Delete all business and services in " + deleteDuration + "ms"); - tckBusiness.deleteJoePublisherBusinesses(authInfoJoe, numberOfBusinesses); - tckTModel.deleteJoePublisherTmodel(authInfoJoe); - } - } http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core/src/test/java/org/apache/juddi/api/impl/API_050_BindingTemplateTest.java ---------------------------------------------------------------------- diff --git a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_050_BindingTemplateTest.java b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_050_BindingTemplateTest.java index f8c679d..072c188 100644 --- a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_050_BindingTemplateTest.java +++ b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_050_BindingTemplateTest.java @@ -150,43 +150,55 @@ public class API_050_BindingTemplateTest { * * @throws Exception */ - @Test - //@Ignore + @Test public void testJUDDI_899() throws Exception { - UDDIInquiryImpl inquiry = new UDDIInquiryImpl(); + try { + tckTModel.saveJoePublisherTmodel(authInfoJoe); + tckBusiness.saveJoePublisherBusiness(authInfoJoe); + tckBusinessService.saveJoePublisherService(authInfoJoe); + tckBindingTemplate.saveJoePublisherBinding(authInfoJoe); + + UDDIInquiryImpl inquiry = new UDDIInquiryImpl(); - FindBinding fb = new FindBinding(); - fb.setAuthInfo(authInfoJoe); + FindBinding fb = new FindBinding(); + fb.setAuthInfo(authInfoJoe); - fb.setTModelBag(new TModelBag()); - //this is stored in joe's binding template - fb.getTModelBag().getTModelKey().add("uddi:uddi.org:protocol:serverauthenticatedssl3"); + fb.setTModelBag(new TModelBag()); + //this is stored in joe's binding template + fb.getTModelBag().getTModelKey().add("uddi:uddi.org:protocol:serverauthenticatedssl3"); + logger.info("testJUDDI_899 searching..."); + BindingDetail findBinding = inquiry.findBinding(fb); + logger.info("testJUDDI_899 searching complete."); + Assert.assertNotNull(findBinding); + Assert.assertNotNull(findBinding.getBindingTemplate()); + Assert.assertFalse(findBinding.getBindingTemplate().isEmpty()); - BindingDetail findBinding = inquiry.findBinding(fb); - Assert.assertNotNull(findBinding); - Assert.assertNotNull(findBinding.getBindingTemplate()); - Assert.assertFalse(findBinding.getBindingTemplate().isEmpty()); - for (int i = 0; i < findBinding.getBindingTemplate().size(); i++) { if (findBinding.getBindingTemplate().get(i).getBindingKey().equals(TckBindingTemplate.JOE_BINDING_KEY)) { return; } } - - /* if (findBinding.isTruncated()==null) { - findBinding.setTruncated(false); + + Assert.fail("Binding wasn't returned"); + } finally { + tckBusinessService.deleteJoePublisherService(authInfoJoe); + tckBusiness.deleteJoePublisherBusiness(authInfoJoe); + tckTModel.deleteJoePublisherTmodel(authInfoJoe); } - //support for paging - while (!findBinding.isTruncated() && !findBinding.getBindingTemplate().isEmpty()) { + /* if (findBinding.isTruncated()==null) { + findBinding.setTruncated(false); + } + //support for paging + while (!findBinding.isTruncated() && !findBinding.getBindingTemplate().isEmpty()) { - findBinding = inquiry.findBinding(fb); - Assert.assertNotNull(findBinding); + findBinding = inquiry.findBinding(fb); + Assert.assertNotNull(findBinding); - if (findBinding.isTruncated()) { - findBinding.setTruncated(false); - } - } + if (findBinding.isTruncated()) { + findBinding.setTruncated(false); + } + } - Assert.fail("The expected service wasn't returned");*/ + Assert.fail("The expected service wasn't returned");*/ } } http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/juddi-core/src/test/resources/juddiv3DisabledTModelKeybag.xml ---------------------------------------------------------------------- diff --git a/juddi-core/src/test/resources/juddiv3DisabledTModelKeybag.xml b/juddi-core/src/test/resources/juddiv3DisabledTModelKeybag.xml new file mode 100644 index 0000000..ca17631 --- /dev/null +++ b/juddi-core/src/test/resources/juddiv3DisabledTModelKeybag.xml @@ -0,0 +1,200 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- +################################################################ +# jUDDI-v3.0 configuration. # +################################################################ +# Note that the property settings in this # +# file can be overriden by system parameters # +# # +################################################################ +--> +<config> + <juddi> + <!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. --> + <server> + <baseurl>http://localhost:8080/juddiv3</baseurl> + <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure> + </server> + <!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API + don't worry, jUDDI doesn't implement it right now, but it may come in the future --> + <nodeId>uddi:juddi.apache.org:node1</nodeId> + <!-- The key of the root business that all of the UDDI services are registered in, as defined in the install_data --> + <root> + <!-- this is the 'root' username, or owner of the node --> + <publisher>root</publisher> + <!-- The key of the root business that all of the UDDI services are registered in, as defined in the install_data --> + <businessId>uddi:juddi.apache.org:businesses-asf</businessId> + <partition>uddi:juddi.apache.org</partition> + </root> + <seed> + <always>false</always> + </seed> + + <!-- Name of the persistence unit to use (the default, "juddiDatabase" refers to the unit compiled into the juddi library)--> + <persistenceunit> + <name>juddiDatabase</name> + </persistenceunit> + + <!-- Check-the-time-stamp-on-this-file Interval in milli seconds --> + <configuration> + <reload> + <delay>2000</delay> + </reload> + </configuration> + <!--Default locale--> + <locale>en_US</locale> + + <!--The UDDI Operator Contact Email Address--> + <operatorEmailAddress>[email protected]</operatorEmailAddress> + + <!-- The maximum name size and maximum number of name elements allows in several of the FindXxxx and SaveXxxx UDDI functions.--> + <maxNameLength>255</maxNameLength> + <maxNameElementsAllowed>5</maxNameElementsAllowed> + + + <!-- The maximum number of rows returned in a find_* operation. Each call can set this independently, but this property defines a global maximum.--> + <maxRows>1000</maxRows> + <!-- The maximum number of "IN" clause parameters. Some RDMBS limit the number of parameters allowed in a SQL "IN" clause.--> + <maxInClause>1000</maxInClause> + + <!-- The maximum number of UDDI artifacts allowed per publisher. A value of '-1' indicates any number of artifacts is valid (These values can be overridden at the individual publisher level).--> + <maxBusinessesPerPublisher>100</maxBusinessesPerPublisher> + <maxServicesPerBusiness>100</maxServicesPerBusiness> + <maxBindingsPerService>100</maxBindingsPerService> + <maxTModelsPerPublisher>100</maxTModelsPerPublisher> + + <!-- Days before a transfer request expires--> + <transfer> + <expiration> + <days>3</days> + </expiration> + </transfer> + + <!-- Days before a subscription expires--> + <subscription> + <expiration> + <days>30</days> + </expiration> + + <!-- Minutes before a "chunked" subscription call expires--> + <chunkexpiration> + <minutes>5</minutes> + </chunkexpiration> + + <!--Since 3.1.5 the maxium ammount of returned subscription entities allowed--> + <maxentities>1000</maxentities> + </subscription> + + <!-- jUDDI UUIDGen implementation to use--> + <uuidgen>org.apache.juddi.uuidgen.DefaultUUIDGen</uuidgen> + + <!-- jUDDI Cryptor implementation to use--> + <cryptor>org.apache.juddi.v3.client.cryptor.DefaultCryptor</cryptor> + + <!-- jUDDI Key Generator to use--> + <keygenerator>org.apache.juddi.keygen.DefaultKeyGenerator</keygenerator> + + <notification> + <!-- Specifies the interval at which the notification timer triggers--> + <interval>5000</interval> + <!-- Specifies the amount of time to wait before the notification timer initially fires--> + <start> + <buffer>0</buffer> + </start> + <acceptableLagtime>1000</acceptableLagtime> + <maxTries>3</maxTries> + <!-- 10 minutes --> + <maxTriesResetInterval>600000</maxTriesResetInterval> + <sendAuthTokenWithResultList>false</sendAuthTokenWithResultList> + </notification> + <!-- All Authentication related settings --> + <auth> + <!-- Specifies whether the inquiry API requires authentication, all other APIs require authN--> + <Inquiry>false</Inquiry> + + <!-- When using file based authentication, this is the filename to use + <usersfile>juddi-users.xml</usersfile>--> + <!-- jUDDI Authentication module to use--> + <authenticator> + <!-- build in Authenticators: + org.apache.juddi.v3.auth.JUDDIAuthenticator - no authentication + LDAP Based + org.apache.juddi.v3.auth.LdapSimpleAuthenticator - use LDAP + org.apache.juddi.v3.auth.LdapExpandedAuthenticator - use LDAP + + File based, see usersfile + org.apache.juddi.v3.auth.XMLDocAuthenticator - XML doc, clear text + org.apache.juddi.v3.auth.CryptedXMLDocAuthenticator - XML doc, encrypted + org.apache.juddi.v3.auth.MD5XMLDocAuthenticator - XML doc, Hashed + + See also, the Jboss Authenticator + --> + <class>org.apache.juddi.v3.auth.JUDDIAuthenticator</class> + <!-- other settings (mostly used by Ldap based auth mods + url + initialcontext + style + ldapexp + --> + </authenticator> + + <token> + <!-- Time in minutes to expire tokes after inactivity--> + <Timeout>15</Timeout> + <!-- As of 3.1.5 Duration of time for tokens to expire, regardless of inactivity --> + <Expiration>15</Expiration> + <!-- As of 3.2, when set to true, tokens can only be used from the same IP address they were issued to --> + <enforceSameIPRule>true</enforceSameIPRule> + </token> + </auth> + + + + + <validation> + <!-- As of 3.1.5 This setting will force referential integrity for all tModels (except keyGenerators), category bags, bindingTemplate/AccessPoint/hostingRedirector (referencing another host), tModelinstanceparms and anything else that references a KeyName default value is true. set to false for backwards compatibility or for a more lax registry--> + <enforceReferentialIntegrity>true</enforceReferentialIntegrity> + </validation> + + <!--As of 3.1.5 Email delivery options for subscription API functions--> + <mail> + <smtp> + <!--The Operatorâs Email address + <from>[email protected]</from>--> + + <!--the hostname of the SMTP server + <host>localhost</host>--> + + <!--The portname of the SMTP server + <port>25</port>--> + + <!--If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create SMTP sockets.--> + <socketFactory> + <!--<class></class>--> + + <!--If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true. + <fallback>true</fallback>--> + <!--Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. + <port>25</port>--> + </socketFactory> + <!--if true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Note that an appropriate trust store must configured so that the client will trust the serverâs certificate. Defaults to false. + <starttls> + <enabled>false</enabled> + </starttls>--> + + <!--If true, attempt to authenticate the user using the AUTH command. Defaults to false. + <auth>false</auth>--> + + <!--Username used to authenticate to the SMTP server used only if mail.smtp.auth is true + <user>user</user>--> + + <!--Password used to authenticate to the SMTP server, used only if mail.smtp.auth is true + <password encrypted="false">pass</password>--> + </smtp> + </mail> + + <preformance> + <enableFindBusinessTModelBagFiltering>false</enableFindBusinessTModelBagFiltering> + </preformance> + </juddi> +</config> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/juddi/blob/7ccb6829/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java ---------------------------------------------------------------------- diff --git a/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java b/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java index 97e85ad..fce76e0 100644 --- a/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java +++ b/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java @@ -149,7 +149,7 @@ public class TckFindEntity } catch(Exception e) { logger.error(e.getMessage(), e); - Assert.fail("No exception should be thrown."); + Assert.fail("No exception should be thrown." + e.getMessage()); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
