Doorgaan naar hoofdcontent

Posts

Er worden posts getoond met het label TDD

Automatic XQuery unit tests for OSB projects

Within the OSB 10.3 you use XQuery code to perform data transformations. These transformations can be very complex. I am in favor of TDD and i want to use automatic tests for XQueries. You can use the OSB Console to test XQueries but this is not very practical with complex Queries and takes a lot of time.You can also use XQuery and JDeveloper to run XQueries and this inspired me to write a simple XQUnit module to test xqueries. This blog shows you how to set up automatic tests with the use of JUnit , XMLUnit and Oracle XQuery engine. The contraints for me were: 1) The XQuery code should be as-is, so no changes with scripts or whatever. The XQueries are used within the test framework as used within the OSB. 2) The XQuery engine of the WLS must be used. I could use some other XQuery engine, but this would not test the real WLS engine and still errors could occur runtime. 3) The test framework can be used within Java unit tests. This way it can also be used within Maven for instanc...

XSLT Unit Testing

I like test driven development and automatic testing, so also for my XSLT code. I wanted to do this also within Oracle SOA Suite. Unfortunately this comes not out-of-the-box from the SOA Suite, so i searched the Net. Eventually i came to XMLUnit  1.2, whcih is an extension of JUnit (version 3.8.2). This framework contains some extension functions especially for XML, like transformations. Configuration First you have to configure XMLUnit to use the Oracle XSLT classes: System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "oracle.xml.jaxp.JXDocumentBuilderFactory"); System.setProperty("javax.xml.parsers.SAXParserFactory", "oracle.xml.jaxp.JXSAXParserFactory"); System.setProperty("javax.xml.transform.TransformerFactory", "oracle.xml.jaxp.JXSAXTransformerFactory"); Implementing a test case Extend from XMLTestCase: public class MyTestCase extends XMLTestCase Configure namespaces (this can be done within the setup() method...