Remove uses of the org.apache.geode.distributed.internal.DistributionConfig interface to refer to configuration property names.

Resolves gh-70.
This commit is contained in:
John Blum
2020-02-21 19:11:19 -08:00
parent a08f9bb0e8
commit c434873f58
2 changed files with 16 additions and 9 deletions

View File

@@ -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;
}

View File

@@ -23,13 +23,13 @@ import org.junit.Test;
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;
/**
@@ -72,10 +72,10 @@ public class LoggingAutoConfigurationIntegrationTests extends IntegrationTestsSu
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