mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
[226738] Create team-shared Launches for Terminal Tests
This commit is contained in:
parent
1941a62e16
commit
734d3e6b8e
5 changed files with 145 additions and 29 deletions
|
@ -0,0 +1,59 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2008 Wind River Systems, Inc. and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Martin Oberhuber (Wind River) - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
package org.eclipse.tm.internal.terminal.connector;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
import org.eclipse.tm.internal.terminal.connector.TerminalConnectorTest.ConnectorMock;
|
||||||
|
import org.eclipse.tm.internal.terminal.connector.TerminalConnectorTest.SimpleFactory;
|
||||||
|
import org.eclipse.tm.internal.terminal.connector.TerminalConnectorTest.TerminalControlMock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Testcase for TerminalConnector that must run as a JUnit plug-in test.
|
||||||
|
*/
|
||||||
|
public class TerminalConnectorPluginTest extends TestCase {
|
||||||
|
|
||||||
|
public void testIsInitialized() {
|
||||||
|
if (!Platform.isRunning())
|
||||||
|
return;
|
||||||
|
TerminalConnector c = new TerminalConnector(new SimpleFactory(new ConnectorMock()), "xID", "xName");
|
||||||
|
assertFalse(c.isInitialized());
|
||||||
|
c.getId();
|
||||||
|
assertFalse(c.isInitialized());
|
||||||
|
c.getName();
|
||||||
|
assertFalse(c.isInitialized());
|
||||||
|
c.getSettingsSummary();
|
||||||
|
assertFalse(c.isInitialized());
|
||||||
|
c.setTerminalSize(10, 10);
|
||||||
|
assertFalse(c.isInitialized());
|
||||||
|
c.load(null);
|
||||||
|
assertFalse(c.isInitialized());
|
||||||
|
c.save(null);
|
||||||
|
assertFalse(c.isInitialized());
|
||||||
|
c.getAdapter(ConnectorMock.class);
|
||||||
|
assertFalse(c.isInitialized());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testGetAdapter() {
|
||||||
|
if (!Platform.isRunning())
|
||||||
|
return;
|
||||||
|
ConnectorMock mock = new ConnectorMock();
|
||||||
|
TerminalConnector c = new TerminalConnector(new SimpleFactory(mock), "xID", "xName");
|
||||||
|
assertNull(c.getAdapter(ConnectorMock.class));
|
||||||
|
// the load is called after the connect...
|
||||||
|
c.connect(new TerminalControlMock());
|
||||||
|
|
||||||
|
assertSame(mock, c.getAdapter(ConnectorMock.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -150,25 +150,6 @@ public class TerminalConnectorTest extends TestCase {
|
||||||
assertEquals("xName", c.getName());
|
assertEquals("xName", c.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIsInitialized() {
|
|
||||||
TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName");
|
|
||||||
assertFalse(c.isInitialized());
|
|
||||||
c.getId();
|
|
||||||
assertFalse(c.isInitialized());
|
|
||||||
c.getName();
|
|
||||||
assertFalse(c.isInitialized());
|
|
||||||
c.getSettingsSummary();
|
|
||||||
assertFalse(c.isInitialized());
|
|
||||||
c.setTerminalSize(10,10);
|
|
||||||
assertFalse(c.isInitialized());
|
|
||||||
c.load(null);
|
|
||||||
assertFalse(c.isInitialized());
|
|
||||||
c.save(null);
|
|
||||||
assertFalse(c.isInitialized());
|
|
||||||
c.getAdapter(ConnectorMock.class);
|
|
||||||
assertFalse(c.isInitialized());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testConnect() {
|
public void testConnect() {
|
||||||
TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName");
|
TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName");
|
||||||
assertFalse(c.isInitialized());
|
assertFalse(c.isInitialized());
|
||||||
|
@ -244,14 +225,4 @@ public class TerminalConnectorTest extends TestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGetAdapter() {
|
|
||||||
ConnectorMock mock=new ConnectorMock();
|
|
||||||
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName");
|
|
||||||
assertNull(c.getAdapter(ConnectorMock.class));
|
|
||||||
// the load is called after the connect...
|
|
||||||
c.connect(new TerminalControlMock());
|
|
||||||
|
|
||||||
assertSame(mock, c.getAdapter(ConnectorMock.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2008 Wind River Systems, Inc. and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Martin Oberhuber (Wind River) - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
package org.eclipse.tm.terminal.test;
|
||||||
|
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Master Test Suite to run all Terminal plug-in tests.
|
||||||
|
*/
|
||||||
|
public class AutomatedPluginTests extends TestCase {
|
||||||
|
/**
|
||||||
|
* Call each AllTests class from each of the test packages.
|
||||||
|
*/
|
||||||
|
public static Test suite() {
|
||||||
|
TestSuite suite = new TestSuite(AutomatedPluginTests.class.getName());
|
||||||
|
suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalConnectorPluginTest.class);
|
||||||
|
return suite;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/org.eclipse.tm.terminal.test/src"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="2"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.tm.terminal.test/src"/>
|
||||||
|
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.tm.terminal.test"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
|
||||||
|
</launchConfiguration>
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
|
||||||
|
<booleanAttribute key="append.args" value="true"/>
|
||||||
|
<booleanAttribute key="askclear" value="false"/>
|
||||||
|
<booleanAttribute key="automaticAdd" value="true"/>
|
||||||
|
<booleanAttribute key="automaticValidate" value="false"/>
|
||||||
|
<stringAttribute key="bootstrap" value=""/>
|
||||||
|
<stringAttribute key="checked" value="[NONE]"/>
|
||||||
|
<booleanAttribute key="clearConfig" value="true"/>
|
||||||
|
<booleanAttribute key="clearws" value="true"/>
|
||||||
|
<booleanAttribute key="clearwslog" value="false"/>
|
||||||
|
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
|
||||||
|
<booleanAttribute key="default" value="true"/>
|
||||||
|
<booleanAttribute key="includeOptional" value="true"/>
|
||||||
|
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/org.eclipse.tm.terminal.test/src/org/eclipse/tm/terminal/test/AutomatedPluginTests.java"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="1"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.tm.terminal.test.AutomatedPluginTests"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.tm.terminal.test"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
|
||||||
|
<stringAttribute key="pde.version" value="3.3"/>
|
||||||
|
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
|
||||||
|
<booleanAttribute key="show_selected_only" value="false"/>
|
||||||
|
<booleanAttribute key="tracing" value="false"/>
|
||||||
|
<booleanAttribute key="useDefaultConfig" value="true"/>
|
||||||
|
<booleanAttribute key="useDefaultConfigArea" value="false"/>
|
||||||
|
<booleanAttribute key="useProduct" value="true"/>
|
||||||
|
</launchConfiguration>
|
Loading…
Add table
Reference in a new issue