Skip to content

Commit

Permalink
Fix ScopeTest on Windows (openhab#1148)
Browse files Browse the repository at this point in the history
Fixes openhab#1069

Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn authored and kaikreuzer committed Oct 19, 2019
1 parent a3d91be commit 42a0007
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package org.openhab.core.automation.module.script.defaultscope.internal;

import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
Expand All @@ -35,7 +34,7 @@ public class ScopeTest extends JavaOSGiTest {

private ScriptEngine engine;

private final String path = "ESH-INF" + File.separator + "automation" + File.separator + "jsr223";
private final String path = "ESH-INF/automation/jsr223/";
private final String workingFile = "scopeWorking.js";
private final String failureFile = "scopeFailure.js";

Expand All @@ -48,13 +47,13 @@ public void init() {

@Test
public void testScopeDefinesItemTypes() throws ScriptException, IOException {
URL url = bundleContext.getBundle().getResource(path + File.separator + workingFile);
URL url = bundleContext.getBundle().getResource(path + workingFile);
engine.eval(new InputStreamReader(url.openStream()));
}

@Test(expected = ScriptException.class)
public void testScopeDoesNotDefineFoobar() throws ScriptException, IOException {
URL url = bundleContext.getBundle().getResource(path + File.separator + failureFile);
URL url = bundleContext.getBundle().getResource(path + failureFile);
engine.eval(new InputStreamReader(url.openStream()));
}
}

0 comments on commit 42a0007

Please sign in to comment.