Made virtualbox tests compatible with Windows

This commit is contained in:
Andrew Phillips 2012-07-16 14:13:49 -04:00
parent 16314f906c
commit f3419e90c9
1 changed files with 4 additions and 3 deletions

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();