From mcconnell at mail.berlios.de Sat Dec 2 21:36:43 2006
From: mcconnell at mail.berlios.de (mcconnell at BerliOS)
Date: Sun, 3 Dec 2006 03:36:43 +0100
Subject: r1790 - tags
Message-ID: <200612030236.kB32ahNX020896@sheep.berlios.de>
Author: mcconnell
Date: 2006-12-03 03:36:43 +0100 (Sun, 03 Dec 2006)
New Revision: 1790
Added:
tags/SDK-1.0.4/
Log:
DPML SDK 1.0.4
Copied: tags/SDK-1.0.4 (from rev 1785, trunk)
From mcconnell at mail.berlios.de Sat Dec 2 21:37:46 2006
From: mcconnell at mail.berlios.de (mcconnell at BerliOS)
Date: Sun, 3 Dec 2006 03:37:46 +0100
Subject: r1791 - tags
Message-ID: <200612030237.kB32bk1g020976@sheep.berlios.de>
Author: mcconnell
Date: 2006-12-03 03:37:46 +0100 (Sun, 03 Dec 2006)
New Revision: 1791
Added:
tags/SDK-1.0.5/
Log:
DPML SDK 1.0.5
Copied: tags/SDK-1.0.5 (from rev 1788, trunk)
From mcconnell at mail.berlios.de Sat Dec 2 21:38:37 2006
From: mcconnell at mail.berlios.de (mcconnell at BerliOS)
Date: Sun, 3 Dec 2006 03:38:37 +0100
Subject: r1792 - tags
Message-ID: <200612030238.kB32cbLg021036@sheep.berlios.de>
Author: mcconnell
Date: 2006-12-03 03:38:37 +0100 (Sun, 03 Dec 2006)
New Revision: 1792
Added:
tags/SDK-1.1.0/
Log:
DPML SDK 1.1.0
Copied: tags/SDK-1.1.0 (from rev 1789, trunk)
From mcconnell at mail.berlios.de Sun Dec 3 00:57:23 2006
From: mcconnell at mail.berlios.de (mcconnell at BerliOS)
Date: Sun, 3 Dec 2006 06:57:23 +0100
Subject: r1793 - in trunk/tutorials: . components components/unit
components/unit/etc components/unit/etc/data
components/unit/src components/unit/src/main
components/unit/src/main/acme components/unit/src/test
components/unit/src/test/acme components/unit/src/test/acme/test
Message-ID: <200612030557.kB35vNDX017319@sheep.berlios.de>
Author: mcconnell
Date: 2006-12-03 06:57:18 +0100 (Sun, 03 Dec 2006)
New Revision: 1793
Added:
trunk/tutorials/components/unit/
trunk/tutorials/components/unit/build.xml
trunk/tutorials/components/unit/etc/
trunk/tutorials/components/unit/etc/data/
trunk/tutorials/components/unit/etc/data/logging.properties
trunk/tutorials/components/unit/src/
trunk/tutorials/components/unit/src/main/
trunk/tutorials/components/unit/src/main/acme/
trunk/tutorials/components/unit/src/main/acme/Child.java
trunk/tutorials/components/unit/src/main/acme/ChildImpl.java
trunk/tutorials/components/unit/src/main/acme/Container.java
trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java
trunk/tutorials/components/unit/src/test/
trunk/tutorials/components/unit/src/test/acme/
trunk/tutorials/components/unit/src/test/acme/test/
trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java
Modified:
trunk/tutorials/module.xml
Log:
add sample testcase dealing with formal decommissioning of a component via Metro management APIs
Property changes on: trunk/tutorials/components/unit
___________________________________________________________________
Name: svn:ignore
+ target
Added: trunk/tutorials/components/unit/build.xml
===================================================================
--- trunk/tutorials/components/unit/build.xml 2006-12-03 02:38:37 UTC (rev 1792)
+++ trunk/tutorials/components/unit/build.xml 2006-12-03 05:57:18 UTC (rev 1793)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Added: trunk/tutorials/components/unit/etc/data/logging.properties
===================================================================
--- trunk/tutorials/components/unit/etc/data/logging.properties 2006-12-03 02:38:37 UTC (rev 1792)
+++ trunk/tutorials/components/unit/etc/data/logging.properties 2006-12-03 05:57:18 UTC (rev 1793)
@@ -0,0 +1,2 @@
+container.level=FINE
+
Added: trunk/tutorials/components/unit/src/main/acme/Child.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/Child.java 2006-12-03 02:38:37 UTC (rev 1792)
+++ trunk/tutorials/components/unit/src/main/acme/Child.java 2006-12-03 05:57:18 UTC (rev 1793)
@@ -0,0 +1,9 @@
+package acme;
+
+import java.net.URI;
+
+public interface Child
+{
+ public void start( URI configurationURI ) throws Exception;
+ public void stop() throws Exception;
+}
Added: trunk/tutorials/components/unit/src/main/acme/ChildImpl.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/ChildImpl.java 2006-12-03 02:38:37 UTC (rev 1792)
+++ trunk/tutorials/components/unit/src/main/acme/ChildImpl.java 2006-12-03 05:57:18 UTC (rev 1793)
@@ -0,0 +1,35 @@
+package acme;
+
+import java.net.URI;
+import java.util.logging.Logger;
+
+public class ChildImpl implements Child
+{
+ private boolean started;
+ private Logger logger;
+
+ public ChildImpl( Logger logger )
+ {
+ this.started = false;
+ this.logger = logger;
+ }
+
+ public void start( URI configurationURI ) throws Exception {
+ if ( !this.started ){
+ this.started = true;
+ this.logger.info( "starting with: " + configurationURI );
+ } else {
+ throw new Exception( "already started!" );
+ }
+ }
+
+ public void stop() throws Exception {
+ if ( this.started ){
+ this.started = false;
+ this.logger.info( "stopping" );
+ } else {
+ throw new Exception("not started!" );
+ }
+ }
+
+}
Added: trunk/tutorials/components/unit/src/main/acme/Container.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/Container.java 2006-12-03 02:38:37 UTC (rev 1792)
+++ trunk/tutorials/components/unit/src/main/acme/Container.java 2006-12-03 05:57:18 UTC (rev 1793)
@@ -0,0 +1,5 @@
+package acme;
+
+public interface Container
+{
+}
Added: trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java 2006-12-03 02:38:37 UTC (rev 1792)
+++ trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java 2006-12-03 05:57:18 UTC (rev 1793)
@@ -0,0 +1,45 @@
+package acme;
+
+import java.net.URI;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class ContainerImpl implements Container {
+
+ public interface Context
+ {
+ public URI getConfigurationURI();
+ }
+
+ public interface Parts
+ {
+ public Child getChild( boolean proxy );
+ }
+
+ private URI m_uri;
+ private Child m_child;
+
+ private Logger m_logger;
+ private Context m_context;
+
+ public ContainerImpl( final Logger logger, final Context context, final Parts parts )
+ {
+ m_logger = logger;
+ m_uri = context.getConfigurationURI();
+ m_logger.info( "configuration uri: " + m_uri );
+ m_child = parts.getChild( false );
+ }
+
+ public void start() throws Exception
+ {
+ m_logger.info( "starting" );
+ m_child.start( m_uri );
+ m_logger.info( "configurable service started successfully" );
+ }
+
+ public synchronized void stop() throws Exception
+ {
+ m_logger.info( "stopping" );
+ m_child.stop();
+ }
+}
Added: trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java
===================================================================
--- trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java 2006-12-03 02:38:37 UTC (rev 1792)
+++ trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java 2006-12-03 05:57:18 UTC (rev 1793)
@@ -0,0 +1,85 @@
+package acme.test;
+
+import java.io.File;
+import java.net.URI;
+import java.util.logging.Logger;
+
+import junit.framework.TestCase;
+
+import net.dpml.component.Component;
+import net.dpml.component.Disposable;
+import net.dpml.component.Provider;
+import net.dpml.lang.Part;
+
+import acme.ContainerImpl;
+
+public class ExampleTest extends TestCase
+{
+ private Logger m_logger;
+ private Component m_component;
+
+ /**
+ * Load up the part from the tasrget/deliverables directory,
+ * and get the component handler which we will use to (a)
+ * establish an instance and (b) handle the formal end-of-life
+ * processing.
+ *
+ * @exception Exception if not everything goes according to plan
+ */
+ public void setUp() throws Exception
+ {
+ m_logger = Logger.getLogger( "test" );
+ m_logger.info( "commissioning" );
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ m_component = (Component) part.getContent( new Class[]{Component.class} );
+ }
+
+ /**
+ * Handle formal decommissioning of the component.
+ *
+ * @exception Exception if not everything goes according to plan
+ */
+ public void tearDown() throws Exception
+ {
+ m_logger.info( "decommissioning" );
+ Disposable disposable = (Disposable) m_component;
+ disposable.dispose();
+ System.gc();
+ }
+
+ /**
+ * The Component instance exposes a buch of management operations. One
+ * of these is the operation getProvider() which gives us access to
+ * the manager of one instance of the class specificed by the component
+ * type. The provider exposes the operation getValue( boolean ) which
+ * is where we actually get a fully initialized instance (and keep
+ * in mind here that full-initialized means that all initialization
+ * actions (such as state transitions) have alrady been successfully
+ * completed.
+ *
+ * @exception Exception if a test related error occurs
+ */
+ public void testExampleComponent() throws Exception
+ {
+ m_logger.info( "testing" );
+ Provider provider = m_component.getProvider();
+ ContainerImpl container = (ContainerImpl) provider.getValue( false );
+
+ // Any tests dealing with the instance would go here.
+ }
+
+ /**
+ * Internal utility to get a URI to the part definition in the
+ * project target/deliverables directory.
+ *
+ * @return the part uri
+ * @exception Exception if an error occurs
+ */
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty( "project.deliverable.part.path" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}
Modified: trunk/tutorials/module.xml
===================================================================
--- trunk/tutorials/module.xml 2006-12-03 02:38:37 UTC (rev 1792)
+++ trunk/tutorials/module.xml 2006-12-03 05:57:18 UTC (rev 1793)
@@ -478,6 +478,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From mcconnell at mail.berlios.de Sun Dec 3 01:00:20 2006
From: mcconnell at mail.berlios.de (mcconnell at BerliOS)
Date: Sun, 3 Dec 2006 07:00:20 +0100
Subject: r1794 - trunk/main/transit/core/src/main/net/dpml/util
Message-ID: <200612030600.kB360K89019963@sheep.berlios.de>
Author: mcconnell
Date: 2006-12-03 07:00:20 +0100 (Sun, 03 Dec 2006)
New Revision: 1794
Modified:
trunk/main/transit/core/src/main/net/dpml/util/UnicastEventSource.java
Log:
move termination message from debug to trace
Modified: trunk/main/transit/core/src/main/net/dpml/util/UnicastEventSource.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/util/UnicastEventSource.java 2006-12-03 05:57:18 UTC (rev 1793)
+++ trunk/main/transit/core/src/main/net/dpml/util/UnicastEventSource.java 2006-12-03 06:00:20 UTC (rev 1794)
@@ -209,11 +209,11 @@
try
{
UnicastRemoteObject.unexportObject( m_source, true );
- m_logger.debug( "terminated" );
+ m_logger.trace( "terminated " + m_source.getClass().getName() );
}
catch( NoSuchObjectException e )
{
- boolean ignoreThis = true; // objct has not been exported
+ boolean ignoreThis = true; // object has not been exported
}
catch( RemoteException e )
{
From mcconnell at mail.berlios.de Sun Dec 3 02:10:31 2006
From: mcconnell at mail.berlios.de (mcconnell at BerliOS)
Date: Sun, 3 Dec 2006 08:10:31 +0100
Subject: r1795 - in trunk/tutorials/components/unit/src: main/acme
test/acme/test
Message-ID: <200612030710.kB37AVKv015472@sheep.berlios.de>
Author: mcconnell
Date: 2006-12-03 08:10:30 +0100 (Sun, 03 Dec 2006)
New Revision: 1795
Modified:
trunk/tutorials/components/unit/src/main/acme/Child.java
trunk/tutorials/components/unit/src/main/acme/ChildImpl.java
trunk/tutorials/components/unit/src/main/acme/Container.java
trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java
trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java
Log:
Update unit test example to include copyright attribution and formalization with respect to style guidelines.
Modified: trunk/tutorials/components/unit/src/main/acme/Child.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/Child.java 2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/main/acme/Child.java 2006-12-03 07:10:30 UTC (rev 1795)
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2006 Juan Pablo Rojas Jim?nez.
+ * Copyright 2006 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 acme;
import java.net.URI;
Modified: trunk/tutorials/components/unit/src/main/acme/ChildImpl.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/ChildImpl.java 2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/main/acme/ChildImpl.java 2006-12-03 07:10:30 UTC (rev 1795)
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2006 Juan Pablo Rojas Jim?nez.
+ * Copyright 2006 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 acme;
import java.net.URI;
@@ -5,31 +23,37 @@
public class ChildImpl implements Child
{
- private boolean started;
- private Logger logger;
+ private boolean m_started;
+ private Logger m_logger;
- public ChildImpl( Logger logger )
+ public ChildImpl( final Logger logger )
{
- this.started = false;
- this.logger = logger;
+ m_started = false;
+ m_logger = logger;
}
- public void start( URI configurationURI ) throws Exception {
- if ( !this.started ){
- this.started = true;
- this.logger.info( "starting with: " + configurationURI );
- } else {
+ public void start( final URI uri ) throws Exception
+ {
+ if( !m_started )
+ {
+ m_started = true;
+ m_logger.info( "starting with: " + uri );
+ }
+ else
+ {
throw new Exception( "already started!" );
}
}
- public void stop() throws Exception {
- if ( this.started ){
- this.started = false;
- this.logger.info( "stopping" );
- } else {
- throw new Exception("not started!" );
+ public void stop() throws Exception
+ {
+ if ( m_started ){
+ m_started = false;
+ m_logger.info( "stopping" );
+ }
+ else
+ {
+ throw new Exception( "Not started!" );
}
}
-
}
Modified: trunk/tutorials/components/unit/src/main/acme/Container.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/Container.java 2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/main/acme/Container.java 2006-12-03 07:10:30 UTC (rev 1795)
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2006 Juan Pablo Rojas Jim?nez.
+ * Copyright 2006 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 acme;
public interface Container
Modified: trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java 2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java 2006-12-03 07:10:30 UTC (rev 1795)
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2006 Juan Pablo Rojas Jim?nez.
+ * Copyright 2006 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 acme;
import java.net.URI;
Modified: trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java
===================================================================
--- trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java 2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java 2006-12-03 07:10:30 UTC (rev 1795)
@@ -45,11 +45,10 @@
m_logger.info( "decommissioning" );
Disposable disposable = (Disposable) m_component;
disposable.dispose();
- System.gc();
}
/**
- * The Component instance exposes a buch of management operations. One
+ * The Component instance exposes a bunch of management operations. One
* of these is the operation getProvider() which gives us access to
* the manager of one instance of the class specificed by the component
* type. The provider exposes the operation getValue( boolean ) which
@@ -66,7 +65,7 @@
Provider provider = m_component.getProvider();
ContainerImpl container = (ContainerImpl) provider.getValue( false );
- // Any tests dealing with the instance would go here.
+ // Any test assertions go here.
}
/**
From mcconnell at mail.berlios.de Sun Dec 3 02:11:09 2006
From: mcconnell at mail.berlios.de (mcconnell at BerliOS)
Date: Sun, 3 Dec 2006 08:11:09 +0100
Subject: r1796 - in trunk/central/site: . src/docs/metro/tutorials
src/docs/metro/tutorials/unit
Message-ID: <200612030711.kB37B9J0015511@sheep.berlios.de>
Author: mcconnell
Date: 2006-12-03 08:11:08 +0100 (Sun, 03 Dec 2006)
New Revision: 1796
Added:
trunk/central/site/src/docs/metro/tutorials/unit/
trunk/central/site/src/docs/metro/tutorials/unit/index.xml
trunk/central/site/src/docs/metro/tutorials/unit/navigation.xml
Modified:
trunk/central/site/build.xml
trunk/central/site/src/docs/metro/tutorials/navigation.xml
Log:
add unit test for components
Modified: trunk/central/site/build.xml
===================================================================
--- trunk/central/site/build.xml 2006-12-03 07:10:30 UTC (rev 1795)
+++ trunk/central/site/build.xml 2006-12-03 07:11:08 UTC (rev 1796)
@@ -287,6 +287,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
Modified: trunk/central/site/src/docs/metro/tutorials/navigation.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/navigation.xml 2006-12-03 07:10:30 UTC (rev 1795)
+++ trunk/central/site/src/docs/metro/tutorials/navigation.xml 2006-12-03 07:11:08 UTC (rev 1796)
@@ -35,6 +35,7 @@
+