cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r888725 - in /cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon: profiling/ProfilingIntegrationTest.java sitemap/SitemapBuilderTest.java
Date Wed, 09 Dec 2009 08:14:25 GMT
Author: reinhard
Date: Wed Dec  9 08:14:24 2009
New Revision: 888725

URL: http://svn.apache.org/viewvc?rev=888725&view=rev
Log:
Fix ProfilingIntegrationTest which doesn't need the CallStack anymore
@AfterClass method that closes the appcontext (ProfilingIntegrationTest)

Modified:
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java?rev=888725&r1=888724&r2=888725&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
Wed Dec  9 08:14:24 2009
@@ -22,7 +22,6 @@
 
 import java.io.ByteArrayOutputStream;
 import java.net.URL;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,19 +34,16 @@
 import org.apache.cocoon.profiling.profiler.PipelineComponentProfiler;
 import org.apache.cocoon.sax.component.XMLSerializer;
 import org.apache.cocoon.servlet.util.HttpContextHelper;
-import org.apache.cocoon.servletservice.CallStackHelper;
 import org.apache.cocoon.sitemap.ComponentProvider;
 import org.apache.cocoon.sitemap.Invocation;
 import org.apache.cocoon.sitemap.InvocationImpl;
-import org.apache.cocoon.sitemap.MockServletContext;
 import org.apache.cocoon.sitemap.SitemapBuilder;
 import org.apache.cocoon.sitemap.node.SitemapNode;
 import org.apache.cocoon.sitemap.objectmodel.ObjectModel;
-import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class ProfilingIntegrationTest {
@@ -56,7 +52,7 @@
 
     SitemapNode sitemap;
 
-    private static ApplicationContext applicationContext;
+    private static ClassPathXmlApplicationContext applicationContext;
 
     private static ComponentProvider componentProvider;
 
@@ -76,19 +72,18 @@
         this.servlet = (SitemapServlet) applicationContext.getBean("MockSitemapServlet");
         this.servlet.setTestcase(this);
         this.output = new ByteArrayOutputStream();
-
-        Map<String, Object> emptyMap = Collections.emptyMap();
-        CallStackHelper.enterServlet(new MockServletContext(), new MockHttpServletRequest(emptyMap),
-                new MockHttpServletResponse());
     }
 
-    @After
-    public void tearDown() throws Exception {
-        CallStackHelper.leaveServlet();
+    @AfterClass
+    public static void shutdownApplicationContext() {
+        applicationContext.close();
     }
 
-    private static ApplicationContext getApplicationContext() {
+    private static ClassPathXmlApplicationContext getApplicationContext() {
         return new ClassPathXmlApplicationContext(new String[] {
+        "cocoon-sample-test-collector.xml",
+
+        "cocoon-profiling-test-component.xml",
 
         "META-INF/cocoon/spring/cocoon-sitemap.xml",
 
@@ -102,16 +97,11 @@
 
         "META-INF/cocoon/spring/cocoon-expression-language.xml",
 
-        "META-INF/cocoon/spring/cocoon-servlet-collector.xml",
-
         "META-INF/cocoon/spring/cocoon-servlet-component.xml",
 
         "META-INF/cocoon/spring/cocoon-controller.xml",
 
         "META-INF/cocoon/spring/cocoon-profiling-component.xml",
-
-        "cocoon-profiling-test-component.xml",
-
         });
     }
 

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java?rev=888725&r1=888724&r2=888725&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
Wed Dec  9 08:14:24 2009
@@ -164,13 +164,27 @@
         super.setUp();
 
         ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[]
{
-                "META-INF/cocoon/spring/cocoon-sitemap.xml", "META-INF/cocoon/spring/cocoon-pipeline-action.xml",
-                "META-INF/cocoon/spring/cocoon-pipeline-component.xml", "META-INF/cocoon/spring/cocoon-pipeline.xml",
+                "cocoon-sample-test-collector.xml",
+
+                "META-INF/cocoon/spring/cocoon-pipeline.xml",
+
+                "META-INF/cocoon/spring/cocoon-pipeline-action.xml",
+
+                "META-INF/cocoon/spring/cocoon-pipeline-component.xml",
+
+                "META-INF/cocoon/spring/cocoon-sitemap.xml",
+
                 "META-INF/cocoon/spring/cocoon-sitemap-node.xml",
+
                 "META-INF/cocoon/spring/cocoon-expression-language.xml",
+
                 "META-INF/cocoon/spring/cocoon-sample-sitemap-components.xml",
-                "META-INF/cocoon/spring/cocoon-servlet-component.xml", "META-INF/cocoon/spring/cocoon-controller.xml",
-                "cocoon-sample-test-collector.xml" });
+
+                "META-INF/cocoon/spring/cocoon-servlet-component.xml",
+
+                "META-INF/cocoon/spring/cocoon-controller.xml"
+
+                 });
 
         this.componentProvider = (ComponentProvider) applicationContext
                 .getBean("org.apache.cocoon.sitemap.ComponentProvider");



Mime
View raw message