Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/11 09:37:18 (14 years ago)
Author:
mholper
Message:

first Unit-Test build against new AdministrationService #1441

File:
1 edited

Legend:

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

    r5673 r5761  
    99import org.junit.Test;
    1010
    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;
     11import com.heuristiclab.okb.wsclient.admin.AdministrationService;
     12import com.heuristiclab.okb.wsclient.admin.Algorithm;
     13import com.heuristiclab.okb.wsclient.admin.ArrayOfAlgorithm;
     14import com.heuristiclab.okb.wsclient.admin.IAdministrationService;
     15
    2116
    2217/**
     
    2621public class OKBClientTest {
    2722
    28   OKBService srv = null;
    29   IOKBService port = null;
     23 
     24  AdministrationService srv = null;
     25  IAdministrationService port = null;
    3026
    3127  /**
     
    4844  @Before
    4945  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   
    5249  }
    5350
     
    5855  public void tearDown() throws Exception {
    5956  }
    60 
    61   @Test
    62   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//
    8784  @Test
    8885  public void GetAlgorithmsTest() {
     
    10198    assertTrue("No Algorithms found!", algos.getAlgorithm().size() > 0);
    10299  }
    103 
    104   @Test
    105   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   @Test
    121   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   @Test
    129   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//  }
    132129 
    133130 
Note: See TracChangeset for help on using the changeset viewer.