Kamesh,

are you sure that your xml file is in the classpath?
the xml file MUST be in the classpath.
To achieve this goal, you should add it in your classapth definition like this:

<path id="<your_junitext_classpath">
   <!-- libs -->
<pathelement path="${xml_file}" /> </path>

hope this help :-)

supareno
Hi All,

I'm trying to execute certain test cases as a part of my build.

I'm using the ant's junit task to accomplish this.

My build script is as follows,

<junit fork="no" maxmemory="1024" includeantruntime="yes" printsummary="yes"
haltonerror="yes" haltonfailure="yes" filtertrace="false" showoutput="yes">

                              <classpath refid="derbyClient"/>

                              <classpath refid="derby"/>

                              <classpath refid="derbynet"/>

                              <classpath refid="saltest"/>

<classpath refid="webinf.lib"/>
                              <classpath refid="class.path"/>

                              <classpath refid="webinf.general"/>

            <formatter type="plain"/>

                  <batchtest todir="${reports.test}">

                  <fileset dir="${component.class.dir}">

                        <include name="**/${TestCase}"/>


                  </fileset>

            </batchtest>

</junit>

I've test case which takes inputs from *.xml files and runs. The
implementation is as follows.
I'm using @RunWith(XMLParameterizedRunner.class) and pass my arguments
through @XMLParameters("/com/org/bias/engine/sal/unittest/TestData.xml").
TestData.xml is the input file which contains the input data for the test
cases.

JUnit suffers the exception at the following constructor.

Line1 :     @XMLParameters("/com/cisco/cp/engine/sal/unittest/data/
TestData.xml")

Line2 :         public TestGenTest(TestData create,TestData update, TestData
delete) { // TestData here is my bean

Line3 :                    this.createAttributes = create;

Line4 :                   this.updateAttributes = update;

Line5 :                   this.deleteAttributes = delete;

Line6 :         }

The exception occurs at Line1

Testcase: initializationError0 took 0 sec

     Caused an ERROR

null

java.lang.NullPointerException

     at java.io.FileInputStream.<init>(FileInputStream.java:103)

     at
org.junitext.runners.parameters.factory.DigesterParameterFactory.createParam
eters(Unknown Source)

     at
org.junitext.runners.XMLParameterizedRunner$RunAllXMLParameterMethods.getPar
ametersList(Unknown Source)

     at
org.junitext.runners.XMLParameterizedRunner$RunAllXMLParameterMethods.<init>
(Unknown Source)

     at org.junitext.runners.XMLParameterizedRunner.<init>(Unknown Source)

     at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

     at java.lang.reflect.Constructor.newInstance(Constructor.java:494).

FYI. Everything is at place.. I didn't find any issues with the classpath.
Could someone throw lights on the annotated @XMLParameters() method, since
I'm not much familiar about what it's up to.

Thanks and Regards,

Kamesh





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to