Create DataTable for Junit Node Testing

Hi,

i want to TDD a Node because I found a few bugs and want to get sure its now bugfree. But I cant write my Testcase without creating a TestDataTable. Is there already sth. I can use, because writing my own Implementation of a DataTable ends with the try to create an Instantiation of DataTableSpec because there is an Error creating the NodeLogger.

So is there a way to create Junit tests? I hope so, because its a very complex Node I'm implementing.

 

best Regards

Because there are no answers till now, i post the error message I receive while creating a ColumnSpec with the ColumnSpecCreator:

log4j:ERROR Could not parse url [file:/C:/Users/alwin/knime/log4j.xml].
org.xml.sax.SAXParseException: Premature end of file.

at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
    at org.apache.log4j.xml.DOMConfigurator$2.parse(DOMConfigurator.java:612)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:711)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618)
    at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:743)
    at org.knime.core.node.NodeLogger.<clinit>(NodeLogger.java:167)
    at org.knime.core.data.DataColumnSpecCreator.<clinit>(DataColumnSpecCreator.java:89)
    at olap.QuantaMatriceTest.createOutSpec(QuantaMatriceTest.java:108)

This has nothing to do with your node. Please check the file "C:/Users/alwin/knime/log4j.xml", it seems to be broken.

Apart from that you want to install the "KNIME Testing Application" and read the document in the "doc"-folder.

Where can I find the "KNIME Testing Application"???? I didn't found sth. like that either on the mainpage nor here at the techpages.

This is an extension you can simply install from the KNIME Update Site.

So I've no installed the extension but it doesn't bring the expected features with it, so it only provides a autoamtic way to test Workflows but I want to test Methods, because my Node is very complex. So it seems that this suggestion will not make it for my.

Any other suggestions?

 

thanks

It depends on what and how accurate you want to test. You can certainly test you method using a workflow with the node and the Differ nodes from the Testing extension. You need many branches though if your node is very complex. I suggest you are using a normal JUnit test for your algorithm instead then.