[logback-dev] svn commit: r2362 - logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi

noreply.ceki at qos.ch noreply.ceki at qos.ch
Wed Jul 22 10:12:25 CEST 2009


Author: ceki
Date: Wed Jul 22 10:12:24 2009
New Revision: 2362

Added:
   logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/PackagingDataCalculatorTest.java
      - copied, changed from r2357, /logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/BasicCPDCTest.java
Modified:
   logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/PackageTest.java

Log:
- renamed BasicCPDCTest as PackagingDataCalculatorTest
- added a new test case (which does not yet compile)

Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/PackageTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/PackageTest.java	(original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/PackageTest.java	Wed Jul 22 10:12:24 2009
@@ -17,6 +17,6 @@
 @SuiteClasses( { ContextListenerTest.class, CallerDataTest.class,
     LoggerComparatorTest.class, LoggingEventSerializationTest.class,
     LoggingEventSerializationPerfTest.class, ThrowableProxyTest.class,
-    BasicCPDCTest.class })
+    PackagingDataCalculatorTest.class })
 public class PackageTest  {
 }
\ No newline at end of file

Copied: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/PackagingDataCalculatorTest.java (from r2357, /logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/BasicCPDCTest.java)
==============================================================================
--- /logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/BasicCPDCTest.java	(original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/spi/PackagingDataCalculatorTest.java	Wed Jul 22 10:12:24 2009
@@ -1,24 +1,24 @@
+/**
+ * Logback: the generic, reliable, fast and flexible logging framework.
+ * 
+ * Copyright (C) 2000-2009, QOS.ch
+ * 
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+
 package ch.qos.logback.classic.spi;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 
 import ch.qos.logback.classic.util.TeztHelper;
 import ch.qos.logback.core.util.SystemInfo;
 
-public class BasicCPDCTest {
-
-  @Before
-  public void setUp() throws Exception {
-  }
-
-  @After
-  public void tearDown() throws Exception {
-  }
+public class PackagingDataCalculatorTest {
 
   public void verify(ThrowableProxy tp) {
     for (StackTraceElementProxy step : tp.getStackTraceElementProxyArray()) {
@@ -29,16 +29,6 @@
   }
 
   @Test
-  public void otherJD() {
-    System.out.println(SystemInfo.getJavaVendor());
-  }
-
-  @Test
-  public void integration() throws Exception {
-
-  }
-
-  @Test
   public void smoke() throws Exception {
     Throwable t = new Throwable("x");
     ThrowableProxy tp = new ThrowableProxy(t);
@@ -101,4 +91,27 @@
         + (d0 * slackFactor), d0 * slackFactor > d1);
 
   }
+
+  @Test
+  // Test http://jira.qos.ch/browse/LBCLASSIC-125
+  public void noClassDefFoundError() {
+    Throwable t = new Throwable("x");
+    ThrowableProxy tp = new ThrowableProxy(t);
+    StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
+    StackTraceElement bogusSTE = new StackTraceElement(MyBogus.class.getName(),
+        "myMethod", "myFile", 12);
+    StackTraceElementProxy bogusSTEP;// = new StackTraceElementProxy(bogusSTE);
+    System.out.println(stepArray.length);
+    for (int i = 0; i < stepArray.length; i++) {
+      System.out.println(i);
+      
+      stepArray[i] = new StackTraceElementProxy(bogusSTE);
+    }
+    PackagingDataCalculator pdc = tp.getPackagingDataCalculator();
+    pdc.calculate(tp);
+    System.out.println(ThrowableProxyUtil.asString(tp));
+    
+    System.out.println(new MyBogus());
+    
+  }
 }


More information about the logback-dev mailing list