Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-195

Make sure batch build & test excludes class files in development tree

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • deferred
    • None
    • QA
    • None

      The batch build (using ant), tests the software. The classpath it uses when running these tests should have the built jars on it only, it should not have other non-runtime class file directories, nor the scala compiler, java compiler, etc.

      There is code in the XML Validator ResourceResolver.java to find the various resources needed by looking on the classpath for jar files that contain the resources. (E.g., the XML Schema (xsd) files for the DFDL annotation syntax. The Jar step in ant builds these xsd files into the jar.

      The code tries looking in the file system src and srcTest directories if it doesn't find them in any jars on the class path. The purpose of this is to insure that we can seamlessly run tests from inside an IDE (where there are no jars) as well as from ant.

      However, these two setups should be disjoint. When developing in the IDE, it should NOT be looking at jars for the resources (and it won't, because the ant build.xml is not used, and nothing creates the jars in question nor puts their directory onto any classpath that eclipse or other IDE would see).

      When running from ant it should NOT be picking the resources up from src or srcTest subdirectories. This is trickier - it might just be finding these "by accident".

      Fixing this requires creating a test.classpath path for ant, which is different from the classpath used when building.

      It also requires changing the working directory so that the relative paths to src and srcTest won't work. Alternatively we can set a java system parameter at the java/scala command line when testing that says "jars only" and use it to shut off the file searching in the src and srcTest directories.

      We need to insure that when testing, it ONLY

              jcranford Jonathan W. Cranford (Inactive)
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: