Skip to Content.
Sympa Menu

notify-dpml - r1441 - in trunk/main: depot/library/src/main/net/dpml/library depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/library/src/test/net/dpml/library/impl depot/library/src/test/net/dpml/library/info lang/process/etc lang/process/etc/test lang/process/src/main/net/dpml/lang/info lang/process/src/test/net/dpml/lang/info

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: r1441 - in trunk/main: depot/library/src/main/net/dpml/library depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/library/src/test/net/dpml/library/impl depot/library/src/test/net/dpml/library/info lang/process/etc lang/process/etc/test lang/process/src/main/net/dpml/lang/info lang/process/src/test/net/dpml/lang/info
  • Date: Fri, 19 May 2006 06:03:35 +0200

Author: mcconnell
Date: 2006-05-19 06:03:32 +0200 (Fri, 19 May 2006)
New Revision: 1441

Added:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultData.java
trunk/main/lang/process/etc/test/workspace.xml
trunk/main/lang/process/src/main/net/dpml/lang/info/CollectionCriteria.java

trunk/main/lang/process/src/main/net/dpml/lang/info/CollectionDirective.java
trunk/main/lang/process/src/main/net/dpml/lang/info/ProductDirective.java
trunk/main/lang/process/src/main/net/dpml/lang/info/WorkspaceDecoder.java
trunk/main/lang/process/src/main/net/dpml/lang/info/WorkspaceDirective.java
trunk/main/lang/process/src/test/net/dpml/lang/info/WorkspaceTestCase.java
Removed:

trunk/main/depot/library/src/main/net/dpml/library/info/ExcludePatternDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/FiltersDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/GenericDataDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/GenericTypeDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/IncludePatternDirective.java
trunk/main/depot/library/src/main/net/dpml/library/info/JavacDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/PatternDirective.java
trunk/main/depot/library/src/main/net/dpml/library/info/RMICDirective.java
trunk/main/depot/library/src/test/net/dpml/library/impl/RMICTestCase.java

trunk/main/depot/library/src/test/net/dpml/library/info/RMICDirectiveTestCase.java

trunk/main/lang/process/src/main/net/dpml/lang/info/AbstractProductDirective.java
Modified:
trunk/main/depot/library/src/main/net/dpml/library/Data.java
trunk/main/depot/library/src/main/net/dpml/library/Resource.java
trunk/main/depot/library/src/main/net/dpml/library/Type.java
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultModule.java

trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultType.java

trunk/main/depot/library/src/main/net/dpml/library/info/AbstractDirective.java
trunk/main/depot/library/src/main/net/dpml/library/info/DataDirective.java
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryDecoder.java

trunk/main/depot/library/src/main/net/dpml/library/info/ModuleDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
trunk/main/depot/library/src/main/net/dpml/library/info/TypeDirective.java

trunk/main/depot/library/src/test/net/dpml/library/info/ModuleDirectiveTestCase.java

trunk/main/depot/library/src/test/net/dpml/library/info/ResourceDirectiveTestCase.java
trunk/main/lang/process/etc/process.xsd
trunk/main/lang/process/etc/test/sample.xml
trunk/main/lang/process/src/main/net/dpml/lang/info/DirectoryDirective.java
trunk/main/lang/process/src/main/net/dpml/lang/info/FileDirective.java
trunk/main/lang/process/src/main/net/dpml/lang/info/InfoDirective.java
trunk/main/lang/process/src/test/net/dpml/lang/info/ProcessXsdTestCase.java
Log:
sorting depot builder

Modified: trunk/main/depot/library/src/main/net/dpml/library/Data.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/Data.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/depot/library/src/main/net/dpml/library/Data.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -29,15 +29,9 @@
public interface Data
{
/**
- * Return the data type id.
- * @return the datatype id
+ * Return the production datatype.
+ * @return the DOM element
*/
- String getID();
-
- /**
- * Return the datatype criteria.
- * @return the criteria in the form of a DOM element.
- */
Element getElement();
-
+
}

Modified: trunk/main/depot/library/src/main/net/dpml/library/Resource.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/Resource.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/depot/library/src/main/net/dpml/library/Resource.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -191,9 +191,8 @@
String getLayoutPath( String id );

/**
- * Return a data directive matching the supplied key.
- * @param key the datatype key
- * @return the selected datatype or null of unknown
+ * Return the array of production data.
+ * @return the associated production data
*/
- DataDirective getDataDirective( String key );
+ Data[] getData();
}

Modified: trunk/main/depot/library/src/main/net/dpml/library/Type.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/Type.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/depot/library/src/main/net/dpml/library/Type.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -26,7 +26,7 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public interface Type
+public interface Type extends Data
{
/**
* Return the type production id.
@@ -40,11 +40,4 @@
*/
boolean getAlias();

- /**
- * Return the type production datatype.
- * @return the datatytpe
- */
- Element getElement();
-
-
}

Added:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultData.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultData.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultData.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -0,0 +1,58 @@
+/*
+ * 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 net.dpml.library.info.DataDirective;
+import net.dpml.library.Data;
+
+import org.w3c.dom.Element;
+
+/**
+ * Internal exception throw to indicate a bad name reference.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DefaultData extends DefaultDictionary implements Data
+{
+ private final DefaultResource m_resource;
+ private final DataDirective m_directive;
+
+ /**
+ * Creation of a new DefaultData.
+ * @param resource the enclosing resource
+ * @param directive the type production directive
+ */
+ DefaultData( DefaultResource resource, DataDirective directive )
+ {
+ super( resource, directive );
+
+ m_resource = resource;
+ m_directive = directive;
+ }
+
+ /**
+ * Get the DOM element defining the produced datatype.
+ * @return the DOM element
+ */
+ public Element getElement()
+ {
+ return m_directive.getElement();
+ }
+}

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-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultModule.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -414,7 +414,7 @@
return new ModuleDirective(
name, version, Classifier.EXTERNAL, basedir,
info, exportedTypes, new DependencyDirective[0],
- directives, properties, null, null );
+ directives, properties, null );
}


//----------------------------------------------------------------------------

Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -39,6 +39,7 @@
import net.dpml.library.Module;
import net.dpml.library.Resource;
import net.dpml.library.Type;
+import net.dpml.library.Data;
import net.dpml.library.info.DataDirective;
import net.dpml.library.info.InfoDirective;
import net.dpml.library.info.TypeDirective;
@@ -49,7 +50,6 @@
import net.dpml.library.info.AbstractDirective;
import net.dpml.library.info.ValidationException;
import net.dpml.library.info.FilterDirective;
-import net.dpml.library.info.FiltersDirective;
import net.dpml.library.info.Scope;

import net.dpml.util.Logger;
@@ -83,6 +83,7 @@
private final String m_path;
private final File m_basedir;
private final Map m_filters = new Hashtable();
+ private final Data[] m_data;

/**
* Creation of a new default resource.
@@ -101,6 +102,7 @@
m_typeNames = new String[0];
m_path = "";
m_basedir = null;
+ m_data = new Data[0];
}

/**
@@ -131,6 +133,8 @@
m_path = module.getResourcePath() + "/" + directive.getName();
}

+ // setup produced types
+
m_types = buildTypes( directive.getTypeDirectives() );
m_typeNames = new String[ m_types.length ];
for( int i=0; i<m_types.length; i++ )
@@ -139,6 +143,12 @@
m_typeNames[i] = type.getID();
}

+ // setup production data
+
+ m_data = new Data[0];
+
+ // setup the resource basedir
+
File anchor = getAnchor();
String filename = m_directive.getBasedir();
if( null != filename )
@@ -213,13 +223,12 @@

//----------------------------------------------------------------------------

/**
- * Return a data directive matching the supplied key.
- * @param key the datatype key
- * @return the selected datatype or null of unknown
+ * Return a data directives.
+ * @return the associated production data
*/
- public DataDirective getDataDirective( final String key )
+ public Data[] getData()
{
- return m_directive.getDataDirective( key );
+ return m_data;
}

/**
@@ -626,7 +635,7 @@
Properties properties = getExportProperties();
return ResourceDirective.createResourceDirective(
name, version, Classifier.EXTERNAL, basedir,
- info, exportedTypes, dependencies, properties, null, null );
+ info, exportedTypes, dependencies, properties, null );
}

TypeDirective[] createExportedTypes( TypeDirective[] types )

Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultType.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultType.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultType.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -29,7 +29,7 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public class DefaultType extends DefaultDictionary implements Type
+public class DefaultType extends DefaultData implements Type
{
private final DefaultResource m_resource;
private final TypeDirective m_directive;
@@ -65,12 +65,4 @@
return m_directive.getAlias();
}

- /**
- * Get the DOM element defining the produced datatype.
- * @return the DOM element
- */
- public Element getElement()
- {
- return m_directive.getElement();
- }
}

Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/AbstractDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/AbstractDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/AbstractDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -35,6 +35,15 @@
* Creation of a new abstract directive.
* @param properties the properties associated with the directive
*/
+ public AbstractDirective()
+ {
+ this( null );
+ }
+
+ /**
+ * Creation of a new abstract directive.
+ * @param properties the properties associated with the directive
+ */
public AbstractDirective( Properties properties )
{
if( null == properties )

Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/DataDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/DataDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/DataDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -18,7 +18,7 @@

package net.dpml.library.info;

-import net.dpml.lang.AbstractDirective;
+import java.util.Properties;

import org.w3c.dom.Element;

@@ -39,18 +39,25 @@
*/
public DataDirective( Element element )
{
- if( null == element )
- {
- throw new NullPointerException( "element" );
- }
+ super();
m_element = element;
}

/**
+ * Creation of a new data directive using a supplied properties argument.
+ * @param properties associated properties
+ */
+ public DataDirective( Properties properties )
+ {
+ super( properties );
+ m_element = null;
+ }
+
+ /**
* Return the datatype element.
* @return the DOM element
*/
- public String getElement()
+ public Element getElement()
{
return m_element;
}
@@ -65,7 +72,7 @@
if( super.equals( other ) && ( other instanceof DataDirective ) )
{
DataDirective object = (DataDirective) other;
- return m_element.equals( object.m_element );
+ return equals( m_element, object.m_element );
}
else
{
@@ -80,7 +87,7 @@
public int hashCode()
{
int hash = super.hashCode();
- hash ^= m_element.hashCode();
+ hash ^= hashValue( m_element );
return hash;
}
}

Deleted:
trunk/main/depot/library/src/main/net/dpml/library/info/ExcludePatternDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/ExcludePatternDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/ExcludePatternDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,39 +0,0 @@
-/*
- * 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 net.dpml.library.info;
-
-import net.dpml.lang.AbstractDirective;
-
-/**
- * The ExcludePatternDirective identifies an exclusion pattern.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class ExcludePatternDirective extends PatternDirective
-{
- /**
- * Creation of a new exclusion directive.
- * @param name the file to include
- */
- public ExcludePatternDirective( String name )
- {
- super( name );
- }
-}

Deleted:
trunk/main/depot/library/src/main/net/dpml/library/info/FiltersDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/FiltersDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/FiltersDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,86 +0,0 @@
-/*
- * 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.info;
-
-import java.util.Arrays;
-
-/**
- * Datatype describing a collection of filters.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class FiltersDirective extends DataDirective
-{
- /**
- * Reserved key.
- */
- public static final String KEY = "filters";
-
- private final FilterDirective[] m_filters;
-
- /**
- * Creation of a filter collection.
- * @param filters the array of filters
- */
- public FiltersDirective( FilterDirective[] filters )
- {
- super( "filters" );
-
- m_filters = filters;
- }
-
- /**
- * Return the filter array.
- * @return the filters
- */
- public FilterDirective[] getFilterDirectives()
- {
- return m_filters;
- }
-
- /**
- * Compare this object with another for equality.
- * @param other the other object
- * @return true if equal
- */
- public boolean equals( Object other )
- {
- if( super.equals( other ) && ( other instanceof FiltersDirective ) )
- {
- FiltersDirective directive = (FiltersDirective) other;
- return Arrays.equals( m_filters, directive.m_filters );
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Compute the hash value.
- * @return the hashcode value
- */
- public int hashCode()
- {
- int hash = super.hashCode();
- hash ^= super.hashArray( m_filters );
- return hash;
- }
-}

Deleted:
trunk/main/depot/library/src/main/net/dpml/library/info/GenericDataDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/GenericDataDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/GenericDataDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,66 +0,0 @@
-/*
- * 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.info;
-
-import net.dpml.lang.AbstractDirective;
-
-import org.w3c.dom.Element;
-
-/**
- * Generic data directives.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class GenericDataDirective extends DataDirective
-{
- private final Element m_element;
-
- /**
- * Creation of a new generic data directive.
- * @param element the definining element
- */
- public GenericDataDirective( Element element )
- {
- super( getElementID( element ) );
-
- m_element = element;
- }
-
- /**
- * Return the element defining this datatype.
- * @return the DOM element
- */
- public Element getElement()
- {
- return m_element;
- }
-
- private static String getElementID( Element element )
- {
- if( null == element )
- {
- throw new NullPointerException( "element" );
- }
- else
- {
- return element.getTagName();
- }
- }
-}

Deleted:
trunk/main/depot/library/src/main/net/dpml/library/info/GenericTypeDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/GenericTypeDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/GenericTypeDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,102 +0,0 @@
-/*
- * 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.info;
-
-import java.util.Properties;
-
-import org.w3c.dom.Element;
-
-/**
- * Definition of a generic type production assertion.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public final class GenericTypeDirective extends TypeDirective
-{
- private final Properties m_properties;
-
- /**
- * Creation of a new generic type directive.
- * @param element the DOM element definition
- * @param id the type identifier
- */
- public GenericTypeDirective( Element element, String id, Properties
properties )
- {
- this( element, id, false, properties );
- }
-
- /**
- * Creation of a new generic type directive.
- * @param element the DOM element definition
- * @param id the type identifier
- * @param alias alias production policy
- */
- public GenericTypeDirective( Element element, String id, boolean alias,
Properties properties )
- {
- super( element, id, alias );
-
- if( null == properties )
- {
- m_properties = new Properties();
- }
- else
- {
- m_properties = properties;
- }
- }
-
- /**
- * Return the associated type properties.
- * @return the properties
- */
- public Properties getProperties()
- {
- return m_properties;
- }
-
- /**
- * Compare this object with another for equality.
- * @param other the other object
- * @return true if equal
- */
- public boolean equals( Object other )
- {
- if( super.equals( other ) && ( other instanceof GenericTypeDirective
) )
- {
- GenericTypeDirective object = (GenericTypeDirective) other;
- return m_properties.equals( object.m_properties );
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Compute the hash value.
- * @return the hashcode value
- */
- public int hashCode()
- {
- int hash = super.hashCode();
- hash ^= m_properties.hashCode();
- return hash;
- }
-}

Deleted:
trunk/main/depot/library/src/main/net/dpml/library/info/IncludePatternDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/IncludePatternDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/IncludePatternDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,39 +0,0 @@
-/*
- * 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.info;
-
-import net.dpml.lang.AbstractDirective;
-
-/**
- * The IncludePatternDirective identifies an inclusion pattern.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class IncludePatternDirective extends PatternDirective
-{
- /**
- * Creation of a new inclusion directive.
- * @param name the file to include
- */
- public IncludePatternDirective( String name )
- {
- super( name );
- }
-}

Deleted:
trunk/main/depot/library/src/main/net/dpml/library/info/JavacDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/JavacDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/JavacDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,44 +0,0 @@
-/*
- * 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.info;
-
-import net.dpml.lang.AbstractDirective;
-
-/**
- * Definition of the RMIC compilation criteria.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public abstract class JavacDirective extends DataCollectionDirective
-{
- /**
- * Reserved datatype key.
- */
- public static final String KEY = "compile-main";
-
- /**
- * Creation of a new data directive.
- * @param key the unique datatype key
- */
- public JavacDirective( String key, PatternDirective[] patterns )
- {
- super( key, patterns );
- }
-}

Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryDecoder.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryDecoder.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/LibraryDecoder.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,4 +1,5 @@
/*
+/*
* Copyright 2005 Stephen J. McConnell
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -588,8 +589,8 @@
buildInfoDirective(
ElementHelper.getChild( element, "info" ) );

- final TypeDirective[] types =
- buildTypes(
+ final DataDirective[] data =
+ buildDataTypes(
ElementHelper.getChild( element, "types" ) );

final DependencyDirective[] dependencies =
@@ -600,10 +601,6 @@
buildFilterDirectives(
ElementHelper.getChild( element, "filters" ) );

- final DataDirective[] data =
- buildDataDirectives(
- ElementHelper.getChild( element, "data" ) );
-
final Properties properties =
buildProperties(
ElementHelper.getChild( element, "properties" ) );
@@ -630,14 +627,14 @@
ResourceDirective[] resources =
(ResourceDirective[]) list.toArray( new
ResourceDirective[0] );
return ModuleDirective.createModuleDirective(
- name, version, classifier, basedir, info, types,
dependencies,
- properties, filters, data, resources );
+ name, version, classifier, basedir, info, data,
dependencies,
+ properties, filters, resources );
}
else
{
return ResourceDirective.createResourceDirective(
- name, version, classifier, basedir, info, types,
dependencies,
- properties, filters, data );
+ name, version, classifier, basedir, info, data,
dependencies,
+ properties, filters );
}
}
else
@@ -694,6 +691,7 @@
}
}

+ /*
private DataDirective[] buildDataDirectives( Element element ) throws
Exception
{
Element[] children = ElementHelper.getChildren( element );
@@ -739,7 +737,7 @@
}
else
{
- return new GenericDataDirective( element );
+ return new DataDirective( element );
}
}

@@ -769,6 +767,7 @@
}
return patterns;
}
+ */

private FilterDirective[] buildFilterDirectives( Element element )
throws Exception
{
@@ -854,23 +853,23 @@
}
*/

- private TypeDirective[] buildTypes( Element element ) throws Exception
+ private DataDirective[] buildDataTypes( Element element ) throws
Exception
{
if( null == element )
{
- return new TypeDirective[0];
+ return new DataDirective[0];
}
Element[] children = ElementHelper.getChildren( element );
- TypeDirective[] types = new TypeDirective[ children.length ];
+ DataDirective[] data = new DataDirective[ children.length ];
for( int i=0; i<children.length; i++ )
{
Element child = children[i];
- types[i] = buildType( child );
+ data[i] = buildDataType( child );
}
- return types;
+ return data;
}

- private TypeDirective buildType( Element element ) throws Exception
+ private DataDirective buildDataType( Element element ) throws Exception
{
TypeInfo info = element.getSchemaTypeInfo();
String namespace = info.getTypeNamespace();
@@ -909,13 +908,7 @@
}
else if( "RMICType".equals( typeName ) )
{
- final String error =
- "RMIC element support is not implemented."
- + "\nNamespace: "
- + namespace
- + "\nType: "
- + info.getTypeName();
- throw new DecodingException( element, error );
+ return new DataDirective( element );
}
else
{
@@ -931,18 +924,18 @@
else if( PART_XSD_URI.equals( namespace ) )
{
final boolean alias = getAliasFlag( element );
- return new TypeDirective( "part", alias, element );
+ return new TypeDirective( element, "part", alias );
}
else if( info.isDerivedFrom( COMMON_XSD_URI, "AbstractType",
TypeInfo.DERIVATION_EXTENSION ) )
{
final String id = getID( element );
final boolean alias = getAliasFlag( element );
- return new TypeDirective( id, alias, element );
+ return new TypeDirective( element, id, alias );
}
else
{
final String error =
- "Unsupported element type encountered in tpe directive
production."
+ "Unsupported element type encountered during directive
production."
+ "\nNamespace: "
+ namespace
+ "\nType: "

Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/ModuleDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/ModuleDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/ModuleDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -41,19 +41,17 @@
* @param classifier LOCAL or EXTERNAL classifier
* @param basedir the project basedir
* @param info info descriptor
- * @param types types produced by the resource
+ * @param data datatypes produced by the resource
* @param dependencies resource dependencies
* @param properties suppliementary properties
- * @param data production data
* @param resources subsidary resources
* @return the immediate enclosing resource
*/
public static ModuleDirective createModuleDirective(
String name, String version, Classifier classifier, String basedir,
- InfoDirective info, TypeDirective[] types,
+ InfoDirective info, DataDirective[] data,
DependencyDirective[] dependencies, Properties properties,
- FilterDirective[] filters, DataDirective[] data,
- ResourceDirective[] resources )
+ FilterDirective[] filters, ResourceDirective[] resources )
{
int n = name.indexOf( "/" );
if( n > -1 )
@@ -67,16 +65,16 @@
{
enclosing =
new ModuleDirective(
- elem, version, classifier, basedir, info, types,
dependencies,
- resources, properties, filters, data );
+ elem, version, classifier, basedir, info, data,
dependencies,
+ resources, properties, filters );
}
else
{
enclosing =
new ModuleDirective(
elem, null, Classifier.EXTERNAL, ".", null,
- new TypeDirective[0], new DependencyDirective[0],
- new ResourceDirective[]{enclosing}, null, null, null
);
+ new DataDirective[0], new DependencyDirective[0],
+ new ResourceDirective[]{enclosing}, null, null );
}
}
return enclosing;
@@ -84,8 +82,8 @@
else
{
return new ModuleDirective(
- name, version, classifier, basedir, info, types, dependencies,
- resources, properties, filters, data );
+ name, version, classifier, basedir, info, data, dependencies,
+ resources, properties, filters );
}
}

@@ -100,8 +98,8 @@
{
this(
name, null, Classifier.ANONYMOUS, null, null,
- new TypeDirective[0], new DependencyDirective[0],
- new ResourceDirective[]{resource}, null, null, null );
+ new DataDirective[0], new DependencyDirective[0],
+ new ResourceDirective[]{resource}, null, null );
}

/**
@@ -111,19 +109,18 @@
* @param classifier LOCAL or EXTERNAL classifier
* @param basedir the project basedir
* @param info info descriptor
- * @param types types produced by the resource
+ * @param data datatypes produced by the resource
* @param dependencies resource dependencies
* @param resources resource included within the module
* @param properties suppliementary properties
- * @param data production data
*/
public ModuleDirective(
String name, String version, Classifier classifier, String basedir,
- InfoDirective info, TypeDirective[] types,
+ InfoDirective info, DataDirective[] data,
DependencyDirective[] dependencies, ResourceDirective[] resources,
- Properties properties, FilterDirective[] filters, DataDirective[] data
)
+ Properties properties, FilterDirective[] filters )
{
- super( name, version, classifier, basedir, info, types,
dependencies, properties, filters, data );
+ super( name, version, classifier, basedir, info, data, dependencies,
properties, filters );

if( null == resources )
{

Deleted:
trunk/main/depot/library/src/main/net/dpml/library/info/PatternDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/PatternDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/PatternDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,92 +0,0 @@
-/*
- * 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.info;
-
-import net.dpml.lang.AbstractDirective;
-
-/**
- * Abstract base class for includes and excludes used within collections.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public abstract class PatternDirective extends AbstractDirective
-{
- private final String m_name;
-
- /**
- * Creation of a new include directive.
- * @param name the pattern name
- */
- public PatternDirective( String name )
- {
- if( null == name )
- {
- throw new NullPointerException( "name" );
- }
- m_name = name;
- }
-
- /**
- * Return the include value.
- * @return the value
- */
- public String getName()
- {
- return m_name;
- }
-
- /**
- * Compare this object with another for equality.
- * @param other the other object
- * @return true if equal
- */
- public boolean equals( Object other )
- {
- if( super.equals( other ) && ( other instanceof PatternDirective ) )
- {
- PatternDirective include = (PatternDirective) other;
- return equals( m_name, include.m_name );
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Compute the hash value.
- * @return the hascode value
- */
- public int hashCode()
- {
- int hash = super.hashCode();
- hash ^= super.hashValue( m_name );
- return hash;
- }
-
- /**
- * Return a string representation of the include.
- * @return the string value
- */
- public String toString()
- {
- return "include:" + m_name;
- }
-}

Deleted:
trunk/main/depot/library/src/main/net/dpml/library/info/RMICDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/RMICDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/RMICDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,44 +0,0 @@
-/*
- * 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.info;
-
-import net.dpml.lang.AbstractDirective;
-
-/**
- * Definition of the RMIC compilation criteria.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class RMICDirective extends DataCollectionDirective
-{
- /**
- * Reserved datatype key.
- */
- public static final String KEY = "rmic";
-
- /**
- * Creation of a new data directive.
- * @param patterns the array of include/exclude patterns
- */
- public RMICDirective( PatternDirective[] patterns )
- {
- super( KEY, patterns );
- }
-}

Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -50,7 +50,7 @@
private final String m_name;
private final String m_version;
private final String m_basedir;
- private final DataDirective[] m_types;
+ private final TypeDirective[] m_types;
private final DataDirective[] m_data;
private final DependencyDirective[] m_dependencies;
private final Classifier m_classifier;
@@ -94,7 +94,7 @@
*/
public static ResourceDirective createResourceDirective(
String name, String version, Classifier classifier, String basedir,
- InfoDirective info, DataDirective[] types,
+ InfoDirective info, DataDirective[] data,
DependencyDirective[] dependencies, Properties properties,
FilterDirective[] filters )
{
@@ -110,7 +110,7 @@
{
resource =
new ResourceDirective(
- elem, version, classifier, basedir, info, types,
dependencies,
+ elem, version, classifier, basedir, info, data,
dependencies,
properties, filters );
}
else
@@ -127,7 +127,7 @@
else
{
return new ResourceDirective(
- name, version, classifier, basedir, info, types,
+ name, version, classifier, basedir, info, data,
dependencies, properties, filters );
}
}
@@ -156,9 +156,9 @@
{
throw new NullPointerException( "name" );
}
- if( null == types )
+ if( null == data )
{
- throw new NullPointerException( "types" );
+ throw new NullPointerException( "data" );
}
if( null == dependencies )
{
@@ -195,16 +195,16 @@
}

ArrayList list = new ArrayList();
- for( int i=0; i<types.length; i++ )
+ for( int i=0; i<data.length; i++ )
{
- DataDrective directive = types[i];
+ DataDirective directive = data[i];
if( directive instanceof TypeDirective )
{
list.add( directive );
}
}
m_types = (TypeDirective[]) list.toArray( new TypeDirective[0] );
- m_data = types;
+ m_data = data;
}

/**
@@ -373,10 +373,6 @@
{
return false;
}
- else if( !Arrays.equals( m_types, object.m_types ) )
- {
- return false;
- }
else if( !Arrays.equals( m_data, object.m_data ) )
{
return false;
@@ -403,9 +399,9 @@
hash ^= super.hashValue( m_version );
hash ^= super.hashValue( m_basedir );
hash ^= super.hashValue( m_info );
- hash ^= super.hashArray( m_types );
- hash ^= super.hashArray( m_dependencies );
hash ^= super.hashArray( m_data );
+ hash ^= super.hashArray( m_dependencies );
+ hash ^= super.hashArray( m_filters );
return hash;
}


Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/TypeDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/TypeDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/TypeDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -20,6 +20,8 @@

import java.util.Properties;

+import net.dpml.lang.AbstractDirective;
+
import org.w3c.dom.Element;

/**
@@ -28,11 +30,10 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public final class TypeDirective extends AbstractDirective
+public class TypeDirective extends DataDirective
{
private final String m_name;
private final boolean m_alias;
- private final Element m_element;

/**
* Creation of a new type directive.
@@ -50,43 +51,41 @@
*/
public TypeDirective( String name, boolean alias )
{
- this( name, alias, (Properties) null );
+ this( (Element) null, name, alias );
}

/**
* Creation of a new type directive.
+ * @param element DOM element defining the type
* @param name the name
* @param alias alias production policy
- * @param properties supplimentary properties
*/
- public TypeDirective( String name, boolean alias, Properties properties )
+ public TypeDirective( Element element, String name, boolean alias )
{
- super( properties );
+ super( element );
if( null == name )
{
throw new NullPointerException( "name" );
}
m_name = name;
m_alias = alias;
- m_element = null;
}

/**
- * Creation of a new type directive.
+ * Creation of a new generic type directive.
+ * @param element DOM element defining the type
* @param name the name
* @param alias alias production policy
- * @param element DOM element defining the type
*/
- public TypeDirective( String name, boolean alias, Element element )
+ public TypeDirective( String name, boolean alias, Properties properties )
{
- super( null );
+ super( properties );
if( null == name )
{
throw new NullPointerException( "name" );
}
m_name = name;
m_alias = alias;
- m_element = element;
}

/**
@@ -108,15 +107,6 @@
}

/**
- * Return the underlying custom element.
- * @return the DOM element
- */
- public Element getElement()
- {
- return m_element;
- }
-
- /**
* Compare this object with another for equality.
* @param other the other object
* @return true if equal

Deleted:
trunk/main/depot/library/src/test/net/dpml/library/impl/RMICTestCase.java
===================================================================
--- trunk/main/depot/library/src/test/net/dpml/library/impl/RMICTestCase.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/depot/library/src/test/net/dpml/library/impl/RMICTestCase.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,76 +0,0 @@
-/*
- * Copyright 2004-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 net.dpml.library.impl;
-
-import java.io.File;
-
-import net.dpml.library.Filter;
-import net.dpml.library.Module;
-import net.dpml.library.Resource;
-
-import net.dpml.library.info.RMICDirective;
-import net.dpml.library.info.LibraryDecoder;
-
-import net.dpml.util.Logger;
-import net.dpml.util.DefaultLogger;
-
-import junit.framework.TestCase;
-
-
-/**
- * Test rmic criteria.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class RMICTestCase extends TestCase
-{
- static
- {
- System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
- }
-
- private LibraryDecoder m_decoder;
-
- /**
- * Setup the library directive builder.
- * @exception Exception if an error occurs during test execution
- */
- public void setUp() throws Exception
- {
- m_decoder = new LibraryDecoder();
- }
-
- /**
- * Test an library definition containing duplicate modules.
- * @exception Exception if an error occurs during test execution
- */
- public void testModuleFilters() throws Exception
- {
- String base = System.getProperty( "project.test.dir" );
- File test = new File( base );
- File file = new File( test, "samples/rmic.xml" );
- Logger logger = new DefaultLogger( "test" );
- DefaultLibrary library = new DefaultLibrary( logger, file );
- Module acme = library.getModule( "acme" );
- RMICDirective rmic = (RMICDirective) acme.getDataDirective(
RMICDirective.KEY );
- assertEquals( "includes", 3, rmic.getIncludes().length );
- assertEquals( "excludes", 2, rmic.getExcludes().length );
- }
-}

Modified:
trunk/main/depot/library/src/test/net/dpml/library/info/ModuleDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/src/test/net/dpml/library/info/ModuleDirectiveTestCase.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/test/net/dpml/library/info/ModuleDirectiveTestCase.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -38,13 +38,13 @@

MODULES[0] = new ModuleDirective(
"aaa", "1.1", ResourceDirective.LOCAL, ".", info, types,
- dependencies, resources, PROPERTIES, null, null );
+ dependencies, resources, PROPERTIES, null );
MODULES[1] = new ModuleDirective(
"bbb", "1.1", ResourceDirective.LOCAL, ".", info, types,
- dependencies, resources, PROPERTIES, null, null );
+ dependencies, resources, PROPERTIES, null );
MODULES[2] = new ModuleDirective(
"ccc", "1.1", ResourceDirective.LOCAL, ".", info, types,
- dependencies, resources, PROPERTIES, null, null );
+ dependencies, resources, PROPERTIES, null );
}

private final Classifier m_classifier = ResourceDirective.LOCAL;
@@ -52,11 +52,10 @@
private final String m_version = "1.1.1";
private final String m_basedir = ".";
private final InfoDirective m_info = new InfoDirective( "test", "test
description" );
- private final TypeDirective[] m_types = TypeDirectiveTestCase.TYPES;
private final DependencyDirective[] m_dependencies =
DependencyDirectiveTestCase.DEPENDENCIES;
private final ResourceDirective[] m_resources =
ResourceDirectiveTestCase.RESOURCES;
private final FilterDirective[] m_filters = new FilterDirective[0];
- private final DataDirective[] m_data = new DataDirective[0];
+ private final DataDirective[] m_data = TypeDirectiveTestCase.TYPES;

private ModuleDirective m_module;

@@ -68,8 +67,8 @@
{
m_module =
new ModuleDirective(
- m_name, m_version, m_classifier, "test", m_info, m_types,
m_dependencies,
- m_resources, PROPERTIES, m_filters, m_data );
+ m_name, m_version, m_classifier, "test", m_info, m_data,
m_dependencies,
+ m_resources, PROPERTIES, m_filters );
}

/**
@@ -81,8 +80,8 @@
try
{
new ModuleDirective(
- null, m_version, m_classifier, "test", m_info, m_types,
- m_dependencies, m_resources, PROPERTIES, m_filters, m_data );
+ null, m_version, m_classifier, "test", m_info, m_data,
+ m_dependencies, m_resources, PROPERTIES, m_filters );
fail( "no-NPE" );
}
catch( NullPointerException e )
@@ -100,8 +99,8 @@
try
{
new ModuleDirective(
- m_name, null, m_classifier, "test", m_info, m_types,
m_dependencies,
- m_resources, PROPERTIES, m_filters, m_data );
+ m_name, null, m_classifier, "test", m_info, m_data,
m_dependencies,
+ m_resources, PROPERTIES, m_filters );
}
catch( NullPointerException e )
{
@@ -118,8 +117,8 @@
try
{
new ModuleDirective(
- m_name, m_version, m_classifier, "test", m_info, m_types,
null,
- m_resources, PROPERTIES, m_filters, m_data );
+ m_name, m_version, m_classifier, "test", m_info, m_data, null,
+ m_resources, PROPERTIES, m_filters );
fail( "no-NPE" );
}
catch( NullPointerException e )
@@ -137,8 +136,8 @@
try
{
new ModuleDirective(
- m_name, m_version, m_classifier, "test", m_info, m_types,
- m_dependencies, null, PROPERTIES, m_filters, m_data );
+ m_name, m_version, m_classifier, "test", m_info, m_data,
+ m_dependencies, null, PROPERTIES, m_filters );
fail( "no-NPE" );
}
catch( NullPointerException e )

Deleted:
trunk/main/depot/library/src/test/net/dpml/library/info/RMICDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/src/test/net/dpml/library/info/RMICDirectiveTestCase.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/test/net/dpml/library/info/RMICDirectiveTestCase.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,71 +0,0 @@
-/*
- * 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.info;
-
-/**
- * Test and validate the RMICDirective class.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public final class RMICDirectiveTestCase extends AbstractTestCase
-{
- static final PatternDirective[] PATTERNS =
- new PatternDirective[]
- {
- new IncludePatternDirective( "foo" ),
- new ExcludePatternDirective( "bar" )
- };
-
- static final RMICDirective RMIC = new RMICDirective( PATTERNS );
-
- /**
- * Test null argument.
- */
- public void testNullArgs()
- {
- try
- {
- RMICDirective rmic = new RMICDirective( null );
- fail( "Did not thow a NPE" );
- }
- catch( NullPointerException e )
- {
- // success
- }
- }
-
- /**
- * Test accessor.
- */
- public void testPatternAccessor()
- {
- assertEquals( "patterns", PATTERNS, RMIC.getPatternDirectives() );
- }
-
- /**
- * Test directive serialization.
- * @exception Exception if an error occurs
- */
- public void testSerialization() throws Exception
- {
- doSerializationTest( RMIC );
- }
-
-}

Modified:
trunk/main/depot/library/src/test/net/dpml/library/info/ResourceDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/src/test/net/dpml/library/info/ResourceDirectiveTestCase.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/depot/library/src/test/net/dpml/library/info/ResourceDirectiveTestCase.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -40,13 +40,13 @@
{
RESOURCES[0] =
new ResourceDirective(
- "fred", null, CLASSIFIER, "example/fred", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "fred", null, CLASSIFIER, "example/fred", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
RESOURCES[1] =
new ResourceDirective(
- "george", "1.3.0", CLASSIFIER, "example/george", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "george", "1.3.0", CLASSIFIER, "example/george", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
RESOURCES[2] =
new ResourceDirective(
- "mary", "2.7", CLASSIFIER, "example/mary", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "mary", "2.7", CLASSIFIER, "example/mary", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
}

/**
@@ -59,7 +59,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- null, "1.0", CLASSIFIER, "test", INFO, TYPES, DEPENDENCIES,
PROPERTIES, FILTERS, DATA );
+ null, "1.0", CLASSIFIER, "test", INFO, TYPES, DEPENDENCIES,
PROPERTIES, FILTERS );
fail( "no-NPE" );
}
catch( NullPointerException e )
@@ -78,7 +78,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "fred", "1.0", CLASSIFIER, "test", INFO, null, DEPENDENCIES,
PROPERTIES, FILTERS, DATA );
+ "fred", "1.0", CLASSIFIER, "test", INFO, null, DEPENDENCIES,
PROPERTIES, FILTERS );
fail( "no-NPE" );
}
catch( NullPointerException e )
@@ -97,7 +97,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "fred", "1.0", CLASSIFIER, "test", INFO, TYPES, null,
PROPERTIES, FILTERS, DATA );
+ "fred", "1.0", CLASSIFIER, "test", INFO, TYPES, null,
PROPERTIES, FILTERS );
fail( "no-NPE" );
}
catch( NullPointerException e )
@@ -113,7 +113,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
assertEquals( "name", "resource", resource.getName() );
}

@@ -124,7 +124,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
assertEquals( "version", "2.7", resource.getVersion() );
}

@@ -135,7 +135,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
assertEquals( "basedir", "test", resource.getBasedir() );
}

@@ -146,7 +146,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
assertEquals( "types", 3, resource.getTypeDirectives().length );
}

@@ -157,7 +157,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
assertEquals( "dependencies", 3,
resource.getDependencyDirectives().length );
}

@@ -168,7 +168,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
assertEquals( "properties", PROPERTIES, resource.getProperties() );
}

@@ -180,7 +180,7 @@
{
ResourceDirective resource =
new ResourceDirective(
- "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS, DATA );
+ "resource", "2.7", CLASSIFIER, "test", INFO, TYPES,
DEPENDENCIES, PROPERTIES, FILTERS );
doSerializationTest( resource );
}
}

Modified: trunk/main/lang/process/etc/process.xsd
===================================================================
--- trunk/main/lang/process/etc/process.xsd 2006-05-14 05:40:06 UTC (rev
1440)
+++ trunk/main/lang/process/etc/process.xsd 2006-05-19 04:03:32 UTC (rev
1441)
@@ -9,11 +9,14 @@
<import namespace="artifact:xsd:dpml/lang/dpml-common#1.0"
schemaLocation="artifact:xsd:dpml/lang/dpml-common#1.0"/>

<element name="configuration" type="this:ConfigurationType"/>
+
<element name="process" type="this:ProcessType"/>
<element name="product" type="this:ProductType"/>

<element name="dir" type="this:DirectoryType"
substitutionGroup="this:product"/>
<element name="file" type="this:FileType"
substitutionGroup="this:product"/>
+ <element name="collection" type="this:CollectionType"
substitutionGroup="this:product"/>
+ <element name="workspace" type="this:WorkspaceType"
substitutionGroup="this:product"/>

<!-- top-level configuration definitions -->

@@ -24,23 +27,36 @@
</choice>
</complexType>

- <!-- product definitions -->
+ <!-- abstract base -->

- <complexType name="ProductType" abstract="true">
+ <complexType name="DescriptionType">
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+
+ <complexType name="InfoType">
<sequence>
<element name="description" type="this:DescriptionType"
minOccurs="0" maxOccurs="1"/>
</sequence>
+ <attribute name="title" type="string"/>
+ </complexType>
+
+ <complexType name="BaseType" abstract="true">
+ <sequence>
+ <element name="info" type="this:InfoType" minOccurs="0"
maxOccurs="1"/>
+ </sequence>
<attribute name="name" type="string" use="required"/>
</complexType>

- <complexType name="DescriptionType">
- <simpleContent>
- <extension base="string">
- <attribute name="title" type="string"/>
- </extension>
- </simpleContent>
+ <complexType name="ProductType" abstract="true">
+ <complexContent>
+ <extension base="this:BaseType"/>
+ </complexContent>
</complexType>

+ <!-- product definitions -->
+
<complexType name="DirectoryType">
<complexContent>
<extension base="this:ProductType">
@@ -49,27 +65,63 @@
</complexContent>
</complexType>

+ <complexType name="WorkspaceType">
+ <complexContent>
+ <extension base="this:DirectoryType">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="this:product"/>
+ </choice>
+ </extension>
+ </complexContent>
+ </complexType>
+
<complexType name="FileType">
<complexContent>
<extension base="this:ProductType">
<attribute name="type" type="string" use="required"/>
+ <attribute name="base" type="string" use="required"/>
</extension>
</complexContent>
</complexType>

+ <complexType name="CollectionType">
+ <complexContent>
+ <extension base="this:ProductType">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="include" type="this:SelectorType"/>
+ <element name="exclude" type="this:SelectorType"/>
+ </choice>
+ <attribute name="defaultIncludes" type="string"/>
+ <attribute name="defaultExcludes" type="string"/>
+ <attribute name="criteria" type="this:criteria" default="any"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <simpleType name="criteria">
+ <restriction base="string">
+ <enumeration value="any"/>
+ <enumeration value="file"/>
+ <enumeration value="dir"/>
+ </restriction>
+ </simpleType>
+
<!-- generic process definition -->

<complexType name="ProcessType">
- <sequence>
- <element name="dependencies" type="this:DependenciesType"
minOccurs="0" maxOccurs="1"/>
- <element name="consumes" type="this:ConsumesType" minOccurs="0"
maxOccurs="1"/>
- <element name="validators" type="this:ValidatorsType" minOccurs="0"
maxOccurs="1"/>
- <element name="params" type="anyType" minOccurs="0" maxOccurs="1"/>
- </sequence>
- <attribute name="name" type="string" use="required"/>
- <attribute name="class" type="string" use="required"/>
- <attribute name="implicit" type="boolean" default="false"/>
- <attribute name="produces" type="string" use="optional"/>
+ <complexContent>
+ <extension base="this:BaseType">
+ <sequence>
+ <element name="dependencies" type="this:DependenciesType"
minOccurs="0" maxOccurs="1"/>
+ <element name="consumes" type="this:ConsumesType" minOccurs="0"
maxOccurs="1"/>
+ <element name="validators" type="this:ValidatorsType"
minOccurs="0" maxOccurs="1"/>
+ <element name="params" type="anyType" minOccurs="0"
maxOccurs="1"/>
+ </sequence>
+ <attribute name="class" type="string" use="required"/>
+ <attribute name="implicit" type="boolean" default="false"/>
+ <attribute name="produces" type="string" use="optional"/>
+ </extension>
+ </complexContent>
</complexType>

<complexType name="DependenciesType">

Modified: trunk/main/lang/process/etc/test/sample.xml
===================================================================
--- trunk/main/lang/process/etc/test/sample.xml 2006-05-14 05:40:06 UTC (rev
1440)
+++ trunk/main/lang/process/etc/test/sample.xml 2006-05-19 04:03:32 UTC (rev
1441)
@@ -5,33 +5,50 @@
xmlns:part="@PART-XSD-URI@">

<!-- client products -->
+
+ <dir name="project.basedir" path="${basedir}">
+ <info title="Project base directory.">
+ <description>
+ Project source base directory from which the working
+ target drectory is established.
+ </description>
+ </info>
+ </dir>

<dir name="src.main" path="${project.src.main.dir}">
- <description title="Project main source directory.">
- Project source for primary content to be added to the
- normalized ${target.build.main.dir} directory.
- </description>
+ <info title="Project main source directory.">
+ <description>
+ Project source for primary content to be added to the
+ normalized ${target.build.main.dir} directory.
+ </description>
+ </info>
</dir>

<dir name="src.test" path="${project.src.test.dir}">
- <description title="Project test source directory.">
- Project source for test content to be added to the
- normalized ${target.build.test.dir} directory.
- </description>
+ <info title="Project test source director.">
+ <description>
+ Project source for test content to be added to the
+ normalized ${target.build.test.dir} directory.
+ </description>
+ </info>
</dir>

<dir name="etc.main" path="${project.etc.main.dir}">
- <description title="Project supplimentary main content directory.">
- Project source for supplimentary content to be added to the
- normalized ${target.build.main.dir} directory.
- </description>
+ <info title="Project supplimentary main content directory.">
+ <description>
+ Project source for supplimentary content to be added to the
+ normalized ${target.build.main.dir} directory.
+ </description>
+ </info>
</dir>

<dir name="etc.test" path="${project.etc.test.dir}">
- <description title="Project supplimentary test content directory.">
- Project source for supplimentary test content to be added to the
- normalized ${target.build.test.dir} directory.
- </description>
+ <info title="Project supplimentary test content directory.">
+ <description>
+ Project source for supplimentary test content to be added to the
+ normalized ${target.build.test.dir} directory.
+ </description>
+ </info>
</dir>

<!-- normalized products -->
@@ -40,22 +57,42 @@
<dir name="target.test.dir" path="${target.dir}/test"/>
<dir name="target.reports.dir" path="${target.dir}/reports"/>
<dir name="target.reports.test.dir" path="${target.reports.dir}/test"/>
-
<dir name="target.build.dir" path="${target.dir}/build"/>
<dir name="target.build.main.dir" path="${target.build.dir}/main"/>
<dir name="target.build.test.dir" path="${target.build.dir}/test"/>
-
<dir name="target.classes.dir" path="${target.dir}/classes"/>
<dir name="target.classes.main.dir" path="${target.classes.dir}/main"/>
<dir name="target.classes.test.dir" path="${target.classes.dir}/test"/>
+ <dir name="target.deliverables.dir" path="${target.dir}/deliverables"/>

- <file name="target.deliverables.jar" type="jar"/>
- <file name="target.deliverables.part" type="part"/>
+ <file name="target.deliverables.jar" type="jar"
base="target.deliverables.dir"/>
+ <file name="target.deliverables.part" type="part"
base="target.deliverables.dir"/>

+ <collection name="all" criteria="file">
+ <info title="All deliverable products.">
+ <description>
+ Collection of all deliverable files associated with a project.
+ </description>
+ </info>
+ <include name="*"/>
+ </collection>
+
<!-- processes -->

+ <process name="init" class="net.dpml.tools.process.InitializationProcess"
+ produces="target.dir">
+ <consumes>
+ <input id="project.basedir"/>
+ </consumes>
+ </process>
+
+ <process name="install" class="net.dpml.tools.process.InstallProcess"/>
+
<process name="prepare-main"
class="net.dpml.tools.process.PrepareMainProcess"
produces="target.build.main.dir">
+ <dependencies>
+ <dependency id="init"/>
+ </dependencies>
<consumes>
<input xsi:type="Selection" id="etc.main" filtering="false">
<include
name="**/*.exe,**/*.jar*,**/*.dll,**/*.gif,**/*.jpeg,**/*.jpg,**/*.ico,**/*.png,**/*.keystore"/>
@@ -68,6 +105,9 @@

<process name="prepare-test"
class="net.dpml.tools.process.PrepareTestProcess"
produces="target.build.test.dir">
+ <dependencies>
+ <dependency id="init"/>
+ </dependencies>
<consumes policy="conditional">
<input id="target.build.main.dir"/>
<input id="src.test" policy="optional"/>
@@ -106,6 +146,7 @@
<process name="jar" class="net.dpml.tools.process.JarProcess"
produces="target.deliverables.jar">
<consumes>
+ <input id="target.deliverables.dir"/>
<input id="target.classes.main.dir" policy="conditional"/>
</consumes>
<validators>

Added: trunk/main/lang/process/etc/test/workspace.xml
===================================================================
--- trunk/main/lang/process/etc/test/workspace.xml 2006-05-14 05:40:06
UTC (rev 1440)
+++ trunk/main/lang/process/etc/test/workspace.xml 2006-05-19 04:03:32
UTC (rev 1441)
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<workspace name="project" path="." xmlns="@PROJECT-XSD-URI@"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xmlns:this="@PROJECT-XSD-URI@">
+
+ <!-- project directories -->
+
+ <dir name="src.main" path="src/main">
+ <info title="Project main source directory.">
+ <description>
+ Project source for primary content to be added to the
+ normalized ${target.build.main.dir} directory.
+ </description>
+ </info>
+ </dir>
+
+ <dir name="src.test" path="src/test">
+ <info title="Project test source director.">
+ <description>
+ Project source for test content to be added to the
+ normalized ${target.build.test.dir} directory.
+ </description>
+ </info>
+ </dir>
+
+ <dir name="etc.main" path="etc/main">
+ <info title="Project supplimentary main content directory.">
+ <description>
+ Project source for supplimentary content to be added to the
+ normalized ${target.build.main.dir} directory.
+ </description>
+ </info>
+ </dir>
+
+ <dir name="etc.test" path="etc/test">
+ <info title="Project supplimentary test content directory.">
+ <description>
+ Project source for supplimentary test content to be added to the
+ normalized ${target.build.test.dir} directory.
+ </description>
+ </info>
+ </dir>
+
+ <dir name="etc.prefs" path="etc/prefs">
+ <info title="Project preferences directory.">
+ <description>
+ Project source directory for preference data.
+ </description>
+ </info>
+ </dir>
+
+ <dir name="etc.docs" path="etc/docs">
+ <info title="Project supplimentary doc content directory.">
+ <description>
+ Project source for supplimentary documentation content to be added to
the
+ normalized ${target.build.docs.dir} directory.
+ </description>
+ </info>
+ </dir>
+
+ <workspace name="target" path="target">
+ <workspace name="test" path="test"/>
+ <workspace name="build" path="build">
+ <dir name="main" path="main"/>
+ <dir name="test" path="test"/>
+ <dir name="docs" path="docs"/>
+ </workspace>
+ <workspace name="classes" path="classes">
+ <dir name="main" path="main"/>
+ <dir name="test" path="test"/>
+ </workspace>
+ <workspace name="reports" path="reports">
+ <dir name="test" path="test"/>
+ </workspace>
+ <workspace name="cache" path="cache"/>
+ <workspace name="prefs" path="prefs"/>
+ <workspace name="docs" path="docs"/>
+ <workspace name="bin" path="bin"/>
+ </workspace>
+
+</workspace>

Deleted:
trunk/main/lang/process/src/main/net/dpml/lang/info/AbstractProductDirective.java
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/info/AbstractProductDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/lang/process/src/main/net/dpml/lang/info/AbstractProductDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -1,115 +0,0 @@
-/*
- * 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 net.dpml.lang.info;
-
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Properties;
-
-import net.dpml.lang.AbstractDirective;
-
-/**
- * The AbstractProductDirective class describes a product instance such as a
file or directory.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public abstract class AbstractProductDirective extends AbstractDirective
-{
- private final String m_name;
- private final InfoDirective m_info;
-
- public AbstractProductDirective( final String name, final InfoDirective
info )
- {
- if( null == name )
- {
- throw new NullPointerException( "name" );
- }
- if( null == info )
- {
- throw new NullPointerException( "info" );
- }
- m_name = name;
- m_info = info;
- }
-
- /**
- * Get the product name.
- * @return the product name.
- */
- public String getName()
- {
- return m_name;
- }
-
-
- /**
- * Get the product title.
- * @return the product title.
- */
- public String getTitle()
- {
- return m_info.getTitle();
- }
- /**
- * Get the product description.
- * @return the product description.
- */
- public String getDescription()
- {
- return m_info.getDescription();
- }
-
- /**
- * Compare this object with another for equality.
- * @param other the other object
- * @return true if equal
- */
- public boolean equals( Object other )
- {
- if( super.equals( other ) && ( other instanceof
AbstractProductDirective ) )
- {
- AbstractProductDirective object = (AbstractProductDirective)
other;
- if( !m_name.equals( object.m_name ) )
- {
- return false;
- }
- else
- {
- return equals( m_info, object.m_info );
- }
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Compute the hash value.
- * @return the hashcode value
- */
- public int hashCode()
- {
- int hash = super.hashCode();
- hash ^= hashValue( m_name );
- hash ^= hashValue( m_info );
- return hash;
- }
-}

Added:
trunk/main/lang/process/src/main/net/dpml/lang/info/CollectionCriteria.java
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/info/CollectionCriteria.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/lang/process/src/main/net/dpml/lang/info/CollectionCriteria.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -0,0 +1,116 @@
+/*
+ * 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 net.dpml.lang.info;
+
+import net.dpml.lang.Enum;
+
+/**
+ * Product selection criteria enumeration.
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public final class CollectionCriteria extends Enum
+{
+ static final long serialVersionUID = 1L;
+
+ /**
+ * Any product.
+ */
+ public static final CollectionCriteria ANY = new CollectionCriteria(
"any" );
+
+ /**
+ * Any deliverable file product.
+ */
+ public static final CollectionCriteria FILE = new CollectionCriteria(
"file" );
+
+ /**
+ * Any interim directory product.
+ */
+ public static final CollectionCriteria DIR = new CollectionCriteria(
"dir" );
+
+ /**
+ * Array of scope enumeration values.
+ */
+ private static final CollectionCriteria[] ENUM_VALUES =
+ new CollectionCriteria[]
+ {
+ ANY,
+ FILE,
+ DIR
+ };
+
+ /**
+ * Returns an array of enum values.
+ * @return the enumeration array
+ */
+ public static CollectionCriteria[] values()
+ {
+ return ENUM_VALUES;
+ }
+
+ /**
+ * Internal constructor.
+ * @param label the enumeration label.
+ */
+ private CollectionCriteria( String label )
+ {
+ super( label );
+ }
+
+ /**
+ * Return a string representation of the category.
+ * @return the category name in uppercase
+ */
+ public String toString()
+ {
+ return getName().toUpperCase();
+ }
+
+ /**
+ * Create a category by parsing the supplied name.
+ * @param value the category name
+ * @return the corresponding category
+ * @exception IllegalArgumentException if the value is not recognized
+ */
+ public static CollectionCriteria parse( String value ) throws
IllegalArgumentException
+ {
+ if( null == value )
+ {
+ return ANY;
+ }
+ else
+ {
+ if( value.equalsIgnoreCase( "file" ) )
+ {
+ return FILE;
+ }
+ else if( value.equalsIgnoreCase( "dir" ) )
+ {
+ return DIR;
+ }
+ else
+ {
+ final String error =
+ "Unrecognized selection criteria argument [" + value + "]";
+ throw new IllegalArgumentException( error );
+ }
+ }
+ }
+}
+

Added:
trunk/main/lang/process/src/main/net/dpml/lang/info/CollectionDirective.java
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/info/CollectionDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/lang/process/src/main/net/dpml/lang/info/CollectionDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -0,0 +1,125 @@
+/*
+ * 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 net.dpml.lang.info;
+
+import java.util.Arrays;
+
+/**
+ * The DirectoryProductDirective class describes a working directory.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class CollectionDirective extends ProductDirective
+{
+ private final CollectionCriteria m_criteria;
+ private final String[] m_includes;
+ private final String[] m_excludes;
+
+ public CollectionDirective(
+ final String name, final InfoDirective info, CollectionCriteria
criteria,
+ String[] includes, String[] excludes )
+ {
+ super( name, info );
+
+ if( null == criteria )
+ {
+ throw new NullPointerException( "criteria" );
+ }
+ if( null == includes )
+ {
+ throw new NullPointerException( "includes" );
+ }
+ if( null == excludes )
+ {
+ throw new NullPointerException( "excludes" );
+ }
+
+ m_criteria = criteria;
+ m_includes = includes;
+ m_excludes = excludes;
+ }
+
+ /**
+ * Get the selection criteria.
+ * @return the criteria value
+ */
+ public CollectionCriteria getCollectionCriteria()
+ {
+ return m_criteria;
+ }
+
+ /**
+ * Get the selection includes.
+ * @return the include selectors
+ */
+ public String[] getIncludes()
+ {
+ return m_includes;
+ }
+
+ /**
+ * Get the selection excludes.
+ * @return the exclude selectors
+ */
+ public String[] getExcludes()
+ {
+ return m_excludes;
+ }
+
+ /**
+ * Compare this object with another for equality.
+ * @param other the other object
+ * @return true if equal
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof CollectionDirective
) )
+ {
+ CollectionDirective object = (CollectionDirective) other;
+ if( !Arrays.equals( m_includes, object.m_includes ) )
+ {
+ return false;
+ }
+ else if( !Arrays.equals( m_excludes, object.m_excludes ) )
+ {
+ return false;
+ }
+ else
+ {
+ return m_criteria.equals( object.m_criteria );
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the hash value.
+ * @return the hashcode value
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= hashValue( m_criteria );
+ return hash;
+ }
+}

Modified:
trunk/main/lang/process/src/main/net/dpml/lang/info/DirectoryDirective.java
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/info/DirectoryDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/lang/process/src/main/net/dpml/lang/info/DirectoryDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -24,7 +24,7 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public class DirectoryDirective extends AbstractProductDirective
+public class DirectoryDirective extends ProductDirective
{
private final String m_path;


Modified:
trunk/main/lang/process/src/main/net/dpml/lang/info/FileDirective.java
===================================================================
--- trunk/main/lang/process/src/main/net/dpml/lang/info/FileDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/lang/process/src/main/net/dpml/lang/info/FileDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -25,17 +25,19 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public class FileDirective extends AbstractProductDirective
+public class FileDirective extends ProductDirective
{
private final String m_type;
+ private final String m_base;

/**
* Creation of a new file directive.
* @param name the product identifier
* @param info supplimentary product info
* @param type the artifact type
+ * @param base id of the partent directory
*/
- public FileDirective( final String name, final InfoDirective info,
String type )
+ public FileDirective( final String name, final InfoDirective info,
String type, String base )
{
super( name, info );

@@ -45,6 +47,7 @@
}

m_type = type;
+ m_base = base;
}

/**
@@ -57,6 +60,15 @@
}

/**
+ * Get the product base directory id.
+ * @return the product base directory identifier.
+ */
+ public String getBaseID()
+ {
+ return m_base;
+ }
+
+ /**
* Compare this object with another for equality.
* @param other the other object
* @return true if equal

Modified:
trunk/main/lang/process/src/main/net/dpml/lang/info/InfoDirective.java
===================================================================
--- trunk/main/lang/process/src/main/net/dpml/lang/info/InfoDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/lang/process/src/main/net/dpml/lang/info/InfoDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -30,17 +30,13 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public abstract class InfoDirective extends AbstractDirective
+public class InfoDirective extends AbstractDirective
{
private final String m_title;
private final String m_description;

public InfoDirective( final String title, final String description )
{
- if( null == title )
- {
- throw new NullPointerException( "title" );
- }
m_title = title;
m_description = description;
}
@@ -73,7 +69,7 @@
if( super.equals( other ) && ( other instanceof InfoDirective ) )
{
InfoDirective object = (InfoDirective) other;
- if( !m_title.equals( object.m_title ) )
+ if( !equals( m_title, object.m_title ) )
{
return false;
}

Copied:
trunk/main/lang/process/src/main/net/dpml/lang/info/ProductDirective.java
(from rev 1439,
trunk/main/lang/process/src/main/net/dpml/lang/info/AbstractProductDirective.java)
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/info/AbstractProductDirective.java
2006-05-06 20:55:46 UTC (rev 1439)
+++ trunk/main/lang/process/src/main/net/dpml/lang/info/ProductDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -0,0 +1,115 @@
+/*
+ * 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 net.dpml.lang.info;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Properties;
+
+import net.dpml.lang.AbstractDirective;
+
+/**
+ * The ProductDirective class describes a product instance such as a file or
directory.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public abstract class ProductDirective extends AbstractDirective
+{
+ private final String m_name;
+ private final InfoDirective m_info;
+
+ public ProductDirective( final String name, final InfoDirective info )
+ {
+ if( null == name )
+ {
+ throw new NullPointerException( "name" );
+ }
+ if( null == info )
+ {
+ throw new NullPointerException( "info" );
+ }
+ m_name = name;
+ m_info = info;
+ }
+
+ /**
+ * Get the product name.
+ * @return the product name.
+ */
+ public String getName()
+ {
+ return m_name;
+ }
+
+
+ /**
+ * Get the product title.
+ * @return the product title.
+ */
+ public String getTitle()
+ {
+ return m_info.getTitle();
+ }
+ /**
+ * Get the product description.
+ * @return the product description.
+ */
+ public String getDescription()
+ {
+ return m_info.getDescription();
+ }
+
+ /**
+ * Compare this object with another for equality.
+ * @param other the other object
+ * @return true if equal
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof ProductDirective ) )
+ {
+ ProductDirective object = (ProductDirective) other;
+ if( !m_name.equals( object.m_name ) )
+ {
+ return false;
+ }
+ else
+ {
+ return equals( m_info, object.m_info );
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the hash value.
+ * @return the hashcode value
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= hashValue( m_name );
+ hash ^= hashValue( m_info );
+ return hash;
+ }
+}

Added:
trunk/main/lang/process/src/main/net/dpml/lang/info/WorkspaceDecoder.java
===================================================================
--- trunk/main/lang/process/src/main/net/dpml/lang/info/WorkspaceDecoder.java
2006-05-14 05:40:06 UTC (rev 1440)
+++ trunk/main/lang/process/src/main/net/dpml/lang/info/WorkspaceDecoder.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -0,0 +1,181 @@
+/*
+/*
+ * 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 net.dpml.lang.info;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.FileNotFoundException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Properties;
+
+import net.dpml.lang.DuplicateKeyException;
+
+import net.dpml.util.DecodingException;
+import net.dpml.util.DOM3DocumentBuilder;
+import net.dpml.util.ElementHelper;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Document;
+import org.w3c.dom.TypeInfo;
+
+/**
+ * Utility class supporting workspace decoding.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public final class WorkspaceDecoder
+{
+ private static final DOM3DocumentBuilder DOCUMENT_BUILDER = new
DOM3DocumentBuilder();
+
+ /**
+ * Construct a workspace from XML source.
+ * @param source the XML source file
+ * @return the layout directive
+ * @exception IOException if an IO exception occurs
+ */
+ public WorkspaceDirective build( File source ) throws IOException
+ {
+ if( null == source )
+ {
+ throw new NullPointerException( "source" );
+ }
+ if( !source.exists() )
+ {
+ throw new FileNotFoundException( source.toString() );
+ }
+ if( source.isDirectory() )
+ {
+ final String error =
+ "File ["
+ + source
+ + "] references a directory.";
+ throw new IllegalArgumentException( error );
+ }
+ try
+ {
+ final Element root = getRootElement( source );
+ return buildWorkspaceDirective( root );
+ }
+ catch( IOException e )
+ {
+ throw e;
+ }
+ catch( Exception e )
+ {
+ final String error =
+ "Unexpected error while attempting to load project layout."
+ + "File: '" + source + "'";
+ IOException ioe = new IOException( error );
+ ioe.initCause( e );
+ throw ioe;
+ }
+ }
+
+ private Element getRootElement( File source ) throws IOException
+ {
+ File file = source.getCanonicalFile();
+ final Document document = DOCUMENT_BUILDER.parse( file.toURI() );
+ return document.getDocumentElement();
+ }
+
+ /**
+ * Build a layout using an XML element.
+ * @param base the base directory
+ * @param element the module element
+ * @return the library directive
+ * @exception Exception if an exception occurs
+ */
+ private WorkspaceDirective buildWorkspaceDirective( Element element )
throws DecodingException, DuplicateKeyException
+ {
+ String name = ElementHelper.getAttribute( element, "name" );
+ InfoDirective info = buildInfoDirective( ElementHelper.getChild(
element, "info" ) );
+ String path = ElementHelper.getAttribute( element, "path" );
+ Element[] children = ElementHelper.getChildren( element );
+ ProductDirective[] products = new ProductDirective[ children.length
];
+ for( int i=0; i<children.length; i++ )
+ {
+ Element child = children[i];
+ products[i] = buildProductDirective( child );
+ }
+ return new WorkspaceDirective( name, info, path, products );
+ }
+
+ private ProductDirective buildProductDirective( Element element ) throws
DecodingException, DuplicateKeyException
+ {
+ String tag = element.getTagName();
+ if( "dir".equals( tag ) )
+ {
+ return buildDirectoryDirective( element );
+ }
+ else if( "file".equals( tag ) )
+ {
+ return buildFileDirective( element );
+ }
+ else if( "collection".equals( tag ) )
+ {
+ return buildCollectionDirective( element );
+ }
+ else if( "workspace".equals( tag ) )
+ {
+ return buildWorkspaceDirective( element );
+ }
+ else
+ {
+ final String error =
+ "Element tag name ["
+ + tag
+ + "] is not recognized.";
+ throw new DecodingException( element, error );
+ }
+ }
+
+ private DirectoryDirective buildDirectoryDirective( Element element )
+ {
+ String name = ElementHelper.getAttribute( element, "name" );
+ String path = ElementHelper.getAttribute( element, "path" );
+ InfoDirective info = buildInfoDirective( ElementHelper.getChild(
element, "info" ) );
+ return new DirectoryDirective( name, info, path );
+ }
+
+ private FileDirective buildFileDirective( Element element )
+ {
+ String name = ElementHelper.getAttribute( element, "name" );
+ String type = ElementHelper.getAttribute( element, "type" );
+ String base = ElementHelper.getAttribute( element, "base" );
+ InfoDirective info = buildInfoDirective( ElementHelper.getChild(
element, "info" ) );
+ return new FileDirective( name, info, type, base );
+ }
+
+ private CollectionDirective buildCollectionDirective( Element element )
+ {
+ throw new UnsupportedOperationException( "buildCollectionDirective"
);
+ }
+
+ private InfoDirective buildInfoDirective( Element element )
+ {
+ String title = ElementHelper.getAttribute( element, "title" );
+ Element elem = ElementHelper.getChild( element, "description" );
+ String description = ElementHelper.getValue( elem );
+ return new InfoDirective( title, description );
+ }
+}

Added:
trunk/main/lang/process/src/main/net/dpml/lang/info/WorkspaceDirective.java
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/info/WorkspaceDirective.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/lang/process/src/main/net/dpml/lang/info/WorkspaceDirective.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -0,0 +1,135 @@
+/*
+ * 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 net.dpml.lang.info;
+
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Hashtable;
+
+import net.dpml.lang.AbstractDirective;
+import net.dpml.lang.UnknownKeyException;
+import net.dpml.lang.DuplicateKeyException;
+
+/**
+ * The WorkspaceDirective holds the collection of products defining a
project layout.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class WorkspaceDirective extends DirectoryDirective
+{
+ private final ProductDirective[] m_products;
+
+ private final transient Map m_map = new Hashtable();
+
+ public WorkspaceDirective(
+ final String name, InfoDirective info, final String path, final
ProductDirective[] products )
+ throws DuplicateKeyException
+ {
+ super( name, info, path );
+ if( null == products )
+ {
+ throw new NullPointerException( "products" );
+ }
+ m_products = products;
+ for( int i=0; i<m_products.length; i++ )
+ {
+ ProductDirective product = m_products[i];
+ String key = product.getName();
+ if( m_map.containsKey( key ) )
+ {
+ throw new DuplicateKeyException( key );
+ }
+ else
+ {
+ m_map.put( key, product );
+ }
+ }
+ }
+
+ /**
+ * Get the set of product directives.
+ * @return the product directive array.
+ */
+ public ProductDirective[] getProductDirectives()
+ {
+ return m_products;
+ }
+
+ /**
+ * Get a named product from the layout.
+ * @return the named product.
+ * @exception UnknownKeyException if the requested name is unknown
+ */
+ public ProductDirective getProductDirective( String name ) throws
UnknownKeyException
+ {
+ if( null == name )
+ {
+ throw new NullPointerException( "name" );
+ }
+ int n = name.indexOf( "/" );
+ if( n > -1 )
+ {
+ String item = name.substring( 0, n );
+ String remainder = name.substring( n + 1 );
+ WorkspaceDirective workspace = (WorkspaceDirective)
getProductDirective( item );
+ return workspace.getProductDirective( remainder );
+ }
+ else
+ {
+ if( m_map.containsKey( name ) )
+ {
+ return (ProductDirective) m_map.get( name );
+ }
+ else
+ {
+ throw new UnknownKeyException( name );
+ }
+ }
+ }
+
+ /**
+ * Compare this object with another for equality.
+ * @param other the other object
+ * @return true if equal
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof WorkspaceDirective )
)
+ {
+ WorkspaceDirective object = (WorkspaceDirective) other;
+ return Arrays.equals( m_products, object.m_products );
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the hash value.
+ * @return the hashcode value
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= hashArray( m_products );
+ return hash;
+ }
+}

Modified:
trunk/main/lang/process/src/test/net/dpml/lang/info/ProcessXsdTestCase.java
===================================================================
---
trunk/main/lang/process/src/test/net/dpml/lang/info/ProcessXsdTestCase.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/lang/process/src/test/net/dpml/lang/info/ProcessXsdTestCase.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -129,6 +129,7 @@
*/
public void testImplicitTargets() throws Exception
{
+ System.out.println( "PROCESS DRIVEN" );
Element[] implicits = getImplicitProcesses();
for( int i=0; i<implicits.length; i++ )
{
@@ -144,6 +145,7 @@
*/
public void testExplicitProducts() throws Exception
{
+ System.out.println( "PRODUCT DRIVEN" );
Element jar = (Element) m_products.get( "target.deliverables.jar" );
if( null == jar )
{
@@ -166,6 +168,7 @@
*/
public void testProcessTarget() throws Exception
{
+ System.out.println( "PROCESS" );
ArrayList list = new ArrayList();
Element rmic = (Element) m_processes.get( "rmic" );
Element jar = (Element) m_processes.get( "jar" );

Added:
trunk/main/lang/process/src/test/net/dpml/lang/info/WorkspaceTestCase.java
===================================================================
---
trunk/main/lang/process/src/test/net/dpml/lang/info/WorkspaceTestCase.java
2006-05-14 05:40:06 UTC (rev 1440)
+++
trunk/main/lang/process/src/test/net/dpml/lang/info/WorkspaceTestCase.java
2006-05-19 04:03:32 UTC (rev 1441)
@@ -0,0 +1,105 @@
+/*
+ * 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.lang.info;
+
+import java.io.File;
+import java.net.URI;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import net.dpml.util.DOM3DocumentBuilder;
+import net.dpml.util.ElementHelper;
+import net.dpml.util.DecodingException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.TypeInfo;
+
+import junit.framework.TestCase;
+
+/**
+ * The ProcessXsdTestCase class validates a process XML schema instance.
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ */
+public class WorkspaceTestCase extends TestCase
+{
+ private static final String XSD_URI = "@PROJECT-XSD-URI@";
+
+ private WorkspaceDirective m_workspace;
+
+ public void setUp() throws Exception
+ {
+ // get the sample xml file to parse
+
+ File testdir = new File( System.getProperty( "project.test.dir" ) );
+ File doc = new File( testdir, "workspace.xml" );
+
+ // define a system property declaring the location of the source xsd
+
+ File basedir = new File( System.getProperty( "project.basedir" ) );
+ File target = new File( basedir, "target" );
+ File deliverables = new File( target, "deliverables" );
+ File xsds = new File( deliverables, "xsds" );
+ String version = System.getProperty( "project.version" );
+ File xsd = new File( xsds, "dpml-process-" + version + ".xsd" );
+ System.setProperty( XSD_URI, xsd.toURI().toString() );
+
+ // parse the layout file
+
+ DOM3DocumentBuilder builder = new DOM3DocumentBuilder();
+ Document document = builder.parse( doc.toURI() );
+ Element element = document.getDocumentElement();
+
+ // setup the layout directive
+
+ WorkspaceDecoder decoder = new WorkspaceDecoder();
+ m_workspace = decoder.build( doc );
+ }
+
+ public void testWorkspace() throws Exception
+ {
+ System.out.println( "# WORKSPACE " + m_workspace.getName() );
+ ProductDirective[] products = m_workspace.getProductDirectives();
+ for( int i=0; i<products.length; i++ )
+ {
+ ProductDirective product = products[i];
+ System.out.print( "# " + product.getName() );
+ if( product instanceof DirectoryDirective )
+ {
+ DirectoryDirective dir = (DirectoryDirective) product;
+ System.out.println( "\t" + dir.getPath() );
+ }
+ else
+ {
+ System.out.println( "" );
+ }
+ }
+ assertEquals( "count", 7, products.length );
+ }
+
+ public void testLookup() throws Exception
+ {
+ System.out.println( "# LOOKUP " + m_workspace.getName() );
+ ProductDirective product = m_workspace.getProductDirective(
"target/reports/test" );
+ System.out.println( "# TEST " + product.getName() );
+ }
+}




  • r1441 - in trunk/main: depot/library/src/main/net/dpml/library depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/library/src/test/net/dpml/library/impl depot/library/src/test/net/dpml/library/info lang/process/etc lang/process/etc/test lang/process/src/main/net/dpml/lang/info lang/process/src/test/net/dpml/lang/info, mcconnell at BerliOS, 05/19/2006

Archive powered by MHonArc 2.6.24.

Top of Page