summaryrefslogtreecommitdiffstats
path: root/auth
diff options
context:
space:
mode:
authorInstrumental <jcgmisc@stl.gathman.org>2018-04-13 20:04:09 -0500
committerInstrumental <jcgmisc@stl.gathman.org>2018-04-13 20:04:17 -0500
commitccd363f92f74fe7c4fdadb2d4e8dea77a1e44718 (patch)
tree0a16481b0f9f4e0eb1d770266a45427a488c4c10 /auth
parente42027821142e47c1e52f0f314f7c915446b76c6 (diff)
Update Default Org issue
Issue-ID: AAF-247 Change-Id: Iffe755ac94225be943d3fe003ebcad95d0038052 Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth')
-rw-r--r--auth/.gitignore1
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java10
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java7
-rw-r--r--auth/auth-core/src/test/java/org/onap/aaf/auth/env/test/JU_AuthzTransImpl.java2
-rw-r--r--auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java2
5 files changed, 11 insertions, 11 deletions
diff --git a/auth/.gitignore b/auth/.gitignore
index 3ff6f78c..5833316a 100644
--- a/auth/.gitignore
+++ b/auth/.gitignore
@@ -3,3 +3,4 @@
/target/
/aaf_*
/deploy.gz
+/createLocalDeploy.sh
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java
index cbb3603e..4cf2dd5d 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java
@@ -132,12 +132,8 @@ public class TextIndex {
TimeTaken tt2 = trans.start("Open Files", Env.SUB);
try {
raf = new RandomAccessFile(file,"rw");
- try {
- raf.setLength(0L);
- fos = raf.getChannel();
- } finally {
- raf.close();
- }
+ raf.setLength(0L);
+ fos = raf.getChannel();
} finally {
tt2.done();
}
@@ -187,7 +183,7 @@ public class TextIndex {
}
} finally {
fos.close();
- raf.close();
+ raf.close(); // closed by fos
}
}
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
index d12345a9..843e2682 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
@@ -75,6 +75,8 @@ public class OrganizationFactory {
}
Organization org = orgs.get(orgNS);
if(org == null) {
+ env.debug().printf("Attempting to instantiate Organization %s\n",orgNS);
+
String orgClass = env.getProperty(ORGANIZATION_DOT+orgNS);
if(orgClass == null) {
env.warn().log("There is no Organization." + orgNS + " property");
@@ -104,10 +106,11 @@ public class OrganizationFactory {
}
}
orgs.put(orgNS, org);
- if("true".equalsIgnoreCase(env.getProperty(orgNS+".default"))) {
+ boolean isDefault;
+ if((isDefault="true".equalsIgnoreCase(env.getProperty(orgNS+".default")))) {
defaultOrg = org;
}
-
+ env.init().printf("Instantiated %s with %s%s\n",orgNS,orgClass,(isDefault?" as default":""));
}
if(org==null) {
if(defaultOrg!=null) {
diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/env/test/JU_AuthzTransImpl.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/env/test/JU_AuthzTransImpl.java
index c646e52e..317fb94a 100644
--- a/auth/auth-core/src/test/java/org/onap/aaf/auth/env/test/JU_AuthzTransImpl.java
+++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/env/test/JU_AuthzTransImpl.java
@@ -161,7 +161,7 @@ public class JU_AuthzTransImpl {
@Test
public void testNow() {
- Date date = new Date();
+ Date date = authzTransImpl.now();
Assert.assertEquals(date,authzTransImpl.now());
when(authzTransImpl.now()).thenReturn(null);
}
diff --git a/auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java b/auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java
index 9fc983e2..5674e247 100644
--- a/auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java
+++ b/auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java
@@ -84,7 +84,7 @@ public class DefaultOrg implements Organization {
if(temp==null) {
temp = env.getProperty(AAF_DATA_DIR);
if(temp!=null) {
- env.warn().log(defFile, "is not defined. Using default: ",temp+"/identities.dat");
+ env.warn().log(defFile, " is not defined. Using default: ",temp+"/identities.dat");
File dir = new File(temp);
fIdentities=new File(dir,"identities.dat");
if(!fIdentities.exists()) {