[seam-commits] Seam SVN: r8623 - trunk/src/main/org/jboss/seam/mock.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Aug 7 08:05:58 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-08-07 08:05:58 -0400 (Thu, 07 Aug 2008)
New Revision: 8623
Modified:
trunk/src/main/org/jboss/seam/mock/AbstractDBUnitSeamTest.java
Log:
JBSEAM-3226
Modified: trunk/src/main/org/jboss/seam/mock/AbstractDBUnitSeamTest.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/AbstractDBUnitSeamTest.java 2008-08-07 11:30:50 UTC (rev 8622)
+++ trunk/src/main/org/jboss/seam/mock/AbstractDBUnitSeamTest.java 2008-08-07 12:05:58 UTC (rev 8623)
@@ -199,30 +199,57 @@
{
this(dataSetLocation, DatabaseOperation.CLEAN_INSERT);
}
+
+ /**
+ * Defaults to <tt>DatabaseOperation.CLEAN_INSERT</tt>
+ */
+ public DataSetOperation(String dataSetLocation, String dtdLocation)
+ {
+ this(dataSetLocation, dtdLocation, DatabaseOperation.CLEAN_INSERT);
+ }
- public DataSetOperation(String dataSetLocation, DatabaseOperation operation)
+ public DataSetOperation(String dataSetLocation, String dtdLocation, DatabaseOperation operation)
{
- log.info(">>> Preparing dataset: " + dataSetLocation + " <<<");
+ log.info(">>> Preparing dataset: " + dataSetLocation + " <<<");
- // Load the base dataset file
- InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(dataSetLocation);
- try
- {
- this.dataSet = new ReplacementDataSet( new FlatXmlDataSet(input) );
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex);
- }
- this.dataSet.addReplacementObject("[NULL]", null);
- if (binaryDir != null)
- {
- this.dataSet.addReplacementSubstring("[BINARY_DIR]", getBinaryDirFullpath().toString());
- }
- this.operation = operation;
- this.dataSetLocation = dataSetLocation;
+ // Load the base dataset file
+ InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(dataSetLocation);
+ try
+ {
+ InputStream dtdInput = null;
+ if (dtdLocation != null)
+ {
+ dtdInput = Thread.currentThread().getContextClassLoader().getResourceAsStream(dtdLocation);
+ }
+ if (dtdInput == null)
+ {
+ this.dataSet = new ReplacementDataSet( new FlatXmlDataSet(input) );
+ }
+ else
+ {
+ this.dataSet = new ReplacementDataSet( new FlatXmlDataSet(input, dtdInput) );
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ this.dataSet.addReplacementObject("[NULL]", null);
+ if (binaryDir != null)
+ {
+ this.dataSet.addReplacementSubstring("[BINARY_DIR]", getBinaryDirFullpath().toString());
+ }
+ this.operation = operation;
+ this.dataSetLocation = dataSetLocation;
}
+
+
+ public DataSetOperation(String dataSetLocation, DatabaseOperation operation)
+ {
+ this(dataSetLocation, null, operation);
+ }
+
public IDataSet getDataSet()
{
return dataSet;
More information about the seam-commits
mailing list