You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by re...@apache.org on 2015/03/01 19:35:44 UTC

[23/50] [abbrv] stratos git commit: Copying jndi.properties file to stratos server instance started by the integration test

Copying jndi.properties file to stratos server instance started by the integration test


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/350d5358
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/350d5358
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/350d5358

Branch: refs/heads/docker-grouping-merge
Commit: 350d53583e807f1d0292a2a6295e40edd69f706d
Parents: 530880a
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sat Feb 28 08:43:26 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sat Feb 28 08:44:13 2015 +0530

----------------------------------------------------------------------
 .../tests/StratosTestServerManager.java         | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/350d5358/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
index fd74f75..ec9afeb 100755
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
@@ -50,7 +50,8 @@ public class StratosTestServerManager extends TestServerManager {
             "/../../../distribution/target/apache-stratos-4.1.0-SNAPSHOT.zip";
     private final static int PORT_OFFSET = 0;
     private static final String ACTIVEMQ_BIND_ADDRESS = "tcp://localhost:61617";
-    private static final String MOCK_IAAS_XML = "mock-iaas.xml";
+    private static final String MOCK_IAAS_XML_FILE = "mock-iaas.xml";
+    private static final String JNDI_PROPERTIES_FILE = "jndi.properties";
 
     private ServerUtils serverUtils;
     private String carbonHome;
@@ -123,13 +124,18 @@ public class StratosTestServerManager extends TestServerManager {
     }
 
     protected void copyArtifacts(String carbonHome) throws IOException {
-        log.info("Copying " + MOCK_IAAS_XML + " configuration file...");
-        URL mockIaasUrl = getClass().getResource("/" + MOCK_IAAS_XML);
-        assertNotNull(mockIaasUrl);
-        File srcFile = new File(mockIaasUrl.getFile());
-        File destFile = new File(carbonHome + "/repository/conf/" + MOCK_IAAS_XML);
+        copyConfigFile(carbonHome, MOCK_IAAS_XML_FILE);
+        copyConfigFile(carbonHome, JNDI_PROPERTIES_FILE);
+    }
+
+    private void copyConfigFile(String carbonHome, String fileName) throws IOException {
+        log.info("Copying " + fileName + " configuration file...");
+        URL fileURL = getClass().getResource("/" + fileName);
+        assertNotNull(fileURL);
+        File srcFile = new File(fileURL.getFile());
+        File destFile = new File(carbonHome + "/repository/conf/" + fileName);
         FileUtils.copyFile(srcFile, destFile);
-        log.info(MOCK_IAAS_XML + " configuration file copied");
+        log.info(fileName + " configuration file copied");
     }
 
     private boolean serverStarted(TestLogAppender testLogAppender) {