You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2013/12/21 07:36:21 UTC
git commit: [KARAF-2558] Fix unit tests on Windows platform
Updated Branches:
refs/heads/karaf-2.x 0ab169c91 -> ab81daace
[KARAF-2558] Fix unit tests on Windows platform
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/ab81daac
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/ab81daac
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/ab81daac
Branch: refs/heads/karaf-2.x
Commit: ab81daacefa010a1f18783111858e2ebfbc94e22
Parents: 0ab169c
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Sat Dec 21 07:35:49 2013 +0100
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Sat Dec 21 07:35:49 2013 +0100
----------------------------------------------------------------------
.../jaas/modules/properties/PropertiesLoginModuleTest.java | 6 ++----
main/src/test/java/org/apache/karaf/main/MainStartTest.java | 6 ++----
2 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf/blob/ab81daac/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModuleTest.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModuleTest.java b/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModuleTest.java
index 08830f4..3413048 100644
--- a/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModuleTest.java
+++ b/jaas/modules/src/test/java/org/apache/karaf/jaas/modules/properties/PropertiesLoginModuleTest.java
@@ -258,11 +258,9 @@ public class PropertiesLoginModuleTest {
@Test
public void testNonExistantPropertiesFile() throws LoginException, IOException, UnsupportedCallbackException {
try {
- testWithUsersFile("/test/users.properties");
+ testWithUsersFile(File.separator + "test" + File.separator + "users.properties");
} catch (LoginException e) {
- String message = e.getMessage();
- message = message.replace("\\", "/");
- Assert.assertEquals("Users file not found at /test/users.properties", message);
+ Assert.assertEquals("Users file not found at " + File.separator + "test" + File.separator + "users.properties", e.getMessage());
}
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/ab81daac/main/src/test/java/org/apache/karaf/main/MainStartTest.java
----------------------------------------------------------------------
diff --git a/main/src/test/java/org/apache/karaf/main/MainStartTest.java b/main/src/test/java/org/apache/karaf/main/MainStartTest.java
index 6ccfef8..a5f991b 100644
--- a/main/src/test/java/org/apache/karaf/main/MainStartTest.java
+++ b/main/src/test/java/org/apache/karaf/main/MainStartTest.java
@@ -21,7 +21,6 @@ package org.apache.karaf.main;
import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
import java.io.File;
-import java.net.URI;
import junit.framework.Assert;
@@ -39,9 +38,8 @@ public class MainStartTest {
public void testAutoStart() throws Exception {
File basedir = new File(getClass().getClassLoader().getResource("foo").getPath()).getParentFile();
File home = new File(basedir, "test-karaf-home");
- File data = new File(home, "data");
-
- Utils.deleteDirectory(data);
+ // create an unique data folder to avoid conflict with other unit tests (KARAF-2558)
+ File data = new File(home, "data" + System.currentTimeMillis());
String[] args = new String[0];
String fileMVNbundle = new File(home, "bundles/pax-url-mvn.jar").toURI().toURL().toExternalForm();