From 032929d287cbafefe8367e0fcee18dec4b1bf9f7 Mon Sep 17 00:00:00 2001 From: vempo Date: Mon, 22 Oct 2018 11:33:19 +0300 Subject: Deleted deprecated workflow project Change-Id: I2ad75adab7d47d8df5b3996a315a9b173fa4bbfe Issue-ID: SDC-1855 Signed-off-by: vempo --- .../workflowdesigner/SDCServiceProxyInfoTest.java | 53 ------- .../WorkflowDesignerConfigurationTest.java | 54 ------- .../workflowdesigner/config/AdapterTypeTest.java | 45 ------ .../sdc/workflowdesigner/config/ConfigTest.java | 26 --- .../sdc/entity/ActivityContentTest.java | 56 ------- .../sdc/entity/ActivitySpecTest.java | 74 --------- .../externalservice/sdc/entity/ParameterTest.java | 59 ------- .../sdc/entity/WorkflowArtifactInfoTest.java | 57 ------- .../sdc/workflowdesigner/model/DataObjectTest.java | 53 ------- .../sdc/workflowdesigner/model/ElementTest.java | 79 ---------- .../workflowdesigner/model/ErrorEndEventTest.java | 47 ------ .../sdc/workflowdesigner/model/ParameterTest.java | 69 -------- .../sdc/workflowdesigner/model/PositionTest.java | 50 ------ .../sdc/workflowdesigner/model/ProcessTest.java | 62 -------- .../model/RestServiceTaskTest.java | 71 --------- .../sdc/workflowdesigner/model/ScriptTaskTest.java | 50 ------ .../workflowdesigner/model/SequenceFlowTest.java | 62 -------- .../workflowdesigner/model/ServiceTaskTest.java | 56 ------- .../model/TimerEventDefinitionTest.java | 56 ------- .../parser/Bpmn4ToscaJsonParserTest.java | 130 --------------- .../planwriter/BpmnPlanArtefactWriterTest.java | 58 ------- .../resources/ExtendActivityResourceTest.java | 66 -------- .../resources/WorkflowModelerResourceTest.java | 109 ------------- .../resources/entity/CategoryDataTest.java | 50 ------ .../resources/entity/ContentTest.java | 73 --------- .../entity/ExtActivityDisplayInfoTest.java | 53 ------- .../resources/entity/ExtendActivityTest.java | 63 -------- .../resources/entity/I18nStringTest.java | 49 ------ .../resources/entity/IconDataTest.java | 53 ------- .../resources/entity/InputOutputTest.java | 67 -------- .../resources/entity/NodeCategoryTest.java | 47 ------ .../resources/entity/WorkflowInfoTest.java | 67 -------- .../utils/FileCommonUtilsTest.java | 175 --------------------- .../sdc/workflowdesigner/utils/JsonUtilsTest.java | 59 ------- .../utils/entity/CommonErrorResponseTest.java | 51 ------ .../resources/workflow/template-test.bpmn20.xml | 15 -- .../src/test/resources/workflow/workflow.json | 28 ---- 37 files changed, 2292 deletions(-) delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfoTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfigurationTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/config/AdapterTypeTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/config/ConfigTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpecTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ParameterTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfoTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/DataObjectTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ElementTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ErrorEndEventTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ParameterTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/PositionTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ProcessTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/RestServiceTaskTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ScriptTaskTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/SequenceFlowTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ServiceTaskTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinitionTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParserTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/planwriter/BpmnPlanArtefactWriterTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResourceTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResourceTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryDataTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfoTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtendActivityTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/I18nStringTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/IconDataTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutputTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategoryTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfoTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtilsTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/JsonUtilsTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponseTest.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/resources/workflow/template-test.bpmn20.xml delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/test/resources/workflow/workflow.json (limited to 'deprecated-workflow-designer/sdc-workflow-designer-server/src/test') diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfoTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfoTest.java deleted file mode 100644 index dde607e9..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfoTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner; - -import static org.junit.Assert.assertEquals; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class SDCServiceProxyInfoTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String serviceAddr = "serviceAddr"; - String xEcompInstanceId = "xEcompInstanceId"; - String authorization = "authorization"; - - SDCServiceProxyInfo spi = new SDCServiceProxyInfo(); - spi.setAuthorization(authorization); - spi.setServiceAddr(serviceAddr); - spi.setxEcompInstanceId(xEcompInstanceId); - - assertEquals(authorization, spi.getAuthorization()); - assertEquals(serviceAddr, spi.getServiceAddr()); - assertEquals(xEcompInstanceId, spi.getxEcompInstanceId()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfigurationTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfigurationTest.java deleted file mode 100644 index a09afb15..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfigurationTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner; - -import static org.junit.Assert.assertEquals; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class WorkflowDesignerConfigurationTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String template = "template"; - String defaultName = "Workflow Designer"; - SDCServiceProxyInfo sdcServiceProxy = new SDCServiceProxyInfo(); - - - WorkflowDesignerConfiguration wdc = new WorkflowDesignerConfiguration(); - wdc.setDefaultName(defaultName); - wdc.setSdcServiceProxy(sdcServiceProxy); - wdc.setTemplate(template); - - assertEquals(defaultName, wdc.getDefaultName()); - assertEquals(sdcServiceProxy, wdc.getSdcServiceProxy()); - assertEquals(template, wdc.getTemplate()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/config/AdapterTypeTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/config/AdapterTypeTest.java deleted file mode 100644 index 6d779cc2..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/config/AdapterTypeTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.config; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class AdapterTypeTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - AdapterType at = AdapterType.valueOf("SDC"); - assertEquals(AdapterType.SDC, at); - AdapterType at1 = AdapterType.valueOf("DEFAULT"); - assertEquals(AdapterType.DEFAULT, at1); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/config/ConfigTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/config/ConfigTest.java deleted file mode 100644 index deb04c57..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/config/ConfigTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.config; - -import static org.junit.Assert.assertEquals; - -import org.apache.velocity.exception.ParseErrorException; -import org.apache.velocity.exception.ResourceNotFoundException; -import org.junit.Test; - -public class ConfigTest { - @Test - public void testLoad() throws ResourceNotFoundException, ParseErrorException, Exception { - assertEquals(Config.PROPERTIES.get(Config.HANDLER_ClASS), - "org.onap.workflow.activitiext.restservicetask.HttpUtil"); - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java deleted file mode 100644 index 27a9872d..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class ActivityContentTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - /** - * Test method for {@link java.lang.Object#toString()}. - */ - @Test - public void testToString() { -// String clazz = "clazz"; - String script = "script"; - String scriptFormat = "scriptFormat"; - - ActivityContent ac = new ActivityContent(); -// ac.setClass(clazz); - ac.setScript(script); - ac.setScriptFormat(scriptFormat ); - -// assertEquals(clazz, ac.getClazz()); - assertEquals(script, ac.getScript()); - assertEquals(scriptFormat, ac.getScriptFormat()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpecTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpecTest.java deleted file mode 100644 index 84ca9198..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpecTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class ActivitySpecTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String id = ""; - String versionId = ""; - String name = ""; - String description = ""; - String type = ""; - String content = ""; - String[] categoryList = new String[]{"aaa"}; - Parameter[] inputs = new Parameter[0]; - Parameter[] outputs = new Parameter[0]; - String status = "status"; - - ActivitySpec as = new ActivitySpec(); - as.setId(id); - as.setVersionId(versionId); - as.setName(name); - as.setDescription(description); - as.setType(type); - as.setContent(content); - as.setCategoryList(categoryList); - as.setInputs(inputs); - as.setOutputs(outputs); - as.setStatus(status); - - assertEquals(id, as.getId()); - assertEquals(versionId, as.getVersionId()); - assertEquals(name, as.getName()); - assertEquals(description, as.getDescription()); - assertEquals(type, as.getType()); - assertEquals(content, as.getContent()); - assertEquals(categoryList, as.getCategoryList()); - assertEquals(inputs, as.getInputs()); - assertEquals(outputs, as.getOutputs()); - assertEquals(status, as.getStatus()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ParameterTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ParameterTest.java deleted file mode 100644 index 0a56b302..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ParameterTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.google.gson.annotations.SerializedName; - -/** - * - */ -public class ParameterTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String name = "name"; - String type = "type"; - String defaultValue = "defaultValue"; - String value = "value"; - - Parameter p = new Parameter(); - p.setDefault(defaultValue); - p.setName(name); - p.setType(type); - p.setValue(value); - - assertEquals(name, p.getName()); - assertEquals(type, p.getType()); - assertEquals(defaultValue, p.getDefault()); - assertEquals(value, p.getValue()); - - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfoTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfoTest.java deleted file mode 100644 index 73412637..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfoTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class WorkflowArtifactInfoTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String artifactName = "artifactName"; - String description = "description"; - String artifactType = "WORKFLOW"; - String payloadData = "payloadData"; - - WorkflowArtifactInfo wai = new WorkflowArtifactInfo(artifactName, description, payloadData); - wai.setArtifactName(artifactName); - wai.setArtifactType(artifactType); - wai.setDescription(description); - wai.setPayloadData(payloadData); - - assertEquals(artifactName, wai.getArtifactName()); - assertEquals(description, wai.getDescription()); - assertEquals(artifactType, wai.getArtifactType()); - assertEquals(payloadData, wai.getPayloadData()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/DataObjectTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/DataObjectTest.java deleted file mode 100644 index da2806ce..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/DataObjectTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class DataObjectTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String id = "id"; - String name = "name"; - String value = "value"; - - DataObject d = new DataObject(); - d.setId(id); - d.setName(name); - d.setValue(value); - - assertEquals(id, d.getId()); - assertEquals(name, d.getName()); - assertEquals(value, d.getValue()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ElementTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ElementTest.java deleted file mode 100644 index 520061ed..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ElementTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -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; - -/** - * - */ -public class ElementTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.model.Element#getType()} - * - */ - @Test - public final void getType() { - Element endEvent = new EndEvent(); - 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 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/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ErrorEndEventTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ErrorEndEventTest.java deleted file mode 100644 index 98e19646..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ErrorEndEventTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class ErrorEndEventTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - Parameter parameter = new Parameter(); - - ErrorEndEvent eee = new ErrorEndEvent(); - eee.setParameter(parameter); - - assertEquals(parameter, eee.getParameter()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ParameterTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ParameterTest.java deleted file mode 100644 index fea6a6f4..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ParameterTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -/** - * - */ -public class ParameterTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String description = "description"; - String name = "name"; - String position = "position"; - boolean required = false; - String type = "type"; - Object value = "value"; - String valueSource = "valueSource"; - - Parameter p = new Parameter(); - p.setDescription(description); - p.setName(name); - p.setPosition(position); - p.setRequired(required); - p.setType(type); - p.setValueSource(valueSource); - p.setValue(value); - - assertEquals(description, p.getDescription()); - assertEquals(name, p.getName()); - assertEquals(position, p.getPosition()); - assertEquals(required, p.isRequired()); - assertEquals(type, p.getType()); - assertEquals(valueSource, p.getValueSource()); - assertEquals(value, p.getValue()); - - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/PositionTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/PositionTest.java deleted file mode 100644 index 5ebb335c..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/PositionTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class PositionTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - int left = 100; - int top = 100; - - Position p = new Position(); - p.setLeft(left); - p.setTop(top); - - assertEquals(left, p.getLeft()); - assertEquals(top, p.getTop()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ProcessTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ProcessTest.java deleted file mode 100644 index 34c3cc64..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ProcessTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class ProcessTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String id = "id"; - boolean isExecutable = false; - List elementList = new ArrayList(); - List sequenceFlowList = new ArrayList(); - List dataObjectList = new ArrayList(); - - Process p = new Process(id); - p.setDataObjectList(dataObjectList); - p.setElementList(elementList); - p.setExecutable(isExecutable); - p.setId(id); - p.setSequenceFlowList(sequenceFlowList); - - assertEquals(dataObjectList, p.getDataObjectList()); - assertEquals(elementList, p.getElementList()); - assertEquals(isExecutable, p.isExecutable()); - assertEquals(id, p.getId()); - assertEquals(sequenceFlowList, p.getSequenceFlowList()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/RestServiceTaskTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/RestServiceTaskTest.java deleted file mode 100644 index 1aa593c5..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/RestServiceTaskTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class RestServiceTaskTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - List produces = new ArrayList<>(); - List consumes = new ArrayList<>(); - List parameters = new ArrayList<>(); - String baseUrl = ""; - String serviceName = ""; - String serviceVersion = ""; - String path = ""; - String method = ""; - - RestServiceTask rst = new RestServiceTask(); - rst.setProduces(produces); - rst.setConsumes(consumes); - rst.setParameters(parameters); - rst.setBaseUrl(baseUrl); - rst.setServiceName(serviceName); - rst.setServiceVersion(serviceVersion); - rst.setPath(path); - rst.setMethod(method); - - assertEquals(produces, rst.getProduces()); - assertEquals(consumes, rst.getConsumes()); - assertEquals(parameters, rst.getParameters()); - assertEquals(baseUrl, rst.getBaseUrl()); - assertEquals(serviceName, rst.getServiceName()); - assertEquals(serviceVersion, rst.getServiceVersion()); - assertEquals(path, rst.getPath()); - assertEquals(method, rst.getMethod()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ScriptTaskTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ScriptTaskTest.java deleted file mode 100644 index 1eaba96d..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ScriptTaskTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class ScriptTaskTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String scriptFormat = "scriptFormat"; - String script = "script"; - - ScriptTask st = new ScriptTask(); - st.setScript(script); - st.setScriptFormat(scriptFormat); - - assertEquals(scriptFormat, st.getScriptFormat()); - assertEquals(script, st.getScript()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/SequenceFlowTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/SequenceFlowTest.java deleted file mode 100644 index ae947b58..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/SequenceFlowTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class SequenceFlowTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String id = "id"; - String name = "name"; - String sourceRef = "sourceRef"; - String targetRef = "targetRef"; - String documentation = "documentation"; - String condition = "condition"; - - SequenceFlow sf = new SequenceFlow(); - sf.setCondition(condition); - sf.setDocumentation(documentation); - sf.setId(id); - sf.setName(name); - sf.setSourceRef(sourceRef); - sf.setTargetRef(targetRef); - - assertEquals(condition, sf.getCondition()); - assertEquals(documentation, sf.getDocumentation()); - assertEquals(id, sf.getId()); - assertEquals(name, sf.getName()); - assertEquals(sourceRef, sf.getSourceRef()); - assertEquals(targetRef, sf.getTargetRef()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ServiceTaskTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ServiceTaskTest.java deleted file mode 100644 index e2718d19..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/ServiceTaskTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class ServiceTaskTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String className = "className"; - List inputs = new ArrayList<>(); - List outputs = new ArrayList<>(); - - ServiceTask st = new ServiceTask(); - st.setClassName(className); - st.setInputs(inputs); - st.setOutputs(outputs); - - assertEquals(className, st.getClassName()); - assertEquals(inputs, st.getInputs()); - assertEquals(outputs, st.getOutputs()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinitionTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinitionTest.java deleted file mode 100644 index 8c82ddf0..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinitionTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class TimerEventDefinitionTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String type = "type"; - String timeDuration = "timeDuration"; - String timeDate = "timeDate"; - String timeCycle = "timeCycle"; - - TimerEventDefinition ted = new TimerEventDefinition(); - ted.setType(type); - ted.setTimeDate(timeDate); - ted.setTimeDuration(timeDuration); - ted.setTimeCycle(timeCycle); - - assertEquals(type, ted.getType()); - assertEquals(timeDate, ted.getTimeDate()); - assertEquals(timeDuration, ted.getTimeDuration()); - assertEquals(timeCycle, ted.getTimeCycle()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParserTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParserTest.java deleted file mode 100644 index abadd298..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParserTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.parser; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URI; -import java.nio.file.Paths; -import java.util.Iterator; -import java.util.List; - -import org.junit.Test; -import org.onap.sdc.workflowdesigner.model.Element; -import org.onap.sdc.workflowdesigner.model.Position; -import org.onap.sdc.workflowdesigner.model.Process; -import org.onap.sdc.workflowdesigner.model.ScriptTask; -import org.onap.sdc.workflowdesigner.model.SequenceFlow; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; - -public class Bpmn4ToscaJsonParserTest { - - private static String RESOURCES_DIR = "src/test/resources/workflow"; - protected static String PROCESS_NAME = "test1"; - - @Test - public void parseTest() throws JsonParseException, JsonMappingException, MalformedURLException, IOException { - Bpmn4ToscaJsonParser parser = new Bpmn4ToscaJsonParser(); - URI srcUri = Paths.get(RESOURCES_DIR, "workflow.json").toUri(); - Process actualProcess = parser.parse(PROCESS_NAME, srcUri); - Process expectedProcess = createReferenceProcess(); - - assertElements(expectedProcess.getElementList(), actualProcess.getElementList()); - assertSequenceFlows(expectedProcess.getSequenceFlowList(), actualProcess.getSequenceFlowList()); - } - - private static void assertElements(List expectedElementList, List actualElementList) { - assertEquals(expectedElementList.size(), actualElementList.size()); - - for (Iterator iterator = expectedElementList.iterator(); iterator.hasNext();) { - Element expectedElement = (Element) iterator.next(); - Element actualElement = getElementById(expectedElement.getId(), actualElementList); - if (actualElement != null) { - assertElement(expectedElement, actualElement); - } else { - fail("Element with id " + expectedElement.getId() + " could not be found"); - } - } - } - - private static Element getElementById(String id, List actualElementList) { - Iterator iter = actualElementList.iterator(); - while (iter.hasNext()) { - Element element = (Element) iter.next(); - if (element.getId().equals(id)) { - return element; - } - } - return null; - } - - public static void assertElement(Element expected, Element actual) { - assertEquals("element: id ", expected.getId(), actual.getId()); - assertEquals("element: name ", expected.getName(), actual.getName()); - } - - public static void assertSequenceFlows(List expectedSequenceList, - List actualSequenceFlowList) { - assertEquals(expectedSequenceList.size(), actualSequenceFlowList.size()); - - for (Iterator iterator = expectedSequenceList.iterator(); iterator.hasNext();) { - SequenceFlow expectedElement = (SequenceFlow) iterator.next(); - SequenceFlow actualElement = getSequenceById(expectedElement.getSourceRef(), expectedElement.getTargetRef(), - actualSequenceFlowList); - if (actualElement != null) { - assertLink(expectedElement, actualElement); - } else { - fail("Element with id " + expectedElement.getId() + " could not be found"); - } - } - } - - private static SequenceFlow getSequenceById(String sourceRef, String targetRef, - List actualSequenceFlowList) { - Iterator iter = actualSequenceFlowList.iterator(); - while (iter.hasNext()) { - SequenceFlow element = (SequenceFlow) iter.next(); - if (element.getSourceRef().equals(sourceRef) && element.getTargetRef().equals(targetRef)) { - return element; - } - } - return null; - } - - public static void assertLink(SequenceFlow expectedLink, SequenceFlow actualLink) { - assertEquals("Link source: id", expectedLink.getSourceRef(), actualLink.getSourceRef()); - assertEquals("Link target :id", expectedLink.getTargetRef(), actualLink.getTargetRef()); - } - - private static Process createReferenceProcess() { - Process process = new Process(PROCESS_NAME); - - ScriptTask scriptTask = new ScriptTask(); - scriptTask.setId("scriptTask"); - scriptTask.setName("Script Task"); - Position position = new Position(); - position.setLeft(328); - position.setTop(134); - scriptTask.setPosition(position); - scriptTask.setScript(""); - scriptTask.setScriptFormat("JavaScript"); - process.getElementList().add(scriptTask); - - return process; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/planwriter/BpmnPlanArtefactWriterTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/planwriter/BpmnPlanArtefactWriterTest.java deleted file mode 100644 index a67a2070..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/planwriter/BpmnPlanArtefactWriterTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.planwriter; - -import static org.junit.Assert.assertEquals; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; - -import org.junit.Test; -import org.onap.sdc.workflowdesigner.model.Process; -import org.onap.sdc.workflowdesigner.writer.BpmnPlanArtefactWriter; - -public class BpmnPlanArtefactWriterTest { - - @Test - public void testWritePlan() throws Exception { - BpmnPlanArtefactWriter writer = new BpmnPlanArtefactWriter(mockProcss()); - String result = writer.completePlanTemplate(); - assertEquals(result, getResult()); - } - - private Process mockProcss() { - Process process = new Process("templateTest"); - - return process; - } - - public String getResult() throws IOException { - StringBuffer buffer = new StringBuffer(); - - String path = "src/test/resources/workflow/template-test.bpmn20.xml"; - BufferedReader reader = new BufferedReader(new FileReader(new File(path))); - - String line = null; - while ((line = reader.readLine()) != null) { - buffer.append(line).append("\r\n"); - } - - if (reader != null) { - reader.close(); - } - - return buffer.toString(); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResourceTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResourceTest.java deleted file mode 100644 index be55aed0..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResourceTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources; - -import static org.junit.Assert.assertEquals; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.onap.sdc.workflowdesigner.resources.entity.ExtActivity; -import org.onap.sdc.workflowdesigner.utils.FileCommonUtils; -import org.onap.sdc.workflowdesigner.utils.JsonUtils; - -/** - * - */ -public class ExtendActivityResourceTest { - private static final String EXT_ACTIVITIES_FILE_NAME = "src/main/assembly/ext-activities.json"; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - /** - * - */ - @Test - public void testRetriveExtActivites() { - try { - String json = FileCommonUtils.readString(EXT_ACTIVITIES_FILE_NAME); - ExtActivity[] extActivities = JsonUtils.fromJson(json, ExtActivity[].class); - - FileCommonUtils.write("test.json", JsonUtils.toJson(extActivities)); - assertEquals(extActivities.length == 0, false); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.resources.ExtendActivityResource#getDisplayInfo(java.lang.String)}. - */ - @Test - public void testGetDisplayInfo() { - - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResourceTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResourceTest.java deleted file mode 100644 index 47a46a8c..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResourceTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.net.URI; -import java.nio.file.Paths; -import java.util.UUID; - -import org.dom4j.DocumentException; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.onap.sdc.workflowdesigner.resources.entity.WorkflowInfo; -import org.onap.sdc.workflowdesigner.utils.FileCommonUtils; -import org.onap.sdc.workflowdesigner.utils.JsonUtils; - -/** - * - */ -public class WorkflowModelerResourceTest { - private static final String WORKFLOW_JSON_TEMP_FILE_NAME = "temp_workflow.json"; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - /** - * Test method for - * {@link org.onap.sdc.workflowdesigner.resources.WorkflowModelerResource#buildBPMN(java.net.URI, java.lang.String)}. - */ - @Test - public void testBuildBPMN() { - String bpmn = parseBpmnfromJsonFile(); - assertEquals(false, bpmn.isEmpty()); - } - - /** - * @return - */ - private String parseBpmnfromJsonFile() { - try { - URI srcUri = Paths.get("src/main/assembly", WORKFLOW_JSON_TEMP_FILE_NAME).toUri(); - WorkflowModelerResource resource = new WorkflowModelerResource(); - String processName = "plan_" + UUID.randomUUID().toString(); - return resource.buildBPMN(srcUri, processName); - } catch (IOException e) { - } catch (Exception e) { - } - - return null; - } - - /** - * Test method for - * {@link org.onap.sdc.workflowdesigner.resources.WorkflowModelerResource#insertJson2Bpmn(java.lang.String, java.lang.String)}. - */ - @Test - public void testInsertJson2Bpmn() { - String bpmn = parseBpmnfromJsonFile(); - - try { - String json = FileCommonUtils.readString("src/main/assembly/" + WORKFLOW_JSON_TEMP_FILE_NAME); - WorkflowModelerResource resource = new WorkflowModelerResource(); - String combineBpmn = resource.insertJson2Bpmn(json, bpmn); - - String json1 = resource.readJsonfromBPMN(combineBpmn); - - assertEqualsJson(json, json1); - } catch (IOException e) { - } catch (DocumentException e) { - } - } - - /** - * @param json - * @param json1 - */ - private void assertEqualsJson(String json, String json1) { - WorkflowInfo wi = JsonUtils.fromJson(json, WorkflowInfo.class); - WorkflowInfo wi1 = JsonUtils.fromJson(json1, WorkflowInfo.class); - - String newJson = JsonUtils.toJson(wi); - String newJson1 = JsonUtils.toJson(wi1); - - assertEquals(newJson1, newJson); - - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryDataTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryDataTest.java deleted file mode 100644 index 590432fd..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryDataTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class CategoryDataTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - I18nString displayName = new I18nString(); - boolean collapse = false; - - CategoryData cd = new CategoryData(); - cd.setDisplayName(displayName); - cd.setCollapse(collapse); - - assertEquals(false, cd.isCollapse()); - assertEquals(displayName, cd.getDisplayName()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java deleted file mode 100644 index 8458fc5e..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.onap.sdc.workflowdesigner.utils.JsonUtils; - -/** - * - */ -public class ContentTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { -// String clazz = "clazz"; - String script = "script"; - String scriptFormat = "scriptFormat"; - Map inputs = new HashMap(); - Map outputs = new HashMap(); - - Content c = new Content(); -// c.setClass(clazz); - c.setInputs(inputs); - c.setOutputs(outputs); - c.setScript(script); - c.setScriptFormat(scriptFormat); - -// assertEquals(clazz, c.getClazz()); - assertEquals(inputs, c.getInputs()); - assertEquals(outputs, c.getOutputs()); - assertEquals(script, c.getScript()); - assertEquals(scriptFormat, c.getScriptFormat()); - } - - @Test - public void testGson() { - String json = "{\r\n" + - " \"class\": \"aaaa\",\r\n" + - " \"inputs\": {}\r\n" + - " }"; - Content content = JsonUtils.fromJson(json, Content.class); - assertNotNull(content); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfoTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfoTest.java deleted file mode 100644 index 6c26ec75..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfoTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class ExtActivityDisplayInfoTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - Map nodes = new HashMap<>(); - Map categoryData = new HashMap<>(); - - ExtActivityDisplayInfo ed = new ExtActivityDisplayInfo(); - ed.setCategoryData(categoryData); - ed.setNodes(nodes); - - assertEquals(categoryData, ed.getCategoryData()); - assertEquals(nodes, ed.getNodes()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtendActivityTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtendActivityTest.java deleted file mode 100644 index aca66b0f..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ExtendActivityTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class ExtendActivityTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String id = ""; - I18nString displayName = new I18nString(); - I18nString description = new I18nString(); - String type = ""; - IconData icon = new IconData(); - Content content = new Content(); - - ExtActivity ea = new ExtActivity(); - ea.setContent(content); - ea.setDescription(description); - ea.setDisplayName(displayName); - ea.setIcon(icon); - ea.setId(id); - ea.setType(type); - - assertEquals(content, ea.getContent()); - assertEquals(description, ea.getDescription()); - assertEquals(displayName, ea.getDisplayName()); - assertEquals(icon, ea.getIcon()); - assertEquals(id, ea.getId()); - assertEquals(type, ea.getType()); - - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/I18nStringTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/I18nStringTest.java deleted file mode 100644 index f72a10b3..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/I18nStringTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class I18nStringTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String en_US = "en_US"; - String zh_CN = "zh_CN"; - I18nString i18n = new I18nString(en_US, zh_CN); - i18n.setEn_US(en_US); - i18n.setZh_CN(zh_CN); - - assertEquals(en_US, i18n.getEn_US()); - assertEquals(zh_CN, i18n.getZh_CN()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/IconDataTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/IconDataTest.java deleted file mode 100644 index dae22c03..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/IconDataTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class IconDataTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String name = "name"; - int width = 100; - int height= 10; - - IconData id = new IconData(); - id.setHeight(height); - id.setName(name); - id.setWidth(width); - - assertEquals(height, id.getHeight()); - assertEquals(name, id.getName()); - assertEquals(width, id.getWidth()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutputTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutputTest.java deleted file mode 100644 index f453088d..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutputTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.google.gson.annotations.SerializedName; - -/** - * - */ -public class InputOutputTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String type = ""; - String defaultValue = ""; - boolean required = false; - I18nString displayName = new I18nString(); - boolean show = true; - boolean editable = true; - String value = ""; - - InputOutput io = new InputOutput(); - io.setDefault(defaultValue); - io.setDisplayName(displayName); - io.setEditable(editable); - io.setRequired(required); - io.setShow(show); - io.setType(type); - io.setValue(value); - - assertEquals(defaultValue, io.getDefault()); - assertEquals(displayName, io.getDisplayName()); - assertEquals(editable, io.isEditable()); - assertEquals(required, io.isRequired()); - assertEquals(show, io.isShow()); - assertEquals(type, io.getType()); - assertEquals(value, io.getValue()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategoryTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategoryTest.java deleted file mode 100644 index 2342d43d..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategoryTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class NodeCategoryTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String category = "category"; - - NodeCategory nc = new NodeCategory(); - nc.setCategory(category); - - assertEquals(category, nc.getCategory()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfoTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfoTest.java deleted file mode 100644 index 488a744c..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfoTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.google.gson.JsonObject; - -/** - * - */ -public class WorkflowInfoTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @Test - public void test() { - String uuid = ""; - String operationId = ""; - String id = ""; - String name = ""; - String description = ""; - String scene = ""; - JsonObject data =new JsonObject(); - - WorkflowInfo wi = new WorkflowInfo(); - wi.setData(data); - wi.setDescription(description); - wi.setId(id); - wi.setName(name); - wi.setOperationId(operationId); - wi.setScene(scene); - wi.setUuid(uuid); - - assertEquals(data, wi.getData()); - assertEquals(description, wi.getDescription()); - assertEquals(id, wi.getId()); - assertEquals(name, wi.getName()); - assertEquals(operationId, wi.getOperationId()); - assertEquals(scene, wi.getScene()); - assertEquals(uuid, wi.getUuid()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtilsTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtilsTest.java deleted file mode 100644 index 0abddfff..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtilsTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.utils; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.StringBufferInputStream; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class FileCommonUtilsTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#readLines(java.io.InputStream)}. - */ - @Test - public void testReadLines() { - String fileName = "src/test/resources/workflow/template-test.bpmn20.xml"; - File file = new File(fileName); - FileInputStream ins = null; - try { - ins = new FileInputStream(file); - String[] ss = FileCommonUtils.readLines(ins); - assertEquals(false, ss.length == 0); - - FileCommonUtils.write("template-test.bpmn20.xml", ss); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } finally { - FileCommonUtils.closeInputStream(ins); - } - - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#readString(java.io.InputStream)}. - */ - @Test - public void testReadStringInputStream() { - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#readString(java.lang.String)}. - */ - @Test - public void testReadStringString() { - String fileName = "src/test/resources/workflow/template-test.bpmn20.xml"; - File file = new File(fileName); - if (file.exists()) { - try { - String s = FileCommonUtils.readString(fileName); - FileCommonUtils.write("test.xml", s); - assertEquals(s.isEmpty(), false); - } catch (IOException e) { - } - } - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#saveFile(java.io.InputStream, java.lang.String, java.lang.String)}. - */ - @Test - public void testSaveFile() { - String fileName = "test3.json"; - String content = "{\"aaa\": \"节点\"}"; - StringBufferInputStream ins = null; - try { - ins = new StringBufferInputStream(content); - FileCommonUtils.saveFile(ins, ".", fileName); - } catch (IOException e) { - e.printStackTrace(); - FileCommonUtils.closeInputStream(ins); - } - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#writetoAbsoluteFile(java.lang.String, java.lang.String, java.lang.String)}. - */ - @Test - public void testWritetoAbsoluteFileStringStringString() { - String fileName = "test1.json"; - String content = "{\"aaa\": \"节点\"}"; - - try { - FileCommonUtils.writetoAbsoluteFile(".", fileName, content); - String s = FileCommonUtils.readString(fileName); - assertEquals(s, content); - } catch (IOException e) { - } - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#writetoAbsoluteFile(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}. - */ - @Test - public void testWritetoAbsoluteFileStringStringStringString() { - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#write(java.lang.String, java.lang.String)}. - */ - @Test - public void testWriteStringString() { - String fileName = "test.json"; - String content = "{\"aaa\": \"节点\"}"; - - try { - FileCommonUtils.write(fileName, content); - String s = FileCommonUtils.readString(fileName); - assertEquals(s, content); - } catch (IOException e) { - } - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#write(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}. - */ - @Test - public void testWriteStringStringStringString() { - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#write(java.lang.String, java.lang.String, java.lang.String)}. - */ - @Test - public void testWriteStringStringString() { - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#write(java.lang.String, java.lang.String[])}. - */ - @Test - public void testWriteStringStringArray() { - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.FileCommonUtils#write(java.lang.String, java.lang.String[], java.lang.String)}. - */ - @Test - public void testWriteStringStringArrayString() { - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/JsonUtilsTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/JsonUtilsTest.java deleted file mode 100644 index c4b341fd..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/JsonUtilsTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.utils; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.onap.sdc.workflowdesigner.resources.entity.I18nString; - -/** - * - */ -public class JsonUtilsTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.JsonUtils#fromJson(java.lang.String, java.lang.Class)}. - */ - @Test - public void testFromJson() { - String i18n = "{\"en_US\":\"Service Task\",\"zh_CN\":\"Service Task\"}"; - I18nString i18nString = JsonUtils.fromJson(i18n, I18nString.class); - assertNotNull(i18nString); - } - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.JsonUtils#toJson(java.lang.Object)}. - */ - @Test - public void testToJson() { - I18nString i18nString = new I18nString("Service Task", "Service Task"); - String i18n = JsonUtils.toJson(i18nString); - String expect = "{\"en_US\":\"Service Task\",\"zh_CN\":\"Service Task\"}"; - assertEquals(expect, i18n); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponseTest.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponseTest.java deleted file mode 100644 index f6014cfd..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponseTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.utils.entity; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * - */ -public class CommonErrorResponseTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - /** - * Test method for {@link org.onap.sdc.workflowdesigner.utils.entity.CommonErrorResponse#failure(java.lang.String)}. - */ - @Test - public void testFailure() { - String code = "code"; - String message = "message"; - CommonErrorResponse errorResponse = new CommonErrorResponse(code); - errorResponse.setCode(code); - errorResponse.setMessage(message); - assertEquals(code, errorResponse.getCode()); - assertEquals(message, errorResponse.getMessage()); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/resources/workflow/template-test.bpmn20.xml b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/resources/workflow/template-test.bpmn20.xml deleted file mode 100644 index de2dee8d..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/resources/workflow/template-test.bpmn20.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/resources/workflow/workflow.json b/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/resources/workflow/workflow.json deleted file mode 100644 index 554e663f..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/test/resources/workflow/workflow.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id":"id12345", - "name":"test", - "scene":"abcd", - "data":{ - "nodes":[ - { - "id":"scriptTask", - "type":"scriptTask", - "typeId":"apds_script", - "icon":"apds_script", - "name":"Script Task", - "parentId":"root", - "position":{ - "left":328, - "top":134, - "width":56, - "height":56 - }, - "connection":[ - - ], - "scriptFormat":"JavaScript", - "script":"" - } - ] - } -} \ No newline at end of file -- cgit 1.2.3-korg