Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    unit testing a custom server side DataSource

    I’m writing a custom DataSource and would like to unit test it in a stand-alone Java application (TestNg).

    I tried making a call directly to executeFetch. The executeFetch fetch executes code that has no external dependency.

    I get this stack trace:

    Code:
    Problem loading builtinTypes.xml
    Exception when loading from __USE_CONTAINER__/Orchestrate/sc/system/schema/builtinTypes.xml:
    java.io.IOException: Configured for containerIO, but servletContext not available!  You need to install the Init servlet
    	at com.isomorphic.io.ISCFile.<init>(ISCFile.java:177)
    	at com.isomorphic.xml.XML.getXMLDocument(XML.java:286)
    	at com.isomorphic.xml.XML.toDSRecords(XML.java:294)
    	at com.isomorphic.xml.XML.toDSRecords(XML.java:298)
    	at com.isomorphic.xml.XML.toDSRecords(XML.java:303)
    	at com.isomorphic.datasource.DataSource.<clinit>(DataSource.java:990)
    	at com.cedarcone.Orchestrate.test.classifier2.ReceipeDataSourceTest.testReceipeDataSource(ReceipeDataSourceTest.java:29)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    	at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
    	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
    	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
    	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
    	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
    	at org.testng.TestRunner.privateRun(TestRunner.java:771)
    	at org.testng.TestRunner.run(TestRunner.java:621)
    	at org.testng.SuiteRunner.runTest(SuiteRunner.java:352)
    	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:347)
    	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
    	at org.testng.SuiteRunner.run(SuiteRunner.java:254)
    	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
    	at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
    	at org.testng.TestNG.run(TestNG.java:1032)
    	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
    Is there a way to set up an environment for stand-alone unit testing of a server side DataSource?

    #2
    See "Standalone DataSource Usage" in the docs.

    Comment


      #3
      Originally posted by Isomorphic View Post
      See "Standalone DataSource Usage" in the docs.
      Please provide the URL of the "docs" you're referring to.

      Comment


        #4
        Nevermind. I found it. Thanks!

        Comment

        Working...
        X