tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: adding user(n, p) and role(u, r) in tomee embedded configuration + faking a doc base if not already existing for tomee embedded
Date Tue, 03 Mar 2015 15:18:47 GMT
Repository: tomee
Updated Branches:
  refs/heads/develop 7d90f0d3c -> 9e407904d


adding user(n,p) and role(u,r) in tomee embedded configuration + faking a doc base if not
already existing for tomee embedded


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/9e407904
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/9e407904
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/9e407904

Branch: refs/heads/develop
Commit: 9e407904d89d1013d475a9ea9e109f92f2982c47
Parents: 7d90f0d
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Tue Mar 3 16:18:35 2015 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Tue Mar 3 16:18:35 2015 +0100

----------------------------------------------------------------------
 .../org/apache/tomee/embedded/Configuration.java   | 17 +++++++++++++++++
 .../java/org/apache/tomee/embedded/Container.java  |  2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/9e407904/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
index e55f1d0..f504b7d 100644
--- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
+++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Configuration.java
@@ -19,6 +19,7 @@ package org.apache.tomee.embedded;
 import org.apache.openejb.util.NetworkUtil;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
@@ -257,4 +258,20 @@ public class Configuration {
     public void setKeepServerXmlAsThis(final boolean keepServerXmlAsThis) {
         this.keepServerXmlAsThis = keepServerXmlAsThis;
     }
+
+    public Configuration user(final String name, final String pwd) {
+        if (users == null) {
+            users = new HashMap<>();
+        }
+        this.users.put(name, pwd);
+        return this;
+    }
+
+    public Configuration role(final String user, final String roles) {
+        if (this.roles == null) {
+            this.roles = new HashMap<>();
+        }
+        this.roles.put(user, roles);
+        return this;
+    }
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/9e407904/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
index 29e62ae..7e148eb 100644
--- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
+++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
@@ -202,7 +202,7 @@ public class Container implements AutoCloseable {
             contextRoot = "/" + context;
         }
 
-        final File jarLocation = docBase == null ? fakeRootDir() : docBase;
+        File jarLocation = docBase == null || !docBase.isDirectory() ? fakeRootDir() : docBase;
         final WebModule webModule = new WebModule(new WebApp(), contextRoot, loader, jarLocation.getAbsolutePath(),
contextRoot.replace("/", ""));
         if (docBase == null) {
             webModule.getProperties().put("fakeJarLocation", "true");


Mime
View raw message