From 58176910ab6c1b65631481f50a1ad31cc17c35e0 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 01 Sep 2006 01:16:17 +0000
Subject: [PATCH] Update the build script to ensure that checkstyle is run on the unit tests and functional/integration tests.  At the present time, this includes only ensuring that the CDDL header is included at the top of the file.  It also updates three integration test source files to add a missing line break in the CDDL header.

---
 opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_syntax.java        |    3 ++-
 opends/ext/checkstyle/opends-unittest-checkstyle.xml                                                                       |   15 +++++++++++++++
 opends/build.xml                                                                                                           |   21 +++++++++++++++++++--
 opends/ext/checkstyle/opends-functest-checkstyle.xml                                                                       |   15 +++++++++++++++
 opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_standards.java     |    3 ++-
 opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2253_relationships.java |    3 ++-
 6 files changed, 55 insertions(+), 5 deletions(-)

diff --git a/opends/build.xml b/opends/build.xml
index 674810d..82aba0a 100644
--- a/opends/build.xml
+++ b/opends/build.xml
@@ -56,6 +56,12 @@
   <property name="unittest.report.dir"
        location="${build.dir}/unit-tests/report"/>
 
+  <!-- Properties for use in functional/integration testing.  -->
+  <property name="functest.testng.dir"
+       location="tests/integration-tests-testng" />
+  <property name="functest.testng.src.dir"
+    location="${functest.testng.dir}/src"/>
+
   <!-- Properties for use with the DSML component.                      -->
   <property name="dsml.dir"         location="resource/dsml"             />
   <property name="dsml.src.dir"     location="src/dsml"                  />
@@ -221,6 +227,18 @@
            includes="**/*.java" />
       <formatter type="plain" />
     </checkstyle>
+
+    <checkstyle config="${checkstyle.dir}/opends-unittest-checkstyle.xml"
+         failOnViolation="true">
+      <fileset dir="${unittest.testng.src.dir}" includes="**/*.java" />
+      <formatter type="plain" />
+    </checkstyle>
+
+    <checkstyle config="${checkstyle.dir}/opends-functest-checkstyle.xml"
+         failOnViolation="true">
+      <fileset dir="${functest.testng.src.dir}" includes="**/*.java" />
+      <formatter type="plain" />
+    </checkstyle>
   </target>
 
 
@@ -621,8 +639,7 @@
   
     <target name="integration-tests" 
         description="Builds the integration tests">
-        <ant dir="${basedir}/tests/integration-tests-testng">
-        </ant>
+        <ant dir="${functest.testng.dir}" />
     </target>
         
 </project>
diff --git a/opends/ext/checkstyle/opends-functest-checkstyle.xml b/opends/ext/checkstyle/opends-functest-checkstyle.xml
new file mode 100644
index 0000000..664a714
--- /dev/null
+++ b/opends/ext/checkstyle/opends-functest-checkstyle.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+
+<module name="Checker">
+  <module name="TreeWalker">
+    <!-- Ensure that each source file starts with the appropriate header -->
+    <module name="Header">
+      <property name="headerFile" value="${basedir}/ext/checkstyle/opends.sourceheader" />
+    </module>
+  </module>
+</module>
+
diff --git a/opends/ext/checkstyle/opends-unittest-checkstyle.xml b/opends/ext/checkstyle/opends-unittest-checkstyle.xml
new file mode 100644
index 0000000..664a714
--- /dev/null
+++ b/opends/ext/checkstyle/opends-unittest-checkstyle.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+
+<module name="Checker">
+  <module name="TreeWalker">
+    <!-- Ensure that each source file starts with the appropriate header -->
+    <module name="Header">
+      <property name="headerFile" value="${basedir}/ext/checkstyle/opends.sourceheader" />
+    </module>
+  </module>
+</module>
+
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_standards.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_standards.java
index f28c552..5a7d5df 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_standards.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_standards.java
@@ -1,4 +1,5 @@
-/* * CDDL HEADER START
+/*
+ * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
  * Common Development and Distribution License, Version 1.0 only
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_syntax.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_syntax.java
index 317aa93..c749da7 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_syntax.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2252_syntax.java
@@ -1,4 +1,5 @@
-/* * CDDL HEADER START
+/*
+ * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
  * Common Development and Distribution License, Version 1.0 only
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2253_relationships.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2253_relationships.java
index c95f91c..0e94b4e 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2253_relationships.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/frontend/FrontendRFC2253_relationships.java
@@ -1,4 +1,5 @@
-/* * CDDL HEADER START
+/*
+ * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
  * Common Development and Distribution License, Version 1.0 only

--
Gitblit v1.10.0