You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by le...@apache.org on 2004/06/15 20:18:12 UTC

svn commit: rev 21302 - in excalibur/sandbox/fortress2: . fortress2-api/src/java/org/apache/excalibur/fortress fortress2-impl/src/java/org/apache/excalibur/fortress fortress2-impl/src/test/org/apache/excalibur/fortress/test fortress2-tck fortress2-tck/src/java/org/apache/excalibur/fortress/tck

Author: leosimons
Date: Tue Jun 15 11:18:11 2004
New Revision: 21302

Added:
   excalibur/sandbox/fortress2/fortress2-api/src/java/org/apache/excalibur/fortress/Container.java
   excalibur/sandbox/fortress2/fortress2-tck/src/java/org/apache/excalibur/fortress/tck/AbstractContainerTestCase.java
Removed:
   excalibur/sandbox/fortress2/fortress2.iws
Modified:
   excalibur/sandbox/fortress2/_root.iml
   excalibur/sandbox/fortress2/build.xml
   excalibur/sandbox/fortress2/fortress2-impl/src/java/org/apache/excalibur/fortress/DefaultContainer.java
   excalibur/sandbox/fortress2/fortress2-impl/src/test/org/apache/excalibur/fortress/test/DefaultContainerTestCase.java
   excalibur/sandbox/fortress2/fortress2-tck/fortress2-tck.iml
Log:
Complete basic setup of fortress2 package layout. Sample unit test as well :-D

Modified: excalibur/sandbox/fortress2/_root.iml
==============================================================================
--- excalibur/sandbox/fortress2/_root.iml	(original)
+++ excalibur/sandbox/fortress2/_root.iml	Tue Jun 15 11:18:11 2004
@@ -4,7 +4,10 @@
   <component name="NewModuleRootManager">
     <output url="file://$MODULE_DIR$/target/classes" />
     <exclude-output />
-    <content url="file://$MODULE_DIR$" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/fortress2-tck/src/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/fortress2-tck/src/test" isTestSource="true" />
+    </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>

Modified: excalibur/sandbox/fortress2/build.xml
==============================================================================
--- excalibur/sandbox/fortress2/build.xml	(original)
+++ excalibur/sandbox/fortress2/build.xml	Tue Jun 15 11:18:11 2004
@@ -8,6 +8,7 @@
     <!-- the ordering is important! :-D -->
     <property name="subprojects" value="
                                       fortress2-api/
+                                      fortress2-tck/
                                       fortress2-impl/
 
                                       ecm/

Added: excalibur/sandbox/fortress2/fortress2-api/src/java/org/apache/excalibur/fortress/Container.java
==============================================================================
--- (empty file)
+++ excalibur/sandbox/fortress2/fortress2-api/src/java/org/apache/excalibur/fortress/Container.java	Tue Jun 15 11:18:11 2004
@@ -0,0 +1,27 @@
+/*
+* Copyright 2003-2004 The 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.excalibur.fortress;
+
+/**
+ * 
+ *
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public interface Container
+{
+    Object getComponent( String name );
+}

Modified: excalibur/sandbox/fortress2/fortress2-impl/src/java/org/apache/excalibur/fortress/DefaultContainer.java
==============================================================================
--- excalibur/sandbox/fortress2/fortress2-impl/src/java/org/apache/excalibur/fortress/DefaultContainer.java	(original)
+++ excalibur/sandbox/fortress2/fortress2-impl/src/java/org/apache/excalibur/fortress/DefaultContainer.java	Tue Jun 15 11:18:11 2004
@@ -21,6 +21,16 @@
  *
  * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
  */
-public class DefaultContainer
+public class DefaultContainer implements Container
 {
+    public DefaultContainer()
+    {
+    }
+
+    public Object getComponent( String name )
+    {
+        if( name == null ) throw new IllegalArgumentException();
+
+        return null;
+    }
 }

Modified: excalibur/sandbox/fortress2/fortress2-impl/src/test/org/apache/excalibur/fortress/test/DefaultContainerTestCase.java
==============================================================================
--- excalibur/sandbox/fortress2/fortress2-impl/src/test/org/apache/excalibur/fortress/test/DefaultContainerTestCase.java	(original)
+++ excalibur/sandbox/fortress2/fortress2-impl/src/test/org/apache/excalibur/fortress/test/DefaultContainerTestCase.java	Tue Jun 15 11:18:11 2004
@@ -17,15 +17,18 @@
 package org.apache.excalibur.fortress.test;
 
 import org.apache.excalibur.fortress.DefaultContainer;
-
-import junit.framework.TestCase;
+import org.apache.excalibur.fortress.Container;
+import org.apache.excalibur.fortress.tck.AbstractContainerTestCase;
 
 /**
  * 
  *
  * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
  */
-public class DefaultContainerTestCase extends TestCase
+public class DefaultContainerTestCase extends AbstractContainerTestCase
 {
-//test subversion integration...    
+    protected Container getContainer()
+    {
+        return new DefaultContainer();
+    }
 }

Modified: excalibur/sandbox/fortress2/fortress2-tck/fortress2-tck.iml
==============================================================================
--- excalibur/sandbox/fortress2/fortress2-tck/fortress2-tck.iml	(original)
+++ excalibur/sandbox/fortress2/fortress2-tck/fortress2-tck.iml	Tue Jun 15 11:18:11 2004
@@ -12,6 +12,7 @@
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="fortress2-api" />
+    <orderEntry type="library" name="junit-3.8.1" level="project" />
   </component>
 </module>
 

Added: excalibur/sandbox/fortress2/fortress2-tck/src/java/org/apache/excalibur/fortress/tck/AbstractContainerTestCase.java
==============================================================================
--- (empty file)
+++ excalibur/sandbox/fortress2/fortress2-tck/src/java/org/apache/excalibur/fortress/tck/AbstractContainerTestCase.java	Tue Jun 15 11:18:11 2004
@@ -0,0 +1,45 @@
+/*
+* Copyright 2003-2004 The 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.excalibur.fortress.tck;
+
+import org.apache.excalibur.fortress.Container;
+import junit.framework.TestCase;
+
+/**
+ * 
+ *
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public abstract class AbstractContainerTestCase extends TestCase
+{
+    private Container m_container;
+    protected abstract Container getContainer();
+
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        m_container = getContainer();
+    }
+
+    public void testGetComponentThrowsIllegalArgumentExceptionOnNullKey()
+    {
+        try
+        {
+            m_container.getComponent( null );
+        } catch( IllegalArgumentException iae ) {}
+    }
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org