struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvanma...@apache.org
Subject svn commit: r411581 - in /struts/shale/branches/mvn_reorg/shale-clay/src/test: java/org/apache/shale/clay/config/ java/org/apache/shale/clay/parser/ java/org/apache/shale/clay/utils/ resources/org/apache/shale/clay/utils/
Date Sun, 04 Jun 2006 16:22:04 GMT
Author: gvanmatre
Date: Sun Jun  4 09:22:01 2006
New Revision: 411581

URL: http://svn.apache.org/viewvc?rev=411581&view=rev
Log:
Moved a test resource to the correct folder.  Changed the parameter order on several asserted
junit tests.

Added:
    struts/shale/branches/mvn_reorg/shale-clay/src/test/resources/org/apache/shale/clay/utils/
    struts/shale/branches/mvn_reorg/shale-clay/src/test/resources/org/apache/shale/clay/utils/hello.html
      - copied unchanged from r411579, struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/utils/hello.html
Removed:
    struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/utils/hello.html
Modified:
    struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/CommentTestCase.java
    struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/SymbolsTestCase.java
    struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/parser/ParserTestCase.java
    struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/utils/ClayAmalgamTestCase.java

Modified: struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/CommentTestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/CommentTestCase.java?rev=411581&r1=411580&r2=411581&view=diff
==============================================================================
--- struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/CommentTestCase.java
(original)
+++ struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/CommentTestCase.java
Sun Jun  4 09:22:01 2006
@@ -127,14 +127,14 @@
         
         Parser p = new Parser();
         List nodes = p.parse(writer.getBuffer());
-        assertEquals("1 root node", nodes.size(), 1);
+        assertEquals("1 root node", 1, nodes.size());
 
         Node comment = findComment((Node) nodes.get(0));
         assertNotNull("comment found", comment);       
         assertTrue("is a comment", comment.isComment());
         
         StringBuffer buff = concatCommentText(comment);      
-        assertEquals(buff.toString(), "<!-- <span jsfid=\"outputText\"/> -->");
+        assertEquals("<!-- <span jsfid=\"outputText\"/> -->", buff.toString());
         
         writer.close();
         
@@ -171,14 +171,14 @@
         
         Parser p = new Parser();
         List nodes = p.parse(writer.getBuffer());
-        assertEquals("1 root node", nodes.size(), 1);
+        assertEquals("1 root node", 1, nodes.size());
         
         Node comment = findComment((Node) nodes.get(0));
         assertNotNull("comment found", comment);       
         assertTrue("is a comment", comment.isComment());
         
         StringBuffer buff = concatCommentText(comment);      
-        assertEquals(buff.toString(), "<!-- <span jsfid=\"outputText\"/> -->");
+        assertEquals("<!-- <span jsfid=\"outputText\"/> -->", buff.toString());
       
         writer.close();
     }

Modified: struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/SymbolsTestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/SymbolsTestCase.java?rev=411581&r1=411580&r2=411581&view=diff
==============================================================================
--- struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/SymbolsTestCase.java
(original)
+++ struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/config/SymbolsTestCase.java
Sun Jun  4 09:22:01 2006
@@ -77,7 +77,7 @@
        
        Command command = new PropertyValueCommand();
        boolean isFinal = command.execute(clayContext);
-       assertEquals("command finished", isFinal, true);       
+       assertEquals("command finished", true, isFinal);       
        assertEquals("value = 10", child.getValue(), "10");
 
        
@@ -91,8 +91,8 @@
        attr.setValue("#{goodYear}");
 
        isFinal = command.execute(clayContext);
-       assertEquals("command finished", isFinal, true);       
-       assertEquals("value = 1969", child.getValue(), "1969");
+       assertEquals("command finished", true, isFinal);       
+       assertEquals("value = 1969", "1969", child.getValue());
        
        child = (javax.faces.component.html.HtmlOutputText) 
                              facesContext.getApplication().createComponent("javax.faces.HtmlOutputText");

@@ -104,7 +104,7 @@
        attr.setValue("#{ping}");
 
        isFinal = command.execute(clayContext);
-       assertEquals("command finished", isFinal, true);       
+       assertEquals("command finished", true, isFinal);       
        assertEquals("value = pong", child.getValue(), "pong");
 
 
@@ -117,8 +117,8 @@
        attr.setValue("#{forManfred}");
 
        isFinal = command.execute(clayContext);
-       assertEquals("command finished", isFinal, true);       
-       assertEquals("value = #{forManfred}", child.getValue(), "#{forManfred}");
+       assertEquals("command finished", true, isFinal);       
+       assertEquals("value = #{forManfred}", "#{forManfred}", child.getValue());
 
         
     }
@@ -154,8 +154,8 @@
            
            Command command = new PropertyValueCommand();
            boolean isFinal = command.execute(clayContext);
-           assertEquals("command finished", isFinal, true);       
-           assertEquals("value = 10", child.getValue(), "10");
+           assertEquals("command finished", true, isFinal);       
+           assertEquals("value = 10", "10", child.getValue());
 
            
            // test a symbol value of an el value
@@ -174,8 +174,8 @@
            clayContext.setSymbols(displayElement.getSymbols());
            
            isFinal = command.execute(clayContext);
-           assertEquals("command finished", isFinal, true);       
-           assertEquals("value = 10", child.getValue(), "10");
+           assertEquals("command finished", true, isFinal);       
+           assertEquals("value = 10", "10", child.getValue());
 
            
            // test a symbol value with a null value symbol replacement
@@ -193,8 +193,8 @@
            clayContext.setSymbols(displayElement.getSymbols());
            
            isFinal = command.execute(clayContext);
-           assertEquals("command finished", isFinal, true);       
-           assertEquals("value = null", child.getValue(), null);
+           assertEquals("command finished", true, isFinal);       
+           assertEquals("value = null", null, child.getValue());
 
 
            // test a symbol value with an empty String value.  
@@ -213,8 +213,8 @@
            clayContext.setSymbols(displayElement.getSymbols());
            
            isFinal = command.execute(clayContext);
-           assertEquals("command finished", isFinal, true);       
-           assertEquals("value = null", child.getValue(), null);
+           assertEquals("command finished", true, isFinal);       
+           assertEquals("value = null", null, child.getValue());
 
            //no symbol replacement for a empty string - should return
            //an empty string.  This allows components like the selectItem
@@ -230,8 +230,8 @@
            clayContext.setDisplayElement(displayElement);
            
            isFinal = command.execute(clayContext);
-           assertEquals("command finished", isFinal, true);       
-           assertEquals("value = \"\"", child.getValue(), "");
+           assertEquals("command finished", true, isFinal);       
+           assertEquals("value = \"\"", "", child.getValue());
 
            //Case insensitive and reoccurring replacement
            attr.setValue("@TeSt1, @tEst1 never @test2; @test1, @teSt1 till ya @tesT3"); 
//test multiple symbols           
@@ -251,9 +251,9 @@
            clayContext.setSymbols(displayElement.getSymbols());
            
            isFinal = command.execute(clayContext);
-           assertEquals("command finished", isFinal, true);       
+           assertEquals("command finished", true, isFinal);       
            assertEquals("value = \"rock, rock never stop; rock, rock till ya drop\"", 
-                   child.getValue(), "rock, rock never stop; rock, rock till ya drop");
+                   "rock, rock never stop; rock, rock till ya drop", child.getValue());
 
     }
 
@@ -282,12 +282,12 @@
         
         Command command = new CreateComponentCommand();
         boolean isFinal = command.execute(clayContext);
-        assertEquals("command finished", isFinal, false);
+        assertEquals("command finished", false, isFinal);
         
         UIComponent child = (UIComponent) clayContext.getChild();
         assertNotNull("child", child);
         
-        assertEquals("id = test", child.getId(), "test");
+        assertEquals("id = test", "test", child.getId());
         
         
         //null component id symbol replacement
@@ -387,8 +387,8 @@
         
         Command command = new PropertyValueCommand();
         boolean isFinal = command.execute(clayContext);
-        assertEquals("command finished", isFinal, true);       
-        assertEquals("value = 6743", child.getValue(), "6743");      
+        assertEquals("command finished", true, isFinal);       
+        assertEquals("value = 6743", "6743", child.getValue());      
 
     
         //create a target component
@@ -403,8 +403,8 @@
         clayContext.setChild(child);
 
         isFinal = command.execute(clayContext);
-        assertEquals("command finished", isFinal, true);       
-        assertEquals("value = 6743", child.getValue(), "6743");      
+        assertEquals("command finished", true, isFinal);       
+        assertEquals("value = 6743", "6743", child.getValue());      
 
 
         
@@ -420,8 +420,8 @@
         clayContext.setChild(child);
 
         isFinal = command.execute(clayContext);
-        assertEquals("command finished", isFinal, true);       
-        assertEquals("value = 6743", child.getValue(), "6743");      
+        assertEquals("command finished", true, isFinal);       
+        assertEquals("value = 6743", "6743", child.getValue());      
         
         
     }
@@ -438,7 +438,7 @@
         //look for a base symbol definition
         String symbol = (String) bean.getSymbols().get("@mystyle");
         assertNotNull(symbol);
-        assertEquals("@mystyle == color:blue", symbol, "color:blue");
+        assertEquals("@mystyle == color:blue", "color:blue", symbol);
 
         // symbol1Label extends baseSymbolLabel
         bean = standardConfigBean.getElement("symbol1Label");
@@ -446,7 +446,7 @@
         //look for inherited symbol
         symbol = (String) bean.getSymbols().get("@mystyle");
         assertNotNull(symbol);
-        assertEquals("@mystyle == color:blue", symbol, "color:blue");
+        assertEquals("@mystyle == color:blue", "color:blue", symbol);
 
         // symbol2Label extends symbol1Label
         bean = standardConfigBean.getElement("symbol2Label");
@@ -454,7 +454,7 @@
         //look for an overridden symbol
         symbol = (String) bean.getSymbols().get("@mystyle");
         assertNotNull(symbol);
-        assertEquals("@mystyle == color:red", symbol, "color:red");
+        assertEquals("@mystyle == color:red", "color:red", symbol);
 
         
         //test nested/inner element inheritance
@@ -469,12 +469,12 @@
                 //look for inherited symbol
                 symbol = (String) ebean.getSymbols().get("@mystyle");
                 assertNotNull(symbol);
-                assertEquals("@mystyle == color:blue", symbol, "color:blue");           
    
+                assertEquals("@mystyle == color:blue", "color:blue", symbol);           
    
             } else if (ebean.getRenderId() == 2) {
                 //look for an overridden symbol
                 symbol = (String) ebean.getSymbols().get("@mystyle");
                 assertNotNull(symbol);
-                assertEquals("@mystyle == color:red", symbol, "color:red");
+                assertEquals("@mystyle == color:red", "color:red", symbol);
                 
             }
         }

Modified: struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/parser/ParserTestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/parser/ParserTestCase.java?rev=411581&r1=411580&r2=411581&view=diff
==============================================================================
--- struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/parser/ParserTestCase.java
(original)
+++ struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/parser/ParserTestCase.java
Sun Jun  4 09:22:01 2006
@@ -460,13 +460,13 @@
         Node node = (Node) nodes.get(0);
 
         String value = (String) node.getAttributes().get("type");
-        assertEquals("Attribute type", value, "text");
+        assertEquals("Attribute type", "text", value);
         
         value = (String) node.getAttributes().get("size");
-        assertEquals("Attribute size", value, "10");
+        assertEquals("Attribute size", "10", value);
         
         value = (String) node.getAttributes().get("name");
-        assertEquals("Attribute name", value, "date");
+        assertEquals("Attribute name", "date", value);
 
         //test linespan with bogus whitespace
         doc.setLength(0);
@@ -478,13 +478,13 @@
         node = (Node) nodes.get(0);
 
         value = (String) node.getAttributes().get("type");
-        assertEquals("Attribute type", value, "text");
+        assertEquals("Attribute type", "text", value);
         
         value = (String) node.getAttributes().get("size");
-        assertEquals("Attribute size", value, "10");
+        assertEquals("Attribute size", "10", value);
         
         value = (String) node.getAttributes().get("name");
-        assertEquals("Attribute name", value, "date");
+        assertEquals("Attribute name", "date", value);
 
        
         //test bogus attribute with missing delimiter
@@ -497,13 +497,13 @@
         node = (Node) nodes.get(0);
 
         value = (String) node.getAttributes().get("type");
-        assertEquals("Attribute type ", value, "text ");
+        assertEquals("Attribute type ", "text ", value);
 
         value = (String) node.getAttributes().get("size");
-        assertEquals("Attribute size", value, "10");
+        assertEquals("Attribute size", "10", value);
 
         value = (String) node.getAttributes().get("name");
-        assertEquals("Attribute name", value, "date");
+        assertEquals("Attribute name", "date", value);
 
       
         //test bogus attribute with missing delimiter
@@ -516,10 +516,10 @@
         node = (Node) nodes.get(0);
 
         value = (String) node.getAttributes().get("type");
-        assertEquals("Attribute type", value, "radio");
+        assertEquals("Attribute type", "radio", value);
 
         value = (String) node.getAttributes().get("name");
-        assertEquals("Attribute name", value, "date");
+        assertEquals("Attribute name", "date", value);
         
         assertTrue("Attribute checked exists", node.getAttributes().containsKey("checked"));
         value = (String) node.getAttributes().get("checked");
@@ -554,7 +554,7 @@
 
         
         value = (String) node.getAttributes().get("href");
-        assertEquals("Attribute href",  value, "http://www.acme.com");   
+        assertEquals("Attribute href",  "http://www.acme.com", value);   
             
     }
     
@@ -574,19 +574,19 @@
         assertNotNull("table", table);
         
         List trs = table.getChildren();
-        assertEquals("trs, 2 root nodes", trs.size(), 2);   
+        assertEquals("trs, 2 root nodes", 2, trs.size());   
         
         Node tr = (Node) trs.get(0);
         assertNotNull("tr row 1", tr);
         
         List ths = tr.getChildren();
-        assertEquals("ths, 2 root nodes", ths.size(), 2);           
+        assertEquals("ths, 2 root nodes", 2, ths.size());           
         
         tr = (Node) trs.get(1);
         assertNotNull("tr row 2", tr);
         
         List tds = tr.getChildren();
-        assertEquals("tds, 2 root nodes", tds.size(), 2);           
+        assertEquals("tds, 2 root nodes", 2, tds.size());           
         
         
     }
@@ -621,9 +621,9 @@
         Node message = (Node) td.getChildren().get(0);
         assertNotNull("bean:message node not null", message);
         
-        assertEquals("node.name", message.getName(), "message");
-        assertEquals("node.qname", message.getQname(), "bean");
-        assertEquals("node.attributes.key", message.getAttributes().get("key"), "msg.username");
+        assertEquals("node.name", "message", message.getName());
+        assertEquals("node.qname", "bean", message.getQname());
+        assertEquals("node.attributes.key", "msg.username", message.getAttributes().get("key"));
        
         td = (Node) tr.getChildren().get(1);
         assertNotNull("td node not null", td);
@@ -631,11 +631,11 @@
         Node text = (Node) td.getChildren().get(0);
         assertNotNull("bean:message node not null", text);
         
-        assertEquals("node.name", text.getName(), "text");
-        assertEquals("node.qname", text.getQname(), "html");
-        assertEquals("node.attributes.property", text.getAttributes().get("property"), "userName");
-        assertEquals("node.attributes.size", text.getAttributes().get("size"), "10");
-        assertEquals("node.attributes.maxlength", text.getAttributes().get("maxlength"),
"10");  
+        assertEquals("node.name", "text", text.getName());
+        assertEquals("node.qname", "html", text.getQname());
+        assertEquals("node.attributes.property", "userName", text.getAttributes().get("property"));
+        assertEquals("node.attributes.size", "10", text.getAttributes().get("size"));
+        assertEquals("node.attributes.maxlength", "10", text.getAttributes().get("maxlength"));
 
 
     }
     
@@ -653,7 +653,7 @@
         Node root = (Node) nodes.get(1);
         assertNotNull("last node", root);
 
-        assertEquals("node raw text", root.getToken().getRawText(), "test");
+        assertEquals("node raw text", "test", root.getToken().getRawText());
 
 
         doc.setLength(0);
@@ -665,7 +665,7 @@
         root = (Node) nodes.get(0);
         assertNotNull("first node", root);
 
-        assertEquals("node raw text", root.getToken().getRawText(), doc.toString());
+        assertEquals("node raw text", doc.toString(), root.getToken().getRawText());
 
         
     }

Modified: struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/utils/ClayAmalgamTestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/utils/ClayAmalgamTestCase.java?rev=411581&r1=411580&r2=411581&view=diff
==============================================================================
--- struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/utils/ClayAmalgamTestCase.java
(original)
+++ struts/shale/branches/mvn_reorg/shale-clay/src/test/java/org/apache/shale/clay/utils/ClayAmalgamTestCase.java
Sun Jun  4 09:22:01 2006
@@ -76,21 +76,20 @@
        
        clayAmalgam.clayImport(facesContext, component, displayElement);
        
-       assertEquals("jsfid", displayElement.getJsfid(), "outputText");
-       assertEquals("componentType", displayElement.getComponentType(), "javax.faces.HtmlOutputText");
+       assertEquals("jsfid", "outputText", displayElement.getJsfid());
+       assertEquals("componentType", "javax.faces.HtmlOutputText", displayElement.getComponentType());
        
        AttributeBean attr = displayElement.getAttribute("escape");
        assertNotNull("escape", attr);
-       assertEquals("escape", attr.getValue(), Boolean.FALSE.toString());
+       assertEquals("escape", Boolean.FALSE.toString(), attr.getValue());
        
        attr = displayElement.getAttribute("isTransient");
        assertNotNull("isTransient", attr);
-       assertEquals("isTransient", attr.getValue(), Boolean.TRUE.toString());
+       assertEquals("isTransient", Boolean.TRUE.toString(), attr.getValue());
        
        attr = displayElement.getAttribute("value");
        assertNotNull("value", attr);
-//       FIXME - following test fails because attr.getValue() returns ""
-//       assertEquals("value", attr.getValue(), "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body
bgcolor=\"blue\"&gt;Hello World&lt;/body&gt;&lt;/html&gt;");
+       assertEquals("value", "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body
bgcolor=\"blue\"&gt;Hello World&lt;/body&gt;&lt;/html&gt;", attr.getValue());
 
        //test excapeXml=false
        component.getAttributes().put("escapeXml", Boolean.FALSE.toString());
@@ -101,21 +100,20 @@
       
        clayAmalgam.clayImport(facesContext, component, displayElement);
        
-       assertEquals("jsfid", displayElement.getJsfid(), "outputText");
-       assertEquals("componentType", displayElement.getComponentType(), "javax.faces.HtmlOutputText");
+       assertEquals("jsfid", "outputText", displayElement.getJsfid());
+       assertEquals("componentType", "javax.faces.HtmlOutputText", displayElement.getComponentType());
        
        attr = displayElement.getAttribute("escape");
        assertNotNull("escape", attr);
-       assertEquals("escape", attr.getValue(), Boolean.FALSE.toString());
+       assertEquals("escape", Boolean.FALSE.toString(), attr.getValue());
        
        attr = displayElement.getAttribute("isTransient");
        assertNotNull("isTransient", attr);
-       assertEquals("isTransient", attr.getValue(), Boolean.TRUE.toString());
+       assertEquals("isTransient", Boolean.TRUE.toString(), attr.getValue());
        
        attr = displayElement.getAttribute("value");
        assertNotNull("value", attr);
-//       FIXME - following test fails because attr.getValue() returns ""
-//       assertEquals("value", attr.getValue(), "<html><head></head><body
bgcolor=\"blue\">Hello World</body></html>");
+       assertEquals("value", "<html><head></head><body bgcolor=\"blue\">Hello
World</body></html>", attr.getValue());
 
        
        //test no file found
@@ -136,7 +134,7 @@
        clayAmalgam.clayImport(facesContext, component, displayElement);
        attr = displayElement.getAttribute("value");
        assertNotNull("value", attr);
-       assertEquals("value", attr.getValue(), "");
+       assertEquals("value", "", attr.getValue());
 
        
     }
@@ -156,20 +154,20 @@
    
         clayAmalgam.clayOut(facesContext, component, displayElement);
         
-        assertEquals("jsfid", displayElement.getJsfid(), "outputText");
-        assertEquals("componentType", displayElement.getComponentType(), "javax.faces.HtmlOutputText");
+        assertEquals("jsfid", "outputText", displayElement.getJsfid());
+        assertEquals("componentType", "javax.faces.HtmlOutputText", displayElement.getComponentType());
         
         AttributeBean attr = displayElement.getAttribute("escape");
         assertNotNull("escape", attr);
-        assertEquals("escape", attr.getValue(), Boolean.FALSE.toString());
+        assertEquals("escape", Boolean.FALSE.toString(), attr.getValue());
         
         attr = displayElement.getAttribute("isTransient");
         assertNotNull("isTransient", attr);
-        assertEquals("isTransient", attr.getValue(), Boolean.TRUE.toString());
+        assertEquals("isTransient", Boolean.TRUE.toString(), attr.getValue());
         
         attr = displayElement.getAttribute("value");
         assertNotNull("value", attr);
-        assertEquals("value", attr.getValue(), "<html><head></head><body
bgcolor=\"blue\">Hello World</body></html>");
+        assertEquals("value", "<html><head></head><body bgcolor=\"blue\">Hello
World</body></html>", attr.getValue());
           
     }
     



Mime
View raw message