Changeset 5761 for branches/OKBJavaConnector/src/test/java/at
- Timestamp:
- 03/19/11 09:37:18 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKBJavaConnector/src/test/java/at/hl/okb/wsclient/OKBClientTest.java
r5673 r5761 9 9 import org.junit.Test; 10 10 11 import at.hl.okb.wsclient.Exception.OKBWebServiceFailedException; 12 import at.hl.wsclient.okb.AddAlgorithm; 13 import at.hl.wsclient.okb.Algorithm; 14 import at.hl.wsclient.okb.ArrayOfAlgorithm; 15 import at.hl.wsclient.okb.ArrayOfDataType; 16 import at.hl.wsclient.okb.DataType; 17 import at.hl.wsclient.okb.IOKBService; 18 import at.hl.wsclient.okb.OKBService; 19 import at.hl.wsclient.okb.ObjectFactory; 20 import at.hl.wsclient.okb.Platform; 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 21 16 22 17 /** … … 26 21 public class OKBClientTest { 27 22 28 OKBService srv = null; 29 IOKBService port = null; 23 24 AdministrationService srv = null; 25 IAdministrationService port = null; 30 26 31 27 /** … … 48 44 @Before 49 45 public void setUp() throws Exception { 50 this.srv = new OKBService(); 51 this.port = srv.getWSHttpBindingIOKBService1(); 46 this.srv = new AdministrationService(); 47 this.port = srv.getJavaAdministrationService(); //.getWSHttpBindingIAdministrationService1(); 48 52 49 } 53 50 … … 58 55 public void tearDown() throws Exception { 59 56 } 60 61 @Test62 public void AddAlgorithmTest() throws Exception {63 64 ObjectFactory fac = new ObjectFactory();65 AddAlgorithm addA = fac.createAddAlgorithm();66 addA.setDto(fac.createAddAlgorithmDto(fac.createAlgorithm()));67 Long retval = 0L;68 69 // if (port.getAlgorithm(2L)!=null)70 // port.deleteAlgorithm(2L);71 72 73 Algorithm a = fac.createAlgorithm();74 a.setAlgorithmClassId(1L);75 a.setDescription(fac.createNamedOKBItemDescription("a new Algo"));76 a.setId(2L);77 a.setName(fac.createNamedOKBItemName("Algorithm Name 6"));78 a.setPlatformId(1L);79 try {80 retval = port.addAlgorithm(a);81 } catch (Exception e) {82 throw new OKBWebServiceFailedException(e.getMessage());83 }84 assertTrue("Algortihm wasn't added", retval > 0);85 }86 57 58 // @Test 59 // public void AddAlgorithmTest() throws Exception { 60 // 61 // ObjectFactory fac = new ObjectFactory(); 62 // AddAlgorithm addA = fac.createAddAlgorithm(); 63 // addA.setDto(fac.createAddAlgorithmDto(fac.createAlgorithm())); 64 // Long retval = 0L; 65 // 66 //// if (port.getAlgorithm(2L)!=null) 67 //// port.deleteAlgorithm(2L); 68 // 69 // 70 // Algorithm a = fac.createAlgorithm(); 71 // a.setAlgorithmClassId(1L); 72 // a.setDescription(fac.createNamedOKBItemDescription("a new Algo")); 73 // a.setId(2L); 74 // a.setName(fac.createNamedOKBItemName("Algorithm Name 6")); 75 // a.setPlatformId(1L); 76 // try { 77 // retval = port.addAlgorithm(a); 78 // } catch (Exception e) { 79 // throw new OKBWebServiceFailedException(e.getMessage()); 80 // } 81 // assertTrue("Algortihm wasn't added", retval > 0); 82 // } 83 // 87 84 @Test 88 85 public void GetAlgorithmsTest() { … … 101 98 assertTrue("No Algorithms found!", algos.getAlgorithm().size() > 0); 102 99 } 103 104 @Test105 public void GetDataTypesTest() {106 107 ArrayOfDataType dataTypes = port.getDataTypes();108 109 for (DataType dataType : dataTypes.getDataType()) {110 System.out.println("algo Id:=" + dataType.getId());111 System.out.println("algo platformId:=" + dataType.getPlatformId());112 System.out.println("algo Name:=" + dataType.getName());113 System.out.println("algo Class:=" + dataType.getClass());114 System.out.println("algo SQLName:="115 + dataType.getSqlName().getValue());116 }117 assertTrue("No dataTypes found!", dataTypes.getDataType().size() > 0);118 }119 120 @Test121 public void GetPlatFormTest() {122 Platform f = port.getPlatform(1L);123 assertTrue(f.getName().getValue().length() > 0);124 }125 126 OKBServiceClient client = new OKBServiceClient();127 128 @Test129 public void testGetPlatform() {130 client.getPlatformId("ECJ");131 }100 // 101 // @Test 102 // public void GetDataTypesTest() { 103 // 104 // ArrayOfDataType dataTypes = port.getDataTypes(); 105 // 106 // for (DataType dataType : dataTypes.getDataType()) { 107 // System.out.println("algo Id:=" + dataType.getId()); 108 // System.out.println("algo platformId:=" + dataType.getPlatformId()); 109 // System.out.println("algo Name:=" + dataType.getName()); 110 // System.out.println("algo Class:=" + dataType.getClass()); 111 // System.out.println("algo SQLName:=" 112 // + dataType.getSqlName().getValue()); 113 // } 114 // assertTrue("No dataTypes found!", dataTypes.getDataType().size() > 0); 115 // } 116 // 117 // @Test 118 // public void GetPlatFormTest() { 119 // Platform f = port.getPlatform(1L); 120 // assertTrue(f.getName().getValue().length() > 0); 121 // } 122 // 123 // AdministrationServiceClient client = new AdministrationServiceClient(); 124 // 125 // @Test 126 // public void testGetPlatform() { 127 // client.getPlatformId("ECJ"); 128 // } 132 129 133 130
Note: See TracChangeset
for help on using the changeset viewer.