Author: ddewolf
Date: Thu Nov  9 10:47:09 2006
New Revision: 473016

URL: http://svn.apache.org/viewvc?view=rev&rev=473016
Log:
All selenium tests now pass, including definition tags that use the mutable 
container

Modified:
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java
    struts/sandbox/trunk/tiles/tiles-test/src/main/webapp/index.jsp

Modified: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java?view=diff&rev=473016&r1=473015&r2=473016
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java
 Thu Nov  9 10:47:09 2006
@@ -51,13 +51,20 @@
         }
 
         for(ComponentAttribute attr : definition.getAttributes().values()) {
-            if(ComponentAttribute.DEFINITION.equals(attr.getType())) {
+            if(isDefinition(attr)) {
                 ComponentDefinition d = 
getDefinition(attr.getValue().toString(), null);
                 attr.setAttributes(d.getAttributes());
             }
         }
 
         definitions.put(definition.getName(), definition);
+    }
+
+    private boolean isDefinition(ComponentAttribute attribute) throws 
DefinitionsFactoryException {
+        boolean explicit =  
ComponentAttribute.DEFINITION.equals(attribute.getType());
+        boolean implicit =  attribute.getType() == null  &&
+                            (getDefinition((String)attribute.getValue(), null) 
!= null);
+        return explicit || implicit;
     }
 
     private void validate(TileDefinition definition) {

Modified: struts/sandbox/trunk/tiles/tiles-test/src/main/webapp/index.jsp
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-test/src/main/webapp/index.jsp?view=diff&rev=473016&r1=473015&r2=473016
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-test/src/main/webapp/index.jsp (original)
+++ struts/sandbox/trunk/tiles/tiles-test/src/main/webapp/index.jsp Thu Nov  9 
10:47:09 2006
@@ -28,6 +28,8 @@
     <h1>Tiles 2 Test Application</h1>
     
     <h2>Currently working tests</h2>
+
+    <h3>Standard Render/Attribute Tests</h3>
     <a href="testinsertdefinition.jsp">Test Insert Configured 
Definition</a><br/>
     <a href="testinsertdefinition_preparer.jsp">Test Insert Configured 
Definition with Preparer</a><br/>
     <a href="testinsertdefinition_classpath.jsp">Test Insert Configured 
Classpath Definition</a><br/>
@@ -35,20 +37,19 @@
     <a href="testinsertdefinition_override.jsp">Test Insert Configured 
Definition with an overridden content</a><br/>
     <a href="testinsertdefinition_inline.jsp">Test Insert Configured 
Definition with an inline content</a><br/>
     <a href="testinsertdefinition_composite.jsp">Test Insert Configured 
Definition that contains another definition inside</a><br/>
-    <!-- Broken Tests Go Here! -->
     <a href="testput.jsp">Test Put Tag</a><br/>
     <a href="testput_servlet.jsp">Test Put Tag using a servlet mapping as a 
template</a><br/>
     <a href="testimportattribute.jsp">Test importAttribute Tag</a><br/>
     <a href="testimportattribute_all.jsp">Test importAttribute Tag with no 
name</a><br/>
 
-    <h2>Container Management Tags</h2>
+    <h3>Mutable Container Tests</h3>
     <a href="testinitcontainer.jsp">Test Initialize Container</a><br/>
     <a href="testdef.jsp">Test Definition Tag</a><br/>
     <a href="testinsertdefinition_composite_tags_includes_configured.jsp">Test 
Insert Definition that contains another definition inside (configured via 
tiles-defs.xml) using JSP tags</a><br/>
     <a href="testinsertdefinition_composite_tags.jsp">Test Insert Definition 
that contains another definition inside using JSP tags</a><br/>
-
-    <h2>Currently not working tests</h2>
     <a 
href="testinsertdefinition_composite_tags_includes_configured_notype.jsp">Test 
Insert Definition that contains another definition inside (configured via 
tiles-defs.xml) using JSP tags without types</a><br/>
     <a href="testinsertdefinition_composite_tags_notype.jsp">Test Insert 
Definition that contains another definition inside using JSP tags without 
types</a><br/></body>
+
+    <h2>Currently not working tests</h2>
 
 </html>


Reply via email to