Help

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Getting Started

You first step is downloading Seam and building it, see Seam SVN Repository and Building Seam.

Seam2 development is in community/Seam_2_3 branch only.

Setting up an Eclipse workspace

Seam SVN comes with a .project file, and an ant task is used to generate the .classpath file from the Maven POM's used to describe project dependencies. To generate the .classpath, in seam/ run ant build eclipseclasspath. Then, refresh the project.

The eclipseclasspath target automatically attaches any -sources.jar it finds in your local Maven repository. To populate your local Maven repository with all the available source jars for Seam dependencies and make them available in Eclipse, run ant build downloadDependenciesSources eclipseclasspath.

Developing Seam using IntelliJ IDEA

If you would like to use IntelliJ IDEA for Seam development, you can take advantage of the Seam community license. The license key and details about the terms are available on request by one of the team members (try Dan first). Keep in mind the license expires each year in the fall, so contact one of us when IntelliJ prompts you for the new code.

We'd like to thank JetBrains for their support of Seam development. Not only do they support the development of Seam by offering this license, they also have add extensive support for Seam development in the IDE in the form of plugins.

Submitting a patch

We prefer you to submit your patch using the unified diff format. Fortunately, SVN makes this easy. Alter necessary files in the svn checkout, then run svn diff theFile.java >> mychanges.diff for each file you have changed. Then attach this file in JIRA. If you are making a lot of changes, consider splitting you changes into logical chunks. Try not to make any whitespace changes in a diff - submit a separate diff if you want to make (legitimate) whitespace changes.

Most IDEs support creating patches from SVN - for example, in Eclipse, select the file you want to create the patch from, right click, and choose Team -> Create Patch....

Running the testsuite

Seam has a mixture of unit and integration tests.

To run the whole testsuite (you should do this before submitting a patch or making a commit), run ant cleanall testall testreport. This generates a report in jboss-seam/test-report/junit-noframes.html.

If you want to run the testsuite in coverage mode, run ant cleanall coverageall testreport. This generate a report in jboss-seam/test-report/coverage.html. As the coverage target instruments the Seam jars, don't forget to run a ant cleanall build before using Seam normally.

You can also run the integration tests individually. For example, to run the MessagingTest from the core integration test suite

cd jboss-seam/src/test/integration
ant testclass -DclassName=MessagingTest

Running integration tests from the TestNG Eclipse Plugin

This is useful if you want to attach a debugger to a test.

  • Start Eclipse and download the TestNG Eclipse Plugin.
  • Outside Eclipse, go to the Seam example folder and run ant test.
  • Back in Eclipse, create new Java project from existing ant build file while selecting the example's build file.
  • Select testng suite or testng class and choose Run as -> TestNG
  • Go to Run -> Run configurations and edit the newly created TestNG runner
  • If you use Java 6 as runtime, add jvm argument -Dsun.lang.ClassLoader.allowArraySyntax=true in Arguments tab
  • Go to Classpath tab and remove all User entries
  • Add following jars:
lib/test/hibernate-all.jar
lib/test/jboss-embedded-all.jar
lib/test/thirdparty-all.jar
lib/jboss-embedded-api.jar
lib/jboss-seam.jar
lib/jboss-el.jar
lib/activation.jar
lib/jsf-api.jar
lib/el-api.jar
  • Then, using the Advanced... option, add these folders:
jboss-seam/bootstrap
/path/to/example/test-build
  • If you can't see any of these jars/folders, you need to refresh the project.
  • Then, just hit debug, and the test output will appear in the console.

Code style guidelines

Here are a few style guidelines for writing code:

  • Indent each level using 3 spaces
  • Place braces on a new line like
public void foo()
{
   log.info("foo");
}
  • Format long method lines sensibly
  • When writing docs or comments use an 80 character gutter
  • When writing XML, indent each level with 3 spaces
  • When writing docbook, normally tags which display inline are placed inline in the XML source

And most importantly, take a look at some existing files, and be consistent!

You can find an Eclipse code format template in the SVN checkout (seam/eclipse-code-formatter-profile.xml); apply it by going to the project's Properties -> Java Code Style -> Formatter -> Import.

Reference documentation style guidelines

Please see the Reference Documentation Style Guide for information on how to format the DocBook files that comprise the Reference Documentation.

Maven POM guidelines

All the builds in Web Beans and Seam 3 are based on Maven 2. That's a lot of XML to maintain, unfortunately. To make it easy to find information in the POM file, developers should adhere to the following order of elements:

project
    modelVersion
    parent
        groupId
        artifactId
        version
    artifactId
    version
    packaging
    name
    description
    [project metadata: url, inceptionYear, developers, licenses, etc]
    modules
    repositories
    pluginRepositories
    properties
    dependencyManagement
    dependencies
    build
        extensions
        pluginManagement
        plugins
    reporting
    profiles
    [source metadata: ciManagement, issueManagement, scm, distributionManagement]

Please update this section if there are elements in the tree which are not represented here. The actual order is not important. What's important is that it remain consistent across projects/modules.

Seam License Information

The Seam Framework is licensed under the GNU LESSER GENERAL PUBLIC LICENSE

See this page for further information on licensing and source code headers - Seam Licensing

Seam's Jira Usage