Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2294 - in development/main/metro: . composition/control composition/control/src/main/net/dpml/composition/control composition/testing/acme/src/main/net/dpml/composition/testing composition/unit/src/main/net/dpml/composition/unit main main/src/main/net/dpml/metro

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: r2294 - in development/main/metro: . composition/control composition/control/src/main/net/dpml/composition/control composition/testing/acme/src/main/net/dpml/composition/testing composition/unit/src/main/net/dpml/composition/unit main main/src/main/net/dpml/metro
  • Date: Sat, 16 Apr 2005 10:47:31 -0400

Author: mcconnell AT dpml.net
Date: Sat Apr 16 10:47:27 2005
New Revision: 2294

Modified:
development/main/metro/composition/control/build.xml

development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java

development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java

development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionPartHandler.java

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

development/main/metro/composition/unit/src/main/net/dpml/composition/unit/CompositionHelper.java
development/main/metro/index.xml
development/main/metro/main/build.xml
development/main/metro/main/src/main/net/dpml/metro/Metro.java
Log:
Tweaking metro to enable testing the the deployment of FT via metro command
line.
For example ...

metro -execute -test
artifact:part:dpml/test/dpml-composition-testing-acme#SNAPSHOT

Modified: development/main/metro/composition/control/build.xml
==============================================================================
--- development/main/metro/composition/control/build.xml (original)
+++ development/main/metro/composition/control/build.xml Sat Apr 16
10:47:27 2005
@@ -14,7 +14,7 @@
</target>

<target name="package" depends="standard.package">
- <x:export class="net.dpml.composition.control.CompositionController"/>
+ <x:export class="net.dpml.composition.control.CompositionManager"/>
</target>

</project>

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
Sat Apr 16 10:47:27 2005
@@ -630,6 +630,21 @@
}
}

+ protected static URI createURI( String spec )
+ {
+ try
+ {
+ return new URI( spec );
+ }
+ catch( URISyntaxException e )
+ {
+ final String error =
+ "Invalid URI specification [" + spec + "].";
+ throw new ControlRuntimeException( CONTROLLER_URI, error, e );
+ }
+ }
+
+
static final URI CONTROLLER_URI = setupURI( "@PART-CONTROLLER-URI@" );

protected static URI setupURI( String spec )

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
Sat Apr 16 10:47:27 2005
@@ -27,6 +27,8 @@
import java.io.ObjectInputStream;
import java.util.Set;
import java.util.HashSet;
+import java.util.Map;
+import java.util.Hashtable;
import java.util.Collections;
import java.util.WeakHashMap;
import java.util.ArrayList;
@@ -35,6 +37,8 @@
import java.util.logging.Handler;
import java.util.logging.LogManager;

+import net.dpml.activity.Startable;
+
import net.dpml.automation.part.Part;

import net.dpml.automation.control.SystemManager;
@@ -52,6 +56,16 @@

import net.dpml.system.SystemContext;

+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.GnuParser;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.cli.OptionGroup;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+
+
/**
* The CompositionManager is a top-level manager responsible for the
management
* of an arbitary collection of component models.
@@ -59,7 +73,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public class CompositionManager extends CompositionController implements
SystemManager
+public class CompositionManager extends CompositionController implements
SystemManager, Startable
{
//--------------------------------------------------------------------
// state
@@ -69,12 +83,13 @@
private final ClassLoader m_classloader;
private final URI m_partition;
private final Set m_models = Collections.synchronizedSet( new HashSet()
);
+ private final Map m_instances = new Hashtable();

//--------------------------------------------------------------------
// constructor
//--------------------------------------------------------------------

- public CompositionManager( SystemContext system )
+ public CompositionManager( SystemContext system, String[] args ) throws
Exception
{
super( new DefaultMonitor( system.getLogger() ), system,
createPartition( system ) );

@@ -93,18 +108,29 @@

Properties properties = new Properties();
properties.setProperty(
- ".level",
- "INFO" );
- properties.setProperty(
"handlers",
"java.util.logging.ConsoleHandler" );
properties.setProperty(
"java.util.logging.ConsoleHandler.formatter",
"net.dpml.transit.adapter.StandardFormatter" );
- properties.setProperty(
- "java.util.logging.ConsoleHandler.level",
- "INFO" );
-
+ if( system.getDebugMode() )
+ {
+ properties.setProperty(
+ ".level",
+ "FINE" );
+ properties.setProperty(
+ "java.util.logging.ConsoleHandler.level",
+ "FINE" );
+ }
+ else
+ {
+ properties.setProperty(
+ ".level",
+ "INFO" );
+ properties.setProperty(
+ "java.util.logging.ConsoleHandler.level",
+ "INFO" );
+ }
try
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -118,6 +144,67 @@
{
e.printStackTrace();
}
+
+ CommandLine line = getCommandLine( args );
+ String[] arguments = line.getArgs();
+ URI uri = getLauchTargetURI( arguments );
+ if( null != uri )
+ {
+ addRootPart( uri );
+ }
+ }
+
+ private URI getLauchTargetURI( String[] arguments )
+ {
+ if( arguments.length == 0 )
+ {
+ return null;
+ }
+ else if( arguments.length == 1 )
+ {
+ String spec = arguments[0];
+ return createURI( spec );
+ }
+ else
+ {
+ final String error =
+ "Multi-part loading not supported at this time.";
+ throw new UnsupportedOperationException( error );
+ }
+ }
+
+ private CommandLine getCommandLine( String[] args )
+ {
+ try
+ {
+ Options options = buildCommandLineOptions();
+ CommandLineParser parser = new GnuParser();
+ return parser.parse( options, args, false );
+ }
+ catch( Throwable e )
+ {
+ URI uri = getURI();
+ final String error =
+ "Commandline parsing error.";
+ throw new ControlRuntimeException( uri, error, e );
+ }
+ }
+
+ private void addRootPart( URI uri )
+ {
+ try
+ {
+ addPart( uri, "root" );
+ }
+ catch( Throwable e )
+ {
+ URI control = getURI();
+ final String error =
+ "Unable to establish the model for the part."
+ + "\nPart: " + uri
+ + "\nController: " + getURI();
+ throw new ControlRuntimeException( control, error, e );
+ }
}

//--------------------------------------------------------------------
@@ -149,14 +236,33 @@
m_models.add( model );
}

- public void start() throws Exception
+ public synchronized void start() throws Exception
{
- throw new UnsupportedOperationException( "start" );
+ getMonitor().debug( "initiating startup in " + getURI() );
+ Model[] models = getManagedModels();
+ for( int i=0; i<models.length; i++ )
+ {
+ Model model = models[i];
+ getMonitor().debug( "starting " + model.getURI() );
+ Controller controller = model.getController();
+ Object instance = controller.resolve( model );
+ m_instances.put( model, instance );
+ }
}

- public void stop()
+ public synchronized void stop()
{
- throw new UnsupportedOperationException( "stop" );
+ getMonitor().debug( "initiating shutdown in " + getURI() );
+ Model[] models = (Model[]) m_instances.keySet().toArray( new
Model[0] );
+ for( int i=0; i<models.length; i++ )
+ {
+ Model model = models[i];
+ getMonitor().debug( "stopping " + model.getURI() );
+ Controller controller = model.getController();
+ Object instance = m_instances.get( model );
+ controller.release( instance );
+ m_instances.remove( model );
+ }
}

//--------------------------------------------------------------------
@@ -260,4 +366,13 @@
throw new RuntimeException( error, e );
}
}
+
+ private static Options buildCommandLineOptions()
+ {
+ Options options = new Options();
+ options.addOption(
+ new Option( "audit", "Enable audit mode." ) );
+ return options;
+ }
+
}

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionPartHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionPartHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionPartHandler.java
Sat Apr 16 10:47:27 2005
@@ -223,7 +223,7 @@
catch( Throwable e )
{
final String error =
- "Error loading part handler ["
+ "Error loading part ["
+ uri
+ "].";
throw new PartHandlerRuntimeException( error, e );

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/AcmeContainer.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/AcmeContainer.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/AcmeContainer.java
Sat Apr 16 10:47:27 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.
@@ -26,7 +26,6 @@
* A simple class composed of two parts (widget and gizmo).
*
* @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 AcmeContainer implements Example
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/BadColorException.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/BadColorException.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/BadColorException.java
Sat Apr 16 10:47:27 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.
@@ -22,7 +22,6 @@
* An exception that is thrown by the BadWidget
*
* @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 BadColorException extends RuntimeException
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/BadWidget.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/BadWidget.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/BadWidget.java
Sat Apr 16 10:47:27 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.
@@ -24,7 +24,6 @@
* Component implementation that demonstrates the use of a context
inner-class.
*
* @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 BadWidget implements Widget
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ColorContext.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ColorContext.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ColorContext.java
Sat Apr 16 10:47:27 2005
@@ -19,10 +19,9 @@
package net.dpml.composition.testing;

/**
- * An example of a ACME standard context definition.
+ * An example of a standard context definition.
*
* @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 interface ColorContext
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Dimension.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Dimension.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Dimension.java
Sat Apr 16 10:47:27 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.
@@ -22,7 +22,6 @@
* The dimension interface.
*
* @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 interface Dimension
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionComponent.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionComponent.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionComponent.java
Sat Apr 16 10:47:27 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.
@@ -18,23 +18,39 @@

package net.dpml.composition.testing;

+import java.util.logging.Logger;
+
/**
* An example of component based implementation of a Dimension. Unlike
* the DimensionValue, this implementation resolves width and height
parameters
* form the supplied context.
*
* @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 DimensionComponent implements Dimension
{
+ //------------------------------------------------------------------
+ // state
+ //------------------------------------------------------------------
+
+ private final Logger m_logger;
private final Context m_context;

- public DimensionComponent( Context context )
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ public DimensionComponent( Logger logger, Context context )
{
m_context = context;
+ m_logger = logger;
+ m_logger.fine( "available" );
}

+ //------------------------------------------------------------------
+ // Dimension
+ //------------------------------------------------------------------
+
public int getWidth()
{
return m_context.getWidth( 1024 );
@@ -51,7 +67,9 @@
{
int x = getWidth();
int y = getHeight();
- return multiply( x, y );
+ int result = multiply( x, y );
+ m_logger.fine( "" + x + " x " + y + " = " + result );
+ return result;
}
}


Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionValue.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionValue.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionValue.java
Sat Apr 16 10:47:27 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.
@@ -26,7 +26,6 @@
* context.
*
* @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 DimensionValue implements Dimension
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionalContext.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionalContext.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/DimensionalContext.java
Sat Apr 16 10:47:27 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.
@@ -22,7 +22,6 @@
* An example of a standard context interface.
*
* @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 interface DimensionalContext
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Example.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Example.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Example.java
Sat Apr 16 10:47:27 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.
@@ -22,7 +22,6 @@
* An example service interface.
*
* @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 interface Example
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleComponent.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleComponent.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleComponent.java
Sat Apr 16 10:47:27 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.
@@ -26,7 +26,6 @@
* Component implementation that demonstrates the use of a context
inner-class.
*
* @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 ExampleComponent implements Example
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleContainer.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleContainer.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/ExampleContainer.java
Sat Apr 16 10:47:27 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.
@@ -25,7 +25,6 @@
* Component implementation that demonstrates the use of a context
inner-class.
*
* @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 ExampleContainer implements Example
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Gizmo.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Gizmo.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Gizmo.java
Sat Apr 16 10:47:27 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.
@@ -21,7 +21,6 @@
/**
* Sample gizmo service.
* @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 interface Gizmo
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/GizmoComponent.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/GizmoComponent.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/GizmoComponent.java
Sat Apr 16 10:47:27 2005
@@ -23,7 +23,6 @@
/**
* AbstractCompositionTestCase
* @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 GizmoComponent implements Gizmo
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/SimpleWidget.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/SimpleWidget.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/SimpleWidget.java
Sat Apr 16 10:47:27 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.
@@ -24,7 +24,6 @@
* Component implementation that demonstrates the use of a context
inner-class.
*
* @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 SimpleWidget implements Widget
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Widget.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Widget.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/Widget.java
Sat Apr 16 10:47:27 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.
@@ -21,7 +21,6 @@
/**
* Sample widget service.
* @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 interface Widget
{

Modified:
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/WidgetComponent.java
==============================================================================
---
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/WidgetComponent.java
(original)
+++
development/main/metro/composition/testing/acme/src/main/net/dpml/composition/testing/WidgetComponent.java
Sat Apr 16 10:47:27 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.
@@ -26,7 +26,6 @@
* Component implementation that demonstrates the use of a context
inner-class.
*
* @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 WidgetComponent implements Widget
{

Modified:
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/CompositionHelper.java
==============================================================================
---
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/CompositionHelper.java
(original)
+++
development/main/metro/composition/unit/src/main/net/dpml/composition/unit/CompositionHelper.java
Sat Apr 16 10:47:27 2005
@@ -47,7 +47,6 @@
* includuing but not limited to test-cases.
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
- * @version $Id: CompositionTestCase.java 363 2004-11-04 15:06:34Z mcconnell
$
*/
public class CompositionHelper
{
@@ -108,7 +107,7 @@
public CompositionHelper( File base, Map map ) throws Exception
{
m_system = createSystemContext( map, base );
- m_manager = new CompositionManager( m_system );
+ m_manager = new CompositionManager( m_system, new String[0] );
}

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

Modified: development/main/metro/index.xml
==============================================================================
--- development/main/metro/index.xml (original)
+++ development/main/metro/index.xml Sat Apr 16 10:47:27 2005
@@ -447,7 +447,10 @@
<include key="dpml-automation-control" tag="spi"/>
<include key="dpml-composition-api" tag="spi"/>
<include key="dpml-system-api" tag="spi"/>
+ <include key="dpml-activity-api"/>
<include key="dpml-util-exception"/>
+ <include key="commons-cli"/>
+ <include key="dpml-parameters-impl"/>
</dependencies>
</project>


Modified: development/main/metro/main/build.xml
==============================================================================
--- development/main/metro/main/build.xml (original)
+++ development/main/metro/main/build.xml Sat Apr 16 10:47:27 2005
@@ -7,6 +7,7 @@

<target name="init" depends="standard.init">
<x:filter feature="plugin" token="METRO-PLUGIN-URI"/>
+ <x:filter feature="plugin" key="dpml-composition-control"
token="TEST-URI"/>
<x:filter feature="plugin" key="dpml-system-impl"
token="SYSTEM-PLUGIN-URI"/>
<x:filter feature="plugin" key="dpml-composition-control"
token="FREIGHT-TRAIN-CONTROLLER-URI"/>
<x:filter feature="plugin" key="dpml-composition-impl"
token="COMPOSITION-IMPL-ARTIFACT-URI"/>

Modified: development/main/metro/main/src/main/net/dpml/metro/Metro.java
==============================================================================
--- development/main/metro/main/src/main/net/dpml/metro/Metro.java
(original)
+++ development/main/metro/main/src/main/net/dpml/metro/Metro.java Sat
Apr 16 10:47:27 2005
@@ -93,6 +93,9 @@
private static String SYSTEM_IMPL_PLUGIN_DEFAULT =
"@SYSTEM-PLUGIN-URI@";

+ private static String TEST_URI =
+ "@TEST-URI@";
+
public static String SYSTEM_IMPL_SPEC_KEY =
SystemContext.DOMAIN + ".metro.system.artifact";

@@ -186,7 +189,8 @@

try
{
- URI target = getMainArtifact( properties );
+ boolean testMode = line.hasOption( "test" );
+ URI target = getMainArtifact( properties, testMode );
getLogger().debug( "loading plugin: [" + target + "]." );

ClassLoader classloader = getRootClassLoader( line );
@@ -209,13 +213,15 @@

if( m_plugin instanceof Startable )
{
+ getLogger().debug( "initiating plugin startup" );
((Startable)m_plugin).start();
getLogger().debug( "plugin startup completed" );
- if( !m_server )
- {
- ((Startable)m_plugin).stop();
- getLogger().debug( "plugin shutdown completed" );
- }
+ //if( !m_server )
+ //{
+ // getLogger().debug( "initiating plugin shutdown" );
+ // ((Startable)m_plugin).stop();
+ // getLogger().debug( "plugin shutdown completed" );
+ //}
}
else
{
@@ -307,9 +313,13 @@
}
}

- private URI getMainArtifact( Properties properties )
+ private URI getMainArtifact( Properties properties, boolean test )
throws URISyntaxException
{
+ if( test )
+ {
+ return Artifact.createArtifact( TEST_URI ).toURI();
+ }
String spec = properties.getProperty( TARGET_URI_KEY );
if( null != spec )
{



  • svn commit: r2294 - in development/main/metro: . composition/control composition/control/src/main/net/dpml/composition/control composition/testing/acme/src/main/net/dpml/composition/testing composition/unit/src/main/net/dpml/composition/unit main main/src/main/net/dpml/metro, mcconnell, 04/15/2005

Archive powered by MHonArc 2.6.24.

Top of Page