diff options
author | Markus Tiede | 2015-07-06 14:43:18 +0000 |
---|---|---|
committer | Markus Tiede | 2015-07-06 14:43:27 +0000 |
commit | eaf18550bd6f89e52b8811b5c4ca2e4352ddadfe (patch) | |
tree | 8553095bf83035e08ef5c75fe296d4159a8c2d7b | |
parent | ec862635ac0da9ccbff568a8231a3ef71e85a997 (diff) | |
download | org.eclipse.jubula.core-eaf18550bd6f89e52b8811b5c4ca2e4352ddadfe.tar.gz org.eclipse.jubula.core-eaf18550bd6f89e52b8811b5c4ca2e4352ddadfe.tar.xz org.eclipse.jubula.core-eaf18550bd6f89e52b8811b5c4ca2e4352ddadfe.zip |
Sprint task - allow adding of custom type mapping in 'org.eclipse.jubula.toolkit.ToolkitInfo' - docu part 3
12 files changed, 269 insertions, 0 deletions
diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/.classpath b/org.eclipse.jubula.examples.extension.javafx.api.test/.classpath new file mode 100644 index 000000000..098194ca4 --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/.gitignore b/org.eclipse.jubula.examples.extension.javafx.api.test/.gitignore new file mode 100644 index 000000000..64af1f50f --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/.gitignore @@ -0,0 +1,3 @@ +/build +/bin +/target diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/.project b/org.eclipse.jubula.examples.extension.javafx.api.test/.project new file mode 100644 index 000000000..97e229998 --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/.project @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.jubula.examples.extension.javafx.api.test</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> + <filteredResources> + <filter> + <id>1409218333740</id> + <name></name> + <type>10</type> + <matcher> + <id>org.eclipse.ui.ide.multiFilter</id> + <arguments>1.0-projectRelativePath-matches-false-false-target</arguments> + </matcher> + </filter> + </filteredResources> +</projectDescription> diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jubula.examples.extension.javafx.api.test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..f42de363a --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/META-INF/MANIFEST.MF b/org.eclipse.jubula.examples.extension.javafx.api.test/META-INF/MANIFEST.MF new file mode 100644 index 000000000..24d211b3e --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Jubula Extension Example - JavaFX - API Test +Bundle-SymbolicName: org.eclipse.jubula.examples.extension.javafx.api.test +Bundle-Version: 3.1.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Bundle-Vendor: Eclipse Jubula +Bundle-ClassPath: . +Require-Bundle: org.junit;bundle-version="[4.0.0,5.0.0)", + org.eclipse.jubula.tools;bundle-version="[3.0.0,4.0.0)", + org.eclipse.jubula.client.api;bundle-version="[3.0.0,4.0.0)", + org.eclipse.jubula.client.api.commands;bundle-version="[3.0.0,4.0.0)", + org.eclipse.jubula.communication;bundle-version="[3.0.0,4.0.0)", + org.eclipse.jubula.toolkit.api;bundle-version="[3.0.0,4.0.0)", + org.eclipse.jubula.toolkit.base.api;bundle-version="[3.0.0,4.0.0)", + org.eclipse.jubula.toolkit.concrete.api;bundle-version="[3.0.0,4.0.0)", + org.eclipse.jubula.toolkit.javafx.api;bundle-version="[3.0.0,4.0.0)", + org.eclipse.jubula.examples.extension.javafx.api;bundle-version="[3.0.0,4.0.0)", + org.slf4j.api;bundle-version="[1.7.2,2.0.0)", + org.apache.commons.codec;bundle-version="[1.4.0,2.0.0)", + org.apache.commons.lang;bundle-version="[2.6.0,3.0.0)" diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/about.html b/org.eclipse.jubula.examples.extension.javafx.api.test/about.html new file mode 100644 index 000000000..f1be81099 --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 22, 2011</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/build.properties b/org.eclipse.jubula.examples.extension.javafx.api.test/build.properties new file mode 100644 index 000000000..9cbab3c13 --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html +src.includes = about.html diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/pom.xml b/org.eclipse.jubula.examples.extension.javafx.api.test/pom.xml new file mode 100644 index 000000000..3687c45cf --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/pom.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + + <parent> + <relativePath>../org.eclipse.jubula.examples.extension.releng</relativePath> + <groupId>org.eclipse.jubula</groupId> + <artifactId>org.eclipse.jubula.examples.extension.releng</artifactId> + <version>3.1.0-SNAPSHOT</version> + </parent> + + <artifactId>org.eclipse.jubula.examples.extension.javafx.api.test</artifactId> + <packaging>eclipse-plugin</packaging> +</project>
\ No newline at end of file diff --git a/org.eclipse.jubula.examples.extension.javafx.api.test/src/org/eclipse/jubula/examples/extension/javafx/test/PieCharTest.java b/org.eclipse.jubula.examples.extension.javafx.api.test/src/org/eclipse/jubula/examples/extension/javafx/test/PieCharTest.java new file mode 100644 index 000000000..bd7fd3140 --- /dev/null +++ b/org.eclipse.jubula.examples.extension.javafx.api.test/src/org/eclipse/jubula/examples/extension/javafx/test/PieCharTest.java @@ -0,0 +1,127 @@ +/******************************************************************************* + * Copyright (c) 2015 BREDEX GmbH. + * 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: + * BREDEX GmbH - initial API and implementation and/or initial documentation + *******************************************************************************/ +package org.eclipse.jubula.examples.extension.javafx.test; + +import java.util.Locale; + +import org.eclipse.jubula.client.AUT; +import org.eclipse.jubula.client.AUTAgent; +import org.eclipse.jubula.client.MakeR; +import org.eclipse.jubula.client.exceptions.CheckFailedException; +import org.eclipse.jubula.client.launch.AUTConfiguration; +import org.eclipse.jubula.examples.extension.javafx.PieChartComponents; +import org.eclipse.jubula.toolkit.ToolkitInfo; +import org.eclipse.jubula.toolkit.base.components.GraphicsComponent; +import org.eclipse.jubula.toolkit.concrete.components.ButtonComponent; +import org.eclipse.jubula.toolkit.enums.ValueSets.InteractionMode; +import org.eclipse.jubula.toolkit.javafx.JavafxComponents; +import org.eclipse.jubula.toolkit.javafx.config.JavaFXAUTConfiguration; +import org.eclipse.jubula.tools.AUTIdentifier; +import org.eclipse.jubula.tools.ComponentIdentifier; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** @author BREDEX GmbH */ +public class PieCharTest { + /** the default number of pies within the AUT */ + public static final int DEFAULT_NO_OF_SLICES = 5; + + /** AUT-Agent host name to use */ + public static final String AGENT_HOST = "localhost"; //$NON-NLS-1$ + /** AUT-Agent port to use */ + public static final int AGENT_PORT = 60000; + /** the AUT-Agent */ + private AUTAgent m_agent; + /** the AUT */ + private AUT m_aut; + /** the pie chart component wrapper */ + private PieChartComponents m_pcc; + /** the component identifier */ + private static final ComponentIdentifier<?> pieChartIdentifier = MakeR.createCI( + "rO0ABXNyAD1vcmcuZWNsaXBzZS5qdWJ1bGEudG9vbHMuaW50ZXJuYWwub2JqZWN0cy5Db21wb25lbnRJZGVudGlmaWVyAAAAAAAABAcCAAlaABRtX2VxdWFsT3JpZ2luYWxGb3VuZEQAEW1fbWF0Y2hQZXJjZW50YWdlSQAhbV9udW1iZXJPZk90aGVyTWF0Y2hpbmdDb21wb25lbnRzTAAYbV9hbHRlcm5hdGl2ZURpc3BsYXlOYW1ldAASTGphdmEvbGFuZy9TdHJpbmc7TAAUbV9jb21wb25lbnRDbGFzc05hbWVxAH4AAUwAFW1fY29tcG9uZW50UHJvcGVydGllc3QAD0xqYXZhL3V0aWwvTWFwO0wAEG1faGllcmFyY2h5TmFtZXN0ABBMamF2YS91dGlsL0xpc3Q7TAAMbV9uZWlnaGJvdXJzcQB+AANMABRtX3N1cHBvcnRlZENsYXNzTmFtZXEAfgABeHAAv/AAAAAAAAD/////cHQAG2phdmFmeC5zY2VuZS5jaGFydC5QaWVDaGFydHBzcgATamF2YS51dGlsLkFycmF5TGlzdHiB0h2Zx2GdAwABSQAEc2l6ZXhwAAAABHcEAAAABHQAFGphdmFmeC5zdGFnZS5TdGFnZV8xdAAUamF2YWZ4LnNjZW5lLlNjZW5lXzF0ABpqYXZhZnguc2NlbmUubGF5b3V0LlZCb3hfMXQACHBpZUNoYXJ0eHNxAH4ABgAAAAF3BAAAAAF0ABpqYXZhZnguc2NlbmUubGF5b3V0LkhCb3hfMXhxAH4ABQ=="); //$NON-NLS-1$ + /** the button */ + private static GraphicsComponent button; + + /** global prepare */ + @BeforeClass + public static void loadObjectMapping() throws Exception { + ComponentIdentifier<ButtonComponent> buttonCI = MakeR.createCI( + "rO0ABXNyAD1vcmcuZWNsaXBzZS5qdWJ1bGEudG9vbHMuaW50ZXJuYWwub2JqZWN0cy5Db21wb25lbnRJZGVudGlmaWVyAAAAAAAABAcCAAlaABRtX2VxdWFsT3JpZ2luYWxGb3VuZEQAEW1fbWF0Y2hQZXJjZW50YWdlSQAhbV9udW1iZXJPZk90aGVyTWF0Y2hpbmdDb21wb25lbnRzTAAYbV9hbHRlcm5hdGl2ZURpc3BsYXlOYW1ldAASTGphdmEvbGFuZy9TdHJpbmc7TAAUbV9jb21wb25lbnRDbGFzc05hbWVxAH4AAUwAFW1fY29tcG9uZW50UHJvcGVydGllc3QAD0xqYXZhL3V0aWwvTWFwO0wAEG1faGllcmFyY2h5TmFtZXN0ABBMamF2YS91dGlsL0xpc3Q7TAAMbV9uZWlnaGJvdXJzcQB+AANMABRtX3N1cHBvcnRlZENsYXNzTmFtZXEAfgABeHAAv/AAAAAAAAD/////cHQAG2phdmFmeC5zY2VuZS5jb250cm9sLkJ1dHRvbnBzcgATamF2YS51dGlsLkFycmF5TGlzdHiB0h2Zx2GdAwABSQAEc2l6ZXhwAAAABXcEAAAABXQAFGphdmFmeC5zdGFnZS5TdGFnZV8xdAAUamF2YWZ4LnNjZW5lLlNjZW5lXzF0ABpqYXZhZnguc2NlbmUubGF5b3V0LlZCb3hfMXQAGmphdmFmeC5zY2VuZS5sYXlvdXQuSEJveF8xdAAKcGx1c0J1dHRvbnhzcQB+AAYAAAABdwQAAAABdAALbWludXNCdXR0b254cQB+AAU="); //$NON-NLS-1$ + + button = JavafxComponents.createButton(buttonCI); + } + + /** prepare */ + @Before + public void setUp() throws Exception { + m_agent = MakeR.createAUTAgent(AGENT_HOST, AGENT_PORT); + m_agent.connect(); + + final String autID = "JavaFXExampleExtensionAUT"; //$NON-NLS-1$ + AUTConfiguration config = new JavaFXAUTConfiguration( + "api.aut.conf.javafx.extension", //$NON-NLS-1$ + autID, + "JREs\\java8\\bin\\java.exe", //$NON-NLS-1$ + "..\\examples\\", //$NON-NLS-1$ + new String[]{ + "-jar", //$NON-NLS-1$ + "development\\extension\\AUT\\PieChart.jar" //$NON-NLS-1$ + }, + Locale.getDefault()); + + AUTIdentifier id = m_agent.startAUT(config); + if (id != null) { + ToolkitInfo toolkitInformation = JavafxComponents + .createToolkitInformation(); + + m_pcc = new PieChartComponents(toolkitInformation); + + m_aut = m_agent.getAUT(id, m_pcc.getToolkitInfo()); + m_aut.connect(); + } else { + Assert.fail("AUT start has failed!"); //$NON-NLS-1$ + } + } + + /** the actual test method */ + @Test + public void testPieChartSpecificAction() throws Exception { + m_aut.execute(m_pcc.checkNumberOfItems(pieChartIdentifier, + DEFAULT_NO_OF_SLICES), + "Verify initial number of pies"); + + m_aut.execute(button.click(1, InteractionMode.primary), + "Increment number of pies"); + + m_aut.execute(m_pcc.checkNumberOfItems(pieChartIdentifier, + DEFAULT_NO_OF_SLICES + 1), + "Verify incremented number of pies"); + } + + /** the actual test method */ + @Test(expected = CheckFailedException.class) + public void testExpectedCheckFailed() throws Exception { + m_aut.execute(m_pcc.checkNumberOfItems(pieChartIdentifier, + DEFAULT_NO_OF_SLICES - 1), + "Expected failure for initial number of slice verification"); + } + + /** cleanup */ + @After + public void tearDown() throws Exception { + m_aut.disconnect(); + m_agent.stopAUT(m_aut.getIdentifier()); + m_agent.disconnect(); + } +}
\ No newline at end of file diff --git a/org.eclipse.jubula.examples.extension.javafx.api/META-INF/MANIFEST.MF b/org.eclipse.jubula.examples.extension.javafx.api/META-INF/MANIFEST.MF index 23d85f754..a6d8fb152 100644 --- a/org.eclipse.jubula.examples.extension.javafx.api/META-INF/MANIFEST.MF +++ b/org.eclipse.jubula.examples.extension.javafx.api/META-INF/MANIFEST.MF @@ -11,3 +11,4 @@ Require-Bundle: org.slf4j.api;bundle-version="[1.7.2,2.0.0)", org.eclipse.jubula.tools;bundle-version="[3.1.0,3.2.0)", org.eclipse.jubula.communication;bundle-version="[3.1.0,3.2.0)", org.eclipse.jubula.toolkit.api;bundle-version="[3.1.0,3.2.0)" +Export-Package: org.eclipse.jubula.examples.extension.javafx diff --git a/org.eclipse.jubula.examples.extension.javafx.feature/feature.xml b/org.eclipse.jubula.examples.extension.javafx.feature/feature.xml index 1cc544fe0..bc7098dc2 100644 --- a/org.eclipse.jubula.examples.extension.javafx.feature/feature.xml +++ b/org.eclipse.jubula.examples.extension.javafx.feature/feature.xml @@ -47,4 +47,18 @@ BREDEX GmbH - initial API and implementation and/or initial documentation version="0.0.0" unpack="false"/> + <plugin + id="org.eclipse.jubula.examples.extension.javafx.api" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.jubula.examples.extension.javafx.api.test" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + </feature> diff --git a/org.eclipse.jubula.examples.extension.releng/pom.xml b/org.eclipse.jubula.examples.extension.releng/pom.xml index aec9e7ef8..53e8f80f7 100644 --- a/org.eclipse.jubula.examples.extension.releng/pom.xml +++ b/org.eclipse.jubula.examples.extension.releng/pom.xml @@ -25,6 +25,7 @@ <module>../org.eclipse.jubula.examples.extension.javafx.rc.container</module> <module>../org.eclipse.jubula.examples.extension.javafx.toolkit</module> <module>../org.eclipse.jubula.examples.extension.javafx.api</module> + <module>../org.eclipse.jubula.examples.extension.javafx.api.test</module> </modules> </project>
\ No newline at end of file |