summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.riena.tests')
-rw-r--r--org.eclipse.riena.tests/plugin.xml13
-rw-r--r--org.eclipse.riena.tests/schema/core.test.extpoint.exsd41
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ExtensionUtilTest.java27
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ITest.java2
4 files changed, 56 insertions, 27 deletions
diff --git a/org.eclipse.riena.tests/plugin.xml b/org.eclipse.riena.tests/plugin.xml
index b63e33b..59fa3a2 100644
--- a/org.eclipse.riena.tests/plugin.xml
+++ b/org.eclipse.riena.tests/plugin.xml
@@ -29,5 +29,18 @@
executable="java.lang.String"
string="test1">
</test>
+ <test
+ boolean="false"
+ executable="java.util.HashMap"
+ string="test2">
+ </test>
+ </extension>
+ <extension
+ point="core.test.extpoint">
+ <test
+ boolean="true"
+ executable="java.util.ArrayList"
+ string="test3">
+ </test>
</extension>
</plugin>
diff --git a/org.eclipse.riena.tests/schema/core.test.extpoint.exsd b/org.eclipse.riena.tests/schema/core.test.extpoint.exsd
index 0aabc80..3add169 100644
--- a/org.eclipse.riena.tests/schema/core.test.extpoint.exsd
+++ b/org.eclipse.riena.tests/schema/core.test.extpoint.exsd
@@ -1,10 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
-<schema targetNamespace="de.compeople.scp.core.tests">
+<schema targetNamespace="de.compeople.scp.core.tests" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
- <appInfo>
+ <appinfo>
<meta.schema plugin="de.compeople.scp.core.tests" id="core.test.extpoint" name="extpoint"/>
- </appInfo>
+ </appinfo>
<documentation>
[Enter description of this extension point.]
</documentation>
@@ -12,7 +12,7 @@
<element name="extension">
<complexType>
- <sequence>
+ <sequence minOccurs="1" maxOccurs="unbounded">
<element ref="test"/>
</sequence>
<attribute name="point" type="string" use="required">
@@ -34,9 +34,9 @@
<documentation>
</documentation>
- <appInfo>
+ <appinfo>
<meta.attribute translatable="true"/>
- </appInfo>
+ </appinfo>
</annotation>
</attribute>
</complexType>
@@ -63,57 +63,50 @@
<documentation>
</documentation>
- <appInfo>
+ <appinfo>
<meta.attribute kind="java"/>
- </appInfo>
+ </appinfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
- <appInfo>
+ <appinfo>
<meta.section type="since"/>
- </appInfo>
+ </appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
- <appInfo>
+ <appinfo>
<meta.section type="examples"/>
- </appInfo>
+ </appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
- <appInfo>
+ <appinfo>
<meta.section type="apiInfo"/>
- </appInfo>
+ </appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
+
<annotation>
- <appInfo>
+ <appinfo>
<meta.section type="implementation"/>
- </appInfo>
+ </appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
</schema>
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ExtensionUtilTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ExtensionUtilTest.java
index 027c041..731fb41 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ExtensionUtilTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ExtensionUtilTest.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.riena.core.extension.util;
+import java.util.ArrayList;
+import java.util.HashMap;
+
import org.eclipse.riena.tests.RienaTestCase;
public class ExtensionUtilTest extends RienaTestCase {
@@ -18,8 +21,26 @@ public class ExtensionUtilTest extends RienaTestCase {
System.out.println("test");
ITest[] tests = ExtensionUtility.readExtensions("core.test.extpoint", ITest.class);
assertNotNull(tests);
- assertTrue(tests[0].getString().equals("test1"));
- assertTrue(tests[0].getBoolean());
- assertTrue(tests[0].createExecutable() instanceof String);
+ assertTrue("tests.length should be 3 but is " + tests.length, tests.length == 3);
+ for (ITest test : tests) {
+ assertNotNull(test.getString());
+ if (test.getString().equals("test1")) {
+ assertTrue(test.getBoolean());
+ assertTrue(test.isBoolean());
+ assertTrue(test.createExecutable() instanceof String);
+ } else {
+ if (test.getString().equals("test2")) {
+ assertFalse(test.getBoolean());
+ assertFalse(test.isBoolean());
+ assertTrue(test.createExecutable() instanceof HashMap);
+ } else {
+ if (test.getString().equals("test3")) {
+ assertTrue(test.getBoolean());
+ assertTrue(test.isBoolean());
+ assertTrue(test.createExecutable() instanceof ArrayList);
+ }
+ }
+ }
+ }
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ITest.java
index fb7218a..a820bd7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/util/ITest.java
@@ -16,6 +16,8 @@ public interface ITest {
boolean getBoolean();
+ boolean isBoolean();
+
Object createExecutable();
}