Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeb Ford-Reitz2011-11-02 08:01:15 +0000
committerZeb Ford-Reitz2011-11-02 08:01:15 +0000
commitdac548e6ff15b95991816d7f9fa80f3d93c20839 (patch)
tree84bbbb9e36795150c2f3d1edc8a9d7001fe0fa24
parent3d43926f94ec5efb60f48beacb874041c3e96292 (diff)
downloadorg.eclipse.jubula.core-dac548e6ff15b95991816d7f9fa80f3d93c20839.tar.gz
org.eclipse.jubula.core-dac548e6ff15b95991816d7f9fa80f3d93c20839.tar.xz
org.eclipse.jubula.core-dac548e6ff15b95991816d7f9fa80f3d93c20839.zip
Adds model-/database-level support for Central Test Data categories.
-rw-r--r--org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlExporter.java2
-rw-r--r--org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java8
-rw-r--r--org.eclipse.jubula.client.core/META-INF/persistence.xml2
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java4
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java2
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java1
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties1
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java2
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCategoryPO.java79
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubeContPO.java39
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java12
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java4
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java25
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCategoryPO.java284
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubeContPO.java126
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java52
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java10
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java1
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contentassist/TestDataCubeRefContentProposalProvider.java2
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java4
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/CentralTestDataEditor.java9
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/PersistableEditorInput.java3
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/AddNewTestDataManagerHandler.java13
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTestDataManagerHandler.java11
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/AbstractOpenHandler.java4
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenCentralTestDataEditorHandler.java4
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/AbstractTreeViewContentProvider.java14
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/CentralTestDataContentProvider.java15
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/query/TestDataSearchQuery.java2
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/result/BasicSearchResult.java9
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/validator/TestDataCubeReferenceValidator.java2
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java4
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ImportXLSTestdataWizardPage.java8
-rw-r--r--org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/jarutils/IVersion.java2
34 files changed, 518 insertions, 242 deletions
diff --git a/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlExporter.java b/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlExporter.java
index f84c142e0..2be372ea1 100644
--- a/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlExporter.java
+++ b/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlExporter.java
@@ -379,7 +379,7 @@ class XmlExporter {
}
// Test Data Cubes
for (IParameterInterfacePO testDataCube
- : po.getTestDataCubeCont().getTestDataCubeList()) {
+ : po.getTestDataCubeCont().getTestDataChildren()) {
NamedTestData xmlTestDataCube = xml.addNewNamedTestData();
fillNamedTestData(xmlTestDataCube, testDataCube);
}
diff --git a/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java b/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java
index d1f4a533e..052f8301e 100644
--- a/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java
+++ b/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java
@@ -742,7 +742,7 @@ class XmlImporter {
}
for (NamedTestData testDataCube : xml.getNamedTestDataList()) {
checkCancel();
- proj.getTestDataCubeCont().addTestDataCube(createTestDataCube(
+ proj.getTestDataCubeCont().addTestData(createTestDataCube(
testDataCube, assignNewGuid, mapper));
}
for (Category catXml : xml.getCategoryList()) {
@@ -1804,7 +1804,7 @@ class XmlImporter {
* @return a persistent object generated from the information in the XML
* element
*/
- private IParameterInterfacePO createTestDataCube(NamedTestData xml,
+ private ITestDataCubePO createTestDataCube(NamedTestData xml,
boolean assignNewGuids, IParamNameMapper mapper) {
ITestDataCubePO testDataCube =
@@ -1919,7 +1919,7 @@ class XmlImporter {
if (xml.getReferencedTestData() != null) {
String referencedDataName = xml.getReferencedTestData();
for (IParameterInterfacePO testDataCube
- : proj.getTestDataCubeCont().getTestDataCubeList()) {
+ : proj.getTestDataCubeCont().getTestDataChildren()) {
if (referencedDataName.equals(testDataCube.getName())) {
tc.setReferencedDataCube(testDataCube);
break;
@@ -2073,7 +2073,7 @@ class XmlImporter {
if (xml.getReferencedTestData() != null) {
String referencedDataName = xml.getReferencedTestData();
for (IParameterInterfacePO testDataCube
- : proj.getTestDataCubeCont().getTestDataCubeList()) {
+ : proj.getTestDataCubeCont().getTestDataChildren()) {
if (referencedDataName.equals(testDataCube.getName())) {
exec.setReferencedDataCube(testDataCube);
break;
diff --git a/org.eclipse.jubula.client.core/META-INF/persistence.xml b/org.eclipse.jubula.client.core/META-INF/persistence.xml
index 2cef210e6..3f25231dd 100644
--- a/org.eclipse.jubula.client.core/META-INF/persistence.xml
+++ b/org.eclipse.jubula.client.core/META-INF/persistence.xml
@@ -51,7 +51,7 @@
<class>org.eclipse.jubula.client.core.model.AUTContPO</class>
<class>org.eclipse.jubula.client.core.model.SpecObjContPO</class>
<class>org.eclipse.jubula.client.core.model.ExecObjContPO</class>
- <class>org.eclipse.jubula.client.core.model.TestDataCubeContPO</class>
+ <class>org.eclipse.jubula.client.core.model.TestDataCategoryPO</class>
<class>org.eclipse.jubula.client.core.model.ParamNamePO</class>
<class>org.eclipse.jubula.client.core.model.ProjectNamePO</class>
<class>org.eclipse.jubula.client.core.model.ComponentNamePO</class>
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java
index 52fddfd5c..63e971c75 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java
@@ -16,7 +16,7 @@ import org.eclipse.jubula.client.core.model.IPersistentObject;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.IProjectPropertiesPO;
import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.model.ITestJobPO;
import org.eclipse.jubula.client.core.model.ITestSuitePO;
import org.slf4j.Logger;
@@ -75,7 +75,7 @@ public final class CompNameMapperFactory {
return new NullComponentNameMapper();
} else if (node instanceof ITestJobPO) {
return new NullComponentNameMapper();
- } else if (node instanceof ITestDataCubeContPO) {
+ } else if (node instanceof ITestDataCategoryPO) {
return new NullComponentNameMapper();
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java
index 9154c798f..faef92587 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java
@@ -51,7 +51,7 @@ public class TestDataCubeBP {
for (IParameterInterfacePO testDataCube
: containingProject.getTestDataCubeCont()
- .getTestDataCubeList()) {
+ .getTestDataChildren()) {
if (cubeName.equals(testDataCube.getName())) {
return testDataCube;
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java
index 27c54addf..1a14a9b2b 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java
@@ -52,7 +52,6 @@ public class Messages extends NLS {
public static String CantReadProjectFromDatabase;
public static String CantSaveProject;
public static String CantSetupPersistence;
- public static String CentralTestDataEditorName;
public static String ClearingOfMasterSessionFailed;
public static String ClientBuildingReport;
public static String ClientCalculating;
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties
index c54220504..a8b08848b 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties
@@ -38,7 +38,6 @@ CantLoadPersistenceProperties=Can't load Persistence properties
CantReadProjectFromDatabase=Can't read project from database
CantSaveProject=Can't save project
CantSetupPersistence=Can't setup Persistence
-CentralTestDataEditorName=Central Test Data
ClearingOfMasterSessionFailed=Clearing of master session failed
ClientBuildingReport=Building Monitoring Report
ClientCalculating=Calculating Monitoring Values
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java
index 88fc263f3..49b1e5454 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java
@@ -102,7 +102,7 @@ public interface IProjectPO extends IParamNodePO {
/**
* @return Returns the test data container.
*/
- public abstract ITestDataCubeContPO getTestDataCubeCont();
+ public abstract ITestDataCategoryPO getTestDataCubeCont();
/**
* All data from this PO is available from delegate methods in IProjectPO.
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCategoryPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCategoryPO.java
new file mode 100644
index 000000000..fa4816f78
--- /dev/null
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCategoryPO.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2011 BREDEX GmbH.
+ * 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:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.model;
+
+import java.util.List;
+
+/**
+ * @author BREDEX GmbH
+ * @created Nov 01, 2011
+ */
+public interface ITestDataCategoryPO extends IPersistentObject {
+
+ /**
+ * @return an unmodifiable list of Test Data Categories
+ */
+ public List<ITestDataCategoryPO> getCategoryChildren();
+
+ /**
+ * @return an unmodifiable list of Central Test Data
+ */
+ public List<ITestDataCubePO> getTestDataChildren();
+
+ /**
+ *
+ * @param toAdd The category to add to the receiver. Must not be
+ * <code>null</code>.
+ */
+ public void addCategory(ITestDataCategoryPO toAdd);
+
+ /**
+ *
+ * @param toRemove The category to remove from the receiver. Must not be
+ * <code>null</code>.
+ */
+ public void removeCategory(ITestDataCategoryPO toRemove);
+
+ /**
+ *
+ * @param toAdd The Central Test Data to add to the receiver. Must not be
+ * <code>null</code>.
+ */
+ public void addTestData(ITestDataCubePO toAdd);
+
+ /**
+ *
+ * @param toRemove The Central Test Data to remove from the receiver.
+ * Must not be <code>null</code>.
+ */
+ public void removeTestData(ITestDataCubePO toRemove);
+
+ /**
+ *
+ * @return the receiver's parent category, or <code>null</code> if the
+ * receiver is a top-level element (i.e. has no parent category).
+ */
+ public ITestDataCategoryPO getParent();
+
+ /**
+ *
+ * @param parent The receiver's new parent. A value of <code>null</code>
+ * indicates that the receiver is a top-level element (i.e.
+ * has no parent category).
+ */
+ public void setParent(ITestDataCategoryPO parent);
+
+ /**
+ *
+ * @param name The receiver's new name. Must not be <code>null</code>.
+ */
+ public void setName(String name);
+}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubeContPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubeContPO.java
deleted file mode 100644
index cee621f46..000000000
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubeContPO.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.core.model;
-
-import java.util.List;
-
-/**
- * @author BREDEX GmbH
- * @created Jun 28, 2010
- *
- */
-public interface ITestDataCubeContPO extends IPersistentObject {
-
- /**
- * @return an unmodifiable list of test data cubes
- */
- public abstract List<IParameterInterfacePO> getTestDataCubeList();
-
- /**
- * @param tdc
- * test data cube to add
- */
- public abstract void addTestDataCube(IParameterInterfacePO tdc);
-
- /**
- * @param tdc
- * test data cube to remove
- */
- public abstract void removeTestDataCube(IParameterInterfacePO tdc);
-
-} \ No newline at end of file
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java
index 45bb3e620..72c4340c9 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java
@@ -19,4 +19,16 @@ public interface ITestDataCubePO extends IModifiableParameterInterfacePO {
* @param name The new name.
*/
public void setName(String name);
+
+ /**
+ *
+ * @return the receiver's parent category.
+ */
+ public ITestDataCategoryPO getParent();
+
+ /**
+ *
+ * @param parent The receiver's new parent.
+ */
+ public void setParent(ITestDataCategoryPO parent);
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java
index e88a77075..7c75ee189 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java
@@ -431,8 +431,8 @@ public abstract class PoMaker {
* factory method to replace constructor
* @return TestDataCubeContPO
*/
- public static ITestDataCubeContPO createTestDataCubeContPO() {
- return new TestDataCubeContPO();
+ public static ITestDataCategoryPO createTestDataCategoryPO() {
+ return new TestDataCategoryPO();
}
/**
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java
index 162ec29d3..1cba31232 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java
@@ -94,7 +94,7 @@ class ProjectPO extends ParamNodePO implements IProjectPO {
/**
* <code>m_testdatacubecont</code> object to manage all test data cubes
*/
- private TestDataCubeContPO m_testdatacubecont;
+ private ITestDataCategoryPO m_testdatacubecont;
/**
* only for Persistence (JPA / EclipseLink)
@@ -142,7 +142,7 @@ class ProjectPO extends ParamNodePO implements IProjectPO {
PoMaker.createProjectPropertiesPO(
majorNumber, minorNumber));
setAutCont(PoMaker.createAUTContPO());
- setTestDataCubeContPO(PoMaker.createTestDataCubeContPO());
+ setTestDataCubeContPO(PoMaker.createTestDataCategoryPO());
setExecObjCont(PoMaker.createExecObjContPO());
setSpecObjCont(PoMaker.createSpecObjContPO());
setClientMetaDataVersion(metadataVersion);
@@ -299,9 +299,9 @@ class ProjectPO extends ParamNodePO implements IProjectPO {
*
* {@inheritDoc}
*/
- public void setTestDataCubeContPO(ITestDataCubeContPO tdcc) {
- setHbmTestDataCubeContPO((TestDataCubeContPO)tdcc);
- getHbmTestDataCubeContPO().setParentProjectId(getId());
+ public void setTestDataCubeContPO(ITestDataCategoryPO testDataCategory) {
+ setHbmTestDataCubeContPO(testDataCategory);
+ testDataCategory.setParentProjectId(getId());
}
/**
@@ -748,24 +748,27 @@ class ProjectPO extends ParamNodePO implements IProjectPO {
* {@inheritDoc}
*/
@Transient
- public ITestDataCubeContPO getTestDataCubeCont() {
+ public ITestDataCategoryPO getTestDataCubeCont() {
return getHbmTestDataCubeContPO();
}
/**
- * @param tdcc The testdata cube container to set.
+ *
+ * @param testDataCategory The receiver's new top-level Test Data Category.
*/
- private void setHbmTestDataCubeContPO(TestDataCubeContPO tdcc) {
- m_testdatacubecont = tdcc;
+ private void setHbmTestDataCubeContPO(
+ ITestDataCategoryPO testDataCategory) {
+ m_testdatacubecont = testDataCategory;
}
/**
*
* @return Returns the test data cube container.
*/
- @OneToOne(cascade = CascadeType.ALL)
+ @OneToOne(cascade = CascadeType.ALL,
+ targetEntity = TestDataCategoryPO.class)
@JoinColumn(name = "TDC_CONT", unique = true)
- private TestDataCubeContPO getHbmTestDataCubeContPO() {
+ private ITestDataCategoryPO getHbmTestDataCubeContPO() {
return m_testdatacubecont;
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCategoryPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCategoryPO.java
new file mode 100644
index 000000000..d5c879f75
--- /dev/null
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCategoryPO.java
@@ -0,0 +1,284 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2011 BREDEX GmbH.
+ * 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:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderColumn;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+import org.eclipse.jubula.tools.exception.Assert;
+import org.eclipse.persistence.annotations.Index;
+
+/**
+ * @author BREDEX GmbH
+ * @created Nov 01, 2011
+ */
+@Entity
+@Table(name = "TEST_DATA_CAT")
+class TestDataCategoryPO implements ITestDataCategoryPO {
+
+ /** Persistence (JPA / EclipseLink) OID */
+ private transient Long m_id = null;
+
+ /** Persistence (JPA / EclipseLink) version id */
+ private transient Integer m_version = null;
+
+ /** The ID of the parent project */
+ private Long m_parentProjectId = null;
+
+ /** the name of the category */
+ private String m_name = null;
+
+ /** all Central Test Data children of this element */
+ private List<ITestDataCubePO> m_testDataChildList =
+ new ArrayList<ITestDataCubePO>();
+
+ /** all Test Data Category children of this element */
+ private List<ITestDataCategoryPO> m_categoryChildList =
+ new ArrayList<ITestDataCategoryPO>();
+
+ /** the parent category */
+ private ITestDataCategoryPO m_parent = null;
+
+ /**
+ * JPA accessor for Central Test Data children.
+ *
+ * @return the Central Test Data children.
+ */
+ @OneToMany(cascade = CascadeType.ALL,
+ fetch = FetchType.EAGER,
+ targetEntity = TestDataCubePO.class,
+ orphanRemoval = true)
+ @OrderColumn(name = "IDX")
+ List<ITestDataCubePO> getHbmTestDataChildList() {
+ return m_testDataChildList;
+ }
+
+ /**
+ * JPA mutator for Central Test Data children.
+ *
+ * @param testDataChildList The Central Test Data children.
+ */
+ void setHbmTestDataChildList(List<ITestDataCubePO> testDataChildList) {
+ m_testDataChildList = testDataChildList;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Transient
+ public List<ITestDataCubePO> getTestDataChildren() {
+ return Collections.unmodifiableList(getHbmTestDataChildList());
+ }
+
+ /**
+ * JPA accessor for Test Data Category children.
+ *
+ * @return the Test Data Category children.
+ */
+ @OneToMany(cascade = CascadeType.ALL,
+ fetch = FetchType.EAGER,
+ targetEntity = TestDataCategoryPO.class,
+ orphanRemoval = true)
+ @OrderColumn(name = "IDX")
+ List<ITestDataCategoryPO> getHbmCategoryChildList() {
+ return m_categoryChildList;
+ }
+
+ /**
+ * JPA mutator for Central Test Data children.
+ *
+ * @param categoryChildList The Test Data Category children.
+ */
+ void setHbmCategoryChildList(List<ITestDataCategoryPO> categoryChildList) {
+ m_categoryChildList = categoryChildList;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Transient
+ public List<ITestDataCategoryPO> getCategoryChildren() {
+ return Collections.unmodifiableList(getHbmCategoryChildList());
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Id
+ @GeneratedValue
+ public Long getId() {
+ return m_id;
+ }
+ /**
+ * @param id The id to set.
+ */
+ @SuppressWarnings("unused")
+ private void setId(Long id) {
+ m_id = id;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Version
+ @Column(name = "VERSION")
+ public Integer getVersion() {
+ return m_version;
+ }
+ /**
+ * @param version The version to set.
+ */
+ @SuppressWarnings("unused")
+ private void setVersion(Integer version) {
+ m_version = version;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Transient
+ public Long getParentProjectId() {
+ return getHbmParentProjectId();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void setParentProjectId(Long projectId) {
+ setHbmParentProjectId(projectId);
+ for (ITestDataCategoryPO category : getCategoryChildren()) {
+ category.setParentProjectId(projectId);
+ }
+ for (ITestDataCubePO testData : getTestDataChildren()) {
+ testData.setParentProjectId(projectId);
+ }
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void addCategory(ITestDataCategoryPO toAdd) {
+ Assert.verify(toAdd != null);
+ toAdd.setParent(this);
+ getHbmCategoryChildList().add(toAdd);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void removeCategory(ITestDataCategoryPO toRemove) {
+ Assert.verify(toRemove != null);
+ toRemove.setParent(null);
+ getHbmCategoryChildList().remove(toRemove);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void addTestData(ITestDataCubePO toAdd) {
+ Assert.verify(toAdd != null);
+ toAdd.setParent(this);
+ getHbmTestDataChildList().add(toAdd);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void removeTestData(ITestDataCubePO toRemove) {
+ Assert.verify(toRemove != null);
+ toRemove.setParent(null);
+ getHbmTestDataChildList().remove(toRemove);
+ }
+
+ /**
+ * JPA accessor for parent Project ID.
+ *
+ * @return the ID of the Project to which the receiver belongs.
+ */
+ @Basic
+ @Column(name = "PARENT_PROJ")
+ @Index(name = "PI_DATA_CAT_PARENT_PROJ")
+ Long getHbmParentProjectId() {
+ return m_parentProjectId;
+ }
+
+ /**
+ * JPA mutator for parent Project ID.
+ *
+ * @param projectId the ID of the Project to which the receiver belongs.
+ */
+ void setHbmParentProjectId(Long projectId) {
+ m_parentProjectId = projectId;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Basic
+ @Column(name = "NAME", length = 4000)
+ public String getName() {
+ return m_name;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void setName(String name) {
+ m_name = name;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @ManyToOne(targetEntity = TestDataCategoryPO.class)
+ @JoinColumn(name = "FK_PARENT", insertable = false,
+ updatable = false)
+ public ITestDataCategoryPO getParent() {
+ return m_parent;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void setParent(ITestDataCategoryPO parent) {
+ m_parent = parent;
+ }
+}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubeContPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubeContPO.java
deleted file mode 100644
index 9ab622815..000000000
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubeContPO.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.core.model;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderColumn;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import org.eclipse.jubula.client.core.i18n.Messages;
-
-
-/**
- * @author BREDEX GmbH
- * @created Jun 28, 2010
- */
-@Entity
-@Table(name = "CUBE_CONT")
-public class TestDataCubeContPO extends WrapperPO implements
- ITestDataCubeContPO {
- /**
- * <code>m_testDataCubes</code>
- */
- private List<IParameterInterfacePO> m_testDataCubes =
- new ArrayList<IParameterInterfacePO>();
-
- /** default constructor */
- TestDataCubeContPO() {
- // nothing
- }
-
- /**
- *
- * @return Returns the topLevelNodeList.
- */
- @OneToMany(cascade = CascadeType.ALL,
- fetch = FetchType.EAGER,
- targetEntity = TestDataCubePO.class,
- orphanRemoval = true)
- @OrderColumn(name = "IDX")
- List<IParameterInterfacePO> getHbmTestDataCubeList() {
- return m_testDataCubes;
- }
-
- /**
- * @return an unmodifiable list of test data cubes
- */
- @Transient
- public List<IParameterInterfacePO> getTestDataCubeList() {
- return Collections.unmodifiableList(getHbmTestDataCubeList());
- }
-
- /**
- * @param tdcl
- * test data cube list The test data cube list to set.
- */
- void setHbmTestDataCubeList(List<IParameterInterfacePO> tdcl) {
- m_testDataCubes = tdcl;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Transient
- public String getName() {
- return Messages.CentralTestDataEditorName;
- }
-
- /**
- * {@inheritDoc}
- */
- public void addTestDataCube(IParameterInterfacePO tdc) {
- getHbmTestDataCubeList().add(tdc);
- tdc.setParentProjectId(getParentProjectId());
- }
-
- /**
- * {@inheritDoc}
- */
- public void removeTestDataCube(IParameterInterfacePO tdc) {
- getHbmTestDataCubeList().remove(tdc);
- }
-
- /**
- * {@inheritDoc}
- */
- @Transient
- // FIXME zeb If we don't explicitly declare this method and mark it as
- // @Transient, then EclipseLink assumes (due to the inheritance
- // of the method from the superclass) that the property
- // "parentProjectId" should be persisted. This causes an
- // exception when trying to access an instance of this class
- // from the database. Oddly enough, the exceptions do not occur
- // when running Jubula from the IDE. The exceptions only occur
- // in a deployed Jubula. Once this problem is resolved (for a
- // deployed Jubula), the workaround can be removed.
- public Long getParentProjectId() {
- return super.getParentProjectId();
- }
-
- /**
- * {@inheritDoc}
- */
- public void setParentProjectId(Long projectId) {
- super.setParentProjectId(projectId);
- for (IParameterInterfacePO tdc : getHbmTestDataCubeList()) {
- tdc.setParentProjectId(projectId);
- }
- }
-}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java
index 7171a47fe..49ff9dfd0 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java
@@ -38,6 +38,7 @@ import org.apache.commons.lang.Validate;
import org.eclipse.jubula.client.core.businessprocess.IParamNameMapper;
import org.eclipse.jubula.client.core.i18n.Messages;
import org.eclipse.jubula.client.core.persistence.PersistenceUtil;
+import org.eclipse.persistence.annotations.Index;
/**
@@ -54,9 +55,15 @@ class TestDataCubePO implements ITestDataCubePO {
/** Persistence (JPA / EclipseLink) version id */
private transient Integer m_version = null;
+ /** The ID of the parent project */
+ private Long m_parentProjectId = null;
+
/** the name by which the cube can be referenced */
private String m_name = null;
+ /** parent category */
+ private ITestDataCategoryPO m_parent = null;
+
/**
* <code>m_parameters</code>parameters for testcase
*/
@@ -286,6 +293,7 @@ class TestDataCubePO implements ITestDataCubePO {
* {@inheritDoc}
*/
public void setParentProjectId(Long projectId) {
+ setHbmParentProjectId(projectId);
for (IParamDescriptionPO paramDesc : getHbmParameterList()) {
paramDesc.setParentProjectId(projectId);
}
@@ -444,8 +452,29 @@ class TestDataCubePO implements ITestDataCubePO {
* {@inheritDoc}
*/
@Transient
- public Long getParentProjectId() throws UnsupportedOperationException {
- return null;
+ public Long getParentProjectId() {
+ return getHbmParentProjectId();
+ }
+
+ /**
+ * JPA accessor for ID of parent Project.
+ *
+ * @return the parent Project ID.
+ */
+ @Basic
+ @Column(name = "PARENT_PROJ")
+ @Index(name = "PI_TDC_PARENT_PROJ")
+ Long getHbmParentProjectId() {
+ return m_parentProjectId;
+ }
+
+ /**
+ * JPA mutator for ID of parent Project.
+ *
+ * @param projectId The parent Project ID.
+ */
+ void setHbmParentProjectId(Long projectId) {
+ m_parentProjectId = projectId;
}
/**
@@ -520,4 +549,23 @@ class TestDataCubePO implements ITestDataCubePO {
.removeParamNamePO(desc.getUniqueId());
}
}
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @ManyToOne(targetEntity = TestDataCategoryPO.class)
+ @JoinColumn(name = "FK_PARENT", insertable = false,
+ updatable = false)
+ public ITestDataCategoryPO getParent() {
+ return m_parent;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void setParent(ITestDataCategoryPO parent) {
+ m_parent = parent;
+ }
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
index f62aba738..e7393245b 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
@@ -38,7 +38,7 @@ import org.eclipse.jubula.client.core.model.IPersistentObject;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
import org.eclipse.jubula.client.core.model.ITcParamDescriptionPO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.tools.constants.StringConstants;
import org.eclipse.jubula.tools.exception.Assert;
import org.eclipse.jubula.tools.exception.JBFatalAbortException;
@@ -205,10 +205,10 @@ public class EditSupport {
((ITcParamDescriptionPO)desc)
.setParamNameMapper(m_paramMapper);
}
- } else if (m_workVersion instanceof ITestDataCubeContPO) {
+ } else if (m_workVersion instanceof ITestDataCategoryPO) {
for (IParameterInterfacePO pio
- : ((ITestDataCubeContPO)m_workVersion)
- .getTestDataCubeList()) {
+ : ((ITestDataCategoryPO)m_workVersion)
+ .getTestDataChildren()) {
List<IParamDescriptionPO> params = pio.getParameterList();
for (IParamDescriptionPO desc : params) {
((ITcParamDescriptionPO)desc)
@@ -259,7 +259,7 @@ public class EditSupport {
try {
boolean mayModifyParamNames =
m_workVersion instanceof ISpecTestCasePO
- || m_workVersion instanceof ITestDataCubeContPO;
+ || m_workVersion instanceof ITestDataCategoryPO;
if (mayModifyParamNames) {
saveParamNames();
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
index 4237f4ed6..36cfbfcec 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
@@ -603,7 +603,6 @@ public class ProjectPM extends PersistenceManager {
List nodes = preloadDataPerClass(s, projectIds, "NodePO");
preloadDataPerClass(s, projectIds, "SpecObjContPO");
preloadDataPerClass(s, projectIds, "ExecObjContPO");
- preloadDataPerClass(s, projectIds, "TestDataCubeContPO");
preloadDataPerClass(s, projectIds, "ObjectMappingAssoziationPO");
preloadDataPerClass(s, projectIds, "ParamDescriptionPO");
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contentassist/TestDataCubeRefContentProposalProvider.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contentassist/TestDataCubeRefContentProposalProvider.java
index 5d8289cc7..474fbebc5 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contentassist/TestDataCubeRefContentProposalProvider.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contentassist/TestDataCubeRefContentProposalProvider.java
@@ -142,7 +142,7 @@ public class TestDataCubeRefContentProposalProvider implements
List<TestDataCubeRefContentProposal> proposalList =
new ArrayList<TestDataCubeRefContentProposal>();
for (IParameterInterfacePO dataCube
- : m_project.getTestDataCubeCont().getTestDataCubeList()) {
+ : m_project.getTestDataCubeCont().getTestDataChildren()) {
if (dataCubeFulfillsNameRequirements(
dataCube, contents.substring(0, position))
&& dataCubeFulfillsParameterRequirements(
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java
index 164f2dc12..1c4fe3800 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java
@@ -54,7 +54,7 @@ import org.eclipse.jubula.client.core.model.IPersistentObject;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
import org.eclipse.jubula.client.core.model.ITDManager;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.model.ITestDataPO;
import org.eclipse.jubula.client.core.model.ITestSuitePO;
import org.eclipse.jubula.client.core.model.ITimestampPO;
@@ -186,7 +186,7 @@ public abstract class AbstractTestCaseEditor extends AbstractJBEditor {
public void handleDataChanged(IPersistentObject po,
DataState dataState, UpdateState updateState) {
- if (po instanceof ITestDataCubeContPO
+ if (po instanceof ITestDataCategoryPO
&& dataState == DataState.StructureModified
&& updateState != UpdateState.notInEditor) {
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/CentralTestDataEditor.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/CentralTestDataEditor.java
index dabb074b8..303fc10ae 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/CentralTestDataEditor.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/CentralTestDataEditor.java
@@ -17,6 +17,7 @@ import java.util.Set;
import javax.persistence.EntityManager;
+import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
@@ -34,7 +35,7 @@ import org.eclipse.jubula.client.core.events.DataEventDispatcher.IParamChangedLi
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.INodePO;
import org.eclipse.jubula.client.core.model.IPersistentObject;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.model.ITestDataCubePO;
import org.eclipse.jubula.client.core.persistence.EditSupport;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
@@ -178,7 +179,7 @@ public class CentralTestDataEditor extends AbstractJBEditor implements
/** {@inheritDoc} */
protected void setInitialInput() {
- ITestDataCubeContPO rootPOTop = (ITestDataCubeContPO)getEditorHelper()
+ ITestDataCategoryPO rootPOTop = (ITestDataCategoryPO)getEditorHelper()
.getEditSupport().getWorkVersion();
try {
getTreeViewer().getTree().getParent().setRedraw(false);
@@ -340,4 +341,8 @@ public class CentralTestDataEditor extends AbstractJBEditor implements
return m_elementsToRefresh;
}
+ @Override
+ public String getTitleToolTip() {
+ return StringUtils.EMPTY;
+ }
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/PersistableEditorInput.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/PersistableEditorInput.java
index f82e72f57..7d1ab1860 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/PersistableEditorInput.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/PersistableEditorInput.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.jubula.client.ui.rcp.editors;
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jubula.client.core.businessprocess.ParamNameBP;
@@ -65,7 +66,7 @@ public class PersistableEditorInput implements IEditorInput {
* @return
*/
public String getName() {
- return m_node.getName();
+ return StringUtils.defaultString(m_node.getName());
}
/**
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/AddNewTestDataManagerHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/AddNewTestDataManagerHandler.java
index 933a0365b..e80fe3ce3 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/AddNewTestDataManagerHandler.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/AddNewTestDataManagerHandler.java
@@ -20,7 +20,8 @@ import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.DataState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IParameterInterfacePO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
+import org.eclipse.jubula.client.core.model.ITestDataCubePO;
import org.eclipse.jubula.client.core.model.PoMaker;
import org.eclipse.jubula.client.core.persistence.EditSupport;
import org.eclipse.jubula.client.ui.constants.ContextHelpIds;
@@ -67,10 +68,10 @@ public class AddNewTestDataManagerHandler extends AbstractHandler {
*/
public static Set<String> getSetOfUsedNames(
CentralTestDataEditor ctdEditor) {
- ITestDataCubeContPO po = (ITestDataCubeContPO)ctdEditor
+ ITestDataCategoryPO po = (ITestDataCategoryPO)ctdEditor
.getEditorHelper().getEditSupport().getWorkVersion();
Set<String> usedNames = new HashSet<String>();
- for (IParameterInterfacePO cube : po.getTestDataCubeList()) {
+ for (IParameterInterfacePO cube : po.getTestDataChildren()) {
usedNames.add(cube.getName());
}
return usedNames;
@@ -107,9 +108,9 @@ public class AddNewTestDataManagerHandler extends AbstractHandler {
private void performOperation(CentralTestDataEditor ctdEditor,
String newName) {
EditSupport es = ctdEditor.getEditorHelper().getEditSupport();
- ITestDataCubeContPO cont = (ITestDataCubeContPO)es.getWorkVersion();
- IParameterInterfacePO testdata = PoMaker.createTestDataCubePO(newName);
- cont.addTestDataCube(testdata);
+ ITestDataCategoryPO cont = (ITestDataCategoryPO)es.getWorkVersion();
+ ITestDataCubePO testdata = PoMaker.createTestDataCubePO(newName);
+ cont.addTestData(testdata);
ctdEditor.getEditorHelper().setDirty(true);
DataEventDispatcher.getInstance().fireDataChangedListener(cont,
DataState.StructureModified, UpdateState.onlyInEditor);
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTestDataManagerHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTestDataManagerHandler.java
index 2720ef2ef..0f67a9466 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTestDataManagerHandler.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTestDataManagerHandler.java
@@ -22,7 +22,8 @@ import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.DataState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IParameterInterfacePO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
+import org.eclipse.jubula.client.core.model.ITestDataCubePO;
import org.eclipse.jubula.client.ui.rcp.editors.CentralTestDataEditor;
import org.eclipse.jubula.client.ui.rcp.editors.JBEditorHelper.EditableState;
import org.eclipse.jubula.client.ui.utils.ErrorHandlingUtil;
@@ -80,7 +81,7 @@ public class DeleteTestDataManagerHandler
@SuppressWarnings("nls")
private void deleteSelection(CentralTestDataEditor editor,
IStructuredSelection structuredSelection) {
- ITestDataCubeContPO cont = (ITestDataCubeContPO)editor
+ ITestDataCategoryPO cont = (ITestDataCategoryPO)editor
.getEditorHelper().getEditSupport().getWorkVersion();
List<String> reusedCubeList = new ArrayList<String>(0);
@@ -105,10 +106,10 @@ public class DeleteTestDataManagerHandler
ErrorHandlingUtil.createMessageDialog(MessageIDs.I_REUSED_TDC,
new Object[] { sb.toString() }, null);
} else {
- for (Iterator<IParameterInterfacePO> it = structuredSelection
+ for (Iterator<ITestDataCubePO> it = structuredSelection
.iterator(); it.hasNext();) {
- IParameterInterfacePO td = it.next();
- cont.removeTestDataCube(td);
+ ITestDataCubePO td = it.next();
+ cont.removeTestData(td);
DataEventDispatcher.getInstance().fireDataChangedListener(td,
DataState.Deleted, UpdateState.onlyInEditor);
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/AbstractOpenHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/AbstractOpenHandler.java
index c47dc5e60..9608b5236 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/AbstractOpenHandler.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/AbstractOpenHandler.java
@@ -20,7 +20,7 @@ import org.eclipse.jubula.client.core.model.IAUTMainPO;
import org.eclipse.jubula.client.core.model.INodePO;
import org.eclipse.jubula.client.core.model.IPersistentObject;
import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.model.ITestJobPO;
import org.eclipse.jubula.client.core.model.ITestSuitePO;
import org.eclipse.jubula.client.core.persistence.PMException;
@@ -158,7 +158,7 @@ public abstract class AbstractOpenHandler extends AbstractHandler {
if (node instanceof ITestJobPO) {
return Constants.TEST_JOB_EDITOR_ID;
}
- if (node instanceof ITestDataCubeContPO) {
+ if (node instanceof ITestDataCategoryPO) {
return Constants.CENTRAL_TESTDATA_EDITOR_ID;
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenCentralTestDataEditorHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenCentralTestDataEditorHandler.java
index 22b2d16c6..a6fb9d1c9 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenCentralTestDataEditorHandler.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/open/OpenCentralTestDataEditorHandler.java
@@ -13,7 +13,7 @@ package org.eclipse.jubula.client.ui.rcp.handlers.open;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.jubula.client.core.model.INodePO;
import org.eclipse.jubula.client.core.model.IProjectPO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
import org.eclipse.ui.IEditorPart;
@@ -36,7 +36,7 @@ public class OpenCentralTestDataEditorHandler extends AbstractOpenHandler {
public Object execute(ExecutionEvent event) {
IProjectPO project = GeneralStorage.getInstance().getProject();
if (project != null) {
- ITestDataCubeContPO centralTestData = project.getTestDataCubeCont();
+ ITestDataCategoryPO centralTestData = project.getTestDataCubeCont();
if (centralTestData != null) {
IEditorPart editor = openEditor(centralTestData);
if (editor != null) {
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/AbstractTreeViewContentProvider.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/AbstractTreeViewContentProvider.java
index 192b6f879..1e426953d 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/AbstractTreeViewContentProvider.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/AbstractTreeViewContentProvider.java
@@ -15,7 +15,7 @@ import org.eclipse.jubula.client.core.model.INodePO;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.IReusedProjectPO;
import org.eclipse.jubula.client.core.model.ISpecObjContPO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.model.ITestDataCubePO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
import org.eclipse.jubula.client.ui.rcp.i18n.Messages;
@@ -67,10 +67,14 @@ public abstract class AbstractTreeViewContentProvider extends
|| element instanceof ISpecObjContPO
|| element instanceof IExecObjContPO) {
return GeneralStorage.getInstance().getProject();
- }
- if (element instanceof ITestDataCubeContPO
- || element instanceof ITestDataCubePO
- || element instanceof SearchResultElement) {
+ }
+ if (element instanceof ITestDataCategoryPO) {
+ return ((ITestDataCategoryPO)element).getParent();
+ }
+ if (element instanceof ITestDataCubePO) {
+ return ((ITestDataCubePO)element).getParent();
+ }
+ if (element instanceof SearchResultElement) {
return null;
}
Assert.notReached(Messages.WrongTypeOfElement
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/CentralTestDataContentProvider.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/CentralTestDataContentProvider.java
index 17eba5d0a..f49297d83 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/CentralTestDataContentProvider.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/contentprovider/CentralTestDataContentProvider.java
@@ -10,8 +10,11 @@
*******************************************************************************/
package org.eclipse.jubula.client.ui.rcp.provider.contentprovider;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.commons.lang.ArrayUtils;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
/**
@@ -25,10 +28,14 @@ public class CentralTestDataContentProvider extends
* {@inheritDoc}
*/
public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof ITestDataCubeContPO) {
- return ((ITestDataCubeContPO)parentElement).getTestDataCubeList()
- .toArray();
+ if (parentElement instanceof ITestDataCategoryPO) {
+ ITestDataCategoryPO category = (ITestDataCategoryPO)parentElement;
+ List<Object> childList = new ArrayList<Object>();
+ childList.addAll(category.getCategoryChildren());
+ childList.addAll(category.getTestDataChildren());
+ return childList.toArray();
}
+
return ArrayUtils.EMPTY_OBJECT_ARRAY;
}
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/query/TestDataSearchQuery.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/query/TestDataSearchQuery.java
index 4492729d0..330ff740f 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/query/TestDataSearchQuery.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/query/TestDataSearchQuery.java
@@ -82,7 +82,7 @@ public class TestDataSearchQuery extends AbstractSearchQuery {
} else if (ITestDataCubePO.class.isAssignableFrom(searchType)) {
IProjectPO cProject = GeneralStorage.getInstance().getProject();
centralTestData.addAll(cProject.getTestDataCubeCont()
- .getTestDataCubeList());
+ .getTestDataChildren());
}
monitor.worked(1);
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/result/BasicSearchResult.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/result/BasicSearchResult.java
index 954f49cf6..25145e584 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/result/BasicSearchResult.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/search/result/BasicSearchResult.java
@@ -25,10 +25,9 @@ import org.eclipse.jubula.client.core.model.IEventExecTestCasePO;
import org.eclipse.jubula.client.core.model.IExecTestCasePO;
import org.eclipse.jubula.client.core.model.INodePO;
import org.eclipse.jubula.client.core.model.IObjectMappingAssoziationPO;
-import org.eclipse.jubula.client.core.model.IParameterInterfacePO;
import org.eclipse.jubula.client.core.model.IRefTestSuitePO;
import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.model.ITestDataCubePO;
import org.eclipse.jubula.client.core.model.ITestJobPO;
import org.eclipse.jubula.client.core.model.ITestSuitePO;
@@ -379,10 +378,10 @@ public class BasicSearchResult implements ISearchResult {
* {@inheritDoc}
*/
public void jumpTo(Long id) {
- ITestDataCubeContPO tdcContainer = GeneralStorage.getInstance()
+ ITestDataCategoryPO tdcContainer = GeneralStorage.getInstance()
.getProject().getTestDataCubeCont();
- for (IParameterInterfacePO testdatacube : tdcContainer
- .getTestDataCubeList()) {
+ for (ITestDataCubePO testdatacube : tdcContainer
+ .getTestDataChildren()) {
if (id.equals(testdatacube.getId())) {
IEditorPart editor = AbstractOpenHandler
.openEditor(tdcContainer);
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/validator/TestDataCubeReferenceValidator.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/validator/TestDataCubeReferenceValidator.java
index c5e124750..8fba09880 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/validator/TestDataCubeReferenceValidator.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/validator/TestDataCubeReferenceValidator.java
@@ -56,7 +56,7 @@ public class TestDataCubeReferenceValidator implements IValidator {
String newValue = workValue.toString();
boolean mightMatch = false;
for (IParameterInterfacePO dataCube
- : m_project.getTestDataCubeCont().getTestDataCubeList()) {
+ : m_project.getTestDataCubeCont().getTestDataChildren()) {
if (StringUtils.equals(e.text, dataCube.getName())) {
return ValidationState.OK;
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java
index 89f9c4ea3..80849c0a2 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java
@@ -40,7 +40,7 @@ import org.eclipse.jubula.client.core.model.IParamDescriptionPO;
import org.eclipse.jubula.client.core.model.IParameterInterfacePO;
import org.eclipse.jubula.client.core.model.IPersistentObject;
import org.eclipse.jubula.client.core.model.ITDManager;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
import org.eclipse.jubula.client.core.persistence.PMException;
import org.eclipse.jubula.client.core.utils.GuiParamValueConverter;
@@ -1382,7 +1382,7 @@ public abstract class AbstractDataSetPage extends Page
}
if (dataState == DataState.StructureModified
- && po instanceof ITestDataCubeContPO) {
+ && po instanceof ITestDataCategoryPO) {
updateView();
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ImportXLSTestdataWizardPage.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ImportXLSTestdataWizardPage.java
index b42e82021..ab98956d6 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ImportXLSTestdataWizardPage.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ImportXLSTestdataWizardPage.java
@@ -39,7 +39,7 @@ import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.DataState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IPersistentObject;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.model.ITestDataCubePO;
import org.eclipse.jubula.client.core.model.PoMaker;
import org.eclipse.jubula.client.core.persistence.EditSupport;
@@ -145,8 +145,8 @@ public class ImportXLSTestdataWizardPage extends WizardResourceImportPage {
try {
EditSupport es = m_ctde.getEditorHelper()
.getEditSupport();
- ITestDataCubeContPO cont = (ITestDataCubeContPO)es
- .getWorkVersion();
+ ITestDataCategoryPO cont =
+ (ITestDataCategoryPO)es.getWorkVersion();
Set<String> usedNames = AddNewTestDataManagerHandler
.getSetOfUsedNames(m_ctde);
if (merge) {
@@ -180,7 +180,7 @@ public class ImportXLSTestdataWizardPage extends WizardResourceImportPage {
ITestDataCubePO testdata = PoMaker
.createTestDataCubePO(name);
fillCentralTestDataSet(f, ll, testdata);
- cont.addTestDataCube(testdata);
+ cont.addTestData(testdata);
p.writeLine(NLS.bind(Messages
.ImportXLSTestDataWizardSuccessfullImport,
new Object[] { absoluteFilePath }));
diff --git a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/jarutils/IVersion.java b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/jarutils/IVersion.java
index 5f8689793..882f8dd2c 100644
--- a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/jarutils/IVersion.java
+++ b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/jarutils/IVersion.java
@@ -24,7 +24,7 @@ public interface IVersion {
public final Integer JB_PROTOCOL_MAJOR_VERSION = new Integer(11);
/** major version for DB */
- public final Integer JB_DB_MAJOR_VERSION = new Integer(37);
+ public final Integer JB_DB_MAJOR_VERSION = new Integer(38);
/** minor version for DB */
public final Integer JB_DB_MINOR_VERSION = new Integer(0);

Back to the top