xmlBlaster 2.0.0 API

org.xmlBlaster.test.jdbc
Class TestJdbcAccess

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xmlBlaster.test.jdbc.TestJdbcAccess
All Implemented Interfaces:
junit.framework.Test

public class TestJdbcAccess
extends junit.framework.TestCase

This client tests the JDBC plugin framework with get() invocations.

We start our own xmlBlaster server in a thread. This client may be invoked multiple time on the same xmlBlaster server, as it cleans up everything after his tests are done.

Invoke examples:

    java junit.textui.TestRunner org.xmlBlaster.test.jdbc.TestJdbcAccess
    java junit.swingui.TestRunner -noloading org.xmlBlaster.test.jdbc.TestJdbcAccess
 


Field Summary
private  I_XmlBlasterAccess con
           
private  Global glob
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private  java.lang.String name
           
private  java.lang.String passwd
           
private  int serverPort
           
private  EmbeddedXmlBlaster serverThread
           
private  XmlDbMessageWrapper wrap
           
 
Constructor Summary
TestJdbcAccess(java.lang.String testName)
          Constructs the TestJdbcAccess object.
 
Method Summary
private  java.lang.String invokeSyncQuery(XmlDbMessageWrapper wrap, int numResultRowsExpected, java.lang.String token)
          get() blocks until the SQL query is finished ...
static void main(java.lang.String[] args)
          Deprecated. Use the TestRunner from the testsuite to run it
protected  void setUp()
          Sets up the fixture.
protected  void tearDown()
          Tears down the fixture.
 void testQueries()
          Create a RDBMS table, fill some data and destroy it again.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ME

private static java.lang.String ME

glob

private final Global glob

log

private static java.util.logging.Logger log

con

private I_XmlBlasterAccess con

name

private java.lang.String name

passwd

private java.lang.String passwd

serverThread

private EmbeddedXmlBlaster serverThread

serverPort

private int serverPort

wrap

private XmlDbMessageWrapper wrap
Constructor Detail

TestJdbcAccess

public TestJdbcAccess(java.lang.String testName)
Constructs the TestJdbcAccess object.

Parameters:
testName - The name used in the test suite
Method Detail

setUp

protected void setUp()
Sets up the fixture.

We start an own xmlBlaster server in a separate thread, it is configured to load the tinySQL JDBC driver to test SQL access (with dBase files)

Then we connect as a client

Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
Tears down the fixture.

cleaning up .... erase() the previous message OID and logout

Overrides:
tearDown in class junit.framework.TestCase

testQueries

public void testQueries()
Create a RDBMS table, fill some data and destroy it again. We use the tinySQL dBase JDBC driver for testing.


invokeSyncQuery

private java.lang.String invokeSyncQuery(XmlDbMessageWrapper wrap,
                                         int numResultRowsExpected,
                                         java.lang.String token)
get() blocks until the SQL query is finished ...


main

public static void main(java.lang.String[] args)
Deprecated. Use the TestRunner from the testsuite to run it

Invoke: java org.xmlBlaster.test.jdbc.TestJdbcAccess


xmlBlaster 2.0.0 API

Copyright © 1999-2010 The xmlBlaster.org contributers.