X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.lttng2.ui.tests%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Flttng2%2Fui%2Ftests%2Fcontrol%2Fmodel%2Fcomponent%2FTraceControlPropertiesTest.java;h=ff63ad9beebe97399feec0279822c3aa793e0fec;hb=9315aeeef150e462551af3dcd5eb20f370a6942f;hp=23e4a18a5535d5a7ed19e09d6a10379f8b0fcced;hpb=115b4a011a6d454d317b035d616f649c75a9943c;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlPropertiesTest.java b/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlPropertiesTest.java index 23e4a18a55..ff63ad9bee 100644 --- a/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlPropertiesTest.java +++ b/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlPropertiesTest.java @@ -20,14 +20,14 @@ import junit.framework.TestSuite; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Path; +import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo; +import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState; +import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement; +import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType; +import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel; +import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState; import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy; -import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IChannelInfo; import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent; -import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TargetNodeState; -import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TraceEnablement; -import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TraceLogLevel; -import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TraceSessionState; import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent; import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.KernelProviderComponent; import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent; @@ -46,13 +46,14 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceEve import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceProbeEventPropertySource; import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.TraceSessionPropertySource; import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.UstProviderPropertySource; -import org.eclipse.linuxtools.lttng2.ui.tests.Activator; -import org.eclipse.rse.core.model.Host; +import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.internal.core.model.SystemProfile; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.ui.views.properties.IPropertySource; import org.junit.After; import org.junit.Before; +import org.osgi.framework.FrameworkUtil; /** @@ -111,27 +112,27 @@ public class TraceControlPropertiesTest extends TestCase { */ @Override @After - public void tearDown() throws Exception { + public void tearDown() throws Exception { + TraceControlTestFacility.getInstance().waitForJobs(); } /** * Run the TraceControlComponent. */ - public void testTraceControlComponents() - throws Exception { + public void testComponentProperties() throws Exception { TestRemoteSystemProxy proxy = new TestRemoteSystemProxy(); - URL location = FileLocator.find(Activator.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null); + URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null); File testfile = new File(FileLocator.toFileURL(location).toURI()); proxy.setTestFile(testfile.getAbsolutePath()); proxy.setScenario(SCEN_LIST_INFO_TEST); ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot(); - @SuppressWarnings("restriction") - IHost host = new Host(new SystemProfile("myProfile", true)); - host.setHostName("127.0.0.1"); + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + ISystemProfile profile = registry.createSystemProfile("myProfile", true); + IHost host = registry.createLocalHost(profile, "myProfile", "user"); TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, proxy); @@ -154,7 +155,7 @@ public class TraceControlPropertiesTest extends TestCase { assertNotNull(source.getPropertyDescriptors()); assertEquals("myNode", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_NAME_PROPERTY_ID)); - assertEquals("127.0.0.1", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_ADDRESS_PROPERTY_ID)); + assertEquals("LOCALHOST", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_ADDRESS_PROPERTY_ID)); assertEquals(TargetNodeState.CONNECTED.name(), source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_STATE_PROPERTY_ID)); assertNull(source.getPropertyValue("test")); @@ -196,7 +197,7 @@ public class TraceControlPropertiesTest extends TestCase { UstProviderPropertySource ustSource = (UstProviderPropertySource)adapter; assertNotNull(ustSource.getPropertyDescriptors()); - assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_NAME_PROPERTY_ID)); + assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_NAME_PROPERTY_ID)); assertEquals(String.valueOf(9379), ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_PID_PROPERTY_ID)); // ------------------------------------------------------------------------ @@ -343,5 +344,10 @@ public class TraceControlPropertiesTest extends TestCase { assertEquals("0x0", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID)); assertEquals("init_post", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID)); + //------------------------------------------------------------------------- + // Delete node + //------------------------------------------------------------------------- + node.disconnect(); + node.getParent().removeChild(node); } } \ No newline at end of file