Add Unit Test 89/39089/1
authorYuanHu <yuan.hu1@zte.com.cn>
Tue, 27 Mar 2018 13:18:46 +0000 (21:18 +0800)
committerYuanHu <yuan.hu1@zte.com.cn>
Tue, 27 Mar 2018 13:18:46 +0000 (21:18 +0800)
Add Unit Test

Issue-ID: SDC-1078

Change-Id: Ie61cfdc3865420da259260c98bc02dca8263c412
Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
28 files changed:
sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java
sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java
sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpecTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ParameterTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfoTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/DataObjectTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ElementTest.java
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ErrorEndEventTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ParameterTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/PositionTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ProcessTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/RestServiceTaskTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ScriptTaskTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/SequenceFlowTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ServiceTaskTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinitionTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryDataTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfoTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtendActivityTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/I18nStringTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/IconDataTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutputTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategoryTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfoTest.java [new file with mode: 0644]
sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponseTest.java [new file with mode: 0644]

index e850710..caa8857 100644 (file)
@@ -11,8 +11,6 @@
  */\r
 package org.onap.sdc.workflowdesigner;\r
 \r
-import javax.validation.constraints.NotNull;\r
-\r
 import org.hibernate.validator.constraints.NotEmpty;\r
 \r
 import com.fasterxml.jackson.annotation.JsonProperty;\r
index cce803b..8a1aaf1 100644 (file)
@@ -57,14 +57,14 @@ public class Parameter {
   /**\r
    * @return the defaultValue\r
    */\r
-  public String getDefaultValue() {\r
+  public String getDefault() {\r
     return defaultValue;\r
   }\r
 \r
   /**\r
    * @param defaultValue the defaultValue to set\r
    */\r
-  public void setDefaultValue(String defaultValue) {\r
+  public void setDefault(String defaultValue) {\r
     this.defaultValue = defaultValue;\r
   }\r
 \r
index 0473622..60ab4c7 100644 (file)
@@ -50,14 +50,14 @@ public class InputOutput {
   /**\r
    * @return the defaultValue\r
    */\r
-  public String getDefaultValue() {\r
+  public String getDefault() {\r
     return defaultValue;\r
   }\r
 \r
   /**\r
    * @param defaultValue the defaultValue to set\r
    */\r
-  public void setDefaultValue(String defaultValue) {\r
+  public void setDefault(String defaultValue) {\r
     this.defaultValue = defaultValue;\r
   }\r
 \r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java
new file mode 100644 (file)
index 0000000..2ede261
--- /dev/null
@@ -0,0 +1,56 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.externalservice.sdc.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ActivityContentTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  /**\r
+   * Test method for {@link java.lang.Object#toString()}.\r
+   */\r
+  @Test\r
+  public void testToString() {\r
+    String clazz = "clazz";\r
+    String script = "script";\r
+    String scriptFormat = "scriptFormat";\r
+    \r
+    ActivityContent ac = new ActivityContent();\r
+    ac.setClazz(clazz);\r
+    ac.setScript(script);\r
+    ac.setScriptFormat(scriptFormat );\r
+    \r
+    assertEquals(clazz, ac.getClazz());\r
+    assertEquals(script, ac.getScript());\r
+    assertEquals(scriptFormat, ac.getScriptFormat());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpecTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpecTest.java
new file mode 100644 (file)
index 0000000..aff131f
--- /dev/null
@@ -0,0 +1,74 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.externalservice.sdc.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ActivitySpecTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String id = "";\r
+    String versionId = "";\r
+    String name = "";\r
+    String description = "";\r
+    String type = "";\r
+    ActivityContent content = new ActivityContent();\r
+    String[] categoryList = new String[]{"aaa"};\r
+    Parameter[] inputs = new Parameter[0];\r
+    Parameter[] outputs = new Parameter[0];\r
+    String status = "status";\r
+    \r
+    ActivitySpec as = new ActivitySpec();\r
+    as.setId(id);\r
+    as.setVersionId(versionId);\r
+    as.setName(name);\r
+    as.setDescription(description);\r
+    as.setType(type);\r
+    as.setContent(content);\r
+    as.setCategoryList(categoryList);\r
+    as.setInputs(inputs);\r
+    as.setOutputs(outputs);\r
+    as.setStatus(status);\r
+    \r
+    assertEquals(id, as.getId());\r
+    assertEquals(versionId, as.getVersionId());\r
+    assertEquals(name, as.getName());\r
+    assertEquals(description, as.getDescription());\r
+    assertEquals(type, as.getType());\r
+    assertEquals(content, as.getContent());\r
+    assertEquals(categoryList, as.getCategoryList());\r
+    assertEquals(inputs, as.getInputs());\r
+    assertEquals(outputs, as.getOutputs());\r
+    assertEquals(status, as.getStatus());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ParameterTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ParameterTest.java
new file mode 100644 (file)
index 0000000..ce03410
--- /dev/null
@@ -0,0 +1,59 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.externalservice.sdc.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import com.google.gson.annotations.SerializedName;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ParameterTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String name = "name";\r
+    String type = "type";\r
+    String defaultValue = "defaultValue";\r
+    String value = "value";\r
+    \r
+    Parameter p = new Parameter();\r
+    p.setDefault(defaultValue);\r
+    p.setName(name);\r
+    p.setType(type);\r
+    p.setValue(value);\r
+    \r
+    assertEquals(name, p.getName());\r
+    assertEquals(type, p.getType());\r
+    assertEquals(defaultValue, p.getDefault());\r
+    assertEquals(value, p.getValue());\r
+\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfoTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfoTest.java
new file mode 100644 (file)
index 0000000..a29c55e
--- /dev/null
@@ -0,0 +1,57 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.externalservice.sdc.entity;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import static org.junit.Assert.fail;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class WorkflowArtifactInfoTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String artifactName = "artifactName";\r
+    String description = "description";\r
+    String artifactType = "WORKFLOW";\r
+    String payloadData = "payloadData";\r
+    \r
+    WorkflowArtifactInfo wai = new WorkflowArtifactInfo(artifactName, description, payloadData);\r
+    wai.setArtifactName(artifactName);\r
+    wai.setArtifactType(artifactType);\r
+    wai.setDescription(description);\r
+    wai.setPayloadData(payloadData);\r
+    \r
+    assertEquals(artifactName, wai.getArtifactName());\r
+    assertEquals(description, wai.getDescription());\r
+    assertEquals(artifactType, wai.getArtifactType());\r
+    assertEquals(payloadData, wai.getPayloadData());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/DataObjectTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/DataObjectTest.java
new file mode 100644 (file)
index 0000000..4f3dbd1
--- /dev/null
@@ -0,0 +1,53 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class DataObjectTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String id = "id";\r
+    String name = "name";\r
+    String value = "value";\r
+\r
+    DataObject d = new DataObject();\r
+    d.setId(id);\r
+    d.setName(name);\r
+    d.setValue(value);\r
+    \r
+    assertEquals(id, d.getId());\r
+    assertEquals(name, d.getName());\r
+    assertEquals(value, d.getValue());\r
+  }\r
+\r
+}\r
index 426141d..520061e 100644 (file)
@@ -14,9 +14,13 @@ package org.onap.sdc.workflowdesigner.model;
 
 import static org.junit.Assert.assertEquals;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.onap.sdc.workflowdesigner.model.Element.TYPE;
 
 /**
  *
@@ -45,5 +49,31 @@ public class ElementTest {
     System.out.println(endEvent.getType());
     assertEquals(endEvent.getType(), null);
   }
+  
+  
+  @Test
+  public void test() {
+    String id = "id";
+    String name = "name";
+    TYPE type = TYPE.endEvent;
+    String documentation = "documentation";
+    Position position = new Position();
+    List<String> connections= new ArrayList<>();
+    
+    Element e = new Element();
+    e.setConnections(connections);
+    e.setDocumentation(documentation);
+    e.setId(id);
+    e.setName(name);
+    e.setPosition(position);
+    e.setType(type);
+    
+    assertEquals(connections, e.getConnections());
+    assertEquals(documentation, e.getDocumentation());
+    assertEquals(id, e.getId());
+    assertEquals(name, e.getName());
+    assertEquals(position, e.getPosition());
+    assertEquals(type, e.getType());
+  }
 
 }
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ErrorEndEventTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ErrorEndEventTest.java
new file mode 100644 (file)
index 0000000..edd0ece
--- /dev/null
@@ -0,0 +1,47 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ErrorEndEventTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    Parameter parameter = new Parameter();\r
+\r
+    ErrorEndEvent eee = new ErrorEndEvent();\r
+    eee.setParameter(parameter);\r
+\r
+    assertEquals(parameter, eee.getParameter());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ParameterTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ParameterTest.java
new file mode 100644 (file)
index 0000000..aa428bc
--- /dev/null
@@ -0,0 +1,69 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import com.fasterxml.jackson.annotation.JsonInclude;\r
+import com.fasterxml.jackson.annotation.JsonInclude.Include;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ParameterTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String description = "description";\r
+    String name = "name";\r
+    String position = "position";\r
+    boolean required = false;\r
+    String type = "type";\r
+    Object value = "value";\r
+    String valueSource = "valueSource";\r
+    \r
+    Parameter p = new Parameter();\r
+    p.setDescription(description);\r
+    p.setName(name);\r
+    p.setPosition(position);\r
+    p.setRequired(required);\r
+    p.setType(type);\r
+    p.setValueSource(valueSource);\r
+    p.setValue(value);\r
+    \r
+    assertEquals(description, p.getDescription());\r
+    assertEquals(name, p.getName());\r
+    assertEquals(position, p.getPosition());\r
+    assertEquals(required, p.isRequired());\r
+    assertEquals(type, p.getType());\r
+    assertEquals(valueSource, p.getValueSource());\r
+    assertEquals(value, p.getValue());\r
+    \r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/PositionTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/PositionTest.java
new file mode 100644 (file)
index 0000000..83e826d
--- /dev/null
@@ -0,0 +1,50 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class PositionTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    int left = 100;\r
+    int top = 100;\r
+    \r
+    Position p = new Position();\r
+    p.setLeft(left);\r
+    p.setTop(top);\r
+    \r
+    assertEquals(left, p.getLeft());\r
+    assertEquals(top, p.getTop());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ProcessTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ProcessTest.java
new file mode 100644 (file)
index 0000000..5073bbe
--- /dev/null
@@ -0,0 +1,62 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ProcessTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String id = "id";\r
+    boolean isExecutable = false;\r
+    List<Element> elementList = new ArrayList<Element>();\r
+    List<SequenceFlow> sequenceFlowList = new ArrayList<SequenceFlow>();\r
+    List<DataObject> dataObjectList = new ArrayList<DataObject>();\r
+    \r
+    Process p = new Process(id);\r
+    p.setDataObjectList(dataObjectList);\r
+    p.setElementList(elementList);\r
+    p.setExecutable(isExecutable);\r
+    p.setId(id);\r
+    p.setSequenceFlowList(sequenceFlowList);\r
+\r
+    assertEquals(dataObjectList, p.getDataObjectList());\r
+    assertEquals(elementList, p.getElementList());\r
+    assertEquals(isExecutable, p.isExecutable());\r
+    assertEquals(id, p.getId());\r
+    assertEquals(sequenceFlowList, p.getSequenceFlowList());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/RestServiceTaskTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/RestServiceTaskTest.java
new file mode 100644 (file)
index 0000000..2d158e9
--- /dev/null
@@ -0,0 +1,71 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class RestServiceTaskTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    List<String> produces = new ArrayList<>();\r
+    List<String> consumes = new ArrayList<>();\r
+    List<Parameter> parameters = new ArrayList<>();\r
+    String baseUrl = "";\r
+    String serviceName = "";\r
+    String serviceVersion = "";\r
+    String path = "";\r
+    String method = "";\r
+    \r
+    RestServiceTask rst = new RestServiceTask();\r
+    rst.setProduces(produces);\r
+    rst.setConsumes(consumes);\r
+    rst.setParameters(parameters);\r
+    rst.setBaseUrl(baseUrl);\r
+    rst.setServiceName(serviceName);\r
+    rst.setServiceVersion(serviceVersion);\r
+    rst.setPath(path);\r
+    rst.setMethod(method);\r
+    \r
+    assertEquals(produces, rst.getProduces());\r
+    assertEquals(consumes, rst.getConsumes());\r
+    assertEquals(parameters, rst.getParameters());\r
+    assertEquals(baseUrl, rst.getBaseUrl());\r
+    assertEquals(serviceName, rst.getServiceName());\r
+    assertEquals(serviceVersion, rst.getServiceVersion());\r
+    assertEquals(path, rst.getPath());\r
+    assertEquals(method, rst.getMethod());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ScriptTaskTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ScriptTaskTest.java
new file mode 100644 (file)
index 0000000..2323ffc
--- /dev/null
@@ -0,0 +1,50 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ScriptTaskTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String scriptFormat = "scriptFormat";\r
+    String script = "script";\r
+    \r
+    ScriptTask st = new ScriptTask();\r
+    st.setScript(script);\r
+    st.setScriptFormat(scriptFormat);\r
+    \r
+    assertEquals(scriptFormat, st.getScriptFormat());\r
+    assertEquals(script, st.getScript());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/SequenceFlowTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/SequenceFlowTest.java
new file mode 100644 (file)
index 0000000..7f613c1
--- /dev/null
@@ -0,0 +1,62 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class SequenceFlowTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String id = "id";\r
+    String name = "name";\r
+    String sourceRef = "sourceRef";\r
+    String targetRef = "targetRef";\r
+    String documentation = "documentation";\r
+    String condition = "condition";\r
+    \r
+    SequenceFlow sf = new SequenceFlow();\r
+    sf.setCondition(condition);\r
+    sf.setDocumentation(documentation);\r
+    sf.setId(id);\r
+    sf.setName(name);\r
+    sf.setSourceRef(sourceRef);\r
+    sf.setTargetRef(targetRef);\r
+    \r
+    assertEquals(condition, sf.getCondition());\r
+    assertEquals(documentation, sf.getDocumentation());\r
+    assertEquals(id, sf.getId());\r
+    assertEquals(name, sf.getName());\r
+    assertEquals(sourceRef, sf.getSourceRef());\r
+    assertEquals(targetRef, sf.getTargetRef());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ServiceTaskTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ServiceTaskTest.java
new file mode 100644 (file)
index 0000000..a58fd58
--- /dev/null
@@ -0,0 +1,56 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ServiceTaskTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String className = "className";\r
+    List<Parameter> inputs = new ArrayList<>();\r
+    List<Parameter> outputs = new ArrayList<>();\r
+    \r
+    ServiceTask st = new ServiceTask();\r
+    st.setClassName(className);\r
+    st.setInputs(inputs);\r
+    st.setOutputs(outputs);\r
+    \r
+    assertEquals(className, st.getClassName());\r
+    assertEquals(inputs, st.getInputs());\r
+    assertEquals(outputs, st.getOutputs());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinitionTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinitionTest.java
new file mode 100644 (file)
index 0000000..b17a482
--- /dev/null
@@ -0,0 +1,56 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class TimerEventDefinitionTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String type = "type";\r
+    String timeDuration = "timeDuration";\r
+    String timeDate = "timeDate";\r
+    String timeCycle = "timeCycle";\r
+    \r
+    TimerEventDefinition ted = new TimerEventDefinition();\r
+    ted.setType(type);\r
+    ted.setTimeDate(timeDate);\r
+    ted.setTimeDuration(timeDuration);\r
+    ted.setTimeCycle(timeCycle);\r
+    \r
+    assertEquals(type, ted.getType());\r
+    assertEquals(timeDate, ted.getTimeDate());\r
+    assertEquals(timeDuration, ted.getTimeDuration());\r
+    assertEquals(timeCycle, ted.getTimeCycle());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryDataTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryDataTest.java
new file mode 100644 (file)
index 0000000..c42f4d0
--- /dev/null
@@ -0,0 +1,50 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class CategoryDataTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    I18nString displayName = new I18nString();\r
+    boolean collapse = false;\r
+    \r
+    CategoryData cd = new CategoryData();\r
+    cd.setDisplayName(displayName);\r
+    cd.setCollapse(collapse);\r
+\r
+    assertEquals(false, cd.isCollapse());\r
+    assertEquals(displayName, cd.getDisplayName());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java
new file mode 100644 (file)
index 0000000..58738bc
--- /dev/null
@@ -0,0 +1,62 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ContentTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String clazz = "clazz";\r
+    String script = "script";\r
+    String scriptFormat = "scriptFormat";\r
+    Map<String, InputOutput> inputs = new HashMap<String, InputOutput>();\r
+    Map<String, InputOutput> outputs = new HashMap<String, InputOutput>();\r
+    \r
+    Content c = new Content();\r
+    c.setClass(clazz);\r
+    c.setInputs(inputs);\r
+    c.setOutputs(outputs);\r
+    c.setScript(script);\r
+    c.setScriptFormat(scriptFormat);\r
+    \r
+    assertEquals(clazz, c.getClazz());\r
+    assertEquals(inputs, c.getInputs());\r
+    assertEquals(outputs, c.getOutputs());\r
+    assertEquals(script, c.getScript());\r
+    assertEquals(scriptFormat, c.getScriptFormat());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfoTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfoTest.java
new file mode 100644 (file)
index 0000000..f711271
--- /dev/null
@@ -0,0 +1,53 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ExtActivityDisplayInfoTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    Map<String, NodeCategory> nodes = new HashMap<>();\r
+    Map<String, CategoryData> categoryData = new HashMap<>();\r
+    \r
+    ExtActivityDisplayInfo ed = new ExtActivityDisplayInfo();\r
+    ed.setCategoryData(categoryData);\r
+    ed.setNodes(nodes);\r
+    \r
+    assertEquals(categoryData, ed.getCategoryData());\r
+    assertEquals(nodes, ed.getNodes());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtendActivityTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtendActivityTest.java
new file mode 100644 (file)
index 0000000..e8fa1e7
--- /dev/null
@@ -0,0 +1,63 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class ExtendActivityTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String id = "";\r
+    I18nString displayName = new I18nString();\r
+    I18nString description = new I18nString();\r
+    String type = "";\r
+    IconData icon = new IconData();\r
+    Content content = new Content();\r
+\r
+    ExtendActivity ea = new ExtendActivity();\r
+    ea.setContent(content);\r
+    ea.setDescription(description);\r
+    ea.setDisplayName(displayName);\r
+    ea.setIcon(icon);\r
+    ea.setId(id);\r
+    ea.setType(type);\r
+    \r
+    assertEquals(content, ea.getContent());\r
+    assertEquals(description, ea.getDescription());\r
+    assertEquals(displayName, ea.getDisplayName());\r
+    assertEquals(icon, ea.getIcon());\r
+    assertEquals(id, ea.getId());\r
+    assertEquals(type, ea.getType());\r
+\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/I18nStringTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/I18nStringTest.java
new file mode 100644 (file)
index 0000000..b9ead1c
--- /dev/null
@@ -0,0 +1,49 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class I18nStringTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String en_US = "en_US";\r
+    String zh_CN = "zh_CN";\r
+    I18nString i18n = new I18nString(en_US, zh_CN);\r
+    i18n.setEn_US(en_US);\r
+    i18n.setZh_CN(zh_CN);\r
+    \r
+    assertEquals(en_US, i18n.getEn_US());\r
+    assertEquals(zh_CN, i18n.getZh_CN());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/IconDataTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/IconDataTest.java
new file mode 100644 (file)
index 0000000..148d3ad
--- /dev/null
@@ -0,0 +1,53 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class IconDataTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String name = "name";\r
+    int width = 100;\r
+    int height= 10;\r
+    \r
+    IconData id = new IconData();\r
+    id.setHeight(height);\r
+    id.setName(name);\r
+    id.setWidth(width);\r
+    \r
+    assertEquals(height, id.getHeight());\r
+    assertEquals(name, id.getName());\r
+    assertEquals(width, id.getWidth());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutputTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutputTest.java
new file mode 100644 (file)
index 0000000..7220145
--- /dev/null
@@ -0,0 +1,67 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import com.google.gson.annotations.SerializedName;\r
+\r
+/**\r
+ *\r
+ */\r
+public class InputOutputTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String type = "";\r
+    String defaultValue = "";\r
+    boolean required = false;\r
+    I18nString displayName = new I18nString();\r
+    boolean show = true;\r
+    boolean editable = true;\r
+    String value = "";\r
+\r
+    InputOutput io = new InputOutput();\r
+    io.setDefault(defaultValue);\r
+    io.setDisplayName(displayName);\r
+    io.setEditable(editable);\r
+    io.setRequired(required);\r
+    io.setShow(show);\r
+    io.setType(type);\r
+    io.setValue(value);\r
+    \r
+    assertEquals(defaultValue, io.getDefault());\r
+    assertEquals(displayName, io.getDisplayName());\r
+    assertEquals(editable, io.isEditable());\r
+    assertEquals(required, io.isRequired());\r
+    assertEquals(show, io.isShow());\r
+    assertEquals(type, io.getType());\r
+    assertEquals(value, io.getValue());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategoryTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategoryTest.java
new file mode 100644 (file)
index 0000000..8bc678f
--- /dev/null
@@ -0,0 +1,47 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class NodeCategoryTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String category = "category";\r
+    \r
+    NodeCategory nc = new NodeCategory();\r
+    nc.setCategory(category);\r
+    \r
+    assertEquals(category, nc.getCategory());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfoTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfoTest.java
new file mode 100644 (file)
index 0000000..22b951e
--- /dev/null
@@ -0,0 +1,67 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.resources.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import com.google.gson.JsonObject;\r
+\r
+/**\r
+ *\r
+ */\r
+public class WorkflowInfoTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  @Test\r
+  public void test() {\r
+    String uuid = "";\r
+    String operationId = "";\r
+    String id = "";\r
+    String name = "";\r
+    String description = "";\r
+    String scene = "";\r
+    JsonObject data =new JsonObject();\r
+    \r
+    WorkflowInfo wi = new WorkflowInfo();\r
+    wi.setData(data);\r
+    wi.setDescription(description);\r
+    wi.setId(id);\r
+    wi.setName(name);\r
+    wi.setOperationId(operationId);\r
+    wi.setScene(scene);\r
+    wi.setUuid(uuid);\r
+    \r
+    assertEquals(data, wi.getData());\r
+    assertEquals(description, wi.getDescription());\r
+    assertEquals(id, wi.getId());\r
+    assertEquals(name, wi.getName());\r
+    assertEquals(operationId, wi.getOperationId());\r
+    assertEquals(scene, wi.getScene());\r
+    assertEquals(uuid, wi.getUuid());\r
+  }\r
+\r
+}\r
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponseTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponseTest.java
new file mode 100644 (file)
index 0000000..5292521
--- /dev/null
@@ -0,0 +1,51 @@
+/**\r
+ * Copyright (c) 2018 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the Apache License, Version 2.0\r
+ * and the Eclipse Public License v1.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.utils.entity;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+/**\r
+ *\r
+ */\r
+public class CommonErrorResponseTest {\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @Before\r
+  public void setUp() throws Exception {}\r
+\r
+  /**\r
+   * @throws java.lang.Exception\r
+   */\r
+  @After\r
+  public void tearDown() throws Exception {}\r
+\r
+  /**\r
+   * Test method for {@link org.onap.sdc.workflowdesigner.utils.entity.CommonErrorResponse#failure(java.lang.String)}.\r
+   */\r
+  @Test\r
+  public void testFailure() {\r
+    String code = "code";\r
+    String message = "message";\r
+    CommonErrorResponse errorResponse = new CommonErrorResponse(code);\r
+    errorResponse.setCode(code);\r
+    errorResponse.setMessage(message);\r
+    assertEquals(code, errorResponse.getCode());\r
+    assertEquals(message, errorResponse.getMessage());\r
+  }\r
+\r
+}\r