Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
abego edited this pageJun 28, 2017 ·5 revisions

Run Java2Script Unit Tests

Usej2slib with "junit"

To run Java2Script unit tests you must use aj2slib that contains "junit".

To build aj2slib with "junit" follow the description given in 'Building j2slib (The Runtime Library)' but when starting the Ant build make sure to set the Ant propertyj2s.lib.include.junit totrue.

I.e. when starting Ant from the command line (in the 'net.sf.j2s.lib' directory)

  • runant -Dj2s.lib.include.junit=true -f build/build.xml

When starting Ant from within Eclipse:

  • Right-click "build/build.xml" and select "Run As > Ant Build..."
  • (An 'Edit Configuration' dialog appears.)
  • In the 'Main' tab find the 'Arguments:' field and enter:
    • -Dj2s.lib.include.junit=true
  • Click 'Run'

(Make sure the just buildj2slib is used when running Java2Script code. See 'Building j2slib (The Runtime Library)' for details.)

Run Tests

  • Right-click the (JUnit) test class
  • Select "Run as > Java2Script Unit Test"

While running the test output is written to the 'J2S Console' in Eclipse.

Click the button 'Run in External Browser' in the 'J2S Console' to re-run the test in an external browser. Especially when debugging JavaScript code using an external browser (and its 'Developer Tools') is the preferred way to go.

But also for "normal" test runs use the external browser because the output to the 'J2S console' is not always updated (seeIssue #17).

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp