Review Request 52306: GEODE-1769: add the ignored exception

2016-09-27 Thread Jinmei Liao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52306/
---

Review request for geode.


Repository: geode


Description
---

GEODE-1769: add the ignored exception


Diffs
-

  
geode-core/src/test/java/org/apache/geode/security/IntegratedClientRegisterInterestAuthDistributedTest.java
 f897b5e27cc63d22295df6b7f7596c9265929e75 

Diff: https://reviews.apache.org/r/52306/diff/


Testing
---

the affected test


Thanks,

Jinmei Liao



Re: Review Request 52269: GEODE-1659: put security properties in the cluster config and applied to all the members in the cluster.

2016-09-27 Thread Jinmei Liao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52269/
---

(Updated Sept. 27, 2016, 5:25 p.m.)


Review request for geode, Jared Stewart, Kevin Duling, and Kirk Lund.


Repository: geode


Description (updated)
---

GEODE-1659: put security properties in the cluster config and applied to all 
the members in the cluster.

When joining a secured server, the server's security-manager and 
security-post-processor should match whatever the cluster config is. 
Also prevent a member not using cluster configuration from joining a secured 
cluster.

broke down requestAndApplySharedConfiguration into individual steps so that we 
can apply properties and cache.xml in different phases of cache initialization


Diffs (updated)
-

  
geode-core/src/main/java/org/apache/geode/distributed/internal/SharedConfiguration.java
 2e6677f3dff5bc9a811185e9844b22e4ed925971 
  
geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
 5281e117d2ab4c67eb0db13490e6c21aff74f5c5 
  
geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java 
93a9c3b1686a82d8c7814fbda47650d4a26ebbd2 
  geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java 
d341f51f493dc4e0391be26b15d64d7568c35fcb 
  
geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
 c42d1a259e21a02a4aee0dc3fd4c1a51779b79e3 
  
geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
 597a977ccaab900fe38a4042b996daedaef99456 
  
geode-core/src/test/java/org/apache/geode/security/PDXGfshPostProcessorOnRemoteServerTest.java
 34043e8c894ae7a209b666841254e620cdd2b158 
  
geode-core/src/test/java/org/apache/geode/security/SecurityClusterConfigDUnitTest.java
 PRE-CREATION 
  
geode-core/src/test/java/org/apache/geode/security/SecurityWithoutClusterConfigDUnitTest.java
 PRE-CREATION 
  
geode-core/src/test/java/org/apache/geode/security/StartServerAuthorizationTest.java
 8468664446a3953bf5dfb056621bfcbdd0c8daa4 

Diff: https://reviews.apache.org/r/52269/diff/


Testing
---

precheckin running


Thanks,

Jinmei Liao



Re: Review Request 52306: GEODE-1769: add the ignored exception

2016-09-27 Thread Jinmei Liao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52306/
---

(Updated Sept. 27, 2016, 6:13 p.m.)


Review request for geode, Jared Stewart, Kevin Duling, and Kirk Lund.


Repository: geode


Description
---

GEODE-1769: add the ignored exception


Diffs (updated)
-

  
geode-core/src/test/java/org/apache/geode/security/AbstractSecureServerDUnitTest.java
 23b851a3c0c6c8556ca3a0d0cb65e5583c2c38d5 
  
geode-core/src/test/java/org/apache/geode/security/IntegratedClientRegisterInterestAuthDistributedTest.java
 f897b5e27cc63d22295df6b7f7596c9265929e75 

Diff: https://reviews.apache.org/r/52306/diff/


Testing
---

the affected test


Thanks,

Jinmei Liao



JUnit best practices #1

2016-09-27 Thread Kirk Lund
Some of the very basic best practices for JUnit:

1) never catch an unexpected exception

Yes:
public void myTest() throws Exception {
  doSomething();
  validation();
}

No:
public void myTest() {
  try {
doSomething();
validation();
  } catch (Exception e) {
fail(e.getMessage());
  }
}

Why: because the 2nd example makes the test harder to read and it also
disguises the stack trace if it fails. JUnit framework handles this 100%
better than "fail(e.getMessage())".

Please don't use this testing antipattern.

[1] http://www.exubero.com/junit/antipatterns.html
[2] http://junit.org/junit4/faq.html#atests_8

-Kirk


JUnit best practices #2

2016-09-27 Thread Kirk Lund
We are using Categories to aid in separating UnitTests, IntegrationTests,
etc.

A UnitTest is:

/**
 * JUnit Test Category that specifies a test with very narrow and well
defined
 * scope. Any complex dependencies and interactions are stubbed or mocked.
 *
 * A {@code UnitTest} should not do any of the following:
 * communicate with a database
 * communicate across the network
 * access the file system
 * prevent the running of other unit tests in parallel
 * require anything special in the environment (such as editing config
files or running an external process)
 * 
 *
 * @see http://www.artima.com/weblogs/viewpost.jsp?thread=126923;>A
Set of Unit Testing Rules by Michael Feathers
 */

An IntegrationTest is:

/**
 * JUnit Test Category that specifies a test involving inter-operation of
 * components or subsystems.
 */

[1] http://www.artima.com/weblogs/viewpost.jsp?thread=126923

-Kirk