Author: mareshkau
Date: 2008-01-14 14:03:17 -0500 (Mon, 14 Jan 2008)
New Revision: 5671
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/plugin.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/schema/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/schema/vpe.tests.exsd
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeAllTests.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/META-INF/MANIFEST.MF
Log:
http://jira.jboss.com/jira/browse/JBIDE-1562, was added extensions points to tests which
allows collect all testcases together and was added class which collect all test cases
together and run it's
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/META-INF/MANIFEST.MF 2008-01-14
19:03:08 UTC (rev 5670)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/META-INF/MANIFEST.MF 2008-01-14
19:03:17 UTC (rev 5671)
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Visual Editor Test Plugin
-Bundle-SymbolicName: org.jboss.tools.jsf.vpe.ui.test
+Bundle-SymbolicName: org.jboss.tools.jsf.vpe.ui.test;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.jboss.tools.vpe.ui.test.VPETestPlugin
Require-Bundle: org.eclipse.ui,
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/plugin.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/plugin.xml
(rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/plugin.xml 2008-01-14 19:03:17 UTC
(rev 5671)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="org.jboss.tools.jsf.vpe.ui.tests" name="Visual
Page Editor Junit Test" schema="schema/vpe.tests.exsd"/>
+</plugin>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/schema/vpe.tests.exsd
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/schema/vpe.tests.exsd
(rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/schema/vpe.tests.exsd 2008-01-14
19:03:17 UTC (rev 5671)
@@ -0,0 +1,119 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.jsf.vpe.ui.test">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.jsf.vpe.ui.test"
id="vpe.tests" name="Visual Editor Tests"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="tests"/>
+ </sequence>
+ <attribute name="point" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="tests">
+ <complexType>
+ <attribute name="testSuite" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeAllTests.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeAllTests.java 2008-01-14
19:03:17 UTC (rev 5671)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author Max Areshkau
+ *
+ * Class created to run all ui tests for VPE together
+ */
+public class VpeAllTests {
+
+ public static final String VPE_TEST_EXTENTION_POINT_ID =
"org.jboss.tools.jsf.vpe.ui.tests";
+
+ public static final String TEST_SUITE_PARAM = "testSuite";
+
+ public static final String METHOD_SUITE_NAME = "suite";
+
+ public static Test suite() {
+
+ TestSuite result = new TestSuite();
+ IExtensionRegistry extensionRepository = Platform
+ .getExtensionRegistry();
+
+ IExtensionPoint extensionPoint = extensionRepository
+ .getExtensionPoint(VPE_TEST_EXTENTION_POINT_ID);
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] confElements = extension
+ .getConfigurationElements();
+ for (IConfigurationElement configurationElement : confElements) {
+ String clazz = configurationElement
+ .getAttribute(TEST_SUITE_PARAM);
+ try {
+ Bundle bundle = Platform.getBundle(configurationElement
+ .getNamespaceIdentifier());
+ Class<?> testObject = bundle.loadClass(clazz);
+ Method method = testObject.getMethod(METHOD_SUITE_NAME, null);
+ // null -because static method
+ Object res = method.invoke(null, null);
+ if (res instanceof Test) {
+ Test testSuite = (Test) res;
+ result.addTest(testSuite);
+ }
+ } catch (ClassNotFoundException e) {
+ VPETestPlugin.getDefault().logError(e);
+ } catch (SecurityException e) {
+ VPETestPlugin.getDefault().logError(e);
+ } catch (NoSuchMethodException e) {
+ VPETestPlugin.getDefault().logError(e);
+ } catch (IllegalArgumentException e) {
+ VPETestPlugin.getDefault().logError(e);
+ } catch (IllegalAccessException e) {
+ VPETestPlugin.getDefault().logError(e);
+ } catch (InvocationTargetException e) {
+ VPETestPlugin.getDefault().logError(e);
+ }
+ }
+ }
+ return result;
+
+ }
+
+}