You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by Kirk Lund <kl...@apache.org> on 2018/11/16 20:43:06 UTC
Spring detecting MockPluginCommand and logging WARN in integration tests
The new logging tests assert that when you create a Cache, there are no
WARN log statements being logged.
Unfortunately, src/tests (unit tests) is in the classpath of integration
tests (CacheWithCustomLogConfigIntegrationTest is an integration test).
Apparently springshell gets kicked on when we create a cache, it finds
org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
because it's annotated as a springshell Command and then Spring logs this:
[Logger=org.apache.geode Level=WARN Message=(tid=25 msgId=0) Could not load
plugin command: org.springframework.shell.core.CommandMarker: Provider
org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
not found]
My test is NOT logging that, Spring is. So how do we fix this? Should I try
to ignore WARN log statements in my logging tests that involve Spring?
org.apache.geode.internal.logging.log4j.CacheWithCustomLogConfigIntegrationTest
> cacheLogWriterInfoMessageIsSuppressed FAILED
java.lang.AssertionError:
Expecting empty but was:<[Logger=org.apache.geode Level=WARN
Message=(tid=25 msgId=0) Could not load plugin command:
org.springframework.shell.core.CommandMarker: Provider
org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
not found]>
at
org.apache.geode.internal.logging.log4j.CacheWithCustomLogConfigIntegrationTest.cacheLogWriterInfoMessageIsSuppressed(CacheWithCustomLogConfigIntegrationTest.java:134)
Re: Spring detecting MockPluginCommand and logging WARN in
integration tests
Posted by Kirk Lund <kl...@apache.org>.
Yep! I have a fixed version now that will not fail due to springshell.
On Fri, Nov 16, 2018 at 1:07 PM Jens Deppe <jd...@pivotal.io> wrote:
> If this test is already applying a custom log configuration, could it not
> also turn down the logging for org.springframework.shell?
>
> --Jens
>
> On Fri, Nov 16, 2018 at 12:53 PM Kirk Lund <kl...@apache.org> wrote:
>
> > I checked the DUnit grep for suspect strings and it's ignore WARNING log
> > level. So we may DUnit tests that are generating the same warning log
> from
> > org.springframework.shell.core.CommandMarker without causing any tests to
> > fail.
> >
> > On Fri, Nov 16, 2018 at 12:43 PM Kirk Lund <kl...@apache.org> wrote:
> >
> > > The new logging tests assert that when you create a Cache, there are no
> > > WARN log statements being logged.
> > >
> > > Unfortunately, src/tests (unit tests) is in the classpath of
> integration
> > > tests (CacheWithCustomLogConfigIntegrationTest is an integration test).
> > > Apparently springshell gets kicked on when we create a cache, it finds
> > >
> >
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> > > because it's annotated as a springshell Command and then Spring logs
> > this:
> > >
> > > [Logger=org.apache.geode Level=WARN Message=(tid=25 msgId=0) Could not
> > > load plugin command: org.springframework.shell.core.CommandMarker:
> > Provider
> > >
> >
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> > > not found]
> > >
> > > My test is NOT logging that, Spring is. So how do we fix this? Should I
> > > try to ignore WARN log statements in my logging tests that involve
> > Spring?
> > >
> > >
> >
> org.apache.geode.internal.logging.log4j.CacheWithCustomLogConfigIntegrationTest
> > > > cacheLogWriterInfoMessageIsSuppressed FAILED
> > > java.lang.AssertionError:
> > > Expecting empty but was:<[Logger=org.apache.geode Level=WARN
> > > Message=(tid=25 msgId=0) Could not load plugin command:
> > > org.springframework.shell.core.CommandMarker: Provider
> > >
> >
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> > > not found]>
> > > at
> > >
> >
> org.apache.geode.internal.logging.log4j.CacheWithCustomLogConfigIntegrationTest.cacheLogWriterInfoMessageIsSuppressed(CacheWithCustomLogConfigIntegrationTest.java:134)
> > >
> >
>
Re: Spring detecting MockPluginCommand and logging WARN in
integration tests
Posted by Jens Deppe <jd...@pivotal.io>.
If this test is already applying a custom log configuration, could it not
also turn down the logging for org.springframework.shell?
--Jens
On Fri, Nov 16, 2018 at 12:53 PM Kirk Lund <kl...@apache.org> wrote:
> I checked the DUnit grep for suspect strings and it's ignore WARNING log
> level. So we may DUnit tests that are generating the same warning log from
> org.springframework.shell.core.CommandMarker without causing any tests to
> fail.
>
> On Fri, Nov 16, 2018 at 12:43 PM Kirk Lund <kl...@apache.org> wrote:
>
> > The new logging tests assert that when you create a Cache, there are no
> > WARN log statements being logged.
> >
> > Unfortunately, src/tests (unit tests) is in the classpath of integration
> > tests (CacheWithCustomLogConfigIntegrationTest is an integration test).
> > Apparently springshell gets kicked on when we create a cache, it finds
> >
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> > because it's annotated as a springshell Command and then Spring logs
> this:
> >
> > [Logger=org.apache.geode Level=WARN Message=(tid=25 msgId=0) Could not
> > load plugin command: org.springframework.shell.core.CommandMarker:
> Provider
> >
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> > not found]
> >
> > My test is NOT logging that, Spring is. So how do we fix this? Should I
> > try to ignore WARN log statements in my logging tests that involve
> Spring?
> >
> >
> org.apache.geode.internal.logging.log4j.CacheWithCustomLogConfigIntegrationTest
> > > cacheLogWriterInfoMessageIsSuppressed FAILED
> > java.lang.AssertionError:
> > Expecting empty but was:<[Logger=org.apache.geode Level=WARN
> > Message=(tid=25 msgId=0) Could not load plugin command:
> > org.springframework.shell.core.CommandMarker: Provider
> >
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> > not found]>
> > at
> >
> org.apache.geode.internal.logging.log4j.CacheWithCustomLogConfigIntegrationTest.cacheLogWriterInfoMessageIsSuppressed(CacheWithCustomLogConfigIntegrationTest.java:134)
> >
>
Re: Spring detecting MockPluginCommand and logging WARN in
integration tests
Posted by Kirk Lund <kl...@apache.org>.
I checked the DUnit grep for suspect strings and it's ignore WARNING log
level. So we may DUnit tests that are generating the same warning log from
org.springframework.shell.core.CommandMarker without causing any tests to
fail.
On Fri, Nov 16, 2018 at 12:43 PM Kirk Lund <kl...@apache.org> wrote:
> The new logging tests assert that when you create a Cache, there are no
> WARN log statements being logged.
>
> Unfortunately, src/tests (unit tests) is in the classpath of integration
> tests (CacheWithCustomLogConfigIntegrationTest is an integration test).
> Apparently springshell gets kicked on when we create a cache, it finds
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> because it's annotated as a springshell Command and then Spring logs this:
>
> [Logger=org.apache.geode Level=WARN Message=(tid=25 msgId=0) Could not
> load plugin command: org.springframework.shell.core.CommandMarker: Provider
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> not found]
>
> My test is NOT logging that, Spring is. So how do we fix this? Should I
> try to ignore WARN log statements in my logging tests that involve Spring?
>
> org.apache.geode.internal.logging.log4j.CacheWithCustomLogConfigIntegrationTest
> > cacheLogWriterInfoMessageIsSuppressed FAILED
> java.lang.AssertionError:
> Expecting empty but was:<[Logger=org.apache.geode Level=WARN
> Message=(tid=25 msgId=0) Could not load plugin command:
> org.springframework.shell.core.CommandMarker: Provider
> org.apache.geode.management.internal.cli.CommandManagerJUnitTest$MockPluginCommand
> not found]>
> at
> org.apache.geode.internal.logging.log4j.CacheWithCustomLogConfigIntegrationTest.cacheLogWriterInfoMessageIsSuppressed(CacheWithCustomLogConfigIntegrationTest.java:134)
>