Commit 939b6dfb authored by Dominique Blouin's avatar Dominique Blouin

Issue #98: Migration of existing tests to TTool directory

parent 7133636b
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry combineaccessrules="false" kind="src" path="/src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fr.tpt.ttool.tests.diplodocus.simulator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="src" path="/src"/>
<classpathentry kind="lib" path="assertj-swing-3.8.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fr.tpt.ttool.tests.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry combineaccessrules="false" kind="src" path="/src"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fr.tpt.ttool.tests.util</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
package fr.tpt.ttool.tests.util;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import fr.tpt.ttool.tests.util.remote.TestRshClient;
public class TToolUtilTestsRunner {
public static void main(String[] args) {
Result result = JUnitCore.runClasses( TestRshClient.class );
for ( final Failure failure : result.getFailures() ) {
System.err.println( "Test failed : " + failure.toString() );
}
if ( result.wasSuccessful() ) {
System.out.println( "All tests passed." );
}
else {
System.err.println( "Some of the tests failed!" );
}
System.exit( 0 );
}
}
<?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="/ttool/src/test/java/ui/TestGTURTLEModeling.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.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ui.TestGTURTLEModeling"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ttool"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:ttool/src/test}"/>
</launchConfiguration>
<?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="/ttool/src/test/java/launcher/TestRshClient.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.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="launcher.TestRshClient"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ttool"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:ttool/src/test}"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/TToolUtilTestsRunner.java"/>
<listEntry value="/ttool/src/test/java/ui/tmldd/TestTDiagramPanel.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="fr.tpt.ttool.tests.util.TToolUtilTestsRunner"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="fr.tpt.ttool.tests.util"/>
<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.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ui.tmldd.TestTDiagramPanel"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ttool"/>
</launchConfiguration>
<?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="/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/remote/TestRshClient.java"/>
<listEntry value="/ttool"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=ttool"/>
<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.junit4"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="fr.tpt.ttool.tests.util.remote.TestRshClient"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="fr.tpt.ttool.tests.util"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ttool"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:ttool/src/test}"/>
</launchConfiguration>
......@@ -42,25 +42,19 @@
* @author Letitia LI
*/
package avatartranslator;
//I am adding safety tests because Ludovic said to
import org.junit.Test;
import org.junit.*;
import static org.junit.Assert.*;
import java.util.LinkedList;
import java.util.HashMap;
import java.util.Vector;
import java.util.List;
import java.util.ArrayList;
import ui.TAttribute;
import avatartranslator.*;
import ui.*;
import ui.avatarbd.*;
import myutil.*;
public class AvatarSafetyTests {
List<AvatarBDBlock> blocks;
......
......@@ -45,28 +45,34 @@
package avatartranslator;
import org.junit.Test;
import org.junit.*;
import static org.junit.Assert.*;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import ui.*;
import ui.tmlcompd.*;
import java.util.LinkedList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
import ui.tree.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ToolTipManager;
import javax.swing.*;
import org.junit.Before;
import org.junit.Test;
import tmltranslator.*;
import tmltranslator.SecurityPattern;
import tmltranslator.TMLArchitecture;
import tmltranslator.TMLExecC;
import tmltranslator.TMLMapping;
import tmltranslator.TMLModeling;
import tmltranslator.TMLStartState;
import tmltranslator.TMLTask;
import tmltranslator.toavatar.TML2Avatar;
import ui.MainGUI;
import ui.TGComponent;
import ui.TMLComponentDesignPanel;
import ui.tmlcompd.TMLCPrimitiveComponent;
import ui.tmlcompd.TMLComponentTaskDiagramPanel;
import ui.tree.DiagramTreeRenderer;
import ui.tree.JDiagramTree;
public class AvatarSecurityTranslationTests {
TMLMapping<TGComponent> map;
......
package fr.tpt.ttool.tests.util.remote;
package launcher;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
......@@ -24,9 +24,9 @@ public class TestRshClient {
private static final String EXPECTED_COMMAND_OUTPUT = "!!!Hello World!!!" + System.lineSeparator();
private static final String TEST_PROGRAM_NAME = "helloWorld";
private static final String TEST_COMMAND = "./resources/" + TEST_PROGRAM_NAME;
private static final String TEST_COMMAND_NON_STOP = "./resources/helloWorldNonStop";
private static final String TEST_FILE_NAME = "./resources/test.txt";
private static final String TEST_COMMAND = "./resources/launcher/" + TEST_PROGRAM_NAME;
private static final String TEST_COMMAND_NON_STOP = "./resources/launcher/helloWorldNonStop";
private static final String TEST_FILE_NAME = "./resources/launcher/test.txt";
private static final String TEST_FILE_DATA = "testDatafhkenomrcg ,jgh o";
......
package fr.tpt.ttool.tests.ui;
package ui.tmldd;
import org.junit.*;
import ui.MainGUI;
import ui.tmldd.TMLArchiBUSNode;
import ui.tmldd.TMLArchiDiagramPanel;
import ui.tmldd.TMLArchiDiagramToolBar;
import junit.framework.TestCase;
import myutil.PluginManager;
import static org.junit.Assert.assertTrue;
public class MoveComponentTest extends TestCase {
static MainGUI mgui;
import org.junit.Before;
import org.junit.Test;
import ui.AbstractUITest;
public class TestTDiagramPanel extends AbstractUITest {
// static MainGUI mgui;
static TMLArchiDiagramToolBar tb;
static TMLArchiDiagramPanel tdp;
static TMLArchiBUSNode tgc;
public TestTDiagramPanel() {
super();
}
@Before
public void setUp() throws Exception {
mgui = new MainGUI(false, false, false, false, false, false, false, false, false, false, false, true);
mgui.build();
PluginManager.pluginManager = new PluginManager();
tb = new TMLArchiDiagramToolBar(mgui);
tdp = new TMLArchiDiagramPanel(mgui, tb);
// mgui = new MainGUI(false, false, false, false, false, false, false, false, false, false, false, true);
// mgui.build();
//PluginManager.pluginManager = new PluginManager();
tb = new TMLArchiDiagramToolBar( mainGui );
tdp = new TMLArchiDiagramPanel( mainGui, tb);
tgc = new TMLArchiBUSNode(500, 500, 0, 1400, 0, 1900, true, null, tdp);
tdp.setComponentPointed(null);
}
......@@ -61,4 +64,4 @@ public class MoveComponentTest extends TestCase {
assertTrue(tgc.getY() == 500);
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment