[logback-dev] svn commit: r1422 - in logbackPDE/trunk/plugins: ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views ConsolePluginTest ConsolePluginTest/META-INF ConsolePluginTest/lib ConsolePluginTest/src/ch/qos/logback/eclipse/test
noreply.seb at qos.ch
noreply.seb at qos.ch
Mon Mar 12 16:19:59 CET 2007
Author: seb
Date: Mon Mar 12 16:19:58 2007
New Revision: 1422
Added:
logbackPDE/trunk/plugins/ConsolePluginTest/lib/
logbackPDE/trunk/plugins/ConsolePluginTest/lib/logback-classic-0.9.1-SNAPSHOT.jar (contents, props changed)
logbackPDE/trunk/plugins/ConsolePluginTest/lib/logback-core-0.9.1-SNAPSHOT.jar (contents, props changed)
logbackPDE/trunk/plugins/ConsolePluginTest/lib/slf4j-api-1.3.0.jar (contents, props changed)
logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/SendEventTest.java
Modified:
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java
logbackPDE/trunk/plugins/ConsolePluginTest/META-INF/MANIFEST.MF
logbackPDE/trunk/plugins/ConsolePluginTest/build.properties
logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/AbstractPluginTest.java
logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/LogbackTestSuite.java
Log:
Added test cases
Bug fix
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java Mon Mar 12 16:19:58 2007
@@ -26,6 +26,7 @@
public LoggingEventLabelProvider() {
context = new LoggerContext();
context.setName("Logback Plugin Context");
+ createDefaultPatternLayout();
}
public String getText(Object element) {
Modified: logbackPDE/trunk/plugins/ConsolePluginTest/META-INF/MANIFEST.MF
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePluginTest/META-INF/MANIFEST.MF (original)
+++ logbackPDE/trunk/plugins/ConsolePluginTest/META-INF/MANIFEST.MF Mon Mar 12 16:19:58 2007
@@ -12,3 +12,7 @@
org.eclipse.ui.console,
org.eclipse.jface.text
Eclipse-LazyStart: true
+Bundle-ClassPath: lib/logback-classic-0.9.1-SNAPSHOT.jar,
+ lib/logback-core-0.9.1-SNAPSHOT.jar,
+ lib/slf4j-api-1.3.0.jar,
+ .
Modified: logbackPDE/trunk/plugins/ConsolePluginTest/build.properties
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePluginTest/build.properties (original)
+++ logbackPDE/trunk/plugins/ConsolePluginTest/build.properties Mon Mar 12 16:19:58 2007
@@ -1,4 +1,7 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ lib/logback-classic-0.9.1-SNAPSHOT.jar,\
+ lib/logback-core-0.9.1-SNAPSHOT.jar,\
+ lib/slf4j-api-1.3.0.jar
Added: logbackPDE/trunk/plugins/ConsolePluginTest/lib/logback-classic-0.9.1-SNAPSHOT.jar
==============================================================================
Binary file. No diff available.
Added: logbackPDE/trunk/plugins/ConsolePluginTest/lib/logback-core-0.9.1-SNAPSHOT.jar
==============================================================================
Binary file. No diff available.
Added: logbackPDE/trunk/plugins/ConsolePluginTest/lib/slf4j-api-1.3.0.jar
==============================================================================
Binary file. No diff available.
Modified: logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/AbstractPluginTest.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/AbstractPluginTest.java (original)
+++ logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/AbstractPluginTest.java Mon Mar 12 16:19:58 2007
@@ -4,6 +4,8 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import ch.qos.logback.eclipse.views.LogbackView;
@@ -55,4 +57,14 @@
String consoleText = logbackView.getViewer().getTextWidget().getText();
assertEquals(expectedContent, consoleText);
}
+
+ protected LogbackView getLogbackView() {
+ try {
+ return (LogbackView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .showView(LogbackView.ID);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
}
Modified: logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/LogbackTestSuite.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/LogbackTestSuite.java (original)
+++ logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/LogbackTestSuite.java Mon Mar 12 16:19:58 2007
@@ -8,6 +8,7 @@
public static Test suite() {
TestSuite suite = new TestSuite("Logback test suite");
suite.addTest(new TestSuite(LogbackViewTest.class));
+ suite.addTest(new TestSuite(SendEventTest.class));
return suite;
}
}
Added: logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/SendEventTest.java
==============================================================================
--- (empty file)
+++ logbackPDE/trunk/plugins/ConsolePluginTest/src/ch/qos/logback/eclipse/test/SendEventTest.java Mon Mar 12 16:19:58 2007
@@ -0,0 +1,56 @@
+package ch.qos.logback.eclipse.test;
+
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.net.SocketAppender;
+import ch.qos.logback.eclipse.views.LogbackView;
+
+public class SendEventTest extends AbstractPluginTest {
+
+ LogbackView view;
+ LoggerContext context;
+ Logger rootLogger;
+
+
+ public SendEventTest(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ waitForJobs();
+
+ view = getLogbackView();
+ view.updateServerPort(4560);
+ view.updatePattern("%msg");
+
+ waitForJobs();
+ delay(3000);
+
+ context = new LoggerContext();
+ context.setName("default");
+ context.start();
+ SocketAppender appender = new SocketAppender();
+ appender.setContext(context);
+ appender.setPort(4560);
+ appender.setRemoteHost("localhost");
+ appender.start();
+ rootLogger = context.getLogger(LoggerContext.ROOT_NAME);
+ rootLogger.addAppender(appender);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testSendEvent() throws InterruptedException {
+ rootLogger.debug("testing");
+ waitForJobs();
+ delay(3000);
+ assertLogbackViewContent(view, "testing\n");
+ }
+
+}
More information about the logback-dev
mailing list