xmlBlaster 2.2.0 API

org.xmlBlaster.test.contrib.dbwatcher
Class TestTimestamp

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.custommonkey.xmlunit.XMLTestCase
              extended by org.xmlBlaster.test.contrib.dbwatcher.TestTimestamp
All Implemented Interfaces:
junit.framework.Test, org.custommonkey.xmlunit.XMLConstants, org.custommonkey.xmlunit.XSLTConstants

public class TestTimestamp
extends org.custommonkey.xmlunit.XMLTestCase

Test basic functionality.

To run most of the tests you need to have a databse (for example Oracle) and XmlBlaster up and running.

The connection configuration (url, password etc.) is configured as JVM property or in TestResultSetToXmlConverter.createTest(I_Info, Map) and TestResultSetToXmlConverter.setUpDbPool(I_Info)

Author:
Marcel Ruff
See Also:
DbWatcher

Field Summary
private  I_DbPool dbPool
           
private  I_Info info
           
private static java.util.logging.Logger log
           
private  java.util.prefs.Preferences prefs
           
private  DbWatcher processor
           
private  java.util.Map updateMap
           
 
Fields inherited from interface org.custommonkey.xmlunit.XSLTConstants
XSLT_END, XSLT_IDENTITY_TEMPLATE, XSLT_START, XSLT_STRIP_WHITESPACE, XSLT_XML_OUTPUT_NOINDENT
 
Fields inherited from interface org.custommonkey.xmlunit.XMLConstants
CLOSE_NODE, END_CDATA, END_COMMENT, END_PROCESSING_INSTRUCTION, OPEN_END_NODE, OPEN_START_NODE, START_CDATA, START_COMMENT, START_DOCTYPE, START_PROCESSING_INSTRUCTION, XML_DECLARATION, XMLNS_PREFIX, XPATH_ATTRIBUTE_IDENTIFIER, XPATH_CHARACTER_NODE_IDENTIFIER, XPATH_COMMENT_IDENTIFIER, XPATH_NODE_INDEX_END, XPATH_NODE_INDEX_START, XPATH_PROCESSING_INSTRUCTION_IDENTIFIER, XPATH_SEPARATOR
 
Constructor Summary
TestTimestamp()
          Default ctor.
TestTimestamp(java.lang.String arg0)
          Constructor for TestResultSetToXmlConverter.
 
Method Summary
private  DbWatcher createTest(I_Info info, java.util.Map updateMap)
          Creates a DbWatcher instance and listens on MoM messages.
static void main(java.lang.String[] args)
          Start the test.
protected  void setUp()
          Configure database access.
private  void sleep(long millis)
           
protected  void tearDown()
           
 void testEmptyTableStates()
          Check detection of changes on a table and deliver the change as pure event without XML dump.
 void testQueryMeatTableStates()
          Check detection of changes on a table and deliver the change as XML.
 void testReplaceDate()
          Checks if the conversion of the special token ${currentDate} is correct
static void writeToFile(java.lang.String topic, java.lang.String xml)
          Dump to file.
 
Methods inherited from class org.custommonkey.xmlunit.XMLTestCase
assertNodeTestPasses, assertNodeTestPasses, assertNotXpathExists, assertNotXpathExists, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLEqual, assertXMLIdentical, assertXMLIdentical, assertXMLIdentical, assertXMLNotEqual, assertXMLNotEqual, assertXMLNotEqual, assertXMLNotEqual, assertXMLNotEqual, assertXMLNotEqual, assertXMLValid, assertXMLValid, assertXMLValid, assertXMLValid, assertXpathEvaluatesTo, assertXpathEvaluatesTo, assertXpathExists, assertXpathExists, assertXpathNotExists, assertXpathNotExists, assertXpathsEqual, assertXpathsEqual, assertXpathsEqual, assertXpathsEqual, assertXpathsNotEqual, assertXpathsNotEqual, assertXpathsNotEqual, assertXpathsNotEqual, assertXpathValuesEqual, assertXpathValuesEqual, assertXpathValuesEqual, assertXpathValuesEqual, assertXpathValuesNotEqual, assertXpathValuesNotEqual, assertXpathValuesNotEqual, assertXpathValuesNotEqual, compareXML, compareXML, compareXML, compareXML, compareXML, setControlParser, setIgnoreWhitespace, setTestParser
 
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

log

private static java.util.logging.Logger log

prefs

private java.util.prefs.Preferences prefs

info

private I_Info info

dbPool

private I_DbPool dbPool

updateMap

private java.util.Map updateMap

processor

private DbWatcher processor
Constructor Detail

TestTimestamp

public TestTimestamp()
Default ctor.


TestTimestamp

public TestTimestamp(java.lang.String arg0)
Constructor for TestResultSetToXmlConverter.

Parameters:
arg0 -
Method Detail

main

public static void main(java.lang.String[] args)
Start the test.
 java -Ddb.password=secret junit.swingui.TestRunner -noloading org.xmlBlaster.test.contrib.dbwatcher.TestTimestamp
 

Parameters:
args - Command line settings

setUp

protected void setUp()
              throws java.lang.Exception
Configure database access.

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception
See Also:
TestCase.setUp()

createTest

private DbWatcher createTest(I_Info info,
                             java.util.Map updateMap)
                      throws java.lang.Exception
Creates a DbWatcher instance and listens on MoM messages.

Throws:
java.lang.Exception
See Also:
TestResultSetToXmlConverter.createTest(I_Info, Map)

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

sleep

private void sleep(long millis)

testEmptyTableStates

public final void testEmptyTableStates()
                                throws java.lang.Exception
Check detection of changes on a table and deliver the change as pure event without XML dump.

Throws:
java.lang.Exception - Any type is possible

testReplaceDate

public final void testReplaceDate()
                           throws java.lang.Exception
Checks if the conversion of the special token ${currentDate} is correct

Throws:
java.lang.Exception

testQueryMeatTableStates

public final void testQueryMeatTableStates()
                                    throws java.lang.Exception
Check detection of changes on a table and deliver the change as XML.

Throws:
java.lang.Exception - Any type is possible

writeToFile

public static void writeToFile(java.lang.String topic,
                               java.lang.String xml)
                        throws java.lang.Exception
Dump to file.

Parameters:
topic - The file name body
xml - The file content
Throws:
java.lang.Exception - IOException

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.