|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.custommonkey.xmlunit.XMLTestCase org.xmlBlaster.test.contrib.replication.TestDbSpecific
public class TestDbSpecific
Test basic functionality which is specific for each database implementation. There is a predefined set of default properties which are specific to the database you use. For instance if you want to use the predefined settings for oracle use:
java -Ddb=oracle ..... or if you want to use postgres: java -Ddb=postgres
The connection configuration (url, password etc.) is configured
as JVM property or in #createTest(I_Info, Map)
and
setUpDbPool(I_Info)
Field Summary | |
---|---|
private static boolean |
checked
|
private static java.lang.String |
currentMethod
|
private DbMetaHelper |
dbHelper
|
private static I_DbPool |
dbPool
|
private static I_DbSpecific |
dbSpecific
|
private static boolean |
doCheck
|
private static I_Info |
info
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
replPrefix
|
private static SpecificHelper |
specificHelper
|
private java.lang.String |
tableName
|
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 | |
---|---|
TestDbSpecific()
Default ctor. |
|
TestDbSpecific(java.lang.String arg0)
Constructor for TestDbSpecific. |
Method Summary | |
---|---|
XBSession |
getJmsSession()
Only used in replication, can return null if not used. |
java.util.Set |
getUsedPropertyKeys()
Gets all property keys which may be used by this object. |
void |
init(I_Info info)
After creation this method is called. |
static void |
main(java.lang.String[] args)
Start the test. |
java.lang.String |
publish(java.lang.String changeKey,
byte[] message,
java.util.Map attrMap)
This method gets invoked when a change is detected. |
boolean |
registerAlertListener(I_Update momCb,
java.util.Map attrs)
Register for alerts when the data source has changed. |
protected void |
setUp()
Configure database access. |
private DbPool |
setUpDbPool(I_Info info)
Creates a database pooling instance and puts it to info. |
private I_DbSpecific |
setUpDbSpecific(I_Info info,
java.lang.String dbSpecificName)
Creates an I_DbSpecific object. |
void |
shutdown()
Cleanup resources. |
protected void |
tearDown()
|
void |
testCheckSequenceForCreation()
This method tests all the sql statements. |
void |
testCheckTableForCreation()
This method tests all the sql statements. |
void |
testCreateTablesWithDifferentTypes()
This method tests all the sql statements. |
void |
testGetObjectName()
|
void |
testSchemaWipeout()
|
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 |
---|
private static java.util.logging.Logger log
private static I_Info info
private static I_DbPool dbPool
private static I_DbSpecific dbSpecific
private static java.lang.String currentMethod
private static boolean doCheck
private static boolean checked
private DbMetaHelper dbHelper
private static SpecificHelper specificHelper
private java.lang.String replPrefix
private java.lang.String tableName
Constructor Detail |
---|
public TestDbSpecific()
public TestDbSpecific(java.lang.String arg0)
arg0
- Method Detail |
---|
public static void main(java.lang.String[] args)
java -Ddb=oracle junit.swingui.TestRunner -noloading org.xmlBlaster.test.contrib.replication.TestDbSpecific
args
- Command line settingsprotected void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
TestCase#setUp()
public java.util.Set getUsedPropertyKeys()
I_ContribPlugin
getUsedPropertyKeys
in interface I_ContribPlugin
I_ContribPlugin.getUsedPropertyKeys()
public void init(I_Info info) throws java.lang.Exception
I_ChangePublisher
init
in interface I_ChangePublisher
init
in interface I_ContribPlugin
info
- The configuration environment
java.lang.Exception
- MoM specificpublic java.lang.String publish(java.lang.String changeKey, byte[] message, java.util.Map attrMap) throws java.lang.Exception
publish
in interface I_ChangePublisher
changeKey
- Can be used to create the topic namemessage
- The message content to sendattrMap
- An optional map with attributes or null
java.lang.Exception
- On sending problemspublic boolean registerAlertListener(I_Update momCb, java.util.Map attrs) throws java.lang.Exception
I_ChangePublisher
This funtionality is plugin depending, for example the xmlBlaster plugin has a configuration option to subscribe on a alert topic and listens if somebody publishes a message to it. If such a message arrives we trigger a new database poll.
registerAlertListener
in interface I_ChangePublisher
momCb
- The callback interface to receive the notificationattrs
- extra parameters to pass for the registration. For example
if one implementation wants to do a specific extra subscription it would
pass the quality of service in the attributes.
java.lang.Exception
- The MoM specific exceptionpublic void shutdown()
I_ChangePublisher
Can be called multiple times if instance is reused from different plugins.
shutdown
in interface I_ChangePublisher
shutdown
in interface I_ContribPlugin
I_Plugin
private DbPool setUpDbPool(I_Info info)
info
- The configuration
private I_DbSpecific setUpDbSpecific(I_Info info, java.lang.String dbSpecificName)
info
- The configuration.dbSpecificName
- the name of the class to instantiate. If null, a default is taken.
protected void tearDown() throws java.lang.Exception
tearDown
in class junit.framework.TestCase
java.lang.Exception
public final void testCreateTablesWithDifferentTypes() throws java.lang.Exception
java.lang.Exception
- Any type is possiblepublic final void testGetObjectName() throws java.lang.Exception
java.lang.Exception
- Any type is possiblepublic final void testCheckTableForCreation() throws java.lang.Exception
java.lang.Exception
- Any type is possiblepublic final void testCheckSequenceForCreation() throws java.lang.Exception
java.lang.Exception
- Any type is possiblepublic final void testSchemaWipeout() throws java.lang.Exception
java.lang.Exception
public XBSession getJmsSession()
I_ChangePublisher
getJmsSession
in interface I_ChangePublisher
I_ChangePublisher.getJmsSession()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |