You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by kjduling <gi...@git.apache.org> on 2016/09/27 21:18:46 UTC

[GitHub] incubator-geode pull request #247: Feature/geode 1902

GitHub user kjduling opened a pull request:

    https://github.com/apache/incubator-geode/pull/247

    Feature/geode 1902

    Updated pull request after resolving SSL test error.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kjduling/incubator-geode feature/GEODE-1902

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-geode/pull/247.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #247
    
----
commit feba91f2a9f7ab622ff0fc7d313df22d17447217
Author: Kevin Duling <kd...@pivotal.io>
Date:   2016-09-26T23:10:34Z

    GEODE-1902 - Add GEMFIRE_VERBOSE LogMarker as alias of GEODE_VERBOSE for backwards compatibility

commit 0da8d8ffb51115431a270e4d12db6014782f4b95
Author: Kevin Duling <kd...@pivotal.io>
Date:   2016-09-26T23:11:55Z

    Merge branch 'develop' into feature/GEODE-1902

commit d0c5cfdabce4cbe9e36fec9c178a9aa8ec54c55f
Author: Kevin Duling <kd...@pivotal.io>
Date:   2016-09-27T15:38:21Z

    Added missing JUnit Category

commit e8d00ff54419821b4465414629cb90a45deead4c
Author: Kevin Duling <kd...@pivotal.io>
Date:   2016-09-27T21:04:16Z

    Merge branch 'develop' into feature/GEODE-1902

commit 29f21fe8a9741c878289afc621d82154261dc8ea
Author: Kevin Duling <kd...@pivotal.io>
Date:   2016-09-27T21:14:23Z

    Merge branch 'develop' into feature/GEODE-1902

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode pull request #247: Feature/geode 1902

Posted by kirklund <gi...@git.apache.org>.
Github user kirklund commented on a diff in the pull request:

    https://github.com/apache/incubator-geode/pull/247#discussion_r81405863
  
    --- Diff: geode-core/src/test/java/org/apache/geode/internal/logging/log4j/LogMarkerJUnitTest.java ---
    @@ -0,0 +1,118 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.geode.internal.logging.log4j;
    +
    +
    +import static org.apache.geode.internal.logging.log4j.custom.CustomConfiguration.*;
    +import static org.assertj.core.api.Assertions.*;
    +
    +import java.io.File;
    +
    +import org.apache.logging.log4j.Level;
    +import org.apache.logging.log4j.Logger;
    +import org.apache.logging.log4j.core.config.ConfigurationFactory;
    +import org.apache.logging.log4j.status.StatusLogger;
    +import org.junit.After;
    +import org.junit.Before;
    +import org.junit.Rule;
    +import org.junit.Test;
    +import org.junit.contrib.java.lang.system.SystemErrRule;
    +import org.junit.contrib.java.lang.system.SystemOutRule;
    +import org.junit.experimental.categories.Category;
    +import org.junit.rules.TemporaryFolder;
    +
    +import org.apache.geode.internal.logging.LogService;
    +import org.apache.geode.internal.logging.log4j.custom.BasicAppender;
    +import org.apache.geode.test.junit.categories.UnitTest;
    +
    +/**
    + * Integration tests with custom log4j2 configuration.
    + */
    +@Category(UnitTest.class)
    --- End diff --
    
    Please change to IntegrationTest.class since this exercises entire LogService and touches the file system.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode issue #247: Feature/geode 1902

Posted by kjduling <gi...@git.apache.org>.
Github user kjduling commented on the issue:

    https://github.com/apache/incubator-geode/pull/247
  
    Updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode pull request #247: Feature/geode 1902

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-geode/pull/247


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode pull request #247: Feature/geode 1902

Posted by kirklund <gi...@git.apache.org>.
Github user kirklund commented on a diff in the pull request:

    https://github.com/apache/incubator-geode/pull/247#discussion_r81405967
  
    --- Diff: geode-core/src/test/java/org/apache/geode/internal/logging/log4j/LogMarkerJUnitTest.java ---
    @@ -0,0 +1,118 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.geode.internal.logging.log4j;
    +
    +
    +import static org.apache.geode.internal.logging.log4j.custom.CustomConfiguration.*;
    +import static org.assertj.core.api.Assertions.*;
    +
    +import java.io.File;
    +
    +import org.apache.logging.log4j.Level;
    +import org.apache.logging.log4j.Logger;
    +import org.apache.logging.log4j.core.config.ConfigurationFactory;
    +import org.apache.logging.log4j.status.StatusLogger;
    +import org.junit.After;
    +import org.junit.Before;
    +import org.junit.Rule;
    +import org.junit.Test;
    +import org.junit.contrib.java.lang.system.SystemErrRule;
    +import org.junit.contrib.java.lang.system.SystemOutRule;
    +import org.junit.experimental.categories.Category;
    +import org.junit.rules.TemporaryFolder;
    +
    +import org.apache.geode.internal.logging.LogService;
    +import org.apache.geode.internal.logging.log4j.custom.BasicAppender;
    +import org.apache.geode.test.junit.categories.UnitTest;
    +
    +/**
    + * Integration tests with custom log4j2 configuration.
    + */
    +@Category(UnitTest.class)
    +public class LogMarkerJUnitTest {
    +
    +  private String beforeConfigFileProp;
    +  private Level beforeLevel;
    +
    +  private File customConfigFile;
    +
    +  @Rule
    +  public SystemErrRule systemErrRule = new SystemErrRule().enableLog();
    +
    +  @Rule
    +  public SystemOutRule systemOutRule = new SystemOutRule().enableLog();
    +
    +  @Rule
    +  public TemporaryFolder temporaryFolder = new TemporaryFolder();
    +
    +  @Before
    +  public void setUp() throws Exception {
    +    Configurator.shutdown();
    +    BasicAppender.clearInstance();
    +
    +    this.beforeConfigFileProp = System.getProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
    +    this.beforeLevel = StatusLogger.getLogger().getLevel();
    +
    +    this.customConfigFile = createConfigFileIn(this.temporaryFolder.getRoot());
    +
    +    System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, this.customConfigFile.getAbsolutePath());
    +    LogService.reconfigure();
    +    assertThat(LogService.isUsingGemFireDefaultConfig()).as(LogService.getConfigInformation()).isFalse();
    +  }
    +
    +  @After
    +  public void tearDown() throws Exception {
    +    Configurator.shutdown();
    +
    +    System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
    +    if (this.beforeConfigFileProp != null) {
    +      System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, this.beforeConfigFileProp);
    +    }
    +    StatusLogger.getLogger().setLevel(this.beforeLevel);
    +
    +    LogService.reconfigure();
    +    assertThat(LogService.isUsingGemFireDefaultConfig()).as(LogService.getConfigInformation()).isTrue();
    +
    +    BasicAppender.clearInstance();
    +
    +    assertThat(this.systemErrRule.getLog()).isEmpty();
    +  }
    +
    +  /**
    +   * Test to see that log messages for GEODE_VERBOSE are filtered, based on the log4j2-custom.xml configuration file
    +   */
    +  @Test
    +  public void testGeodeFilter()
    +  {
    --- End diff --
    
    Please update, reload /etc/intellijIdeaCodeStyle.xml and reformat.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---