java.lang.NullPointerException at net.sf.borg.test.CheckListTests.setUp

  • Kuba Kowalski

    Kuba Kowalski - 2013-11-03


    I'm trying to write some JUnit tests for BORG and I wanted to start by running the existing tests. However, I get NullPointerException as DBHelper.getController() in part DBHelper.getController().connect("jdbc:hsqldb:mem:whatever"); seems to be null.

    Could you help me connect to the memory database?

    Kind regards,

  • Mike Berger

    Mike Berger - 2013-11-03

    Have you checked out the latest 1.8 code from Git? I switched from ANT to Maven a few weeks ago.

    The Junit tests are run as part of the Maven build. The test setup is:

    DBHelper.setFactory(new JdbcDBHelper());
    DBHelper.setController(new JdbcDBHelper());

    and hsqldb is in the runtime classpath in the POM.

    If you are using the ANT-based code, I'd have to go back and look, so let me know.


  • Kuba Kowalski

    Kuba Kowalski - 2013-11-05

    Thank you for your reply. I'm using ANT-based code. I'm writing a test case for Address Book using Sikuli and I'd like to connect to the memory database at the beginning of test.

    For now, my workaround is to connect to the main database and delete test entries after testing.

    Do you think this kind of tests could be useful for the project? I will have test case finished tomorrow, can I email it to you?


  • Mike Berger

    Mike Berger - 2013-11-05

    Perhaps you should try changing hsqldb to h2 in the jdbc url? Maybe that will work better.

    Such tests would be useful.

    Also, I've never heard of Sikuli and it's always good to learn something new.


  • Kuba Kowalski

    Kuba Kowalski - 2013-11-05

    I have emailed you parts I have already done. As you will see I call Borg main method in my test. For further cases it would be useful to set prefs for testing, could you tell me how to do it?



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks