Menu

#45 Java/Junit- compile error on any code with assertArrayEquals

closed-fixed
5
2010-01-24
2009-02-14
No

When submitting the latest project for my class at the U of A to WebCAT, I found that it gives a compile time error for any code that uses the assertArrayEquals method which is part of the Junit API. (The code in question used import static org.junit.Assert.*; it compiled and worked in its original form using assertArrayEquals on both my machine and the ones at the U of A's computer lab, and it worked on WebCAT after rewriting it to use only assertEquals for each individual element in the array.)

The message WebCAT gives if you submit code that uses assertArrayEquals is:

ArrayFunTest.java:127: cannot find symbol

symbol : method assertArrayEquals(int[],int[])

location: class ArrayFunTest

assertArrayEquals(new int[] { 0, 3, 2, 1, 2, 4 }, testArrays[0]);

^

(same message repeated for every instance of assertArrayEquals)

I sent an email about this to the contact address on Web-CAT earlier, and Stephen Edwards emailed me back and said the problem was probably that the Junit plugin that Web-CAT uses needs to be upgraded to a version that supports the more recently added methods. The assertArrayEquals method apparently was added in Junit 4.3 (see among other sources http://www.nabble.com/JUnit-4.3-is-released-td9573546.html\) What version of Junit is currently installed on Web-CAT?

Discussion

  • Stephen H. Edwards

    This was fixed long ago, but I forgot to close the issue in the tracker. The problem was fixed by updating the JUnit version embedded in the AntForPlugins subsystem.

     
  • Stephen H. Edwards

    • milestone: --> Java_TDD_grading_plug-in
    • status: open --> closed-fixed