1 | package at.hl.okb.wsclient;
|
---|
2 |
|
---|
3 | import static org.junit.Assert.assertTrue;
|
---|
4 |
|
---|
5 | import org.junit.After;
|
---|
6 | import org.junit.AfterClass;
|
---|
7 | import org.junit.Before;
|
---|
8 | import org.junit.BeforeClass;
|
---|
9 | import org.junit.Test;
|
---|
10 |
|
---|
11 | import com.heuristiclab.okb.wsclient.admin.AdministrationService;
|
---|
12 | import com.heuristiclab.okb.wsclient.admin.Algorithm;
|
---|
13 | import com.heuristiclab.okb.wsclient.admin.ArrayOfAlgorithm;
|
---|
14 | import com.heuristiclab.okb.wsclient.admin.IAdministrationService;
|
---|
15 |
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * @author HolperM
|
---|
19 | *
|
---|
20 | */
|
---|
21 | public class OKBClientTest {
|
---|
22 |
|
---|
23 |
|
---|
24 | AdministrationService srv = null;
|
---|
25 | IAdministrationService port = null;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * @throws java.lang.Exception
|
---|
29 | */
|
---|
30 | @BeforeClass
|
---|
31 | public static void setUpBeforeClass() throws Exception {
|
---|
32 | }
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * @throws java.lang.Exception
|
---|
36 | */
|
---|
37 | @AfterClass
|
---|
38 | public static void tearDownAfterClass() throws Exception {
|
---|
39 | }
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * @throws java.lang.Exception
|
---|
43 | */
|
---|
44 | @Before
|
---|
45 | public void setUp() throws Exception {
|
---|
46 | this.srv = new AdministrationService();
|
---|
47 | this.port = srv.getJavaAdministrationService(); //.getWSHttpBindingIAdministrationService1();
|
---|
48 | }
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * @throws java.lang.Exception
|
---|
52 | */
|
---|
53 | @After
|
---|
54 | public void tearDown() throws Exception {
|
---|
55 | }
|
---|
56 |
|
---|
57 | // @Test
|
---|
58 | // public void AddAlgorithmTest() throws Exception {
|
---|
59 | //
|
---|
60 | // ObjectFactory fac = new ObjectFactory();
|
---|
61 | // AddAlgorithm addA = fac.createAddAlgorithm();
|
---|
62 | // addA.setDto(fac.createAddAlgorithmDto(fac.createAlgorithm()));
|
---|
63 | // Long retval = 0L;
|
---|
64 | //
|
---|
65 | //// if (port.getAlgorithm(2L)!=null)
|
---|
66 | //// port.deleteAlgorithm(2L);
|
---|
67 | //
|
---|
68 | //
|
---|
69 | // Algorithm a = fac.createAlgorithm();
|
---|
70 | // a.setAlgorithmClassId(1L);
|
---|
71 | // a.setDescription(fac.createNamedOKBItemDescription("a new Algo"));
|
---|
72 | // a.setId(2L);
|
---|
73 | // a.setName(fac.createNamedOKBItemName("Algorithm Name 6"));
|
---|
74 | // a.setPlatformId(1L);
|
---|
75 | // try {
|
---|
76 | // retval = port.addAlgorithm(a);
|
---|
77 | // } catch (Exception e) {
|
---|
78 | // throw new OKBWebServiceFailedException(e.getMessage());
|
---|
79 | // }
|
---|
80 | // assertTrue("Algortihm wasn't added", retval > 0);
|
---|
81 | // }
|
---|
82 | //
|
---|
83 | @Test
|
---|
84 | public void GetAlgorithmsTest() {
|
---|
85 |
|
---|
86 | ArrayOfAlgorithm algos = port.getAlgorithms();
|
---|
87 |
|
---|
88 | for (Algorithm algo : algos.getAlgorithm()) {
|
---|
89 | System.out.println("algo ClassId:=" + algo.getAlgorithmClassId());
|
---|
90 | System.out.println("algo Id:=" + algo.getId());
|
---|
91 | System.out.println("algo PlattformId:=" + algo.getPlatformId());
|
---|
92 | System.out.println("algo Class:=" + algo.getClass());
|
---|
93 | System.out.println("algo Description:="
|
---|
94 | + algo.getDescription().getValue());
|
---|
95 | System.out.println("algo Name:=" + algo.getName().getValue());
|
---|
96 | }
|
---|
97 | assertTrue("No Algorithms found!", algos.getAlgorithm().size() > 0);
|
---|
98 | }
|
---|
99 |
|
---|
100 |
|
---|
101 | //
|
---|
102 | // @Test
|
---|
103 | // public void GetDataTypesTest() {
|
---|
104 | //
|
---|
105 | // ArrayOfDataType dataTypes = port.getDataTypes();
|
---|
106 | //
|
---|
107 | // for (DataType dataType : dataTypes.getDataType()) {
|
---|
108 | // System.out.println("algo Id:=" + dataType.getId());
|
---|
109 | // System.out.println("algo platformId:=" + dataType.getPlatformId());
|
---|
110 | // System.out.println("algo Name:=" + dataType.getName());
|
---|
111 | // System.out.println("algo Class:=" + dataType.getClass());
|
---|
112 | // System.out.println("algo SQLName:="
|
---|
113 | // + dataType.getSqlName().getValue());
|
---|
114 | // }
|
---|
115 | // assertTrue("No dataTypes found!", dataTypes.getDataType().size() > 0);
|
---|
116 | // }
|
---|
117 | //
|
---|
118 | // @Test
|
---|
119 | // public void GetPlatFormTest() {
|
---|
120 | // Platform f = port.getPlatform(1L);
|
---|
121 | // assertTrue(f.getName().getValue().length() > 0);
|
---|
122 | // }
|
---|
123 | //
|
---|
124 | // AdministrationServiceClient client = new AdministrationServiceClient();
|
---|
125 | //
|
---|
126 | // @Test
|
---|
127 | // public void testGetPlatform() {
|
---|
128 | // client.getPlatformId("ECJ");
|
---|
129 | // }
|
---|
130 |
|
---|
131 |
|
---|
132 | }
|
---|