Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa/tests
diff options
context:
space:
mode:
authorkmoore2007-08-06 13:14:21 +0000
committerkmoore2007-08-06 13:14:21 +0000
commitbf47a9ed3437cfbe6871c2bd4b9551ce73ca29cd (patch)
tree0c196d336a3d1c9cf6a50d77d16d44448aa00c59 /jpa/tests
parenta48b2a8af868458e822519afcb2e5decfe0bee52 (diff)
downloadwebtools.dali-bf47a9ed3437cfbe6871c2bd4b9551ce73ca29cd.tar.gz
webtools.dali-bf47a9ed3437cfbe6871c2bd4b9551ce73ca29cd.tar.xz
webtools.dali-bf47a9ed3437cfbe6871c2bd4b9551ce73ca29cd.zip
*** empty log message ***
Diffstat (limited to 'jpa/tests')
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.classpath7
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF14
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/build.properties4
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties22
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java72
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java28
8 files changed, 207 insertions, 0 deletions
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.classpath b/jpa/tests/org.eclipse.jpt.ui.tests/.classpath
new file mode 100644
index 0000000000..751c8f2e50
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/.classpath
@@ -0,0 +1,7 @@
+<?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.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.project b/jpa/tests/org.eclipse.jpt.ui.tests/.project
new file mode 100644
index 0000000000..0240774761
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jpt.ui.tests</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>
+</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..0433c08a07
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.jpt.ui.tests
+Bundle-Version: 1.0.0
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.jpt.core.tests,
+ org.eclipse.jpt.core,
+ org.junit,
+ org.eclipse.jpt.utility,
+ org.eclipse.jpt.ui,
+ testPlugin
+Eclipse-LazyStart: true
+Bundle-Vendor: %providerName
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/build.properties b/jpa/tests/org.eclipse.jpt.ui.tests/build.properties
new file mode 100644
index 0000000000..34d2e4d2da
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties
new file mode 100644
index 0000000000..ca8ab879ff
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties
@@ -0,0 +1,22 @@
+###############################################################################
+# Copyright (c) 2006, 2007 Oracle. 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: Oracle. - initial API and implementation
+###############################################################################
+# ====================================================================
+# To code developer:
+# Do NOT change the properties between this line and the
+# "%%% END OF TRANSLATED PROPERTIES %%%" line.
+# Make a new property name, append to the end of the file and change
+# the code to use the new property.
+# ====================================================================
+
+# ====================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# ====================================================================
+
+pluginName=Java Persistence API UI Tests
+providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java
new file mode 100644
index 0000000000..a1a87466a6
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Oracle. 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:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.tests;
+
+import org.eclipse.jpt.ui.tests.internal.platform.JptUiPlatformTests;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Runs all JPT UI Tests
+ */
+public class JptUiTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(JptUiTests.class.getName());
+ suite.addTest(JptUiPlatformTests.suite());
+ return suite;
+ }
+
+ private JptUiTests() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
new file mode 100644
index 0000000000..de209fcfff
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
@@ -0,0 +1,72 @@
+package org.eclipse.jpt.ui.tests.internal.platform;
+
+import junit.framework.TestCase;
+import org.eclipse.jpt.core.internal.IJpaProject;
+import org.eclipse.jpt.core.internal.JpaPlatformRegistry;
+import org.eclipse.jpt.core.internal.platform.generic.GenericPlatform;
+import org.eclipse.jpt.core.tests.internal.ProjectUtility;
+import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
+import org.eclipse.jpt.ui.internal.IJpaPlatformUi;
+import org.eclipse.jpt.ui.internal.PlatformRegistry;
+import org.eclipse.jpt.ui.internal.generic.GenericPlatformUi;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+
+public class JpaPlatformUiExtensionTests extends TestCase
+{
+ protected TestJpaProject testProject;
+
+ protected static final String PROJECT_NAME = "ExtensionTestProject";
+ protected static final String PACKAGE_NAME = "extension.test";
+
+ public static final String TEST_PLUGIN_CLASS = "org.eclipse.tests.TestPlugin";
+ public static final String TEST_PLUGIN_ID = "testPlugin";
+ public static final String TEST_PLUGIN_NAME = "TestPlugin";
+
+ public static final String TEST_PLATFORM_ID = "core.testJpaPlatform";
+ public static final String TEST_PLATFORM_CLASS = "org.eclipse.tests.TestJpaPlatform";
+ public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
+
+ public static final String TEST_UI_PLATFORM_ID = TEST_PLATFORM_ID;
+ public static final String TEST_UI_PLATFORM_CLASS = "org.eclipse.tests.TestJpaPlatformUi";
+
+ public JpaPlatformUiExtensionTests(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ testProject = this.buildJpaProject(PROJECT_NAME, false); // false = no auto-build
+ }
+
+ protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild) throws Exception {
+ return new TestJpaProject(projectName, autoBuild); // false = no auto-build
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //testProject.dispose();
+ ProjectUtility.deleteAllProjects();
+ testProject = null;
+ super.tearDown();
+ }
+
+ protected IJpaProject jpaProject() {
+ return this.testProject.getJpaProject();
+ }
+
+ public void testJpaPlatform() {
+ assertNotNull(PlatformRegistry.instance().jpaPlatform(jpaProject().getPlatform().getId()));
+ }
+
+ public void testSetPlatform() {
+ IJpaPlatformUi platformUi = PlatformRegistry.instance().jpaPlatform(jpaProject().getPlatform().getId());
+ assertTrue(platformUi instanceof GenericPlatformUi);
+
+ jpaProject().setPlatform(TEST_PLATFORM_ID);
+
+ platformUi = PlatformRegistry.instance().jpaPlatform(jpaProject().getPlatform().getId());
+
+ assertTrue(platformUi.getClass().getName().equals(TEST_UI_PLATFORM_CLASS));
+ }
+}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java
new file mode 100644
index 0000000000..2614c59ac1
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Oracle.
+ * 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:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.tests.internal.platform;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class JptUiPlatformTests
+{
+ public static Test suite() {
+ TestSuite suite = new TestSuite(JptUiPlatformTests.class.getName());
+ suite.addTestSuite(JpaPlatformUiExtensionTests.class);
+ return suite;
+ }
+
+ private JptUiPlatformTests() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+}

Back to the top