notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2159 - in development/planet/users/niclas/processing/nested-test: . src src/test src/test/net src/test/net/dpml src/test/net/dpml/processing src/test/net/dpml/processing/controller src/test/net/dpml/processing/controller/test
- From: niclas AT hedhman.org
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2159 - in development/planet/users/niclas/processing/nested-test: . src src/test src/test/net src/test/net/dpml src/test/net/dpml/processing src/test/net/dpml/processing/controller src/test/net/dpml/processing/controller/test
- Date: Sun, 27 Mar 2005 14:09:30 -0500
Author: niclas AT hedhman.org
Date: Sun Mar 27 14:09:30 2005
New Revision: 2159
Added:
development/planet/users/niclas/processing/nested-test/
development/planet/users/niclas/processing/nested-test/build.xml
(contents, props changed)
development/planet/users/niclas/processing/nested-test/src/
development/planet/users/niclas/processing/nested-test/src/test/
development/planet/users/niclas/processing/nested-test/src/test/net/
development/planet/users/niclas/processing/nested-test/src/test/net/dpml/
development/planet/users/niclas/processing/nested-test/src/test/net/dpml/processing/
development/planet/users/niclas/processing/nested-test/src/test/net/dpml/processing/controller/
development/planet/users/niclas/processing/nested-test/src/test/net/dpml/processing/controller/test/
development/planet/users/niclas/processing/nested-test/src/test/net/dpml/processing/controller/test/NestedProcessTest.java
(contents, props changed)
Log:
Stuff I forgot to commit earlier... Hmmm?
Added: development/planet/users/niclas/processing/nested-test/build.xml
==============================================================================
--- (empty file)
+++ development/planet/users/niclas/processing/nested-test/build.xml Sun
Mar 27 14:09:30 2005
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2005 Niclas Hedhman
+
+ 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.
+-->
+
+<project name="dpml-processing-nestedtest" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+>
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="build" depends="standard.build">
+ <x:property name="test-block" feature="uri" key="dpml-processing-test" />
+
+ <x:block name="outer" embed="MAIN">
+ <x:component name="controller"
class="net.dpml.processing.controller.NestedController" >
+ <x:dependencies>
+ <x:dependency key="initial-activity" source="start" />
+ <x:dependency key="tracking" source="main/tracking" />
+ </x:dependencies>
+ </x:component>
+
+ <x:component name="start"
class="net.dpml.processing.controller.test.Start" >
+ <x:dependencies>
+ <x:dependency key="outcome1" source="main" />
+ <x:dependency key="tracking" source="main/tracking" />
+ </x:dependencies>
+ </x:component>
+
+ <x:include name="main" uri="${test-block}" />
+
+ <x:component name="main-succeeded"
class="net.dpml.processing.controller.test.Step" >
+ <x:dependencies>
+ <x:dependency key="outcome" source="exit" />
+ <x:dependency key="tracking" source="main/tracking" />
+ </x:dependencies>
+ </x:component>
+
+ <x:component name="exit"
class="net.dpml.processing.controller.ExitPoint" />
+
+ </x:block>
+ </target>
+</project>
Added:
development/planet/users/niclas/processing/nested-test/src/test/net/dpml/processing/controller/test/NestedProcessTest.java
==============================================================================
--- (empty file)
+++
development/planet/users/niclas/processing/nested-test/src/test/net/dpml/processing/controller/test/NestedProcessTest.java
Sun Mar 27 14:09:30 2005
@@ -0,0 +1,77 @@
+
+/*
+ * Copyright 2005, Niclas Hedhman
+ *
+ * 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.processing.controller.test;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+import net.dpml.composition.model.ComponentModel;
+import net.dpml.composition.model.ContainmentModel;
+
+import net.dpml.metro.unit.CompositionTestCase;
+
+import net.dpml.transit.artifact.Handler;
+
+import net.dpml.processing.ProcessActivity;
+
+import net.dpml.processing.controller.NestedController;
+
+public class NestedProcessTest extends CompositionTestCase
+{
+ private ComponentModel m_nested;
+ private Tracking m_tracking;
+
+ public void setUp()
+ throws Exception
+ {
+ System.out.println( System.getProperty( "project.dir" ) );
+ System.out.println( System.getProperty( "user.dir" ) );
+ ContainmentModel root = createContainmentModel( "../classes" );
+ root.commission();
+ String path = "controller";
+ m_nested = (ComponentModel) root.getModel( path );
+ path = "main/tracking";
+ ComponentModel tracking = (ComponentModel) root.getModel( path );
+ m_tracking = (Tracking) tracking.resolve();
+ }
+
+
+ public void testSequenceA()
+ throws Exception
+ {
+ // A bit hacky way to pass a parameter to a component, but...
+ System.setProperty( "metro.processing.test.outcome", "1" );
+ ProcessActivity instance = (ProcessActivity) m_nested.resolve();
+ ProcessActivity activity = instance.process();
+ assertNull( "return value", activity );
+
+ String[] visited = m_tracking.getLocations();
+ assertEquals( "/outer/start", visited[ 0 ] );
+ assertEquals( "/outer/main/start", visited[ 1 ] );
+ assertEquals( "/outer/main/step1", visited[ 2 ] );
+ assertEquals( "/outer/main/step3", visited[ 3 ] );
+ assertEquals( "/outer/main-succeeded", visited[ 4 ] );
+ }
+
+}
\ No newline at end of file
- svn commit: r2159 - in development/planet/users/niclas/processing/nested-test: . src src/test src/test/net src/test/net/dpml src/test/net/dpml/processing src/test/net/dpml/processing/controller src/test/net/dpml/processing/controller/test, niclas, 03/27/2005
Archive powered by MHonArc 2.6.24.