Merge pull request #1 from hthu/master
Remove getClass() call in findAssertionBuilderTarget().
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..f0b5448
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,51 @@
+# 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.
+name: Continuous Integration
+
+on:
+ push:
+ branches: [ '*' ]
+ pull_request:
+ branches: [ '*' ]
+
+env:
+ MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ java: [ 8, 11, 17 ]
+ name: "Java ${{ matrix.java }}"
+ runs-on: ubuntu-18.04
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Cache Maven Repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: maven-java-${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ maven-java-${{ matrix.java }}-
+ maven-
+ - name: Set up Java
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+ - name: Build
+ run: mvn -B -e -Prelease -Dgpg.skip=true verify
+ - name: Remove Snapshots
+ run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf
diff --git a/pom.xml b/pom.xml
index 9b0dce9..14bfaef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -225,6 +225,36 @@
</excludes>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.8.7</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <skip>${skipJacoco}</skip>
+ <includes>
+ <include>org.apache.neethi.*</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.github.veithen.maven</groupId>
+ <artifactId>jacoco-report-maven-plugin</artifactId>
+ <version>0.3.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
@@ -345,7 +375,7 @@
</site>
</distributionManagement>
<properties>
- <axiom.version>1.2.22</axiom.version>
+ <axiom.version>1.3.0</axiom.version>
<neethi.osgi.version>${project.version}</neethi.osgi.version>
<failIfNoTests>false</failIfNoTests>
</properties>
diff --git a/src/main/java/org/apache/neethi/All.java b/src/main/java/org/apache/neethi/All.java
index fae3e01..c29fbd3 100644
--- a/src/main/java/org/apache/neethi/All.java
+++ b/src/main/java/org/apache/neethi/All.java
@@ -46,7 +46,7 @@
}
/**
- * Returns a <tt>List</tt> of it's PolicyComponents.
+ * Returns a {@link List} of it's PolicyComponents.
*
* @return a List of it's PolicyComponents
*/
diff --git a/src/main/java/org/apache/neethi/Policy.java b/src/main/java/org/apache/neethi/Policy.java
index e2104a2..1da0034 100644
--- a/src/main/java/org/apache/neethi/Policy.java
+++ b/src/main/java/org/apache/neethi/Policy.java
@@ -68,8 +68,8 @@
}
/**
- * Returns a Normalized version of self. If <tt>deep</tt> is set
- * <tt>false</tt> then the assertions are not normalized and it returns a
+ * Returns a Normalized version of self. If {@code deep} is set
+ * {@code false} then the assertions are not normalized and it returns a
* partially normalized version of self.
*
* @param deep
@@ -81,8 +81,8 @@
}
/**
- * Returns a normalized version of self.If <tt>deep</tt> is set
- * <tt>false</tt> then the assertions are not normalized and it returns a
+ * Returns a normalized version of self.If {@code deep} is set
+ * {@code false} then the assertions are not normalized and it returns a
* partially normalized version of self.
*
* @param reg
@@ -217,9 +217,9 @@
/**
* Returns an Iterator that will return a list of assertions correspond to a
- * Policy alternative if any. The <tt>iterator.next()</tt> will return a
+ * Policy alternative if any. The {@code iterator.next()} will return a
* list of assertions correspond to a Policy alternative if any and
- * <tt>iterator.hasNext()</tt> will indicates whether there is another
+ * {@code iterator.hasNext()} will indicates whether there is another
* Policy alternative.
*
* @return An iterator over the list of alternatives
@@ -276,7 +276,7 @@
/**
* Returns the value of the attribute specified by the QName. Returns
- * <tt>null</tt> if not present.
+ * {@code null} if not present.
*
* @param name
* the QName of the attribute
@@ -287,7 +287,7 @@
}
/**
- * Returns a <tt>Map</tt> of all attributes of self.
+ * Returns a {@link Map} of all attributes of self.
*
* @return a Map of all attributes of self
*/
@@ -296,7 +296,7 @@
}
/**
- * Sets the <tt>Name</tt> attribute of self.
+ * Sets the {@code Name} attribute of self.
*
* @param name
* the Name attribute of self
@@ -306,7 +306,7 @@
}
/**
- * Returns the <tt>Name</tt> attribute of self.
+ * Returns the {@code Name} attribute of self.
*
* @return the Name attribute of self
*/
diff --git a/src/main/java/org/apache/neethi/PolicyReference.java b/src/main/java/org/apache/neethi/PolicyReference.java
index a2325c2..ea62c93 100644
--- a/src/main/java/org/apache/neethi/PolicyReference.java
+++ b/src/main/java/org/apache/neethi/PolicyReference.java
@@ -89,7 +89,7 @@
/**
* Returns normalized version of the Policy that is referred by self. The specified
- * PolicyRegistry is used to lookup for the Policy that is referred and <tt>deep</tt>
+ * PolicyRegistry is used to lookup for the Policy that is referred and {@code deep}
* indicates the level of normalization for the returning Policy.
*
* @param reg the PolicyRegistry that is used to resolved the Policy referred by self
diff --git a/src/main/java/org/apache/neethi/util/PolicyComparator.java b/src/main/java/org/apache/neethi/util/PolicyComparator.java
index 2eb2eb5..0c173f6 100644
--- a/src/main/java/org/apache/neethi/util/PolicyComparator.java
+++ b/src/main/java/org/apache/neethi/util/PolicyComparator.java
@@ -38,13 +38,13 @@
}
/**
- * Returns <tt>true</tt> if the two policies have the same semantics
+ * Returns {@code true} if the two policies have the same semantics
*
* @param arg1
* a Policy
* @param arg2
* an another Policy
- * @return <tt>true</tt> if both policies have the same semantics
+ * @return {@code true} if both policies have the same semantics
*/
public static boolean compare(Policy arg1, Policy arg2) {
@@ -83,14 +83,14 @@
}
/**
- * Returns <tt>true</tt> if the two PolicyComponents have the same
+ * Returns {@code true} if the two PolicyComponents have the same
* semantics.
*
* @param arg1
* a PolicyComponent
* @param arg2
* an another PolicyComponent
- * @return <tt>true</tt> if both PolicyComponents have the same semantics
+ * @return {@code true} if both PolicyComponents have the same semantics
*/
public static boolean compare(PolicyComponent arg1, PolicyComponent arg2) {
if (!arg1.getClass().equals(arg2.getClass())) {