Author: mcconnell
Date: Thu Jun 10 07:56:40 2004
New Revision: 21013

Added:
   
avalon/trunk/runtime/composition/spi/src/java/org/apache/avalon/composition/util/
   
avalon/trunk/runtime/composition/spi/src/java/org/apache/avalon/composition/util/DefaultState.java
   (contents, props changed)
   
avalon/trunk/runtime/composition/spi/src/java/org/apache/avalon/composition/util/package.html
   (contents, props changed)
Removed:
   
avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/util/DefaultState.java
Modified:
   
avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/impl/fileset/FilesetModelTestCase.java
Log:
move DefaultState from composition-impl to composition-spi because its 
referenced from activation impl which should only have referenceds to 
composition-api and -spi.

Modified: 
avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/impl/fileset/FilesetModelTestCase.java
==============================================================================
--- 
avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/impl/fileset/FilesetModelTestCase.java
   (original)
+++ 
avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/impl/fileset/FilesetModelTestCase.java
   Thu Jun 10 07:56:40 2004
@@ -182,15 +182,15 @@
      */
     public void testWildcardIncludes() throws Exception
     {
-        // testing an include directive = "*.jar"
+        // testing an include directive = "*.widget"
         IncludeDirective[] includes = new IncludeDirective[1];
-        includes[0] = new IncludeDirective( "*.jar" );
+        includes[0] = new IncludeDirective( "*.widget" );
 
         // testing empty exclude directives
         ExcludeDirective[] excludes = new ExcludeDirective[0];
 
         // provide legitimate fileset directory attribute
-        final String dir = "ext";
+        final String dir = "fileset";        
         FilesetDirective fsd = new FilesetDirective( dir, includes, excludes );
 
         // create the fileset model's anchor directory
@@ -207,7 +207,9 @@
             ArrayList list = m_model.getIncludes();
             if ( list.size() != 4 )
             {
-                fail( "The include set returned did not equal 4 (four) 
entries" );
+                fail( 
+                  "The include set returned [" + list.size() 
+                  + "] entries which does not equal 4 (four) expected entries" 
);
             }
             for ( int i = 0; i < list.size(); i++ )
             {
@@ -216,9 +218,9 @@
                 {
                     fail( "One of the included entries is not a file" );
                 }
-                if ( !file.getName().endsWith( "jar" ) )
+                if ( !file.getName().endsWith( "widget" ) )
                 {
-                    fail( "One of the included file entries does not have a 
.jar extension" );
+                    fail( "One of the included file entries does not have a 
.widget extension" );
                 }
             }
         }
@@ -250,16 +252,16 @@
      */
     public void testIncludeExcludes() throws Exception
     {
-        // testing an include directive = "*.jar"
+        // testing an include directive = "*.widget"
         IncludeDirective[] includes = new IncludeDirective[1];
-        includes[0] = new IncludeDirective( "*.jar" );
+        includes[0] = new IncludeDirective( "*.widget" );
 
-        // testing an exclude directive = "test*.jar"
+        // testing an exclude directive = "test*.widget"
         ExcludeDirective[] excludes = new ExcludeDirective[1];
-        excludes[0] = new ExcludeDirective( "test*.jar" );
+        excludes[0] = new ExcludeDirective( "test*.widget" );
 
         // provide legitimate fileset directory attribute
-        final String dir = "ext";
+        final String dir = "fileset";
         FilesetDirective fsd = new FilesetDirective( dir, includes, excludes );
 
         // create the fileset model's anchor directory
@@ -285,9 +287,9 @@
                 {
                     fail( "One of the included entries is not a file" );
                 }
-                if ( !file.getName().endsWith( "jar" ) )
+                if ( !file.getName().endsWith( "widget" ) )
                 {
-                    fail( "One of the included file entries does not have a 
.jar extension" );
+                    fail( "One of the included file entries does not have a 
.widget extension" );
                 }
                 if ( file.getName().startsWith( "test" ) )
                 {
@@ -321,15 +323,15 @@
      */
     public void testRecursiveIncludes() throws Exception
     {
-        // testing an include directive = "**/*.jar"
+        // testing an include directive = "**/*.widget"
         IncludeDirective[] includes = new IncludeDirective[1];
-        includes[0] = new IncludeDirective( "**/*.jar" );
+        includes[0] = new IncludeDirective( "**/*.widget" );
 
         // testing empty exclude directives
         ExcludeDirective[] excludes = new ExcludeDirective[0];
 
         // provide legitimate fileset directory attribute
-        final String dir = ".";
+        final String dir = "fileset";
         FilesetDirective fsd = new FilesetDirective( dir, includes, excludes );
 
         // create the fileset model's anchor directory
@@ -355,9 +357,9 @@
                 {
                     fail( "One of the included entries is not a file" );
                 }
-                if ( !file.getName().endsWith( "jar" ) )
+                if ( !file.getName().endsWith( "widget" ) )
                 {
-                    fail( "One of the included file entries does not have a 
.jar extension" );
+                    fail( "One of the included file entries does not have a 
.widget extension" );
                 }
             }
         }

Added: 
avalon/trunk/runtime/composition/spi/src/java/org/apache/avalon/composition/util/DefaultState.java
==============================================================================
--- (empty file)
+++ 
avalon/trunk/runtime/composition/spi/src/java/org/apache/avalon/composition/util/DefaultState.java
  Thu Jun 10 07:56:40 2004
@@ -0,0 +1,62 @@
+/* 
+ * Copyright 2004 Apache Software Foundation
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ * 
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.avalon.composition.util;
+
+/**
+ * The State class desribes the state of a simple action.  The state
+ * may reflect a boolean EXECUTING and a boolean ENABLED.  
+ *
+ * @author <a href="mailto:dev@avalon.apache.org";>Avalon Development Team</a>
+ * @version $Revision: 1.1 $ $Date: 2004/02/10 16:23:34 $
+ */
+
+public class DefaultState
+{
+
+    
//---------------------------------------------------------------------------
+    // state
+    
//---------------------------------------------------------------------------
+
+    private boolean m_enabled = false;
+
+    
//---------------------------------------------------------------------------
+    // State
+    
//---------------------------------------------------------------------------
+
+   /**
+    * Return the enabled state of the state.
+    * @return TRUE if the state has been enabled else FALSE
+    */
+    public boolean isEnabled()
+    {
+        return m_enabled;
+    }
+
+    
//---------------------------------------------------------------------------
+    // implementation
+    
//---------------------------------------------------------------------------
+
+   /**
+    * Set the enabled state of the state.
+    * @param enabled the enabled state to assign
+    */
+    public void setEnabled( boolean enabled ) throws IllegalStateException
+    {
+        m_enabled = enabled;
+    }
+}

Added: 
avalon/trunk/runtime/composition/spi/src/java/org/apache/avalon/composition/util/package.html
==============================================================================
--- (empty file)
+++ 
avalon/trunk/runtime/composition/spi/src/java/org/apache/avalon/composition/util/package.html
       Thu Jun 10 07:56:40 2004
@@ -0,0 +1,4 @@
+<body>
+<p>The <code>util</code> package contains a number of general component
+utilities.</p>
+</body>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to