diff --git a/geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerInstall.java b/geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerInstall.java index d40818d9d5a0..65aefa417b2a 100644 --- a/geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerInstall.java +++ b/geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerInstall.java @@ -112,11 +112,6 @@ public String getInstallPath() { */ public abstract void setLocator(String address, int port) throws Exception; - /** - * Sets up the cache XML files - */ - public abstract void setupCacheXMLFile(String newXMLFilePath) throws IOException; - /** * Sets the XML file which contains cache properties. * diff --git a/geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerManager.java b/geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerManager.java index e199e2c2f74a..2dba38a18dd5 100644 --- a/geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerManager.java +++ b/geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerManager.java @@ -326,7 +326,6 @@ private InstalledLocalContainer addContainer(ContainerInstall install, int index ConfigurationType.STANDALONE, "/tmp/cargo_configs/" + uniqueName); configuration.setProperty(GeneralPropertySet.LOGGING, install.getLoggingLevel()); - install.setupCacheXMLFile("cargo_logs/XMLs/" + uniqueName + ".xml"); install.modifyConfiguration(configuration); File gemfireLogFile = new File("cargo_logs/gemfire_modules/" + uniqueName); diff --git a/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerInstall.java b/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerInstall.java index ff068868d213..f5072bbbf19d 100644 --- a/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerInstall.java +++ b/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerInstall.java @@ -129,6 +129,10 @@ public GenericAppServerInstall(Server server, CacheType cacheType, String instal this.cacheType = cacheType; appServerModulePath = findAndExtractModule(GEODE_BUILD_HOME, "appserver"); + // Set the cache XML file by copying the XML file in the build dir + setCacheXMLFile(appServerModulePath + "/conf/" + cacheType.getXMLTypeFile(), + "cargo_logs/XMLs/" + getContainerDescription() + ".xml"); + // Default properties setCacheProperty("enable_local_cache", "false"); @@ -136,19 +140,6 @@ public GenericAppServerInstall(Server server, CacheType cacheType, String instal warFile.deleteOnExit(); } - /** - * Sets the XML file to use for cache settings - * - * Calls {@link ContainerInstall#setCacheXMLFile(String, String)} with the default original cache - * file located in the conf folder of the {@link #appServerModulePath} and the given - * newXMLFilePath. - */ - @Override - public void setupCacheXMLFile(String newXMLFilePath) throws IOException { - super.setCacheXMLFile(appServerModulePath + "/conf/" + cacheType.getXMLTypeFile(), - newXMLFilePath); - } - /** * Build the command list used to modify/build the WAR file */ @@ -240,8 +231,7 @@ public void setLocator(String address, int port) throws Exception { attributes.put("host", address); attributes.put("port", Integer.toString(port)); - editXMLFile(appServerModulePath + "/conf/" + cacheType.getXMLTypeFile(), "locator", "pool", - attributes, true); + editXMLFile(getSystemProperty("cache-xml-file"), "locator", "pool", attributes, true); } logger.info("Set locator for AppServer install to " + address + "[" + port + "]"); diff --git a/geode-assembly/src/test/java/org/apache/geode/session/tests/TomcatInstall.java b/geode-assembly/src/test/java/org/apache/geode/session/tests/TomcatInstall.java index 25fb9ed21385..9a5b15ea905c 100644 --- a/geode-assembly/src/test/java/org/apache/geode/session/tests/TomcatInstall.java +++ b/geode-assembly/src/test/java/org/apache/geode/session/tests/TomcatInstall.java @@ -188,6 +188,10 @@ public TomcatInstall(TomcatVersion version, TomcatConfig config, String installD // Get tomcat module path tomcatModulePath = findAndExtractModule(GEODE_BUILD_HOME, "tomcat"); + // Set the cache XML file by copying the XML file in the build dir + setCacheXMLFile(tomcatModulePath + "/conf/" + config.getXMLFile(), + "cargo_logs/XMLs/" + getContainerDescription() + "_" + System.nanoTime() + ".xml"); + // Default properties setCacheProperty("enableLocalCache", "false"); @@ -200,17 +204,6 @@ public TomcatInstall(TomcatVersion version, TomcatConfig config, String installD } } - /** - * Sets the XML file to use for cache settings - * - * Calls {@link ContainerInstall#setCacheXMLFile(String, String)} with the default original cache - * file located in the conf folder of the {@link #tomcatModulePath} and the given newXMLFilePath. - */ - @Override - public void setupCacheXMLFile(String newXMLFilePath) throws IOException { - super.setCacheXMLFile(tomcatModulePath + "/conf/" + config.getXMLFile(), newXMLFilePath); - } - /** * Copies jars specified by {@link #tomcatRequiredJars} from the {@link #tomcatModulePath} and the * specified other directory passed to the function. @@ -353,7 +346,7 @@ public void writeProperties() throws Exception { * * For Client Server installations the cache-client.xml file is updated within the installations * conf folder. For Peer to Peer installations the server.xml file is updated using - * {@link #updateXMLFiles()}. + * {@link #updateXMLFiles()} when the container is started. */ @Override public void setLocator(String address, int port) throws Exception { @@ -362,8 +355,7 @@ public void setLocator(String address, int port) throws Exception { attributes.put("host", address); attributes.put("port", Integer.toString(port)); - editXMLFile(tomcatModulePath + "/conf/" + config.getXMLFile(), "locator", "pool", attributes, - true); + editXMLFile(getSystemProperty("cache-xml-file"), "locator", "pool", attributes, true); } else { setSystemProperty("locators", address + "[" + port + "]");