@@ -0,0 +1,2464 @@
+/*%0A * Copyright 2012-2014 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.springframework.cloud.netflix.eureka.server;%0A%0Aimport static org.hamcrest.Matchers.equalTo;%0Aimport static org.junit.Assert.assertThat;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.log4j.Logger;%0Aimport org.junit.Before;%0Aimport org.junit.Ignore;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.springframework.boot.logging.LogLevel;%0Aimport org.springframework.boot.logging.log4j.Log4JLoggingSystem;%0Aimport org.springframework.boot.test.OutputCapture;%0Aimport org.springframework.core.io.ClassPathResource;%0Aimport org.springframework.util.ClassUtils;%0Aimport org.springframework.util.StringUtils;%0A%0Aimport com.netflix.blitz4j.LoggingConfiguration;%0A%0A/**%0A * Tests for %7B@link Log4JLoggingSystem%7D.%0A *%0A * @author Phillip Webb%0A */%0Apublic class Log4JLoggingSystemTests %7B%0A%0A%09@Rule%0A%09public OutputCapture output = new OutputCapture();%0A%0A%09private final Log4JLoggingSystem loggingSystem = new Log4JLoggingSystem(getClass()%0A%09%09%09.getClassLoader());%0A%0A%09private Logger logger;%0A%0A%09@Before%0A%09public void setup() %7B%0A%09%09System.setProperty(%22log4j.configuration%22, getPackagedConfigFile(%22log4j.properties%22));%0A%09%09logger = Logger.getLogger(getClass());%0A%09%09LoggingConfiguration.getInstance().configure();%0A%09%7D%0A%0A%09@Test%0A%09@Ignore(%22gh-48%22)%0A%09public void setLevel() throws Exception %7B%0A%09%09this.loggingSystem.beforeInitialize();%0A%09%09this.loggingSystem.initialize(null, null);%0A%09%09this.logger.debug(%22Hello%22);%0A%09%09this.loggingSystem.setLogLevel(%22org.springframework.cloud%22, LogLevel.DEBUG);%0A%09%09this.logger.debug(%22Hello%22);%0A%09%09assertThat(StringUtils.countOccurrencesOf(this.output.toString(), %22Hello%22),%0A%09%09%09%09equalTo(1));%0A%09%7D%0A%0A%0A%09private final String getPackagedConfigFile(String fileName) %7B%0A%09%09try %7B%0A%09%09%09return new ClassPathResource(fileName, Log4JLoggingSystem.class).getURL().toString();%0A%09%09%7D%0A%09%09catch (IOException e) %7B%0A%09%09%09throw new IllegalStateException(%22Cannot create URL%22, e);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add ignored test to show that blitz4j is not responding