diff options
author | YuanHu <yuan.hu1@zte.com.cn> | 2018-03-28 09:02:58 +0800 |
---|---|---|
committer | YuanHu <yuan.hu1@zte.com.cn> | 2018-03-28 09:02:58 +0800 |
commit | 4fd794f4f23237fbc18e4d5319d639d85b21aacb (patch) | |
tree | 8c82dcaa981268d42f590420a86677b12cffda7f /sdc-workflow-designer-server/src/test | |
parent | 0e813dd358952d25d49de4833d09964dba5e42a0 (diff) |
Add Unit Test & Remove redundant code
Add Unit Test & Remove redundant code
Issue-ID: SDC-1078
Change-Id: I83ee83f3265386373749463c43dced047d4aa407
Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server/src/test')
3 files changed, 111 insertions, 40 deletions
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfoTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfoTest.java new file mode 100644 index 00000000..6ae8ffa1 --- /dev/null +++ b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfoTest.java @@ -0,0 +1,54 @@ +/**
+ * 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.*;
+
+import org.hibernate.validator.constraints.NotEmpty;
+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/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfigurationTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfigurationTest.java new file mode 100644 index 00000000..12e18531 --- /dev/null +++ b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfigurationTest.java @@ -0,0 +1,57 @@ +/**
+ * 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.*;
+
+import javax.validation.constraints.NotNull;
+
+import org.hibernate.validator.constraints.NotEmpty;
+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/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/convert/BPMN4Tosca2BpmnTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/convert/BPMN4Tosca2BpmnTest.java deleted file mode 100644 index 83b52dfd..00000000 --- a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/convert/BPMN4Tosca2BpmnTest.java +++ /dev/null @@ -1,40 +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.convert;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URI;
-import java.nio.file.Paths;
-
-import org.apache.velocity.exception.ParseErrorException;
-import org.apache.velocity.exception.ResourceNotFoundException;
-import org.junit.Test;
-import org.onap.sdc.workflowdesigner.converter.Bpmn4Tosca2Bpmn;
-
-public class BPMN4Tosca2BpmnTest {
- private static String RESOURCES_DIR = "src/test/resources/workflow";
-
- @Test
- public void testTransform() throws ResourceNotFoundException, ParseErrorException, Exception {
-
- URI srcUri = Paths.get(RESOURCES_DIR, "workflow.json").toUri();
- URI targetUri = Paths.get(RESOURCES_DIR, "bpmnworkflow.bpmn20.xml").toUri();
- BPMN4Tosca2BpmnTest.class.getResource(".");
- Bpmn4Tosca2Bpmn transformer = new Bpmn4Tosca2Bpmn();
-// transformer.transform("transformTest", srcUri, targetUri);
-// assertTrue(new File(targetUri.getPath()).exists());
- // TODO for Nexus-IQ
- }
-
-}
|