[wsas-java-dev] svn commit r47 - in wsas/java/trunk: . modules/admin/test/org/wso2/wsas/admin/service/logging modules/admin/test/org/wso2/wsas/admin/throttle modules/core/conf/hibernate modules/core/src/org/wso2/wsas modules/core/test/org/wso2/wsas modules/core/test/org/wso2/wsas/persistence modules/core/test/org/wso2/wsas/security modules/core/test/org/wso2/wsas/trust modules/core/test/org/wso2/wsas/util modules/integration/test/org/wso2/wsas/sample/commodityquote modules/integration/test/org/wso2/wsas/sample/trader modules/servlet-edition/src/org/wso2/wsas

svn at wso2.com svn at wso2.com
Thu Nov 30 22:15:16 PST 2006


Author: azeez
Date: Thu Nov 30 22:15:15 2006
New Revision: 47

Modified:
   wsas/java/trunk/maven.xml
   wsas/java/trunk/modules/admin/test/org/wso2/wsas/admin/service/logging/LoggingServiceTest.java
   wsas/java/trunk/modules/admin/test/org/wso2/wsas/admin/throttle/ThrottleTest.java
   wsas/java/trunk/modules/core/conf/hibernate/test-hibernate.cfg.xml
   wsas/java/trunk/modules/core/src/org/wso2/wsas/Main.java
   wsas/java/trunk/modules/core/src/org/wso2/wsas/ServerConstants.java
   wsas/java/trunk/modules/core/test/org/wso2/wsas/AbstractTestCase.java
   wsas/java/trunk/modules/core/test/org/wso2/wsas/JettyServerTest.java
   wsas/java/trunk/modules/core/test/org/wso2/wsas/persistence/AbstractDAOTestCase.java
   wsas/java/trunk/modules/core/test/org/wso2/wsas/persistence/PersistenceTest.java
   wsas/java/trunk/modules/core/test/org/wso2/wsas/security/CryptoUtilTest.java
   wsas/java/trunk/modules/core/test/org/wso2/wsas/security/WSS4JUtilTest.java
   wsas/java/trunk/modules/core/test/org/wso2/wsas/trust/SecurityTokenStoreTest.java
   wsas/java/trunk/modules/core/test/org/wso2/wsas/util/MIMEType2FileExtensionMapTest.java
   wsas/java/trunk/modules/integration/test/org/wso2/wsas/sample/commodityquote/CommodityQuoteServiceIntegrationTest.java
   wsas/java/trunk/modules/integration/test/org/wso2/wsas/sample/trader/TraderServiceIntegrationTest.java
   wsas/java/trunk/modules/servlet-edition/src/org/wso2/wsas/MainServlet.java
Log:
Create the DB in the target dir when tests are run

Modified: wsas/java/trunk/maven.xml
==============================================================================
--- wsas/java/trunk/maven.xml	(original)
+++ wsas/java/trunk/maven.xml	Thu Nov 30 22:15:15 2006
@@ -867,7 +867,7 @@
         <ant:copy todir="${dist.temp.dir}/conf/rampart" filtering="on">
             <ant:fileset dir="modules/core/conf/rampart"/>
         </ant:copy>
-        <ant:copy todir="${dist.temp.dir}/conf" filtering="on">
+        <ant:copy todir="${dist.temp.dir}/conf" filtering="on" overwrite="true">
             <ant:fileset file="modules/core/conf/server.xml"/>
             <ant:fileset file="modules/core/conf/server-web.xml"/>
             <ant:fileset file="modules/core/conf/mime-mappings.xml"/>
@@ -948,7 +948,7 @@
         <ant:copy
                 tofile="${dist.temp.dir}/repository/modules/throttle-${wso2wsas.version}.mar"
                 file="modules/wsf-common-core/target/throttle-${wso2wsas.version}.mar"/>
-	<ant:copy
+	    <ant:copy
                 tofile="${dist.temp.dir}/repository/modules/mex-${wso2wsas.version}.mar"
                 file="modules/wsf-common-core/target/mex-${wso2wsas.version}.mar"/>
 

Modified: wsas/java/trunk/modules/admin/test/org/wso2/wsas/admin/service/logging/LoggingServiceTest.java
==============================================================================
--- wsas/java/trunk/modules/admin/test/org/wso2/wsas/admin/service/logging/LoggingServiceTest.java	(original)
+++ wsas/java/trunk/modules/admin/test/org/wso2/wsas/admin/service/logging/LoggingServiceTest.java	Thu Nov 30 22:15:15 2006
@@ -39,6 +39,7 @@
     private CircularBuffer circQ;
 
     protected void setUp() throws Exception {
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
         logService = new LoggingService();
 
         MessageContext msgCtx = new MessageContext();

Modified: wsas/java/trunk/modules/admin/test/org/wso2/wsas/admin/throttle/ThrottleTest.java
==============================================================================
--- wsas/java/trunk/modules/admin/test/org/wso2/wsas/admin/throttle/ThrottleTest.java	(original)
+++ wsas/java/trunk/modules/admin/test/org/wso2/wsas/admin/throttle/ThrottleTest.java	Thu Nov 30 22:15:15 2006
@@ -34,6 +34,7 @@
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.wso2.wsas.ServerConstants;
 
 
 public class ThrottleTest extends TestCase {
@@ -54,6 +55,7 @@
 
     protected void setUp() throws Exception {
         File file = new File(repository);
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
         File configFile = new File(repository + "/conf/axis2.xml");
         if (!file.exists()) {
             throw new Exception("repository directory "

Modified: wsas/java/trunk/modules/core/conf/hibernate/test-hibernate.cfg.xml
==============================================================================
--- wsas/java/trunk/modules/core/conf/hibernate/test-hibernate.cfg.xml	(original)
+++ wsas/java/trunk/modules/core/conf/hibernate/test-hibernate.cfg.xml	Thu Nov 30 22:15:15 2006
@@ -8,7 +8,7 @@
 
         <!-- Database connection settings -->
         <property name="connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
-        <property name="connection.url">jdbc:derby:target/database/WSO2WSAS_DB;create=true</property>
+        <property name="connection.url">jdbc:derby:../target/database/WSO2WSAS_DB;create=true</property>
         <property name="connection.username">wso2wsas</property>
         <property name="connection.password">wso2wsas</property>
 

Modified: wsas/java/trunk/modules/core/src/org/wso2/wsas/Main.java
==============================================================================
--- wsas/java/trunk/modules/core/src/org/wso2/wsas/Main.java	(original)
+++ wsas/java/trunk/modules/core/src/org/wso2/wsas/Main.java	Thu Nov 30 22:15:15 2006
@@ -56,10 +56,11 @@
     private static JettyWebConfiguration jettyConfig = JettyWebConfiguration.getInstance();
 
     public Main() {
-        System.setProperty("axis2.home", ".");
-        System.setProperty("wso2wsas.home", ".");
+        System.setProperty(ServerConstants.AXIS2_HOME, ".");
+        System.setProperty(ServerConstants.WSO2WSAS_HOME, ".");
         serverConfig = ServerConfiguration.getInstance();
-        System.setProperty("derby.system.home", serverConfig.getFirstProperty("Database.Home"));
+        System.setProperty(ServerConstants.DERBY_HOME,
+                           serverConfig.getFirstProperty("Database.Home"));
         serverManager =
                 new ServerManager(serverConfig,
                                   HibernateConfigFactory.
@@ -77,10 +78,11 @@
     }
 
     public Main(ServerConfiguration serverConfiguration) {
-        System.setProperty("axis2.home", ".");
-        System.setProperty("wso2wsas.home", ".");
+        System.setProperty(ServerConstants.AXIS2_HOME, ".");
+        System.setProperty(ServerConstants.WSO2WSAS_HOME, ".");
         serverConfig = serverConfiguration;
-        System.setProperty("derby.system.home", serverConfig.getFirstProperty("Database.Home"));
+        System.setProperty(ServerConstants.DERBY_HOME,
+                           serverConfig.getFirstProperty("Database.Home"));
 
         serverManager =
                 new ServerManager(serverConfig,

Modified: wsas/java/trunk/modules/core/src/org/wso2/wsas/ServerConstants.java
==============================================================================
--- wsas/java/trunk/modules/core/src/org/wso2/wsas/ServerConstants.java	(original)
+++ wsas/java/trunk/modules/core/src/org/wso2/wsas/ServerConstants.java	Thu Nov 30 22:15:15 2006
@@ -24,6 +24,9 @@
     }
 
     public static final String WSO2WSAS_HOME = "wso2wsas.home";
+    public static final String AXIS2_HOME = "axis2.home";
+    public static final String AXIS2_XML = "axis2.xml";
+    public static final String DERBY_HOME = "derby.system.home";
 
     //=============================================
     //          HTTP Constants

Modified: wsas/java/trunk/modules/core/test/org/wso2/wsas/AbstractTestCase.java
==============================================================================
--- wsas/java/trunk/modules/core/test/org/wso2/wsas/AbstractTestCase.java	(original)
+++ wsas/java/trunk/modules/core/test/org/wso2/wsas/AbstractTestCase.java	Thu Nov 30 22:15:15 2006
@@ -28,7 +28,7 @@
     protected ServerUtils serverUtils;
 
     protected void setUp() throws Exception {
-        System.setProperty("derby.system.home", "conf");
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
         System.setProperty(org.apache.axis2.Constants.AXIS2_CONF,
                            "target/repository/axis2.xml");
 
@@ -37,7 +37,7 @@
     }
 
     protected void setUp(String serverConfigLocation) {
-        System.setProperty("derby.system.home", "conf");
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
         System.setProperty(org.apache.axis2.Constants.AXIS2_CONF,
                            "target/repository/axis2.xml");
         serverUtils = new ServerUtils();

Modified: wsas/java/trunk/modules/core/test/org/wso2/wsas/JettyServerTest.java
==============================================================================
--- wsas/java/trunk/modules/core/test/org/wso2/wsas/JettyServerTest.java	(original)
+++ wsas/java/trunk/modules/core/test/org/wso2/wsas/JettyServerTest.java	Thu Nov 30 22:15:15 2006
@@ -38,6 +38,7 @@
     protected void setUp() throws Exception {
         ServerConfiguration.configurationXMLLocation = "conf/server.xml";
         System.setProperty("axis2.xml", "target/repository/axis2.xml");
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
         new ServerUtils().startServer();
     }
 

Modified: wsas/java/trunk/modules/core/test/org/wso2/wsas/persistence/AbstractDAOTestCase.java
==============================================================================
--- wsas/java/trunk/modules/core/test/org/wso2/wsas/persistence/AbstractDAOTestCase.java	(original)
+++ wsas/java/trunk/modules/core/test/org/wso2/wsas/persistence/AbstractDAOTestCase.java	Thu Nov 30 22:15:15 2006
@@ -44,7 +44,7 @@
     protected LoggerDAO loggerDAO;
 
     protected void setUp() throws Exception {
-        System.setProperty("derby.system.home", "conf");
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
         hbConfig = HibernateConfigFactory.getDefaultConfig(ServerConstants.WSO2WSAS_HB_CONFIG_KEY);
         modDAO = new ModuleDAO(hbConfig);
         serviceDAO = new ServiceDAO(hbConfig);

Modified: wsas/java/trunk/modules/core/test/org/wso2/wsas/persistence/PersistenceTest.java
==============================================================================
--- wsas/java/trunk/modules/core/test/org/wso2/wsas/persistence/PersistenceTest.java	(original)
+++ wsas/java/trunk/modules/core/test/org/wso2/wsas/persistence/PersistenceTest.java	Thu Nov 30 22:15:15 2006
@@ -39,7 +39,7 @@
     private PersistenceManager pm;
 
     protected void setUp() throws Exception {
-        System.setProperty("derby.system.home", "conf");
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
         hbConfig = HibernateConfigFactory.getDefaultConfig(ServerConstants.WSO2WSAS_HB_CONFIG_KEY);
         pm = new PersistenceManager(hbConfig);
     }

Modified: wsas/java/trunk/modules/core/test/org/wso2/wsas/security/CryptoUtilTest.java
==============================================================================
--- wsas/java/trunk/modules/core/test/org/wso2/wsas/security/CryptoUtilTest.java	(original)
+++ wsas/java/trunk/modules/core/test/org/wso2/wsas/security/CryptoUtilTest.java	Thu Nov 30 22:15:15 2006
@@ -19,6 +19,7 @@
 import org.wso2.wsf.common.tools.security.CryptoUtil;
 import org.wso2.wsf.common.tools.security.CryptoException;
 import org.wso2.wsf.common.util.ServerConfiguration;
+import org.wso2.wsas.ServerConstants;
 import junit.framework.TestCase;
 
 public class CryptoUtilTest extends TestCase {
@@ -27,6 +28,11 @@
         super(name);
     }
 
+    protected void setUp() throws Exception {
+        super.setUp();
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
+    }
+
     public void testEncryptDecrypt() {
         String plainText = "passphrase";
         try {

Modified: wsas/java/trunk/modules/core/test/org/wso2/wsas/security/WSS4JUtilTest.java
==============================================================================
--- wsas/java/trunk/modules/core/test/org/wso2/wsas/security/WSS4JUtilTest.java	(original)
+++ wsas/java/trunk/modules/core/test/org/wso2/wsas/security/WSS4JUtilTest.java	Thu Nov 30 22:15:15 2006
@@ -16,6 +16,7 @@
 package org.wso2.wsas.security;
 
 import org.wso2.wsf.common.ServerException;
+import org.wso2.wsas.ServerConstants;
 import junit.framework.TestCase;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.Parameter;
@@ -30,6 +31,11 @@
         super(arg0);
     }
 
+    protected void setUp() throws Exception {
+        super.setUp();
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
+    }
+
     /**
      * This is to test the i18n of the error message
      */

Modified: wsas/java/trunk/modules/core/test/org/wso2/wsas/trust/SecurityTokenStoreTest.java
==============================================================================
--- wsas/java/trunk/modules/core/test/org/wso2/wsas/trust/SecurityTokenStoreTest.java	(original)
+++ wsas/java/trunk/modules/core/test/org/wso2/wsas/trust/SecurityTokenStoreTest.java	Thu Nov 30 22:15:15 2006
@@ -21,6 +21,7 @@
 import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
 import org.apache.rahas.Token;
 import org.apache.rahas.TrustException;
+import org.wso2.wsas.ServerConstants;
 
 import java.util.Date;
 import java.util.Properties;
@@ -33,6 +34,7 @@
     private SecurityTokenStore store;
 
     protected void setUp() throws Exception {
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
         store = new SecurityTokenStore();
     }
 

Modified: wsas/java/trunk/modules/core/test/org/wso2/wsas/util/MIMEType2FileExtensionMapTest.java
==============================================================================
--- wsas/java/trunk/modules/core/test/org/wso2/wsas/util/MIMEType2FileExtensionMapTest.java	(original)
+++ wsas/java/trunk/modules/core/test/org/wso2/wsas/util/MIMEType2FileExtensionMapTest.java	Thu Nov 30 22:15:15 2006
@@ -18,6 +18,7 @@
 import junit.framework.TestCase;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.wso2.wsas.ServerConstants;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -30,6 +31,11 @@
  */
 public class MIMEType2FileExtensionMapTest extends TestCase {
 
+    protected void setUp() throws Exception {
+        super.setUp();
+        System.setProperty(ServerConstants.DERBY_HOME, "conf");
+    }
+
     public void testGetMimeType() throws FileNotFoundException, XMLStreamException {
         String mappingFileName = "conf/mime-mappings.xml";
         OMElement doc = new StAXOMBuilder(mappingFileName).getDocumentElement();

Modified: wsas/java/trunk/modules/integration/test/org/wso2/wsas/sample/commodityquote/CommodityQuoteServiceIntegrationTest.java
==============================================================================
--- wsas/java/trunk/modules/integration/test/org/wso2/wsas/sample/commodityquote/CommodityQuoteServiceIntegrationTest.java	(original)
+++ wsas/java/trunk/modules/integration/test/org/wso2/wsas/sample/commodityquote/CommodityQuoteServiceIntegrationTest.java	Thu Nov 30 22:15:15 2006
@@ -36,6 +36,7 @@
 import org.wso2.wsas.sample.commodityquote.services.CommodityQuoteMessageReceiverInOut;
 import org.wso2.wsas.sample.commodityquote.services.CommodityQuoteService;
 import org.wso2.wsas.util.ServerUtils;
+import org.wso2.wsas.ServerConstants;
 import org.wso2.wsf.common.util.ServerConfiguration;
 import org.wso2.www.types.client.*;
 
@@ -57,7 +58,7 @@
                         ".." + File.separator + "core" + File.separator + "conf" + File.separator +
                         "server.xml";
 
-                System.setProperty("derby.system.home", "conf");
+                System.setProperty(ServerConstants.DERBY_HOME, "conf");
                 System.setProperty(org.apache.axis2.Constants.AXIS2_CONF,
                                    "target/repository/axis2.xml");
 

Modified: wsas/java/trunk/modules/integration/test/org/wso2/wsas/sample/trader/TraderServiceIntegrationTest.java
==============================================================================
--- wsas/java/trunk/modules/integration/test/org/wso2/wsas/sample/trader/TraderServiceIntegrationTest.java	(original)
+++ wsas/java/trunk/modules/integration/test/org/wso2/wsas/sample/trader/TraderServiceIntegrationTest.java	Thu Nov 30 22:15:15 2006
@@ -32,6 +32,7 @@
 import org.wso2.wsas.sample.trader.client.TraderClientSkeleton;
 import org.wso2.wsas.sample.trader.client.TraderClientStub;
 import org.wso2.wsas.util.ServerUtils;
+import org.wso2.wsas.ServerConstants;
 import org.wso2.wsf.common.util.ServerConfiguration;
 import org.wso2.www.types.exchange.client.GetInfoRequest;
 import org.wso2.www.types.exchange.client.GetInfoResponse;
@@ -53,12 +54,12 @@
     public static Test suite() {
         return new TestSetup(new TestSuite(TraderServiceIntegrationTest.class)) {
             protected void setUp() throws Exception {
-
+                System.setProperty(ServerConstants.DERBY_HOME, "conf");
                 ServerConfiguration.configurationXMLLocation =
                         ".." + File.separator + "core" + File.separator + "conf" + File.separator +
                         "server.xml";
 
-                System.setProperty("derby.system.home", "conf");
+                System.setProperty(ServerConstants.DERBY_HOME, "conf");
                 System.setProperty(org.apache.axis2.Constants.AXIS2_CONF,
                                    "target/repository/axis2.xml");
 

Modified: wsas/java/trunk/modules/servlet-edition/src/org/wso2/wsas/MainServlet.java
==============================================================================
--- wsas/java/trunk/modules/servlet-edition/src/org/wso2/wsas/MainServlet.java	(original)
+++ wsas/java/trunk/modules/servlet-edition/src/org/wso2/wsas/MainServlet.java	Thu Nov 30 22:15:15 2006
@@ -154,7 +154,7 @@
         ServerConfiguration serverConfig = ServerConfiguration.getInstance();
         ServletContext servletContext = servletConfig.getServletContext();
 
-        System.setProperty("derby.system.home",
+        System.setProperty(ServerConstants.DERBY_HOME,
                            wso2wsasHome + File.separator +
                            serverConfig.getFirstProperty("Database.Home"));
         HibernateConfig hbConfig =




More information about the Wsas-java-dev mailing list