Hi,

As Daniel was having some issues with Ant integration i thought i'd make a 
small sample project using ANT with one class and one test case. Doing things 
neatly i thought that i'd use the last build (614) and here is my feedback:

I used a build.xml file with *no* taskdef or optional tag:

  <target name="tests" depends="compile" description="Runs the jUnit tests" >

    <junit printsummary="yes" haltonfailure="yes" fork="yes">

      <classpath>
        <path>
          <fileset dir="${lib.dir}">
            <patternset refid="all.jar.files"/>
          </fileset>
        </path>
        <pathelement path="${bin.classes}"/>
        <pathelement path="${conf.dir}"/>
        <pathelement path="${build.dir}/ant.jar"/>
      </classpath>

      <formatter type="plain" usefile="false"/>

      <test name="raccoon.sample.TestAllSample">
      </test>

    </junit>
  </target>

And now this is what i can do:
 * Using IDEA :
    - i can launch each test case individually from the src pane, right click.
    - i can launch ant tasks, including the test task defined above.
 * Using the DOS Command Prompt :
    - i can run all ant tasks with no errors.

So what gives? Simply defining correctly your classpath and getting the ANT 
Properties correctly set ... :o)

I have a small Zip file containing the configuration, build.xml, idea.bat, and 
sample test case that i used to validate all this stuff, available per 
request :o)

FYI if you get the error 'Could not create task of type junit", just add to the 
ANT Properties (ALT + ENTER in the window) the jar: junit.jar ... simple isn't 
it?

Having said that i have some issues (bug?) to raise in 614:

In the ANT Definition window, select properties (ALT + ENTER), goto Execution 
TAB and activate the "Run under Custom JDK" option.
Create a simple application that publishes the class path to STDOUT and run the 
tests ... 
Why is the IDEA Classpath (the one defined in my custom idea.bat) inherited? 
It's as if the "Run under Custom JDK" has no meaning ... i would think that if 
i create a custom JDK with a specific classpath that i shouldn't inherit from 
IDEA classpath, no?

The source used to display the classpath:

Enumeration enum = props.propertyNames();

while (enum.hasMoreElements()) {
   String propertyName = (String) enum.nextElement();

   System.out.println("{" + propertyName + "=\"" + props.getProperty
(propertyName ) + "\"}");
}

a++ Cedric

_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to