You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2019/05/29 10:35:42 UTC

[tomee] 07/07: Fix test after backport

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

jgallimore pushed a commit to branch tomee-1.7.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 527f842bb418376b5ea5ae51679ed89576d4e8f0
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Wed May 29 11:26:51 2019 +0100

    Fix test after backport
---
 .../core/security/BasicJaccProviderTest.java       | 23 +++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java b/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
index 451c105..bf9e491 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
@@ -17,8 +17,9 @@
 package org.apache.openejb.core.security;
 
 import org.apache.openejb.junit.ApplicationComposer;
-import org.apache.openejb.testing.Classes;
-import org.apache.openejb.testing.ContainerProperties;
+import org.apache.openejb.testing.Configuration;
+import org.apache.openejb.testing.Module;
+import org.apache.openejb.testng.PropertiesBuilder;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -26,19 +27,27 @@ import org.junit.runner.RunWith;
 import javax.ejb.EJB;
 import javax.ejb.Singleton;
 import java.security.Policy;
+import java.util.Properties;
 
 
-@Classes(innerClassesAsBean = true)
 @RunWith(ApplicationComposer.class)
-@ContainerProperties(
-        @ContainerProperties.Property(
-                name = "javax.security.jacc.policy.provider",
-                value = "org.apache.openejb.core.security.BasicJaccProviderTest$MyPolicy"))
 public class BasicJaccProviderTest {
 
     @EJB
     private SimpleSingleton myBean;
 
+    @Module
+    public Class<?>[] beans() {
+        return new Class<?>[]{SimpleSingleton.class};
+    }
+
+    @Configuration
+    public Properties config() {
+        return new PropertiesBuilder()
+            .p("javax.security.jacc.policy.provider", "org.apache.openejb.core.security.BasicJaccProviderTest$MyPolicy")
+            .build();
+    }
+
     @Test
     public void run() throws Exception {
         Assert.assertNotNull("Singleton bean could not be created", myBean);