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=964559dfab72762ff5840c4354f615cc75e7f339;hpb=b957fb8c2ee8e14b8f4cfaa31e37d7e0a54aedd8;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 964559dfab..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; /** @@ -122,16 +123,16 @@ public class TraceControlPropertiesTest extends TestCase { 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)); // ------------------------------------------------------------------------