Repository: nifi Updated Branches: refs/heads/master beb92492b -> 43b4cb728
NIFI-1376 Fixed checkstyle errors Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/43b4cb72 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/43b4cb72 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/43b4cb72 Branch: refs/heads/master Commit: 43b4cb728a95492009f82f56b00d2039d07b40b9 Parents: 13c6aee Author: Richard Miskin <[email protected]> Authored: Sat Jan 9 22:15:00 2016 +0000 Committer: Mark Payne <[email protected]> Committed: Mon Jan 25 16:32:28 2016 -0500 ---------------------------------------------------------------------- .../org/apache/nifi/util/CapturingLogger.java | 24 ++++++++++++++++---- .../java/org/apache/nifi/util/LogMessage.java | 18 ++++++++++++++- .../org/apache/nifi/util/MockProcessorLog.java | 10 ++++---- .../nifi/util/StandardProcessorTestRunner.java | 7 +++--- .../java/org/apache/nifi/util/TestRunner.java | 4 ++-- 5 files changed, 46 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/43b4cb72/nifi-mock/src/main/java/org/apache/nifi/util/CapturingLogger.java ---------------------------------------------------------------------- diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/CapturingLogger.java b/nifi-mock/src/main/java/org/apache/nifi/util/CapturingLogger.java index f404529..c627f3e 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/CapturingLogger.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/CapturingLogger.java @@ -7,15 +7,31 @@ import java.util.List; import org.slf4j.Logger; import org.slf4j.Marker; +/* + * 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. + */ /** * Implementation of SLF4J logger that records every log message and provides a mechanism - * to retrieve them. + * to retrieve them. * */ public class CapturingLogger implements Logger { private final Logger logger; - + private List<LogMessage> traceMessages = new ArrayList<>(); private List<LogMessage> debugMessages = new ArrayList<>(); private List<LogMessage> infoMessages = new ArrayList<>(); @@ -40,7 +56,7 @@ public class CapturingLogger implements Logger { public List<LogMessage> getErrorMessages() { return Collections.unmodifiableList(errorMessages); } - + @Override public String getName() { return logger.getName(); @@ -191,8 +207,6 @@ public class CapturingLogger implements Logger { logger.debug(marker, msg, t); } - - // INFO @Override public boolean isInfoEnabled() { http://git-wip-us.apache.org/repos/asf/nifi/blob/43b4cb72/nifi-mock/src/main/java/org/apache/nifi/util/LogMessage.java ---------------------------------------------------------------------- diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/LogMessage.java b/nifi-mock/src/main/java/org/apache/nifi/util/LogMessage.java index e12b695..49f800b 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/LogMessage.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/LogMessage.java @@ -1,3 +1,19 @@ +/* + * 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.nifi.util; import org.slf4j.Marker; @@ -13,7 +29,7 @@ public class LogMessage { this.throwable = t; this.args = args; } - + public Marker getMarker() { return marker; } http://git-wip-us.apache.org/repos/asf/nifi/blob/43b4cb72/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorLog.java ---------------------------------------------------------------------- diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorLog.java b/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorLog.java index 0bc587f..ae79647 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorLog.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorLog.java @@ -31,35 +31,35 @@ public class MockProcessorLog implements ProcessorLog { this.logger = new CapturingLogger(LoggerFactory.getLogger(component.getClass())); this.component = component; } - + /** * @return a {@link List} of all TRACE level messages recorded by this {@link Logger}. */ public List<LogMessage> getTraceMessages() { return logger.getTraceMessages(); } - + /** * @return a {@link List} of all DEBUG level messages recorded by this {@link Logger}. */ public List<LogMessage> getDebugMessages() { return logger.getDebugMessages(); } - + /** * @return a {@link List} of all INFO level messages recorded by this {@link Logger}. */ public List<LogMessage> getInfoMessages() { return logger.getInfoMessages(); } - + /** * @return a {@link List} of all WARN level messages recorded by this {@link Logger}. */ public List<LogMessage> getWarnMessages() { return logger.getWarnMessages(); } - + /** * @return a {@link List} of all ERROR level messages recorded by this {@link Logger}. */ http://git-wip-us.apache.org/repos/asf/nifi/blob/43b4cb72/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java ---------------------------------------------------------------------- diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java index 9cb514a..bf5977c 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java @@ -62,7 +62,6 @@ import org.apache.nifi.controller.ControllerService; import org.apache.nifi.controller.queue.QueueSize; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessSessionFactory; import org.apache.nifi.processor.Processor; import org.apache.nifi.processor.Relationship; @@ -771,13 +770,13 @@ public class StandardProcessorTestRunner implements TestRunner { public void clearProvenanceEvents() { sharedState.clearProvenanceEvents(); } - + public MockProcessorLog getLogger() { return logger; } - public MockProcessorLog getControllerServiceLogger(final String identifier) { + public MockProcessorLog getControllerServiceLogger(final String identifier) { return controllerServiceLoggers.get(identifier); } - + } http://git-wip-us.apache.org/repos/asf/nifi/blob/43b4cb72/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java ---------------------------------------------------------------------- diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java index 0bb588c..2a4afd9 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java @@ -824,7 +824,7 @@ public interface TestRunner { * Clears the Provenance Events that have been emitted by the Processor */ void clearProvenanceEvents(); - + /** * Returns the {@link MockProcessorLog} that is used by the Processor under test. * @return the logger @@ -833,7 +833,7 @@ public interface TestRunner { /** * Returns the {@link MockProcessorLog} that is used by the specified controller service. - * + * * @param identifier a controller service identifier * @return the logger */
