Skip to Content.
Sympa Menu

notify-dpml - r1374 - in trunk/main: . depot/library/etc/test/samples depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl metro

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: r1374 - in trunk/main: . depot/library/etc/test/samples depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl metro
  • Date: Fri, 14 Apr 2006 11:03:17 +0200

Author: mcconnell
Date: 2006-04-14 11:02:43 +0200 (Fri, 14 Apr 2006)
New Revision: 1374

Added:
trunk/main/depot/library/etc/test/samples/properties.xml

trunk/main/depot/library/src/test/net/dpml/library/impl/PropertiesTestCase.java
Modified:
trunk/main/depot/library/etc/test/samples/absolute.xml
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultModule.java

trunk/main/depot/library/src/test/net/dpml/library/impl/AbsoluteTestCase.java
trunk/main/library.xml
trunk/main/metro/module.xml
Log:
Resolve redundant property assertions in module export.

Modified: trunk/main/depot/library/etc/test/samples/absolute.xml
===================================================================
--- trunk/main/depot/library/etc/test/samples/absolute.xml 2006-04-14
07:53:03 UTC (rev 1373)
+++ trunk/main/depot/library/etc/test/samples/absolute.xml 2006-04-14
09:02:43 UTC (rev 1374)
@@ -6,6 +6,7 @@
<modules>
<module name="gov/nsa/acme">
<info/>
+ <resource name="widget/gizmo"/>
</module>
</modules>


Added: trunk/main/depot/library/etc/test/samples/properties.xml
===================================================================
--- trunk/main/depot/library/etc/test/samples/properties.xml 2006-04-14
07:53:03 UTC (rev 1373)
+++ trunk/main/depot/library/etc/test/samples/properties.xml 2006-04-14
09:02:43 UTC (rev 1374)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<library xmlns="@MODULE-XSD-URI@"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xmlns:part="artifact:xsd:dpml/lang/dpml-part#1.0">
+
+ <modules>
+ <module name="org">
+ <properties>
+ <property name="ping" value="pong"/>
+ <property name="batman" value="robin"/>
+ </properties>
+ <module name="acme">
+ <properties>
+ <property name="foo" value="bar"/>
+ </properties>
+ </module>
+ </module>
+ </modules>
+
+</library>

Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultModule.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultModule.java
2006-04-14 07:53:03 UTC (rev 1373)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultModule.java
2006-04-14 09:02:43 UTC (rev 1374)
@@ -411,8 +411,8 @@
InfoDirective info = m_directive.getInfoDirective();
TypeDirective[] types = m_directive.getTypeDirectives();
TypeDirective[] exportedTypes = createExportedTypes( types );
- Properties properties = module.getExportProperties();
-
+ //Properties properties = module.getExportProperties(); // <-- why
the module?
+ Properties properties = getExportProperties();
return new ModuleDirective(
name, version, Classifier.EXTERNAL, basedir,
info, exportedTypes, new DependencyDirective[0],

Modified:
trunk/main/depot/library/src/test/net/dpml/library/impl/AbsoluteTestCase.java
===================================================================
---
trunk/main/depot/library/src/test/net/dpml/library/impl/AbsoluteTestCase.java
2006-04-14 07:53:03 UTC (rev 1373)
+++
trunk/main/depot/library/src/test/net/dpml/library/impl/AbsoluteTestCase.java
2006-04-14 09:02:43 UTC (rev 1374)
@@ -21,6 +21,7 @@
import java.io.File;

import net.dpml.library.Module;
+import net.dpml.library.Resource;

import net.dpml.util.Logger;
import net.dpml.util.DefaultLogger;
@@ -68,4 +69,18 @@
Module nsa = m_library.getModule( "gov/nsa" );
Module acme = m_library.getModule( "gov/nsa/acme" );
}
+
+ /**
+ * Validation of a nested resource path expansion. The resource defintion
+ * includes a path in the form "widget/gizmo" under the module
"gov/nsa/acme"
+ * which should be expanded to a structure containing the "gov" module,
+ * containing the "nsa" module, containing the "acme" module, containing
+ * the wiget module containing the gizmo resource.
+ * @exception Exception if an error occurs during test execution
+ */
+ public void testNestedResource() throws Exception
+ {
+ Module widget = m_library.getModule( "gov/nsa/acme/widget" );
+ Resource gizmo = widget.getResource( "gizmo" );
+ }
}

Added:
trunk/main/depot/library/src/test/net/dpml/library/impl/PropertiesTestCase.java
===================================================================
---
trunk/main/depot/library/src/test/net/dpml/library/impl/PropertiesTestCase.java
2006-04-14 07:53:03 UTC (rev 1373)
+++
trunk/main/depot/library/src/test/net/dpml/library/impl/PropertiesTestCase.java
2006-04-14 09:02:43 UTC (rev 1374)
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ * 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.library.impl;
+
+import java.io.File;
+
+import net.dpml.library.Module;
+import net.dpml.library.Resource;
+
+import net.dpml.util.Logger;
+import net.dpml.util.DefaultLogger;
+
+import junit.framework.TestCase;
+
+/**
+ * The ImportDirective class describes a the inclusion of a typed value.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public final class PropertiesTestCase extends AbstractTestCase
+{
+ static
+ {
+ System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
+ }
+
+ private DefaultLibrary m_library;
+
+ /**
+ * Setup the library directive builder.
+ * @exception Exception if an error occurs during test execution
+ */
+ public void setUp() throws Exception
+ {
+ String base = System.getProperty( "project.test.dir" );
+ File test = new File( base );
+ File file = new File( test, "samples/properties.xml" );
+ Logger logger = new DefaultLogger( "test" );
+ m_library = new DefaultLibrary( logger, file );
+ }
+
+ /**
+ * Test the integrity of the local properties.
+ * @exception Exception if an error occurs during test execution
+ */
+ public void testRootModuleProperties() throws Exception
+ {
+ DefaultModule acme = m_library.getDefaultModule( "org" );
+ String[] names = acme.getLocalPropertyNames();
+ assertEquals( "count", 2, names.length );
+ }
+
+ /**
+ * Test the integrity of the local properties.
+ * @exception Exception if an error occurs during test execution
+ */
+ public void testNestedModuleProperties() throws Exception
+ {
+ DefaultModule acme = m_library.getDefaultModule( "org/acme" );
+ String[] names = acme.getLocalPropertyNames();
+ assertEquals( "count", 1, names.length );
+ }
+}

Modified: trunk/main/library.xml
===================================================================
--- trunk/main/library.xml 2006-04-14 07:53:03 UTC (rev 1373)
+++ trunk/main/library.xml 2006-04-14 09:02:43 UTC (rev 1374)
@@ -41,11 +41,7 @@
<import file="station/module.xml"/>
<import file="planet/module.xml"/>

- <project name="central" basedir="central">
- <properties>
- <property name="project.docs.home.path" value="about/index.html"/>
- </properties>
- </project>
+ <project name="central" basedir="central"/>

</module>


Modified: trunk/main/metro/module.xml
===================================================================
--- trunk/main/metro/module.xml 2006-04-14 07:53:03 UTC (rev 1373)
+++ trunk/main/metro/module.xml 2006-04-14 09:02:43 UTC (rev 1374)
@@ -135,11 +135,12 @@
</project>

<project name="dpml-metro-tools" basedir="tools">
- <properties>
- <property name="project.title" value="Metro Tools"/>
- <property name="project.description"
- value="DPML extensions supporting the Ant build system for component
type and deployment data management."/>
- </properties>
+ <info>
+ <description title="DPML Metro Tools">
+ DPML extensions supporting the Ant build system for component
+ type and deployment data management
+ </description>
+ </info>
<types>
<type id="jar"/>
<part:resource alias="true" urn="dpml:metro"




  • r1374 - in trunk/main: . depot/library/etc/test/samples depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl metro, mcconnell at BerliOS, 04/14/2006

Archive powered by MHonArc 2.6.24.

Top of Page