This is an automated email from the ASF dual-hosted git repository. bschuchardt pushed a commit to branch feature/GEODE-7168 in repository https://gitbox.apache.org/repos/asf/geode.git
commit 43dbca6886800d703f9900fe9523fab68b5c3d3a Author: Bruce Schuchardt <bschucha...@pivotal.io> AuthorDate: Fri Sep 6 14:07:31 2019 -0700 GEODE-7168: CI failure in Tomcat8 rolling upgrade test The test infrastructure wasn't providing the actual version strings with period-separators so our tomcat tests were having to do some hard work to find those strings. This PR alters the geode-old-versions sub-project and VersionManager to preserve the original version strings. --- .../Tomcat8ClientServerRollingUpgradeTest.java | 17 +++-------------- ...loverWithMixedVersionServersDistributedTest.java | 2 +- .../apache/geode/security/ClientAuthDUnitTest.java | 3 ++- .../apache/geode/test/version/VersionManager.java | 21 +++++++++++---------- geode-old-versions/build.gradle | 4 ++-- 5 files changed, 19 insertions(+), 28 deletions(-) diff --git a/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/Tomcat8ClientServerRollingUpgradeTest.java b/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/Tomcat8ClientServerRollingUpgradeTest.java index 943bb89..94aa265 100644 --- a/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/Tomcat8ClientServerRollingUpgradeTest.java +++ b/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/Tomcat8ClientServerRollingUpgradeTest.java @@ -20,9 +20,7 @@ import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.util.Collection; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.apache.commons.lang3.JavaVersion; import org.apache.commons.lang3.SystemUtils; @@ -60,20 +58,13 @@ public class Tomcat8ClientServerRollingUpgradeTest { private String locatorDir; private String server1Dir; private String server2Dir; - private static Map<String, Version> versionMap = new HashMap<>(); @Parameterized.Parameters(name = "{0}") public static Collection<String> data() { List<String> result = VersionManager.getInstance().getVersionsWithoutCurrent(); - int minimumVersion = SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9) ? 180 : 170; - result.removeIf(s -> Integer.parseInt(s) < minimumVersion); - Version.getAllVersions().forEach(v -> { - result.forEach(r -> { - if (r.equals(v.getName().replace(".", ""))) { - versionMap.put(r, v); - } - }); - }); + String minimumVersion = + SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9) ? "1.8.0" : "1.7.0"; + result.removeIf(s -> s.compareTo(minimumVersion) < 0); return result; } @@ -309,8 +300,6 @@ public class Tomcat8ClientServerRollingUpgradeTest { * @return Paths to required jars */ private String getClassPathTomcat8AndOldModules() { - String oldVersion = versionMap.get(this.oldVersion).getName(); - final String[] requiredClasspathJars = { "/lib/geode-modules-" + oldVersion + ".jar", "/lib/geode-modules-tomcat8-" + oldVersion + ".jar", diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverWithMixedVersionServersDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverWithMixedVersionServersDistributedTest.java index 7cda8c3..8b28d4c 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverWithMixedVersionServersDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverWithMixedVersionServersDistributedTest.java @@ -96,7 +96,7 @@ public class ClientServerTransactionFailoverWithMixedVersionServersDistributedTe @Before public void setup() throws Exception { host = Host.getHost(0); - String startingVersion = "160"; + String startingVersion = "1.6.0"; server1 = host.getVM(startingVersion, 0); server2 = host.getVM(startingVersion, 1); server3 = host.getVM(startingVersion, 2); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientAuthDUnitTest.java index a36ed0c..ac268b6 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientAuthDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientAuthDUnitTest.java @@ -86,7 +86,8 @@ public class ClientAuthDUnitTest { // for older version of client when we did not implement lazy initialization of the pool, the // authentication error will happen at this step. - if (Arrays.asList("100", "110", "111", "120", "130", "140").contains(clientVersion)) { + if (Arrays.asList("1.0.0", "1.1.0", "1.1.1", "1.2.0", "1.3.0", "1.4.0") + .contains(clientVersion)) { assertThatThrownBy( () -> lsRule.startClientVM(0, clientVersion, c -> c.withCredential("test", "invalidPassword") diff --git a/geode-junit/src/main/java/org/apache/geode/test/version/VersionManager.java b/geode-junit/src/main/java/org/apache/geode/test/version/VersionManager.java index c335d6e..eecc8c6 100755 --- a/geode-junit/src/main/java/org/apache/geode/test/version/VersionManager.java +++ b/geode-junit/src/main/java/org/apache/geode/test/version/VersionManager.java @@ -38,11 +38,9 @@ import org.apache.commons.lang3.SystemUtils; * see Host.getVM(String, int) */ public class VersionManager { - public static final String CURRENT_VERSION = "000"; - public static final String GEODE_110 = "110"; - public static final String GEODE_120 = "120"; - public static final String GEODE_130 = "130"; - public static final String GEODE_140 = "140"; + public static final String CURRENT_VERSION = "0.0.0"; + public static final String GEODE_130 = "1.3.0"; + public static final String GEODE_140 = "1.4.0"; private static VersionManager instance; @@ -166,12 +164,15 @@ public class VersionManager { private Optional<String> parseVersion(String version) { String parsedVersion = null; - if (version.startsWith("test") && version.length() >= "test".length()) { - if (version.equals("test")) { - parsedVersion = CURRENT_VERSION; - } else { - parsedVersion = version.substring("test".length()); + if (version.length() > 0 && Character.isDigit(version.charAt(0)) + && version.length() >= "1.2.3".length()) { + for (int i = 1; i < version.length(); i++) { + char character = version.charAt(i); + if (!Character.isDigit(character) && character != '.') { + return Optional.ofNullable(parsedVersion); + } } + parsedVersion = version; } return Optional.ofNullable(parsedVersion); } diff --git a/geode-old-versions/build.gradle b/geode-old-versions/build.gradle index 48c6338..322dc83 100644 --- a/geode-old-versions/build.gradle +++ b/geode-old-versions/build.gradle @@ -49,7 +49,7 @@ subprojects { compile "org.apache.geode:geode-rebalancer:${oldGeodeVersion}" } - parent.ext.versions.setProperty(projSrcName, sourceSets.main.runtimeClasspath.asPath) + parent.ext.versions.setProperty(oldGeodeVersion, sourceSets.main.runtimeClasspath.asPath) def unpackDest = project.buildDir.toPath().resolve('apache-geode-'.concat(oldGeodeVersion)) @@ -58,7 +58,7 @@ subprojects { if (downloadInstall) { project.dependencies.add "oldInstall", "org.apache.geode:apache-geode:${oldGeodeVersion}@${archiveType}" - parent.ext.installs.setProperty(projSrcName, unpackDest.toString()) + parent.ext.installs.setProperty(oldGeodeVersion, unpackDest.toString()) } project.task("downloadAndUnzipFile") {