Split the lttng-tools wrapper in a separate artifact
[lttng-ust-java-tests.git] / lttng-ust-java-tests / src / test / java / org / lttng / ust / agent / integration / log4j / Log4jTestUtils.java
diff --git a/lttng-ust-java-tests/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jTestUtils.java b/lttng-ust-java-tests/src/test/java/org/lttng/ust/agent/integration/log4j/Log4jTestUtils.java
new file mode 100644 (file)
index 0000000..c69f7bc
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2015, EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.integration.log4j;
+
+import java.io.IOException;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+/**
+ * Utility methods for log4j tests
+ */
+final class Log4jTestUtils {
+
+    private Log4jTestUtils() {
+    }
+
+    static void send10Events(Logger logger) {
+        // Levels/priorities are DEBUG, ERROR, FATAL, INFO, TRACE, WARN
+        logger.debug("Debug message. Lost among so many.");
+        logger.debug("Debug message with a throwable", new IOException());
+        logger.error("Error messsage. This might be bad.");
+        logger.error("Error message with a throwable", new IOException());
+        logger.fatal("A fatal message. You are already dead.");
+        logger.info("A info message. Lol, who cares.");
+        logger.trace("A trace message. No, no *that* trace");
+        logger.warn("A warn message. Yellow underline.");
+        logger.log(Level.DEBUG, "A debug message using .log()");
+        logger.log(Level.ERROR, "A error message using .log()");
+    }
+}
This page took 0.023283 seconds and 4 git commands to generate.