This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b7e50b  CXF-8148: Address OpenJDK14 build failures. The issues have 
been caused by removal of the deprecated 'java.security.acl' package
6b7e50b is described below

commit 6b7e50b87d74dc6b7d1e830b373c7e30c04e14a2
Author: reta <[email protected]>
AuthorDate: Tue Nov 12 20:13:57 2019 -0500

    CXF-8148: Address OpenJDK14 build failures. The issues have been caused by 
removal of the deprecated 'java.security.acl' package
---
 core/pom.xml                                       | 30 ++++++++++++
 .../security/DefaultSecurityContextTest.java       | 15 ------
 .../security/DeprecatedSecurityContextTest.java    | 53 ++++++++++++++++++++++
 .../interceptor/security/test/GroupWrapper.java    |  0
 4 files changed, 83 insertions(+), 15 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index a31e89f..82da697 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -376,4 +376,34 @@
             </plugins>
         </pluginManagement>
     </build>
+
+    <profiles>
+        <profile>
+            <id>before-jdk14</id>
+            <activation>
+                <jdk>(,14)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>build-helper-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>generate-test-sources</phase>
+                                <goals>
+                                    <goal>add-test-source</goal>
+                                </goals>
+                                <configuration>
+                                    <sources>
+                                        
<source>${project.basedir}/src/test/java8</source>
+                                    </sources>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
diff --git 
a/core/src/test/java/org/apache/cxf/interceptor/security/DefaultSecurityContextTest.java
 
b/core/src/test/java/org/apache/cxf/interceptor/security/DefaultSecurityContextTest.java
index f4faf7d..cec0e6b 100644
--- 
a/core/src/test/java/org/apache/cxf/interceptor/security/DefaultSecurityContextTest.java
+++ 
b/core/src/test/java/org/apache/cxf/interceptor/security/DefaultSecurityContextTest.java
@@ -27,7 +27,6 @@ import javax.security.auth.Subject;
 import org.apache.cxf.common.security.GroupPrincipal;
 import org.apache.cxf.common.security.SimpleGroup;
 import org.apache.cxf.common.security.SimplePrincipal;
-import org.apache.cxf.interceptor.security.test.GroupWrapper;
 import org.apache.cxf.security.LoginSecurityContext;
 
 import org.junit.Test;
@@ -118,18 +117,4 @@ public class DefaultSecurityContextTest {
         assertFalse(context.isUserInRole("family"));
         assertFalse(context.isUserInRole("Barry"));
     }
-    
-    @Test
-    public void testPrivateStaticGroup() {
-        Subject s = new Subject();
-        Principal p = new SimplePrincipal("Barry");
-        s.getPrincipals().add(p);
-        //create a friend group and add Barry to this group
-        GroupWrapper test = new GroupWrapper("friend", "Barry");
-        s.getPrincipals().add(test.getGroup());
-        LoginSecurityContext context = new DefaultSecurityContext(p, s);
-        assertTrue(context.isUserInRole("Barry"));
-    }
-    
-
 }
\ No newline at end of file
diff --git 
a/core/src/test/java8/org/apache/cxf/interceptor/security/DeprecatedSecurityContextTest.java
 
b/core/src/test/java8/org/apache/cxf/interceptor/security/DeprecatedSecurityContextTest.java
new file mode 100644
index 0000000..ead4380
--- /dev/null
+++ 
b/core/src/test/java8/org/apache/cxf/interceptor/security/DeprecatedSecurityContextTest.java
@@ -0,0 +1,53 @@
+package org.apache.cxf.interceptor.security;
+/**
+ * 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.
+ */
+
+
+import java.security.Principal;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+
+import org.apache.cxf.common.security.GroupPrincipal;
+import org.apache.cxf.common.security.SimpleGroup;
+import org.apache.cxf.common.security.SimplePrincipal;
+import org.apache.cxf.interceptor.security.test.GroupWrapper;
+import org.apache.cxf.security.LoginSecurityContext;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+public class DeprecatedSecurityContextTest {
+    @Test
+    public void testPrivateStaticGroup() {
+        Subject s = new Subject();
+        Principal p = new SimplePrincipal("Barry");
+        s.getPrincipals().add(p);
+        //create a friend group and add Barry to this group
+        GroupWrapper test = new GroupWrapper("friend", "Barry");
+        s.getPrincipals().add(test.getGroup());
+        LoginSecurityContext context = new DefaultSecurityContext(p, s);
+        assertTrue(context.isUserInRole("Barry"));
+    }
+}
\ No newline at end of file
diff --git 
a/core/src/test/java/org/apache/cxf/interceptor/security/test/GroupWrapper.java 
b/core/src/test/java8/org/apache/cxf/interceptor/security/test/GroupWrapper.java
similarity index 100%
rename from 
core/src/test/java/org/apache/cxf/interceptor/security/test/GroupWrapper.java
rename to 
core/src/test/java8/org/apache/cxf/interceptor/security/test/GroupWrapper.java

Reply via email to