From 16314f906c9b9eb5b0904a20e1ed436c00c44e5a Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 16 Jul 2012 11:44:06 -0400 Subject: [PATCH 1/4] Made scriptbuilder tests compatible with Windows --- .../statements/login/AdminAccessBuilderSpecTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/statements/login/AdminAccessBuilderSpecTest.java b/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/statements/login/AdminAccessBuilderSpecTest.java index cc60c91404..d2c0f316c2 100644 --- a/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/statements/login/AdminAccessBuilderSpecTest.java +++ b/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/statements/login/AdminAccessBuilderSpecTest.java @@ -19,11 +19,13 @@ package org.jclouds.scriptbuilder.statements.login; +import static java.lang.String.format; import static org.jclouds.scriptbuilder.statements.login.AdminAccessBuilderSpec.parse; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; import static org.testng.Assert.fail; +import java.io.File; import java.lang.reflect.Field; import javax.inject.Provider; @@ -104,7 +106,7 @@ public class AdminAccessBuilderSpecTest { public void testParsePrivateKeyFile() { AdminAccessBuilderSpec spec = parse("adminPrivateKeyFile=target/test-classes/test"); - assertEquals(spec.getAdminPrivateKeyFile().getPath(), "target/test-classes/test"); + assertEquals(spec.getAdminPrivateKeyFile().getPath(), format("target%stest-classes%stest", File.separator, File.separator)); assertNull(spec.adminHome); assertNull(spec.adminPassword); assertNull(spec.adminPublicKeyFile); From f3419e90c9c7751a3baa76653e8ea183b0b35a7b Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 16 Jul 2012 14:13:49 -0400 Subject: [PATCH 2/4] Made virtualbox tests compatible with Windows --- .../java/org/jclouds/virtualbox/PreseedCfgServerTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/PreseedCfgServerTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/PreseedCfgServerTest.java index 659c1f84e2..28c6001f9e 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/PreseedCfgServerTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/PreseedCfgServerTest.java @@ -20,6 +20,7 @@ package org.jclouds.virtualbox; import static org.testng.Assert.assertEquals; +import java.io.File; import java.net.URI; import java.net.URL; import java.util.Map; @@ -44,9 +45,9 @@ import com.google.common.collect.Iterables; * @author dralves * */ -@Test(groups = "live", singleThreaded = true, testName = "StartJettyIfNotAlreadyRunningLiveTest") +@Test(groups = "live", singleThreaded = true, testName = "PreseedCfgServerTest") public class PreseedCfgServerTest { - + private static final String lineSeparator = System.getProperty("line.separator"); @Test public void testJettyServerServesPreseedFile() throws Exception { Properties props = VirtualBoxApiMetadata.defaultProperties(); @@ -60,7 +61,7 @@ public class PreseedCfgServerTest { starter.start(preconfigurationUrl, getDefaultImage().preseed_cfg); String preseedFileFromJetty = IOUtils.toString(new URL("http://127.0.0.1:" + port + "/preseed.cfg").openStream()); - String preseedFileFromFile = getDefaultImage().preseed_cfg + "\n"; + String preseedFileFromFile = getDefaultImage().preseed_cfg + lineSeparator; assertEquals(preseedFileFromFile, preseedFileFromJetty); starter.stop(); From 75ce908c130ebc73f6d505315200398e3cfd135e Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 16 Jul 2012 15:24:26 -0400 Subject: [PATCH 3/4] Made joyent-api tests compatible with Windows --- .../cloudapi/v6_5/compute/loaders/CreateUniqueKeyTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/labs/joyent-cloudapi/src/test/java/org/jclouds/joyent/cloudapi/v6_5/compute/loaders/CreateUniqueKeyTest.java b/labs/joyent-cloudapi/src/test/java/org/jclouds/joyent/cloudapi/v6_5/compute/loaders/CreateUniqueKeyTest.java index c264bcdca4..1eb3aa40b6 100644 --- a/labs/joyent-cloudapi/src/test/java/org/jclouds/joyent/cloudapi/v6_5/compute/loaders/CreateUniqueKeyTest.java +++ b/labs/joyent-cloudapi/src/test/java/org/jclouds/joyent/cloudapi/v6_5/compute/loaders/CreateUniqueKeyTest.java @@ -64,6 +64,8 @@ import com.google.inject.util.Providers; */ @Test(groups = "unit", testName = "CreateUniqueKeyTest") public class CreateUniqueKeyTest { + private static final String lineSeparator = System.getProperty("line.separator"); + private Factory namingConvention; private KeyPair keyPair; private String openSshKey; @@ -111,7 +113,7 @@ public class CreateUniqueKeyTest { CreateUniqueKey parser = new CreateUniqueKey(cloudApiApi, namingConvention, crypto, Providers.of(secureRandom)); assertEquals(parser.load(DatacenterAndName.fromDatacenterAndName("datacenter", "group")), - KeyAndPrivateKey.fromKeyAndPrivateKey(key, PRIVATE_KEY)); + KeyAndPrivateKey.fromKeyAndPrivateKey(key, PRIVATE_KEY.replaceAll("\n", lineSeparator))); verify(cloudApiApi, keyApi, crypto, rsaKeyPairGenerator, secureRandom); } From 575b0a4559f3be970fa3c52006914ab470e8756a Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Tue, 17 Jul 2012 15:29:48 -0400 Subject: [PATCH 4/4] Using the 'maxmemory' option rather than the more generic 'additionalJOption' for the Javadoc plugin to allow for easier overriding --- project/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/pom.xml b/project/pom.xml index bac02ac417..a62d20964e 100644 --- a/project/pom.xml +++ b/project/pom.xml @@ -604,7 +604,7 @@ ${project.build.sourceEncoding} true - -J-Xmx256m + 256m @@ -708,7 +708,7 @@ maven-javadoc-plugin 2.8.1 - -J-Xmx256m + 256m ${project.build.sourceEncoding} true