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.
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)
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.
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.