Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2183 - in development/main/metro/composition: builder/src/main/net/dpml/composition/builder builder/src/main/net/dpml/composition/builder/datatypes testing/acme testing/acme/src/main/net/dpml/composition/testing testing/unit testing/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: r2183 - in development/main/metro/composition: builder/src/main/net/dpml/composition/builder builder/src/main/net/dpml/composition/builder/datatypes testing/acme testing/acme/src/main/net/dpml/composition/testing testing/unit testing/unit/src/test/net/dpml/composition/test
  • Date: Fri, 01 Apr 2005 01:29:27 -0500

Author: mcconnell AT dpml.net
Date: Fri Apr 1 01:29:19 2005
New Revision: 2183

Added:

development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/CompositeGizmo.java
development/main/metro/composition/testing/unit/build.properties

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
- copied, changed from r2178,
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/FreightTestCase.java
Removed:

development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/FreightTestCase.java
Modified:

development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ComponentBuilderTask.java

development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ContainerBuilderTask.java

development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/ContextDataType.java
development/main/metro/composition/testing/acme/build.xml

development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultGizmo.java

development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultWidget.java
development/main/metro/composition/testing/unit/build.xml
Log:
Adding validation of the context entries at build time. Updates to testcases.
Separating basic examples for in-progress examples.

Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ComponentBuilderTask.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ComponentBuilderTask.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ComponentBuilderTask.java
Fri Apr 1 01:29:19 2005
@@ -62,12 +62,16 @@
import net.dpml.composition.builder.datatypes.ConfigurationDataType;
import net.dpml.composition.builder.datatypes.PartsDataType;

+import net.dpml.meta.info.EntryDescriptor;
+
import net.dpml.part.Part;
import net.dpml.part.PartHolder;

import net.dpml.builder.PartBuilder;
import net.dpml.builder.IntrospectionException;

+import net.dpml.context.ComponentContext;
+
import net.dpml.configuration.Configuration;
import net.dpml.configuration.impl.DefaultConfiguration;

@@ -115,8 +119,20 @@
private DependenciesDataType m_dependencies;
private PartsDataType m_parts;

+ private File m_output;
+
private Type m_type;

+ /**
+ * Override the default output destination.
+ *
+ * @param file the overriding destination
+ */
+ public void setDest( File file )
+ {
+ m_output = file;
+ }
+
public void setKey( String key )
{
m_key = key;
@@ -260,37 +276,73 @@
ClassLoader classloader = new AntClassLoader( project, path );

File file = getOutputFile();
+ File parent = file.getParentFile();
+ if( !parent.exists() )
+ {
+ parent.mkdirs();
+ }
+
try
{
ComponentProfile profile = buildComponentProfile( classloader );
URI uri = getDefinition().getArtifactURI( Part.ARTIFACT_TYPE );
- log( "saving part to: " + uri );
+ if( null == m_output )
+ {
+ log( "saving part to: " + uri );
+ }
+ else
+ {
+ log( "saving part to: " + m_output );
+ }
URI handler = getPartHandlerURI();
byte[] bytes = SerializableObjectHelper.writeToByteArray(
profile );
PartHolder holder = new PartHolder( handler, bytes );
SerializableObjectHelper.write( holder, file );
}
- catch( Exception ioe )
+ catch( ConstructionException e )
+ {
+ throw e;
+ }
+ catch( IntrospectionException e )
+ {
+ final String error =
+ "Introspection error. "
+ + e.getMessage();
+ throw new BuildException( error, e, getLocation() );
+ }
+ catch( IOException e )
{
final String error =
"Internal error while attempting to write component part to
file ["
+ file
+ "]";
- throw new BuildException( error, ioe, getLocation() );
+ throw new BuildException( error, e, getLocation() );
+ }
+ catch( Exception e )
+ {
+ final String error =
+ "Internal error while attempting to build the part.";
+ throw new BuildException( error, e, getLocation() );
}
}

private File getOutputFile()
{
- File dir = getContext().getDeliverablesDirectory( Part.ARTIFACT_TYPE
);
- String filename = getDefinition().getFilename( Part.ARTIFACT_TYPE );
- File file = new File( dir, filename );
- File parent = file.getParentFile();
- if( !parent.exists() )
+ if( null != m_output )
{
- parent.mkdirs();
+ return m_output;
}
- return file;
+ else
+ {
+ return getDefaultOutputFile();
+ }
+ }
+
+ private File getDefaultOutputFile()
+ {
+ File dir = getContext().getDeliverablesDirectory( Part.ARTIFACT_TYPE
);
+ String filename = getDefinition().getFilename( Part.ARTIFACT_TYPE );
+ return new File( dir, filename );
}


@@ -353,13 +405,12 @@
String name = getName();
String classname = getClassname();
Type type = loadType( classloader, classname );
-
String lifestyle = getLifestylePolicy( type ); // need to update
ComponentProfile to handle this
int collection = getCollectionPolicy( type );
int activation = getActivationPolicy();
Mode mode = Mode.EXPLICIT;
CategoriesDirective categories = getCategoriesDirective();
- ContextDirective context = getContextDirective( classloader );
+ ContextDirective context = getContextDirective( classloader, type );
DependencyDirective[] dependencies = getDependencyDirectives();
Part[] parts = getParts( classloader );

@@ -378,17 +429,31 @@
/**
* TODO: move this to a part controller
*/
- private Type loadType( ClassLoader classloader, String classname )
+ private Type loadType( ClassLoader classloader, String classname )
{
+ if( null == classloader )
+ {
+ throw new NullPointerException( "classloader" );
+ }
+ if( null == classname )
+ {
+ throw new NullPointerException( "classname" );
+ }
String path = classname.replace( '.', '/' ) + ".type";
+ URL url = classloader.getResource( path );
+ if( null == url )
+ {
+ final String error =
+ "Unable to locate a component type definition for the class ["
+ + classname
+ + "] under the resource path ["
+ + path
+ + "].";
+ throw new ConstructionException( error );
+ }
try
{
- URL url = classloader.getResource( path );
InputStream input = url.openStream();
- if( null == input )
- {
- throw new TypeNotFoundException( url.toString() );
- }
ObjectInputStream stream = new ObjectInputStream( input );
TypeHolder holder = (TypeHolder) stream.readObject();
byte[] bytes = holder.getByteArray();
@@ -410,9 +475,16 @@
{
if( null == m_name )
{
- final String error =
- "Missing component 'name' attribute.";
- throw new BuildException( error, getLocation() );
+ if( null == m_key )
+ {
+ final String error =
+ "Missing component 'name' attribute.";
+ throw new BuildException( error, getLocation() );
+ }
+ else
+ {
+ return m_key;
+ }
}
return m_name;
}
@@ -523,7 +595,45 @@
}
}

- private ContextDirective getContextDirective( ClassLoader classloader )
+ private ContextDirective getContextDirective( ClassLoader classloader,
Type type )
+ throws IntrospectionException, IOException, ClassNotFoundException
+ {
+ String classname = type.getInfo().getClassname();
+ ContextDirective context = createContextDirective( classloader );
+
+ //
+ // validate that the context directives are declared
+ // and if not - throw an exception
+ //
+
+ EntryDescriptor[] entries = type.getContext().getEntries();
+ for( int i=0; i<entries.length; i++ )
+ {
+ EntryDescriptor entry = entries[i];
+ String key = entry.getKey();
+ EntryDirective directive = context.getEntryDirective( key );
+ if( entry.isRequired() && ( null == directive ) )
+ {
+ final String error =
+ "The component model ["
+ + getName()
+ + "] referencing the component type ["
+ + classname
+ + "] does not declare a context entry directive for the
non-optional entry ["
+ + key
+ + "].";
+ throw new ConstructionException( error, getLocation() );
+ }
+ }
+
+ //
+ // we are ship-shape
+ //
+
+ return context;
+ }
+
+ private ContextDirective createContextDirective( ClassLoader classloader
)
throws IntrospectionException, IOException, ClassNotFoundException
{
if( null == m_context )
@@ -597,6 +707,12 @@
}
}

+ private static final String COMPONENT_CONTEXT_CLASSNAME =
"net.dpml.context.ComponentContext";
+
+ private static Class loadClientComponentContextClass( ClassLoader
classloader ) throws ClassNotFoundException
+ {
+ return classloader.loadClass( COMPONENT_CONTEXT_CLASSNAME );
+ }

private static URI PART_HANDLER_URI = setupURI( "@PART-HANDLER-URI@" );
private static URI PART_BUILDER_URI = setupURI( "@PART-BUILDER-URI@" );

Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ContainerBuilderTask.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ContainerBuilderTask.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ContainerBuilderTask.java
Fri Apr 1 01:29:19 2005
@@ -84,6 +84,18 @@
private ClassloaderDataType m_classpath;
private ServicesDataType m_services;

+ private File m_output;
+
+ /**
+ * Override the default output destination.
+ *
+ * @param file the overriding destination
+ */
+ public void setDest( File file )
+ {
+ m_output = file;
+ }
+
public void setKey( String key )
{
m_key = key;
@@ -148,10 +160,23 @@
ContainmentProfile profile = buildContainer( classloader );

File file = getOutputFile();
+ File parent = file.getParentFile();
+ if( !parent.exists() )
+ {
+ parent.mkdirs();
+ }
+
try
{
URI uri = getDefinition().getArtifactURI( Part.ARTIFACT_TYPE );
- log( "saving part to: " + uri );
+ if( null == m_output )
+ {
+ log( "saving part to: " + uri );
+ }
+ else
+ {
+ log( "saving part to: " + m_output );
+ }
URI handler = getPartHandlerURI();
byte[] bytes = SerializableObjectHelper.writeToByteArray(
profile );
PartHolder holder = new PartHolder( handler, bytes );
@@ -216,10 +241,10 @@
{
String name = getName();
log( "building container: " + name);
- DeploymentProfile[] profiles = buildDeploymentProfiles( classloader
);
ClasspathDirective classpath = getClasspathDirective();
ServiceDirective[] services = getServiceDirectives();
CategoriesDirective categories = new CategoriesDirective(); // TODO
+ DeploymentProfile[] profiles = buildDeploymentProfiles( classloader
);
return new ContainmentProfile( name, classpath, services,
categories, profiles );
}

@@ -272,6 +297,10 @@
throw new UnsupportedOperationException( error );
}
}
+ catch( ConstructionException e )
+ {
+ throw e;
+ }
catch( Exception e )
{
final String error =
@@ -330,15 +359,21 @@

private File getOutputFile()
{
- File dir = getContext().getDeliverablesDirectory( Part.ARTIFACT_TYPE
);
- String filename = getDefinition().getFilename( Part.ARTIFACT_TYPE );
- File file = new File( dir, filename );
- File parent = file.getParentFile();
- if( !parent.exists() )
+ if( null != m_output )
{
- parent.mkdirs();
+ return m_output;
}
- return file;
+ else
+ {
+ return getDefaultOutputFile();
+ }
+ }
+
+ private File getDefaultOutputFile()
+ {
+ File dir = getContext().getDeliverablesDirectory( Part.ARTIFACT_TYPE
);
+ String filename = getDefinition().getFilename( Part.ARTIFACT_TYPE );
+ return new File( dir, filename );
}


//---------------------------------------------------------------------------

Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/ContextDataType.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/ContextDataType.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/ContextDataType.java
Fri Apr 1 01:29:19 2005
@@ -81,6 +81,7 @@
public ContextDirective getContextDirective( ClassLoader classloader )
throws IntrospectionException, IOException, ClassNotFoundException
{
+ String classname = getClassname();
PartBuilder[] builders = getBuilders();
EntryDirective[] entryDirectives = new EntryDirective[
builders.length ];
for( int i=0; i<builders.length; i++ )
@@ -100,7 +101,6 @@
throw new IllegalStateException( error );
}
}
- String classname = getClassname();
return new ContextDirective( classname, entryDirectives );
}
}

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
01:29:19 2005
@@ -7,30 +7,29 @@

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

- <!-- create the types -->
+ <!-- create the component types -->
<types xmlns="plugin:dpml/composition/dpml-composition-builder">
<type class="net.dpml.composition.testing.DefaultWidget"/>
<type class="net.dpml.composition.testing.DefaultGizmo"/>
+ <type class="net.dpml.composition.testing.CompositeGizmo"/>
</types>

- <!-- create a classic container model -->
+ <!-- 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>
- <parts>
- <value key="date" class="java.util.Date"/>
- <value key="info" class="java.net.URI"
value="link:acme-parts-list"/>
- <component key="widget" name="secret"
class="net.dpml.composition.testing.DefaultWidget"/>
- </parts>
</component>
</container>


Added:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/CompositeGizmo.java
==============================================================================
--- (empty file)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/CompositeGizmo.java
Fri Apr 1 01:29:19 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2004 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.composition.testing;
+
+import net.dpml.logging.Logger;
+
+/**
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ * @version $Id: CompositionTestCase.java 1393 2005-01-06 10:27:10Z niclas $
+ */
+public class CompositeGizmo implements Gizmo
+{
+ //------------------------------------------------------------------
+ // static
+ //------------------------------------------------------------------
+
+ public static final boolean TYPE_THREADSAFE_CAPABLE = true;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new widget component.
+ *
+ * @param logger the logging channel assigned by the container
+ * @param dependencies the requested dependencies
+ */
+ public CompositeGizmo( Logger logger, Parts parts )
+ {
+ logger.info( "initializing" );
+ try
+ {
+ Widget widget = parts.createWidget();
+ logger.info( "widget established");
+ widget.doWidgetTypeStuff();
+ parts.releaseWidget( widget );
+ logger.info( "widget released");
+ }
+ catch( UnsupportedOperationException uoe )
+ {
+ logger.warn( "message: " + uoe.getMessage() );
+ }
+ }
+
+ //------------------------------------------------------------------
+ // facards
+ //------------------------------------------------------------------
+
+ public interface Parts
+ {
+ Widget createWidget();
+ void releaseWidget( Widget widget );
+ }
+}

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultGizmo.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultGizmo.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultGizmo.java
Fri Apr 1 01:29:19 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2005 Stephen J. McConnell.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,37 +43,21 @@
* @param logger the logging channel assigned by the container
* @param dependencies the requested dependencies
*/
- public DefaultGizmo( Logger logger, Dependencies dependencies, Parts
parts )
+ public DefaultGizmo( Logger logger, Dependencies dependencies )
{
logger.info( "initializing" );
Widget widget = dependencies.getWidget();
logger.info( "widget established");

widget.doWidgetTypeStuff();
-
- try
- {
- Widget anotherWidget = parts.createWidget();
- parts.releaseWidget( anotherWidget );
- }
- catch( UnsupportedOperationException uoe )
- {
- logger.warn( "message: " + uoe.getMessage() );
- }
}

//------------------------------------------------------------------
- // facards
+ // concerns
//------------------------------------------------------------------

public interface Dependencies
{
Widget getWidget();
}
-
- public interface Parts
- {
- Widget createWidget();
- void releaseWidget( Widget widget );
- }
}

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultWidget.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultWidget.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DefaultWidget.java
Fri Apr 1 01:29:19 2005
@@ -18,6 +18,8 @@

package net.dpml.composition.testing;

+import java.io.File;
+
import net.dpml.logging.Logger;

/**
@@ -72,6 +74,9 @@
+ width
+ " and a height of "
+ height );
+
+ File work = m_context.getWorkingDirectory();
+ m_logger.info( "working dir: " + work );
}

//------------------------------------------------------------------
@@ -81,7 +86,10 @@
public interface Context
{
String getFoo();
+ String getName();
+ String getPartition();
int getWidth();
int getHeight( int defaultHeight );
+ File getWorkingDirectory();
}
}

Added: development/main/metro/composition/testing/unit/build.properties
==============================================================================
--- (empty file)
+++ development/main/metro/composition/testing/unit/build.properties Fri
Apr 1 01:29:19 2005
@@ -0,0 +1 @@
+project.test.halt-on-failure = false

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
01:29:19 2005
@@ -10,4 +10,37 @@
<filter token="ACME-PART-URI" value="${acme.part}"/>
</target>

+ <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.
+ -->
+
+ <container xmlns="plugin:dpml/composition/dpml-composition-builder"
+ name="test"
+ 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">
+ <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>
+ </parts>
+ </component>
+
+ </container>
+
+ </target>
+
</project>

Added:
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/CompositeTestCase.java
==============================================================================
--- (empty file)
+++
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/CompositeTestCase.java
Fri Apr 1 01:29:19 2005
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2004 Apache Software Foundation
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.composition.test;
+
+import java.io.File;
+import java.net.URI;
+
+import net.dpml.metro.unit.CompositionTestCase;
+
+import net.dpml.composition.model.DeploymentModel;
+import net.dpml.composition.model.ContainmentModel;
+
+import net.dpml.exception.ExceptionHelper;
+
+/**
+ * The testcase validates the new metro component model part loading and
deployment
+ * (which is currently not operational).
+ */
+public class CompositeTestCase extends CompositionTestCase
+{
+ //----------------------------------------------------------
+ // testcase
+ //----------------------------------------------------------
+
+ public void setUp() throws Exception
+ {
+ super.setupCompositionRoot();
+ }
+
+ /**
+ * Validate that the hello component is deployable and resolvable.
+ * @exception if a deployment error occurs
+ */
+ 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 );
+ }
+ }
+}

Copied:
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/SimpleTestCase.java
(from r2178,
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/FreightTestCase.java)
==============================================================================
---
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/FreightTestCase.java
(original)
+++
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/SimpleTestCase.java
Fri Apr 1 01:29:19 2005
@@ -27,10 +27,9 @@
import net.dpml.exception.ExceptionHelper;

/**
- * The hello component testcase validates that the
- * hello example is deployable.
+ * The testcase validates the new metro container model part loading and
deployment.
*/
-public class FreightTestCase extends CompositionTestCase
+public class SimpleTestCase extends CompositionTestCase
{
//----------------------------------------------------------
// testcase
@@ -47,21 +46,11 @@
*/
public void testFreightTrain() throws Throwable
{
- try
- {
- URI uri = new URI( "@ACME-PART-URI@" );
- DeploymentModel test = getRoot().addModel( uri );
- test.commission();
- Object object = test.resolve( false );
- test.release( object );
- getRoot().decommission();
- }
- catch( Throwable e )
- {
- final String header = "Derailed!";
- String stack = ExceptionHelper.packException( header, e, true );
- System.out.println( stack );
- throw e;
- }
+ URI uri = new URI( "@ACME-PART-URI@" );
+ DeploymentModel test = getRoot().addModel( uri );
+ test.commission();
+ Object object = test.resolve( false );
+ test.release( object );
+ getRoot().decommission();
}
}



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

Archive powered by MHonArc 2.6.24.

Top of Page