diff --git a/ipojo/examples/junit4osgi/felix-command/LICENSE b/ipojo/examples/junit4osgi/felix-command/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/ipojo/examples/junit4osgi/felix-command/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/ipojo/examples/junit4osgi/felix-command/NOTICE b/ipojo/examples/junit4osgi/felix-command/NOTICE
new file mode 100644
index 0000000..c0a0c56
--- /dev/null
+++ b/ipojo/examples/junit4osgi/felix-command/NOTICE
@@ -0,0 +1,17 @@
+Apache Felix iPOJO junit4osgi Felix Command
+Copyright 2008 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+II. Used Software
+
+This product uses software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
diff --git a/ipojo/examples/junit4osgi/felix-command/metadata.xml b/ipojo/examples/junit4osgi/felix-command/metadata.xml
index 87f7db1..4021649 100644
--- a/ipojo/examples/junit4osgi/felix-command/metadata.xml
+++ b/ipojo/examples/junit4osgi/felix-command/metadata.xml
@@ -1,9 +1,27 @@
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
+-->
 <?xml version="1.0" encoding="UTF-8"?>
 <iPOJO>
 	<component
 		className="org.apache.felix.ipojo.junit4osgi.command.JunitCommand"
 		factory="false">
-		<requires field="runner" />
+		<requires field="m_runner" />
 		<provides />
 	</component>
 	<instance
diff --git a/ipojo/examples/junit4osgi/felix-command/pom.xml b/ipojo/examples/junit4osgi/felix-command/pom.xml
index 6f6749c..6b912ad 100644
--- a/ipojo/examples/junit4osgi/felix-command/pom.xml
+++ b/ipojo/examples/junit4osgi/felix-command/pom.xml
@@ -23,7 +23,7 @@
 	<artifactId>
 		org.apache.felix.ipojo.junit4osgi.felix-command
 	</artifactId>
-	<groupId>ipojo.examples</groupId>
+	<groupId>org.apache.felix</groupId>
 	<version>1.1.0-SNAPSHOT</version>
 	<dependencies>
 		<dependency>
@@ -59,15 +59,13 @@
 				<extensions>true</extensions>
 				<configuration>
 					<instructions>
-						<Bundle-Name>
-							iPOJO OSGi Junit Runner - Felix Command
+						<Bundle-Name> iPOJO OSGi Junit Runner - Felix Command
 						</Bundle-Name>
-						<Bundle-SymbolicName>
-							${pom.artifactId}
-						</Bundle-SymbolicName>
-						<Private-Package>
-							org.apache.felix.ipojo.junit4osgi.command
+						<Bundle-SymbolicName> ${pom.artifactId}</Bundle-SymbolicName>
+						<Private-Package> org.apache.felix.ipojo.junit4osgi.command
 						</Private-Package>
+						<Include-Resource> META-INF/LICENCE=LICENSE,
+							META-INF/NOTICE=NOTICE </Include-Resource>
 					</instructions>
 				</configuration>
 			</plugin>
@@ -86,6 +84,31 @@
 					</execution>
 				</executions>
 			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>rat-maven-plugin</artifactId>
+				<configuration>
+					<excludeSubProjects>false</excludeSubProjects>
+					<useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+					<useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+					<excludes>
+						<param>doc/*</param>
+						<param>maven-eclipse.xml</param>
+						<param>.checkstyle</param>
+						<param>.externalToolBuilders/*</param>
+					</excludes>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-checkstyle-plugin
+				</artifactId>
+				<configuration>
+					<configLocation>
+						http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml
+					</configLocation>
+				</configuration>
+			</plugin>
 		</plugins>
 	</build>
 </project>
diff --git a/ipojo/examples/junit4osgi/felix-command/src/main/java/org/apache/felix/ipojo/junit4osgi/command/JunitCommand.java b/ipojo/examples/junit4osgi/felix-command/src/main/java/org/apache/felix/ipojo/junit4osgi/command/JunitCommand.java
index 1a16e44..74ffac2 100644
--- a/ipojo/examples/junit4osgi/felix-command/src/main/java/org/apache/felix/ipojo/junit4osgi/command/JunitCommand.java
+++ b/ipojo/examples/junit4osgi/felix-command/src/main/java/org/apache/felix/ipojo/junit4osgi/command/JunitCommand.java
@@ -38,8 +38,16 @@
  */
 public class JunitCommand implements Command {
 
-    private OSGiJunitRunner runner;
+    /**
+     * OSGi Junit Runner service.
+     */
+    private OSGiJunitRunner m_runner;
 
+    /**
+     * Gets the Test names.
+     * @param list the list of test
+     * @return the list of test names.
+     */
     private List getNamesFromTests(List list) {
         List names = new ArrayList(list.size());
         for (int i = 0; i < list.size(); i++) {
@@ -57,26 +65,33 @@
         return names;
     }
 
+    /**
+     * Executes the command.
+     * @param line the command line
+     * @param out the output stream
+     * @param err the error stream
+     * @see org.apache.felix.shell.Command#execute(java.lang.String, java.io.PrintStream, java.io.PrintStream)
+     */
     public void execute(String line, PrintStream out, PrintStream err) {
         line = line.substring(getName().length()).trim();
         List tr = null;
         if (line.equals("all")) {
-            if (runner.getTests() == null) {
+            if (m_runner.getTests() == null) {
                 err.println("No tests to execute");
                 return;
             } else {
-                out.println("Executing " + getNamesFromTests(runner.getTests()));
-                tr = runner.run();
+                out.println("Executing " + getNamesFromTests(m_runner.getTests()));
+                tr = m_runner.run();
             }
         } else {
             try {
                 Long bundleId = new Long(line);
-                if (runner.getTests(bundleId.longValue()) == null) {
+                if (m_runner.getTests(bundleId.longValue()) == null) {
                     err.println("No tests to execute");
                     return;
                 } else {
-                    out.println("Executing " + getNamesFromTests(runner.getTests(bundleId.longValue())));
-                    tr = runner.run(bundleId.longValue());
+                    out.println("Executing " + getNamesFromTests(m_runner.getTests(bundleId.longValue())));
+                    tr = m_runner.run(bundleId.longValue());
                 }
             } catch (NumberFormatException e) {
                 err.println("Unable to parse id " + line);
@@ -96,16 +111,31 @@
 
     }
 
+    /**
+     * Gets the command name.
+     * @return "junit"
+     * @see org.apache.felix.shell.Command#getName()
+     */
     public String getName() {
         return "junit";
     }
 
+    /**
+     * Gets a small description of the command.
+     * @return "launch junit tests"
+     * @see org.apache.felix.shell.Command#getShortDescription()
+     */
     public String getShortDescription() {
         return "launch junit tests";
     }
 
+    /**
+     * Gets command usage.
+     * @return the command usage.
+     * @see org.apache.felix.shell.Command#getUsage()
+     */
     public String getUsage() {
-        return "junit";
+        return "junit <bundleid> | junit all";
     }
 
 }
diff --git a/ipojo/examples/junit4osgi/immediate-launcher/LICENSE b/ipojo/examples/junit4osgi/immediate-launcher/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/ipojo/examples/junit4osgi/immediate-launcher/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/ipojo/examples/junit4osgi/immediate-launcher/NOTICE b/ipojo/examples/junit4osgi/immediate-launcher/NOTICE
new file mode 100644
index 0000000..7324e07
--- /dev/null
+++ b/ipojo/examples/junit4osgi/immediate-launcher/NOTICE
@@ -0,0 +1,17 @@
+Apache Felix iPOJO junit4osgi Immediate Runner
+Copyright 2008 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+II. Used Software
+
+This product uses software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
diff --git a/ipojo/examples/junit4osgi/immediate-launcher/metadata.xml b/ipojo/examples/junit4osgi/immediate-launcher/metadata.xml
index 648ab67..4d7392a 100644
--- a/ipojo/examples/junit4osgi/immediate-launcher/metadata.xml
+++ b/ipojo/examples/junit4osgi/immediate-launcher/metadata.xml
@@ -1,9 +1,27 @@
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
+-->
 <?xml version="1.0" encoding="UTF-8"?>
 <iPOJO>
 	<component
 		className="org.apache.felix.ipojo.junit4osgi.command.ImmediateRunner"
 		factory="false">
-		<requires field="runner" />
+		<requires field="m_runner" />
 		<callback method="start" transition="validate" />
 	</component>
 	<instance
diff --git a/ipojo/examples/junit4osgi/immediate-launcher/pom.xml b/ipojo/examples/junit4osgi/immediate-launcher/pom.xml
index 8a9f41d..0328d91 100644
--- a/ipojo/examples/junit4osgi/immediate-launcher/pom.xml
+++ b/ipojo/examples/junit4osgi/immediate-launcher/pom.xml
@@ -23,7 +23,7 @@
 	<artifactId>
 		org.apache.felix.ipojo.junit4osgi.immediate-runner
 	</artifactId>
-	<groupId>ipojo.examples</groupId>
+	<groupId>org.apache.felix</groupId>
 	<version>1.1.0-SNAPSHOT</version>
 	<dependencies>
 		<dependency>
@@ -59,15 +59,13 @@
 				<extensions>true</extensions>
 				<configuration>
 					<instructions>
-						<Bundle-Name>
-							iPOJO OSGi Junit Runner - Immediate Runner
+						<Bundle-Name> iPOJO OSGi Junit Runner - Immediate Runner
 						</Bundle-Name>
-						<Bundle-SymbolicName>
-							${pom.artifactId}
-						</Bundle-SymbolicName>
-						<Private-Package>
-							org.apache.felix.ipojo.junit4osgi.command
+						<Bundle-SymbolicName> ${pom.artifactId}</Bundle-SymbolicName>
+						<Private-Package> org.apache.felix.ipojo.junit4osgi.command
 						</Private-Package>
+						<Include-Resource> META-INF/LICENCE=LICENSE,
+							META-INF/NOTICE=NOTICE </Include-Resource>
 					</instructions>
 				</configuration>
 			</plugin>
@@ -86,6 +84,31 @@
 					</execution>
 				</executions>
 			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>rat-maven-plugin</artifactId>
+				<configuration>
+					<excludeSubProjects>false</excludeSubProjects>
+					<useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+					<useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+					<excludes>
+						<param>doc/*</param>
+						<param>maven-eclipse.xml</param>
+						<param>.checkstyle</param>
+						<param>.externalToolBuilders/*</param>
+					</excludes>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-checkstyle-plugin
+				</artifactId>
+				<configuration>
+					<configLocation>
+						http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml
+					</configLocation>
+				</configuration>
+			</plugin>
 		</plugins>
 	</build>
 </project>
diff --git a/ipojo/examples/junit4osgi/immediate-launcher/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ImmediateRunner.java b/ipojo/examples/junit4osgi/immediate-launcher/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ImmediateRunner.java
index 199cdf6..1cc0a59 100644
--- a/ipojo/examples/junit4osgi/immediate-launcher/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ImmediateRunner.java
+++ b/ipojo/examples/junit4osgi/immediate-launcher/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ImmediateRunner.java
@@ -21,15 +21,22 @@
 import org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner;
 
 /**
- * Felix shell command. Allow to run tests.
+ * Junit Immediate runner.
+ * Executes test when starts.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class ImmediateRunner {
 
-    private OSGiJunitRunner runner;
+    /**
+     * OSGi Junit Runner service.
+     */
+    private OSGiJunitRunner m_runner;
     
+    /**
+     * Start method. 
+     */
     public void start() {
-        runner.run();
+        m_runner.run();
     }
 
 }
diff --git a/ipojo/examples/junit4osgi/junit4osgi/LICENSE b/ipojo/examples/junit4osgi/junit4osgi/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/ipojo/examples/junit4osgi/junit4osgi/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/ipojo/examples/junit4osgi/junit4osgi/NOTICE b/ipojo/examples/junit4osgi/junit4osgi/NOTICE
new file mode 100644
index 0000000..9c51625
--- /dev/null
+++ b/ipojo/examples/junit4osgi/junit4osgi/NOTICE
@@ -0,0 +1,22 @@
+Apache Felix iPOJO junit4osgi Framework
+Copyright 2008 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed by
+Junit project (http://junit.org)
+Licensed under Common Public License 1.0.
+
+II. Used Software
+
+This product uses software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
+- Common Public License 1.0
diff --git a/ipojo/examples/junit4osgi/junit4osgi/metadata.xml b/ipojo/examples/junit4osgi/junit4osgi/metadata.xml
index 9fd4d99..db0dc94 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/metadata.xml
+++ b/ipojo/examples/junit4osgi/junit4osgi/metadata.xml
@@ -1,3 +1,21 @@
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
+-->
 <?xml version="1.0" encoding="UTF-8"?>
 <ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd 
diff --git a/ipojo/examples/junit4osgi/junit4osgi/pom.xml b/ipojo/examples/junit4osgi/junit4osgi/pom.xml
index 2737035..26db137 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/pom.xml
+++ b/ipojo/examples/junit4osgi/junit4osgi/pom.xml
@@ -21,7 +21,7 @@
 	<packaging>bundle</packaging>
 	<name>Junit4Osgi</name>
 	<artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-	<groupId>ipojo.examples</groupId>
+	<groupId>org.apache.felix</groupId>
 	<version>1.1.0-SNAPSHOT</version>
 	<dependencies>
 		<dependency>
@@ -79,6 +79,8 @@
 							org.apache.felix.ipojo.junit4osgi.test.TestTestSuite,
 							org.apache.felix.ipojo.junit4osgi.test.TestOSGiTestSuite,
 						</Test-Suite>  -->
+						<Include-Resource> META-INF/LICENCE=LICENSE,
+							META-INF/NOTICE=NOTICE </Include-Resource>
 					</instructions>
 				</configuration>
 			</plugin>
@@ -97,6 +99,29 @@
 					</execution>
 				</executions>
 			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>rat-maven-plugin</artifactId>
+				<configuration>
+					<excludeSubProjects>false</excludeSubProjects>
+					<useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+					<useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+					<excludes>
+						<param>doc/*</param>
+						<param>maven-eclipse.xml</param>
+						<param>.checkstyle</param>
+						<param>.externalToolBuilders/*</param>
+					</excludes>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-checkstyle-plugin</artifactId>
+				<configuration>
+					<configLocation>http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml</configLocation>
+					<violationSeverity>error</violationSeverity>
+				</configuration>
+			</plugin>
 		</plugins>
 	</build>
 </project>
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/Helper.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/Helper.java
new file mode 100644
index 0000000..9909b68
--- /dev/null
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/Helper.java
@@ -0,0 +1,58 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.junit4osgi;
+
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * Helper abstract class.
+ * Helper objects aim to facilitate Test writing.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public abstract class Helper {
+    
+    /**
+     * The bundle context.
+     */
+    protected BundleContext m_context;
+    
+    /**
+     * The OSGi Test case. 
+     */
+    protected OSGiTestCase m_testcase;
+          
+    /**
+     * Creates a Helper.
+     * Registers the helper.
+     * Sub-classes must initialize the session.
+     * @param tc the OSGi Test Case
+     */
+    public Helper(OSGiTestCase tc) {
+        m_testcase = tc;
+        m_context = m_testcase.getBundleContext();
+        tc.addHelper(this);
+    }
+    
+    /**
+     * Rolls back the session. 
+     */
+    public abstract void dispose();
+
+}
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiJunitRunner.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiJunitRunner.java
index 7998a55..334e311 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiJunitRunner.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiJunitRunner.java
@@ -32,7 +32,7 @@
     
     /**
      * Set the output stream of the runner.
-     * @param ps : print stream.
+     * @param ps the print stream.
      */
     void setResultPrinter(PrintStream ps);
     
@@ -44,7 +44,7 @@
     
     /**
      * Run the tests from the given bundle.
-     * @param bundleId : bundle containing the tests. 
+     * @param bundleId the bundle id containing the tests. 
      * @return the list of the test results.
      */
     List/*<TestResult>*/ run(long bundleId);
@@ -57,16 +57,16 @@
     
     /**
      * Get the tests from the given bundle. 
-     * @param bundleId : bundle id.
+     * @param bundleId the bundle id.
      * @return the list of Test contained in the given bundle.
      */
     List/*<Test>*/ getTests(long bundleId);
     
     /**
      * Run the given test.
-     * @param test : test to execute.
+     * @param test the test to execute.
      * @return the result.
      */
-    public TestResult run(Test test);
+    TestResult run(Test test);
 
 }
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java
index 6a860ad..952f823 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestCase.java
@@ -29,441 +29,538 @@
 import org.osgi.framework.ServiceReference;
 
 /**
- * OSGi Test Case. Allow the injection of the bundle context.
+ * OSGi Test Case. 
+ * Allows the injection of the bundle context.
  * 
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class OSGiTestCase extends TestCase {
 
-	protected BundleContext context;
-	
-	
-	private List references = new ArrayList();
-	
+    /**
+     * The bundle context.
+     */
+    protected BundleContext context;
+
+    /**
+     * List of get references.
+     */
+    private List m_references = new ArrayList();
+    
+    /**
+     * List of helpers.
+     */
+    private List m_helpers = new ArrayList();
+    
+    /**
+     * Gets the Bundle Context.
+     * @return the bundle context.
+     */
+    public BundleContext getContext() {
+        return context;
+    }
+    
+    /**
+     * Add an helper.
+     * This method is called by the {@link Helper#Helper(OSGiTestCase)}
+     * method.
+     * @param helper the helper object.
+     */
+    public void addHelper(Helper helper) {
+        m_helpers.add(helper);
+    }
+
     /**
      * Extends runBare to release (unget) services after the teardown.
      * @throws Throwable when an error occurs.
      * @see junit.framework.TestCase#runBare()
      */
     public void runBare() throws Throwable {
-	    super.runBare();
-	    // Unget services
-	    for (int i = 0; i < references.size(); i++) {
-	        context.ungetService((ServiceReference) references.get(i));
-	    }
-	    references.clear();
-	}
+        setUp();
+        try {
+            runTest();
+        } finally {
+            tearDown();
+            // Stop Helpers
+            for (int i = 0; i < m_helpers.size(); i++) {
+                ((Helper) m_helpers.get(i)).dispose();
+            }
+            // Unget services
+            for (int i = 0; i < m_references.size(); i++) {
+                context.ungetService((ServiceReference) m_references.get(i));
+            }
+            m_references.clear();
+        }
+        
+    }
 
-	public void setBundleContext(BundleContext bc) {
-		context = bc;
-	}
-	
-	public BundleContext getBundleContext() {
-	    return context;
-	}
+    public void setBundleContext(BundleContext bc) {
+        context = bc;
+    }
 
-	public static void assertContains(String message, String[] array, String txt) {
-		for (int i = 0; i < array.length; i++) {
-			if (array[i].equals(txt)) {
-				return;
-			}
-		}
-		fail(formatContainsMessage(message, array, txt));
-	}
+    public BundleContext getBundleContext() {
+        return context;
+    }
 
-	public static void assertContains(String message, byte[] array, int txt) {
-		for (int i = 0; i < array.length; i++) {
-			if (array[i] == txt) {
-				return;
-			}
-		}
-		Byte[] bytes = new Byte[array.length];
-		for (int i = 0; i < array.length; i++) {
-			bytes[i] = new Byte(array[i]);
-		}
-		fail(formatContainsMessage(message, bytes, new Integer(txt)));
-	}
+    /**
+     * Checks that the given string is contained in the given array.
+     * @param message the assert point message
+     * @param array the String array
+     * @param txt the String to search
+     */
+    public static void assertContains(String message, String[] array, String txt) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i].equals(txt)) {
+                return;
+            }
+        }
+        fail(formatContainsMessage(message, array, txt));
+    }
 
-	public static void assertContains(String message, short[] array, int txt) {
-		for (int i = 0; i < array.length; i++) {
-			if (array[i] == txt) {
-				return;
-			}
-		}
-		Short[] bytes = new Short[array.length];
-		for (int i = 0; i < array.length; i++) {
-			bytes[i] = new Short(array[i]);
-		}
-		fail(formatContainsMessage(message, bytes, new Integer(txt)));
-	}
+    /**
+     * Checks that the given integer is contained in the given array.
+     * @param message the assert point message
+     * @param array the byte array
+     * @param num the number to search
+     */
+    public static void assertContains(String message, byte[] array, int num) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == num) {
+                return;
+            }
+        }
+        Byte[] bytes = new Byte[array.length];
+        for (int i = 0; i < array.length; i++) {
+            bytes[i] = new Byte(array[i]);
+        }
+        fail(formatContainsMessage(message, bytes, new Integer(num)));
+    }
 
-	public static void assertContains(String message, int[] array, int txt) {
-		for (int i = 0; i < array.length; i++) {
-			if (array[i] == txt) {
-				return;
-			}
-		}
-		Integer[] bytes = new Integer[array.length];
-		for (int i = 0; i < array.length; i++) {
-			bytes[i] = new Integer(array[i]);
-		}
-		fail(formatContainsMessage(message, bytes, new Integer(txt)));
-	}
+    /**
+     * Checks that the given integer is contained in the given array.
+     * @param message the assert point message
+     * @param array the short array
+     * @param num the number to search
+     */
+    public static void assertContains(String message, short[] array, int num) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == num) {
+                return;
+            }
+        }
+        Short[] bytes = new Short[array.length];
+        for (int i = 0; i < array.length; i++) {
+            bytes[i] = new Short(array[i]);
+        }
+        fail(formatContainsMessage(message, bytes, new Integer(num)));
+    }
 
-	public static void assertContains(String message, long[] array, long txt) {
-		for (int i = 0; i < array.length; i++) {
-			if (array[i] == txt) {
-				return;
-			}
-		}
-		Long[] bytes = new Long[array.length];
-		for (int i = 0; i < array.length; i++) {
-			bytes[i] = new Long(array[i]);
-		}
-		fail(formatContainsMessage(message, bytes, new Long(txt)));
-	}
+    /**
+     * Checks that the given integer is contained in the given array.
+     * @param message the assert point message
+     * @param array the integer array
+     * @param num the number to search
+     */
+    public static void assertContains(String message, int[] array, int num) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == num) {
+                return;
+            }
+        }
+        Integer[] bytes = new Integer[array.length];
+        for (int i = 0; i < array.length; i++) {
+            bytes[i] = new Integer(array[i]);
+        }
+        fail(formatContainsMessage(message, bytes, new Integer(num)));
+    }
 
-	public static void assertContains(String message, float[] array, float txt) {
-		for (int i = 0; i < array.length; i++) {
-			if (array[i] == txt) {
-				return;
-			}
-		}
-		Float[] bytes = new Float[array.length];
-		for (int i = 0; i < array.length; i++) {
-			bytes[i] = new Float(array[i]);
-		}
-		fail(formatContainsMessage(message, bytes, new Float(txt)));
-	}
+    /**
+     * Checks that the given long is contained in the given array.
+     * @param message the assert point message
+     * @param array the long array
+     * @param num the number to search
+     */
+    public static void assertContains(String message, long[] array, long num) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == num) {
+                return;
+            }
+        }
+        Long[] bytes = new Long[array.length];
+        for (int i = 0; i < array.length; i++) {
+            bytes[i] = new Long(array[i]);
+        }
+        fail(formatContainsMessage(message, bytes, new Long(num)));
+    }
 
-	public static void assertContains(String message, double[] array, double txt) {
-		for (int i = 0; i < array.length; i++) {
-			if (array[i] == txt) {
-				return;
-			}
-		}
-		Double[] bytes = new Double[array.length];
-		for (int i = 0; i < array.length; i++) {
-			bytes[i] = new Double(array[i]);
-		}
-		fail(formatContainsMessage(message, bytes, new Double(txt)));
-	}
+    /**
+     * Checks that the given float is contained in the given array.
+     * @param message the assert point message
+     * @param array the float array
+     * @param num the number to search
+     */
+    public static void assertContains(String message, float[] array, float num) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == num) {
+                return;
+            }
+        }
+        Float[] bytes = new Float[array.length];
+        for (int i = 0; i < array.length; i++) {
+            bytes[i] = new Float(array[i]);
+        }
+        fail(formatContainsMessage(message, bytes, new Float(num)));
+    }
 
-	public static void assertContains(String message, char[] array, char txt) {
-		for (int i = 0; i < array.length; i++) {
-			if (array[i] == txt) {
-				return;
-			}
-		}
-		Character[] bytes = new Character[array.length];
-		for (int i = 0; i < array.length; i++) {
-			bytes[i] = new Character(array[i]);
-		}
-		fail(formatContainsMessage(message, bytes, new Character(txt)));
-	}
+    /**
+     * Checks that the given double is contained in the given array.
+     * @param message the assert point message
+     * @param array the double array
+     * @param num the number to search
+     */
+    public static void assertContains(String message, double[] array, double num) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == num) {
+                return;
+            }
+        }
+        Double[] bytes = new Double[array.length];
+        for (int i = 0; i < array.length; i++) {
+            bytes[i] = new Double(array[i]);
+        }
+        fail(formatContainsMessage(message, bytes, new Double(num)));
+    }
 
-	/**
-	 * Asserts that two doubles are equal. If they are not an
-	 * AssertionFailedError is thrown with the given message.
-	 */
-	public static void assertEquals(String message, double expected,
-			double actual) {
-		if (expected != actual) {
-			fail(formatEqualsMessage(message, new Double(expected), new Double(
-					actual)));
-		}
-	}
+    /**
+     * Checks that the given character is contained in the given array.
+     * @param message the assert point message
+     * @param array the character array
+     * @param character the character to search
+     */
+    public static void assertContains(String message, char[] array, char character) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == character) {
+                return;
+            }
+        }
+        Character[] bytes = new Character[array.length];
+        for (int i = 0; i < array.length; i++) {
+            bytes[i] = new Character(array[i]);
+        }
+        fail(formatContainsMessage(message, bytes, new Character(character)));
+    }
 
-	public static void assertNotEquals(String message, Object o1, Object o2) {
-		if (o1.equals(o2)) {
-			fail(formatNotEqualsMessage(message, o1, o2));
-		}
-	}
+    /**
+     * Asserts that two doubles are equal. If they are not an
+     * AssertionFailedError is thrown with the given message.
+     * @param message the assert point message
+     * @param expected the expected double
+     * @param actual the received double
+     */
+    public static void assertEquals(String message, double expected,
+            double actual) {
+        if (expected != actual) {
+            fail(formatEqualsMessage(message, new Double(expected), new Double(
+                    actual)));
+        }
+    }
 
-	public static boolean contains(String string, String[] array) {
-		for (int i = 0; array != null && i < array.length; i++) {
-			if (array[i] != null && array[i].equals(string)) {
-				return true;
-			}
-		}
-		return false;
-	}
+    /**
+     * Asserts that two objects are not equal. If they are an
+     * AssertionFailedError is thrown with the given message.
+     * @param message the assert point message
+     * @param o1 the unexpected object
+     * @param o2 the received object
+     */
+    public static void assertNotEquals(String message, Object o1, Object o2) {
+        if (o1.equals(o2)) {
+            fail(formatNotEqualsMessage(message, o1, o2));
+        }
+    }
 
-	public static boolean contains(int value, int[] array) {
-		for (int i = 0; array != null && i < array.length; i++) {
-			if (array[i] == value) {
-				return true;
-			}
-		}
-		return false;
-	}
+    /**
+     * Checks that the given string is contained in the given array.
+     * @param string the String to search
+     * @param array the String array
+     * @return <code>true</code> if the array contains the string
+     */
+    public static boolean contains(String string, String[] array) {
+        for (int i = 0; array != null && i < array.length; i++) {
+            if (array[i] != null && array[i].equals(string)) {
+                return true;
+            }
+        }
+        return false;
+    }
 
-	private static String formatEqualsMessage(String message, Object expected,
-			Object actual) {
-		String formatted = "";
-		if (message != null) {
-			formatted = message + " ";
-		}
-		return formatted + "expected:<" + expected + "> but was:<" + actual
-				+ ">";
-	}
+    /**
+     * Checks that the given integer is contained in the given array.
+     * @param value the number to search
+     * @param array the integer array
+     * @return <code>true</code> if the array contains the value
+     */
+    public static boolean contains(int value, int[] array) {
+        for (int i = 0; array != null && i < array.length; i++) {
+            if (array[i] == value) {
+                return true;
+            }
+        }
+        return false;
+    }
 
-	private static String formatNotEqualsMessage(String message, Object o1,
-			Object o2) {
-		String formatted = "";
-		if (message != null) {
-			formatted = message + " ";
-		}
-		return formatted + "o1:<" + o1 + "> is equals to o2:<" + o2 + ">";
-	}
+    /**
+     * Formats a failure message for 'equality' tests.
+     * @param message the assertion point message
+     * @param expected the expected value
+     * @param actual the received value
+     * @return the computed message
+     */
+    private static String formatEqualsMessage(String message, Object expected,
+            Object actual) {
+        String formatted = "";
+        if (message != null) {
+            formatted = message + " ";
+        }
+        return formatted + "expected:<" + expected + "> but was:<" + actual
+                + ">";
+    }
 
-	private static String formatContainsMessage(String message, Object[] array,
-			Object txt) {
-		String formatted = "";
-		if (message != null) {
-			formatted = message + " ";
-		}
+    /**
+     * Formats a failure message for 'un-equality' tests.
+     * @param message the assertion point message
+     * @param o1 the unexpected value
+     * @param o2 the received value
+     * @return the computed message
+     */
+    private static String formatNotEqualsMessage(String message, Object o1,
+            Object o2) {
+        String formatted = "";
+        if (message != null) {
+            formatted = message + " ";
+        }
+        return formatted + "o1:<" + o1 + "> is equals to o2:<" + o2 + ">";
+    }
 
-		String arr = null;
-		for (int i = 0; i < array.length; i++) {
-			if (arr == null) {
-				arr = "[" + array[i];
-			} else {
-				arr += "," + array[i];
-			}
-		}
-		arr += "]";
+    /**
+     * Formats a failure message for 'contains' tests.
+     * @param message the assertion point message
+     * @param array the array
+     * @param txt the looked value
+     * @return the computed message
+     */
+    private static String formatContainsMessage(String message, Object[] array,
+            Object txt) {
+        String formatted = "";
+        if (message != null) {
+            formatted = message + " ";
+        }
 
-		return formatted + "array:" + arr + " does not contains:<" + txt + ">";
-	}
+        String arr = null;
+        for (int i = 0; i < array.length; i++) {
+            if (arr == null) {
+                arr = "[" + array[i];
+            } else {
+                arr += "," + array[i];
+            }
+        }
+        arr += "]";
 
-	
+        return formatted + "array:" + arr + " does not contains:<" + txt + ">";
+    }
 
-	/**
-	 * Returns the service object of a service provided by the specified bundle,
-	 * offering the specified interface and matching the given filter.
-	 * 
-	 * @param bundle
-	 *            the bundle in which the service is searched.
-	 * @param itf
-	 *            the interface provided by the searched service.
-	 * @param filter
-	 *            an additional filter (can be {@code null}).
-	 * @return the service object provided by the specified bundle, offering the
-	 *         specified interface and matching the given filter.
-	 */
-	public static Object getServiceObject(Bundle bundle, String itf,
-			String filter) {
-		ServiceReference ref = getServiceReference(bundle, itf, filter);
-		if (ref != null) {
-			return bundle.getBundleContext().getService(ref);
-		} else {
-			return null;
-		}
-	}
+    /**
+     * Returns the service object of a service provided by the specified bundle,
+     * offering the specified interface and matching the given filter.
+     * 
+     * @param bundle the bundle from which the service is searched.
+     * @param itf the interface provided by the searched service.
+     * @param filter an additional filter (can be {@code null}).
+     * @return the service object provided by the specified bundle, offering the
+     *         specified interface and matching the given filter.
+     */
+    public static Object getServiceObject(Bundle bundle, String itf,
+            String filter) {
+        ServiceReference ref = getServiceReference(bundle, itf, filter);
+        if (ref != null) {
+            return bundle.getBundleContext().getService(ref);
+        } else {
+            return null;
+        }
+    }
 
+    /**
+     * Returns the service objects of the services provided by the specified
+     * bundle, offering the specified interface and matching the given filter.
+     * 
+     * @param bundle the bundle from which services are searched.
+     * @param itf the interface provided by the searched services.
+     * @param filter an additional filter (can be {@code null}).
+     * @return the service objects provided by the specified bundle, offering
+     *         the specified interface and matching the given filter.
+     */
+    public static Object[] getServiceObjects(Bundle bundle, String itf,
+            String filter) {
+        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
+        if (refs != null) {
+            Object[] list = new Object[refs.length];
+            for (int i = 0; i < refs.length; i++) {
+                list[i] = bundle.getBundleContext().getService(refs[i]);
+            }
+            return list;
+        } else {
+            return new Object[0];
+        }
+    }
 
-	/**
-	 * Returns the service objects of the services provided by the specified
-	 * bundle, offering the specified interface and matching the given filter.
-	 * 
-	 * @param bundle
-	 *            the bundle in which services are searched.
-	 * @param itf
-	 *            the interface provided by the searched services.
-	 * @param filter
-	 *            an additional filter (can be {@code null}).
-	 * @return the service objects provided by the specified bundle, offering
-	 *         the specified interface and matching the given filter.
-	 */
-	public static Object[] getServiceObjects(Bundle bundle, String itf,
-			String filter) {
-		ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-		if (refs != null) {
-			Object[] list = new Object[refs.length];
-			for (int i = 0; i < refs.length; i++) {
-				list[i] = bundle.getBundleContext().getService(refs[i]);
-			}
-			return list;
-		} else {
-			return new Object[0];
-		}
-	}
+    /**
+     * Returns the service reference of a service provided by the specified
+     * bundle, offering the specified interface and matching the given filter.
+     * 
+     * @param bundle the bundle from which the service is searched.
+     * @param itf the interface provided by the searched service.
+     * @param filter an additional filter (can be {@code null}).
+     * @return a service reference provided by the specified bundle, offering
+     *         the specified interface and matching the given filter. If no
+     *         service is found, {@code null} is returned.
+     */
+    public static ServiceReference getServiceReference(Bundle bundle,
+            String itf, String filter) {
+        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
+        if (refs.length != 0) {
+            return refs[0];
+        } else {
+            // No service found
+            return null;
+        }
+    }
 
-
-
-	/**
-	 * Returns the service reference of a service provided by the specified
-	 * bundle, offering the specified interface and matching the given filter.
-	 * 
-	 * @param bundle
-	 *            the bundle in which the service is searched.
-	 * @param itf
-	 *            the interface provided by the searched service.
-	 * @param filter
-	 *            an additional filter (can be {@code null}).
-	 * @return a service reference provided by the specified bundle, offering
-	 *         the specified interface and matching the given filter. If no
-	 *         service is found, {@code null} is returned.
-	 */
-	public static ServiceReference getServiceReference(Bundle bundle,
-			String itf, String filter) {
-		ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-		if (refs.length != 0) {
-			return refs[0];
-		} else {
-			// No service found
-			return null;
-		}
-	}
-	
-	/**
-	 * Checks if the service is available.
-	 * @param itf the service interface
-	 * @return <code>true</code> if the service is available,
-	 * <code>false</code> otherwise.
-	 */
-	public boolean isServiceAvailable(String itf) {
+    /**
+     * Checks if the service is available.
+     * @param itf the service interface
+     * @return <code>true</code> if the service is available, <code>false</code>
+     *         otherwise.
+     */
+    public boolean isServiceAvailable(String itf) {
         ServiceReference ref = getServiceReference(itf, null);
         return ref != null;
     }
-    
+
     /**
      * Checks if the service is available.
      * @param itf the service interface
      * @param pid the service pid
-     * @return <code>true</code> if the service is available,
-     * <code>false</code> otherwise.
+     * @return <code>true</code> if the service is available, <code>false</code>
+     *         otherwise.
      */
     public boolean isServiceAvailableByPID(String itf, String pid) {
         ServiceReference ref = getServiceReferenceByPID(itf, pid);
         return ref != null;
     }
 
-	
-
-	/**
-	 * Returns the service reference of the service provided by the specified
-	 * bundle, offering the specified interface and having the given persistent
-	 * ID.
-	 * 
-	 * @param bundle
-	 *            the bundle in which the service is searched.
-	 * @param itf
-	 *            the interface provided by the searched service.
-	 * @param pid
-	 *            the persistent ID of the searched service.
-	 * @return a service provided by the specified bundle, offering the
-	 *         specified interface and having the given persistent ID.
-	 */
-	public static ServiceReference getServiceReferenceByPID(Bundle bundle,
-			String itf, String pid) {
-		String filter = "(" + "service.pid" + "=" + pid + ")";
-		ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-		if (refs == null) {
-			return null;
-		} else if (refs.length == 1) {
-			return refs[0];
-		} else {
-			throw new IllegalStateException(
-					"A service lookup by PID returned several providers ("
-							+ refs.length + ")" + " for " + itf + " with pid="
-							+ pid);
-		}
-	}
-
-	
-
-	/**
-	 * Returns the service reference of all the services provided in the
-	 * specified bundle, offering the specified interface and matching the given
-	 * filter.
-	 * 
-	 * @param bundle
-	 *            the bundle in which services are searched.
-	 * @param itf
-	 *            the interface provided by the searched services.
-	 * @param filter
-	 *            an additional filter (can be {@code null}).
-	 * @return all the service references provided in the specified bundle,
-	 *         offering the specified interface and matching the given filter.
-	 *         If no service matches, an empty array is returned.
-	 */
-	public static ServiceReference[] getServiceReferences(Bundle bundle,
-			String itf, String filter) {
-		ServiceReference[] refs = null;
-		try {
-			// Get all the service references
-			refs = bundle.getBundleContext().getServiceReferences(itf, filter);
-		} catch (InvalidSyntaxException e) {
-			throw new IllegalArgumentException(
-					"Cannot get service references: " + e.getMessage());
-		}
-		if (refs == null) {
-			return new ServiceReference[0];
-		} else {
-			return refs;
-		}
-	}
-
-	
-	
-	/**
-	 * Returns the service object of a service provided by the local bundle,
-	 * offering the specified interface and matching the given filter.
-	 * 
-	 * @param itf
-	 *            the interface provided by the searched service.
-	 * @param filter
-	 *            an additional filter (can be {@code null}).
-	 * @return the service object provided by the local bundle, offering the
-	 *         specified interface and matching the given filter.
-	 */
-	public Object getServiceObject(String itf, String filter) {
-		ServiceReference ref = getServiceReference(itf, filter);
-        if (ref != null) {
-            references.add(ref);
-            return context.getService(ref);
-        } else {
-            return null;
-        }
-	}
-	
-	   
-	/**
-     * Returns the service object associated with this service
-     * reference.
+    /**
+     * Returns the service reference of the service provided by the specified
+     * bundle, offering the specified interface and having the given persistent
+     * ID.
      * 
-     * @param ref
-     *            service reference
-     * @return the service object.
+     * @param bundle the bundle from which the service is searched.
+     * @param itf the interface provided by the searched service.
+     * @param pid the persistent ID of the searched service.
+     * @return a service provided by the specified bundle, offering the
+     *         specified interface and having the given persistent ID.
      */
-    public Object getServiceObject(ServiceReference ref) {
+    public static ServiceReference getServiceReferenceByPID(Bundle bundle,
+            String itf, String pid) {
+        String filter = "(" + "service.pid" + "=" + pid + ")";
+        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
+        if (refs == null) {
+            return null;
+        } else if (refs.length == 1) {
+            return refs[0];
+        } else {
+            throw new IllegalStateException(
+                    "A service lookup by PID returned several providers ("
+                            + refs.length + ")" + " for " + itf + " with pid="
+                            + pid);
+        }
+    }
+
+    /**
+     * Returns the service reference of all the services provided in the
+     * specified bundle, offering the specified interface and matching the given
+     * filter.
+     * 
+     * @param bundle the bundle from which services are searched.
+     * @param itf the interface provided by the searched services.
+     * @param filter an additional filter (can be {@code null}).
+     * @return all the service references provided in the specified bundle,
+     *         offering the specified interface and matching the given filter.
+     *         If no service matches, an empty array is returned.
+     */
+    public static ServiceReference[] getServiceReferences(Bundle bundle,
+            String itf, String filter) {
+        ServiceReference[] refs = null;
+        try {
+            // Get all the service references
+            refs = bundle.getBundleContext().getServiceReferences(itf, filter);
+        } catch (InvalidSyntaxException e) {
+            throw new IllegalArgumentException(
+                    "Cannot get service references: " + e.getMessage());
+        }
+        if (refs == null) {
+            return new ServiceReference[0];
+        } else {
+            return refs;
+        }
+    }
+
+    /**
+     * Returns the service object of a service provided by the local bundle,
+     * offering the specified interface and matching the given filter.
+     * 
+     * @param itf the interface provided by the searched service.
+     * @param filter an additional filter (can be {@code null}).
+     * @return the service object provided by the local bundle, offering the
+     *         specified interface and matching the given filter.
+     */
+    public Object getServiceObject(String itf, String filter) {
+        ServiceReference ref = getServiceReference(itf, filter);
         if (ref != null) {
-            references.add(ref);
+            m_references.add(ref);
             return context.getService(ref);
         } else {
             return null;
         }
     }
 
-	/**
-	 * Returns the service objects of the services provided by the local
-	 * bundle, offering the specified interface and matching the given filter.
-	 * 
-	 * @param itf
-	 *            the interface provided by the searched services.
-	 * @param filter
-	 *            an additional filter (can be {@code null}).
-	 * @return the service objects provided by the local bundle, offering
-	 *         the specified interface and matching the given filter.
-	 */
-	public Object[] getServiceObjects(String itf, String filter) {
-	    ServiceReference[] refs = getServiceReferences(itf, filter);
+    /**
+     * Returns the service object associated with this service reference.
+     * 
+     * @param ref service reference
+     * @return the service object.
+     */
+    public Object getServiceObject(ServiceReference ref) {
+        if (ref != null) {
+            m_references.add(ref);
+            return context.getService(ref);
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Returns the service objects of the services provided by the local bundle,
+     * offering the specified interface and matching the given filter.
+     * 
+     * @param itf the interface provided by the searched services.
+     * @param filter an additional filter (can be {@code null}).
+     * @return the service objects provided by the local bundle, offering the
+     *         specified interface and matching the given filter.
+     */
+    public Object[] getServiceObjects(String itf, String filter) {
+        ServiceReference[] refs = getServiceReferences(itf, filter);
         if (refs != null) {
             Object[] list = new Object[refs.length];
             for (int i = 0; i < refs.length; i++) {
-                references.add(refs[i]);
+                m_references.add(refs[i]);
                 list[i] = context.getService(refs[i]);
             }
             return list;
@@ -472,69 +569,59 @@
         }
     }
 
-	/**
-	 * Returns the service reference of a service provided by the local
-	 * bundle, offering the specified interface and matching the given filter.
-	 * 
-	 * @param itf
-	 *            the interface provided by the searched service.
-	 * @param filter
-	 *            an additional filter (can be {@code null}).
-	 * @return a service reference provided by the local bundle, offering
-	 *         the specified interface and matching the given filter. If no
-	 *         service is found, {@code null} is returned.
-	 */
-	public ServiceReference getServiceReference(String itf, String filter) {
-		return getServiceReference(context.getBundle(), itf, filter);
-	}
-	
-	/**
-     * Returns the service reference of a service provided 
-     * offering the specified interface.
+    /**
+     * Returns the service reference of a service provided by the local bundle,
+     * offering the specified interface and matching the given filter.
      * 
-     * @param itf
-     *            the interface provided by the searched service.
-     * @return a service reference provided by the local bundle, offering
-     *         the specified interface and matching the given filter. If no
-     *         service is found, {@code null} is returned.
+     * @param itf the interface provided by the searched service.
+     * @param filter an additional filter (can be {@code null}).
+     * @return a service reference provided by the local bundle, offering the
+     *         specified interface and matching the given filter. If no service
+     *         is found, {@code null} is returned.
+     */
+    public ServiceReference getServiceReference(String itf, String filter) {
+        return getServiceReference(context.getBundle(), itf, filter);
+    }
+
+    /**
+     * Returns the service reference of a service provided offering the
+     * specified interface.
+     * 
+     * @param itf the interface provided by the searched service.
+     * @return a service reference provided by the local bundle, offering the
+     *         specified interface and matching the given filter. If no service
+     *         is found, {@code null} is returned.
      */
     public ServiceReference getServiceReference(String itf) {
         return getServiceReference(context.getBundle(), itf, null);
     }
 
-	/**
-	 * Returns the service reference of the service provided by the local
-	 * bundle, offering the specified interface and having the given persistent
-	 * ID.
-	 * 
-	 * @param itf
-	 *            the interface provided by the searched service.
-	 * @param pid
-	 *            the persistent ID of the searched service.
-	 * @return a service provided by the local bundle, offering the
-	 *         specified interface and having the given persistent ID.
-	 */
-	public ServiceReference getServiceReferenceByPID(String itf, String pid) {
-		return getServiceReferenceByPID(context.getBundle(), itf, pid);
-	}
+    /**
+     * Returns the service reference of the service provided by the local
+     * bundle, offering the specified interface and having the given persistent
+     * ID.
+     * 
+     * @param itf the interface provided by the searched service.
+     * @param pid the persistent ID of the searched service.
+     * @return a service provided by the local bundle, offering the specified
+     *         interface and having the given persistent ID.
+     */
+    public ServiceReference getServiceReferenceByPID(String itf, String pid) {
+        return getServiceReferenceByPID(context.getBundle(), itf, pid);
+    }
 
-	/**
-	 * Returns the service reference of all the services provided in the
-	 * local bundle, offering the specified interface and matching the given
-	 * filter.
-	 * 
-	 * @param itf
-	 *            the interface provided by the searched services.
-	 * @param filter
-	 *            an additional filter (can be {@code null}).
-	 * @return all the service references provided in the local bundle,
-	 *         offering the specified interface and matching the given filter.
-	 *         If no service matches, an empty array is returned.
-	 */
-	public ServiceReference[] getServiceReferences(String itf, String filter) {
-		return getServiceReferences(context.getBundle(), itf, filter);
-	}
-	
-	
+    /**
+     * Returns the service reference of all the services provided in the local
+     * bundle, offering the specified interface and matching the given filter.
+     * 
+     * @param itf the interface provided by the searched services.
+     * @param filter an additional filter (can be {@code null}).
+     * @return all the service references provided in the local bundle, offering
+     *         the specified interface and matching the given filter. If no
+     *         service matches, an empty array is returned.
+     */
+    public ServiceReference[] getServiceReferences(String itf, String filter) {
+        return getServiceReferences(context.getBundle(), itf, filter);
+    }
 
 }
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestSuite.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestSuite.java
index 8e7795a..581c14a 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestSuite.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/OSGiTestSuite.java
@@ -32,38 +32,71 @@
  */
 public class OSGiTestSuite extends TestSuite {
 
-    protected BundleContext context;
+    /**
+     * The bundle context of the bundle containing
+     * the test suite.
+     */
+    protected BundleContext m_context;
 
+    /**
+     * Creates a OSGiTestSuite.
+     * @param clazz the class
+     * @param bc the bundle context
+     * @see TestSuite#TestSuite(Class)
+     */
     public OSGiTestSuite(Class clazz, BundleContext bc) {
         super(clazz);
-        context = bc;
-    }
-
-    public OSGiTestSuite(BundleContext bc) {
-        super();
-        context = bc;
-    }
-
-    public OSGiTestSuite(String name, BundleContext bc) {
-        super(name);
-        context = bc;
-    }
-
-    public OSGiTestSuite(Class clazz, String name, BundleContext bc) {
-        super(clazz, name);
-        context = bc;
-    }
-
-    public void setBundleContext(BundleContext bc) {
-        context = bc;
+        m_context = bc;
     }
 
     /**
-     * Adds the tests from the given class to the suite
+     * Creates a OSGiTestSuite.
+     * @param bc the bundle context
+     * @see TestSuite#TestSuite()
+     */
+    public OSGiTestSuite(BundleContext bc) {
+        super();
+        m_context = bc;
+    }
+
+    /**
+     * Creates a OSGiTestSuite.
+     * @param name the name
+     * @param bc the bundle context
+     * @see TestSuite#TestSuite(String)
+     */
+    public OSGiTestSuite(String name, BundleContext bc) {
+        super(name);
+        m_context = bc;
+    }
+
+    /**
+     * Creates a OSGiTestSuite.
+     * @param clazz the class
+     * @param name the name
+     * @param bc the bundle context
+     * @see TestSuite#TestSuite(Class, String)
+     */
+    public OSGiTestSuite(Class clazz, String name, BundleContext bc) {
+        super(clazz, name);
+        m_context = bc;
+    }
+
+    /**
+     * Set the bundle context.
+     * @param bc the bundle context to use.
+     */
+    public void setBundleContext(BundleContext bc) {
+        m_context = bc;
+    }
+
+    /**
+     * Adds the tests from the given class to the suite.
+     * @param testClass the class to add
      */
     public void addTestSuite(Class testClass) {
         if (OSGiTestCase.class.isAssignableFrom(testClass)) {
-            addTest(new OSGiTestSuite(testClass, context));
+            addTest(new OSGiTestSuite(testClass, m_context));
         } else if (TestCase.class.isAssignableFrom(testClass)) {
             addTest(new TestSuite(testClass));
         } else {
@@ -71,12 +104,19 @@
         }
     }
 
+    /**
+     * Executes the given {@link Test} with the
+     * given {@link TestResult}.
+     * @param test the test
+     * @param result the test result.
+     * @see junit.framework.TestSuite#runTest(junit.framework.Test, junit.framework.TestResult)
+     */
     public void runTest(Test test, TestResult result) {
         if (test instanceof OSGiTestSuite) {
-            ((OSGiTestSuite) test).context = context;
+            ((OSGiTestSuite) test).m_context = m_context;
             test.run(result);
         } else if (test instanceof OSGiTestCase) {
-            ((OSGiTestCase) test).context = context;
+            ((OSGiTestCase) test).setBundleContext(m_context);
             test.run(result);
         } else {
             test.run(result);
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java
index 697a4c2..791fcfd 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/helpers/IPOJOHelper.java
@@ -29,6 +29,7 @@
 import org.apache.felix.ipojo.HandlerFactory;
 import org.apache.felix.ipojo.ServiceContext;
 import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.junit4osgi.Helper;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.ManifestMetadataParser;
@@ -39,47 +40,74 @@
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.cm.ManagedServiceFactory;
 
-public class IPOJOHelper {
-    
-    private BundleContext context;
-    private OSGiTestCase testcase;
-    
-    
-    private List instances;
-    
+/**
+ * iPOJO Helper.
+ * This helper helps getting {@link Factory}, and managing
+ * {@link ComponentInstance}.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class IPOJOHelper extends Helper {
+
+    /**
+     * The bundle context.
+     */
+    private BundleContext m_context;
+    /**
+     * The test case.
+     */
+    private OSGiTestCase m_testcase;
+
+    /**
+     * List of instances.
+     */
+    private List m_instances;
+
+    /**
+     * Creates a IPOJOHelper.
+     * @param tc the OSGi Test Case
+     */
     public IPOJOHelper(OSGiTestCase tc) {
-        testcase = tc;
-        context = testcase.getBundleContext();
-        instances = new ArrayList();
+        super(tc);
+        m_testcase = tc;
+        m_context = m_testcase.getBundleContext();
+        m_instances = new ArrayList();
     }
-    
+
+    /**
+     * Disposes created instances.
+     * @see org.apache.felix.ipojo.junit4osgi.Helper#dispose()
+     */
     public void dispose() {
-        for (int i = 0; i < instances.size(); i++) {
-            ((ComponentInstance) instances.get(i)).dispose();
+        for (int i = 0; i < m_instances.size(); i++) {
+            ((ComponentInstance) m_instances.get(i)).dispose();
         }
-        instances.clear();
+        m_instances.clear();
     }
-    
+
+    /**
+     * Gets a created instance from the instance name.
+     * @param name the instance name.
+     * @return the created {@link ComponentInstance} or <code>null</code>
+     * if the instance was not created during the session.
+     */
     public ComponentInstance getInstanceByName(String name) {
-        for (int i = 0; i < instances.size(); i++) {
-            if (((ComponentInstance) instances.get(i)).getInstanceName().equals(name)) {
-                return (ComponentInstance) instances.get(i);
+        for (int i = 0; i < m_instances.size(); i++) {
+            if (((ComponentInstance) m_instances.get(i)).getInstanceName()
+                    .equals(name)) {
+                return (ComponentInstance) m_instances.get(i);
             }
         }
         return null;
     }
-    
+
     /**
      * Creates a new component instance with the given name (and empty
      * configuration), from the factory specified in the given bundle.
      * 
-     * @param bundle
-     *            the bundle in which the component factory is defined.
-     * @param factoryName
-     *            the name of the component factory, defined in the specified
-     *            bundle.
-     * @param instanceName
-     *            the name of the component instance to create.
+     * @param bundle the bundle from which the component factory is defined.
+     * @param factoryName the name of the component factory, defined in the
+     *            specified bundle.
+     * @param instanceName the name of the component instance to create.
      * @return the newly created component instance.
      */
     public static ComponentInstance createComponentInstance(Bundle bundle,
@@ -96,13 +124,11 @@
      * Creates a new component instance with the given configuration, from the
      * factory specified in the given bundle.
      * 
-     * @param bundle
-     *            the bundle in which the component factory is defined.
-     * @param factoryName
-     *            the name of the component factory, defined in the specified
-     *            bundle.
-     * @param configuration
-     *            the configuration of the component instance to create.
+     * @param bundle the bundle from which the component factory is defined.
+     * @param factoryName the name of the component factory, defined in the
+     *            specified bundle.
+     * @param configuration the configuration of the component instance to
+     *            create.
      * @return the newly created component instance.
      */
     public static ComponentInstance createComponentInstance(Bundle bundle,
@@ -123,8 +149,8 @@
             return fact.createComponentInstance(configuration);
         } catch (Exception e) {
             throw new IllegalArgumentException(
-                    "Cannot create the component instance with the given configuration:" +
-                    e.getMessage());
+                    "Cannot create the component instance with the given configuration:"
+                            + e.getMessage());
         }
     }
 
@@ -132,15 +158,11 @@
      * Creates a new component instance with the given name and configuration,
      * from the factory specified in the given bundle.
      * 
-     * @param bundle
-     *            the bundle in which the component factory is defined.
-     * @param factoryName
-     *            the name of the component factory, defined in the specified
-     *            bundle.
-     * @param instanceName
-     *            the name of the component instance to create.
-     * @param configuration
-     *            the configuration of the instance to create.
+     * @param bundle the bundle from which the component factory is defined.
+     * @param factoryName the name of the component factory, defined in the
+     *            specified bundle.
+     * @param instanceName the name of the component instance to create.
+     * @param configuration the configuration of the instance to create.
      * @return the newly created component instance.
      */
     public static ComponentInstance createComponentInstance(Bundle bundle,
@@ -156,14 +178,11 @@
      * Creates a new component instance with the given name (and an empty
      * configuration), from the factory specified in the given service context.
      * 
-     * @param serviceContext
-     *            the service context in which the component factory service is
-     *            registered.
-     * @param factoryName
-     *            the name of the component factory, defined in the specified
-     *            service context.
-     * @param instanceName
-     *            the name of the component instance to create.
+     * @param serviceContext the service context in which the component factory
+     *            service is registered.
+     * @param factoryName the name of the component factory, defined in the
+     *            specified service context.
+     * @param instanceName the name of the component instance to create.
      * @return the newly created component instance.
      */
     public static ComponentInstance createComponentInstance(
@@ -182,14 +201,11 @@
      * Creates a new component instance with the given name and configuration,
      * from the factory specified in the given service context.
      * 
-     * @param serviceContext
-     *            the service context in which the component factory service is
-     *            registered.
-     * @param factoryName
-     *            the name of the component factory, defined in the specified
-     *            service context.
-     * @param configuration
-     *            the configuration of the instance to create.
+     * @param serviceContext the service context in which the component factory
+     *            service is registered.
+     * @param factoryName the name of the component factory, defined in the
+     *            specified service context.
+     * @param configuration the configuration of the instance to create.
      * @return the newly created component instance.
      */
     public static ComponentInstance createComponentInstance(
@@ -210,8 +226,8 @@
             return fact.createComponentInstance(configuration);
         } catch (Exception e) {
             throw new IllegalArgumentException(
-                    "Cannot create the component instance with the given configuration: " +
-                    e.getMessage());
+                    "Cannot create the component instance with the given configuration: "
+                            + e.getMessage());
         }
     }
 
@@ -219,16 +235,12 @@
      * Creates a new component instance with the given name and configuration,
      * from the factory specified in the given service context.
      * 
-     * @param serviceContext
-     *            the service context in which the component factory service is
-     *            registered.
-     * @param factoryName
-     *            the name of the component factory, defined in the specified
-     *            service context.
-     * @param instanceName
-     *            the name of the component instance to create.
-     * @param configuration
-     *            the configuration of the instance to create.
+     * @param serviceContext the service context in which the component factory
+     *            service is registered.
+     * @param factoryName the name of the component factory, defined in the
+     *            specified service context.
+     * @param instanceName the name of the component instance to create.
+     * @param configuration the configuration of the instance to create.
      * @return the newly created component instance.
      */
     public static ComponentInstance createComponentInstance(
@@ -241,23 +253,21 @@
         return createComponentInstance(serviceContext, factoryName,
                 configuration);
     }
-    
+
     /**
      * Creates a new component instance with the given name (and empty
      * configuration), from the factory specified in the local bundle.
      * 
-     * @param factoryName
-     *            the name of the component factory, defined in the local
-     *            bundle.
-     * @param instanceName
-     *            the name of the component instance to create.
+     * @param factoryName the name of the component factory, defined in the
+     *            local bundle.
+     * @param instanceName the name of the component instance to create.
      * @return the newly created component instance.
      */
     public ComponentInstance createComponentInstance(String factoryName,
             String instanceName) {
-        ComponentInstance ci = createComponentInstance(context.getBundle(), factoryName,
-                instanceName);
-        instances.add(ci);
+        ComponentInstance ci = createComponentInstance(m_context.getBundle(),
+                factoryName, instanceName);
+        m_instances.add(ci);
         return ci;
     }
 
@@ -265,32 +275,32 @@
      * Creates a new component instance with the given configuration, from the
      * factory specified in the local bundle.
      * 
-     * @param factoryName
-     *            the name of the component factory, in the local bundle.
-     * @param configuration
-     *            the configuration of the component instance to create.
+     * @param factoryName the name of the component factory, in the local
+     *            bundle.
+     * @param configuration the configuration of the component instance to
+     *            create.
      * @return the newly created component instance.
      */
     public ComponentInstance createComponentInstance(String factoryName,
             Dictionary configuration) {
-        ComponentInstance ci =  createComponentInstance(context.getBundle(), factoryName,
-                configuration);
-        instances.add(ci);
+        ComponentInstance ci = createComponentInstance(m_context.getBundle(),
+                factoryName, configuration);
+        m_instances.add(ci);
         return ci;
     }
-    
+
     /**
-     * Creates a new component instance with no configuration, from the
-     * factory specified in the local bundle.
+     * Creates a new component instance with no configuration, from the factory
+     * specified in the local bundle.
      * 
-     * @param factoryName
-     *            the name of the component factory, in the local bundle.
+     * @param factoryName the name of the component factory, in the local
+     *            bundle.
      * @return the newly created component instance.
      */
     public ComponentInstance createComponentInstance(String factoryName) {
-        ComponentInstance ci =  createComponentInstance(context.getBundle(), factoryName,
-                (Dictionary) null);
-        instances.add(ci);
+        ComponentInstance ci = createComponentInstance(m_context.getBundle(),
+                factoryName, (Dictionary) null);
+        m_instances.add(ci);
         return ci;
     }
 
@@ -298,68 +308,58 @@
      * Creates a new component instance with the given name and configuration,
      * from the factory specified in the given bundle.
      * 
-     * @param bundle
-     *            the bundle in which the component factory is defined.
-     * @param factoryName
-     *            the name of the component factory, defined in the specified
-     *            bundle.
-     * @param instanceName
-     *            the name of the component instance to create.
-     * @param configuration
-     *            the configuration of the instance to create.
+     * @param factoryName the name of the component factory, defined in the
+     *            specified bundle.
+     * @param instanceName the name of the component instance to create.
+     * @param configuration the configuration of the instance to create.
      * @return the newly created component instance.
      */
     public ComponentInstance createComponentInstance(String factoryName,
             String instanceName, Dictionary configuration) {
-        ComponentInstance ci = createComponentInstance(context.getBundle(), factoryName,
-                instanceName, configuration);
-        instances.add(ci);
+        ComponentInstance ci = createComponentInstance(m_context.getBundle(),
+                factoryName, instanceName, configuration);
+        m_instances.add(ci);
         return ci;
     }
 
     /**
      * Returns the component factory with the given name in the local bundle.
      * 
-     * @param factoryName
-     *            the name of the factory to retrieve.
+     * @param factoryName the name of the factory to retrieve.
      * @return the component factory with the given name in the local bundle, or
      *         {@code null} if not found.
      */
     public Factory getFactory(String factoryName) {
-        return getFactory(context.getBundle(), factoryName);
+        return getFactory(m_context.getBundle(), factoryName);
     }
 
     /**
      * Returns the handler factory with the given name in the local bundle.
      * 
-     * @param factoryName
-     *            the name of the handler factory to retrieve.
+     * @param factoryName the name of the handler factory to retrieve.
      * @return the handler factory with the given name in the local bundle, or
      *         {@code null} if not found.
      */
     public HandlerFactory getHandlerFactory(String factoryName) {
-        return getHandlerFactory(context.getBundle(), factoryName);
+        return getHandlerFactory(m_context.getBundle(), factoryName);
     }
 
     /**
      * Returns the metadata description of the component defined in this bundle.
      * 
-     * @param component
-     *            the name of the locally defined component.
+     * @param component the name of the locally defined component.
      * @return the metadata description of the component with the given name,
      *         defined in this given bundle, or {@code null} if not found.
      */
     public Element getMetadata(String component) {
-        return getMetadata(context.getBundle(), component);
+        return getMetadata(m_context.getBundle(), component);
     }
-    
+
     /**
      * Returns the component factory with the given name in the given bundle.
      * 
-     * @param bundle
-     *            the bundle in which the component factory is defined.
-     * @param factoryName
-     *            the name of the defined factory.
+     * @param bundle the bundle from which the component factory is defined.
+     * @param factoryName the name of the defined factory.
      * @return the component factory with the given name in the given bundle, or
      *         {@code null} if not found.
      */
@@ -371,7 +371,7 @@
                     Factory.class.getName(),
                     "(factory.name=" + factoryName + ")");
             if (refs != null) {
-                return ((Factory) bundle.getBundleContext().getService(refs[0]));
+                return (Factory) bundle.getBundleContext().getService(refs[0]);
             }
 
             // Factory not found...
@@ -379,7 +379,8 @@
 
         } catch (InvalidSyntaxException e) {
             throw new IllegalArgumentException(
-                    "Cannot get the component factory services: " + e.getMessage());
+                    "Cannot get the component factory services: "
+                            + e.getMessage());
         }
     }
 
@@ -387,10 +388,9 @@
      * Returns the component factory with the given name, registered in the
      * given service context.
      * 
-     * @param serviceContext
-     *            the service context in which the factory service is defined.
-     * @param factoryName
-     *            the name of the factory.
+     * @param serviceContext the service context in which the factory service is
+     *            defined.
+     * @param factoryName the name of the factory.
      * @return the component factory with the given name, registered in the
      *         given service context.
      */
@@ -403,7 +403,7 @@
             refs = serviceContext.getServiceReferences(Factory.class.getName(),
                     "(factory.name=" + factoryName + ")");
             if (refs != null) {
-                return ((Factory) serviceContext.getService(refs[0]));
+                return (Factory) serviceContext.getService(refs[0]);
             }
             return null;
 
@@ -417,10 +417,8 @@
     /**
      * Returns the handler factory with the given name in the given bundle.
      * 
-     * @param bundle
-     *            the bundle in which the handler factory is defined.
-     * @param factoryName
-     *            the name of the handler factory to retrieve.
+     * @param bundle the bundle from which the handler factory is defined.
+     * @param factoryName the name of the handler factory to retrieve.
      * @return the handler factory with the given name in the given bundle, or
      *         {@code null} if not found.
      */
@@ -442,7 +440,8 @@
             return null;
         } catch (InvalidSyntaxException e) {
             throw new IllegalArgumentException(
-                    "Cannot get the handler factory services: " + e.getMessage());
+                    "Cannot get the handler factory services: "
+                            + e.getMessage());
         }
     }
 
@@ -450,10 +449,8 @@
      * Returns the metadata description of the component with the given name,
      * defined in the given bundle.
      * 
-     * @param bundle
-     *            the bundle in which the component is defined.
-     * @param component
-     *            the name of the defined component.
+     * @param bundle the bundle from which the component is defined.
+     * @param component the name of the defined component.
      * @return the metadata description of the component with the given name,
      *         defined in the given bundle, or {@code null} if not found.
      */
@@ -493,18 +490,16 @@
                             + bundle.getSymbolicName() + "): " + e.getMessage());
         }
     }
-    
+
     /**
      * Returns the service object of a service registered in the specified
      * service context, offering the specified interface and matching the given
      * filter.
      * 
-     * @param serviceContext
-     *            the service context in which the service is searched.
-     * @param itf
-     *            the interface provided by the searched service.
-     * @param filter
-     *            an additional filter (can be {@code null}).
+     * @param serviceContext the service context in which the service is
+     *            searched.
+     * @param itf the interface provided by the searched service.
+     * @param filter an additional filter (can be {@code null}).
      * @return the service object provided by the specified bundle, offering the
      *         specified interface and matching the given filter.
      */
@@ -517,18 +512,15 @@
             return null;
         }
     }
-    
+
     /**
      * Returns the service objects of the services registered in the specified
      * service context, offering the specified interface and matching the given
      * filter.
      * 
-     * @param serviceContext
-     *            the service context in which services are searched.
-     * @param itf
-     *            the interface provided by the searched services.
-     * @param filter
-     *            an additional filter (can be {@code null}).
+     * @param serviceContext the service context in which services are searched.
+     * @param itf the interface provided by the searched services.
+     * @param filter an additional filter (can be {@code null}).
      * @return the service objects provided by the specified bundle, offering
      *         the specified interface and matching the given filter.
      */
@@ -546,18 +538,15 @@
             return new Object[0];
         }
     }
-    
+
     /**
      * Returns the service reference of a service registered in the specified
      * service context, offering the specified interface and matching the given
      * filter.
      * 
-     * @param serviceContext
-     *            the service context in which services are searched.
-     * @param itf
-     *            the interface provided by the searched service.
-     * @param filter
-     *            an additional filter (can be {@code null}).
+     * @param serviceContext the service context in which services are searched.
+     * @param itf the interface provided by the searched service.
+     * @param filter an additional filter (can be {@code null}).
      * @return a service reference registered in the specified service context,
      *         offering the specified interface and matching the given filter.
      *         If no service is found, {@code null} is returned.
@@ -573,18 +562,15 @@
             return null;
         }
     }
-    
+
     /**
      * Returns the service reference of the service registered in the specified
      * service context, offering the specified interface and having the given
      * persistent ID.
      * 
-     * @param serviceContext
-     *            the service context in which services are searched.
-     * @param itf
-     *            the interface provided by the searched service.
-     * @param pid
-     *            the persistent ID of the searched service.
+     * @param serviceContext the service context in which services are searched.
+     * @param itf the interface provided by the searched service.
+     * @param pid the persistent ID of the searched service.
      * @return a service registered in the specified service context, offering
      *         the specified interface and having the given persistent ID.
      */
@@ -604,18 +590,15 @@
                             + pid);
         }
     }
-    
+
     /**
      * Returns the service reference of all the services registered in the
      * specified service context, offering the specified interface and matching
      * the given filter.
      * 
-     * @param serviceContext
-     *            the service context in which services are searched.
-     * @param itf
-     *            the interface provided by the searched services.
-     * @param filter
-     *            an additional filter (can be {@code null}).
+     * @param serviceContext the service context in which services are searched.
+     * @param itf the interface provided by the searched services.
+     * @param filter an additional filter (can be {@code null}).
      * @return all the service references registered in the specified service
      *         context, offering the specified interface and matching the given
      *         filter. If no service matches, an empty array is returned.
@@ -637,18 +620,14 @@
         }
     }
 
-    
     /**
      * Returns the service reference of a service registered in the specified
      * service context, offering the specified interface and having the given
      * name.
      * 
-     * @param serviceContext
-     *            the service context in which services are searched.
-     * @param itf
-     *            the interface provided by the searched service.
-     * @param name
-     *            the name of the searched service.
+     * @param serviceContext the service context in which services are searched.
+     * @param itf the interface provided by the searched service.
+     * @param name the name of the searched service.
      * @return a service registered in the specified service context, offering
      *         the specified interface and having the given name.
      */
@@ -665,56 +644,54 @@
         }
         return getServiceReference(serviceContext, itf, filter);
     }
-    
+
     /**
      * Checks the availability of a service inside the given service context.
      * @param sc the service context
      * @param itf the service interface to found
      * @return <code>true</code> if the service is available in the service
-     * context, <code>false</code> otherwise.
+     *         context, <code>false</code> otherwise.
      */
     public static boolean isServiceAvailable(ServiceContext sc, String itf) {
         ServiceReference ref = getServiceReference(sc, itf, null);
         return ref != null;
     }
 
-    
     /**
      * Checks the availability of a service inside the given service context.
      * @param sc the service context
      * @param itf the service interface to found
      * @param name the service provider name
      * @return <code>true</code> if the service is available in the service
-     * context, <code>false</code> otherwise.
+     *         context, <code>false</code> otherwise.
      */
-    public static boolean isServiceAvailableByName(ServiceContext sc, String itf, String name) {
+    public static boolean isServiceAvailableByName(ServiceContext sc,
+            String itf, String name) {
         ServiceReference ref = getServiceReferenceByName(sc, itf, name);
         return ref != null;
     }
-    
+
     /**
      * Checks the availability of a service inside the given service context.
      * @param sc the service context
      * @param itf the service interface to found
      * @param pid the pid of the service
      * @return <code>true</code> if the service is available in the service
-     * context, <code>false</code> otherwise.
+     *         context, <code>false</code> otherwise.
      */
-    public static boolean isServiceAvailableByPID(ServiceContext sc, String itf, String pid) {
+    public static boolean isServiceAvailableByPID(ServiceContext sc,
+            String itf, String pid) {
         ServiceReference ref = getServiceReferenceByPID(sc, itf, pid);
         return ref != null;
     }
-    
+
     /**
      * Returns the service reference of a service provided by the specified
      * bundle, offering the specified interface and having the given name.
      * 
-     * @param bundle
-     *            the bundle in which the service is searched.
-     * @param itf
-     *            the interface provided by the searched service.
-     * @param name
-     *            the name of the searched service.
+     * @param bundle the bundle from which the service is searched.
+     * @param itf the interface provided by the searched service.
+     * @param name the name of the searched service.
      * @return a service provided by the specified bundle, offering the
      *         specified interface and having the given name.
      */
@@ -731,33 +708,30 @@
         }
         return OSGiTestCase.getServiceReference(bundle, itf, filter);
     }
-    
+
     /**
-     * Returns the service reference of a service provided by the local
-     * bundle, offering the specified interface and having the given name.
+     * Returns the service reference of a service provided by the local bundle,
+     * offering the specified interface and having the given name.
      * 
-     * @param itf
-     *            the interface provided by the searched service.
-     * @param name
-     *            the name of the searched service.
+     * @param itf the interface provided by the searched service.
+     * @param name the name of the searched service.
      * @return a service provided by the specified bundle, offering the
      *         specified interface and having the given name.
      */
     public ServiceReference getServiceReferenceByName(String itf, String name) {
-        return getServiceReferenceByName(context.getBundle(), itf, name);
+        return getServiceReferenceByName(m_context.getBundle(), itf, name);
     }
-    
+
     /**
      * Checks if the service is available.
      * @param itf the service interface
-     * @param the service provider name
-     * @return <code>true</code> if the service is available,
-     * <code>false</code> otherwise.
+     * @param name the service provider name
+     * @return <code>true</code> if the service is available, <code>false</code>
+     *         otherwise.
      */
     public boolean isServiceAvailableByName(String itf, String name) {
         ServiceReference ref = getServiceReferenceByName(itf, name);
         return ref != null;
     }
-    
 
 }
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/JunitExtender.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/JunitExtender.java
index 39ee95f..45c928e 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/JunitExtender.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/JunitExtender.java
@@ -48,14 +48,34 @@
  */
 public class JunitExtender implements OSGiJunitRunner {
 
+    /**
+     * Suite method name.
+     */
     public static final String SUITE_METHODNAME = "suite";
 
+    /**
+     * List of found suites (Bundle-> List of Class).
+     */
     private Map/*<Bundle, List<Class>>*/ m_suites = new HashMap/*<Bundle, List<Class>>*/();
 
+    /**
+     * The result printer.
+     * By default, prints result on {@link System#out}
+     */
     private ResultPrinter m_printer = new ResultPrinter(System.out);
     
+    /**
+     * The log service used to log messages.
+     * If not provided, a default implementation
+     * printing messages on the console is used.
+     */
     private LogService m_log;
 
+    /**
+     * A new matching bundle arrives.
+     * @param bundle the matching bundle
+     * @param header the looked header value
+     */
     void onBundleArrival(Bundle bundle, String header) {
         String[] tss = ParseUtils.split(header, ",");
         for (int i = 0; i < tss.length; i++) {
@@ -71,6 +91,11 @@
         }
     }
 
+    /**
+     * Adds a test suite.
+     * @param bundle the bundle declaring the test suite.
+     * @param test the test class.
+     */
     private synchronized void addTestSuite(Bundle bundle, Class/*<? extends Test>*/ test) {
         List/*<Class>*/ list = (List) m_suites.get(bundle);
         if (list == null) {
@@ -82,19 +107,37 @@
         }
     }
 
+    /**
+     * Removes the test suites provided by the given bundles.
+     * @param bundle the leaving bundles.
+     */
     private synchronized void removeTestSuites(Bundle bundle) {
         List list = (List) m_suites.remove(bundle);
         m_log.log(LogService.LOG_INFO, "Unload test suites " + list);
     }
 
+    /**
+     * A matching bundle is leaving.
+     * @param bundle the leaving bundle.
+     */
     void onBundleDeparture(Bundle bundle) {
         removeTestSuites(bundle);
     }
 
+    /**
+     * Set the result printer.
+     * @param pw the stream to use.
+     * @see org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner#setResultPrinter(java.io.PrintStream)
+     */
     public void setResultPrinter(PrintStream pw) {
         m_printer = new ResultPrinter(pw);
     }
 
+    /**
+     * Runs tests.
+     * @return the list of {@link TestResult}
+     * @see org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner#run()
+     */
     public synchronized List/*<TestResult>*/ run() {
         List/*<TestResult>*/ results = new ArrayList/*<TestResult>*/(m_suites.size());
         Iterator/*<Entry<Bundle, List<Class>>>*/ it = m_suites.entrySet().iterator();
@@ -103,7 +146,7 @@
             Bundle bundle = (Bundle) entry.getKey();
             List/*<Class>*/ list = (List) m_suites.get(bundle);
             for (int i = 0; i < list.size(); i++) {
-                Test test = createTestFromClass((Class)list.get(i), bundle);
+                Test test = createTestFromClass((Class) list.get(i), bundle);
                 TestResult tr = doRun(test);
                 results.add(tr);
             }
@@ -111,6 +154,11 @@
         return results;
     }
 
+    /**
+     * Internal methods executing tests.
+     * @param test the test to execute
+     * @return the result
+     */
     private TestResult doRun(Test test) {
         TestResult result = new TestResult();
         result.addListener(m_printer);
@@ -125,6 +173,15 @@
         return result;
     }
 
+    /**
+     * Creates a {@link Test} object from the
+     * given class from the given bundle.
+     * This method creates {@link OSGiTestCase} and
+     * {@link OSGiTestSuite} when required.
+     * @param clazz the class
+     * @param bundle the bundle
+     * @return the resulting Test object.
+     */
     private Test createTestFromClass(Class/*<?>*/ clazz, Bundle bundle) {
         Method suiteMethod = null;
         boolean bc = false;
@@ -171,6 +228,11 @@
         return test;
     }
 
+    /**
+     * Gets the list of {@link Test}.
+     * @return the list of {@link Test}
+     * @see org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner#getTests()
+     */
     public synchronized List/*<Test>*/ getTests() {
         List/*<Test>*/ results = new ArrayList/*<Test>*/();
         Iterator/*<Entry<Bundle, List<Class>>>*/ it = m_suites.entrySet().iterator();
@@ -186,10 +248,23 @@
         return results;
     }
 
+    /**
+     * Runs the given tests.
+     * @param test the test to execute
+     * @return the result
+     * @see org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner#run(junit.framework.Test)
+     */
     public TestResult run(Test test) {
         return doRun(test);
     }
 
+    /**
+     * Gets the list of {@link Test} from the bundle (specified
+     * by using the bundle id).
+     * @param bundleId the bundle id
+     * @return the list of {@link Test} declared in this bundle.
+     * @see org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner#getTests(long)
+     */
     public synchronized List/*<Test>*/ getTests(long bundleId) {
         Iterator/*<Entry<Bundle, List<Class>>>*/ it = m_suites.entrySet().iterator();
         while (it.hasNext()) {
@@ -208,6 +283,13 @@
         return null;
     }
 
+    /**
+     * Runs the tests declared in the bundle
+     * (specified by the bundle id).
+     * @param bundleId the bundle id
+     * @return the List of {@link TestResult}
+     * @see org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner#run(long)
+     */
     public synchronized List/*<TestResult>*/ run(long bundleId) {
         Iterator/*<Entry<Bundle, List<Class>>>*/ it = m_suites.entrySet().iterator();
         while (it.hasNext()) {
@@ -227,15 +309,29 @@
         return null;
     }
 
+    /**
+     * Stop method.
+     * Clears test suites.
+     */
     public synchronized void stopping() {
         m_log.log(LogService.LOG_INFO, "Cleaning test suites ...");
         m_suites.clear();
     }
     
+    /**
+     * Start method.
+     */
     public void starting() {
         m_log.log(LogService.LOG_INFO, "Junit Extender starting ...");
     }
 
+    /**
+     * Helper method analyzing the {@link Bundle} object
+     * to get the {@link BundleContext} object.
+     * @param bundle the Bundle
+     * @return the BundleContext of <code>null</code> if
+     * the BundleContext cannot be collected.
+     */
     private BundleContext getBundleContext(Bundle bundle) {
         if (bundle == null) { return null; }
 
@@ -288,10 +384,10 @@
                 try {
                     return (BundleContext) fields[i].get(bundle);
                 } catch (IllegalArgumentException e) {
-                    m_log.log(LogService.LOG_ERROR, "Cannot get the BundleContext by invoking " + meth.getName(), e);
+                    m_log.log(LogService.LOG_ERROR, "Cannot get the BundleContext by reflecting on " + fields[i].getName(), e);
                     return null;
                 } catch (IllegalAccessException e) {
-                    m_log.log(LogService.LOG_ERROR, "Cannot get the BundleContext by invoking " + meth.getName(), e);
+                    m_log.log(LogService.LOG_ERROR, "Cannot get the BundleContext by reflecting on " + fields[i].getName(), e);
                     return null;
                 }
             }
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/LogServiceImpl.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/LogServiceImpl.java
index 1da168a..71afd82 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/LogServiceImpl.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/LogServiceImpl.java
@@ -1,10 +1,39 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.felix.ipojo.junit4osgi.impl;
 
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.log.LogService;
 
+/**
+ * Log Service default implementation.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public class LogServiceImpl implements LogService {
     
+    /**
+     * Creates a message.
+     * @param level the log level
+     * @param msg the message
+     * @param exception the thrown exception
+     * @return the computed message
+     */
     private String computeLogMessage(int level, String msg, Throwable exception) {
         String message = null;
         switch (level) {
@@ -20,6 +49,8 @@
             case LogService.LOG_WARNING:
                 message = "[WARNING] " + msg;
                 break;
+            default:
+                break;
         }
         
         if (exception != null) {
@@ -29,18 +60,46 @@
         return message;
     }
 
+    /**
+     * Logs a message.
+     * @param arg0 the log level
+     * @param arg1 the message
+     * @see org.osgi.service.log.LogService#log(int, java.lang.String)
+     */
     public void log(int arg0, String arg1) {
         System.err.println(computeLogMessage(arg0, arg1, null));
     }
 
+    /**
+     * Logs a message.
+     * @param arg0 the log level
+     * @param arg1 the message
+     * @param arg2 the thrown exception
+     * @see org.osgi.service.log.LogService#log(int, java.lang.String)
+     */
     public void log(int arg0, String arg1, Throwable arg2) {
         System.err.println(computeLogMessage(arg0, arg1, arg2));
     }
 
+    /**
+     * Logs a message.
+     * @param arg0 the service reference
+     * @param arg1 the log level
+     * @param arg2 the message
+     * @see org.osgi.service.log.LogService#log(ServiceReference, int, String)
+     */
     public void log(ServiceReference arg0, int arg1, String arg2) {
         System.err.println(computeLogMessage(arg1, arg2, null));
     }
 
+    /**
+     * Logs a message.
+     * @param arg0 the service reference
+     * @param arg1 the log level
+     * @param arg2 the message
+     * @param arg3 the thrown exception
+     * @see org.osgi.service.log.LogService#log(ServiceReference, int, String, Throwable)
+     */
     public void log(ServiceReference arg0, int arg1, String arg2, Throwable arg3) {
         System.err.println(computeLogMessage(arg1, arg2, arg3));
     }
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/ResultPrinter.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/ResultPrinter.java
index 2acb056..906658b 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/ResultPrinter.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/impl/ResultPrinter.java
@@ -34,18 +34,29 @@
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class ResultPrinter implements TestListener {
-    PrintStream fWriter;
+    /**
+     * the writer.
+     */
+    PrintStream m_fWriter;
 
-    int fColumn = 0;
+    /**
+     * The column .
+     */
+    int m_fColumn = 0;
 
+    /**
+     * Creates a ResultPrinter.
+     * @param writer the printer
+     */
     public ResultPrinter(PrintStream writer) {
-        fWriter = writer;
+        m_fWriter = writer;
     }
 
-    /*
-     * API for use by textui.TestRunner
+    /**
+     * Prints the result.
+     * @param result the test result
+     * @param runTime the test duration
      */
-
     synchronized void print(TestResult result, long runTime) {
         printHeader(runTime);
         printErrors(result);
@@ -53,6 +64,9 @@
         printFooter(result);
     }
 
+    /**
+     * Prints message wiating for prompt.
+     */
     void printWaitPrompt() {
         getWriter().println();
         getWriter().println("<RETURN> to continue");
@@ -62,46 +76,86 @@
      * Internal methods
      */
 
+    /**
+     * Prints the result header.
+     * @param runTime the test execution duration
+     */
     protected void printHeader(long runTime) {
         getWriter().println();
         getWriter().println("Time: " + elapsedTimeAsString(runTime));
     }
 
+    /**
+     * Prints the errors.
+     * @param result the test result
+     */
     protected void printErrors(TestResult result) {
         printDefects(result.errors(), result.errorCount(), "error");
     }
 
+    /**
+     * Prints failures.
+     * @param result the test result
+     */
     protected void printFailures(TestResult result) {
         printDefects(result.failures(), result.failureCount(), "failure");
     }
 
+    /**
+     * Prints failures.
+     * @param booBoos the failures
+     * @param count the number of failures
+     * @param type the type
+     */
     protected void printDefects(Enumeration/*<TestFailure>*/ booBoos, int count, String type) {
-        if (count == 0)
+        if (count == 0) {
             return;
-        if (count == 1)
+        }
+        
+        if (count == 1) {
             getWriter().println("There was " + count + " " + type + ":");
-        else
+        } else {
             getWriter().println("There were " + count + " " + type + "s:");
+        }
+        
         for (int i = 1; booBoos.hasMoreElements(); i++) {
             printDefect((TestFailure) booBoos.nextElement(), i);
         }
     }
 
+    /**
+     * Prints a failure.
+     * @param booBoo the failure
+     * @param count the count
+     */
     public void printDefect(TestFailure booBoo, int count) { // only public for testing purposes
         printDefectHeader(booBoo, count);
         printDefectTrace(booBoo);
     }
 
+    /**
+     * Prints defect header.
+     * @param booBoo the failure
+     * @param count the count
+     */
     protected void printDefectHeader(TestFailure booBoo, int count) {
         // I feel like making this a println, then adding a line giving the throwable a chance to print something
         // before we get to the stack trace.
         getWriter().print(count + ") " + booBoo.failedTest());
     }
 
+    /**
+     * Prints the stack trace.
+     * @param booBoo the failure
+     */
     protected void printDefectTrace(TestFailure booBoo) {
         getWriter().print(BaseTestRunner.getFilteredTrace(booBoo.trace()));
     }
 
+    /**
+     * Prints the footer.
+     * @param result the test result.
+     */
     protected void printFooter(TestResult result) {
         if (result.wasSuccessful()) {
             getWriter().println();
@@ -117,17 +171,22 @@
     }
 
     /**
-     * Returns the formatted string of the elapsed time. Duplicated from BaseTestRunner. Fix it.
+     * Returns the formatted string of the elapsed time.
+     * @param runTime the elapsed time
+     * @return the elapsed time.
      */
     protected String elapsedTimeAsString(long runTime) {
         return NumberFormat.getInstance().format((double) runTime / 1000);
     }
 
     public PrintStream getWriter() {
-        return fWriter;
+        return m_fWriter;
     }
 
     /**
+     * Adds an error.
+     * @param test the test in error.
+     * @param t the thrown error
      * @see junit.framework.TestListener#addError(Test, Throwable)
      */
     public void addError(Test test, Throwable t) {
@@ -135,6 +194,9 @@
     }
 
     /**
+     * Adds a failure.
+     * @param test the failing test.
+     * @param t the thrown failure
      * @see junit.framework.TestListener#addFailure(Test, AssertionFailedError)
      */
     public void addFailure(Test test, AssertionFailedError t) {
@@ -142,19 +204,23 @@
     }
 
     /**
+     * A test ends.
+     * (do nothing)
+     * @param test the ending test
      * @see junit.framework.TestListener#endTest(Test)
      */
-    public void endTest(Test test) {
-    }
+    public void endTest(Test test) { }
 
     /**
+     * A test starts.
+     * @param test the starting test
      * @see junit.framework.TestListener#startTest(Test)
      */
     public void startTest(Test test) {
         getWriter().print(".");
-        if (fColumn++ >= 40) {
+        if (m_fColumn++ >= 40) {
             getWriter().println();
-            fColumn = 0;
+            m_fColumn = 0;
         }
     }
 
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestOSGiTestCase.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestOSGiTestCase.java
index 2ee139e..9d59e00 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestOSGiTestCase.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestOSGiTestCase.java
@@ -26,9 +26,12 @@
  */
 public class TestOSGiTestCase extends OSGiTestCase {
     
+    /**
+     * Test.
+     */
     public void test1() {
         System.out.println("Test BC");
-        assertNotNull("Test bundle context", context);
+        assertNotNull("Test bundle context", getContext());
     }
 
 }
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestOSGiTestSuite.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestOSGiTestSuite.java
index c68f37c..746a017 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestOSGiTestSuite.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestOSGiTestSuite.java
@@ -30,6 +30,11 @@
  */
 public class TestOSGiTestSuite extends TestSuite {
     
+    /**
+     * Suite method.
+     * @param bc the bundle context
+     * @return the Test Suite.
+     */
     public static Test suite(BundleContext bc) {
         TestSuite ts = new TestSuite();
         ts.setName("Test OSGi suite() method");
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestTestCase.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestTestCase.java
index 0e1527b..c2f0ae4 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestTestCase.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestTestCase.java
@@ -26,12 +26,24 @@
  */
 public class TestTestCase extends TestCase {
     
+    /**
+     * test1.
+     */
     public void test1() { }
     
+    /**
+     * test2.
+     */
     public void test2() { }
     
+    /**
+     * test3.
+     */
     public void test3() { }
     
+    /**
+     * test4.
+     */
     public void test4() { }
 
 }
diff --git a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestTestSuite.java b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestTestSuite.java
index 6bd1bf1..d559ed9 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestTestSuite.java
+++ b/ipojo/examples/junit4osgi/junit4osgi/src/main/java/org/apache/felix/ipojo/junit4osgi/test/TestTestSuite.java
@@ -27,6 +27,10 @@
  */
 public class TestTestSuite extends TestSuite {
     
+    /**
+     * Suite method.
+     * @return the test suite.
+     */
     public static Test suite() {
         TestSuite ts = new TestSuite();
         ts.setName("Test suite() method");
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/LICENSE b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/NOTICE b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/NOTICE
new file mode 100644
index 0000000..34f9403
--- /dev/null
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/NOTICE
@@ -0,0 +1,17 @@
+Apache Felix iPOJO junit4osgi Maven Plugin
+Copyright 2008 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+II. Used Software
+
+This product uses software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/pom.xml b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/pom.xml
index a1798d6..729d27d 100644
--- a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/pom.xml
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/pom.xml
@@ -19,7 +19,7 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.apache.felix.ipojo.junit4osgi</groupId>
+	<groupId>org.apache.felix</groupId>
 	<artifactId>maven-junit4osgi-plugin</artifactId>
 	<packaging>maven-plugin</packaging>
 	<version>1.1.0-SNAPSHOT</version>
@@ -73,9 +73,35 @@
 			<scope>runtime</scope>
 		</dependency>
 		<dependency>
-			<groupId>ipojo.examples</groupId>
+			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
 			<version>1.1.0-SNAPSHOT</version>
 		</dependency>
 	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>rat-maven-plugin</artifactId>
+				<configuration>
+					<excludeSubProjects>false</excludeSubProjects>
+					<useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+					<useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+					<excludes>
+						<param>doc/*</param>
+						<param>maven-eclipse.xml</param>
+						<param>.checkstyle</param>
+						<param>.externalToolBuilders/*</param>
+					</excludes>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-checkstyle-plugin</artifactId>
+				<configuration>
+					<configLocation>http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml</configLocation>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 </project>
\ No newline at end of file
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Installer.java b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Installer.java
index a7a8078..d98b48a 100644
--- a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Installer.java
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Installer.java
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -41,37 +41,37 @@
     /**
      * The list of artifact containing bundles for the junit4osgi framework.
      */
-    private List artifacts;
+    private List m_artifacts;
     
     /**
      * The current maven project. 
      */
-    private MavenProject project;
+    private MavenProject m_project;
     
     /**
-     * Flag enabling/disbling the deployment of the current
+     * Flag enabling/disabling the deployment of the current
      * project artifact.
      */
-    private boolean deployCurrent;
+    private boolean m_deployCurrent;
     
     /**
      * List of bundle URLs to install. 
      */
-    private List bundles;
+    private List m_bundles;
     
     
     /**
-     * Creates a Installer
+     * Creates a Installer.
      * @param artifacts the list of artifact containing bundles for the junit4osgi framework.
      * @param bundles the list of bundle URLs to install 
      * @param project the current maven project
      * @param deployCurrentArtifact flag enabling/disabling the deployment of the current project artifact
      */
     public Installer(List artifacts, List bundles, MavenProject project, boolean deployCurrentArtifact) {
-        this.artifacts = artifacts;
-        this.project = project;
-        deployCurrent = deployCurrentArtifact;
-        this.bundles = bundles;
+        this.m_artifacts = artifacts;
+        this.m_project = project;
+        m_deployCurrent = deployCurrentArtifact;
+        this.m_bundles = bundles;
     }
     
     /**
@@ -109,11 +109,12 @@
     
     /**
      * Installs and Starts required bundles.
+     * @param context the bundle context used to deploy bundles.
      * @throws BundleException when a bundle cannot be installed or started correctly
      */
     private void deployBundles(BundleContext context) throws BundleException {
-        for (int i = 0; i < bundles.size(); i++) {
-            URL url = (URL) bundles.get(i);
+        for (int i = 0; i < m_bundles.size(); i++) {
+            URL url = (URL) m_bundles.get(i);
             Bundle bundle = context.installBundle(url.toString());
             bundle.start();
         }
@@ -126,8 +127,8 @@
      * be found.
      */
     private URL getUrlByArtifactId(String id) {
-        for (int i = 0; i < artifacts.size(); i++) {
-            Artifact artifact = (Artifact) artifacts.get(i);
+        for (int i = 0; i < m_artifacts.size(); i++) {
+            Artifact artifact = (Artifact) m_artifacts.get(i);
             if (artifact.getArtifactId().equals(id)) {
                 try {
                     return artifact.getFile().toURL();
@@ -145,12 +146,12 @@
      * @throws BundleException when the bundle cannot be installed or started correctly.
      */
     private void deployProjectArtifact(BundleContext context)
-            throws BundleException {
-        if (!deployCurrent) {
+        throws BundleException {
+        if (!m_deployCurrent) {
             return;
         }
 
-        File file = project.getArtifact().getFile();
+        File file = m_project.getArtifact().getFile();
         if (file.exists()) {
             URL url = null;
             try {
@@ -193,4 +194,4 @@
         // Do nothing.
     }
 
-}
\ No newline at end of file
+}
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java
index 6af90e8..ce1f378 100644
--- a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -16,21 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.ipojo.junit4osgi.plugin;/*
-
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+package org.apache.felix.ipojo.junit4osgi.plugin;
 
 import java.io.File;
 import java.io.PrintStream;
@@ -81,68 +67,98 @@
      * @required
      * @readonly
      */
-    private MavenProject project;
+    private MavenProject m_project;
     
-    /** @parameter expression="${plugin.artifacts}" */
-    private java.util.List pluginArtifacts;
+    /**
+     * Dependencies of the current plugin. 
+     * @parameter expression="${plugin.artifacts}"
+     */
+    private java.util.List m_pluginArtifacts;
     
     /**
      * Base directory where all reports are written to.
      * 
      * @parameter expression="${project.build.directory}/junit4osgi-reports"
      */
-    private File reportsDirectory;
+    private File m_reportsDirectory;
     
     /**
      * Base directory where all reports are written to.
      * 
      * @parameter expression="${project.build.directory}"
      */
-    private File targetDir;
+    private File m_targetDir;
     
     /**
-     * Must the current artifact be deployed?.
+     * Must the current artifact be deployed?
      * 
      * @parameter expression="${deployProjectArtifact}" default-value="false"
      */
-    private boolean deployProjectArtifact;
+    private boolean m_deployProjectArtifact;
     
     /**
-     * Required bundles
+     * Required bundles.
      * 
      * @parameter expression="${bundles}"
      */
-    private ArrayList bundles;
-    
-    int total;
-    int totalFailures;
-    int totalErrors;
-    
-    List errors = new ArrayList();
-    List failures = new ArrayList();
-    List results = new ArrayList();
+    private ArrayList m_bundles;
     
     /**
-     * Log Service exposed by the plugin framework.
+     * Number of executed test case.
      */
-    private LogServiceImpl logService;
+    private int m_total;
+    
+    /**
+     * Number of failing test case.
+     */
+    private int m_totalFailures;
+    
+    /**
+     * Number of test case in error .
+     */
+    private int m_totalErrors;
+    
+    /**
+     * Test results in error.
+     */
+    private List m_errors = new ArrayList();
+    
+    /**
+     * Failing test results. 
+     */
+    private List m_failures = new ArrayList();
+    
+    /**
+     * Test results.
+     */
+    private List m_results = new ArrayList();
+    
+    /**
+     * Log Service exposed by the plug-in framework.
+     */
+    private LogServiceImpl m_logService;
     
    
+    /**
+     * Executes the plug-in.
+     * @throws MojoFailureException when the test execution failed.
+     * @see org.apache.maven.plugin.AbstractMojo#execute()
+     */
     public void execute() throws MojoFailureException {
         
         List bundles = parseBundleList();
         bundles.addAll(getTestBundle());
         
         List activators = new ArrayList();
-        logService = new LogServiceImpl();
-        activators.add(logService);
-        activators.add(new Installer(pluginArtifacts, bundles, project, deployProjectArtifact));
+        m_logService = new LogServiceImpl();
+        activators.add(m_logService);
+        activators.add(new Installer(m_pluginArtifacts, bundles, m_project, m_deployProjectArtifact));
         Map map = new HashMap();
         map.put("felix.systembundle.activators", activators);
         map.put("org.osgi.framework.storage.clean", "onFirstInit");
         map.put("ipojo.log.level", "WARNING");
         map.put("org.osgi.framework.bootdelegation", "junit.framework, org.osgi.service.log");
-        map.put("org.osgi.framework.storage", targetDir.getAbsolutePath() + "/felix-cache"); 
+        map.put("org.osgi.framework.storage", m_targetDir.getAbsolutePath() + "/felix-cache"); 
 
         
         System.out.println("");
@@ -170,19 +186,30 @@
             getLog().error(e);
         }
         
-        if (totalErrors > 0 || totalFailures > 0) {
-            throw new MojoFailureException("There are test failures. \n\n" +
-                    "Please refer to " + reportsDirectory.getAbsolutePath() + 
-                    " for the individual test results.");
+        if (m_totalErrors > 0 || m_totalFailures > 0) {
+            throw new MojoFailureException("There are test failures. \n\n"
+                    + "Please refer to " + m_reportsDirectory.getAbsolutePath()
+                    + " for the individual test results.");
         }
 
     }
     
+    /**
+     * Waits for stability:
+     * <ul>
+     * <li>all bundles are activated
+     * <li>service count is stable
+     * </ul>
+     * If the stability can't be reached after a specified time,
+     * the method throws a {@link MojoFailureException}.
+     * @param context the bundle context
+     * @throws MojoFailureException when the stability can't be reach after a several attempts.
+     */
     private void waitForStability(BundleContext context) throws MojoFailureException {
         // Wait for bundle initialization.
         boolean bundleStability = getBundleStability(context);
         int count = 0;
-        while(!bundleStability && count < 500) {
+        while (!bundleStability && count < 500) {
             try {
                 Thread.sleep(5);
             } catch (InterruptedException e) {
@@ -200,15 +227,16 @@
         
         boolean serviceStability = false;
         count = 0;
-        int count1 = 0, count2 = 0;
-        while(! serviceStability && count < 500) {
+        int count1 = 0;
+        int count2 = 0;
+        while (! serviceStability && count < 500) {
             try {
                 ServiceReference[] refs = context.getServiceReferences(null, null);
                 count1 = refs.length;
                 Thread.sleep(500);
                 refs = context.getServiceReferences(null, null);
                 count2 = refs.length;
-                serviceStability = (count1 == count2);
+                serviceStability = count1 == count2;
             } catch (Exception e) {
                 getLog().error(e);
                 serviceStability = false;
@@ -225,6 +253,11 @@
         
     }
     
+    /**
+     * Are bundle stables.
+     * @param bc the bundle context
+     * @return <code>true</code> if every bundles are activated.
+     */
     private boolean getBundleStability(BundleContext bc) {
         boolean stability = true;
         Bundle[] bundles = bc.getBundles();
@@ -234,30 +267,39 @@
         return stability;
     }
 
+    /**
+     * Computes the URL list of bundles to install from
+     * the <code>bundles</code> parameter.
+     * @return the list of url of bundles to install.
+     */
     private List parseBundleList() {
         List toDeploy = new ArrayList();
-        if (bundles == null) {
+        if (m_bundles == null) {
             return toDeploy;
         }
         
-        for (int i = 0; i < bundles.size(); i++) {
-            String bundle = (String) bundles.get(i);
+        for (int i = 0; i < m_bundles.size(); i++) {
+            String bundle = (String) m_bundles.get(i);
             try {
                 URL url = new URL(bundle);
                 toDeploy.add(url);
             } catch (MalformedURLException e) {
-               // Not a valid url,
-               getLog().error(bundle + " is not a valid url, bundle ignored");
-              
+                // Not a valid url,
+                getLog().error(bundle + " is not a valid url, bundle ignored");
             }
         }
         
         return toDeploy;
     }
     
+    /**
+     * Computes the URL list of bundles to install from 
+     * <code>test</code> scoped dependencies.
+     * @return the list of url of bundles to install.
+     */
     private List getTestBundle() {
         List toDeploy = new ArrayList();
-        Set dependencies = project.getDependencyArtifacts();
+        Set dependencies = m_project.getDependencyArtifacts();
         for (Iterator artifactIterator = dependencies.iterator(); artifactIterator.hasNext();) {
             Artifact artifact = (Artifact) artifactIterator.next();
             if (Artifact.SCOPE_TEST.equals(artifact.getScope())) { // Select scope=test.
@@ -275,6 +317,12 @@
         return toDeploy;
     }
     
+    /**
+     * Waits until the {@link OSGiJunitRunner} service
+     * is published.
+     * @param bc the bundle context
+     * @return the {@link OSGiJunitRunner} service object.
+     */
     private Object waitForRunnerService(BundleContext bc) {
         ServiceReference ref = bc.getServiceReference(org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner.class.getName());
         int count = 0;
@@ -293,6 +341,11 @@
         return null;
     }
     
+    /**
+     * Executes tests by using reflection.
+     * @param runner the {@link OSGiJunitRunner} service object
+     * @param bc the bundle context
+     */
     private void invokeRun(Object runner, BundleContext bc) {
         Method getTest;
         
@@ -301,39 +354,45 @@
             List tests = (List) getTest.invoke(runner, new Object[0]);
             Method run = getRunMethod(runner);
             for (int i = 0; i < tests.size(); i++) {
-                executeTest(runner, (Test) tests.get(i),run, bc);
+                executeTest(runner, (Test) tests.get(i), run, bc);
             }
             System.out.println("\nResults :");
-            if (failures.size() > 0) {
+            if (m_failures.size() > 0) {
                 System.out.println("\nFailed tests:");
-                for (int i = 0; i < failures.size(); i++) {
-                    TestResult tr = (TestResult) failures.get(i);
+                for (int i = 0; i < m_failures.size(); i++) {
+                    TestResult tr = (TestResult) m_failures.get(i);
                     Enumeration e = tr.failures();
-                    while(e.hasMoreElements()) {
+                    while (e.hasMoreElements()) {
                         TestFailure tf = (TestFailure) e.nextElement();
                         System.out.println(" " + tf.toString());
                     }
                 }
             }
             
-            if (failures.size() > 0) {
+            if (m_failures.size() > 0) {
                 System.out.println("\nTests in error:");
-                for (int i = 0; i < errors.size(); i++) {
-                    TestResult tr = (TestResult) errors.get(i);
+                for (int i = 0; i < m_errors.size(); i++) {
+                    TestResult tr = (TestResult) m_errors.get(i);
                     Enumeration e = tr.errors();
-                    while(e.hasMoreElements()) {
+                    while (e.hasMoreElements()) {
                         TestFailure tf = (TestFailure) e.nextElement();
                         System.out.println(" " + tf.toString());
                     }
                 }
             }
             
-            System.out.println("\nTests run: " + total + ", Failures: " + totalFailures + ", Errors:" + totalErrors + "\n");          
+            System.out.println("\nTests run: " + m_total + ", Failures: " + m_totalFailures + ", Errors:" + m_totalErrors + "\n");          
         } catch (Exception e) {
             getLog().error(e);
         } 
     }
     
+    /**
+     * Gets the {@link OSGiJunitRunner#run(long)} method from the 
+     * {@link OSGiJunitRunner} service object.
+     * @param runner the {@link OSGiJunitRunner} service object.
+     * @return the Method object for the <code>run</code> method.
+     */
     private Method getRunMethod(Object runner) {
         Method[] methods = runner.getClass().getMethods();
         for (int i = 0; i < methods.length; i++) {
@@ -347,6 +406,14 @@
         return null;
     }
     
+    /**
+     * Computes the name of the given test.
+     * This method calls the {@link TestCase#getName()}
+     * method by reflection. If no success, invokes the
+     * {@link Object#toString()}  method.
+     * @param test the test object.
+     * @return the name of the given test.
+     */
     private String getTestName(Object test) {
         try {
             Method getName = test.getClass().getMethod("getName", new Class[0]);
@@ -362,43 +429,69 @@
             
     }
     
-    private void executeTest(Object runner, Test test, Method run, BundleContext bc) {
+    /**
+     * Executes the given test.
+     * @param runner the {@link OSGiJunitRunner} service object
+     * @param test the test to run
+     * @param run the {@link OSGiJunitRunner#run(long)} method
+     * @param bc the bundle context
+     */
+    private void executeTest(Object runner, Test test, Method run,
+            BundleContext bc) {
         try {
-        XMLReport report = new XMLReport();
-        String name = getTestName(test);
-        System.out.println("Running " + name);
+            XMLReport report = new XMLReport();
+            String name = getTestName(test);
+            System.out.println("Running " + name);
 
-        TestResult tr = new TestResult();
-        tr.addListener(new ResultListener(report));
-        test.run(tr);        
-        results.add(tr);
-        
-        if (tr.wasSuccessful()) {
-            System.out.println("Tests run: " + tr.runCount() + ", Failures: " + tr.failureCount() + ", Errors: " + tr.errorCount() + ", Time elapsed: " + report.elapsedTimeAsString(report.endTime - report.endTime) + " sec");
-        } else {
-            System.out.println("Tests run: " + tr.runCount() + ", Failures: " + tr.failureCount() + ", Errors: " + tr.errorCount() + ", Time elapsed: " + report.elapsedTimeAsString(report.endTime - report.endTime) + " sec <<< FAILURE!");
-            if (tr.errorCount() > 0) {
-                errors.add(tr);
+            TestResult tr = new TestResult();
+            tr.addListener(new ResultListener(report));
+            test.run(tr);
+            m_results.add(tr);
+
+            if (tr.wasSuccessful()) {
+                System.out.println("Tests run: "
+                        + tr.runCount()
+                        + ", Failures: "
+                        + tr.failureCount()
+                        + ", Errors: "
+                        + tr.errorCount()
+                        + ", Time elapsed: "
+                        + report.elapsedTimeAsString(report.m_endTime
+                                - report.m_endTime) + " sec");
+            } else {
+                System.out.println("Tests run: "
+                        + tr.runCount()
+                        + ", Failures: "
+                        + tr.failureCount()
+                        + ", Errors: "
+                        + tr.errorCount()
+                        + ", Time elapsed: "
+                        + report.elapsedTimeAsString(report.m_endTime
+                                - report.m_endTime) + " sec <<< FAILURE!");
+                if (tr.errorCount() > 0) {
+                    m_errors.add(tr);
+                }
+                if (tr.failureCount() > 0) {
+                    m_failures.add(tr);
+                }
             }
-            if (tr.failureCount() > 0) {
-                failures.add(tr);
-            }
-        }
-        
-        total += tr.runCount();
-        totalFailures += tr.failureCount();
-        totalErrors += tr.errorCount();
-        
-        report.generateReport(test, tr, reportsDirectory, bc);
-        
+
+            m_total += tr.runCount();
+            m_totalFailures += tr.failureCount();
+            m_totalErrors += tr.errorCount();
+
+            report.generateReport(test, tr, m_reportsDirectory, bc);
+
         } catch (Exception e) {
             getLog().error(e);
         }
-        
-       
-        
+
     }
     
+    /**
+     * Prints the bundle list.
+     * @param bc the bundle context.
+     */
     public void dumpBundles(BundleContext bc) {
         getLog().info("Bundles:");
         Bundle[] bundles = bc.getBundles();
@@ -408,51 +501,99 @@
     }
     
     public LogServiceImpl getLogService() {
-        return logService;
+        return m_logService;
     }
     
     
     private class ResultListener implements TestListener {
         
-        private XMLReport report;
-        private boolean abort;
+        /**
+         * The XML Report.
+         */
+        private XMLReport m_report;
         
-        private PrintStream outBackup = System.out;
-        private PrintStream errBackup = System.err;
+        /**
+         * Check if the test has failed or thrown an
+         * error.
+         */
+        private boolean m_abort;
         
-        private StringOutputStream out = new StringOutputStream();
-        private StringOutputStream err = new StringOutputStream();;
+        /**
+         * Backup of the {@link System#out} stream.
+         */
+        private PrintStream m_outBackup = System.out;
         
+        /**
+         * Backup of the {@link System#err} stream.
+         */
+        private PrintStream m_errBackup = System.err;
+        
+        /**
+         * The output stream used during the test execution. 
+         */
+        private StringOutputStream m_out = new StringOutputStream();
+        
+        /**
+         * The error stream used during the test execution. 
+         */
+        private StringOutputStream m_err = new StringOutputStream();;
+        
+        /**
+         * Creates a ResultListener.
+         * @param report the XML report
+         */
         public ResultListener(XMLReport report) {
-            this.report = report;
+            this.m_report = report;
         }
 
+        /**
+         * An error occurs during the test execution.
+         * @param test the test in error
+         * @param throwable the thrown error
+         * @see junit.framework.TestListener#addError(junit.framework.Test, java.lang.Throwable)
+         */
         public void addError(Test test, Throwable throwable) {
-            report.testError(test, throwable, out.toString(), err.toString(), getLogService().getLoggedMessages());
-            abort = true;
+            m_report.testError(test, throwable, m_out.toString(), m_err.toString(), getLogService().getLoggedMessages());
+            m_abort = true;
         }
 
+        /**
+         * An failure occurs during the test execution.
+         * @param test the failing test
+         * @param assertionfailederror the failure
+         * @see junit.framework.TestListener#addFailure(junit.framework.Test, junit.framework.AssertionFailedError)
+         */
         public void addFailure(Test test,
                 AssertionFailedError assertionfailederror) {
-            report.testFailed(test, assertionfailederror, out.toString(), err.toString(), getLogService().getLoggedMessages());
-            abort = true;
+            m_report.testFailed(test, assertionfailederror, m_out.toString(), m_err.toString(), getLogService().getLoggedMessages());
+            m_abort = true;
             
         }
 
+        /**
+         * The test ends.
+         * @param test the test
+         * @see junit.framework.TestListener#endTest(junit.framework.Test)
+         */
         public void endTest(Test test) {
-           if (!abort) {
-               report.testSucceeded(test);
-           }
-           System.setErr(errBackup);
-           System.setOut(outBackup);
-           getLogService().reset();
+            if (!m_abort) {
+                m_report.testSucceeded(test);
+            }
+            System.setErr(m_errBackup);
+            System.setOut(m_outBackup);
+            getLogService().reset();
         }
 
+        /**
+         * The test starts.
+         * @param test the test
+         * @see junit.framework.TestListener#startTest(junit.framework.Test)
+         */
         public void startTest(Test test) {
-            abort = false;
-            report.testStarting();
-            System.setErr(new PrintStream(err));
-            System.setOut(new PrintStream(out));
+            m_abort = false;
+            m_report.testStarting();
+            System.setErr(new PrintStream(m_err));
+            System.setOut(new PrintStream(m_out));
             getLogService().enableOutputStream();
         }
         
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Report.java b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Report.java
index cbb8905..16ab48b 100644
--- a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Report.java
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Report.java
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -37,57 +37,57 @@
 public class Report {
     
     /**
-     * Number of ran tests.
+     * New line constant.
      */
-    protected int completedCount;
+    protected static final String NL = System.getProperty("line.separator");
 
     /**
-     * Number of errors
+     * Number of ran tests.
      */
-    protected int errorsCount;
+    protected int m_completedCount;
+
+    /**
+     * Number of errors.
+     */
+    protected int m_errorsCount;
     
     /**
-     * Number of failures
+     * Number of failures.
      */
-    protected int failuresCount;
+    protected int m_failuresCount;
     
     
     /**
-     * Failing tests.
-     */
-    private List failureSources = new ArrayList();
-    
-    /**
-     * Tests in error
-     */
-    private List errorSources = new ArrayList();
-    
-    /**
      * Time at the beginning of the test execution. 
      */
-    protected long startTime;
+    protected long m_startTime;
 
     /**
      * Time at the end of the test execution. 
      */
-    protected long endTime;
+    protected long m_endTime;
 
     /**
+     * Failing tests.
+     */
+    private List m_failureSources = new ArrayList();
+    
+    /**
+     * Tests in error.
+     */
+    private List m_errorSources = new ArrayList();
+    
+    /**
      * Double format. 
      */
-    private NumberFormat numberFormat = NumberFormat.getInstance( Locale.US );
+    private NumberFormat m_numberFormat = NumberFormat.getInstance(Locale.US);
 
     /**
-     * New line constant.
-     */
-    protected static final String NL = System.getProperty( "line.separator" );
-   
-    /**
      * Gets failing tests.
      * @return the list of failing tests.
      */
     public List getFailureSources() {
-        return this.failureSources;
+        return this.m_failureSources;
     }
 
     /**
@@ -95,14 +95,14 @@
      * @return the list of test throwing unexpected exceptions
      */
     public List getErrorSources() {
-        return this.errorSources;
+        return this.m_errorSources;
     }
     
     /**
      * Callback called when a test starts.
      */
     public void testStarting() {
-        startTime = System.currentTimeMillis();
+        m_startTime = System.currentTimeMillis();
     }
 
     /**
@@ -117,8 +117,8 @@
      * @param test the test in error.
      */
     public void testError(Test test) {
-        ++errorsCount;
-        errorSources.add(test.toString());
+        ++m_errorsCount;
+        m_errorSources.add(test.toString());
         endTest();
     }
 
@@ -127,8 +127,8 @@
      * @param test the failing test.
      */
     public void testFailed(Test test) {
-        ++failuresCount;
-        failureSources.add(test.toString());
+        ++m_failuresCount;
+        m_failureSources.add(test.toString());
         endTest();
     }
 
@@ -137,41 +137,41 @@
      * This method handles common action when a test ends.
      */
     private void endTest() {
-        ++completedCount;
+        ++m_completedCount;
 
-        endTime = System.currentTimeMillis();
+        m_endTime = System.currentTimeMillis();
 
-        if (startTime == 0) {
-            startTime = endTime;
+        if (m_startTime == 0) {
+            m_startTime = m_endTime;
         }
     }
     
     
     public int getNumErrors() {
-        return errorsCount;
+        return m_errorsCount;
     }
 
     public int getNumFailures() {
-        return failuresCount;
+        return m_failuresCount;
     }
 
     public int getNumTests() {
-        return completedCount;
+        return m_completedCount;
     }
 
     /**
      * Reset the report.
      */
     public void reset() {
-        errorsCount = 0;
+        m_errorsCount = 0;
 
-        failuresCount = 0;
+        m_failuresCount = 0;
 
-        completedCount = 0;
+        m_completedCount = 0;
 
-        this.failureSources = new ArrayList();
+        this.m_failureSources = new ArrayList();
 
-        this.errorSources = new ArrayList();
+        this.m_errorSources = new ArrayList();
 
     }
 
@@ -182,13 +182,14 @@
      * @return the String displaying the elapsed time
      */
     protected String elapsedTimeAsString(long runTime) {
-        return numberFormat.format((double) runTime / 1000);
+        return m_numberFormat.format((double) runTime / 1000);
     }
 
     /**
-     * Returns the stacktrace as String.
-     * @param report ReportEntry object.
-     * @return stacktrace as string.
+     * Returns the stack trace as String.
+     * @param test the test
+     * @param e the exception
+     * @return stack trace as string.
      */
     protected String getStackTrace(Test test, Throwable e) {
 
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/StringOutputStream.java b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/StringOutputStream.java
index 60186cf..fa0a1f7 100644
--- a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/StringOutputStream.java
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/StringOutputStream.java
@@ -1,3 +1,21 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.felix.ipojo.junit4osgi.plugin;
 
 import java.io.OutputStream;
@@ -6,6 +24,7 @@
 /**
  * Provides an OutputStream to an internal String. Internally converts bytes to
  * a Strings and stores them in an internal StringBuffer.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class StringOutputStream extends OutputStream implements Serializable {
 
@@ -17,14 +36,14 @@
     /**
      * The internal destination StringBuffer.
      */
-    protected StringBuffer buf = null;
+    protected StringBuffer m_buffer = null;
 
     /**
      * Creates new StringOutputStream, makes a new internal StringBuffer.
      */
     public StringOutputStream() {
         super();
-        buf = new StringBuffer();
+        m_buffer = new StringBuffer();
     }
 
     /**
@@ -34,14 +53,14 @@
      * @return returns the content of the internal StringBuffer
      */
     public String toString() {
-        return buf.toString();
+        return m_buffer.toString();
     }
 
     /**
      * Sets the internal StringBuffer to null.
      */
     public void close() {
-        buf = null;
+        m_buffer = null;
 
     }
 
@@ -62,7 +81,7 @@
             bytes[i] = b[off];
             off++;
         }
-        buf.append(toCharArray(bytes));
+        m_buffer.append(toCharArray(bytes));
     }
 
     /**
@@ -71,7 +90,7 @@
      * @param b the byte as an int to add
      */
     public void write(int b) {
-        buf.append((char) b);
+        m_buffer.append((char) b);
     }
     
     /**
@@ -80,11 +99,14 @@
      * @param s the String to add
      */
     public void write(String s) {
-        buf.append(s);
+        m_buffer.append(s);
     }
     
     /**
      * Converts byte array to char array.
+     * @param barr input byte array
+     * @return the char array corresponding to the 
+     * given byte array
      */
     public static char[] toCharArray(byte[] barr) {
         if (barr == null) {
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/XMLReport.java b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/XMLReport.java
index 6d3a722..88e72ec 100644
--- a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/XMLReport.java
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/XMLReport.java
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -51,7 +51,7 @@
     /**
      * List of results.
      */
-    private List results = new ArrayList();
+    private List m_results = new ArrayList();
 
     /**
      * A test ends successfully.
@@ -60,17 +60,20 @@
     public void testSucceeded(Test test) {
         super.testSucceeded();
 
-        long runTime = this.endTime - this.startTime;
+        long runTime = this.m_endTime - this.m_startTime;
 
         Xpp3Dom testCase = createTestElement(test, runTime);
 
-        results.add(testCase);
+        m_results.add(testCase);
     }
 
     /**
      * A test throws an unexpected errors.
      * @param test the test in error
      * @param e the thrown exception
+     * @param out the output messages printed during the test execution
+     * @param err the error messages printed during the test execution
+     * @param log the messages logged during the test execution
      */
     public void testError(Test test, Throwable e, String out, String err, String log) {
         super.testError(test);
@@ -82,6 +85,9 @@
      * A test fails.
      * @param test the failing test
      * @param e the thrown failure
+     * @param out the output messages printed during the test execution
+     * @param err the error messages printed during the test execution
+     * @param log the messages logged during the test execution
      */
     public void testFailed(Test test, Throwable e, String out, String err, String log) {
         super.testFailed(test);
@@ -94,10 +100,13 @@
      * @param test the test
      * @param e the thrown error
      * @param name type of failure ("error" or "failure")
+     * @param out the output messages printed during the test execution
+     * @param err the error messages printed during the test execution
+     * @param log the messages logged during the test execution
      */
     private void writeTestProblems(Test test, Throwable e, String name, String out, String err, String log) {
 
-        long runTime = endTime - startTime;
+        long runTime = m_endTime - m_startTime;
 
         Xpp3Dom testCase = createTestElement(test, runTime);
 
@@ -115,8 +124,8 @@
                 element.setAttribute("message", message);
 
                 element.setAttribute("type",
-                        (stackTrace.indexOf(":") > -1 ? stackTrace.substring(0,
-                                stackTrace.indexOf(":")) : stackTrace));
+                        stackTrace.indexOf(":") > -1 ? stackTrace.substring(0,
+                                stackTrace.indexOf(":")) : stackTrace);
             } else {
                 element.setAttribute("type", new StringTokenizer(stackTrace)
                         .nextToken());
@@ -127,13 +136,13 @@
             element.setValue(stackTrace);
         }
         
-        addOutputStreamElement( out, "system-out", testCase );
+        addOutputStreamElement(out, "system-out", testCase);
 
-        addOutputStreamElement( err, "system-err", testCase );
-        
-        addOutputStreamElement( log, "log-service", testCase );
+        addOutputStreamElement(err, "system-err", testCase);
 
-        results.add(testCase);
+        addOutputStreamElement(log, "log-service", testCase);
+
+        m_results.add(testCase);
     }
 
     /**
@@ -146,7 +155,7 @@
      */
     public void generateReport(Test test, TestResult tr, File reportsDirectory,
             BundleContext bc) throws Exception {
-        long runTime = this.endTime - this.startTime;
+        long runTime = this.m_endTime - this.m_startTime;
 
         Xpp3Dom testSuite = createTestSuiteElement(test, runTime);
 
@@ -158,7 +167,7 @@
 
         testSuite.setAttribute("failures", String.valueOf(tr.failureCount()));
 
-        for (Iterator i = results.iterator(); i.hasNext();) {
+        for (Iterator i = m_results.iterator(); i.hasNext();) {
             Xpp3Dom testcase = (Xpp3Dom) i.next();
             testSuite.addChild(testcase);
         }
@@ -183,9 +192,7 @@
             throw new Exception("Unable to use UTF-8 encoding", e);
         } catch (FileNotFoundException e) {
             throw new Exception("Unable to create file: " + e.getMessage(), e);
-        }
-
-        finally {
+        } finally {
             IOUtil.close(writer);
         }
     }
@@ -231,7 +238,7 @@
     }
 
     /**
-     * Creates an XML element
+     * Creates an XML element.
      * @param element the parent element
      * @param name the name of the element to create
      * @return the resulting XML tree.
@@ -294,6 +301,8 @@
                 case Bundle.UNINSTALLED:
                     state = "UNINSTALLED";
                     break;
+                default:
+                    break;
             }
             Xpp3Dom bundle = createElement(buns, "bundle");
             bundle.setAttribute("symbolic-name", sn);
@@ -302,6 +311,13 @@
 
     }
     
+    /**
+     * Adds messages written during the test execution in the
+     * XML tree.
+     * @param stdOut the messages
+     * @param name the name of the stream (out, error, log)
+     * @param testCase the XML tree
+     */
     private void addOutputStreamElement(String stdOut, String name,
             Xpp3Dom testCase) {
         if (stdOut != null && stdOut.trim().length() > 0) {
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/log/LogServiceImpl.java b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/log/LogServiceImpl.java
index aaa6fe0..bb795ac 100644
--- a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/log/LogServiceImpl.java
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/log/LogServiceImpl.java
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,25 +35,25 @@
     /**
      * Default output stream (not collected).
      */
-    private StringOutputStream defaultStream;
+    private StringOutputStream m_defaultStream;
   
     /**
      * Collected output stream.
      */
-    private StringOutputStream outputStream; 
+    private StringOutputStream m_outputStream; 
     
     /**
      * Creates the log service object.
      */
     public LogServiceImpl() {
-        defaultStream = new StringOutputStream();
+        m_defaultStream = new StringOutputStream();
     }
    
     /**
      * Enables the log messages collection.
      */
     public void enableOutputStream() {
-        outputStream = new StringOutputStream();
+        m_outputStream = new StringOutputStream();
     }
     
     /**
@@ -61,14 +61,14 @@
      * @return the String containing the logged messages.
      */
     public String getLoggedMessages() {
-        return outputStream.toString();
+        return m_outputStream.toString();
     }
     
     /**
      * Re-initializes the collected message list.
      */
     public void reset() {
-        outputStream = null;
+        m_outputStream = null;
     }
 
     /**
@@ -138,6 +138,8 @@
             case LogService.LOG_WARNING:
                 message = "[WARNING] " + msg;
                 break;
+            default:
+                break;
         }
         
         if (exception != null) {
@@ -152,10 +154,10 @@
      * @param log the message
      */
     public void write(String log) {
-        if (outputStream != null) {
-            outputStream.write(log);
+        if (m_outputStream != null) {
+            m_outputStream.write(log);
         } else {
-            defaultStream.write(log);
+            m_defaultStream.write(log);
         }
     }
 
diff --git a/ipojo/examples/junit4osgi/pom.xml b/ipojo/examples/junit4osgi/pom.xml
index 1dede45..5166221 100644
--- a/ipojo/examples/junit4osgi/pom.xml
+++ b/ipojo/examples/junit4osgi/pom.xml
@@ -18,8 +18,8 @@
 -->
 <project>
   <modelVersion>4.0.0</modelVersion>
-  <artifactId>Junit4Osgi</artifactId>
-  <groupId>ipojo.examples</groupId>
+  <artifactId>Junit4OSGi</artifactId>
+  <groupId>org.apache.felix</groupId>
   <version>1.1.0-SNAPSHOT</version>
   <name>Apache Felix iPOJO Junit4OSGi</name>
   <packaging>pom</packaging>
diff --git a/ipojo/examples/junit4osgi/swing-runner/LICENSE b/ipojo/examples/junit4osgi/swing-runner/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/ipojo/examples/junit4osgi/swing-runner/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/ipojo/examples/junit4osgi/swing-runner/NOTICE b/ipojo/examples/junit4osgi/swing-runner/NOTICE
new file mode 100644
index 0000000..b766c24
--- /dev/null
+++ b/ipojo/examples/junit4osgi/swing-runner/NOTICE
@@ -0,0 +1,17 @@
+Apache Felix iPOJO junit4osgi Swing Runner
+Copyright 2008 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+II. Used Software
+
+This product uses software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
diff --git a/ipojo/examples/junit4osgi/swing-runner/metadata.xml b/ipojo/examples/junit4osgi/swing-runner/metadata.xml
index 9251b6f..2a5a610 100644
--- a/ipojo/examples/junit4osgi/swing-runner/metadata.xml
+++ b/ipojo/examples/junit4osgi/swing-runner/metadata.xml
@@ -1,3 +1,21 @@
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
+-->
 <?xml version="1.0" encoding="UTF-8"?>
 <iPOJO>
 	<component
diff --git a/ipojo/examples/junit4osgi/swing-runner/pom.xml b/ipojo/examples/junit4osgi/swing-runner/pom.xml
index fe9b18e..4931067 100644
--- a/ipojo/examples/junit4osgi/swing-runner/pom.xml
+++ b/ipojo/examples/junit4osgi/swing-runner/pom.xml
@@ -21,7 +21,7 @@
 	<packaging>bundle</packaging>
 	<name>Junit4Osgi-Swing-GUI</name>
 	<artifactId>org.apache.felix.ipojo.junit4osgi.swing-gui</artifactId>
-	<groupId>ipojo.examples</groupId>
+	<groupId>org.apache.felix</groupId>
 	<version>1.1.0-SNAPSHOT</version>
 	<dependencies>
 		<dependency>
@@ -30,61 +30,78 @@
 			<version>1.1.0-SNAPSHOT</version>
 		</dependency>
 		<dependency>
-			<groupId>org.apache.felix</groupId>
-			<artifactId>org.apache.felix.shell</artifactId>
-			<version>1.0.2</version>
-		</dependency>
-		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
 			<version>3.8.1</version>
 		</dependency>
 	</dependencies>
 	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<configuration>
-					<source>1.5</source>
-					<target>1.5</target>
-				</configuration>
-			</plugin>
-			<plugin>
-				<groupId>org.apache.felix</groupId>
-				<artifactId>maven-bundle-plugin</artifactId>
-				<version>1.4.3</version>
-				<extensions>true</extensions>
-				<configuration>
-					<instructions>
-						<Bundle-Name>
-							iPOJO OSGi Junit Runner - Swing Gui
-						</Bundle-Name>
-						<Bundle-SymbolicName>
-							${pom.artifactId}
-						</Bundle-SymbolicName>
-						<Private-Package>
-							org.apache.felix.ipojo.junit4osgi.command
-						</Private-Package>
-						<Import-Package>org.osgi.framework;version=1.3,*</Import-Package>
-					</instructions>
-				</configuration>
-			</plugin>
-			<plugin>
-				<groupId>org.apache.felix</groupId>
-				<artifactId>maven-ipojo-plugin</artifactId>
-				<version>1.1.0-SNAPSHOT</version>
-				<executions>
-					<execution>
-						<goals>
-							<goal>ipojo-bundle</goal>
-						</goals>
-						<configuration>
-							<ignoreAnnotations>true</ignoreAnnotations>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
+	<plugins>
+		<plugin>
+			<groupId>org.apache.maven.plugins</groupId>
+			<artifactId>maven-compiler-plugin</artifactId>
+			<configuration>
+				<source>1.5</source>
+				<target>1.5</target>
+			</configuration>
+		</plugin>
+		<plugin>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>maven-bundle-plugin</artifactId>
+			<version>1.4.3</version>
+			<extensions>true</extensions>
+			<configuration>
+				<instructions>
+					<Bundle-Name> iPOJO OSGi Junit Runner - Swing Gui</Bundle-Name>
+					<Bundle-SymbolicName> ${pom.artifactId}</Bundle-SymbolicName>
+					<Private-Package> org.apache.felix.ipojo.junit4osgi.command
+					</Private-Package>
+					<Import-Package>org.osgi.framework;version=1.3,*
+					</Import-Package>
+				</instructions>
+			</configuration>
+		</plugin>
+		<plugin>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>maven-ipojo-plugin</artifactId>
+			<version>1.1.0-SNAPSHOT</version>
+			<executions>
+				<execution>
+					<goals>
+						<goal>ipojo-bundle</goal>
+					</goals>
+					<configuration>
+						<ignoreAnnotations>true</ignoreAnnotations>
+					</configuration>
+				</execution>
+			</executions>
+		</plugin>
+		<plugin>
+			<groupId>org.codehaus.mojo</groupId>
+			<artifactId>rat-maven-plugin</artifactId>
+			<configuration>
+				<excludeSubProjects>false</excludeSubProjects>
+				<useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+				<useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+				<excludes>
+					<param>doc/*</param>
+					<param>maven-eclipse.xml</param>
+					<param>.checkstyle</param>
+					<param>.externalToolBuilders/*</param>
+				</excludes>
+			</configuration>
+		</plugin>
+		<plugin>
+			<groupId>org.apache.maven.plugins</groupId>
+			<artifactId>maven-checkstyle-plugin
+			</artifactId>
+			<configuration>
+				<configLocation>
+					http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml
+				</configLocation>
+				<violationSeverity>error</violationSeverity>
+			</configuration>
+		</plugin>
+	</plugins>
+</build>
 </project>
diff --git a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ResultCellRenderer.java b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ResultCellRenderer.java
index 680ad32..3370f1a 100644
--- a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ResultCellRenderer.java
+++ b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ResultCellRenderer.java
@@ -1,20 +1,3 @@
-/*
- *  Copyright 2008 clement.
- * 
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *  under the License.
- */
-
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -52,12 +35,23 @@
      */
     private static final long serialVersionUID = 1L;
 
+    /**
+     * Renderer method.
+     * @param table the table
+     * @param value the value
+     * @param isSelected is the cell selected
+     * @param hasFocus has the cell the focus
+     * @param row the cell row
+     * @param column the cell column
+     * @return the resulting component
+     * @see javax.swing.table.DefaultTableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
+     */
     public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
         Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
 
         ResultTableModel results = (ResultTableModel) table.getModel();
         String status = (String) results.getValueAt(row, column);
-        if (status.equals(ResultTableModel.SUCESS)) {
+        if (status.equals(ResultTableModel.SUCCESS)) {
             c.setForeground(Color.GREEN);
             setToolTipText(results.getMessage(row, column));
         }
diff --git a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ResultTableModel.java b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ResultTableModel.java
index 491f223..bf457ba 100644
--- a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ResultTableModel.java
+++ b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/ResultTableModel.java
@@ -35,51 +35,84 @@
  */
 public class ResultTableModel extends AbstractTableModel {
 
-    public static final String SUCESS = "success";
+    /**
+     * Success String.
+     */
+    public static final String SUCCESS = "success";
 
+    /**
+     * Failure String.
+     */
     public static final String FAILURE = "failure";
 
+    /**
+     * Error String.
+     */
     public static final String ERROR = "error";
 
+    /**
+     * UUDI.
+     */
     private static final long serialVersionUID = 1L;
 
-    private List<TestRecord> results = new ArrayList<TestRecord>();
+    /**
+     * List of results.
+     */
+    private List<TestRecord> m_results = new ArrayList<TestRecord>();
 
     public int getRowCount() {
-        return results.size();
+        return m_results.size();
     }
 
     public int getColumnCount() {
         return 2;
     }
 
+    /**
+     * Adds a failing test.
+     * @param t the test
+     * @param e the assertion error
+     */
     public void addTest(Test t, AssertionFailedError e) {
         TestRecord rec = new TestRecord(t, e);
-        results.add(rec);
+        m_results.add(rec);
         fireTableDataChanged();
     }
 
+    /**
+     * Adds a test in error.
+     * @param t the test
+     * @param e the thrown error
+     */
     public void addTest(Test t, Throwable e) {
         TestRecord rec = new TestRecord(t, e);
-        results.add(rec);
+        m_results.add(rec);
         fireTableDataChanged();
     }
 
+    /**
+     * Adds a sucessfull test.
+     * @param t the test
+     */
     public void addTest(Test t) {
         if (!contains(t)) {
             TestRecord rec = new TestRecord(t);
-            results.add(rec);
+            m_results.add(rec);
             fireTableDataChanged();
         }
     }
 
     public int getTestCount() {
-        return results.size();
+        return m_results.size();
     }
 
+    /**
+     * Gets the number of success.
+     * @return the number of success
+     */
     public int getSucess() {
         int count = 0;
-        for (TestRecord test : results) {
+        for (TestRecord test : m_results) {
             if (test.m_wasSucessFull) {
                 count++;
             }
@@ -87,19 +120,27 @@
         return count;
     }
 
+    /**
+     * Gets the number of errors.
+     * @return the number of errors
+     */
     public int getErrors() {
         int count = 0;
-        for (TestRecord test : results) {
+        for (TestRecord test : m_results) {
             if (test.m_error != null) {
                 count++;
             }
         }
         return count;
     }
-
+    
+    /**
+     * Gets the number of failures.
+     * @return the number of failures
+     */
     public int getFailures() {
         int count = 0;
-        for (TestRecord test : results) {
+        for (TestRecord test : m_results) {
             if (test.m_failure != null) {
                 count++;
             }
@@ -107,29 +148,51 @@
         return count;
     }
 
+    
+    /**
+     * Does the result list contains the given test.
+     * @param t the test 
+     * @return <code>true</code> if the list contains the test.
+     */
     private boolean contains(Test t) {
-        for (TestRecord test : results) {
+        for (TestRecord test : m_results) {
             if (test.m_test.equals(t)) { return true; }
         }
         return false;
     }
 
+    /**
+     * Clear the list.
+     */
     public void clear() {
-        results.clear();
+        m_results.clear();
         fireTableDataChanged();
     }
 
+    /**
+     * Get the Object placed in the JTable.
+     * @param rowIndex the row
+     * @param columnIndex the column
+     * @return the object
+     * @see javax.swing.table.TableModel#getValueAt(int, int)
+     */
     public Object getValueAt(int rowIndex, int columnIndex) {
-        if (columnIndex == 0) { return results.get(rowIndex).m_test; }
+        if (columnIndex == 0) { return m_results.get(rowIndex).m_test; }
         if (columnIndex == 1) {
-            TestRecord tr = results.get(rowIndex);
-            if (tr.m_wasSucessFull) { return SUCESS; }
+            TestRecord tr = m_results.get(rowIndex);
+            if (tr.m_wasSucessFull) { return SUCCESS; }
             if (tr.m_failure != null) { return FAILURE; }
             if (tr.m_error != null) { return ERROR; }
         }
         return null;
     }
 
+    /**
+     * Gets column names.
+     * @param column the column
+     * @return the column name
+     * @see javax.swing.table.AbstractTableModel#getColumnName(int)
+     */
     public String getColumnName(int column) {
         if (column == 0) { return "Test"; }
 
@@ -138,9 +201,15 @@
         return null;
     }
 
+    /**
+     * Gets the message.
+     * @param row the row
+     * @param column the column
+     * @return the message for this cell
+     */
     public String getMessage(int row, int column) {
         if (row == -1) { return null; }
-        TestRecord rec = results.get(row);
+        TestRecord rec = m_results.get(row);
         if (rec.m_wasSucessFull) { return "The test " + rec.m_test + " was executed sucessfully."; }
         if (rec.m_failure != null) { return "The test " + rec.m_test + " has failed : \n" + rec.m_failure.getMessage(); }
         if (rec.m_error != null) {
@@ -154,26 +223,52 @@
     }
 
     private class TestRecord {
+        /**
+         * Was the test successful?
+         */
         private boolean m_wasSucessFull;
 
+        /**
+         * The test.
+         */
         private Test m_test;
 
+        /**
+         * The failure.
+         */
         private AssertionFailedError m_failure;
 
+        /**
+         * The error.
+         */
         private Throwable m_error;
 
+        /**
+         * Creates a TestRecord.
+         * @param t the test
+         * @param e the failure
+         */
         public TestRecord(Test t, AssertionFailedError e) {
             m_test = t;
             m_wasSucessFull = false;
             m_failure = e;
         }
 
+        /**
+         * Creates a TestRecord.
+         * @param t the test
+         * @param e the error
+         */
         public TestRecord(Test t, Throwable e) {
             m_test = t;
             m_wasSucessFull = false;
             m_error = e;
         }
 
+        /**
+         * Creates a TestRecord.
+         * @param t the test
+         */
         public TestRecord(Test t) {
             m_test = t;
             m_wasSucessFull = true;
diff --git a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/SwingRunner.form b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/SwingRunner.form
index 55cf564..5d5abba 100644
--- a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/SwingRunner.form
+++ b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/SwingRunner.form
@@ -1,3 +1,21 @@
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
+-->
 <?xml version="1.0" encoding="UTF-8" ?>
 
 <Form version="1.3" maxVersion="1.5" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
diff --git a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/SwingRunner.java b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/SwingRunner.java
index 82c4366..90eb523 100644
--- a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/SwingRunner.java
+++ b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/SwingRunner.java
@@ -41,6 +41,9 @@
  */
 public class SwingRunner extends javax.swing.JFrame implements BundleListener {
 
+    /**
+     * UUID.
+     */
     private static final long serialVersionUID = 1L;
 
     /**
@@ -96,17 +99,17 @@
         m_progress.setIndeterminate(false);
         m_progress.setMaximum(100);
         m_progress.setValue(100);
-        
+
         TableColumn column = null;
         for (int i = 0; i < m_resultTable.getColumnCount(); i++) {
             column = m_resultTable.getColumnModel().getColumn(i);
             if (i == 0) {
-                column.setPreferredWidth(350); //first column is bigger
+                column.setPreferredWidth(350); // first column is bigger
             } else {
                 column.setPreferredWidth(50);
                 column.setCellRenderer(new ResultCellRenderer());
+            }
         }
-}
     }
 
     /**
@@ -120,6 +123,7 @@
     /**
      * Refresh the list of available test suites.
      */
+    @SuppressWarnings("unchecked")
     private void refreshSuites() {
         List<Test> list = m_runner.getTests();
         TestListModel lm = (TestListModel) m_suiteList.getModel();
@@ -296,13 +300,13 @@
         getContentPane().add(m_statusBar, gridBagConstraints);
 
         pack();
-    }// </editor-fold>//GEN-END:initComponents
+    } // </editor-fold>//GEN-END:initComponents
 
     /**
      * Execute button action.
      * @param evt : event.
      */
-    private void executeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_executeButtonActionPerformed
+    private void executeButtonActionPerformed(java.awt.event.ActionEvent evt) { //GEN-FIRST:event_m_executeButtonActionPerformed
         if (m_running) { return; }
         // Collect selected test.
         int[] indices = m_suiteList.getSelectedIndices();
@@ -313,26 +317,26 @@
         }
         setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
         executeTest(list);
-    }//GEN-LAST:event_m_executeButtonActionPerformed
+    } //GEN-LAST:event_m_executeButtonActionPerformed
 
     /**
      * All button action.
      * @param evt : event.
      */
-    private void allButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_allButtonActionPerformed
+    private void allButtonActionPerformed(java.awt.event.ActionEvent evt) { //GEN-FIRST:event_m_allButtonActionPerformed
         int max = m_suiteList.getModel().getSize();
         int[] indices = new int[max];
         for (int i = 0; i < max; i++) {
             indices[i] = i;
         }
         m_suiteList.setSelectedIndices(indices);
-    }//GEN-LAST:event_m_allButtonActionPerformed
+    } //GEN-LAST:event_m_allButtonActionPerformed
 
     /**
      * Listener on table click.
      * @param evt : event.
      */
-    private void resultTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_m_resultTableMouseClicked
+    private void resultTableMouseClicked(java.awt.event.MouseEvent evt) { //GEN-FIRST:event_m_resultTableMouseClicked
         Point p = evt.getPoint();
         int row = m_resultTable.rowAtPoint(p);
         int col = m_resultTable.columnAtPoint(p);
@@ -344,25 +348,25 @@
             m_messageArea.setText(message);
             m_resultDialog.setVisible(true);
         }
-    }//GEN-LAST:event_m_resultTableMouseClicked
+    } //GEN-LAST:event_m_resultTableMouseClicked
 
     /**
      * Ok button action.
      * @param evt : event.
      */
-    private void okActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_okActionPerformed
+    private void okActionPerformed(java.awt.event.ActionEvent evt) { //GEN-FIRST:event_m_okActionPerformed
         m_resultDialog.setVisible(false);
         setEnabled(true);
-    }//GEN-LAST:event_m_okActionPerformed
+    } //GEN-LAST:event_m_okActionPerformed
 
     /**
      * Listener when the test report is closed.
      * @param evt : event.
      */
-    private void onDialogClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_onDialogClosed
+    private void onDialogClosed(java.awt.event.WindowEvent evt) { //GEN-FIRST:event_onDialogClosed
         m_resultDialog.setVisible(false);
         setEnabled(true);
-    }//GEN-LAST:event_onDialogClosed
+    } //GEN-LAST:event_onDialogClosed
 
     /**
      * Execute method.
@@ -394,15 +398,19 @@
         new Thread(thread).start();
     }
     
-     private void computeExecutedTest() {
+    /**
+     * Compute executed tests.
+     * (Status bar message)
+     */
+    private void computeExecutedTest() {
         ResultTableModel results = (ResultTableModel) m_resultTable.getModel();
         String m = " \t ";
-        m+= results.getTestCount() + " tests executed / ";
-        m+= results.getSucess() + " sucess / ";
-        m+= results.getFailures() + " failures / ";
-        m+= results.getErrors() + " errors ";
+        m += results.getTestCount() + " tests executed / ";
+        m += results.getSucess() + " sucess / ";
+        m += results.getFailures() + " failures / ";
+        m += results.getErrors() + " errors ";
         m_executedResults.setText(m);
-     }
+    }
 
     private class MyTestListener implements junit.framework.TestListener {
         /**
diff --git a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/TestListModel.java b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/TestListModel.java
index 4811c5e..3232dad 100644
--- a/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/TestListModel.java
+++ b/ipojo/examples/junit4osgi/swing-runner/src/main/java/org/apache/felix/ipojo/junit4osgi/command/TestListModel.java
@@ -29,39 +29,65 @@
  */
 public class TestListModel extends AbstractListModel {
 
+    /**
+     * Id.
+     */
     private static final long serialVersionUID = 1L;
 
-    private List<TestRecord> list = new ArrayList<TestRecord>();
+    /**
+     * List of {@link TestRecord}. 
+     */
+    private List<TestRecord> m_list = new ArrayList<TestRecord>();
 
+    /**
+     * Gets the element placed at the given index.
+     * @param index the index
+     * @return the element placed at the given index 
+     * or <code>null</code> if no element at this index
+     * @see javax.swing.ListModel#getElementAt(int)
+     */
     public Object getElementAt(int index) {
-        if (index >= list.size()) {
+        if (index >= m_list.size()) {
             return null;
         } else {
-            return list.get(index).name;
+            return m_list.get(index).m_name;
         }
     }
 
+    /**
+     * Gets the test object placed at the given index.
+     * @param index the index
+     * @return the test object placed at the given index
+     */
     public Test getTestElementAt(int index) {
-        return list.get(index).test;
+        return m_list.get(index).m_test;
     }
 
+    /**
+     * Adds a test.
+     * @param test the test to add
+     */
     public void addTest(Test test) {
-        synchronized(this) {
+        synchronized (this) {
             TestRecord tr = new TestRecord();
-            tr.test = test;
-            tr.name = test.toString();
-            list.add(tr);
+            tr.m_test = test;
+            tr.m_name = test.toString();
+            m_list.add(tr);
         }
-        fireContentsChanged(this, list.size() - 1, list.size() - 1);
+        fireContentsChanged(this, m_list.size() - 1, m_list.size() - 1);
     }
 
+    /**
+     * Removes a test.
+     * @param test the test to remove
+     */
     public void removeTest(Test test) {
         int index = 1;
-        synchronized(this) {
-            for (TestRecord t : list) {
-                if (t.test.equals(test)) {
-                    index = list.indexOf(t);
-                    list.remove(t);
+        synchronized (this) {
+            for (TestRecord t : m_list) {
+                if (t.m_test.equals(test)) {
+                    index = m_list.indexOf(t);
+                    m_list.remove(t);
                     return;
                 }
             }
@@ -72,18 +98,32 @@
         }
     }
 
+    /**
+     * Clears the list.
+     */
     public void clear() {
-        list.clear();
+        m_list.clear();
     }
 
     private class TestRecord {
-        public Test test;
+        /**
+         * The test.
+         */
+        public Test m_test;
 
-        public String name;
+        /**
+         * The test name.
+         */
+        public String m_name;
     }
 
+    /**
+     * Gets the list size.
+     * @return the list size.
+     * @see javax.swing.ListModel#getSize()
+     */
     public int getSize() {
-        return list.size();
+        return m_list.size();
     }
 
 }
