Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/11 11:22:36 (14 years ago)
Author:
mholper
Message:

first call against AdminService working, WSIT-Files adapted (added TrustCallBackHandler) #1441

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OKBJavaConnector/src/test/java/at/hl/okb/wsclient/OKBClientTest.java

    r5762 r5765  
    99import org.junit.Test;
    1010
     11import com.heuristiclab.okb.wsclient.Exception.OKBWebServiceFailedException;
    1112import com.heuristiclab.okb.wsclient.admin.AdministrationService;
    1213import com.heuristiclab.okb.wsclient.admin.Algorithm;
     14import com.heuristiclab.okb.wsclient.admin.AlgorithmClass;
    1315import com.heuristiclab.okb.wsclient.admin.ArrayOfAlgorithm;
    1416import com.heuristiclab.okb.wsclient.admin.IAdministrationService;
     17import com.heuristiclab.okb.wsclient.admin.ObjectFactory;
    1518
    1619
     
    5558  }
    5659 
    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
    83115  @Test
    84116  public void GetAlgorithmsTest() {
    85117
    86118    ArrayOfAlgorithm algos = port.getAlgorithms();
    87 
     119   
    88120    for (Algorithm algo : algos.getAlgorithm()) {
    89121      System.out.println("algo ClassId:=" + algo.getAlgorithmClassId());
     
    97129    assertTrue("No Algorithms found!", algos.getAlgorithm().size() > 0);
    98130  }
     131 
     132 
    99133 
    100134 
Note: See TracChangeset for help on using the changeset viewer.