X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.ctf.core.tests%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Fctf%2Fcore%2Ftests%2Ftrace%2FStreamTest.java;h=68fe8a81f93dc5432e2d3d81199f78dac8c9f942;hb=8e15b929fecc6725aee97c83727afc34d033f28c;hp=4826e6631315c5e65d1d765a78b0d869162e657c;hpb=9ac63b5b7d1887d843f145b9c3857fd7ba495b69;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java b/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java index 4826e66313..68fe8a81f9 100644 --- a/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java +++ b/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java @@ -16,7 +16,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; import java.io.File; -import java.nio.channels.FileChannel; +import java.io.FilenameFilter; import java.util.Map; import java.util.Set; @@ -59,8 +59,20 @@ public class StreamTest { fixture.setPacketContext(new StructDeclaration(1L)); fixture.setEventHeader(new StructDeclaration(1L)); fixture.setId(1L); - fixture.addInput(new StreamInput(new Stream(testTrace.getTrace()), - (FileChannel) null, new File(""))); + fixture.addInput(new StreamInput(new Stream(testTrace.getTrace()), createFile())); + } + + private static File createFile() { + File path = new File(testTrace.getPath()); + return path.listFiles(new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + if (name.contains("hann")) { + return true; + } + return false; + } + })[0]; } /** @@ -76,8 +88,8 @@ public class StreamTest { } /** - * Run the void addEvent(EventDeclaration) method test with the basic - * event. + * Run the void addEvent(EventDeclaration) method test with the basic event. + * * @throws ParseException */ @Test @@ -93,6 +105,7 @@ public class StreamTest { public void testEventContextIsSet() { assertTrue(fixture.isEventContextSet()); } + /** * Run the boolean eventContextIsSet() method test. */ @@ -188,7 +201,6 @@ public class StreamTest { assertTrue(result); } - /** * Run the void setEventContext(StructDeclaration) method test. */