Commit Graph

959 Commits

Author SHA1 Message Date
John Blum
2440fa68a4 Remove unnecessary testCompile dependency on apache-geode-extensions.
apache-geode-extensions is already an optional compile-time dependency.
2020-02-21 20:17:32 -08:00
John Blum
51e7b0e9f9 Remove assertion on the cache instance asserting whether the cache was an instance of o.a.g.internal.cache.GemFireCacheImpl.
Remove assertion on the Region instance asserting whether the Region was an instance of o.a.g.internal.cache.AbstractRegion.

Resolves gh-70.
2020-02-21 20:17:32 -08:00
John Blum
8e88abfebe Add the org.springframework.geode.util.GeodeAssertions abstract class containing assertions for different Apache Geode objects, such as a cache or Region.
GeodeAssertions will help in the effort to remove all uses of internal Apache Geode APIs and restrict all internal Apache Geode API usage to the apache-geode-extensions module.

Resolves gh-70.
2020-02-21 20:17:32 -08:00
John Blum
796f15e876 Change the GeodeConstants abstract class to an interface. 2020-02-21 20:17:32 -08:00
John Blum
d9a9b7d698 Remove use of the org.apache.geode.distributed.internal.DistributionConfig class to refer to the 'gemfire.' property prefix.
Resolves gh-70.
2020-02-21 19:24:52 -08:00
John Blum
295975e73b Remove use of the org.apache.geode.internal.cache.GemFireCacheImpl class to assert the cache instance is a client.
Resolves gh-70.
2020-02-21 19:22:08 -08:00
John Blum
c434873f58 Remove uses of the org.apache.geode.distributed.internal.DistributionConfig interface to refer to configuration property names.
Resolves gh-70.
2020-02-21 19:19:12 -08:00
John Blum
a08f9bb0e8 Remove use of the org.apache.geode.internal.cache.GemFireCacheImpl class to assert the cache instance is not a client.
Resolves gh-70.
2020-02-21 19:19:12 -08:00
John Blum
d266c1c660 Remove uses of the org.apache.geode.management.internal.security.ResourceConstants class to refer to Security constants and properties.
Resolves gh-70.
2020-02-21 19:14:36 -08:00
John Blum
49d5e65a9f Introduce the org.springframework.geode.util.GeodeConstants class to encapsulate common Apache Geode constants used by SBDG.
The GeodeConstants class will help in the effort to remove all uses of internal Apache Geode APIs, isolating all internal Apache Geode API usage to the apache-geode-extensions module.

Resolves gh-70.
2020-02-21 18:52:27 -08:00
John Blum
b7a0af0df0 Escape the Spring property placeholder syntax used in Spring application properties files. 2020-02-21 15:44:34 -08:00
John Blum
cba67e9a8c Escape the REST API HTTP URL variable syntax. 2020-02-21 15:44:34 -08:00
John Blum
61b2e82396 Fix non-unique anchor. 2020-02-21 15:44:34 -08:00
John Blum
183b8f5486 Close the 'runner' tag.
Annotate the CrmApplication class with @SuppressWarnings('unused').
2020-02-21 15:44:34 -08:00
John Blum
7897f46454 Update Copyright Year in Reference Documentation (Guide) to 2020. 2020-02-20 23:49:08 -08:00
John Blum
fef9ba47be Add documentation on the required dependencies used to run an Apache Geode Manager.
Resolves gh-72.
2020-02-20 23:34:15 -08:00
John Blum
32d0b5339e Edit chapter on Building ClientCache Applications. 2020-02-20 22:53:03 -08:00
John Blum
34389d850c Upgrade to Byte Buddy 1.10.7.
This aligns SBDG's Byte Buddy version with Spring Boot core 2.3.0.M2.
2020-02-20 12:02:21 -08:00
John Blum
8447eaad10 Update Copyright to 2020. 2020-02-19 23:04:23 -08:00
John Blum
92af82654e Upgrade to Gradle 6.2. 2020-02-19 22:57:03 -08:00
John Blum
d5ac5f0c1f Add documentation in the reference guide on the new spring-geode-starter-logging module.
Resolves gh-71.
2020-02-19 22:54:20 -08:00
John Blum
ce295d235f Add method to resolve an Appender from a Logger by name and type.
Add Javadoc to the addAppender(:Logger, :Appender) method.

Refactor addAppender(..) method to lookup the added (registered) Appender from the Logger as verification that the Appender was successfully added.

Re-arrange private utility methods.

Resolves gh-73.
2020-02-19 19:18:08 -08:00
John Blum
f5918498c9 Add CompositeAppender.compose(:Appender[]) and CompositeAppender.compose(:Iterable<Appender>) methods to compose an array or Iterable of Appenders.
Resolves gh-73.
2020-02-19 19:12:18 -08:00
John Blum
7fe4c41fc9 Add StringAppender.Builder.applyTo(:org.slf4j.Logger) method.
Resolves gh-73.
2020-02-19 19:10:32 -08:00
John Blum
76d921f5f0 Add call to reset Logback on test class initialization.
Resolves gh-73.
2020-02-19 19:07:56 -08:00
John Blum
06a1add71b Add utility method to reset the initialized, dirty state of the SLF4J, Logback logging provider/system.
Resolves gh-73.
2020-02-19 19:07:56 -08:00
John Blum
ab03a7c3c1 Change internally created StringBuffer and StringBuilder StringAppenderWrapper implementations used by the StringAppender from Singletons to Prototypes.
Fixes bug in StringAppender that maintained stale Log messages in the buffers of the wrappers between tests.

Resolves gh-73.
2020-02-19 19:07:56 -08:00
John Blum
562dc6c6ed Add additional Smoke Tests asserting Apache Geode logging configuration with the use of Spring Boot application.properties as well as JVM System Properties.
Effectively, these tests test the SBDG GeodeLoggingApplicationListener registration and function.

Resolves gh-73.
2020-02-14 16:57:26 -08:00
John Blum
1969f89492 Add GeodeLoggingApplicationListener registered with Spring Boot to handle backwards compatibility and existing logging configuration expressed with SDG.
User may configure logging using @ClientCacheApplication(logLevel = INFO), or by annotating their Spring application class with @EnableLogging(logLevel = INFO) or using 1 of SDG's logging configuration properties ['spring.data.gemfire.cache.log-level', 'spring.data.gemfire.logging.level'], therefore, SBDG makes a best attempt to honor those logging configuration settings.

Resolves gh-73.
2020-02-14 15:19:14 -08:00
John Blum
007e4db373 Add Function-based converter to convert from SLF4J Loggers to Logback Loggers.
Resolves gh-73.
2020-02-14 15:19:14 -08:00
John Blum
729c02407c Add additional test case asserting that DEBUG Log statements are not logged.
Resolves gh-73.
2020-02-14 15:19:14 -08:00
John Blum
ae616a4774 Switch to using the SpringApplicationBuilder to allow additional Spring profiles to be activated when needed.
Add additional logic to configure printing (output) of the Log messages (content) using System.out when the application is manually run.

Resolves gh-73.
2020-02-14 15:19:14 -08:00
John Blum
ac8d47bec4 Add raw Apache Geode ClientCache application verifying the log-level property has no effect.
Resolves gh-73.
2020-02-13 00:13:38 -08:00
John Blum
348d981b3a Add newlines to separate log events/messages appended to the String.
Resolves gh-73.
2020-02-13 00:11:50 -08:00
John Blum
e4613a1fcc Change 'spring-geode-starter-test' from a testRuntime dependency to testCompile.
Resolves gh-73.
2020-02-12 08:45:54 -08:00
John Blum
4d84136f01 Add LogbackSupport class to invoke the SLF4J and Logback APIs.
Resolves gh-73.
2020-02-12 08:38:57 -08:00
John Blum
5cabe1662d Add StringAppender Logback Appender implementation to capture log messages in-memory appended to a String.
Resolve gh-73.
2020-02-12 08:14:02 -08:00
John Blum
bbe8ff65e0 Add CompositeAppender Logback Appender implementation to compose multiple Appenders as a single Appender.
Resolve gh-73.
2020-02-12 08:14:02 -08:00
John Blum
99cff21c17 Add default name for DelegatingAppender.
Resolves gh-73.
2020-02-11 19:25:04 -08:00
John Blum
21cc8e6c4b Add Smoke Tests for the 'spring-geode-starter-logging' module.
Resolves gh-73.
2020-02-11 19:16:55 -08:00
John Blum
3a347ba365 Add test case asserting the Spring ApplicationContext loads and is of the expected type. 2020-02-10 20:34:47 -08:00
John Blum
a40c66d015 Remove deprecated SDG @EnableLogging annotation from the GeodeConfiguration class.
Edit Javadoc.

Formate source code.

Optimize imports.
2020-02-10 20:30:05 -08:00
John Blum
eaf8bd4930 Add testRuntime dependency on 'spring-geode-starter-test'. 2020-02-10 20:24:26 -08:00
John Blum
a87194cb87 Change IllegalStateException message in AbstractLoggingIntegrationTests.configureLogging() method to properly reflect intent.
Call TestAppender.stop() in addition to clear() in the test tearDown() method.

Resolves gh-73.
2020-02-10 20:23:30 -08:00
John Blum
278ce513c0 Set (as default) root Logger log level to 'INFO'.
Resolves gh-73.
2020-02-10 20:23:25 -08:00
John Blum
0002534140 Add Unit and Integration Tests for the 'spring-geode-starter-logging' module log configuration and logging provider (i.e. SLF4J/Logback) extensions.
Resolves gh-73.
2020-02-10 20:23:19 -08:00
John Blum
85d630c34e Refactor the 'spring-geode-starter-logging' module provided logback.xml file to use templates (includes).
Moved the declared Appenders and Loggers from logback.xml to a new logback-include.xml file making it easier to compose Logback (XML) configuration files using templates, or includes.  This is particularly useful during Integration Testing where logback-test.xml files can be composed with different templates/includes.

Resolves gh-73.
2020-02-10 20:23:13 -08:00
John Blum
269b60bdc6 Provide DelegatingAppender class to allow SLF4J logging provider Appenders to be injected [programmatically] at configuration/runtime.
This is very useful in Integration Tests where the test class needs to assert log statements in infrastructure, system, framework or application code.

Resolves gh-73.
2020-02-10 20:23:07 -08:00
John Blum
0e3ac202a7 Explicitly declare Logback as the logging provider.
Add the 'spring-geode-starter-test' module as a testRuntime dependency in order to write Unit and Integration Tests for this 'spring-geode-starter-logging' module.

Resolves gh-73.
2020-02-10 20:23:02 -08:00
John Blum
c023a22455 Add new 'spring-geode-starter-logging' and 'spring-gemfire-starter-logging' modules.
The new modules enable logging output to be rendered for both Apache Geode & Pivotal GemFire given the right configuration now that the SDG @EnableLogging annotaiton is effectively deprecated since the corresponding GemFire/Geode properties (i.e. gemfire.log-level) no longer have any effect.

Resolves gh-73.
2020-02-10 20:22:56 -08:00