From 75045a9867c46a208db2ea589c2c2b0e9419912c Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 22 Jan 2014 13:34:32 +0000
Subject: [PATCH] Added clirr-maven-plugin to catch non backward compatible changes in opendj-core compared to opendj-ldap-sdk so they are documented.

---
 opendj-sdk/opendj-core/clirr-ignored-api-changes.xml |  168 +++++++++++++++++++++++++++++++++
 opendj-sdk/pom.xml                                   |    5 
 opendj-sdk/opendj-core/pom.xml                       |   72 ++++++++++++++
 3 files changed, 242 insertions(+), 3 deletions(-)

diff --git a/opendj-sdk/opendj-core/clirr-ignored-api-changes.xml b/opendj-sdk/opendj-core/clirr-ignored-api-changes.xml
new file mode 100644
index 0000000..0c92380
--- /dev/null
+++ b/opendj-sdk/opendj-core/clirr-ignored-api-changes.xml
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ! CDDL HEADER START
+  !
+  ! The contents of this file are subject to the terms of the
+  ! Common Development and Distribution License, Version 1.0 only
+  ! (the "License").  You may not use this file except in compliance
+  ! with the License.
+  !
+  ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
+  ! or http://forgerock.org/license/CDDLv1.0.html.
+  ! See the License for the specific language governing permissions
+  ! and limitations under the License.
+  !
+  ! When distributing Covered Code, include this CDDL HEADER in each
+  ! file and include the License file at legal-notices/CDDLv1_0.txt.
+  ! If applicable, add the following below this CDDL HEADER, with the
+  ! fields enclosed by brackets "[]" replaced with your own identifying
+  ! information:
+  !      Portions Copyright [yyyy] [name of copyright owner]
+  !
+  ! CDDL HEADER END
+  !
+  !      Copyright 2014 ForgeRock AS
+  !    
+-->
+<differences>
+<!--
+For specifying ignored differences, see:
+  http://mojo.codehaus.org/clirr-maven-plugin/examples/ignored-differences.html
+
+path/methods/to/from matching can either use:
+- regex when surrounded with '%regex[]'
+- ant style path matching when surrounded with '%ant[]'
+- ant style path matching when not surrounded by anything
+
+For path/methods matching in maven-clirr-plugin see (change version numbers accordingly):
+  http://svn.codehaus.org/mojo/tags/clirr-maven-plugin-2.6.1/src/main/java/org/codehaus/mojo/clirr/Difference.java
+  http://grepcode.com/file/repo1.maven.org/maven2/org.codehaus.plexus/plexus-utils/3.0.7/org/codehaus/plexus/util/SelectorUtils.java
+For a description of ant style path expressions see:
+  http://ant.apache.org/manual/dirtasks.html#patterns
+
+Note: waiting on https://jira.codehaus.org/browse/MCLIRR-62 to be resolved to avoid the need to use \s* in the '<to>' tags.
+-->
+  <difference>
+    <className>org/forgerock/opendj/ldap/CoreMessages</className>
+    <differenceType>8001</differenceType>
+    <justification>Incorrectly reported because it is automatically generated</justification>
+  </difference>
+
+  <difference>
+    <className>org/forgerock/opendj/ldap/Connections</className>
+    <differenceType>7005</differenceType>
+    <method>%regex[org\.forgerock\.opendj\.ldap\.ConnectionFactory newHeartBeatConnectionFactory\(org\.forgerock\.opendj\.ldap\.ConnectionFactory, long, java\.util\.concurrent\.TimeUnit, org\.forgerock\.opendj\.ldap\.requests\.SearchRequest(, java\.util\.concurrent\.ScheduledExecutorService)?\)]</method>
+    <to>%regex[org\.forgerock\.opendj\.ldap\.ConnectionFactory newHeartBeatConnectionFactory\(org\.forgerock\.opendj\.ldap\.ConnectionFactory,\s*long,\s*long,\s*java\.util\.concurrent\.TimeUnit(,\s*org\.forgerock\.opendj\.ldap\.requests\.SearchRequest(,\s*java\.util\.concurrent\.ScheduledExecutorService)?)?\)]</to>
+    <justification>OPENDJ-1058: Added a timeout parameter to actively shutdown dead connections</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/Connections</className>
+    <differenceType>7004</differenceType>
+    <method>org.forgerock.opendj.ldap.ConnectionFactory newHeartBeatConnectionFactory(org.forgerock.opendj.ldap.ConnectionFactory, long, java.util.concurrent.TimeUnit)</method>
+    <justification>OPENDJ-1058: Added a timeout parameter to actively shutdown dead connections</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/ErrorResultException</className>
+    <differenceType>7005</differenceType>
+    <method>%regex[org\.forgerock\.opendj\.ldap\.ErrorResultException newErrorResult\(org\.forgerock\.opendj\.ldap\.ResultCode, java\.lang\.String(, java\.lang\.Throwable)?\)]</method>
+    <to>%regex[org\.forgerock\.opendj\.ldap\.ErrorResultException newErrorResult\(org\.forgerock\.opendj\.ldap\.ResultCode, java\.lang\.CharSequence(, java\.lang\.Throwable)?\)]</to>
+    <justification>OPENDJ-1058: Broadened the API by accepting java.lang.CharSequence while retaining source compatibility</justification>
+  </difference>
+  <difference>
+    <className>%regex[org/forgerock/opendj/ldap/(LDAPConnectionFactory|LDAPListener)]</className>
+    <differenceType>7002</differenceType>
+    <method>java.lang.String getHostname()</method>
+    <justification>OPENDJ-1270: Renamed LDAP{ConnectionFactory|Listener}.getHostname() to getHostName()</justification>
+  </difference>
+  <difference>
+    <className>%regex[org/forgerock/opendj/ldap/(LDAPConnectionFactory|LDAPListener)]</className>
+    <differenceType>7006</differenceType>
+    <method>java.net.SocketAddress getSocketAddress()</method>
+    <to>java.net.InetSocketAddress</to>
+    <justification>OPENDJ-1270: Changed LDAP{ConnectionFactory|Listener}.getAddress() to return InetSocketAddresses</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/LDAPConnectionFactory</className>
+    <differenceType>7005</differenceType>
+    <method>%regex[LDAPConnectionFactory\(java\.net\.SocketAddress(, org\.forgerock\.opendj\.ldap\.LDAPOptions)?\)]</method>
+    <to>%regex[LDAPConnectionFactory\(java\.net\.InetSocketAddress(, org\.forgerock\.opendj\.ldap\.LDAPOptions)?\)]</to>
+    <justification>OPENDJ-1270: Changed constructors to only accept InetSocketAddresses instead of more generic SocketAddress</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/LDAPListener</className>
+    <differenceType>7005</differenceType>
+    <method>%regex[LDAPListener\(java\.net\.SocketAddress, org\.forgerock\.opendj\.ldap\.ServerConnectionFactory(,\s*org\.forgerock\.opendj\.ldap\.LDAPListenerOptions)?\)]</method>
+    <to>%regex[LDAPListener\(java\.net\.InetSocketAddress,\s*org\.forgerock\.opendj\.ldap\.ServerConnectionFactory(,\s*org\.forgerock\.opendj\.ldap\.LDAPListenerOptions)?\)]</to>
+    <justification>OPENDJ-1270: Changed constructors to only accept InetSocketAddresses instead of more generic SocketAddress</justification>
+  </difference>
+
+  <difference>
+    <className>%regex[org/forgerock/opendj/ldap/(LDAPOptions|LDAPListenerOptions)]</className>
+    <differenceType>7002</differenceType>
+    <method>%regex[org\.glassfish\.grizzly\.nio\.transport\.TCPNIOTransport getTCPNIOTransport\(\)]</method>
+    <justification>OPENDJ-346: Decoupled opendj-ldap-sdk from grizzly-framework</justification>
+  </difference>
+  <difference>
+    <className>%regex[org/forgerock/opendj/ldap/(LDAPOptions|LDAPListenerOptions)]</className>
+    <differenceType>7002</differenceType>
+    <method>%regex[org\.forgerock\.opendj\.ldap\.(LDAPOptions|LDAPListenerOptions) setTCPNIOTransport\(org\.glassfish\.grizzly\.nio\.transport\.TCPNIOTransport\)]</method>
+    <justification>OPENDJ-346: Decoupled opendj-ldap-sdk from grizzly-framework</justification>
+  </difference>
+
+  <difference>
+    <className>%regex[org/forgerock/opendj/asn1/[^/]*]</className>
+    <differenceType>8001</differenceType>
+    <justification>OPENDJ-175: Moved all classes from org.forgerock.opendj.asn1 package to org.forgerock.opendj.io package</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/ByteSequence</className>
+    <differenceType>7012</differenceType>
+    <method>boolean isEmpty()</method>
+    <justification>OPENDJ-701: Added method isEmpty() to interface ByteSequence</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/requests/SearchRequest</className>
+    <differenceType>7012</differenceType>
+    <method>boolean isSingleEntrySearch()</method>
+    <justification>OPENDJ-972: Added method isSingleEntrySearch() to interface SearchRequest</justification>
+  </difference>
+
+  <difference>
+    <className>org/forgerock/opendj/ldap/schema/MatchingRule</className>
+    <differenceType>7002</differenceType>
+    <method>%regex[org\.forgerock\.opendj\.ldap\.Assertion getAssertion\(org\.forgerock\.opendj\.ldap\.ByteSequence, java\.util\.List, org\.forgerock\.opendj\.ldap\.ByteSequence\)]</method>
+    <justification>Renamed getAssertion() to getSubstringAssertion()</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/schema/MatchingRuleImpl</className>
+    <differenceType>7002</differenceType>
+    <method>%regex[org\.forgerock\.opendj\.ldap\.Assertion getAssertion\(org\.forgerock\.opendj\.ldap\.schema\.Schema, org\.forgerock\.opendj\.ldap\.ByteSequence, java\.util\.List, org\.forgerock\.opendj\.ldap\.ByteSequence\)]</method>
+    <justification>Renamed getAssertion() to getSubstringAssertion()</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/schema/MatchingRuleImpl</className>
+    <differenceType>7012</differenceType>
+    <method>%regex[org\.forgerock\.opendj\.ldap\.Assertion getSubstringAssertion\(org\.forgerock\.opendj\.ldap\.schema\.Schema, org\.forgerock\.opendj\.ldap\.ByteSequence, java\.util\.List, org\.forgerock\.opendj\.ldap\.ByteSequence\)]</method>
+    <justification>Renamed getAssertion() to getSubstringAssertion()</justification>
+  </difference>
+
+  <difference>
+    <className>org/forgerock/opendj/ldap/schema/SchemaValidationPolicy</className>
+    <differenceType>7006</differenceType>
+    <method>%regex[org\.forgerock\.opendj\.ldap\.schema\.SchemaValidationPolicy\$Policy (checkAttributeValues|checkAttributesAndObjectClasses|checkDITContentRules|checkDITStructureRules|checkNameForms|requireSingleStructuralObjectClass)\(\)]</method>
+    <to>%regex[org\.forgerock\.opendj\.ldap\.schema\.SchemaValidationPolicy\$Action]</to>
+    <justification>Renamed SchemaValidationPolicy.Policy to SchemaValidationPolicy.Action</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/schema/SchemaValidationPolicy</className>
+    <differenceType>7005</differenceType>
+    <method>%regex[org\.forgerock\.opendj\.ldap\.schema\.SchemaValidationPolicy (checkAttributeValues|checkAttributesAndObjectClasses|checkDITContentRules|checkDITStructureRules|checkNameForms|requireSingleStructuralObjectClass)\(org\.forgerock\.opendj\.ldap\.schema\.SchemaValidationPolicy\$Policy(, org\.forgerock\.opendj\.ldap\.schema\.SchemaValidationPolicy\$EntryResolver)?\)]</method>
+    <to>%regex[org\.forgerock\.opendj\.ldap\.schema\.SchemaValidationPolicy (checkAttributeValues|checkAttributesAndObjectClasses|checkDITContentRules|checkDITStructureRules|checkNameForms|requireSingleStructuralObjectClass)\(org\.forgerock\.opendj\.ldap\.schema\.SchemaValidationPolicy\$Action(,\s*org\.forgerock\.opendj\.ldap\.schema\.SchemaValidationPolicy\$EntryResolver)?\)]</to>
+    <justification>Renamed SchemaValidationPolicy.Policy to SchemaValidationPolicy.Action</justification>
+  </difference>
+  <difference>
+    <className>org/forgerock/opendj/ldap/schema/SchemaValidationPolicy$Policy</className>
+    <differenceType>8001</differenceType>
+    <justification>Renamed SchemaValidationPolicy.Policy to SchemaValidationPolicy.Action</justification>
+  </difference>
+</differences>
diff --git a/opendj-sdk/opendj-core/pom.xml b/opendj-sdk/opendj-core/pom.xml
index 1f8fda6..0cea64b 100644
--- a/opendj-sdk/opendj-core/pom.xml
+++ b/opendj-sdk/opendj-core/pom.xml
@@ -21,7 +21,7 @@
   !
   ! CDDL HEADER END
   !
-  !      Copyright 2011-2012 ForgeRock AS
+  !      Copyright 2011-2014 ForgeRock AS
   !    
 -->
 <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/xsd/maven-4.0.0.xsd">
@@ -110,6 +110,76 @@
       </plugin>
     </plugins>
   </build>
+
+  <profiles>
+    <profile>
+      <!-- This profile provides API/ABI compatiblity checks and reports via Clirr -->
+      <id>clirr</id>
+      <activation>
+        <file>
+          <exists>clirr-ignored-api-changes.xml</exists><!-- this file name is duplicated due to MNG-4471 -->
+        </file>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>clirr-maven-plugin</artifactId>
+            <version>${clirrPluginVersion}</version>
+            <inherited>true</inherited>
+            <configuration>
+              <comparisonArtifacts>
+                <comparisonArtifact>
+                  <groupId>${project.groupId}</groupId>
+                  <artifactId>opendj-ldap-sdk</artifactId><!-- former name of this jar -->
+                  <version>2.6.0</version>
+                </comparisonArtifact>
+              </comparisonArtifacts>
+              <excludes>
+                <exclude>com/**</exclude>
+              </excludes>
+              <ignoredDifferencesFile>clirr-ignored-api-changes.xml</ignoredDifferencesFile>
+            </configuration>
+            <executions>
+              <execution>
+                <id>mvn clirr:check</id>
+              </execution>
+              <execution>
+                <id>mvn verify</id>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+      <reporting>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>clirr-maven-plugin</artifactId>
+            <version>${clirrPluginVersion}</version>
+            <inherited>true</inherited>
+            <configuration>
+              <comparisonArtifacts>
+                <comparisonArtifact>
+                  <groupId>${project.groupId}</groupId>
+                  <artifactId>opendj-ldap-sdk</artifactId><!-- former name of this jar -->
+                  <version>2.6.0</version>
+                </comparisonArtifact>
+              </comparisonArtifacts>
+              <excludes>
+                <exclude>com/**</exclude>
+              </excludes>
+              <ignoredDifferencesFile>clirr-ignored-api-changes.xml</ignoredDifferencesFile>
+            </configuration>
+          </plugin>
+        </plugins>
+      </reporting>
+    </profile>
+  </profiles>
+
   <reporting>
     <plugins>
       <plugin>
diff --git a/opendj-sdk/pom.xml b/opendj-sdk/pom.xml
index 06f90fa..9c72522 100644
--- a/opendj-sdk/pom.xml
+++ b/opendj-sdk/pom.xml
@@ -23,12 +23,13 @@
   !
   !      Copyright 2011-2014 ForgeRock AS
   !
---><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/xsd/maven-4.0.0.xsd">
+-->
+<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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.forgerock</groupId>
     <artifactId>forgerock-parent</artifactId>
-    <version>1.2.0</version>
+    <version>1.2.1-SNAPSHOT</version>
   </parent>
   <groupId>org.forgerock.opendj</groupId>
   <artifactId>opendj-project</artifactId>

--
Gitblit v1.10.0