import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-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.junit.After;
import org.junit.Before;
import org.osgi.framework.FrameworkUtil;
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, fProxy);
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.AddContextDialogStub;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableEventsDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProbeEventComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-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.junit.After;
import org.junit.Before;
import org.osgi.framework.FrameworkUtil;
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, fProxy);
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.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;
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"));
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.UstProviderComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlService;
-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.swt.graphics.Image;
import org.junit.After;
import org.junit.Before;
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(TARGET_NODE_NAME, root, host, fProxy);
// ------------------------------------------------------------------------
// Verify Parameters of TargetNodeComponent
// ------------------------------------------------------------------------
- assertEquals("127.0.0.1", node.getHostName());
- assertEquals("127.0.0.1", node.getToolTip());
+ assertEquals("LOCALHOST", node.getHostName()); // assigned in createLocalHost() above
+ assertEquals("LOCALHOST", node.getToolTip()); // assigned in createLocalHost() above
Image connectedImage = node.getImage();
assertNotNull(connectedImage);
assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.TraceControlDialogFactory;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.UstProviderComponent;
-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.junit.After;
import org.junit.Before;
import org.osgi.framework.FrameworkUtil;
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, fProxy);
root.addChild(node);
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
-import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.CreateSessionDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableChannelDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.EnableEventsDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.dialogs.GetEventInfoDialogStub;
import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceChannelComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
-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.junit.After;
import org.junit.Before;
import org.osgi.framework.FrameworkUtil;
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, fProxy);
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.impl.BaseEventInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.EventInfo;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.ProbeEventInfo;
/**
try {
ITraceControlComponent root = fTargetNode.getParent();
fTargetNode.removeAllChildren();
+ fTargetNode.deregister();
root.removeChild(fTargetNode);
} finally {
fLock.unlock();
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandShell;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlServiceFactory;
+import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.IRSECallback;
+import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.subsystems.CommunicationsEvent;
import org.eclipse.rse.core.subsystems.ICommunicationsListener;
import org.eclipse.swt.graphics.Image;
job.schedule();
}
+ /**
+ * Refresh the node configuration
+ */
public void refresh() {
removeAllChildren();
getConfigurationFromNode();
}
+
+ /**
+ * Deregisters host from registry.
+ */
+ public void deregister() {
+ ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
+ registry.deleteHost(fHost);
+ }
// ------------------------------------------------------------------------
// Helper function