Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2618 - in development/main/test/unit: . plus/src/test/net/dpml/test/acme/plus

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: r2618 - in development/main/test/unit: . plus/src/test/net/dpml/test/acme/plus
  • Date: Thu, 19 May 2005 03:48:02 +0000

Author: mcconnell AT dpml.net
Date: Thu May 19 03:47:59 2005
New Revision: 2618

Modified:
development/main/test/unit/index.xml

development/main/test/unit/plus/src/test/net/dpml/test/acme/plus/URLTestCase.java
Log:
Add a few more URL related tests.

Modified: development/main/test/unit/index.xml
==============================================================================
--- development/main/test/unit/index.xml (original)
+++ development/main/test/unit/index.xml Thu May 19 03:47:59 2005
@@ -31,6 +31,7 @@
</types>
</info>
<dependencies>
+ <include key="dpml-test-simple"/>
<include key="dpml-test-plus"/>
<include key="dpml-composition-unit"/>
<include key="ant-junit"/>

Modified:
development/main/test/unit/plus/src/test/net/dpml/test/acme/plus/URLTestCase.java
==============================================================================
---
development/main/test/unit/plus/src/test/net/dpml/test/acme/plus/URLTestCase.java
(original)
+++
development/main/test/unit/plus/src/test/net/dpml/test/acme/plus/URLTestCase.java
Thu May 19 03:47:59 2005
@@ -24,6 +24,10 @@
import junit.framework.TestCase;

import net.dpml.parts.part.Part;
+import net.dpml.parts.model.Provider;
+import net.dpml.parts.model.Model;
+
+import net.dpml.test.acme.Dimension;

/**
* Test URL content handling.
@@ -33,6 +37,49 @@
*/
public class URLTestCase extends TestCase
{
+
//--------------------------------------------------------------------------
+ // tests
+
//--------------------------------------------------------------------------
+
+ /**
+ * Test loading of a component instance via URL.
+ */
+ public void testComponentInstanceAquisition() throws Exception
+ {
+ URL url = new URL( SIMPLE_TEST_PART );
+ Dimension d = (Dimension) url.getContent( new Class[]{ Object.class
} );
+ }
+
+ /**
+ * Test loading of a component provider model via URL.
+ */
+ public void testComponentProviderAquisition() throws Exception
+ {
+ URL url = new URL( SIMPLE_TEST_PART );
+ Provider provider = (Provider) url.getContent( new Class[]{
Provider.class } );
+ Dimension d = (Dimension) provider.resolve();
+ }
+
+ /**
+ * Test loading of a component deployment model via URL.
+ */
+ public void testComponentModelAquisition() throws Exception
+ {
+ URL url = new URL( SIMPLE_TEST_PART );
+ Model model = (Model) url.getContent( new Class[]{ Model.class } );
+ Provider provider = model.getProvider();
+ Dimension d = (Dimension) provider.resolve();
+ }
+
+ /**
+ * Test loading of a component deployment model via URL.
+ */
+ public void testPartAquisition() throws Exception
+ {
+ URL url = new URL( SIMPLE_TEST_PART );
+ Part part = (Part) url.getContent();
+ }
+
/**
* Check that the loading of a url results in the loading of the Part
* class from the same classloader. This validate that the caching of
plugins
@@ -48,13 +95,21 @@
assertEquals( "same class", partA.getClass(), partB.getClass() );
}

+
//--------------------------------------------------------------------------
+ // static utils
+
//--------------------------------------------------------------------------
+
/**
* Setup the system properties to assign transit as a protocol handler,
depot's logging
* configuration so things are neat, make sure prefs are enabled, and
assign the composition
* content manager plugin as the preferred content manager (which will
make sure that our
* part content request are dealt with).
*/
- public void setUp() throws Exception
+ private final static String SIMPLE_TEST_PART = "@SIMPLE-TEST-PART@";
+ private final static String PLUS_TEST_PART = "@PLUS-TEST-PART@";
+ private final static String CONTENT_MANAGER_PLUGIN =
"@CONTENT-MANAGER-PLUGIN@";
+
+ static
{
System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
System.setProperty( "java.util.logging.config.class",
"net.dpml.depot.logging.ConfigurationHandler" );
@@ -62,9 +117,5 @@
System.setProperty( "dpml.transit.content.plugin",
CONTENT_MANAGER_PLUGIN );
}

- private final static String SIMPLE_TEST_PART = "@SIMPLE-TEST-PART@";
- private final static String PLUS_TEST_PART = "@PLUS-TEST-PART@";
- private final static String CONTENT_MANAGER_PLUGIN =
"@CONTENT-MANAGER-PLUGIN@";
-

}



  • svn commit: r2618 - in development/main/test/unit: . plus/src/test/net/dpml/test/acme/plus, mcconnell, 05/18/2005

Archive powered by MHonArc 2.6.24.

Top of Page