[jboss-svn-commits] JBL Code SVN: r7468 - in labs/jbossesb/trunk: product/core/rosetta/tests/src/org/jboss/soa/esb/testutils product/core/services product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr qa/junit/src/org/jboss/soa/esb qa/junit/src/org/jboss/soa/esb/actions qa/junit/src/org/jboss/soa/esb/listeners/message qa/junit/src/org/jboss/soa/esb/services qa/junit/src/org/jboss/soa/esb/services/registry

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Nov 8 10:17:39 EST 2006


Author: kurt.stam at jboss.com
Date: 2006-11-08 10:17:34 -0500 (Wed, 08 Nov 2006)
New Revision: 7468

Added:
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/services/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/services/registry/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/services/registry/juddi-qatest.properties
Removed:
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/juddi-unittest.properties
Modified:
   labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java
   labs/jbossesb/trunk/product/core/services/build.xml
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.java
Log:
Fixing CbrProxyActionTest for ant

Modified: labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java	2006-11-08 14:51:08 UTC (rev 7467)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java	2006-11-08 15:17:34 UTC (rev 7468)
@@ -37,15 +37,20 @@
 	 */
 	public static String getUserDir(String eclipseDir, String antDir)
 	{
-		String _prefix="";
+		String userDir="";
 		String baseDir = System.getProperty("user.dir");
 		log.log(Priority.INFO, baseDir);
 		if (!baseDir.endsWith(eclipseDir)) {
-			_prefix = eclipseDir + "/";
+			if (baseDir.endsWith("qa")) {
+				userDir = antDir + "/";
+			} else {
+				userDir = eclipseDir + "/";
+			}
 		} else {
-			_prefix = antDir;
+			userDir = antDir;
 		}
-		return _prefix;
+		log.log(Priority.INFO, userDir);
+		return userDir;
 	}
 	
 	public static void setESBPropertiesFileToUse()
@@ -64,6 +69,16 @@
 		System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
 	}
 	
+	/**
+	 * Sets the jbossesb-properties.xml to use for test
+	 */
+	public static void setESBPropertiesFileToUse(String eclipseDir, String antDir)
+	{
+		//Set the jbossesb properties file in System, so we can pick up the one for testing
+		String jbossesbPropertiesFile = getUserDir(eclipseDir, antDir) + "etc/test/resources/jbossesb-unittest-properties.xml";
+		System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
+	}
+	
 	public static String readTextFile(File file) throws IOException 
     {
         StringBuffer sb = new StringBuffer(1024);

Modified: labs/jbossesb/trunk/product/core/services/build.xml
===================================================================
--- labs/jbossesb/trunk/product/core/services/build.xml	2006-11-08 14:51:08 UTC (rev 7467)
+++ labs/jbossesb/trunk/product/core/services/build.xml	2006-11-08 15:17:34 UTC (rev 7468)
@@ -11,6 +11,7 @@
 
 	<property name="org.jboss.esb.services.classes.dir" value="${org.jboss.esb.internal.dest}/classes/services"/>
 	<property name="org.jboss.esb.services.src.dir" value="${basedir}/src"/>
+	<property name="org.jboss.esb.services.rules.dir" value="${basedir}/rules"/>
 	<property name="org.jboss.esb.root.dir" value="../.."/>
 	<property environment="env"/>
 
@@ -116,6 +117,10 @@
                 basedir="${org.jboss.esb.services.classes.dir}"
                 includes="**/*.class"
                 />
+    	<jar    destfile="${org.jboss.esb.services.dist.dir}/lib/jbossesb-rules.jar"
+    	                basedir="${org.jboss.esb.services.rules.dir}"
+    	                includes="**/*.drl"
+    	                />
 
 	<antcall target="-ear"/>
     </target>

Modified: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java	2006-11-08 14:51:08 UTC (rev 7467)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java	2006-11-08 15:17:34 UTC (rev 7468)
@@ -81,12 +81,13 @@
 	private static RuleBase readRuleBase(String rulesFile) throws Exception
 	{
 		//read in the rules
+		logger.info("Going to read the rule: " + rulesFile);
 		InputStream inputStream = JBossRulesRouter.class.getResourceAsStream( "/" + rulesFile );
 		Reader source = new InputStreamReader(inputStream);
 		PackageBuilder builder = new PackageBuilder();
 		//this wil parse and compile in one step
 		//NOTE: There are 2 methods here, the one argument one is for normal DRL.
-		builder.addPackageFromDrl( source );;
+		builder.addPackageFromDrl( source );
 		//get the compiled package (which is serializable)
 		Package pkg = builder.getPackage();
 		//add the package to a rulebase (deploy the rule package).

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.java	2006-11-08 14:51:08 UTC (rev 7467)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.java	2006-11-08 15:17:34 UTC (rev 7468)
@@ -131,10 +131,10 @@
 	public static void runBeforeAllTests()
 	{
 		try {
-			DOMConfigurator.configure(TestEnvironmentUtil.getUserDir("product") + "etc/test/resources/log4j.xml");
-			TestEnvironmentUtil.setESBPropertiesFileToUse("product");
+			DOMConfigurator.configure(TestEnvironmentUtil.getUserDir("product","../product") + "etc/test/resources/log4j.xml");
+			TestEnvironmentUtil.setESBPropertiesFileToUse("product","../product");
 			//Set the juddi properties file in System so juddi will pick it up later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/actions/juddi-unittest.properties";
+			String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-qatest.properties";
 			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
 			//Read this properties file to get the db connection string
 			Properties props = new Properties();
@@ -149,13 +149,13 @@
 			if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
 				database = "hsqldb";
 				//Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir("product") + "build/hsqltestdb", "juddi");
+				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir("product","../product") + "build/hsqltestdb", "juddi");
 			} else if ("com.mysql.jdbc.Driver".equals(mDbDriver)) {
 				database = "mysql";
 			} //add and test your own database..
 			
 			//Get the registry-schema create scripts
-			String sqlDir = TestEnvironmentUtil.getUserDir("product") + "install/jUDDI-registry/sql/" + database + "/";
+			String sqlDir = TestEnvironmentUtil.getUserDir("product","../product") + "install/jUDDI-registry/sql/" + database + "/";
 			//Drop what is there now, if exists. We want to start fresh.
 			String sqlDropCmd      = FileUtil.readTextFile(new File(sqlDir + "drop_database.sql"));
 			String sqlCreateCmd    = FileUtil.readTextFile(new File(sqlDir + "create_database.sql"));

Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/juddi-unittest.properties
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/juddi-unittest.properties	2006-11-08 14:51:08 UTC (rev 7467)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/juddi-unittest.properties	2006-11-08 15:17:34 UTC (rev 7468)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# 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).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct 
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=org.hsqldb.jdbcDriver
-juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/juddi
-juddi.jdbcUsername=sa
-juddi.jdbcPassword=
-# jUDDI DataSource to use
-juddi.dataSource=java:comp/env/jdbc/juddiDB
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
- 
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-  

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.java	2006-11-08 14:51:08 UTC (rev 7467)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.java	2006-11-08 15:17:34 UTC (rev 7468)
@@ -119,10 +119,10 @@
 	public static void runBeforeAllTests()
 	{
 		try {
-			DOMConfigurator.configure(TestEnvironmentUtil.getUserDir("product") + "etc/test/resources/log4j.xml");
-			TestEnvironmentUtil.setESBPropertiesFileToUse("product");
+			DOMConfigurator.configure(TestEnvironmentUtil.getUserDir("product","../product") + "etc/test/resources/log4j.xml");
+			TestEnvironmentUtil.setESBPropertiesFileToUse("product","../product");
 			//Set the juddi properties file in System so juddi will pick it up later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-unittest.properties";
+			String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-qatest.properties";
 			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
 			//Read this properties file to get the db connection string
 			Properties props = new Properties();
@@ -137,7 +137,7 @@
 			if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
 				database = "hsqldb";
 				//Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir("product") + "build/hsqltestdb", "juddi");
+				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir("product","../product") + "build/hsqltestdb", "juddi");
 			} else if ("com.mysql.jdbc.Driver".equals(mDbDriver)) {
 				database = "mysql";
 			} //add and test your own database..

Added: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/services/registry/juddi-qatest.properties
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/services/registry/juddi-qatest.properties	2006-11-08 14:51:08 UTC (rev 7467)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/services/registry/juddi-qatest.properties	2006-11-08 15:17:34 UTC (rev 7468)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# 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).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=org.hsqldb.jdbcDriver
+juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/juddi
+juddi.jdbcUsername=sa
+juddi.jdbcPassword=
+# jUDDI DataSource to use
+juddi.dataSource=java:comp/env/jdbc/juddiDB
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  




More information about the jboss-svn-commits mailing list