Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2012-01-19 19:04:56 +0000
committerkmoore2012-01-19 19:04:56 +0000
commit1beda6f5b752a1ddae960f2972b7749791d640d8 (patch)
tree78c8077bbd05219a66b376861cc70d674c504b89 /jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt
parentffd361feb124c3eb7098a5183918c2b4d26537a5 (diff)
downloadwebtools.dali-1beda6f5b752a1ddae960f2972b7749791d640d8.tar.gz
webtools.dali-1beda6f5b752a1ddae960f2972b7749791d640d8.tar.xz
webtools.dali-1beda6f5b752a1ddae960f2972b7749791d640d8.zip
removed use of reflection for persistence.xml enum property values
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt')
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java
index 48befbb7ed..7f4d035911 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
+* Copyright (c) 2009, 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.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
import java.util.Iterator;
-
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.model.event.ListEvent;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
@@ -18,8 +17,8 @@ import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnitProperties;
import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
/**
@@ -78,7 +77,14 @@ public abstract class PersistenceUnitTestCase extends ContextModelTestCase
// ****** convenience test methods *******
protected String getPropertyStringValueOf(Object value) {
- return AbstractPersistenceUnitProperties.getPropertyStringValueOf(value);
+ if (value == null) {
+ return null;
+ }
+ //TODO yes, I know, an instanceof check, this is a LOT of work to get rid of in the tests
+ if (value instanceof PersistenceXmlEnumValue) {
+ return ((PersistenceXmlEnumValue) value).getPropertyValue();
+ }
+ return value.toString();
}
protected <E> E getFirstElement(Iterator<E> iterator) {

Back to the top