01: package com.xoetrope.service.test;
02:
03: import net.xoetrope.debug.DebugLogger;
04: import net.xoetrope.optional.data.sql.ConnectionManager;
05: import net.xoetrope.optional.data.sql.DatabaseTableModel;
06:
07: /**
08: * Test the unreliable service servelt to see that it returns the expected errors
09: * <p>Copyright (c) Xoetrope Ltd. 2001-2004</p>
10: * $Revision: 1.1 $
11: */
12: public class XReplicationServiceTest extends XServiceTest {
13: public XReplicationServiceTest() {
14: super ();
15: defaultURLStr = "http://localhost:8080/xserviceservlet";
16: ConnectionManager.getInstance().reset("org.hsqldb.jdbcDriver",
17: "jdbc:hsqldb:hsql://localhost", "sa", "");
18: }
19:
20: public void testServer() {
21: DatabaseTableModel tableModel = null;
22: try {
23: tableModel = new DatabaseTableModel();
24: tableModel.setupTable("CS_FROZEN_GOODS_OLD", null, null,
25: true);
26: tableModel.retrieve();
27: DebugLogger.trace(tableModel);
28: // Now it should succeed
29: String value1 = tableModel.getFieldValue(1);
30: assertTrue(value1.compareTo("Fruit") == 0);
31: tableModel.next();
32: tableModel.setFieldValue(1, "New Data");
33: } catch (Exception e) {
34: DebugLogger.trace(tableModel);
35: e.printStackTrace();
36: assertTrue(false);
37: }
38: }
39: }
|