You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ji...@apache.org on 2016/04/25 04:34:26 UTC

[1/2] incubator-geode git commit: GEODE-17: Delete the author tag

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-17-2 adb7208fa -> 7e9d2494d


GEODE-17: Delete the author tag


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/047bf8bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/047bf8bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/047bf8bd

Branch: refs/heads/feature/GEODE-17-2
Commit: 047bf8bdddfc5faf0d61a15c89d1a43da65ecd4c
Parents: adb7208
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Fri Apr 22 15:54:12 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Fri Apr 22 15:54:12 2016 -0700

----------------------------------------------------------------------
 .../gemfire/distributed/internal/ConfigAttribute.java        | 1 -
 .../gemfire/distributed/internal/ConfigAttributeChecker.java | 1 -
 .../gemfire/distributed/internal/ConfigAttributeDesc.java    | 3 ---
 .../gemfire/distributed/internal/ConfigAttributeGetter.java  | 3 ---
 .../gemfire/distributed/internal/ConfigAttributeSetter.java  | 3 ---
 .../com/gemstone/gemfire/internal/ConfigSourceJUnitTest.java | 8 +++-----
 6 files changed, 3 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/047bf8bd/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttribute.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttribute.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttribute.java
index 51712f9..de2573c 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttribute.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttribute.java
@@ -22,7 +22,6 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Created by jiliao on 2/3/16.
  * min and max are used only when type is Integer
  */
 @Target(ElementType.FIELD)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/047bf8bd/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeChecker.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeChecker.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeChecker.java
index 14c1e54..21e130d 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeChecker.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeChecker.java
@@ -22,7 +22,6 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Created by jiliao on 2/3/16.
  */
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.RUNTIME)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/047bf8bd/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeDesc.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeDesc.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeDesc.java
index 57a4a72..bc6f017 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeDesc.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeDesc.java
@@ -21,9 +21,6 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-/**
- * Created by jiliao on 2/3/16.
- */
 @Target(ElementType.FIELD)
 @Retention(RetentionPolicy.RUNTIME)
 public @interface ConfigAttributeDesc {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/047bf8bd/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeGetter.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeGetter.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeGetter.java
index 678ecf0..6e24074 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeGetter.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeGetter.java
@@ -21,9 +21,6 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-/**
- * Created by jiliao on 2/3/16.
- */
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.RUNTIME)
 public @interface ConfigAttributeGetter {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/047bf8bd/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeSetter.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeSetter.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeSetter.java
index ad8ad65..2cec022 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeSetter.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/ConfigAttributeSetter.java
@@ -21,9 +21,6 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-/**
- * Created by jiliao on 2/3/16.
- */
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.RUNTIME)
 public @interface ConfigAttributeSetter {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/047bf8bd/geode-core/src/test/java/com/gemstone/gemfire/internal/ConfigSourceJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/ConfigSourceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/ConfigSourceJUnitTest.java
index 73cd9a0..a6c6435 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/ConfigSourceJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/ConfigSourceJUnitTest.java
@@ -16,15 +16,13 @@
  */
 package com.gemstone.gemfire.internal;
 
+import static org.junit.Assert.*;
+
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-/**
- * Created by jiliao on 2/2/16.
- */
 @Category(UnitTest.class)
 public class ConfigSourceJUnitTest {
   @Test


[2/2] incubator-geode git commit: GEODE-17: fix test failures due to security configuration with no setter specified

Posted by ji...@apache.org.
GEODE-17: fix test failures due to security configuration with no setter specified


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/7e9d2494
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/7e9d2494
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/7e9d2494

Branch: refs/heads/feature/GEODE-17-2
Commit: 7e9d2494dabb9e592fc4d4119bcefcafee3e37ad
Parents: 047bf8b
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Sun Apr 24 19:32:36 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Sun Apr 24 19:32:36 2016 -0700

----------------------------------------------------------------------
 .../internal/AbstractDistributionConfig.java    | 23 +++++++++++++++-----
 .../internal/DistributionConfigJUnitTest.java   | 14 ++++++++++++
 2 files changed, 32 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d2494/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
index e8dafb8..e1881e3 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
@@ -519,6 +519,13 @@ public abstract class AbstractDistributionConfig
       return;
     }
 
+    // special case: log-level and security-log-level attributes are String type, but the setter accepts int
+    if(attName.equalsIgnoreCase(LOG_LEVEL_NAME) || attName.equalsIgnoreCase(SECURITY_LOG_LEVEL_NAME)){
+      if(attValue instanceof String) {
+        attValue = LogWriterImpl.levelNameToCode((String) attValue);
+      }
+    }
+
     if (attName.startsWith(SECURITY_PREFIX_NAME)) {
       this.setSecurity(attName,attValue.toString());
     }
@@ -527,13 +534,19 @@ public abstract class AbstractDistributionConfig
       this.setSSLProperty(attName, attValue.toString());
     }
 
-    // special case: log-level and security-log-level attributes are String type, but the setter accepts int
-    if(attName.equalsIgnoreCase(LOG_LEVEL_NAME) || attName.equalsIgnoreCase(SECURITY_LOG_LEVEL_NAME)){
-      attValue = LogWriterImpl.levelNameToCode((String)attValue);
-    }
-
     Method setter = setters.get(attName);
     if (setter == null) {
+      // if we cann't find the defined setter, look for two more special cases
+      if (attName.startsWith(SECURITY_PREFIX_NAME)) {
+        this.setSecurity(attName,(String)attValue);
+        getAttSourceMap().put(attName, source);
+        return;
+      }
+      if (attName.startsWith(SSL_SYSTEM_PROPS_NAME) || attName.startsWith(SYS_PROP_NAME)) {
+        this.setSSLProperty(attName, (String) attValue);
+        getAttSourceMap().put(attName, source);
+        return;
+      }
       throw new InternalGemFireException(LocalizedStrings.AbstractDistributionConfig_UNHANDLED_ATTRIBUTE_NAME_0.toLocalizedString(attName));
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d2494/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
index 3e7008d..31acc47 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
@@ -330,6 +330,20 @@ public class DistributionConfigJUnitTest {
     assertEquals(config.getSecurityProps().size(), 3);
   }
 
+  @Test
+  public void testSecurityPropsWithNoSetter(){
+    Properties props = new Properties();
+    props.put(DistributionConfig.SECURITY_CLIENT_AUTHENTICATOR_NAME, JSONAuthorization.class.getName() + ".create");
+    props.put(DistributionConfig.SECURITY_CLIENT_ACCESSOR_NAME, JSONAuthorization.class.getName() + ".create");
+    props.put(DistributionConfig.SECURITY_LOG_LEVEL_NAME, "config");
+    // add another non-security property to verify it won't get put in the security properties
+    props.put(DistributionConfig.ACK_WAIT_THRESHOLD_NAME, 2);
+    props.put("security-username", "testName");
+
+    DistributionConfig config = new DistributionConfigImpl(props);
+    assertEquals(config.getSecurityProps().size(), 4);
+  }
+
   public final static Map<Class<?>, Class<?>> classMap = new HashMap<Class<?>, Class<?>>();
 
   static {