You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/06/18 00:36:41 UTC
svn commit: r955775 - in
/myfaces/tomahawk/trunk/core12/src/test/java/org/apache/myfaces/custom/htmltag:
./ HtmlTagRendererTest.java
Author: lu4242
Date: Thu Jun 17 22:36:41 2010
New Revision: 955775
URL: http://svn.apache.org/viewvc?rev=955775&view=rev
Log:
rename package
Added:
myfaces/tomahawk/trunk/core12/src/test/java/org/apache/myfaces/custom/htmltag/
myfaces/tomahawk/trunk/core12/src/test/java/org/apache/myfaces/custom/htmltag/HtmlTagRendererTest.java
Added: myfaces/tomahawk/trunk/core12/src/test/java/org/apache/myfaces/custom/htmltag/HtmlTagRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core12/src/test/java/org/apache/myfaces/custom/htmltag/HtmlTagRendererTest.java?rev=955775&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core12/src/test/java/org/apache/myfaces/custom/htmltag/HtmlTagRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core12/src/test/java/org/apache/myfaces/custom/htmltag/HtmlTagRendererTest.java Thu Jun 17 22:36:41 2010
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.htmltag;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.custom.htmlTag.HtmlTag;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class HtmlTagRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private HtmlTag tag;
+
+ public HtmlTagRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(HtmlTagRendererTest.class);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ tag = new HtmlTag();
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ tag = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ };
+
+ tag.setValue("div");
+ MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ tag, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}