You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by lt...@apache.org on 2007/10/11 11:29:49 UTC
svn commit: r583752 -
/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java
Author: ltheussl
Date: Thu Oct 11 02:29:49 2007
New Revision: 583752
URL: http://svn.apache.org/viewvc?rev=583752&view=rev
Log:
Make the IdentityTest optionally executable.
Modified:
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java?rev=583752&r1=583751&r2=583752&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java Thu Oct 11 02:29:49 2007
@@ -42,6 +42,11 @@
*/
public abstract class AbstractIdentityTest extends AbstractModuleTest
{
+ /**
+ * Set to true if the identity transformation should actually be asserted,
+ * by default only the expected and actual results are written to a file, but not compared.
+ */
+ private boolean assertIdentity;
/**
* Create a new instance of the parser to test.
@@ -58,7 +63,6 @@
*/
protected abstract Sink createSink( Writer writer );
-
/**
* Pipes a full model generated by {@link SinkTestDocument} through
* a Sink (generated by {@link #createSink(Writer)}) and a Parser
@@ -105,12 +109,15 @@
fileWriter.write( actual );
fileWriter.flush();
- // Disabled for now, it's unlikely that any of our modules
+ // Disabled by default, it's unlikely that all our modules
// will pass this test any time soon, but the generated
// output files can still be compared.
- // TODO: make this work for at least apt and xdoc modules?
- //assertEquals( "Identity test failed!", expected, actual );
+ if ( assertIdentity )
+ {
+ // TODO: make this work for at least apt and xdoc modules?
+ assertEquals( "Identity test failed!", expected, actual );
+ }
}
finally
@@ -147,5 +154,18 @@
{
return "";
}
+
+ /**
+ * Set to true if the identity transformation should actually be asserted,
+ * by default only the expected and actual results are written to a file, but not compared.
+ * This should be called during setUp().
+ *
+ * @param doAssert True to actually execute the test.
+ */
+ protected void assertIdentity( boolean doAssert )
+ {
+ this.assertIdentity = doAssert;
+ }
+
}