Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests')
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java2
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/EclipseLinkStaticWeavingBuilderMetadataTests.java67
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/JptJpaEclipseLinkCoreMetadataTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml4
5 files changed, 104 insertions, 2 deletions
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF
index 1ed964b5fb..9fe3acc778 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF
+++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF
@@ -28,5 +28,6 @@ Export-Package: org.eclipse.jpt.jpa.eclipselink.core.tests.internal;x-internal:=
org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;x-internal:=true,
+ org.eclipse.jpt.jpa.eclipselink.core.tests.internal.metadata;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java
index d64454a021..97d7891e9c 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java
@@ -14,6 +14,7 @@ import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.JptJpaEclipseLinkCoreContextModelTests;
+import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.metadata.JptJpaEclipseLinkCoreMetadataTests;
import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.JptJpaEclipselinkCoreResourceModelTests;
/**
@@ -33,6 +34,7 @@ public class JptJpaEclipseLinkCoreTests
TestSuite suite = new TestSuite(JptJpaEclipseLinkCoreTests.class.getPackage().getName());
suite.addTest(JptJpaEclipselinkCoreResourceModelTests.suite());
suite.addTest(JptJpaEclipseLinkCoreContextModelTests.suite());
+ suite.addTest(JptJpaEclipseLinkCoreMetadataTests.suite());
return suite;
}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/EclipseLinkStaticWeavingBuilderMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/EclipseLinkStaticWeavingBuilderMetadataTests.java
new file mode 100644
index 0000000000..764927f336
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/EclipseLinkStaticWeavingBuilderMetadataTests.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+* Copyright (c) 2012 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.jpa.eclipselink.core.tests.internal.metadata;
+
+import junit.framework.Assert;
+
+import org.eclipse.jpt.jpa.core.tests.internal.metadata.JpaMetadataTests;
+import org.eclipse.jpt.jpa.eclipselink.core.builder.StaticWeavingBuilderConfigurator;
+
+/**
+ * JpaStaticWeavingBuilderMetadataTests
+ */
+public class EclipseLinkStaticWeavingBuilderMetadataTests extends JpaMetadataTests {
+
+ public static final String SOURCE_PREF_KEY = "staticweave.SOURCE"; //$NON-NLS-1$
+ public static final String LOG_LEVEL_PREF_KEY = "staticweave.LOG_LEVEL"; //$NON-NLS-1$
+
+ public static final String SOURCE_TEST_VALUE = "bin"; //$NON-NLS-1$
+ public static final String LOG_LEVEL_TEST_VALUE = "ALL"; //$NON-NLS-1$
+
+ protected StaticWeavingBuilderConfigurator projectPrefsManager;
+
+ // ********** constructor **********
+
+ public EclipseLinkStaticWeavingBuilderMetadataTests(String name) {
+ super(name);
+ }
+
+ // ********** overrides **********
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ this.projectPrefsManager = new StaticWeavingBuilderConfigurator(this.getJavaProject().getProject());
+ Assert.assertNotNull(this.projectPrefsManager);
+ }
+
+ // ********** tests **********
+
+ public void testSourceLocationProjectMetadata() throws Exception {
+
+ this.projectPrefsManager.setSourceLocationPreference(SOURCE_TEST_VALUE);
+ this.projectPrefsManager.getLegacyProjectPreferences().flush();
+
+ String value = this.getProjectPrefs().get(SOURCE_PREF_KEY);
+ Assert.assertNotNull(value);
+ Assert.assertTrue(SOURCE_TEST_VALUE.equals(value));
+ }
+
+ public void testLogLevelProjectMetadata() throws Exception {
+
+ this.projectPrefsManager.setLogLevelPreference(LOG_LEVEL_TEST_VALUE);
+ this.projectPrefsManager.getLegacyProjectPreferences().flush();
+
+ String value = this.getProjectPrefs().get(LOG_LEVEL_PREF_KEY);
+ Assert.assertNotNull(value);
+ Assert.assertTrue(LOG_LEVEL_TEST_VALUE.equals(value));
+ }
+} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/JptJpaEclipseLinkCoreMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/JptJpaEclipseLinkCoreMetadataTests.java
new file mode 100644
index 0000000000..ce8adf5e40
--- /dev/null
+++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/JptJpaEclipseLinkCoreMetadataTests.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+* Copyright (c) 2012 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.jpa.eclipselink.core.tests.internal.metadata;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+/**
+ * JptJpaEclipseLinkCoreMetadataTests
+ */
+public class JptJpaEclipseLinkCoreMetadataTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(JptJpaEclipseLinkCoreMetadataTests.class.getPackage().getName());
+ suite.addTestSuite(EclipseLinkStaticWeavingBuilderMetadataTests.class);
+ return suite;
+ }
+
+ private JptJpaEclipseLinkCoreMetadataTests() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+
+} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml
index 9b3b5db533..b76008604b 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml
+++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml
@@ -34,8 +34,8 @@
<property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
<property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/>
</ant>
- </target>
- <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.JptJpaEclipseLinkCoreContextModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/> </ant> </target>
+ </target>
+ <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.JptJpaEclipseLinkCoreContextModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/> </ant> </target> <target name="suite3"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.eclipselink.core.tests.internal.metadata.JptJpaEclipseLinkCoreMetadataTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/> </ant> </target>
<!-- This target holds code to cleanup the testing environment after -->
<!-- after all of the tests have been run. You can use this target to -->
<!-- delete temporary files that have been created. -->

Back to the top