Author: doll
Date: Wed May 14 03:24:23 2008
New Revision: 656222

URL: http://svn.apache.org/viewvc?rev=656222&view=rev
Log:
SHINDIG-221
Patch from Dave Smith. Added an AllTests target for the gadgets java unit 
tests. Also adds instructions for running this in eclipse to get code coverage 
results. 


Added:
    
incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/AllTests.java
Modified:
    incubator/shindig/trunk/pom.xml
    incubator/shindig/trunk/site/index.html

Added: 
incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/AllTests.java
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/AllTests.java?rev=656222&view=auto
==============================================================================
--- 
incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/AllTests.java
 (added)
+++ 
incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/AllTests.java
 Wed May 14 03:24:23 2008
@@ -0,0 +1,36 @@
+/*
+ * 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.shindig.gadgets;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import junitx.util.DirectorySuiteBuilder;
+import junitx.util.SimpleTestFilter;
+
+/**
+ * Run all gadgets tests.
+ */
+public class AllTests extends TestSuite {
+  
+  public static Test suite() throws Exception {
+    DirectorySuiteBuilder builder = new DirectorySuiteBuilder(
+      new SimpleTestFilter());
+    return builder.suite("target/test-classes");
+  }
+}

Modified: incubator/shindig/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/pom.xml?rev=656222&r1=656221&r2=656222&view=diff
==============================================================================
--- incubator/shindig/trunk/pom.xml (original)
+++ incubator/shindig/trunk/pom.xml Wed May 14 03:24:23 2008
@@ -658,6 +658,12 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>junit-addons</groupId>
+      <artifactId>junit-addons</artifactId>
+      <version>1.4</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.easymock</groupId>
       <artifactId>easymock</artifactId>
       <version>2.3</version>

Modified: incubator/shindig/trunk/site/index.html
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/site/index.html?rev=656222&r1=656221&r2=656222&view=diff
==============================================================================
--- incubator/shindig/trunk/site/index.html (original)
+++ incubator/shindig/trunk/site/index.html Wed May 14 03:24:23 2008
@@ -293,8 +293,8 @@
           </li>
           <li>File -&gt; New -&gt; Java Project
           <ol>
-            <li>Select 'Create project from existing source' and navigate 
to:<br>
-            ~/src/shindig/java</li>
+            <li>Name the project. The instructions below will assume 
"SHINDIG".</li>
+            <li>Select 'Create project from existing source' and navigate to 
<code>.../src/shindig/java</code>
             <li>Click Finish</li>
             <li>If you see a dialog for "Open Associated Perspective", click 
Ok. Don't worry about the errors after
             loading as they will be fixed in the next step.</li>
@@ -307,9 +307,26 @@
           debugging, you need the source jars. Right-click the project, select 
<code>Maven : Download Sources</code> and
           Eclipse will automatically know about these sources when debugging. 
You can browse them under <code>Maven
           Dependencies</code> in your project.</li>
+         <li>If you'll be using AllTests to run tests or generate code 
coverage stats, adjust the project's output folders.
+           <ol>
+             <li>Project -&gt; Properties -&gt; Java Build Path -&gt; 
Source</li>
+             <li>Locate and open 
<code>SHINDIG/gadgets/src/test/java</code></li>
+             <li>Select <code>Output Folder: (Default Output Folder)</code> 
and click Edit...</li>
+             <li>Select <code>Specific Output Folder</code></li>
+             <li>Enter <code>target/test-classes</code> and click OK.</li>
+             <li>Repeat for <code>SHINDIG/social-api/src/test/java</code></li>
+           </ol>
+         </li>
         </ol>
       </ul>
 
+      <h4><font size="3"><a name="Code_coverage_in_Eclipse"> Generating Code 
Coverage in Eclipse </a></font></h4>
+      <p>To generate code coverage statistics inside of Eclipse, install the 
<a href="http://www.eclema.org";>EclEmma</a> plugin. Then</p>
+      <ul>
+        <li>Open <code>org.apache.shindig.gadgets.AllTests</code></li>
+        <li>Right-click in the class, and select <code>Coverage as -&gt; JUnit 
Test</code></li>
+      </ul>
+
       <h4><font size="3"><a name="Running_inside_Eclipse"> Running inside 
Eclipse </a></font></h4>
       <p>To debug the server in Eclipse, follow the last two steps <a
         href="http://cwiki.apache.org/WICKET/maven-jetty-plugin.html"; 
target="_top">here</a> (takes a few minutes to set up):</p>


Reply via email to