package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocationInfo;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
}
/**
- * Run the String[] getEnvNames() method test.
- */
- @Test
- public void testGetEnvNames() {
- String[] result = fixture.getEnvNames();
- assertNotNull(result);
- }
-
- /**
- * Run the String getEnvValue(String) method test.
+ * Run the String getEnvironment method test.
*/
@Test
public void testGetEnvValue() {
String key = "tracer_name";
- String result = fixture.getEnvValue(key);
+ String result = fixture.getTraceProperties().get(key);
assertEquals("\"lttng-modules\"",result);
}
*/
@Test
public void testGetNbEnvVars() {
- int result = fixture.getNbEnvVars();
+ int result = fixture.getTraceProperties().size();
assertEquals(8, result);
}
public void testValidate() {
IProject project = null;
String path = PATH;
- boolean result = fixture.validate(project, path);
- assertTrue(result);
+ IStatus result = fixture.validate(project, path);
+ assertTrue(result.isOK());
}
+
+ /**
+ * Run the boolean hasEvent(final String) method test
+ */
+ @Test
+ public void testEventLookup() {
+ assertTrue(fixture.hasEvent("sched_switch"));
+ assertFalse(fixture.hasEvent("Sched_switch"));
+ String[] events = { "sched_switch", "sched_wakeup", "timer_init" };
+ assertTrue(fixture.hasAllEvents(events));
+ assertTrue(fixture.hasAtLeastOneOfEvents(events));
+ String[] names = { "inexistent", "sched_switch", "SomeThing" };
+ assertTrue(fixture.hasAtLeastOneOfEvents(names));
+ assertFalse(fixture.hasAllEvents(names));
+ }
+
+ /**
+ * Run the String getHostId() method test
+ */
+ @Test
+ public void testCtfHostId() {
+ String a = fixture.getHostId();
+ assertEquals("\"84db105b-b3f4-4821-b662-efc51455106a\"", a);
+ }
+
}