Menu

#367 Junit tests fail - checking for wrong strings

None
closed
1
2019-03-02
2014-02-05
No

if (out.contains("access denied (java.net.SocketPermission")) {
messagedAccessDenied = true;
}

the string is actually [access denied ("java.net.SocketPermission")]
the first speech mark in these strings is causing the test to fail.
could replace the " in the out before the tests are done ?

package net.sf.robocode.test.robots

affects TestHttpAttack, TestConstructorSocketAttack,TestSocketAttack, TestConstructorReflectionAttack, TestFileAttack, TestFileOutputStreamAttack, TestConstructorHttpAttack

Discussion

  • Flemming N. Larsen

    Robocode is build for Java 6, not Java 7 or 8. So the tests assumes you are running with Java 6. With the .NET plugin for Robocode, .NET 3.5 is assumed.

    Currently, Robocode must be able to run on Java 6 as minimum requirement. Hence, the test must be run on Java 6 to have a guarantee that the tests passes on Java 6. With Java 7 or never, the test units must be adjusted.

     
  • Flemming N. Larsen

    • status: open --> pending
     
  • Flemming N. Larsen

    I just run all tests with JDK 8 without any problems. Perhaps the problem has already been fixed.

     
  • Flemming N. Larsen

    • status: pending --> closed
    • Group: Future Release --> None
     

Log in to post a comment.

Monday.com Logo