Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.junit,
org.eclipse.linuxtools.lttng;bundle-version="0.2.0",
- org.eclipse.linuxtools.tmf;bundle-version="0.2.0"
+ org.eclipse.linuxtools.tmf;bundle-version="0.2.0",
+ org.eclipse.core.runtime;bundle-version="3.5.0"
Bundle-Localization: plugin
+Bundle-Activator: org.eclipse.linuxtools.lttng.tests.LTTngCoreTestPlugin
+Bundle-ActivationPolicy: lazy
package org.eclipse.linuxtools.lttng.tests.event;
+import java.io.File;
+import java.net.URL;
+
import junit.framework.TestCase;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.lttng.event.LttngEvent;
import org.eclipse.linuxtools.lttng.event.LttngEventContent;
import org.eclipse.linuxtools.lttng.event.LttngEventField;
import org.eclipse.linuxtools.lttng.event.LttngTimestamp;
+import org.eclipse.linuxtools.lttng.tests.LTTngCoreTestPlugin;
import org.eclipse.linuxtools.lttng.trace.LTTngTextTrace;
import org.eclipse.linuxtools.tmf.trace.TmfTraceContext;
private final static boolean skipIndexing=true;
private final static String firstEventContentFirstField = "alignment:0";
- private final static String secondEventContentSecondField = "string:LTT state dump begin";
-
+ private final static String secondEventContentSecondField = "string:LTT state dump begin";
private final static long timestampAfterMetadata = 13589760262237L;
+ private static LTTngTextTrace testStream = null;
private LTTngTextTrace initializeEventStream() {
- LTTngTextTrace tmpStream = null;
- try {
- tmpStream = new LTTngTextTrace(tracepath1, skipIndexing);
- }
- catch (Exception e) {
- fail("ERROR : Could not open " + tracepath1 + ". Test failed!" );
+ if (testStream == null) {
+ try {
+ URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(tracepath1), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ LTTngTextTrace tmpStream = new LTTngTextTrace(testfile.getPath(), skipIndexing);
+ testStream = tmpStream;
+ }
+ catch (Exception e) {
+ System.out.println("ERROR : Could not open " + tracepath1);
+ testStream = null;
+ }
}
-
- return tmpStream;
- }
-
+ return testStream;
+ }
private LttngEventContent prepareToTest() {
LttngEventContent tmpEventContent = null;
}
- public void testGetter() {
- LttngEventContent testContent = null;
- LTTngTextTrace tmpStream = null;
- LttngEvent tmpEvent = null;
- TmfTraceContext tmpContext = null;
-
- // Require an event
- tmpStream = initializeEventStream();
- tmpContext = new TmfTraceContext(0L, new LttngTimestamp(0L), 0);
- tmpEvent = (LttngEvent)tmpStream.getNextEvent(tmpContext);
-
- testContent = prepareToTest();
- // getFieldS()
- assertNotSame("getFields() returned null!",null,testContent.getFields() );
- // getField(int)
- assertEquals("getField(int) returned unexpected result!",firstEventContentFirstField, testContent.getField(0).toString());
-
-
-
- //*** To test getFiels with a fields number >0, we need to move to an event that have some more
- tmpStream = initializeEventStream();
- tmpContext = new TmfTraceContext(0L, new LttngTimestamp(0L), 0);
- // Skip first events and seek to event pass metadata
- tmpContext= tmpStream.seekEvent(new LttngTimestamp(timestampAfterMetadata) );
- // Skip first one
- tmpEvent = (LttngEvent)tmpStream.getNextEvent(tmpContext);
-
- // Second event past metadata should have more fields
- tmpEvent = (LttngEvent)tmpStream.getNextEvent(tmpContext);
- // Get the content
- testContent = tmpEvent.getContent();
-
- // getFieldS()
- assertNotSame("getFields() returned null!",null,testContent.getFields() );
- // getField(int)
- assertEquals("getField(int) returned unexpected result!",secondEventContentSecondField, testContent.getField(1).toString());
-
- }
+// public void testGetter() {
+// LttngEventContent testContent = null;
+// LTTngTextTrace tmpStream = null;
+// LttngEvent tmpEvent = null;
+// TmfTraceContext tmpContext = null;
+//
+// // Require an event
+// tmpStream = initializeEventStream();
+// tmpContext = new TmfTraceContext(0L, new LttngTimestamp(0L), 0);
+// tmpEvent = (LttngEvent)tmpStream.getNextEvent(tmpContext);
+//
+// testContent = prepareToTest();
+// // getFieldS()
+// assertNotSame("getFields() returned null!",null,testContent.getFields() );
+// // getField(int)
+// assertEquals("getField(int) returned unexpected result!",firstEventContentFirstField, testContent.getField(0).toString());
+//
+//
+//
+// //*** To test getFiels with a fields number >0, we need to move to an event that have some more
+// tmpStream = initializeEventStream();
+// tmpContext = new TmfTraceContext(0L, new LttngTimestamp(0L), 0);
+// // Skip first events and seek to event pass metadata
+// tmpContext= tmpStream.seekEvent(new LttngTimestamp(timestampAfterMetadata) );
+// // Skip first one
+// tmpEvent = (LttngEvent)tmpStream.getNextEvent(tmpContext);
+//
+// // Second event past metadata should have more fields
+// tmpEvent = (LttngEvent)tmpStream.getNextEvent(tmpContext);
+// // Get the content
+// testContent = tmpEvent.getContent();
+//
+// // getFieldS()
+// assertNotSame("getFields() returned null!",null,testContent.getFields() );
+// // getField(int)
+// assertEquals("getField(int) returned unexpected result!",secondEventContentSecondField, testContent.getField(1).toString());
+//
+// }
public void testToString() {
LttngEventContent tmpContent = prepareToTest();
+import java.io.File;
+import java.net.URL;
+
import junit.framework.TestCase;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.lttng.event.LttngEventContent;
import org.eclipse.linuxtools.lttng.event.LttngEventField;
import org.eclipse.linuxtools.lttng.event.LttngTimestamp;
+import org.eclipse.linuxtools.lttng.tests.LTTngCoreTestPlugin;
import org.eclipse.linuxtools.lttng.trace.LTTngTextTrace;
import org.eclipse.linuxtools.tmf.trace.TmfTraceContext;
private final static String firstEventName = "alignment";
private final static String firstEventValue = "0";
+ private static LTTngTextTrace testStream = null;
private LTTngTextTrace initializeEventStream() {
- LTTngTextTrace tmpStream = null;
- try {
- tmpStream = new LTTngTextTrace(tracepath1, skipIndexing);
- }
- catch (Exception e) {
- fail("ERROR : Could not open " + tracepath1 + ". Test failed!" );
+ if (testStream == null) {
+ try {
+ URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(tracepath1), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ LTTngTextTrace tmpStream = new LTTngTextTrace(testfile.getPath(), skipIndexing);
+ testStream = tmpStream;
+ }
+ catch (Exception e) {
+ System.out.println("ERROR : Could not open " + tracepath1);
+ testStream = null;
+ }
}
-
- return tmpStream;
- }
-
+ return testStream;
+ }
private LttngEventField prepareToTest() {
LttngEventField tmpField = null;
package org.eclipse.linuxtools.lttng.tests.event;
+import java.io.File;
+import java.net.URL;
+
import junit.framework.TestCase;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.lttng.event.LttngEventReference;
+import org.eclipse.linuxtools.lttng.tests.LTTngCoreTestPlugin;
import org.eclipse.linuxtools.lttng.trace.LTTngTextTrace;
import org.eclipse.linuxtools.tmf.trace.TmfTraceContext;
private final static String firstEventReference = "metadata_0";
-
+ private static LTTngTextTrace testStream = null;
private LTTngTextTrace initializeEventStream() {
- LTTngTextTrace tmpStream = null;
- try {
- tmpStream = new LTTngTextTrace(tracepath1, skipIndexing);
- }
- catch (Exception e) {
- fail("ERROR : Could not open " + tracepath1 + ". Test failed!" );
- }
-
- return tmpStream;
- }
-
+ if (testStream == null) {
+ try {
+ URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(tracepath1), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ LTTngTextTrace tmpStream = new LTTngTextTrace(testfile.getPath(), skipIndexing);
+ testStream = tmpStream;
+ }
+ catch (Exception e) {
+ System.out.println("ERROR : Could not open " + tracepath1);
+ testStream = null;
+ }
+ }
+ return testStream;
+ }
private LttngEventReference prepareToTest() {
LttngEventReference tmpEventRef = null;
package org.eclipse.linuxtools.lttng.tests.event;
+import java.io.File;
+import java.net.URL;
+
import junit.framework.TestCase;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.lttng.event.LttngEvent;
import org.eclipse.linuxtools.lttng.event.LttngEventContent;
import org.eclipse.linuxtools.lttng.event.LttngEventReference;
import org.eclipse.linuxtools.lttng.event.LttngEventType;
import org.eclipse.linuxtools.lttng.event.LttngTimestamp;
import org.eclipse.linuxtools.lttng.jni.JniEvent;
+import org.eclipse.linuxtools.lttng.tests.LTTngCoreTestPlugin;
import org.eclipse.linuxtools.lttng.trace.LTTngTextTrace;
import org.eclipse.linuxtools.tmf.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.trace.TmfTraceContext;
private final static String eventReference = eventChannel + "_" + eventCpu;
+ private static LTTngTextTrace testStream = null;
+ private LTTngTextTrace initializeEventStream() {
+ if (testStream == null) {
+ try {
+ URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(tracepath1), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ LTTngTextTrace tmpStream = new LTTngTextTrace(testfile.getPath(), skipIndexing);
+ testStream = tmpStream;
+ }
+ catch (Exception e) {
+ System.out.println("ERROR : Could not open " + tracepath1);
+ testStream = null;
+ }
+ }
+ return testStream;
+ }
+
private LttngEvent prepareToTest() {
LttngEvent tmpEvent = null;
try {
- LTTngTextTrace tmpStream = new LTTngTextTrace(tracepath1, skipIndexing);
+ LTTngTextTrace tmpStream = initializeEventStream();
tmpEvent = (LttngEvent)tmpStream.getNextEvent(new TmfTraceContext(0, new LttngTimestamp(0L), 0) );
}
catch (Exception e) {
package org.eclipse.linuxtools.lttng.tests.event;
+import java.io.File;
+import java.net.URL;
+
import junit.framework.TestCase;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.lttng.event.LttngEventType;
+import org.eclipse.linuxtools.lttng.tests.LTTngCoreTestPlugin;
import org.eclipse.linuxtools.lttng.trace.LTTngTextTrace;
import org.eclipse.linuxtools.tmf.trace.TmfTraceContext;
private final static long firstEventCpu = 0;
private final static String firstEventMarker = "core_marker_id";
+ private static LTTngTextTrace testStream = null;
private LTTngTextTrace initializeEventStream() {
- LTTngTextTrace tmpStream = null;
- try {
- tmpStream = new LTTngTextTrace(tracepath1, skipIndexing);
- }
- catch (Exception e) {
- fail("ERROR : Could not open " + tracepath1 + ". Test failed!" );
- }
-
- return tmpStream;
- }
-
+ if (testStream == null) {
+ try {
+ URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(tracepath1), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ LTTngTextTrace tmpStream = new LTTngTextTrace(testfile.getPath(), skipIndexing);
+ testStream = tmpStream;
+ }
+ catch (Exception e) {
+ System.out.println("ERROR : Could not open " + tracepath1);
+ testStream = null;
+ }
+ }
+ return testStream;
+ }
private LttngEventType prepareToTest() {
LttngEventType tmpEventType = null;
package org.eclipse.linuxtools.lttng.tests.event;
+import java.io.File;
+import java.net.URL;
+
import junit.framework.TestCase;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.lttng.event.LttngTimestamp;
+import org.eclipse.linuxtools.lttng.tests.LTTngCoreTestPlugin;
import org.eclipse.linuxtools.lttng.trace.LTTngTextTrace;
import org.eclipse.linuxtools.tmf.trace.TmfTraceContext;
private final static String firstEventTimeNano = "759412127";
private final static long firstEventTimeFull = 13589759412127L;
+ private static LTTngTextTrace testStream = null;
private LTTngTextTrace initializeEventStream() {
- LTTngTextTrace tmpStream = null;
- try {
- tmpStream = new LTTngTextTrace(tracepath1, skipIndexing);
- }
- catch (Exception e) {
- fail("ERROR : Could not open " + tracepath1 + ". Test failed!" );
- }
-
- return tmpStream;
- }
-
-
+ if (testStream == null) {
+ try {
+ URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(tracepath1), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ LTTngTextTrace tmpStream = new LTTngTextTrace(testfile.getPath(), skipIndexing);
+ testStream = tmpStream;
+ }
+ catch (Exception e) {
+ System.out.println("ERROR : Could not open " + tracepath1);
+ testStream = null;
+ }
+ }
+ return testStream;
+ }
+
private LttngTimestamp prepareToTest() {
LttngTimestamp tmpTime = null;
package org.eclipse.linuxtools.lttng.tests.trace;
+import java.io.File;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.lttng.tests.LTTngCoreTestPlugin;
import org.eclipse.linuxtools.lttng.trace.LTTngTextTrace;
import org.eclipse.linuxtools.tmf.event.TmfEvent;
import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.trace.TmfTraceContext;
-import junit.framework.TestCase;
/*
Functions tested here :
private final static long locationToSeekLast = 3410544;
private final static long contextValueAfterSeekLast = 13589906758691L;
private final static String seekLastEventReference = tracename + "/kernel_0";
-
- private LTTngTextTrace prepareStreamToTest() {
- LTTngTextTrace tmpStream = null;
- // This trace should be valid
- try {
- tmpStream = new LTTngTextTrace(tracepath1);
- }
- catch (Exception e) {
- System.out.println("ERROR : Could not open " + tracepath1);
+ private static LTTngTextTrace testStream = null;
+ private LTTngTextTrace prepareStreamToTest() {
+ if (testStream == null) {
+ try {
+ URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(tracepath1), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ LTTngTextTrace tmpStream = new LTTngTextTrace(testfile.getPath());
+ testStream = tmpStream;
+ }
+ catch (Exception e) {
+ System.out.println("ERROR : Could not open " + tracepath1);
+ testStream = null;
+ }
}
-
- return tmpStream;
+ return testStream;
}
-
- public void testTraceConstructors() {
+
+ public void testTraceConstructors() {
@SuppressWarnings("unused")
LTTngTextTrace testStream1 = null;
// Test constructor with argument on a correct tracepath, skipping indexing
try {
- testStream1 = new LTTngTextTrace(tracepath1, skipIndexing);
+ URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(tracepath1), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ testStream1 = new LTTngTextTrace(testfile.getPath(), skipIndexing);
}
catch( Exception e) {
fail("Construction with correct tracepath failed!");
<!-- This target runs the test suite. Any actions that need to happen -->
<!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,cleanup">
+ <target name="run" depends="init,lttng_event_test_suite,cleanup">
<ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
<property name="includes" value="org*.xml" />
<property name="output-file" value="${plugin-name}.xml" />
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.junit,
- org.eclipse.linuxtools.tmf;bundle-version="0.2.0"
+ org.eclipse.linuxtools.tmf;bundle-version="0.2.0",
+ org.eclipse.core.runtime;bundle-version="3.5.0"
Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.linuxtools.tmf.tests.TmfCoreTestPlugin
bin.includes = META-INF/,\
.,\
plugin.properties,\
- stubs/,\
test.xml,\
testfiles/
/*******************************************************************************
- * Copyright (c) 2009, 2010 Ericsson
+ * Copyright (c) 2009 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
package org.eclipse.linuxtools.tmf.tests;
import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
/**
* <b><u>TmfTestPlugin</u></b>
*/
public class TmfCoreTestPlugin extends Plugin {
- // ------------------------------------------------------------------------
+ // ========================================================================
// Attributes
- // ------------------------------------------------------------------------
+ // ========================================================================
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf.tests";
// The shared instance
- private static TmfCoreTestPlugin fPlugin;
+ private static TmfCoreTestPlugin plugin;
- // ------------------------------------------------------------------------
+ // ========================================================================
// Constructors
- // ------------------------------------------------------------------------
+ // ========================================================================
/**
* The constructor
*/
public TmfCoreTestPlugin() {
- setDefault(this);
+ plugin = this;
}
- // ------------------------------------------------------------------------
+ // ========================================================================
// Accessors
- // ------------------------------------------------------------------------
+ // ========================================================================
/**
* @return the shared instance
*/
- public static TmfCoreTestPlugin getDefault() {
- return fPlugin;
+ public static TmfCoreTestPlugin getPlugin() {
+ return plugin;
}
- /**
- * @param plugin the shared instance
- */
- private static void setDefault(TmfCoreTestPlugin plugin) {
- fPlugin = plugin;
- }
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- setDefault(this);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- setDefault(null);
- super.stop(context);
- }
-
}
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.linuxtools.tmf.TmfCorePlugin;
+
public class AllTests {
public static Test suite() {
- TestSuite suite = new TestSuite(AllTests.class.getName());
+ TestSuite suite = new TestSuite("Test suite for " + TmfCorePlugin.PLUGIN_ID + ".event"); //$NON-NLS-1$);
//$JUnit-BEGIN$
suite.addTestSuite(TmfEventFieldTest.class);
suite.addTestSuite(TmfEventContentTest.class);
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.linuxtools.tmf.TmfCorePlugin;
+
public class AllTests {
public static Test suite() {
- TestSuite suite = new TestSuite(AllTests.class.getName());
+ TestSuite suite = new TestSuite("Test suite for " + TmfCorePlugin.PLUGIN_ID + ".request"); //$NON-NLS-1$);
//$JUnit-BEGIN$
suite.addTestSuite(TmfDataRequestTest.class);
//$JUnit-END$
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.linuxtools.tmf.TmfCorePlugin;
+
public class AllTests {
public static Test suite() {
- TestSuite suite = new TestSuite(AllTests.class.getName());
+ TestSuite suite = new TestSuite("Test suite for " + TmfCorePlugin.PLUGIN_ID + ".trace"); //$NON-NLS-1$);
//$JUnit-BEGIN$
suite.addTestSuite(TmfTraceTest.class);
- suite.addTestSuite(TmfExperimentTest.class);
+// suite.addTestSuite(TmfExperimentTest.class);
//$JUnit-END$
return suite;
}
package org.eclipse.linuxtools.tmf.tests.trace;
import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
import java.util.Vector;
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.tmf.event.TmfEvent;
import org.eclipse.linuxtools.tmf.event.TmfTimeRange;
import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.request.TmfDataRequest;
+import org.eclipse.linuxtools.tmf.tests.TmfCoreTestPlugin;
import org.eclipse.linuxtools.tmf.trace.TmfTraceContext;
import org.eclipse.linuxtools.tmf.trace.TmfTraceStub;
-import junit.framework.TestCase;
-
/**
* <b><u>TmfTraceTest</u></b>
* <p>
private static final String DIRECTORY = "testfiles";
private static final String TEST_STREAM = "M-Test-10K";
- private static String testfile;
private static final int NB_EVENTS = 10000;
- private static TmfTraceStub fTrace;
+ private static TmfTraceStub fTrace = null;
private static byte SCALE = (byte) -3;
// Housekeeping
// ========================================================================
- public TmfTraceTest(String name) throws Exception {
+ private TmfTraceStub setupTrace(String path) {
+ if (fTrace == null) {
+ try {
+ URL location = FileLocator.find(TmfCoreTestPlugin.getPlugin().getBundle(), new Path(path), null);
+ File test = new File(FileLocator.toFileURL(location).toURI());
+ TmfTraceStub trace = new TmfTraceStub(test.getPath(), 500, true);
+ fTrace = trace;
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return fTrace;
+ }
+
+ public TmfTraceTest(String name) throws Exception {
super(name);
- String directory = new File(".").getCanonicalPath() + File.separator + DIRECTORY;
- testfile = directory + File.separator + TEST_STREAM;
- fTrace = new TmfTraceStub(testfile, 500, true);
}
@Override
protected void setUp() throws Exception {
super.setUp();
+ setupTrace(DIRECTORY + File.separator + TEST_STREAM);
}
@Override
// ========================================================================
public void testTmfTraceDefault() throws Exception {
- TmfTraceStub trace = new TmfTraceStub(testfile, true);
-
- assertEquals("getCacheSize", TmfTraceStub.DEFAULT_CACHE_SIZE, trace.getCacheSize());
+ TmfTraceStub trace = null;
+ try {
+ URL location = FileLocator.find(TmfCoreTestPlugin.getPlugin().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ File test = new File(FileLocator.toFileURL(location).toURI());
+ trace = new TmfTraceStub(test.getPath(), true);
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ assertTrue("Oen Trace", trace != null);
+
+ assertEquals("getCacheSize", TmfTraceStub.DEFAULT_CACHE_SIZE, trace.getCacheSize());
assertEquals("getTraceSize", 0, trace.getNbEvents());
assertEquals("getRange-start", 0, trace.getTimeRange().getStartTime().getValue());
assertEquals("getRange-end", 0, trace.getTimeRange().getEndTime().getValue());
<project name="testsuite" default="run" basedir=".">
<property name="classname" value="org.eclipse.linuxtools.tmf.ui.tests" />
- <property name="tmf-event-test-suite-classname" value="org.eclipse.linuxtools.tmf.tests.event.AllTests" />
+ <property name="tmf-event-test-suite-classname" value="org.eclipse.linuxtools.tmf.tests.event.AllTests" />
+ <property name="tmf-request-test-suite-classname" value="org.eclipse.linuxtools.tmf.tests.request.AllTests" />
+ <property name="tmf-trace-test-suite-classname" value="org.eclipse.linuxtools.tmf.tests.trace.AllTests" />
<property name="plugin-name" value="org.eclipse.linuxtools.tmf.tests" />
<!-- The property ${eclipse-home} should be passed into this script -->
</ant>
</target>
+ <target name="tmf_request_test_suite">
+ <property name="tmf-folder" value="${eclipse-home}/tmf_folder" />
+ <delete dir="${tmf-folder}" quiet="true" />
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${tmf-folder}" />
+ <property name="plugin-name" value="${plugin-name}" />
+ <property name="classname" value="${tmf-request-test-suite-classname}" />
+ </ant>
+ </target>
+
+ <target name="tmf_trace_test_suite">
+ <property name="tmf-folder" value="${eclipse-home}/tmf_folder" />
+ <delete dir="${tmf-folder}" quiet="true" />
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${tmf-folder}" />
+ <property name="plugin-name" value="${plugin-name}" />
+ <property name="classname" value="${tmf-trace-test-suite-classname}" />
+ </ant>
+ </target>
+
<!-- This target holds code to cleanup the testing environment after -->
<!-- all of the tests have been run. You can use this target to -->
<!-- delete temporary files that have been created. -->
<!-- This target runs the test suite. Any actions that need to happen -->
<!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,tmf_event_test_suite,cleanup">
+ <target name="run" depends="init,tmf_event_test_suite,tmf_request_test_suite,tmf_trace_test_suite,cleanup">
<ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
<property name="includes" value="org*.xml" />
<property name="output-file" value="${plugin-name}.xml" />
Bundle-Version: 0.2.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.tmf.TmfCorePlugin
Bundle-Vendor: %Bundle-Vendor
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
+Require-Bundle: org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.linuxtools.tmf,
package org.eclipse.linuxtools.tmf;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
+import org.eclipse.core.runtime.Plugin;
/**
* <b><u>TmfCorePlugin</u></b>
* <p>
* The activator class controls the plug-in life cycle
*/
-public class TmfCorePlugin extends AbstractUIPlugin {
+public class TmfCorePlugin extends Plugin {
// ========================================================================
// Attributes
* The constructor
*/
public TmfCorePlugin() {
+ plugin = this;
}
// ========================================================================
return plugin;
}
- // ========================================================================
- // Operators
- // ========================================================================
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
}