520061edee051531af52f1ce37de70d351f24dd4
[sdc/sdc-workflow-designer.git] /
1 /**
2  * Copyright (c) 2018 ZTE Corporation.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the Apache License, Version 2.0
5  * and the Eclipse Public License v1.0 which both accompany this distribution,
6  * and are available at http://www.eclipse.org/legal/epl-v10.html
7  * and http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Contributors:
10  *     ZTE - initial API and implementation and/or initial documentation
11  */
12
13 package org.onap.sdc.workflowdesigner.model;
14
15 import static org.junit.Assert.assertEquals;
16
17 import java.util.ArrayList;
18 import java.util.List;
19
20 import org.junit.After;
21 import org.junit.Before;
22 import org.junit.Test;
23 import org.onap.sdc.workflowdesigner.model.Element.TYPE;
24
25 /**
26  *
27  */
28 public class ElementTest {
29
30   /**
31    * @throws java.lang.Exception
32    */
33   @Before
34   public void setUp() throws Exception {}
35
36   /**
37    * @throws java.lang.Exception
38    */
39   @After
40   public void tearDown() throws Exception {}
41
42   /**
43    * Test method for {@link org.onap.sdc.workflowdesigner.model.Element#getType()}
44    * 
45    */
46   @Test
47   public final void getType() {
48     Element endEvent = new EndEvent();
49     System.out.println(endEvent.getType());
50     assertEquals(endEvent.getType(), null);
51   }
52   
53   
54   @Test
55   public void test() {
56     String id = "id";
57     String name = "name";
58     TYPE type = TYPE.endEvent;
59     String documentation = "documentation";
60     Position position = new Position();
61     List<String> connections= new ArrayList<>();
62     
63     Element e = new Element();
64     e.setConnections(connections);
65     e.setDocumentation(documentation);
66     e.setId(id);
67     e.setName(name);
68     e.setPosition(position);
69     e.setType(type);
70     
71     assertEquals(connections, e.getConnections());
72     assertEquals(documentation, e.getDocumentation());
73     assertEquals(id, e.getId());
74     assertEquals(name, e.getName());
75     assertEquals(position, e.getPosition());
76     assertEquals(type, e.getType());
77   }
78
79 }