notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1628 - in trunk/tutorials/tooling/complex: . build/api build/api/src build/api/src/main build/api/src/main/org build/api/src/main/org/acme build/impl build/impl/src build/impl/src/main build/impl/src/main/org build/impl/src/main/org/acme build/impl/src/main/org/acme/impl build/impl/src/test build/impl/src/test/org build/impl/src/test/org/acme build/impl/src/test/org/acme/impl build/impl/src/test/org/acme/impl/test export modules
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1628 - in trunk/tutorials/tooling/complex: . build/api build/api/src build/api/src/main build/api/src/main/org build/api/src/main/org/acme build/impl build/impl/src build/impl/src/main build/impl/src/main/org build/impl/src/main/org/acme build/impl/src/main/org/acme/impl build/impl/src/test build/impl/src/test/org build/impl/src/test/org/acme build/impl/src/test/org/acme/impl build/impl/src/test/org/acme/impl/test export modules
- Date: Sat, 22 Jul 2006 09:57:14 +0200
Author: mcconnell
Date: 2006-07-22 09:57:11 +0200 (Sat, 22 Jul 2006)
New Revision: 1628
Added:
trunk/tutorials/tooling/complex/build/api/src/
trunk/tutorials/tooling/complex/build/api/src/main/
trunk/tutorials/tooling/complex/build/api/src/main/org/
trunk/tutorials/tooling/complex/build/api/src/main/org/acme/
trunk/tutorials/tooling/complex/build/api/src/main/org/acme/Clock.java
trunk/tutorials/tooling/complex/build/impl/src/
trunk/tutorials/tooling/complex/build/impl/src/main/
trunk/tutorials/tooling/complex/build/impl/src/main/org/
trunk/tutorials/tooling/complex/build/impl/src/main/org/acme/
trunk/tutorials/tooling/complex/build/impl/src/main/org/acme/impl/
trunk/tutorials/tooling/complex/build/impl/src/main/org/acme/impl/SimpleClock.java
trunk/tutorials/tooling/complex/build/impl/src/test/
trunk/tutorials/tooling/complex/build/impl/src/test/org/
trunk/tutorials/tooling/complex/build/impl/src/test/org/acme/
trunk/tutorials/tooling/complex/build/impl/src/test/org/acme/impl/
trunk/tutorials/tooling/complex/build/impl/src/test/org/acme/impl/test/
trunk/tutorials/tooling/complex/build/impl/src/test/org/acme/impl/test/DemoTestCase.java
trunk/tutorials/tooling/complex/export/
trunk/tutorials/tooling/complex/export/index.xml
trunk/tutorials/tooling/complex/modules/
trunk/tutorials/tooling/complex/modules/index.xml
Log:
add multi-project demos
Added: trunk/tutorials/tooling/complex/build/api/src/main/org/acme/Clock.java
===================================================================
--- trunk/tutorials/tooling/complex/build/api/src/main/org/acme/Clock.java
2006-07-22 07:52:55 UTC (rev 1627)
+++ trunk/tutorials/tooling/complex/build/api/src/main/org/acme/Clock.java
2006-07-22 07:57:11 UTC (rev 1628)
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+/**
+ * Clock interface.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface Clock
+{
+ String getTimestamp();
+}
Added:
trunk/tutorials/tooling/complex/build/impl/src/main/org/acme/impl/SimpleClock.java
===================================================================
---
trunk/tutorials/tooling/complex/build/impl/src/main/org/acme/impl/SimpleClock.java
2006-07-22 07:52:55 UTC (rev 1627)
+++
trunk/tutorials/tooling/complex/build/impl/src/main/org/acme/impl/SimpleClock.java
2006-07-22 07:57:11 UTC (rev 1628)
@@ -0,0 +1,66 @@
+/*
+ * 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.impl;
+
+import java.util.Date;
+import java.util.Locale;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import org.acme.Clock;
+
+/**
+ * A minimal implementation of a clock.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class SimpleClock implements Clock
+{
+ //------------------------------------------------------------------
+ // 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/complex/build/impl/src/test/org/acme/impl/test/DemoTestCase.java
===================================================================
---
trunk/tutorials/tooling/complex/build/impl/src/test/org/acme/impl/test/DemoTestCase.java
2006-07-22 07:52:55 UTC (rev 1627)
+++
trunk/tutorials/tooling/complex/build/impl/src/test/org/acme/impl/test/DemoTestCase.java
2006-07-22 07:57:11 UTC (rev 1628)
@@ -0,0 +1,48 @@
+/*
+ * 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.impl.test;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+import junit.framework.TestCase;
+
+import org.acme.Clock;
+import org.acme.impl.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/complex/export/index.xml
===================================================================
--- trunk/tutorials/tooling/complex/export/index.xml 2006-07-22 07:52:55
UTC (rev 1627)
+++ trunk/tutorials/tooling/complex/export/index.xml 2006-07-22 07:57:11
UTC (rev 1628)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
+
+ <module name="org/acme" basedir=".">
+
+ <types>
+ <type id="module" version="1.0"/>
+ </types>
+
+ <project name="widget" basedir="widget"/>
+
+ <project name="gizmo" basedir="gizmo">
+ <dependencies>
+ <build>
+ <include key="widget"/>
+ </build>
+ </dependencies>
+ </project>
+
+ </module>
+
+</index>
Added: trunk/tutorials/tooling/complex/modules/index.xml
===================================================================
--- trunk/tutorials/tooling/complex/modules/index.xml 2006-07-22 07:52:55
UTC (rev 1627)
+++ trunk/tutorials/tooling/complex/modules/index.xml 2006-07-22 07:57:11
UTC (rev 1628)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
+
+ <module name="org/acme" basedir=".">
+
+ <project name="widget" basedir="widget"/>
+
+ <project name="gizmo" basedir="gizmo">
+ <dependencies>
+ <build>
+ <include key="widget"/>
+ </build>
+ </dependencies>
+ </project>
+
+ </module>
+
+</index>
- r1628 - in trunk/tutorials/tooling/complex: . build/api build/api/src build/api/src/main build/api/src/main/org build/api/src/main/org/acme build/impl build/impl/src build/impl/src/main build/impl/src/main/org build/impl/src/main/org/acme build/impl/src/main/org/acme/impl build/impl/src/test build/impl/src/test/org build/impl/src/test/org/acme build/impl/src/test/org/acme/impl build/impl/src/test/org/acme/impl/test export modules, mcconnell at BerliOS, 07/22/2006
Archive powered by MHonArc 2.6.24.