Merge pull request #727 from jclouds/fix-issues-building-on-win

Fix issues building on Windows
This commit is contained in:
Adrian Cole 2012-07-18 15:29:48 -07:00
commit 4ac8770e66
4 changed files with 12 additions and 7 deletions

View File

@ -64,6 +64,8 @@ import com.google.inject.util.Providers;
*/ */
@Test(groups = "unit", testName = "CreateUniqueKeyTest") @Test(groups = "unit", testName = "CreateUniqueKeyTest")
public class CreateUniqueKeyTest { public class CreateUniqueKeyTest {
private static final String lineSeparator = System.getProperty("line.separator");
private Factory namingConvention; private Factory namingConvention;
private KeyPair keyPair; private KeyPair keyPair;
private String openSshKey; private String openSshKey;
@ -111,7 +113,7 @@ public class CreateUniqueKeyTest {
CreateUniqueKey parser = new CreateUniqueKey(cloudApiApi, namingConvention, crypto, Providers.of(secureRandom)); CreateUniqueKey parser = new CreateUniqueKey(cloudApiApi, namingConvention, crypto, Providers.of(secureRandom));
assertEquals(parser.load(DatacenterAndName.fromDatacenterAndName("datacenter", "group")), 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); verify(cloudApiApi, keyApi, crypto, rsaKeyPairGenerator, secureRandom);
} }

View File

@ -20,6 +20,7 @@ package org.jclouds.virtualbox;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.io.File;
import java.net.URI; import java.net.URI;
import java.net.URL; import java.net.URL;
import java.util.Map; import java.util.Map;
@ -44,9 +45,9 @@ import com.google.common.collect.Iterables;
* @author dralves * @author dralves
* *
*/ */
@Test(groups = "live", singleThreaded = true, testName = "StartJettyIfNotAlreadyRunningLiveTest") @Test(groups = "live", singleThreaded = true, testName = "PreseedCfgServerTest")
public class PreseedCfgServerTest { public class PreseedCfgServerTest {
private static final String lineSeparator = System.getProperty("line.separator");
@Test @Test
public void testJettyServerServesPreseedFile() throws Exception { public void testJettyServerServesPreseedFile() throws Exception {
Properties props = VirtualBoxApiMetadata.defaultProperties(); Properties props = VirtualBoxApiMetadata.defaultProperties();
@ -60,7 +61,7 @@ public class PreseedCfgServerTest {
starter.start(preconfigurationUrl, getDefaultImage().preseed_cfg); starter.start(preconfigurationUrl, getDefaultImage().preseed_cfg);
String preseedFileFromJetty = IOUtils.toString(new URL("http://127.0.0.1:" + port + "/preseed.cfg").openStream()); 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); assertEquals(preseedFileFromFile, preseedFileFromJetty);
starter.stop(); starter.stop();

View File

@ -604,7 +604,7 @@
<configuration> <configuration>
<encoding>${project.build.sourceEncoding}</encoding> <encoding>${project.build.sourceEncoding}</encoding>
<quiet>true</quiet> <quiet>true</quiet>
<additionalJOption>-J-Xmx256m</additionalJOption> <maxmemory>256m</maxmemory>
</configuration> </configuration>
<reportSets> <reportSets>
<reportSet> <reportSet>
@ -708,7 +708,7 @@
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version> <version>2.8.1</version>
<configuration> <configuration>
<additionalJOption>-J-Xmx256m</additionalJOption> <maxmemory>256m</maxmemory>
<encoding>${project.build.sourceEncoding}</encoding> <encoding>${project.build.sourceEncoding}</encoding>
<quiet>true</quiet> <quiet>true</quiet>
<links> <links>

View File

@ -19,11 +19,13 @@
package org.jclouds.scriptbuilder.statements.login; package org.jclouds.scriptbuilder.statements.login;
import static java.lang.String.format;
import static org.jclouds.scriptbuilder.statements.login.AdminAccessBuilderSpec.parse; import static org.jclouds.scriptbuilder.statements.login.AdminAccessBuilderSpec.parse;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;
import static org.testng.Assert.fail; import static org.testng.Assert.fail;
import java.io.File;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import javax.inject.Provider; import javax.inject.Provider;
@ -104,7 +106,7 @@ public class AdminAccessBuilderSpecTest {
public void testParsePrivateKeyFile() { public void testParsePrivateKeyFile() {
AdminAccessBuilderSpec spec = parse("adminPrivateKeyFile=target/test-classes/test"); 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.adminHome);
assertNull(spec.adminPassword); assertNull(spec.adminPassword);
assertNull(spec.adminPublicKeyFile); assertNull(spec.adminPublicKeyFile);