X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=LogParser%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fxacml%2Fparser%2FParseLogTest.java;h=c12797f281ef9eef549dff7d96f8fb35f7a7e28f;hb=81d5df62133aa7bdb9c64b3d227a2838a0a2b83c;hp=b02a1435da859e82aa177899747d9ae250682cf9;hpb=490459f7fe922c8448e8a38b87fd48e5e71d7b4c;p=policy%2Fengine.git diff --git a/LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java b/LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java index b02a1435d..c12797f28 100644 --- a/LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java +++ b/LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java @@ -31,6 +31,8 @@ import java.io.IOException; import java.io.InputStreamReader; import java.util.Date; import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.junit.After; import org.junit.Before; @@ -57,6 +59,7 @@ public class ParseLogTest { public void setUp() throws Exception { System.setProperty("com.sun.management.jmxremote.port", "9998"); im = Mockito.mock(IntegrityMonitor.class); + String regex = "^\\/[a-zA-Z]\\:\\/"; try { Mockito.doNothing().when(im).startTransaction(); @@ -66,7 +69,10 @@ public class ParseLogTest { Mockito.doNothing().when(im).endTransaction(); ClassLoader classLoader = getClass().getClassLoader(); configFile = classLoader.getResource("test_config.properties").getFile(); - if(configFile.startsWith("/C:/")){ + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(configFile); + + if (matcher.find()) { configFile = configFile.substring(1); } testFile1 = classLoader.getResource("LineTest.txt").getFile();