Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortle2008-11-14 21:08:46 +0000
committertle2008-11-14 21:08:46 +0000
commit9fabe20c90c3334f449cb8a6e17c0972c7f56f53 (patch)
treef390fc86b3e5e3cd5e4e75dd77042c8e0e790117
parenta8ef170826d966afc729cd08a84620f278bc8da0 (diff)
downloadwebtools.dali-9fabe20c90c3334f449cb8a6e17c0972c7f56f53.tar.gz
webtools.dali-9fabe20c90c3334f449cb8a6e17c0972c7f56f53.tar.xz
webtools.dali-9fabe20c90c3334f449cb8a6e17c0972c7f56f53.zip
Removed invalid test - set property name to null
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java37
1 files changed, 16 insertions, 21 deletions
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java
index 90bde4ffe4..4ab50d113a 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java
@@ -991,74 +991,69 @@ public class PersistenceUnitTests extends ContextModelTestCase
assertNull(persistenceUnit.getProperty("notExist"));
}
+ private Property persistenceUnitFirstProperty() {
+ return persistenceUnit().properties().next();
+ }
+
public void testUpdatePropertyName() {
XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
// add property for testing
XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
xmlPersistenceUnit.setProperties(xmlProperties);
XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
xmlProperties.getProperties().add(xmlProperty);
- Property property = persistenceUnit.properties().next();
// test that names are initially equal
- assertEquals(xmlProperty.getName(), property.getName());
+ assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
// set name to different name, test equality
xmlProperty.setName("newName");
-
- assertEquals(xmlProperty.getName(), property.getName());
+
+ assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
// set name to empty string, test equality
xmlProperty.setName("");
-
- assertEquals(xmlProperty.getName(), property.getName());
-
- // set name to null, test equality
- xmlProperty.setName(null);
-
- assertEquals(xmlProperty.getName(), property.getName());
+
+ assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
// set name back to non-null, test equality
xmlProperty.setName("newName");
-
- assertEquals(xmlProperty.getName(), property.getName());
+
+ assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
}
public void testUpdatePropertyValue() {
XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
// add property for testing
XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
xmlPersistenceUnit.setProperties(xmlProperties);
XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
xmlProperties.getProperties().add(xmlProperty);
- Property property = persistenceUnit.properties().next();
// test that values are initially equal
- assertEquals(xmlProperty.getValue(), property.getValue());
+ assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
// set value to different value, test equality
xmlProperty.setValue("newValue");
- assertEquals(xmlProperty.getValue(), property.getValue());
+ assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
// set value to empty string, test equality
xmlProperty.setValue("");
- assertEquals(xmlProperty.getValue(), property.getValue());
+ assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
// set value to null, test equality
xmlProperty.setValue(null);
- assertEquals(xmlProperty.getValue(), property.getValue());
+ assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
// set value back to non-null, test equality
xmlProperty.setValue("newValue");
- assertEquals(xmlProperty.getValue(), property.getValue());
+ assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
}

Back to the top