Junos Space SDK > Developer Guides > Junos Space Application Developer Guide > Programming with the Junos Space SDK > Using the Junos Space SDK Plug-in

Testing and Debugging the Application

You can test your application by using the following methods:

To test applications, log into the browser and test the application running on the JSVA. Browse to After logging into the application, the deployed application is visible in the browser.

JUnit Testing

The JUnit plug-in executes the test codes generated by the EJB-REST wizard.

Description of Generated Test Cases

Package Structure for Generated Test Class—An example of a package structure for a generated test class is shown below. The generated package name is the REST package name appended by a "test" keyword.

Note: The "junit.properties" file in the web-src folder of the Web Service project contains the information for running JUnit test cases. It is a configurable file that you can modify as needed.

Auto-generated JUnit Constants—These constants are auto-generated and are loaded dynamically from the "junit.properties" file.

Setup and Teardown Method—These methods are automatically generated.

Test Method for PagingResult getCountries(PagingContext ctx)—Methods will be generated for each media type, which further calls a common method.

To execute JUnit test cases:

  1. Right-click and select Run As > JUnit Test.

  2. The JUnit tab displays the test case results.

Remote Debugging

Applications are debugged in the Eclipse IDE as remote Java applications running on the local host. You can debug applications on a remote server by substituting the appropriate host name or IP address and the port defined in the JBoss startup script.

To debug your applications, verify that the JBoss instance is running in debug mode. To debug the application in the IDE:

  1. In the editor, open the source code file to debug, and set breakpoints in the code.
  2. On the Debug menu, select Debug Configurations.


    The Debug Configurations screen is displayed:

  4. In the left-hand panel, click the arrow next to Remote Java Application to open a list of projects that can be selected for debugging.
  5. Select the project containing the code to debug.
  6. Click Debug.
  7. If the Debug Perspective view does not appear automatically, select Window > Open Perspective > Other and click Debug.

When you click the task in the Space UI, the breakpoint will be executed. To learn more about Eclipse remote debugging, refer to the following topics in Eclipse Help: