You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2007/08/02 05:50:23 UTC

svn commit: r562010 [2/2] - in /maven/core-integration-testing/trunk: maven-integration-test-archetype/ maven-integration-test-archetype/src/ maven-integration-test-archetype/src/main/ maven-integration-test-archetype/src/main/resources/ maven-integrat...

Propchange: maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/checkstyle-assembly-1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/rule_set.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/rule_set.xml?view=auto&rev=562010
==============================================================================
--- maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/rule_set.xml (added)
+++ maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/rule_set.xml Wed Aug  1 20:50:20 2007
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<ruleset name="EPHS Custom ruleset"
+    xmlns="http://pmd.sf.net/ruleset/1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+    xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
+
+  <description>
+  This ruleset checks EPHS code
+  </description>
+
+  <rule ref="rulesets/finalizers.xml"/>  
+
+  
+  <rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
+
+  <rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>
+  <rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>
+  <rule ref="rulesets/optimizations.xml/UseArraysAsList"/>
+  <rule ref="rulesets/optimizations.xml/AvoidArrayLoops"/>
+  <!--<rule ref="rulesets/optimizations.xml/UnnecessaryWrapperObjectCreation"/> -->
+
+  <rule ref="rulesets/j2ee.xml/UseProperClassLoader"/>
+
+
+  <rule ref="rulesets/basic.xml/EmptyCatchBlock"/>
+  <rule ref="rulesets/basic.xml/EmptyIfStmt"/>
+  <rule ref="rulesets/basic.xml/EmptyWhileStmt"/>
+  <rule ref="rulesets/basic.xml/EmptyTryBlock"/>
+  <rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>
+  <rule ref="rulesets/basic.xml/EmptySwitchStatements"/>
+  <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
+  <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
+  <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
+  <rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>
+  <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
+  <rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>
+  <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
+  <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
+  <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
+  <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
+  <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
+  <rule ref="rulesets/basic.xml/ClassCastExceptionWithToArray"/>
+  <rule ref="rulesets/basic.xml/UselessOperationOnImmutable"/>
+ <!-- <rule ref="rulesets/basic.xml/NullPointerException"/> -->
+  <rule ref="rulesets/basic.xml/AvoidThreadGroup"/>
+ <!-- <rule ref="rulesets/basic.xml/BrokenNullCheck"/> -->
+ 
+  <rule ref="rulesets/sunsecure.xml"/>
+  <rule ref="rulesets/strictexception.xml"/>
+  
+  <rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>
+  <rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>
+
+  <rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>  
+  
+  
+  <rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>
+  <rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+  <rule ref="rulesets/design.xml/CloseResource"/>
+  <rule ref="rulesets/design.xml/NonStaticInitializer"/>
+  <rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>
+  <rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>
+  <rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
+  <rule ref="rulesets/design.xml/BadComparison"/>
+  <rule ref="rulesets/design.xml/EqualsNull"/>
+  <rule ref="rulesets/design.xml/InstantiationToGetClass"/>
+  <rule ref="rulesets/design.xml/IdempotentOperations"/>
+  <rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>
+  <rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>
+  <rule ref="rulesets/design.xml/MissingBreakInSwitch"/>
+  <rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>
+  <rule ref="rulesets/design.xml/SimplifyConditional"/>
+  <rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>
+  <rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>
+  <rule ref="rulesets/design.xml/UnsynchronizedStaticDateFormatter"/>
+  <rule ref="rulesets/design.xml/PreserveStackTrace"/>
+
+  <rule ref="rulesets/strings.xml/StringInstantiation"/>
+  <rule ref="rulesets/strings.xml/StringToString"/>
+  <rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>
+  <rule ref="rulesets/strings.xml/UseStringBufferLength"/>
+  <rule ref="rulesets/strings.xml/InsufficientStringBufferDeclaration"/>
+  <!--<rule ref="rulesets/strings.xml/UselessStringValueOf"/>  -->
+
+
+  <rule ref="rulesets/imports.xml"/>
+
+  <rule ref="rulesets/naming.xml/VariableNamingConventions"/>
+
+  <!--<rule ref="rulesets/naming.xml/AvoidDollarSign"/> -->
+  <rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>
+  <rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>
+  <rule ref="rulesets/naming.xml/SuspiciousEqualsMethodName"/>
+  <rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>
+  <rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>
+  <rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>
+  
+  <rule ref="rulesets/naming.xml/NoPackage"/>
+  <rule ref="rulesets/naming.xml/PackageCase"/>  
+  <rule ref="rulesets/naming.xml/MisleadingVariableName"/>
+
+
+  <rule ref="rulesets/logging-java.xml/SystemPrintln"/>
+  <rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>
+  
+  <rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>
+  
+
+  <rule ref="rulesets/braces.xml"/>
+
+</ruleset>
\ No newline at end of file

Added: maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/stc_checks.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/stc_checks.xml?view=auto&rev=562010
==============================================================================
--- maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/stc_checks.xml (added)
+++ maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/stc_checks.xml Wed Aug  1 20:50:20 2007
@@ -0,0 +1,121 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--
+
+  Checkstyle configuration that checks the sun coding conventions from:
+
+    - the Java Language Specification at
+      http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+    - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+    - the Javadoc guidelines at
+      http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+    - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+    - some best practices
+
+  Checkstyle is very configurable. Be sure to read the documentation at
+  http://checkstyle.sf.net (or in your downloaded distribution).
+
+  Most Checks are configurable, be sure to consult the documentation.
+
+  To completely disable a check, just comment it out or delete it from the file.
+
+  Finally, it is worth reading the documentation.
+
+-->
+
+<module name="Checker">
+  <module name="TreeWalker">
+
+    <!-- Checks for imports                              -->
+    <!-- See http://checkstyle.sf.net/config_import.html -->
+    <module name="AvoidStarImport"/>
+    <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+    <module name="RedundantImport"/>
+    <module name="UnusedImports"/>
+
+
+    <!-- Checks for Size Violations.                    -->
+    <!-- See http://checkstyle.sf.net/config_sizes.html -->
+
+
+
+    <!-- Modifier Checks                                    -->
+    <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+
+    <!-- Checks for blocks. You know, those {}'s         -->
+    <!-- See http://checkstyle.sf.net/config_blocks.html -->
+    <module name="LeftCurly">
+      <property name="option" value="nl"/>
+    </module>
+    <module name="RightCurly">
+      <property name="option" value="alone"/>
+    </module>
+
+    <module name="TabCharacter"/>
+    <module name="WhitespaceAfter"/>
+
+    <module name="ParenPad"/>
+    <module name="TypecastParenPad"/>
+    <module name="NoWhitespaceBefore"/>
+    <module name="PackageName"/>
+
+
+    <!-- Checks for class design                         -->
+    <!-- See http://checkstyle.sf.net/config_design.html -->
+
+
+    <!-- Miscellaneous other checks.                   -->
+    <!-- See http://checkstyle.sf.net/config_misc.html -->
+    <module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->
+    <module name="EmptyStatement"/>
+
+
+    <module name="GenericIllegalRegexp"> 
+      <!-- \s matches whitespace character, $ matches end of line. --> 
+      <property name="format" value="(?:\x66\x75\x63\x6B)|(?:\x73\x68\x69\x74)|(?:\x63\x75\x6E\x74)"/>
+      <property name="ignoreCase" value="true" />
+      <property name="message" value="Code contains inappropriate language"/>
+
+    </module>
+
+    <!--http://checkstyle.sourceforge.net/config_sizes.html-->
+    <!-- eclipse formatting does not shorten lines -->
+   <!-- <module name="LineLength">
+      <property name="severity" value="warning"/>
+      <property name="max" value="132"/>
+    </module> -->
+
+    <!-- the following exist in sufficent abundance that enforcing and even warning on these is impractical -->
+    <!--
+    <module name="ParameterName">
+      <property name="format" value="^[a-z][a-zA-Z0-9]*" />
+    </module> -->
+
+
+    <!-- http://checkstyle.sourceforge.net/config_coding.html#IllegalCatch-->
+   <!-- <module name="IllegalCatch">
+      <property name="severity" value="warning"/>
+    </module>   
+
+    <module name="IllegalThrows">
+      <property name="severity" value="warning"/>
+    </module>  
+
+    <module name="DefaultComesLast"/>
+
+    <module name="FallThrough">
+      <property name="severity" value="warning"/>
+    </module>  --> 
+
+
+
+
+  </module>
+</module>

Added: maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/pom.xml?view=auto&rev=562010
==============================================================================
--- maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/pom.xml (added)
+++ maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/pom.xml Wed Aug  1 20:50:20 2007
@@ -0,0 +1,50 @@
+<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>
+  <parent>
+    <groupId>org.apache.maven.its.itsample</groupId>
+    <artifactId>parent</artifactId>
+    <version>1</version>
+  </parent>
+  <artifactId>checkstyle-test</artifactId>
+  <name>Checkstyle Test</name>
+  <build>
+
+    <!--This extension is installed by the IT prior to invoking this build. See ../checkstyle-assembly-->
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.its.itsample</groupId>
+        <artifactId>checkstyle-assembly</artifactId>
+        <version>1.0</version>
+      </extension>
+    </extensions>
+
+	<!-- Typically the tests will not rely on actual plugins and should be self-contained, in this case the problem was most
+	often experienced with Checkstyle so it makes it a valid test. Notice however that it is pinned to a known released version 
+	so the test won't randomly fail in the future if the plugin behavior changes.
+	
+	If the extension listed above isn't correctly installed on the plugin classpath, this invocation will fail to find the custom rule -->
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>2.1</version>
+        <inherited>true</inherited>
+        <executions>
+          <execution>
+            <id>STC Checks</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>checkstyle</goal>
+            </goals>
+            <configuration>
+              <configLocation>stc_checks.xml</configLocation>
+              <failsOnError>true</failsOnError>
+              <cacheFile>${project.build.directory}/checkstyle-cachefile</cacheFile>
+              <consoleOutput>true</consoleOutput>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/src/main/java/Class.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/src/main/java/Class.java?view=auto&rev=562010
==============================================================================
--- maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/src/main/java/Class.java (added)
+++ maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/src/main/java/Class.java Wed Aug  1 20:50:20 2007
@@ -0,0 +1,9 @@
+public class Class
+{
+
+public static void main(String[] args)
+{
+  System.out.println("hello");
+  }
+  
+}
\ No newline at end of file

Added: maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/pom.xml?view=auto&rev=562010
==============================================================================
--- maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/pom.xml (added)
+++ maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/pom.xml Wed Aug  1 20:50:20 2007
@@ -0,0 +1,14 @@
+<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.maven.its.itsample</groupId>
+  <artifactId>parent</artifactId>
+  <packaging>pom</packaging>
+  <version>1</version>
+  <name>Checkstyle</name>
+  <!--
+  <modules>
+    <module>checkstyle-assembly</module>
+    <module>checkstyle-test</module>
+  </modules>
+  -->
+</project>

Added: maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/readme.txt
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/readme.txt?view=auto&rev=562010
==============================================================================
--- maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/readme.txt (added)
+++ maven/core-integration-testing/trunk/maven-integration-test-archetype/src/main/resources/archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/readme.txt Wed Aug  1 20:50:20 2007
@@ -0,0 +1,3 @@
+This is a sample IT based on a real one. This test first installs a jar containing some checkstyle rules. The second invocation uses that jar as an extension
+so that checkstyle finds the resources. If Maven behaves properly, the build succeeds, if not, the build fails. This is the simplest way to structure an IT when
+possible as it's cut and dry and is very easy to check with the verifier.
\ No newline at end of file

Modified: maven/core-integration-testing/trunk/maven-integration-test-sample/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/maven-integration-test-sample/pom.xml?view=diff&rev=562010&r1=559662&r2=562010
==============================================================================
--- maven/core-integration-testing/trunk/maven-integration-test-sample/pom.xml (original)
+++ maven/core-integration-testing/trunk/maven-integration-test-sample/pom.xml Wed Aug  1 20:50:20 2007
@@ -1,7 +1,7 @@
 <project>
   <modelVersion>4.0.0</modelVersion> 
-  <groupId>org.apache.maven.its</groupId>
-  <artifactId>maven-integration-test</artifactId>
+  <groupId>org.apache.maven.it.sample</groupId>
+  <artifactId>maven-integration-test-sample</artifactId>
   <version>1.0-SNAPSHOT</version>
   <name>Maven Integration Tests</name>
   <dependencies>

Modified: maven/core-integration-testing/trunk/maven-integration-test-sample/src/test/java/org/apache/maven/itSample/MavenITmngXXXXDescriptionOfProblemTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/maven-integration-test-sample/src/test/java/org/apache/maven/itSample/MavenITmngXXXXDescriptionOfProblemTest.java?view=diff&rev=562010&r1=559662&r2=562010
==============================================================================
--- maven/core-integration-testing/trunk/maven-integration-test-sample/src/test/java/org/apache/maven/itSample/MavenITmngXXXXDescriptionOfProblemTest.java (original)
+++ maven/core-integration-testing/trunk/maven-integration-test-sample/src/test/java/org/apache/maven/itSample/MavenITmngXXXXDescriptionOfProblemTest.java Wed Aug  1 20:50:20 2007
@@ -1,9 +1,10 @@
-package org.apache.maven.integrationtests;
+package org.apache.maven.itSample;
 
 import java.io.File;
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
+import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
 import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;