Merge branch 'mkoller/atfxadapter' into dev

Change-Id: Ibd25785778afbf8a5a4e3b652a0754c1d88541b7
diff --git a/build.gradle b/build.gradle
index 462505e..ef239a0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -14,7 +14,7 @@
 
 description = 'MDM API - Default Model'
 group = 'org.eclipse.mdm'
-version = '5.1.0M8-ATFX-SNAPSHOT'
+version = '5.1.0M8-SNAPSHOT'
 
 apply plugin: 'java'
 apply plugin: 'maven'
diff --git a/src/main/java/org/eclipse/mdm/api/dflt/EntityManager.java b/src/main/java/org/eclipse/mdm/api/dflt/EntityManager.java
index 00f6ac0..2a6b7b0 100644
--- a/src/main/java/org/eclipse/mdm/api/dflt/EntityManager.java
+++ b/src/main/java/org/eclipse/mdm/api/dflt/EntityManager.java
@@ -148,10 +148,10 @@
 	}
 
 	<T extends StatusAttachable> List<T> loadAll(Class<T> entityClass, Status status, String pattern);
-	
 
 	/**
 	 * Loads the refereced {@link TemplateTest} for a {@link Test}.
+	 * 
 	 * @param test {@link Test} referencing the desired template
 	 * @return {@link Optional} with the loaded {@link TemplateTest}
 	 */
@@ -159,6 +159,7 @@
 
 	/**
 	 * Loads the referenced {@link TemplateTestStep} for a {@link TestStep}
+	 * 
 	 * @param testStep {@link TestStep} referencing the desired template
 	 * @return {@link Optional} with the loaded {@link TemplateTestStep}
 	 */
diff --git a/src/main/java/org/eclipse/mdm/api/dflt/model/EntityFactory.java b/src/main/java/org/eclipse/mdm/api/dflt/model/EntityFactory.java
index c199fca..ef133b4 100644
--- a/src/main/java/org/eclipse/mdm/api/dflt/model/EntityFactory.java
+++ b/src/main/java/org/eclipse/mdm/api/dflt/model/EntityFactory.java
@@ -798,12 +798,31 @@
 		return valueListValue;
 	}
 
+	/**
+	 * Creates a new {@link Classification} for given {@link Domain},
+	 * {@link ProjectDomain} and {@link Status}.
+	 * 
+	 * @param domain        The {@link Domain} for the {@link Classification}
+	 * @param projectDomain The {@link ProjectDomain} for the {@link Classification}
+	 * @param status        The {@link Status} for the {@link Classification}
+	 * @return The created {@link Classification} is returned.
+	 */
 	public Classification createClassification(Domain domain, ProjectDomain projectDomain, Status status) {
 		String name = String.format("ProjDomainId_%s.DomainId_%s.StatusId_%s", projectDomain.getID(), domain.getID(),
 				status.getID());
 		return createClassification(name, status, projectDomain, domain);
 	}
 
+	/**
+	 * Creates a new {@link Classification} for given {@link Domain},
+	 * {@link ProjectDomain} and {@link Status}.
+	 * 
+	 * @param name          The name for the {@link Classification}
+	 * @param status        The {@link Status} for the {@link Classification}
+	 * @param projectDomain The {@link ProjectDomain} for the {@link Classification}
+	 * @param domain        The {@link Domain} for the {@link Classification}
+	 * @return The created {@link Classification} is returned.
+	 */
 	public Classification createClassification(String name, Status status, ProjectDomain projectDomain, Domain domain) {
 		Classification classification = new Classification(createCore(Classification.class));
 
@@ -817,6 +836,12 @@
 		return classification;
 	}
 
+	/**
+	 * Creates a new {@link ProjectDomain} with given name.
+	 * 
+	 * @param name Name of the {@link ProjectDomain}
+	 * @return The created {@link ProjectDomain} is returned.
+	 */
 	public ProjectDomain createProjectDomain(String name) {
 		ProjectDomain projectDomain = new ProjectDomain(createCore(ProjectDomain.class));
 		// properties
@@ -824,6 +849,12 @@
 		return projectDomain;
 	}
 
+	/**
+	 * Creates a new {@link Domain} with given name.
+	 * 
+	 * @param name Name of the {@link Domain}
+	 * @return The created {@link Domain} is returned.
+	 */
 	public Domain createDomain(String name) {
 		Domain domain = new Domain(createCore(Domain.class));
 
@@ -869,13 +900,18 @@
 	}
 
 	/**
+	 * Creates a new {@link Test} for given {@link Pool} using given name,
+	 * {@link TemplateTest} and {@link Classification}.
 	 * 
-	 * @param name
-	 * @param pool
-	 * @param templateTest
-	 * @param withTestSteps
-	 * @param status
-	 * @return
+	 * @param name           Name of the created {@code Test}.
+	 * @param pool           The parent {@code Pool}.
+	 * @param templateTest   The template the returned {@code Test} will be derived
+	 *                       from.
+	 * @param classification The {@link Classification} for the created
+	 *                       {@link Test}.
+	 * @param withTestSteps  If true, {@link TestStep}s are automatically created
+	 *                       based on configured {@link TemplateTestStepUsage}.
+	 * @return The created {@code Test} is returned.
 	 */
 	public Test createTest(String name, Pool pool, TemplateTest templateTest, Classification classification,
 			boolean withTestSteps) {
@@ -901,11 +937,15 @@
 	}
 
 	/**
+	 * Creates a new {@link TestStep} for given {@link Test} using given
+	 * {@link TemplateTestStep} and {@link Classification}.
 	 * 
-	 * @param test
-	 * @param templateTestStep
-	 * @param classification
-	 * @return
+	 * @param test             The parent {@code Test}.
+	 * @param templateTestStep The template the returned {@code TestStep} will be
+	 *                         derived from.
+	 * @param classification   The {@link Classification} for the created
+	 *                         {@link TestStep}.
+	 * @return The created {@code TestStep} is returned.
 	 */
 	public TestStep createTestStep(Test test, TemplateTestStep templateTestStep, Classification classification) {
 		TestStep testStep = createTestStep(test, templateTestStep);
@@ -914,11 +954,14 @@
 	}
 
 	/**
+	 * Creates a new {@link TestStep} for given {@link Test} using given
+	 * {@link TemplateTestStep} and {@link Classification}.
 	 * 
-	 * @param name
-	 * @param test
-	 * @param classification
-	 * @return
+	 * @param name           Name of the created {@code TestStep}.
+	 * @param test           The parent {@code Test}.
+	 * @param classification The {@link Classification} for the created
+	 *                       {@link TestStep}.
+	 * @return The created {@code TestStep} is returned.
 	 */
 	public TestStep createTestStep(String name, Test test, Classification classification) {
 		TestStep testStep = createTestStep(name, test);
@@ -927,12 +970,16 @@
 	}
 
 	/**
+	 * Creates a new {@link TestStep} for given {@link Test} using given name,
+	 * {@link TemplateTestStep} and {@link Classification}.
 	 * 
-	 * @param name
-	 * @param test
-	 * @param templateTestStep
-	 * @param classification
-	 * @return
+	 * @param name             Name of the created {@code TestStep}.
+	 * @param test             The parent {@code Test}.
+	 * @param templateTestStep The template the returned {@code TestStep} will be
+	 *                         derived from.
+	 * @param classification   The {@link Classification} for the created
+	 *                         {@link TestStep}.
+	 * @return The created {@code TestStep} is returned.
 	 */
 	public TestStep createTestStep(String name, Test test, TemplateTestStep templateTestStep,
 			Classification classification) {
diff --git a/src/main/java/org/eclipse/mdm/api/dflt/model/Status.java b/src/main/java/org/eclipse/mdm/api/dflt/model/Status.java
index cdd0c5b..041a156 100644
--- a/src/main/java/org/eclipse/mdm/api/dflt/model/Status.java
+++ b/src/main/java/org/eclipse/mdm/api/dflt/model/Status.java
@@ -23,6 +23,7 @@
 import org.eclipse.mdm.api.base.model.StatusAttachable;
 import org.eclipse.mdm.api.base.model.Test;
 import org.eclipse.mdm.api.base.model.TestStep;
+import org.eclipse.mdm.api.base.query.DataAccessException;
 
 /**
  * Implementation of the status entity type. A status may be attached to
@@ -70,8 +71,7 @@
 	public <T extends StatusAttachable> void assign(T statusAttachable) {
 		Classification classification = getCore(statusAttachable).getMutableStore().get(Classification.class);
 		if (classification == null) {
-			// TODO exceptionhandling or create classification
-			throw new RuntimeException("Mandatory element classification not found!");
+			throw new DataAccessException("Mandatory element classification not found!");
 		}
 
 		getCore(classification).getMutableStore().set(this);