Changeset 5765 for branches/OKBJavaConnector/src/test/java/at
- Timestamp:
- 03/19/11 11:22:36 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKBJavaConnector/src/test/java/at/hl/okb/wsclient/OKBClientTest.java
r5762 r5765 9 9 import org.junit.Test; 10 10 11 import com.heuristiclab.okb.wsclient.Exception.OKBWebServiceFailedException; 11 12 import com.heuristiclab.okb.wsclient.admin.AdministrationService; 12 13 import com.heuristiclab.okb.wsclient.admin.Algorithm; 14 import com.heuristiclab.okb.wsclient.admin.AlgorithmClass; 13 15 import com.heuristiclab.okb.wsclient.admin.ArrayOfAlgorithm; 14 16 import com.heuristiclab.okb.wsclient.admin.IAdministrationService; 17 import com.heuristiclab.okb.wsclient.admin.ObjectFactory; 15 18 16 19 … … 55 58 } 56 59 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 // 60 //TODO: fix -->Problem deleting existing Algorithm 61 @Test 62 public void AddAlgorithmTest() throws Exception { 63 64 ObjectFactory fac = new ObjectFactory(); 65 Long retval = 0L; 66 67 //delete existing Algo and Class first 68 if (port.getAlgorithmClass(1000L)!=null) { 69 port.deleteAlgorithmClass(1000L); 70 } 71 if (port.getAlgorithm(1000L)!=null) { 72 port.deleteAlgorithm(1000L); 73 } 74 75 //add AlgorithmClassId first 76 AddAlgorithmClassTest(); 77 Algorithm a = fac.createAlgorithm(); 78 79 a.setAlgorithmClassId(1000L); 80 a.setDescription(fac.createNamedOKBItemDescription("a new Algo")); 81 a.setId(1000L); 82 a.setName(fac.createNamedOKBItemName("Algorithm Name 6")); 83 a.setPlatformId(1L); 84 try { 85 retval = port.addAlgorithm(a); 86 } catch (Exception e) { 87 throw new OKBWebServiceFailedException(e.getMessage()); 88 } 89 assertTrue("Algortihm wasn't added", retval > 0); 90 } 91 92 @Test 93 public void AddAlgorithmClassTest() throws Exception { 94 95 ObjectFactory fac = new ObjectFactory(); 96 Long retval = 0L; 97 98 //delete existing Algo first (if exists) 99 if (port.getAlgorithmClass(1000L)!=null) { 100 port.deleteAlgorithmClass(1000L); 101 } 102 103 AlgorithmClass a = fac.createAlgorithmClass(); 104 a.setId(1000L); 105 a.setName(fac.createNamedOKBItemName("a new AlgoClass")); 106 107 try { 108 retval = port.addAlgorithmClass(a); 109 } catch (Exception e) { 110 throw new OKBWebServiceFailedException(e.getMessage()); 111 } 112 assertTrue("AlgortihmClass wasn't added", retval > 0); 113 } 114 83 115 @Test 84 116 public void GetAlgorithmsTest() { 85 117 86 118 ArrayOfAlgorithm algos = port.getAlgorithms(); 87 119 88 120 for (Algorithm algo : algos.getAlgorithm()) { 89 121 System.out.println("algo ClassId:=" + algo.getAlgorithmClassId()); … … 97 129 assertTrue("No Algorithms found!", algos.getAlgorithm().size() > 0); 98 130 } 131 132 99 133 100 134
Note: See TracChangeset
for help on using the changeset viewer.