Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2512 - development/main/metro/composition/testing/workshop/src/test/net/dpml/test

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2512 - development/main/metro/composition/testing/workshop/src/test/net/dpml/test
  • Date: Wed, 11 May 2005 12:32:19 +0000

Author: mcconnell AT dpml.net
Date: Wed May 11 12:32:11 2005
New Revision: 2512

Modified:

development/main/metro/composition/testing/workshop/src/test/net/dpml/test/PartTestCase.java

development/main/metro/composition/testing/workshop/src/test/net/dpml/test/WorkshopTestCase.java
Log:
add testcase setup and teardown that handles the assumed preferences
infomation

Modified:
development/main/metro/composition/testing/workshop/src/test/net/dpml/test/PartTestCase.java
==============================================================================
---
development/main/metro/composition/testing/workshop/src/test/net/dpml/test/PartTestCase.java
(original)
+++
development/main/metro/composition/testing/workshop/src/test/net/dpml/test/PartTestCase.java
Wed May 11 12:32:11 2005
@@ -22,11 +22,14 @@
import java.net.URL;
import java.util.logging.Logger;
import java.util.logging.Level;
+import java.util.prefs.Preferences;

import junit.framework.TestCase;

import net.dpml.parts.part.Part;

+import net.dpml.transit.content.ContentHandlerRegistry;
+
/**
* Test a simple component case.
*
@@ -35,13 +38,25 @@
*/
public class PartTestCase extends TestCase
{
- static
+ public void setUp() throws Exception
{
+ Preferences prefs = Preferences.userNodeForPackage(
ContentHandlerRegistry.class );
+ Preferences p = prefs.node( "part" );
+ p.put( "title", "Part Content Handler" );
+ p.put( "uri",
"artifact:plugin:dpml/tools/dpml-composition-unit#SNAPSHOT" );
System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
System.setProperty( "java.util.logging.config.class",
"net.dpml.transit.logging.ConfigurationHandler" );
System.setProperty( "dpml.transit.preferences.enabled", "true" );
}

+ public void tearDown() throws Exception
+ {
+ Preferences prefs = Preferences.userNodeForPackage(
ContentHandlerRegistry.class );
+ Preferences p = prefs.node( "part" );
+ p.removeNode();
+ }
+
+
/**
* Check that the loading of a url results in the loading of the Part
class from the same classloader.
* (i.e. validate that the caching of plugins in Transit is doing what it
should be doing).

Modified:
development/main/metro/composition/testing/workshop/src/test/net/dpml/test/WorkshopTestCase.java
==============================================================================
---
development/main/metro/composition/testing/workshop/src/test/net/dpml/test/WorkshopTestCase.java
(original)
+++
development/main/metro/composition/testing/workshop/src/test/net/dpml/test/WorkshopTestCase.java
Wed May 11 12:32:11 2005
@@ -27,6 +27,8 @@
import net.dpml.transit.logging.nodes.Nodes;
import net.dpml.parts.model.Provider;

+import net.dpml.transit.content.ContentHandlerRegistry;
+
/**
* Test a simple component case.
*
@@ -35,24 +37,32 @@
*/
public class WorkshopTestCase extends TestCase
{
- static
+ //
------------------------------------------------------------------------
+ // static
+ //
------------------------------------------------------------------------
+
+ private ClassLoader m_classloader;
+
+ public void setUp() throws Exception
{
+ Preferences prefs = Preferences.userNodeForPackage(
ContentHandlerRegistry.class );
+ Preferences p = prefs.node( "part" );
+ p.put( "title", "Part Content Handler" );
+ p.put( "uri",
"artifact:plugin:dpml/tools/dpml-composition-unit#SNAPSHOT" );
System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
System.setProperty( "java.util.logging.config.class",
"net.dpml.transit.logging.ConfigurationHandler" );
System.setProperty( "dpml.transit.preferences.enabled", "true" );
- }
-
- private ClassLoader m_classloader;

- public void setUp()
- {
ClassLoader current = Thread.currentThread().getContextClassLoader();
ClassLoader classloader = Provider.class.getClassLoader();
Thread.currentThread().setContextClassLoader( classloader );
}

- public void tearDown()
+ public void tearDown() throws Exception
{
+ Preferences prefs = Preferences.userNodeForPackage(
ContentHandlerRegistry.class );
+ Preferences p = prefs.node( "part" );
+ p.removeNode();
Thread.currentThread().setContextClassLoader( m_classloader );
}




  • svn commit: r2512 - development/main/metro/composition/testing/workshop/src/test/net/dpml/test, mcconnell, 05/11/2005

Archive powered by MHonArc 2.6.24.

Top of Page