Author: julien(a)jboss.com
Date: 2007-02-10 19:30:13 -0500 (Sat, 10 Feb 2007)
New Revision: 6204
Added:
trunk/common/src/main/org/jboss/portal/common/io/
trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java
trunk/common/src/main/org/jboss/portal/common/markup/
trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java
trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java
trunk/common/src/main/org/jboss/portal/test/common/MarkupTestCase.java
Removed:
trunk/common/src/main/org/jboss/portal/common/net/Application_XWWWFormURLEncodedFormat.java
trunk/common/src/main/org/jboss/portal/test/common/Application_XWWWFormURLEncodedFormatTestCase.java
trunk/core/src/main/org/jboss/portal/core/util/markup/Attribute.java
trunk/core/src/main/org/jboss/portal/core/util/markup/Element.java
Modified:
trunk/common/build.xml
trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java
trunk/common/src/main/org/jboss/portal/test/common/FastURLEncoderTestCase.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ElementMetaData.java
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/LinkElementMetaData.java
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/NamedMetaElementMetaData.java
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java
trunk/core/src/main/org/jboss/portal/test/core/deployment/JBossApplicationMetaDataFactoryTestCase.java
Log:
- moved markup classes to common
- test case for markup classes
- removed obsolete x-www-url-formencoded encoder because it is duplicated by
FastURLEncoder
- added UndeclaredIOException to prevent classes to have to throw IOException in their
signature
Modified: trunk/common/build.xml
===================================================================
--- trunk/common/build.xml 2007-02-10 02:21:09 UTC (rev 6203)
+++ trunk/common/build.xml 2007-02-11 00:30:13 UTC (rev 6204)
@@ -201,6 +201,8 @@
-->
<x-test>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.common.MarkupTestCase"/>
+<!--
<test todir="${test.reports}"
name="org.jboss.portal.test.common.TypedMapTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.test.InfoTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.test.TestParameterValueTestCase"/>
@@ -222,10 +224,10 @@
<test todir="${test.reports}"
name="org.jboss.portal.test.common.ParameterMapTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.LocalizedStringTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.ImplodeTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.common.Application_XWWWFormURLEncodedFormatTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.BufferedStreamTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.CharBufferTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.common.CopyOnWriteRegistryTestCase"/>
+-->
</x-test>
<x-classpath>
<pathelement location="${build.classes}"/>
Added: trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.io;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.io.IOException;
+
+/**
+ * Avoid a method to declare an IOException in its signature when it is not necessary.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class UndeclaredIOException extends UndeclaredThrowableException
+{
+ public UndeclaredIOException(IOException undeclaredIOException)
+ {
+ super(undeclaredIOException);
+ }
+
+ public UndeclaredIOException(IOException undeclaredIOException, String s)
+ {
+ super(undeclaredIOException, s);
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -0,0 +1,205 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.markup;
+
+import org.jboss.portal.common.text.FastURLEncoder;
+import org.jboss.portal.common.io.UndeclaredIOException;
+
+import java.io.Writer;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * A markup attribute.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MarkupAttribute
+{
+
+ /** . */
+ final String name;
+
+ /** . */
+ final String value;
+
+ /** . */
+ final Type type;
+
+ /** . */
+ final String encodedValue;
+
+ /**
+ * @param name the attribute name
+ * @param value the attribute value
+ * @param type the attribute type
+ */
+ public MarkupAttribute(String name, String value, Type type)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("No null name accepted");
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("No null value accepted");
+ }
+ if (type == null)
+ {
+ throw new IllegalArgumentException("No null type accepted");
+ }
+ this.name = name;
+ this.value = value;
+ this.type = type;
+
+ //
+ StringWriter tmp = new StringWriter();
+ type.encode(value, tmp);
+ this.encodedValue = tmp.toString();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public String getEncodedValue()
+ {
+ return encodedValue;
+ }
+
+ public Type getType()
+ {
+ return type;
+ }
+
+ /**
+ * The type of the attribute value.
+ */
+ public abstract static class Type
+ {
+
+ /**
+ * Encode the string in the proper format according to the type.
+ *
+ * @param string the string to encode
+ * @return the encoded string
+ */
+ public abstract void encode(String string, Writer writer) throws
UndeclaredIOException;
+
+ private static class CDATAType extends Type
+ {
+ public void encode(String string, Writer writer)
+ {
+ try
+ {
+ writer.write(string);
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+ }
+ }
+
+ /**
+ * CDATA is a sequence of characters from the document character set and may
include character entities.
+ * User agents should interpret attribute values as follows:
+ * <ul>
+ * <li>Replace character entities with characters,</li>
+ * <li>Ignore line feeds,</li>
+ * <li>Replace each carriage return or tab with a single
space.</li>
+ * </ul>
+ */
+ public static final Type CDATA = new CDATAType();
+
+ /**
+ * NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any
number of letters, digits ([0-9]),
+ * hyphens ("-"), underscores ("_"), colons (":"),
and periods (".").
+ */
+ public static final Type NAME = new CDATAType();
+
+ /**
+ * %ContentType required : CDATA -- media type, as per [RFC2045].
+ */
+ public static final Type CONTENT_TYPE = new CDATAType();
+
+ /**
+ * %URI : CDATA -- a Uniform Resource Identifier, see [URI].
+ */
+ public static final Type URI = new CDATAType()
+ {
+ {
+ try
+ {
+ // Patches the encoder to let '/' not being encoded
+ encoder = new FastURLEncoder("UTF-8", 0, 512)
+ {
+ {
+ table[(int)'/'] = "/".toCharArray();
+ }
+ };
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new Error(e);
+ }
+ }
+
+ /** Our encoder for URI. */
+ final FastURLEncoder encoder;
+
+ public void encode(String string, Writer writer)
+ {
+ encoder.encode(string, writer);
+ }
+ };
+
+ /**
+ * %LinkTypes : CDATA -- space-separated list of link types.
+ */
+ public static final Type LINK_TYPES = new CDATAType();
+
+ /**
+ * %Text : CDATA : CDATA.
+ */
+ public static final Type TEXT = new CDATAType();
+
+ /**
+ * %MediaDesc : CDATA -- single or comma-separated list of media descriptors.
+ */
+ public static final Type MEDIA_DESC = new CDATAType();
+
+ /**
+ * %URI : CDATA -- a Uniform Resource Identifier, see [URI].
+ */
+ public static final Type HREF = new CDATAType();
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -0,0 +1,211 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.markup;
+
+import org.jboss.portal.common.io.UndeclaredIOException;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.io.Writer;
+import java.io.IOException;
+import java.io.StringWriter;
+
+/**
+ * An markup element.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MarkupElement
+{
+
+ /** . */
+ final String name;
+
+ /** . */
+ final String bodyContent;
+
+ /**
+ * If true and the body content is null then output the start tag and
+ * the end tag instead of an empty tag. The use case is for the script element which
+ * when it is empty raise issues on IE, so it start element and end element have to
be
+ * used.
+ */
+ final boolean neverEmpty;
+
+ /** . */
+ final MarkupAttribute[] attributes;
+
+ /**
+ * @param name the element name
+ * @param bodyContent the optional body content
+ * @param neverEmpty
+ * @param attributes
+ */
+ public MarkupElement(
+ String name,
+ String bodyContent,
+ boolean neverEmpty,
+ MarkupAttribute[] attributes)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("No null name accepted");
+ }
+ if (attributes == null)
+ {
+ throw new IllegalArgumentException("No null attributes accepted");
+ }
+
+ //
+ Set tmp = new HashSet();
+ for (int i= 0;i < attributes.length;i++)
+ {
+ MarkupAttribute attribute = attributes[i];
+ if (attribute == null)
+ {
+ throw new IllegalArgumentException("Cannot have a null
attribute");
+ }
+ if (tmp.add(attribute.name) == false)
+ {
+ throw new IllegalArgumentException("Cannot have two identical attributes
" + attribute.name);
+ }
+ }
+
+ this.name = name;
+ this.bodyContent = bodyContent;
+ this.neverEmpty = neverEmpty;
+ this.attributes = (MarkupAttribute[])attributes.clone();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getBodyContent()
+ {
+ return bodyContent;
+ }
+
+ public boolean isNeverEmpty()
+ {
+ return neverEmpty;
+ }
+
+ public int getAttributeSize()
+ {
+ return attributes.length;
+ }
+
+ public MarkupAttribute getAttribute(int index)
+ {
+ return attributes[index];
+ }
+
+ public MarkupAttribute getAttribute(String name)
+ {
+ for (int i = 0;i < attributes.length;i++)
+ {
+ MarkupAttribute attribute = attributes[i];
+ if (attribute.name.equals(name))
+ {
+ return attribute;
+ }
+ }
+ return null;
+ }
+
+ public void write(String contextPath, Writer writer) throws UndeclaredIOException
+ {
+ if (contextPath == null)
+ {
+ throw new IllegalArgumentException("No context path provided");
+ }
+ if (writer == null)
+ {
+ throw new IllegalArgumentException("No writer provided");
+ }
+ try
+ {
+ writer.write("<");
+ writer.write(name);
+ for (int i = 0;i < attributes.length;i++)
+ {
+ MarkupAttribute attribute = attributes[i];
+
+ // If it is an URI type we prepend the context path
+ if (attribute.type == MarkupAttribute.Type.URI)
+ {
+ writer.write(" ");
+ writer.write(attribute.name);
+ writer.write("=\"");
+ if (attribute.value.startsWith("/"))
+ {
+ MarkupAttribute.Type.URI.encode(contextPath, writer);
+ }
+ writer.write(attribute.encodedValue);
+ writer.write('"');
+ }
+ else
+ {
+ writer.write(" ");
+ writer.write(attribute.name);
+ writer.write("=\"");
+ writer.write(attribute.encodedValue);
+ writer.write('"');
+ }
+ }
+ if (bodyContent != null && bodyContent.length() > 0)
+ {
+ writer.write(">");
+ writer.write(bodyContent);
+ writer.write("</");
+ writer.write(name);
+ writer.write(">\n");
+ }
+ else if (neverEmpty)
+ {
+ writer.write(">");
+ writer.write("</");
+ writer.write(name);
+ writer.write(">\n");
+ }
+ else
+ {
+ writer.write("/>\n");
+ }
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+ }
+
+ public String toString(String contextPath)
+ {
+ StringWriter buffer = new StringWriter(64);
+ write(contextPath, buffer);
+ return buffer.toString();
+ }
+}
Deleted:
trunk/common/src/main/org/jboss/portal/common/net/Application_XWWWFormURLEncodedFormat.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/net/Application_XWWWFormURLEncodedFormat.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/common/src/main/org/jboss/portal/common/net/Application_XWWWFormURLEncodedFormat.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -1,136 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package
org.jboss.portal.common.net;
-
-import java.io.IOException;
-
-/**
- * Provide fast encoding to the application/x-www-form-urlencoded MIME format for a
specified
- * charset.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class Application_XWWWFormURLEncodedFormat
-{
-
- public static final Application_XWWWFormURLEncodedFormat UTF_8 =
safeCreate("UTF-8");
-
- private static Application_XWWWFormURLEncodedFormat safeCreate(String charset)
- {
- try
- {
- return new Application_XWWWFormURLEncodedFormat(charset);
- }
- catch (IOException e)
- {
- throw new Error(e);
- }
- }
-
- private final char[][] table;
-
- public Application_XWWWFormURLEncodedFormat(String charset) throws IOException
- {
- StringBuffer sb = new StringBuffer();
- table = new char[Character.MAX_VALUE + 1][0];
- for (int i = 0; i <= Character.MAX_VALUE; i++)
- {
- char c = (char)i;
- if (c >= 'a' && c <= 'z')
- {
- table[c] = new char[]{c};
- }
- else if (c >= 'A' && c <= 'Z')
- {
- table[c] = new char[]{c};
- }
- else if (c >= '0' && c <= '9')
- {
- table[c] = new char[]{c};
- }
- else if (c == '-' || c == '_' || c == '.' || c ==
'*')
- {
- table[c] = new char[]{c};
- }
- else if (c == ' ')
- {
- table[c] = new char[]{'+'};
- }
- else
- {
- String s = new String(new char[]{c});
- byte[] bytes = s.getBytes(charset);
- for (int j = 0; j < bytes.length; j++)
- {
- byte b = bytes[j];
- int bh = (b >> 4) & 0xF;
- int bl = b & 0xF;
- char ch = Character.toUpperCase(Character.forDigit(bh, 16));
- char cl = Character.toUpperCase(Character.forDigit(bl, 16));
- sb.append('%').append(ch).append(cl);
- }
- table[c] = new char[sb.length()];
- sb.getChars(0, sb.length(), table[c], 0);
- sb.setLength(0);
- }
- }
- }
-
- public void encode(char c, StringBuffer sb)
- {
- sb.append(table[c]);
- }
-
- public void encode(String s, StringBuffer sb)
- {
- encode(s, 0, s.length(), sb);
- }
-
- public void encode(String s, int from, int to, StringBuffer sb)
- {
- for (int i = from; i < to; i++)
- {
- char c = s.charAt(i);
- char[] chars = table[c];
- sb.append(chars);
- }
- }
-
- public String encode(char c)
- {
- return new String(table[c]);
- }
-
- public String encode(String s, int from, int to)
- {
- StringBuffer sb = new StringBuffer();
- encode(s, from, to, sb);
- return sb.toString();
- }
-
- public String encode(String s)
- {
- return encode(s, 0, s.length());
- }
-}
Modified: trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java 2007-02-10
02:21:09 UTC (rev 6203)
+++ trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -22,7 +22,11 @@
******************************************************************************/
package org.jboss.portal.common.text;
+import org.jboss.portal.common.io.UndeclaredIOException;
+
import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.io.IOException;
import java.net.URLEncoder;
/**
@@ -112,6 +116,45 @@
}
}
+ public void encode(String s, Writer out) throws IllegalArgumentException,
UndeclaredIOException
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (out == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ try
+ {
+ for (int i = 0;i < s.length();i++)
+ {
+ char c = s.charAt(i);
+ if (c >= from && c < to)
+ {
+ out.write(table[c - from]);
+ }
+ else
+ {
+ try
+ {
+ out.write(URLEncoder.encode(Character.toString(c), encoding));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // That should never happen has the encoding validity is check at
construction time
+ throw new Error(e);
+ }
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ throw new UndeclaredIOException(e);
+ }
+ }
+
public String toString()
{
return "FastURLEncoder[" + encoding + ",[" + from +
"," + to + "]]";
Deleted:
trunk/common/src/main/org/jboss/portal/test/common/Application_XWWWFormURLEncodedFormatTestCase.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/test/common/Application_XWWWFormURLEncodedFormatTestCase.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/common/src/main/org/jboss/portal/test/common/Application_XWWWFormURLEncodedFormatTestCase.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -1,72 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.common;
-
-import junit.framework.TestCase;
-import org.jboss.portal.common.net.Application_XWWWFormURLEncodedFormat;
-
-import java.net.URLEncoder;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class Application_XWWWFormURLEncodedFormatTestCase extends TestCase
-{
-
- private Application_XWWWFormURLEncodedFormat format =
Application_XWWWFormURLEncodedFormat.UTF_8;
-
- public Application_XWWWFormURLEncodedFormatTestCase(String name)
- {
- super(name);
- }
-
- private static final String INVARIANT_STRING =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_*";
-
- public void testInvariant()
- {
- assertEquals(INVARIANT_STRING, format.encode(INVARIANT_STRING));
- for (int i = 0;i < INVARIANT_STRING.length();i++)
- {
- char c = INVARIANT_STRING.charAt(i);
- String s = format.encode(c);
- assertEquals(s + "!=" + c, s, "" + c);
- }
- }
-
- public void testSpace()
- {
- assertEquals("+", format.encode(' '));
- }
-
- public void testASCII() throws Exception
- {
- for (int i = 0;i < 50000 + 1;i++)
- {
- char c = (char)i;
- String expectedResult = URLEncoder.encode("" + c, "UTF-8");
- String result = format.encode(c);
- assertEquals("Comparing char=" + i + " was expecting " +
expectedResult + " but got " + result, expectedResult, result);
- }
- }
-}
Modified: trunk/common/src/main/org/jboss/portal/test/common/FastURLEncoderTestCase.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/test/common/FastURLEncoderTestCase.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/common/src/main/org/jboss/portal/test/common/FastURLEncoderTestCase.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -153,7 +153,7 @@
}
try
{
- encoder.encode("", null);
+ encoder.encode("", (StringBuffer)null);
fail();
}
catch (IllegalArgumentException expected)
Added: trunk/common/src/main/org/jboss/portal/test/common/MarkupTestCase.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/MarkupTestCase.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/test/common/MarkupTestCase.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -0,0 +1,109 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.common;
+
+import junit.framework.TestCase;
+import org.jboss.portal.common.markup.MarkupAttribute;
+import org.jboss.portal.common.markup.MarkupElement;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MarkupTestCase extends TestCase
+{
+
+ public void testAttributeConstructor()
+ {
+ try
+ {
+ new MarkupAttribute(null, "value", MarkupAttribute.Type.CDATA);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ new MarkupAttribute("name", null, MarkupAttribute.Type.CDATA);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ new MarkupAttribute("name", "value", null);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ MarkupAttribute attribute = new MarkupAttribute("name",
"value", MarkupAttribute.Type.CDATA);
+ assertEquals("name", attribute.getName());
+ assertEquals("value", attribute.getValue());
+ assertEquals(MarkupAttribute.Type.CDATA, attribute.getType());
+ }
+
+ public void testElementContructor()
+ {
+ try
+ {
+ new MarkupElement(null, "body", false, new MarkupAttribute[0]);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ new MarkupElement("name", "body", false, null);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ new MarkupElement("name", "body", false, new
MarkupAttribute[]{null});
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ MarkupElement element = new MarkupElement("elementname",
"body", false, new MarkupAttribute[]{new
MarkupAttribute("attributename", "attributevalue",
MarkupAttribute.Type.CDATA)});
+ assertEquals("elementname", element.getName());
+ assertEquals("body", element.getBodyContent());
+ assertEquals(false, element.isNeverEmpty());
+ assertEquals(1, element.getAttributeSize());
+ MarkupAttribute attribute = element.getAttribute(0);
+ assertEquals("attributename", attribute.getName());
+ assertEquals("attributevalue", attribute.getValue());
+ assertEquals(MarkupAttribute.Type.CDATA, attribute.getType());
+ attribute = element.getAttribute("attributename");
+ assertEquals("attributename", attribute.getName());
+ assertEquals("attributevalue", attribute.getValue());
+ assertEquals(MarkupAttribute.Type.CDATA, attribute.getType());
+ assertEquals(null, element.getAttribute("someotherattributename"));
+ }
+}
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -23,10 +23,10 @@
package org.jboss.portal.core.aspects.portlet;
import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.markup.MarkupElement;
import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
import org.jboss.portal.core.metadata.portlet.ElementMetaData;
-import org.jboss.portal.core.util.markup.Element;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
@@ -88,7 +88,7 @@
for (Iterator i = headerContent.getElements().iterator(); i.hasNext();)
{
ElementMetaData elementMD = (ElementMetaData)i.next();
- Element element = elementMD.getElement();
+ MarkupElement element = elementMD.getElement();
writer.write(element.toString(contextPath));
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ElementMetaData.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ElementMetaData.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ElementMetaData.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.core.metadata.portlet;
-import org.jboss.portal.core.util.markup.Element;
+import org.jboss.portal.common.markup.MarkupElement;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -32,17 +32,13 @@
{
/** . */
- protected final String typeAttribute;
-
- /** . */
protected String bodyContent;
/** . */
- protected Element element;
+ protected MarkupElement element;
- protected ElementMetaData(String typeAttribute)
+ protected ElementMetaData()
{
- this.typeAttribute = typeAttribute;
}
public void init()
@@ -50,18 +46,13 @@
element = buildElement();
}
- protected abstract Element buildElement();
+ protected abstract MarkupElement buildElement();
- public Element getElement()
+ public MarkupElement getElement()
{
return element;
}
- public String getTypeAttribute()
- {
- return typeAttribute;
- }
-
public String getBodyContent()
{
return bodyContent;
@@ -75,7 +66,7 @@
/**
* Create a meta header element. <p>This element will create a meta
tag.</p>
*
- * @param name name attribute of the meta element
+ * @param name name attribute of the meta element
* @param content content attribute of the meta element
* @return a new meta header element
*/
Modified:
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/LinkElementMetaData.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/LinkElementMetaData.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/LinkElementMetaData.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.metadata.portlet;
-import org.jboss.portal.core.util.markup.Element;
-import org.jboss.portal.core.util.markup.Attribute;
+import org.jboss.portal.common.markup.MarkupElement;
+import org.jboss.portal.common.markup.MarkupAttribute;
import java.util.ArrayList;
@@ -34,55 +34,66 @@
public class LinkElementMetaData extends ElementMetaData
{
- /** . */
+ /** %ContentType required : CDATA -- media type, as per [RFC2045]. */
+ private String typeAttribute;
+
+ /** %LinkTypes : CDATA -- space-separated list of link types. */
private String relAttribute;
- /** . */
+ /** %URI : CDATA -- a Uniform Resource Identifier, see [URI]. */
private String hrefAttribute;
- /** . */
+ /** %Text : CDATA : CDATA. */
private String titleAttribute;
- /** . */
+ /** %MediaDesc : CDATA -- single or comma-separated list of media descriptors. */
private String mediaAttribute;
- public LinkElementMetaData(String rel, String type, String href, String title, String
media)
+ public LinkElementMetaData(
+ String relAttribute,
+ String typeAttribute,
+ String hrefAttribute,
+ String titleAttribute,
+ String mediaAttribute)
{
- super(type);
-
- //
- this.relAttribute = rel;
- this.hrefAttribute = href;
- this.titleAttribute = title;
- this.mediaAttribute = media;
+ this.typeAttribute = typeAttribute;
+ this.relAttribute = relAttribute;
+ this.hrefAttribute = hrefAttribute;
+ this.titleAttribute = titleAttribute;
+ this.mediaAttribute = mediaAttribute;
}
- public Element buildElement()
+ public MarkupElement buildElement()
{
ArrayList attributes = new ArrayList(5);
if (typeAttribute != null && typeAttribute.length() > 0)
{
- attributes.add(new Attribute("type", typeAttribute, false));
+ attributes.add(new MarkupAttribute("type", typeAttribute,
MarkupAttribute.Type.CONTENT_TYPE));
}
if (relAttribute != null && relAttribute.length() > 0)
{
- attributes.add(new Attribute("rel", relAttribute, false));
+ attributes.add(new MarkupAttribute("rel", relAttribute,
MarkupAttribute.Type.LINK_TYPES));
}
if (hrefAttribute != null && hrefAttribute.length() > 0)
{
- attributes.add(new Attribute("href", hrefAttribute, true));
+ attributes.add(new MarkupAttribute("href", hrefAttribute,
MarkupAttribute.Type.URI));
}
if (titleAttribute != null && titleAttribute.length() > 0)
{
- attributes.add(new Attribute("title", titleAttribute, false));
+ attributes.add(new MarkupAttribute("title", titleAttribute,
MarkupAttribute.Type.TEXT));
}
if (mediaAttribute != null && mediaAttribute.length() > 0)
{
- attributes.add(new Attribute("media", mediaAttribute, false));
+ attributes.add(new MarkupAttribute("media", mediaAttribute,
MarkupAttribute.Type.MEDIA_DESC));
}
- return new Element("link", null, true,
(Attribute[])attributes.toArray(new Attribute[attributes.size()]));
+ return new MarkupElement("link", null, false,
(MarkupAttribute[])attributes.toArray(new MarkupAttribute[attributes.size()]));
}
+ public String getTypeAttribute()
+ {
+ return typeAttribute;
+ }
+
public String getRelAttribute()
{
return relAttribute;
Modified:
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/NamedMetaElementMetaData.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/NamedMetaElementMetaData.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/NamedMetaElementMetaData.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.metadata.portlet;
-import org.jboss.portal.core.util.markup.Element;
-import org.jboss.portal.core.util.markup.Attribute;
+import org.jboss.portal.common.markup.MarkupElement;
+import org.jboss.portal.common.markup.MarkupAttribute;
import java.util.ArrayList;
@@ -34,30 +34,27 @@
public class NamedMetaElementMetaData extends ElementMetaData
{
- /** . */
+ /** NAME. */
private String nameAttribute;
- /** . */
+ /** CDATA. */
private String contentAttribute;
- public NamedMetaElementMetaData(String name, String content)
+ public NamedMetaElementMetaData(String nameAttribute, String contentAttribute)
{
- super(null);
-
- //
- if (name == null)
+ if (nameAttribute == null)
{
throw new IllegalArgumentException("'name' attribute of meta
element must NOT be null. http-equiv meta " +
"elements are not currently supported.");
}
- if (content == null)
+ if (contentAttribute == null)
{
- throw new IllegalArgumentException("Content attribute required for meta
element: " + name);
+ throw new IllegalArgumentException("Content attribute required for meta
element: " + nameAttribute);
}
//
- this.nameAttribute = name;
- this.contentAttribute = content;
+ this.nameAttribute = nameAttribute;
+ this.contentAttribute = contentAttribute;
}
public String getNameAttribute()
@@ -70,21 +67,17 @@
return contentAttribute;
}
- public Element buildElement()
+ public MarkupElement buildElement()
{
ArrayList attributes = new ArrayList(3);
- if (typeAttribute != null && typeAttribute.length() > 0)
- {
- attributes.add(new Attribute("type", typeAttribute, false));
- }
if (nameAttribute != null && nameAttribute.length() > 0)
{
- attributes.add(new Attribute("name", nameAttribute, false));
+ attributes.add(new MarkupAttribute("name", nameAttribute,
MarkupAttribute.Type.NAME));
}
if (contentAttribute != null && contentAttribute.length() > 0)
{
- attributes.add(new Attribute("content", contentAttribute, false));
+ attributes.add(new MarkupAttribute("content", contentAttribute,
MarkupAttribute.Type.CDATA));
}
- return new Element("meta", null, true,
(Attribute[])attributes.toArray(new Attribute[attributes.size()]));
+ return new MarkupElement("meta", null, false,
(MarkupAttribute[])attributes.toArray(new MarkupAttribute[attributes.size()]));
}
}
Modified:
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.metadata.portlet;
-import org.jboss.portal.core.util.markup.Element;
-import org.jboss.portal.core.util.markup.Attribute;
+import org.jboss.portal.common.markup.MarkupElement;
+import org.jboss.portal.common.markup.MarkupAttribute;
import java.util.ArrayList;
@@ -34,34 +34,35 @@
public class ScriptElementMetaData extends ElementMetaData
{
- /** . */
+ /** %ContentType required : CDATA -- media type, as per [RFC2045]. */
+ private String typeAttribute;
+
+ /** %URI : CDATA -- a Uniform Resource Identifier, see [URI]. */
private String srcAttribute;
- public ScriptElementMetaData(String type, String src)
+ public ScriptElementMetaData(String typeAttribute, String srcAttribute)
{
- super(type);
-
- //
- this.srcAttribute = src;
+ this.typeAttribute = typeAttribute;
+ this.srcAttribute = srcAttribute;
}
- protected String getElementValue()
+ public String getTypeAttribute()
{
- return "script";
+ return typeAttribute;
}
- public Element buildElement()
+ public MarkupElement buildElement()
{
ArrayList attributes = new ArrayList(2);
if (typeAttribute != null && typeAttribute.length() > 0)
{
- attributes.add(new Attribute("type", typeAttribute, false));
+ attributes.add(new MarkupAttribute("type", typeAttribute,
MarkupAttribute.Type.CONTENT_TYPE));
}
if (srcAttribute != null && srcAttribute.length() > 0)
{
- attributes.add(new Attribute("src", srcAttribute, true));
+ attributes.add(new MarkupAttribute("src", srcAttribute,
MarkupAttribute.Type.URI));
}
- return new Element("script", null, false,
(Attribute[])attributes.toArray(new Attribute[attributes.size()]));
+ return new MarkupElement("script", null, true,
(MarkupAttribute[])attributes.toArray(new MarkupAttribute[attributes.size()]));
}
public String getSrcAttribute()
Deleted: trunk/core/src/main/org/jboss/portal/core/util/markup/Attribute.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/util/markup/Attribute.java 2007-02-10
02:21:09 UTC (rev 6203)
+++ trunk/core/src/main/org/jboss/portal/core/util/markup/Attribute.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.util.markup;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class Attribute
-{
-
- /** . */
- final String name;
-
- /** . */
- final String value;
-
- /** . */
- final boolean location;
-
- public Attribute(String name, String value, boolean location)
- {
- this.name = name;
- this.value = value;
- this.location = location;
- }
-}
Deleted: trunk/core/src/main/org/jboss/portal/core/util/markup/Element.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/util/markup/Element.java 2007-02-10 02:21:09
UTC (rev 6203)
+++ trunk/core/src/main/org/jboss/portal/core/util/markup/Element.java 2007-02-11 00:30:13
UTC (rev 6204)
@@ -1,96 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.util.markup;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class Element
-{
-
- /** . */
- final String name;
-
- /** . */
- final String bodyContent;
-
- /**
- * If empty is false and the body content is null then we will output the start tag
and
- * the end tag instead of an empty tag. The use case is for the script element which
- * when it is empty raise issues on IE, so it start element and end element have to
be
- * used.
- */
- final boolean empty;
-
- /** . */
- final Attribute[] attributes;
-
- public Element(String name, String bodyContent, boolean empty, Attribute[]
attributes)
- {
- this.name = name;
- this.bodyContent = bodyContent;
- this.empty = empty;
- this.attributes = attributes;
- }
-
- public String toString(String contextPath)
- {
- if (contextPath == null)
- {
- throw new IllegalArgumentException("No context path provided");
- }
- StringBuffer buffer = new StringBuffer(64);
- buffer.append("<").append(name);
- for (int i = 0;i < attributes.length;i++)
- {
- Attribute attribute = attributes[i];
- if (attribute.location)
- {
- buffer.append("
").append(attribute.name).append("=\"");
- if (attribute.value.startsWith("/"))
- {
- buffer.append(contextPath);
- }
- buffer.append(attribute.value).append('"');
- }
- else
- {
- buffer.append("
").append(attribute.name).append("=\"").append(attribute.value).append('"');
- }
- }
- if (bodyContent != null && bodyContent.length() > 0)
- {
-
buffer.append(">").append(bodyContent).append("</").append(name).append(">\n");
- }
- else if (empty)
- {
- buffer.append("/>\n");
- }
- else
- {
-
buffer.append(">").append("</").append(name).append(">\n");
- }
- return buffer.toString();
- }
-}
Modified:
trunk/core/src/main/org/jboss/portal/test/core/deployment/JBossApplicationMetaDataFactoryTestCase.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/test/core/deployment/JBossApplicationMetaDataFactoryTestCase.java 2007-02-10
02:21:09 UTC (rev 6203)
+++
trunk/core/src/main/org/jboss/portal/test/core/deployment/JBossApplicationMetaDataFactoryTestCase.java 2007-02-11
00:30:13 UTC (rev 6204)
@@ -89,7 +89,6 @@
assertEquals("test.js", script.getSrcAttribute());
NamedMetaElementMetaData meta = (NamedMetaElementMetaData)elements.get(2);
- assertNull(meta.getTypeAttribute());
assertEquals("description", meta.getNameAttribute());
assertEquals("test content", meta.getContentAttribute());
}