Using OS-dependent file separators in asserts (instead of assuming UNIX '/')

This commit is contained in:
Andrew Phillips 2011-10-26 21:25:34 -04:00
parent 0e06eedcdb
commit 39dbc592b5
1 changed files with 5 additions and 2 deletions

View File

@ -18,8 +18,11 @@
*/ */
package org.jclouds.compute.callables; package org.jclouds.compute.callables;
import static java.lang.String.format;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.io.File;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.inject.AbstractModule; import com.google.inject.AbstractModule;
@ -42,7 +45,7 @@ public class InitScriptConfigurationForTasksTest {
public void testPatternUpdatesBasedir() { public void testPatternUpdatesBasedir() {
InitScriptConfigurationForTasks config = InitScriptConfigurationForTasks.create(); InitScriptConfigurationForTasks config = InitScriptConfigurationForTasks.create();
config.initScriptPattern("/var/foo-init-%s"); config.initScriptPattern("/var/foo-init-%s");
assertEquals(config.getBasedir(), "/var"); assertEquals(config.getBasedir(), format("%svar", File.separator));
assertEquals(config.getInitScriptPattern(), "/var/foo-init-%s"); assertEquals(config.getInitScriptPattern(), "/var/foo-init-%s");
} }
@ -57,7 +60,7 @@ public class InitScriptConfigurationForTasksTest {
}).getInstance(InitScriptConfigurationForTasks.class); }).getInstance(InitScriptConfigurationForTasks.class);
config.initScriptPattern("/var/foo-init-%s"); config.initScriptPattern("/var/foo-init-%s");
assertEquals(config.getBasedir(), "/var"); assertEquals(config.getBasedir(), format("%svar", File.separator));
assertEquals(config.getInitScriptPattern(), "/var/foo-init-%s"); assertEquals(config.getInitScriptPattern(), "/var/foo-init-%s");
} }