Update of /cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet/junit
In directory sc8-pr-cvs1:/tmp/cvs-serv10946/core/src/java/xdoclet/junit

Modified Files:
        XMLGeneratorTest.java 
Log Message:
- Removed LoggerExt (we are not going to use this)
- Improved coding conventions
- Added license

Index: XMLGeneratorTest.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet/junit/XMLGeneratorTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** XMLGeneratorTest.java       8 Nov 2002 02:26:06 -0000       1.1
--- XMLGeneratorTest.java       22 Nov 2002 14:22:30 -0000      1.2
***************
*** 18,31 ****
   * @version $Revision$
   */
! public abstract class XMLGeneratorTest extends XMLTestCase {
! 
!    /** Root directory of Java sources used as test sources for generation. */
!     private final File _testSourcesDir = new File( "src/testdata" 
).getAbsoluteFile();
  
      /** Directory containing xml files used for testing reference. */
!     private final File _expectedResultDir = new File( 
"src/expected").getAbsoluteFile();
  
      /** Directory where the generated files will be written. */
!     private final File _destinationDir = new File( "target/test").getAbsoluteFile();
  
      /** Classpath used to find the plugins to test. */
--- 18,31 ----
   * @version $Revision$
   */
! public abstract class XMLGeneratorTest extends XMLTestCase
! {
!     /** Root directory of Java sources used as test sources for generation. */
!     private final File _testSourcesDir = new File("src/testdata").getAbsoluteFile();
  
      /** Directory containing xml files used for testing reference. */
!     private final File _expectedResultDir = new 
File("src/expected").getAbsoluteFile();
  
      /** Directory where the generated files will be written. */
!     private final File _destinationDir = new File("target/test").getAbsoluteFile();
  
      /** Classpath used to find the plugins to test. */
***************
*** 36,40 ****
      private Plugin _plugin;
  
!     protected XMLGeneratorTest( String name ) {
          super(name);
      }
--- 36,41 ----
      private Plugin _plugin;
  
!     protected XMLGeneratorTest(String name)
!     {
          super(name);
      }
***************
*** 53,57 ****
      protected abstract int getGeneratorIndex();
  
!     public final void setUp() throws Exception {
  
          // Configure XMLUnit. It shouldn't validate against DTD
--- 54,59 ----
      protected abstract int getGeneratorIndex();
  
!     public final void setUp() throws Exception
!     {
  
          // Configure XMLUnit. It shouldn't validate against DTD
***************
*** 66,70 ****
  
          // Create the plugin
! long start = System.currentTimeMillis();
          _plugin = _xdoclet.createPlugin(getPluginName());
  
--- 68,72 ----
  
          // Create the plugin
!         long start = System.currentTimeMillis();
          _plugin = _xdoclet.createPlugin(getPluginName());
  
***************
*** 73,97 ****
          // Execute XDoclet
          _xdoclet.execute();
! long end = System.currentTimeMillis();
! System.out.println("GENERATION TIME:" + (end-start));
      }
  
!     protected Reader getGenerated() throws XDocletException, IOException {
          return getReader(_destinationDir, getGeneratorIndex());
      }
  
!     protected Reader getExpected() throws XDocletException, IOException {
          return getReader(_expectedResultDir, getGeneratorIndex());
      }
  
!     private final Reader getReader(File dir, int generatorIndex) throws 
XDocletException, IOException  {
          Generator generator = (Generator) 
_plugin.getGenerators().get(generatorIndex);
          FileDestination destination = (FileDestination) generator.getDestination();
          File testFile = new File(dir, destination.getFileName());
!         return new FileReader( testFile );
      }
  
!     public void testPlugin() throws Exception {
!         assertXMLEqual( getExpected(), getGenerated() );
      }
! }
--- 75,103 ----
          // Execute XDoclet
          _xdoclet.execute();
!         long end = System.currentTimeMillis();
!         System.out.println("GENERATION TIME:" + (end - start));
      }
  
!     protected Reader getGenerated() throws XDocletException, IOException
!     {
          return getReader(_destinationDir, getGeneratorIndex());
      }
  
!     protected Reader getExpected() throws XDocletException, IOException
!     {
          return getReader(_expectedResultDir, getGeneratorIndex());
      }
  
!     private final Reader getReader(File dir, int generatorIndex) throws 
XDocletException, IOException
!     {
          Generator generator = (Generator) 
_plugin.getGenerators().get(generatorIndex);
          FileDestination destination = (FileDestination) generator.getDestination();
          File testFile = new File(dir, destination.getFileName());
!         return new FileReader(testFile);
      }
  
!     public void testPlugin() throws Exception
!     {
!         assertXMLEqual(getExpected(), getGenerated());
      }
! }
\ No newline at end of file



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to