Getting the source#

How do I get the source code?#

Via anonymous Subversion. Check out AnonymousSVNAccess. The other possibility is to download the source package from JSPWikiDownload.

If you have been given commit rights to JSPWiki SVN, then there will be instructions in a separate email.

Coding#

What are the coding conventions used within JSPWiki?#

Check out JSPWikiCodingStandard. No, it's not up to negotiation.

Which version should I use for development?#

It depends: if you are developing something new and grand, you probably should look at the latest SVN. Though, it is recommended that you join the developer mailing list first and tell us about what you are planning.

If you are doing small fixes, new plugins, templates, etc, you should code against the latest stable version.

Patches and code contributions#

I have made some modifications, how do I get it contributed to JSPWiki?#

First of all, you should learn how to create patches. In Eclipse this is pretty easy - just use "Team->Create patch". From command line, you will need to learn how to use the "diff" tool. Check out ContributingChanges for more discussion and instructions.

Should I post the patch to the wiki or where?#

Yes, please. The page ContributedCode contains further information.

You can also try emailing on the jspwiki-dev mailing list, since we don't always notice everything on this wiki. Especially bug fixes can be posted there.

Should I write unit tests as well?#

Yes, PLEASE! If you test your own code, it's a lot easier for us to integrate it in the code base, since then we know what your code is supposed to be doing, especially in error cases!

Should I run the unit tests before sending a contribution?#

Yes. If your code contribution breaks our unit tests, we won't integrate it. No matter how you feel about XP or Agile, Testing Is Good.

Testing#

Some unit tests are failing due to "cannot find web.xml"#

You are probably running the unit tests directly from your IDE. You need to run "ant tests-init" in your development directory first. Running it will create web.xml as well as some few other files needed by the unit tests.

What are these web tests?#

Yes, web tests. We are using the HTTPUnit test framework. There is an UNIX/OSX shell script called "run_webtests.sh" in the top-level directory, which you should run every now and then to see whether you have broken anything.

How do I run the unit tests?#

You have three possible ways:

  1. Run the "ant tests" target. This will result in a bunch of files in the tests/reports directory, which detail the test results.
  2. Run the "ant guitests" target. This will pop up a pretty window which will show a graphical progress and the results of the tests.
  3. Run the "com.ecyrd.jspwiki.AllTests" class. E.g. in Eclipse, right-click on "tests/com/ecyrd/jspwiki/AllTests.java", and choose "Run As->JUnit test". This is the easy way to achieve Eclipse integration, though be warned that any tests which require the JAR file to be signed may fail (notably some auth tests). Also, see above the warning on tests failing with "web.xml not found".

How do I add an unit test?#

The easiest is to copy an existing unit test from a package. If you need to instantiate a WikiEngine, we recommend using the TestEngine class, which is smart enough to find its own properties.

In addition, if you're adding tests for a whole new class, please add your unit test to the AllTests.java in the package directory. This means that the way #3 of running an unit test (above) still works.

I keep getting java.lang.OutOfMemoryErrors!#

The JSPWiki unit tests tend to take a bit of memory. Adding "-Xmx512m" seems to help. If you're running the tests within Eclipse, you can put it in your Preferences->Java->Installed JREs->Edit->Default VM Arguments.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-14) was last changed on 05-Jul-2008 18:48 by Rob McDougall