SimpleTests fail

Hey everyone,
so I tried getting started with the tests of the new project and I tried running the simple tests that are already provided. What I understood by now, the second test should pass since create() in UriParserFactory and parse() both ouput null by now. But for me, and for some of my friends, all three tests fail while for others it works perfectly fine.
I did not change any code yet. I only added one test which shouldn’t affect the SimpleTests.
Thanks in advance!


These are only tests for some UrlParser implementation. As long as you did not write any, you will not be able to run your tests. As soon as you written an implementation, you can return it in the UrlParserFactory class as an implementation of the UrlParser interface.

If you did not implement anything yet, you will need to use the daily tests to find out:

  1. Whether your tests are even correct (as they are tested against a valid implementation during the daily tests)
  2. Your tests test enough to find issues in invalid implementations
You can still try to run them locally without an implementation to find any syntax errors!

Okay, I still don’t get why they then pass for others who also haven’t implemented any code yet, but thanks for your help!

Regarding testNegativeSimple:
As Nicolas said, this test assumes that the factory returns a parser. It then looks whether the parser returns null when parse is invoked:


You can see this in the error message when running the test:

 at uri.tests.SimpleTests.testNegativeSimple(

This exception means: Java tried to access something from a object which was null.
In our case, it tried:


But the test should be successful in an empty project.
It tests that the factory returns null when invoked with null as the argument.


Okay, I get it now. The test you named is successful for me, thank you for your help.

1 Like