[Solved] Junit plugin install runs in timeout

Hi

I try to setup a test, but seems that junit is missing. So I tried to install the junit 1.1 plugin I found under Tools->Plugins->Available Plugins. The download is working but install always stops with the error message:

"
The Plugin Installer found problem timeout of loading JUnit 4[org.netbeans.libs.junit4/1.14] while install the following plugins:

Junit
"

It’s no fun at all work without unit tests. For me nearyl impossible. No I do not unit test grafical output but my own classes and logic.

So I hope find some solution, any hint is welcome. I also would accept some dirty not so well integrated solution maybe on the command line or the like. And what is testNG? No clue how to make that run. As well I do not see a “Test Packages” beside the “Source Packages”, but think because junit is missing?!

Thanks and regards
Christian

Theres no test packages because unit tests were removed from the project.

no way to have junit tests? or is there a way? manually?

Check the manual (press F1)

I did, even the home page and one statement

The jMonkeyEngine SDK supports the JUnit testing framework. It is a good practice to write tests (assertions) for each of your classes. Each test makes certain this “unit” (e.g. method) meets its design and behaves as intended. Run your tests after each major change and you immediately see if you broke something.

seems to be outdated, when you tell me that it is removed from the project. As well the hint with

  1. Right-click a Java file in the Projects window and choose Tools > Create JUnit Tests.

is not working. So I’m a little lost. Ok I’m new the java world, I used to programm normaly in C/C++ and know only boost unit testing so far.

Define “not working”.

Not working == There is no “Create JUnit Tests” in Tools, when I right-click a java file. And I suppose because I can not install the Plugin, but I may be wrong.

To make a long story short: I’ll like to write some unit tests. I found a Plugin, which is not installable, I described that in the description of this topic. I did not found a way or any documentation here which could help me out of this…

So if somebody got this up and running I would be interesed in how this can be achieved. I’m a little lost here.

Regards
Christian

If you right click on the project and pick “Properties” you should see “Sources” on the left. Select that and then click “Add Folder…” under the “Test Package Folders” section. This will add a new test directory. If you have an existing one, delete it first (just make sure the test sources are saved somewhere else) and then add the new one.

Hey! Many thanks, that finally helped :smile:

I can now single call my test files but run all with Run Tests or Alt+F6 leads to this:

compile-test:
Created dir: /home/cli/workspace/synthetics2/build/test/results
/home/cli/workspace/synthetics2/nbproject/build-impl.xml:1285: The following error occurred while executing this line:
/home/cli/workspace/synthetics2/nbproject/build-impl.xml:508: The following error occurred while executing this line:
/home/cli/workspace/synthetics2/nbproject/build-impl.xml:495: The following error occurred while executing this line:
/home/cli/workspace/synthetics2/nbproject/build-impl.xml:450: Process fork failed.

It seems to fail on this line

<j2seproject3:test testincludes="**/*Test.java"/>

I actually have no clue what this tells me? What does those error want to tell me? Anybody?

Many thanks
Christian

If I remove

<j2seproject3:test testincludes="**/*Test.java"/>

it runs without error, but of course then no test get compiled/executed

Do anybody have a clue what should be here for TestNG so that all tests run on i.e. alt + F6?

If I run it on a MacBook Pro it is working, but not for linux. But yeah better than nothing :slight_smile:
Maybe I miss some paths or the like, no clue as the error is not very descriptive as well.

The problem on linux is that

/path/to/jmonkeyplatform/jdk/jre/bin/java

execute flag is not set, that’s why run all test is not working. Maybe this is wort a fix in the jmonkey package?!

Solution

chmod +x /path/to/jmonkeyplatform/jdk/jre/bin/java