Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2187 - in development/main/metro/composition/testing: acme unit unit/src/test/net/dpml/composition/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: r2187 - in development/main/metro/composition/testing: acme unit unit/src/test/net/dpml/composition/test
  • Date: Fri, 01 Apr 2005 03:40:24 -0500

Author: mcconnell AT dpml.net
Date: Fri Apr 1 03:40:20 2005
New Revision: 2187

Modified:
development/main/metro/composition/testing/acme/build.xml
development/main/metro/composition/testing/unit/build.xml

development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/CompositeTestCase.java

development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/SimpleTestCase.java
Log:
housekeeping

Modified: development/main/metro/composition/testing/acme/build.xml
==============================================================================
--- development/main/metro/composition/testing/acme/build.xml (original)
+++ development/main/metro/composition/testing/acme/build.xml Fri Apr 1
03:40:20 2005
@@ -14,27 +14,9 @@
<type class="net.dpml.composition.testing.CompositeGizmo"/>
</types>

- <!-- create a container model -->
- <container xmlns="plugin:dpml/composition/dpml-composition-builder"
name="acme">
- <component name="widget"
class="net.dpml.composition.testing.DefaultWidget">
- <context>
- <entry key="foo" value="bar"/>
- <entry key="width" value="12"/>
- <entry key="height" value="100"/>
- <entry key="name" value="urn:metro:name"/>
- <entry key="partition" value="urn:metro:partition"/>
- <entry key="workingDirectory" value="acme/workspace"/>
- </context>
- </component>
- <component name="gizmo"
class="net.dpml.composition.testing.DefaultGizmo">
- <dependencies>
- <dependency key="widget" source="widget"/>
- </dependencies>
- </component>
- </container>
-
</target>

+ <!--
<target name="package" depends="standard.package">
<echo>Writing types</echo>
<type-writer class="net.dpml.composition.testing.DefaultWidget"
@@ -43,5 +25,6 @@
xmlns="plugin:dpml/composition/dpml-composition-builder"/>
<echo>Building block</echo>
</target>
+ -->

</project>

Modified: development/main/metro/composition/testing/unit/build.xml
==============================================================================
--- development/main/metro/composition/testing/unit/build.xml (original)
+++ development/main/metro/composition/testing/unit/build.xml Fri Apr 1
03:40:20 2005
@@ -12,18 +12,35 @@

<target name="build" depends="standard.build">

- <!--
- PLEASE NOTE: considerable work is required on the internal management of
parts
- before the testcase handling this sceanrio will pass. HOWEVER, the
following
- declaration demonstrates the generation of a test part into the local
target/test
- directory and the deployment of that part as a uri reference under the
- testing/unit CompositeTestCase.
+ <!--
+ Setup a container part to test basic context and dependency handling.
-->
+ <container xmlns="plugin:dpml/composition/dpml-composition-builder"
name="acme"
+ dest="target/test/acme-classic.part">
+ <component name="widget"
class="net.dpml.composition.testing.DefaultWidget">
+ <context>
+ <entry key="foo" value="bar"/>
+ <entry key="width" value="12"/>
+ <entry key="height" value="100"/>
+ <entry key="name" value="urn:metro:name"/>
+ <entry key="partition" value="urn:metro:partition"/>
+ <entry key="workingDirectory" value="acme/workspace"/>
+ </context>
+ </component>
+ <component name="gizmo"
class="net.dpml.composition.testing.DefaultGizmo">
+ <dependencies>
+ <dependency key="widget" source="widget"/>
+ </dependencies>
+ </component>
+ </container>

+ <!--
+ Setup a container dealing with experimental part handling. In the future
this
+ will be updated so that no container is required and the component part
will
+ be added directly.
+ -->
<container xmlns="plugin:dpml/composition/dpml-composition-builder"
- name="test"
- dest="target/test/acme-composite.part">
-
+ name="acme" dest="target/test/acme-composite.part">
<component name="gizmo"
class="net.dpml.composition.testing.CompositeGizmo">
<parts>
<component key="widget"
class="net.dpml.composition.testing.DefaultWidget">
@@ -38,7 +55,6 @@
</component>
</parts>
</component>
-
</container>

</target>

Modified:
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/CompositeTestCase.java
==============================================================================
---
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/CompositeTestCase.java
(original)
+++
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/CompositeTestCase.java
Fri Apr 1 03:40:20 2005
@@ -33,13 +33,21 @@
*/
public class CompositeTestCase extends CompositionTestCase
{
- //----------------------------------------------------------
- // testcase
- //----------------------------------------------------------
+ private static final String FILENAME = "acme-composite.part";
+
+ private URI m_uri;

public void setUp() throws Exception
{
super.setupCompositionRoot();
+ File base = new File( System.getProperty( "project.test.dir" ) );
+ File file = new File( base, FILENAME );
+ m_uri = file.toURI();
+ }
+
+ public void tearDown() throws Exception
+ {
+ getRoot().decommission();
}

/**
@@ -48,23 +56,9 @@
*/
public void testCompositePart() throws Throwable
{
- try
- {
- String path = System.getProperty( "project.test.dir" );
- File base = new File( path );
- File file = new File( base, "acme-composite.part" );
- URI uri = file.toURI();
- DeploymentModel test = getRoot().addModel( uri );
- test.commission();
- Object object = test.resolve( false );
- test.release( object );
- getRoot().decommission();
- }
- catch( Throwable e )
- {
- final String header = "Composite component deployment failure
(expected).";
- String error = ExceptionHelper.packException( header, e, false );
- fail( error );
- }
+ DeploymentModel test = getRoot().addModel( m_uri );
+ test.commission();
+ Object object = test.resolve( false );
+ test.release( object );
}
}

Modified:
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/SimpleTestCase.java
==============================================================================
---
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/SimpleTestCase.java
(original)
+++
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/SimpleTestCase.java
Fri Apr 1 03:40:20 2005
@@ -17,6 +17,7 @@

package net.dpml.composition.test;

+import java.io.File;
import java.net.URI;

import net.dpml.metro.unit.CompositionTestCase;
@@ -31,26 +32,33 @@
*/
public class SimpleTestCase extends CompositionTestCase
{
- //----------------------------------------------------------
- // testcase
- //----------------------------------------------------------
+ private static final String FILENAME = "acme-classic.part";
+
+ private URI m_uri;

public void setUp() throws Exception
{
super.setupCompositionRoot();
+ File base = new File( System.getProperty( "project.test.dir" ) );
+ File file = new File( base, FILENAME );
+ m_uri = file.toURI();
+ }
+
+ public void tearDown() throws Exception
+ {
+ getRoot().decommission();
}

/**
* Validate that the hello component is deployable and resolvable.
* @exception if a deployment error occurs
*/
- public void testFreightTrain() throws Throwable
+ public void testCompositePart() throws Throwable
{
- URI uri = new URI( "@ACME-PART-URI@" );
- DeploymentModel test = getRoot().addModel( uri );
+ DeploymentModel test = getRoot().addModel( m_uri );
test.commission();
Object object = test.resolve( false );
test.release( object );
- getRoot().decommission();
}
+
}



  • svn commit: r2187 - in development/main/metro/composition/testing: acme unit unit/src/test/net/dpml/composition/test, mcconnell, 03/31/2005

Archive powered by MHonArc 2.6.24.

Top of Page