Skip to content

Commit

Permalink
Remove uses of the org.apache.geode.distributed.internal.Distribution…
Browse files Browse the repository at this point in the history
…Config interface to refer to configuration property names.

Resolves spring-projectsgh-70.
  • Loading branch information
jxblum committed Feb 22, 2020
1 parent a08f9bb commit c434873
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,27 @@
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package org.springframework.geode.util;

import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.management.internal.security.ResourceConstants;

/**
* The GeodeConstants class...
* Abstract utility class encapsulating common Apache Geode constants used by SBDG.
*
* @author John Blum
* @since 1.0.0
* @since 1.3.0
*/
public abstract class GeodeConstants {

public static final String USERNAME = ResourceConstants.USER_NAME;
// Logging Constants (referring to Properties)
public static final String LOG_DISK_SPACE_LIMIT = DistributionConfig.LOG_DISK_SPACE_LIMIT_NAME;
public static final String LOG_FILE = DistributionConfig.LOG_FILE_NAME;
public static final String LOG_FILE_SIZE_LIMIT = DistributionConfig.LOG_FILE_SIZE_LIMIT_NAME;
public static final String LOG_LEVEL = DistributionConfig.LOG_LEVEL_NAME;

// Security Constants (referring to Properties)
public static final String PASSWORD = ResourceConstants.PASSWORD;
public static final String USERNAME = ResourceConstants.USER_NAME;

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import org.junit.runner.RunWith;

import org.apache.geode.cache.GemFireCache;
import org.apache.geode.distributed.internal.DistributionConfig;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
import org.springframework.geode.util.GeodeConstants;
import org.springframework.test.context.junit4.SpringRunner;

/**
Expand Down Expand Up @@ -72,10 +72,10 @@ public void loggingConfigurationWasApplied() {

Properties distributedSystemProperties = this.gemfireCache.getDistributedSystem().getProperties();

assertThat(distributedSystemProperties.getProperty(DistributionConfig.LOG_DISK_SPACE_LIMIT_NAME)).isEqualTo("4096");
assertThat(distributedSystemProperties.getProperty(DistributionConfig.LOG_FILE_NAME)).isEqualTo("/path/to/gemfire.log");
assertThat(distributedSystemProperties.getProperty(DistributionConfig.LOG_FILE_SIZE_LIMIT_NAME)).isEqualTo("512");
assertThat(distributedSystemProperties.getProperty(DistributionConfig.LOG_LEVEL_NAME)).isEqualTo("fine");
assertThat(distributedSystemProperties.getProperty(GeodeConstants.LOG_DISK_SPACE_LIMIT)).isEqualTo("4096");
assertThat(distributedSystemProperties.getProperty(GeodeConstants.LOG_FILE)).isEqualTo("/path/to/gemfire.log");
assertThat(distributedSystemProperties.getProperty(GeodeConstants.LOG_FILE_SIZE_LIMIT)).isEqualTo("512");
assertThat(distributedSystemProperties.getProperty(GeodeConstants.LOG_LEVEL)).isEqualTo("fine");
}

@SpringBootApplication
Expand Down

0 comments on commit c434873

Please sign in to comment.