Skip to Content.
Sympa Menu

notify-dpml - r1624 - in trunk/tutorials/tooling: complex/build complex/build/api complex/build/impl simple simple/imports simple/imports/src simple/imports/src/main simple/imports/src/main/org simple/imports/src/main/org/acme simple/imports/src/test simple/imports/src/test/org simple/imports/src/test/org/acme simple/imports/src/test/org/acme/test simple/unit simple/unit/src simple/unit/src/main simple/unit/src/main/org simple/unit/src/main/org/acme simple/unit/src/test simple/unit/src/test/org simple/unit/src/test/org/acme simple/unit/src/test/org/acme/test

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1624 - in trunk/tutorials/tooling: complex/build complex/build/api complex/build/impl simple simple/imports simple/imports/src simple/imports/src/main simple/imports/src/main/org simple/imports/src/main/org/acme simple/imports/src/test simple/imports/src/test/org simple/imports/src/test/org/acme simple/imports/src/test/org/acme/test simple/unit simple/unit/src simple/unit/src/main simple/unit/src/main/org simple/unit/src/main/org/acme simple/unit/src/test simple/unit/src/test/org simple/unit/src/test/org/acme simple/unit/src/test/org/acme/test
  • Date: Sat, 22 Jul 2006 09:43:26 +0200

Author: mcconnell
Date: 2006-07-22 09:43:25 +0200 (Sat, 22 Jul 2006)
New Revision: 1624

Added:
trunk/tutorials/tooling/complex/build/api/
trunk/tutorials/tooling/complex/build/impl/
trunk/tutorials/tooling/simple/imports/
trunk/tutorials/tooling/simple/imports/build.xml
trunk/tutorials/tooling/simple/imports/index.xml
trunk/tutorials/tooling/simple/imports/src/
trunk/tutorials/tooling/simple/imports/src/main/
trunk/tutorials/tooling/simple/imports/src/main/org/
trunk/tutorials/tooling/simple/imports/src/main/org/acme/
trunk/tutorials/tooling/simple/imports/src/main/org/acme/SimpleClock.java
trunk/tutorials/tooling/simple/imports/src/test/
trunk/tutorials/tooling/simple/imports/src/test/org/
trunk/tutorials/tooling/simple/imports/src/test/org/acme/
trunk/tutorials/tooling/simple/imports/src/test/org/acme/test/

trunk/tutorials/tooling/simple/imports/src/test/org/acme/test/DemoTestCase.java
trunk/tutorials/tooling/simple/unit/
trunk/tutorials/tooling/simple/unit/build.xml
trunk/tutorials/tooling/simple/unit/index.xml
trunk/tutorials/tooling/simple/unit/src/
trunk/tutorials/tooling/simple/unit/src/main/
trunk/tutorials/tooling/simple/unit/src/main/org/
trunk/tutorials/tooling/simple/unit/src/main/org/acme/
trunk/tutorials/tooling/simple/unit/src/main/org/acme/SimpleClock.java
trunk/tutorials/tooling/simple/unit/src/test/
trunk/tutorials/tooling/simple/unit/src/test/org/
trunk/tutorials/tooling/simple/unit/src/test/org/acme/
trunk/tutorials/tooling/simple/unit/src/test/org/acme/test/

trunk/tutorials/tooling/simple/unit/src/test/org/acme/test/DemoTestCase.java
Removed:
trunk/tutorials/tooling/complex/build/gizmo/
trunk/tutorials/tooling/complex/build/widget/
Modified:
trunk/tutorials/tooling/complex/build/api/build.xml
trunk/tutorials/tooling/complex/build/impl/build.xml
trunk/tutorials/tooling/complex/build/index.xml
Log:
addition tutorial content dealing with testcases and module imports

Copied: trunk/tutorials/tooling/complex/build/api (from rev 1618,
trunk/tutorials/tooling/complex/build/gizmo)

Modified: trunk/tutorials/tooling/complex/build/api/build.xml
===================================================================
--- trunk/tutorials/tooling/complex/build/gizmo/build.xml 2006-07-20
16:45:13 UTC (rev 1618)
+++ trunk/tutorials/tooling/complex/build/api/build.xml 2006-07-22 07:43:25
UTC (rev 1624)
@@ -1,15 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>

-<project name="demo" default="build">
+<project name="demo" default="install"
+ xmlns:transit="antlib:net.dpml.transit">

- <target name="clean">
- <!-- nothing to do -->
- </target>
+ <transit:import uri="local:template:dpml/tools/standard"/>

- <target name="build">
- <echo message="Executing GIZMO build"/>
- </target>
-
- <target name="install" depends="build"/>
-
</project>

Copied: trunk/tutorials/tooling/complex/build/impl (from rev 1618,
trunk/tutorials/tooling/complex/build/widget)

Modified: trunk/tutorials/tooling/complex/build/impl/build.xml
===================================================================
--- trunk/tutorials/tooling/complex/build/widget/build.xml 2006-07-20
16:45:13 UTC (rev 1618)
+++ trunk/tutorials/tooling/complex/build/impl/build.xml 2006-07-22
07:43:25 UTC (rev 1624)
@@ -1,15 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>

-<project name="demo" default="build">
+<project name="demo" default="install"
+ xmlns:transit="antlib:net.dpml.transit">

- <target name="clean">
- <!-- nothing to do -->
- </target>
+ <transit:import uri="local:template:dpml/tools/standard"/>

- <target name="build">
- <echo message="Executing WIDGET build"/>
- </target>
-
- <target name="install" depends="build"/>
-
</project>

Modified: trunk/tutorials/tooling/complex/build/index.xml
===================================================================
--- trunk/tutorials/tooling/complex/build/index.xml 2006-07-22 07:35:01
UTC (rev 1623)
+++ trunk/tutorials/tooling/complex/build/index.xml 2006-07-22 07:43:25
UTC (rev 1624)
@@ -1,13 +1,30 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">

- <project name="widget" basedir="widget"/>
+ <imports>
+ <import uri="link:module:junit"/>
+ <import uri="link:module:ant"/>
+ <import uri="link:module:dpml"/>
+ </imports>
+
+ <project name="clock-api" basedir="api">
+ <types>
+ <type id="jar"/>
+ </types>
+ </project>

- <project name="gizmo" basedir="gizmo">
+ <project name="clock-impl" basedir="impl">
+ <types>
+ <type id="jar"/>
+ </types>
<dependencies>
- <build>
- <include key="widget"/>
- </build>
+ <runtime>
+ <include key="clock-api"/>
+ </runtime>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
</dependencies>
</project>



Property changes on: trunk/tutorials/tooling/simple/imports
___________________________________________________________________
Name: svn:ignore
+ target


Added: trunk/tutorials/tooling/simple/imports/build.xml
===================================================================
--- trunk/tutorials/tooling/simple/imports/build.xml 2006-07-22 07:35:01
UTC (rev 1623)
+++ trunk/tutorials/tooling/simple/imports/build.xml 2006-07-22 07:43:25
UTC (rev 1624)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="demo" default="install"
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+</project>

Added: trunk/tutorials/tooling/simple/imports/index.xml
===================================================================
--- trunk/tutorials/tooling/simple/imports/index.xml 2006-07-22 07:35:01
UTC (rev 1623)
+++ trunk/tutorials/tooling/simple/imports/index.xml 2006-07-22 07:43:25
UTC (rev 1624)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
+
+ <imports>
+ <import uri="link:module:ant"/>
+ </imports>
+
+ <project name="demo" basedir=".">
+ <properties>
+ <property name="location" value="New York"/>
+ <property name="message" value="Hello from ${user.name} in
${location}"/>
+ </properties>
+ <types>
+ <type id="jar"/>
+ </types>
+ <dependencies>
+ <test>
+ <include ref="ant/ant-junit"/>
+ </test>
+ </dependencies>
+ <filters>
+ <filter token="MESSAGE" value="${message}"/>
+ </filters>
+ </project>
+
+</index>

Added:
trunk/tutorials/tooling/simple/imports/src/main/org/acme/SimpleClock.java
===================================================================
--- trunk/tutorials/tooling/simple/imports/src/main/org/acme/SimpleClock.java
2006-07-22 07:35:01 UTC (rev 1623)
+++ trunk/tutorials/tooling/simple/imports/src/main/org/acme/SimpleClock.java
2006-07-22 07:43:25 UTC (rev 1624)
@@ -0,0 +1,64 @@
+/*
+ * 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 org.acme;
+
+import java.util.Date;
+import java.util.Locale;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * A minimal implementation of a clock.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class SimpleClock
+{
+ //------------------------------------------------------------------
+ // static
+ //------------------------------------------------------------------
+
+ private static final String DEFAULT_PATTERN = "K:mm a, z";
+ private static final Locale DEFAULT_LOCALE = Locale.getDefault();
+
+ //------------------------------------------------------------------
+ // Clock
+ //------------------------------------------------------------------
+
+ /**
+ * Return the current time as a formatted string.
+ * @return the current time as a string
+ */
+ public String getTimestamp()
+ {
+ Date date = new Date();
+ DateFormat formatter = getDateFormatter();
+ return formatter.format( date );
+ }
+
+ //------------------------------------------------------------------
+ // implementation
+ //------------------------------------------------------------------
+
+ private DateFormat getDateFormatter()
+ {
+ return new SimpleDateFormat( DEFAULT_PATTERN, DEFAULT_LOCALE );
+ }
+}

Added:
trunk/tutorials/tooling/simple/imports/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/tutorials/tooling/simple/imports/src/test/org/acme/test/DemoTestCase.java
2006-07-22 07:35:01 UTC (rev 1623)
+++
trunk/tutorials/tooling/simple/imports/src/test/org/acme/test/DemoTestCase.java
2006-07-22 07:43:25 UTC (rev 1624)
@@ -0,0 +1,47 @@
+/*
+ * 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 org.acme.test;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+import junit.framework.TestCase;
+
+import org.acme.SimpleClock;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Just log the timestamp to the test output.
+ * @exception Exception if an error occurs
+ */
+ public void testTheClock() throws Exception
+ {
+ SimpleClock clock = new SimpleClock();
+ String timestamp = clock.getTimestamp();
+ Logger logger = Logger.getLogger( "test" );
+ logger.info( timestamp );
+ }
+}

Added: trunk/tutorials/tooling/simple/unit/build.xml
===================================================================
--- trunk/tutorials/tooling/simple/unit/build.xml 2006-07-22 07:35:01
UTC (rev 1623)
+++ trunk/tutorials/tooling/simple/unit/build.xml 2006-07-22 07:43:25
UTC (rev 1624)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="demo" default="install"
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+</project>

Added: trunk/tutorials/tooling/simple/unit/index.xml
===================================================================
--- trunk/tutorials/tooling/simple/unit/index.xml 2006-07-22 07:35:01
UTC (rev 1623)
+++ trunk/tutorials/tooling/simple/unit/index.xml 2006-07-22 07:43:25
UTC (rev 1624)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
+
+ <project name="demo" basedir=".">
+ <properties>
+ <property name="location" value="New York"/>
+ <property name="message" value="Hello from ${user.name} in
${location}"/>
+ </properties>
+ <types>
+ <type id="jar"/>
+ </types>
+ <dependencies>
+ <test>
+ <include uri="artifact:jar:ant/ant-junit#1.6.5"/>
+ <include uri="artifact:jar:ant/ant#1.6.5"/>
+ <include uri="artifact:jar:junit/junit#3.8.1"/>
+ </test>
+ </dependencies>
+ <filters>
+ <filter token="MESSAGE" value="${message}"/>
+ </filters>
+ </project>
+
+</index>

Added: trunk/tutorials/tooling/simple/unit/src/main/org/acme/SimpleClock.java
===================================================================
--- trunk/tutorials/tooling/simple/unit/src/main/org/acme/SimpleClock.java
2006-07-22 07:35:01 UTC (rev 1623)
+++ trunk/tutorials/tooling/simple/unit/src/main/org/acme/SimpleClock.java
2006-07-22 07:43:25 UTC (rev 1624)
@@ -0,0 +1,64 @@
+/*
+ * 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 org.acme;
+
+import java.util.Date;
+import java.util.Locale;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * A minimal implementation of a clock.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class SimpleClock
+{
+ //------------------------------------------------------------------
+ // static
+ //------------------------------------------------------------------
+
+ private static final String DEFAULT_PATTERN = "K:mm a, z";
+ private static final Locale DEFAULT_LOCALE = Locale.getDefault();
+
+ //------------------------------------------------------------------
+ // Clock
+ //------------------------------------------------------------------
+
+ /**
+ * Return the current time as a formatted string.
+ * @return the current time as a string
+ */
+ public String getTimestamp()
+ {
+ Date date = new Date();
+ DateFormat formatter = getDateFormatter();
+ return formatter.format( date );
+ }
+
+ //------------------------------------------------------------------
+ // implementation
+ //------------------------------------------------------------------
+
+ private DateFormat getDateFormatter()
+ {
+ return new SimpleDateFormat( DEFAULT_PATTERN, DEFAULT_LOCALE );
+ }
+}

Added:
trunk/tutorials/tooling/simple/unit/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/tutorials/tooling/simple/unit/src/test/org/acme/test/DemoTestCase.java
2006-07-22 07:35:01 UTC (rev 1623)
+++
trunk/tutorials/tooling/simple/unit/src/test/org/acme/test/DemoTestCase.java
2006-07-22 07:43:25 UTC (rev 1624)
@@ -0,0 +1,47 @@
+/*
+ * 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 org.acme.test;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+import junit.framework.TestCase;
+
+import org.acme.SimpleClock;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Just log the timestamp to the test output.
+ * @exception Exception if an error occurs
+ */
+ public void testTheClock() throws Exception
+ {
+ SimpleClock clock = new SimpleClock();
+ String timestamp = clock.getTimestamp();
+ Logger logger = Logger.getLogger( "test" );
+ logger.info( timestamp );
+ }
+}




  • r1624 - in trunk/tutorials/tooling: complex/build complex/build/api complex/build/impl simple simple/imports simple/imports/src simple/imports/src/main simple/imports/src/main/org simple/imports/src/main/org/acme simple/imports/src/test simple/imports/src/test/org simple/imports/src/test/org/acme simple/imports/src/test/org/acme/test simple/unit simple/unit/src simple/unit/src/main simple/unit/src/main/org simple/unit/src/main/org/acme simple/unit/src/test simple/unit/src/test/org simple/unit/src/test/org/acme simple/unit/src/test/org/acme/test, mcconnell at BerliOS, 07/22/2006

Archive powered by MHonArc 2.6.24.

Top of Page