Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/07/11 00:39:31 (14 years ago)
Author:
bfarka
Message:

restructure of service project #1218

Location:
branches/OKBJavaConnector/HLOKBWebClient/src/test
Files:
6 added
1 deleted
1 edited

Legend:

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

    r5084 r5229  
    1212import org.junit.Test;
    1313
     14import at.hl.okb.wsclient.OKBServiceClient;
    1415import at.hl.okb.wsclient.Exception.OKBWebServiceFailedException;
    1516
     
    2021public class OKBClientTest {
    2122 
    22   OKBService srv = null;
    23   IOKBService port = null; 
    24 
    25   /**
    26    * @throws java.lang.Exception
    27    */
    28   @BeforeClass
    29   public static void setUpBeforeClass() throws Exception {
    30   }
    31 
    32   /**
    33    * @throws java.lang.Exception
    34    */
    35   @AfterClass
    36   public static void tearDownAfterClass() throws Exception {
    37   }
    38 
    39   /**
    40    * @throws java.lang.Exception
    41    */
    42   @Before
    43   public void setUp() throws Exception {
    44     this.srv = new OKBService();
    45     this.port = srv.getWSHttpBindingIOKBService1();
    46   }
    47 
    48   /**
    49    * @throws java.lang.Exception
    50    */
    51   @After
    52   public void tearDown() throws Exception {
    53   }
    54  
     23   
     24      OKBServiceClient client = new OKBServiceClient();
    5525  @Test
    56   public void AddAlgorithmTest() throws Exception  {
    57    
    58         ObjectFactory fac = new ObjectFactory();
    59         AddAlgorithm addA = fac.createAddAlgorithm();
    60         addA.setDto(fac.createAddAlgorithmDto(fac.createAlgorithm()));
    61         Long retval = 0L;
    62 
    63         Algorithm a = fac.createAlgorithm();
    64         a.setAlgorithmClassId(1L);
    65         a.setDescription(fac.createNamedOKBItemDescription("a new Algo"));
    66         a.setId(2L);
    67         a.setName(fac.createNamedOKBItemName("Algorithm Name 6"));
    68         a.setPlatformId(1L);
    69         try {
    70         retval = port.addAlgorithm(a);
    71         } catch (Exception e) {
    72           throw new OKBWebServiceFailedException(e.getMessage());
    73         }
    74         assertTrue("Algortihm wasn't added", retval>0);
    75   }
    76  
    77   @Test
    78   public void GetAlgorithms() {
    79    
    80     ArrayOfAlgorithm algos = port.getAlgorithms();
    81    
    82     for (Algorithm algo:algos.getAlgorithm()) {
    83       System.out.println("algo ClassId:="+algo.getAlgorithmClassId());
    84       System.out.println("algo Id:="+algo.getId());
    85       System.out.println("algo PlattformId:="+algo.getPlatformId());
    86       System.out.println("algo Class:="+algo.getClass());
    87       System.out.println("algo Description:="+algo.getDescription().getValue());
    88       System.out.println("algo Name:="+algo.getName().getValue());
    89     }
    90     assertTrue("No Algorithms found!", algos.getAlgorithm().size()>0);
    91   }
    92  
    93   @Test
    94   public void GetDataTypes() {
    95    
    96     ArrayOfDataType dataTypes = port.getDataTypes();
    97    
    98     for (DataType dataType:dataTypes.getDataType()) {
    99       System.out.println("algo Id:="+dataType.getId());
    100       System.out.println("algo platformId:="+dataType.getPlatformId());
    101       System.out.println("algo Name:="+dataType.getName());
    102       System.out.println("algo Class:="+dataType.getClass());
    103       System.out.println("algo SQLName:="+dataType.getSqlName().getValue());
    104     }
    105     assertTrue("No dataTypes found!", dataTypes.getDataType().size()>0);
    106   }
    107  
    108  
    109  
    110   @Test
    111   public void GetIds(){
    112    
     26      public void testGetPlatform()
     27  {
     28      client.getPlatformId("ECJ");
    11329  }
    11430
Note: See TracChangeset for help on using the changeset viewer.