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;
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;
/**
@Override
@After
public void tearDown() throws Exception {
+ TraceControlTestFacility.getInstance().waitForJobs();
}
/**
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);
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"));
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));
// ------------------------------------------------------------------------