JBoss Portal SVN: r10103 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-25 00:13:33 -0500 (Mon, 25 Feb 2008)
New Revision: 10103
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.1.1. The JBoss Portlet DTD
minor corrections, adding descriptions
from tutorials.xml to xmldescriptors.xml to
make sections consistent
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-25 02:01:37 UTC (rev 10102)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-25 05:13:33 UTC (rev 10103)
@@ -338,7 +338,7 @@
<computeroutput><portlet-ref></computeroutput> value must match the <computeroutput><portlet-name></computeroutput> value
given in the <filename>HelloWorldPortlet/WEB-INF/portlet.xml</filename> file. The <computeroutput><instance-id></computeroutput>
value can be named anything, but it must match the <computeroutput><instance-ref></computeroutput> value given
- in the <filename>*-object.xml</filename> files, which in this example, would be the <filename>HelloWorldPortlet/WEB-INF/helloworld-object.xml</filename> file.
+ in the <filename>*-object.xml</filename> file, which in this example, would be the <filename>HelloWorldPortlet/WEB-INF/helloworld-object.xml</filename> file.
</para>
<para>
The following is an example of the <filename>HelloWorldPortlet/WEB-INF/portlet-instances.xml</filename> file:
@@ -360,7 +360,7 @@
</screen>
</para>
<para>
- The <filename>*-object.xml</filename> files are JBoss Portal specific descriptors that allow users to
+ The <filename>*-object.xml</filename> file is a JBoss Portal specific descriptor that allow users to
define the structure of their portal instances, and create and configure their windows and
pages. In the following example:
</para>
@@ -427,7 +427,7 @@
</screen></term>
<listitem>
<para>
- Instructs the portal to overwrite or keep this object if it already exists. Possible values are <literal>overwrite</literal> or <literal>keep</literal>. The <literal>overwrite</literal> value will destroy the existing object and create a new one based on the content of the deployment. The <literal>keep</literal> option will maintain the existing object deployment or create a new one if it does not exist.
+ Instructs the portal to overwrite or keep this object if it already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> value will destroy the existing object and create a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option will maintain the existing object deployment, or create a new one if it does not exist.
</para>
</listitem>
</varlistentry>
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-25 02:01:37 UTC (rev 10102)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-25 05:13:33 UTC (rev 10103)
@@ -311,7 +311,7 @@
</screen></term>
<listitem>
<para>
- The <computeroutput><deployements></computeroutput> element is a container for <computeroutput><deployment></computeroutput> elements.
+ The <computeroutput><deployments></computeroutput> element is a container for the <computeroutput><deployment></computeroutput> element.
</para>
<para>
<screen><![CDATA[
@@ -319,7 +319,7 @@
</screen>
</para>
<para>
- The <computeroutput><deployment></computeroutput> is a container for the <computeroutput><instance></computeroutput> element.
+ The <computeroutput><deployment></computeroutput> element is a container for the <computeroutput><instance></computeroutput> element.
</para>
<para>
<screen><![CDATA[
@@ -327,7 +327,7 @@
</screen>
</para>
<para>
- The <computeroutput><if-exists></computeroutput> element is used to define action to take if instance with such name is already present. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> value will destroy the existing object in the database and create a new one, based on the content of the deployment. The <computeroutput>keep</computeroutput> value will maintain the existing object deployment or create a new one if it does not yet exist.
+ The <computeroutput><if-exists></computeroutput> element is used to define the action to take if an instance with the same name already exists. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> value will destroy the existing object and create a new one based on the content of the deployment. The <computeroutput>keep</computeroutput> option will maintain the existing object deployment, or create a new one if it does not exist.
</para>
</listitem>
</varlistentry>
@@ -336,10 +336,10 @@
</screen></term>
<listitem>
<para>
- The <computeroutput><instance></computeroutput> element is used to create an instance of a portlet from the portlet application of the same war file containing the <filename>WEB-INF/portlet-instances.xml</filename> file. The portlet will be created and configured only if the portlet is present and an instance with such a name does not already exist.
+ The <computeroutput><instance></computeroutput> element is used in the <filename>WEB-INF/portlet-instances.xml</filename> file, which is used to create instances of portlets. The portlet will only be created and configured if the portlet is present, and an instance with the same name does not already exist.
</para>
<para>
- Example:
+ The following is an example of the <computeroutput><instance></computeroutput> element, which also contains the <computeroutput><security-constraint></computeroutput> element. Descriptions of each element follow afterwards:
</para>
<para>
<screen><![CDATA[
@@ -367,7 +367,7 @@
</screen>
</para>
<para>
- The identifier of the instance.
+ The instance identifier. The <computeroutput><instance-id></computeroutput> value can be named anything, but it must match the <computeroutput><instance-ref></computeroutput>value given in the <filename>*-object.xml</filename> file.
</para>
<para>
<screen><![CDATA[
@@ -375,7 +375,7 @@
</screen>
</para>
<para>
- The reference to the portlet which is its portlet name.
+ The reference to the portlet, which is the portlet name. The <computeroutput><portlet-ref></computeroutput> value must match the <computeroutput><portlet-name></computeroutput> give in the <filename>WEB-INF/portlet.xml</filename> file.
</para>
<para>
<screen><![CDATA[
@@ -383,7 +383,7 @@
</screen>
</para>
<para>
- The preferences element configures the instance with a specific set of preferences.
+ The <computeroutput><preferences></computeroutput> element configures the instance with a specific set of preferences.
</para>
</listitem>
</varlistentry>
@@ -392,7 +392,7 @@
</screen></term>
<listitem>
<para>
- The preference configure one preference of a set of preferences.
+ The <computeroutput><preference></computeroutput> element configures one preference which is part of a set of preferences, which is defined using the <computeroutput><preferences></computeroutput> element.
</para>
<para>
<screen><![CDATA[
@@ -417,7 +417,7 @@
</screen></term>
<listitem>
<para>
- The <computeroutput><security-constraint></computeroutput> element is a container for policy-permission elements.
+ The <computeroutput><security-constraint></computeroutput> element is a container for <computeroutput><policy-permission></computeroutput> elements.
</para>
<para>
The following is an example of the <computeroutput><security-constraint></computeroutput> element:
@@ -454,28 +454,28 @@
</screen>
</para>
<para>
- The <computeroutput><action-name></computeroutput> element is used to define the access rights given to the role defined. Possible values are:
+ The <computeroutput><action-name></computeroutput> element is used to define the access rights given to the role defined. Accepted values are:
</para>
<para>
<itemizedlist>
<listitem>
<para>
- view - Users can view the page.
+ <computeroutput>view</computeroutput>: users can view the page.
</para>
</listitem>
<listitem>
<para>
- viewrecursive - Users can view the page and child pages.
+ <computeroutput>viewrecursive</computeroutput>: users can view the page and child pages.
</para>
</listitem>
<listitem>
<para>
- personalize - Users are able personalize the page's theme.
+ <computeroutput>personalize</computeroutput>: users are able personalize the page's theme.
</para>
</listitem>
<listitem>
<para>
- personalizerecursive - Users are able personalize the page AND its children's themes. pages.
+ <computeroutput>personalizerecursive</computeroutput>: users are able personalize the page and child pages themes.
</para>
</listitem>
</itemizedlist>
@@ -486,7 +486,7 @@
</screen>
</para>
<para>
- The <computeroutput><unchecked></computeroutput> element is used to define (if present) that anyone can view this instance.
+ If present. the <computeroutput><unchecked></computeroutput> element is used to define that anyone can view the instance.
</para>
<para>
<screen><![CDATA[
@@ -494,11 +494,11 @@
</screen>
</para>
<para>
- The <computeroutput><role-name></computeroutput> element is used to define a role that this security constraint will apply to:
+ The <computeroutput><role-name></computeroutput> element is used to define a role that this security constraint will apply to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role, to access the instance:
</para>
<para>
<screen><![CDATA[
-<role-name>SOMEROLE</role-name> Access to this instance is limited to the defined role.]]>
+<role-name>EXAMPLEROLE</role-name>]]>
</screen>
</para>
</listitem>
18 years, 2 months
JBoss Portal SVN: r10102 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-24 21:01:37 -0500 (Sun, 24 Feb 2008)
New Revision: 10102
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.1.2. The JBoss Portlet Instance DTD
- starting to makeup (computeroutput) elements,
- minor corrections
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-25 01:10:13 UTC (rev 10101)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-25 02:01:37 UTC (rev 10102)
@@ -311,33 +311,32 @@
</screen></term>
<listitem>
<para>
- The deployements element is a container for deployment elements.
+ The <computeroutput><deployements></computeroutput> element is a container for <computeroutput><deployment></computeroutput> elements.
</para>
<para>
<screen><![CDATA[
-<![CDATA[<!ELEMENT deployment (if-exists?,instance)>]]>
+<!ELEMENT deployment (if-exists?,instance)>]]>
</screen>
</para>
<para>
- The deployment is a container for an instance element.
+ The <computeroutput><deployment></computeroutput> is a container for the <computeroutput><instance></computeroutput> element.
</para>
-</listitem>
-</varlistentry>
-<varlistentry><term><screen><![CDATA[
-<![CDATA[<!ELEMENT if-exists (#PCDATA)>]]>
-</screen></term>
-<listitem>
<para>
- The if-exists element is used to define action to take if instance with such name is already present. Possible values are overwrite or keep . Overwrite will destroy the existing object in the database and create a new one, based on the content of the deployment. Keep will maintain the existing object deployment or create a new one if it does not yet exist.
+<screen><![CDATA[
+<!ELEMENT if-exists (#PCDATA)>]]>
+</screen>
+</para>
+ <para>
+ The <computeroutput><if-exists></computeroutput> element is used to define action to take if instance with such name is already present. Accepted values are <computeroutput>overwrite</computeroutput> and <computeroutput>keep</computeroutput>. The <computeroutput>overwrite</computeroutput> value will destroy the existing object in the database and create a new one, based on the content of the deployment. The <computeroutput>keep</computeroutput> value will maintain the existing object deployment or create a new one if it does not yet exist.
</para>
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-<![CDATA[<!ELEMENT instance (instance-id,portlet-ref,preferences?,security-constraint?)>]]>
+<!ELEMENT instance (instance-id,portlet-ref,preferences?,security-constraint?)>]]>
</screen></term>
<listitem>
<para>
- The instance element is used to create an instance of a portlet from the portlet application of the same war file containing the portlet-instances.xml file. The portlet will be created and configured only if the portlet is present and an instance with such a name does not already exist.
+ The <computeroutput><instance></computeroutput> element is used to create an instance of a portlet from the portlet application of the same war file containing the <filename>WEB-INF/portlet-instances.xml</filename> file. The portlet will be created and configured only if the portlet is present and an instance with such a name does not already exist.
</para>
<para>
Example:
@@ -364,7 +363,7 @@
</para>
<para>
<screen><![CDATA[
-<![CDATA[<!ELEMENT instance-id (#PCDATA)>]]>
+<!ELEMENT instance-id (#PCDATA)>]]>
</screen>
</para>
<para>
@@ -372,7 +371,7 @@
</para>
<para>
<screen><![CDATA[
-<![CDATA[<!ELEMENT portlet-ref (#PCDATA)>]]>
+<!ELEMENT portlet-ref (#PCDATA)>]]>
</screen>
</para>
<para>
@@ -380,7 +379,7 @@
</para>
<para>
<screen><![CDATA[
-<![CDATA[<!ELEMENT preferences (preference)>]]>
+<!ELEMENT preferences (preference)>]]>
</screen>
</para>
<para>
@@ -389,7 +388,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-<![CDATA[<!ELEMENT preference (name,value)>]]>
+<!ELEMENT preference (name,value)>]]>
</screen></term>
<listitem>
<para>
@@ -397,7 +396,7 @@
</para>
<para>
<screen><![CDATA[
-<![CDATA[<!ELEMENT name (#PCDATA)>]]>
+<!ELEMENT name (#PCDATA)>]]>
</screen>
</para>
<para>
@@ -418,10 +417,10 @@
</screen></term>
<listitem>
<para>
- The security-constraint element is a container for policy-permission elements. See the elements after the example for an explanation of each.
+ The <computeroutput><security-constraint></computeroutput> element is a container for policy-permission elements.
</para>
<para>
- Example:
+ The following is an example of the <computeroutput><security-constraint></computeroutput> element:
</para>
<para>
<screen><![CDATA[
@@ -447,15 +446,15 @@
</screen></term>
<listitem>
<para>
- The policy-permission element is used to secure a specific portlet instance based on a user's role.
+ The <computeroutput><policy-permission></computeroutput> element is used to secure a specific portlet instance based on a user's role.
</para>
<para>
<screen><![CDATA[
-<![CDATA[<!ELEMENT action-name (#PCDATA)>]]>
+<!ELEMENT action-name (#PCDATA)>]]>
</screen>
</para>
<para>
- The action-name element is used to define the access rights given to the role defined. Possible values are:
+ The <computeroutput><action-name></computeroutput> element is used to define the access rights given to the role defined. Possible values are:
</para>
<para>
<itemizedlist>
@@ -483,19 +482,19 @@
</para>
<para>
<screen><![CDATA[
-<![CDATA[<!ELEMENT unchecked EMPTY>]]>
+<!ELEMENT unchecked EMPTY>]]>
</screen>
</para>
<para>
- The unchecked element is used to define (if present) that anyone can view this instance.
+ The <computeroutput><unchecked></computeroutput> element is used to define (if present) that anyone can view this instance.
</para>
<para>
<screen><![CDATA[
-<![CDATA[<!ELEMENT role-name (#PCDATA)>]]>
+<!ELEMENT role-name (#PCDATA)>]]>
</screen>
</para>
<para>
- The role-name element is used to define a role that this security constraint will apply to:
+ The <computeroutput><role-name></computeroutput> element is used to define a role that this security constraint will apply to:
</para>
<para>
<screen><![CDATA[
18 years, 2 months
JBoss Portal SVN: r10101 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-24 20:10:13 -0500 (Sun, 24 Feb 2008)
New Revision: 10101
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.1.2. The JBoss Portlet Instance DTD
remove itemizedlist, replacing with variablelist
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-24 23:30:39 UTC (rev 10100)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-25 01:10:13 UTC (rev 10101)
@@ -74,7 +74,7 @@
<sect2>
<title>The JBoss Portlet DTD</title>
<para>
- The following list refers to elements found in the JBoss Portlet DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/jboss-portlet_<replaceable>version_number</replaceable>.dtd</filename>:
+ The following items refer to elements found in the JBoss Portlet DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/jboss-portlet_<replaceable>version_number</replaceable>.dtd</filename>:
</para>
<para>
<variablelist>
@@ -91,7 +91,8 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,header-content?,portlet-info?)>]]>
+<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,
+header-content?,portlet-info?)>]]>
</screen></term>
<listitem>
<para>
@@ -211,7 +212,7 @@
</screen></term>
<listitem>
<para>
- Specify content to be included in the portal aggregated page when the portlet is present on that page. This setting only applies when the portlet is used in the local mode.
+ Specify the content to be included in the portal aggregated page when the portlet is present on that page. This setting only applies when the portlet is used in the local mode.
</para>
<para>
<screen><![CDATA[
@@ -291,7 +292,7 @@
</screen>
</para>
<para>
- The <computeroutput><service-ref></computeroutput> element defines the reference to the service. In the JMX Microkernel environment, this consist of the JMX name of the service MBean. For an MBean reference, if the domain is left out, then the current domain of the portal is used.
+ The <computeroutput><service-ref></computeroutput> element defines the reference to the service. In the JMX Microkernel environment, this consist of the JMX name of the service MBean. For an MBean reference, if the domain is left out, the current domain of the portal is used.
</para>
</listitem>
</varlistentry>
@@ -299,38 +300,50 @@
</para>
</sect2>
<sect2>
- <title>Portlet Instance DTD</title>
- <para>
-<itemizedlist>
+ <title>The JBoss Portlet Instance DTD</title>
+ <para>
+ The following items refer to elements found in the JBoss Portlet Instance DTD, <filename>$JBOSS_HOME/server/configuration/deploy/jboss-portal.sar/dtd/portlet-instances_<replaceable>version_number</replaceable>.dtd</filename>:
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry><term><screen><![CDATA[
+<!ELEMENT deployments (deployment*)>]]>
+</screen></term>
<listitem>
-<para>
-Element <![CDATA[<!ELEMENT deployments (deployment*)>]]>
-</para><para><programlisting><![CDATA[
-The deployements element is a container for deployment elements.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT deployment (if-exists?,instance)>
-
-]]>
-</para><para><programlisting><![CDATA[The deployment is a container for an instance element.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT if-exists (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The if-exists element is used to define action to take if instance with such name is
-already present. Possible values are overwrite or keep . Overwrite will destroy the
-existing object in the database and create a new one, based on the content of the
-deployment. Keep will maintain the existing object deployment or create a new one if
-it does not yet exist.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT instance (instance-id,portlet-ref,preferences?,security-constraint?)>]]>
-</para><para><programlisting><![CDATA[The instance element is used to create an instance of a portlet from the portlet
-application of the same war file containing the portlet-instances.xml file. The portlet
-will be created and configured only if the portlet is present and an instance with
-such a name does not already exist.
-
-Example :
-
+ <para>
+ The deployements element is a container for deployment elements.
+ </para>
+ <para>
+<screen><![CDATA[
+<![CDATA[<!ELEMENT deployment (if-exists?,instance)>]]>
+</screen>
+ </para>
+ <para>
+ The deployment is a container for an instance element.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT if-exists (#PCDATA)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The if-exists element is used to define action to take if instance with such name is already present. Possible values are overwrite or keep . Overwrite will destroy the existing object in the database and create a new one, based on the content of the deployment. Keep will maintain the existing object deployment or create a new one if it does not yet exist.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT instance (instance-id,portlet-ref,preferences?,security-constraint?)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The instance element is used to create an instance of a portlet from the portlet application of the same war file containing the portlet-instances.xml file. The portlet will be created and configured only if the portlet is present and an instance with such a name does not already exist.
+ </para>
+ <para>
+ Example:
+ </para>
+ <para>
+<screen><![CDATA[
<instance>
<instance-id>MyPortletInstance</instance-id>
<portlet-ref>MyPortlet</portlet-ref>
@@ -346,38 +359,72 @@
<action-name>view</action-name>
</policy-permission>
</security-constraint>
-</instance>]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT instance-id (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The identifier of the instance.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT portlet-ref (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The reference to the portlet which is its portlet name.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT preferences (preference)>]]>
-</para><para><programlisting><![CDATA[The preferences element configures the instance with a specific set of preferences.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT preference (name,value)>]]>
-</para><para><programlisting><![CDATA[The preference configure one preference of a set of preferences.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT name (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[A name.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT value (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[A string value.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT security-constraint (policy-permission*)>]]>
-</para><para><programlisting><![CDATA[The security-constraint element is a container for policy-permission elements
-
-Examples:
-
+</instance>]]>
+</screen>
+ </para>
+ <para>
+<screen><![CDATA[
+<![CDATA[<!ELEMENT instance-id (#PCDATA)>]]>
+</screen>
+ </para>
+ <para>
+ The identifier of the instance.
+ </para>
+ <para>
+<screen><![CDATA[
+<![CDATA[<!ELEMENT portlet-ref (#PCDATA)>]]>
+</screen>
+ </para>
+ <para>
+ The reference to the portlet which is its portlet name.
+ </para>
+ <para>
+<screen><![CDATA[
+<![CDATA[<!ELEMENT preferences (preference)>]]>
+</screen>
+ </para>
+ <para>
+ The preferences element configures the instance with a specific set of preferences.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT preference (name,value)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The preference configure one preference of a set of preferences.
+ </para>
+ <para>
+<screen><![CDATA[
+<![CDATA[<!ELEMENT name (#PCDATA)>]]>
+</screen>
+ </para>
+ <para>
+ A name.
+ </para>
+ <para>
+<screen><![CDATA[
+<!ELEMENT value (#PCDATA)>]]>
+</screen>
+ </para>
+ <para>
+ A string value.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<!ELEMENT security-constraint (policy-permission*)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The security-constraint element is a container for policy-permission elements. See the elements after the example for an explanation of each.
+ </para>
+ <para>
+ Example:
+ </para>
+ <para>
+<screen><![CDATA[
<security-constraint>
<policy-permission>
<role-name>User</role-name>
@@ -390,34 +437,75 @@
<unchecked/>
<action-name>view</action-name>
</policy-permission>
-</security-constraint>]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>]]>
-</para><para><programlisting><![CDATA[The policy-permission element is used to secure a specific portlet instance based on a user's role.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT action-name (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The action-name element is used to define the access rights given to the role defined.
-Possible values are:
-
- * view - Users can view the page.
- * viewrecursive - Users can view the page and child pages.
- * personalize - Users are able personalize the page's theme.
- * personalizerecursive - Users are able personalize the page AND its children's themes.
- pages.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT unchecked EMPTY>]]>
-</para><para><programlisting><![CDATA[The unchecked element is used to define (if present) that anyone can view this instance]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT role-name (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The role-name element is used to define a role that this security constraint will apply to
-
- * <role-name>SOMEROLE</role-name> Access to this instance is limited to the defined role.]]></programlisting></para>
-</listitem></itemizedlist>
- </para>
+</security-constraint>]]>
+</screen>
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The policy-permission element is used to secure a specific portlet instance based on a user's role.
+ </para>
+ <para>
+<screen><![CDATA[
+<![CDATA[<!ELEMENT action-name (#PCDATA)>]]>
+</screen>
+ </para>
+ <para>
+ The action-name element is used to define the access rights given to the role defined. Possible values are:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ view - Users can view the page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ viewrecursive - Users can view the page and child pages.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ personalize - Users are able personalize the page's theme.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ personalizerecursive - Users are able personalize the page AND its children's themes. pages.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+<screen><![CDATA[
+<![CDATA[<!ELEMENT unchecked EMPTY>]]>
+</screen>
+ </para>
+ <para>
+ The unchecked element is used to define (if present) that anyone can view this instance.
+ </para>
+ <para>
+<screen><![CDATA[
+<![CDATA[<!ELEMENT role-name (#PCDATA)>]]>
+</screen>
+ </para>
+ <para>
+ The role-name element is used to define a role that this security constraint will apply to:
+ </para>
+ <para>
+<screen><![CDATA[
+<role-name>SOMEROLE</role-name> Access to this instance is limited to the defined role.]]>
+</screen>
+ </para>
+</listitem>
+</varlistentry>
+</variablelist>
+</para>
</sect2>
<sect2>
<title>Portal Object DTD</title>
18 years, 2 months
JBoss Portal SVN: r10100 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-24 18:30:39 -0500 (Sun, 24 Feb 2008)
New Revision: 10100
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6. XML Descriptors
minor revisions, trying to remove passive voice...
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-24 18:33:20 UTC (rev 10099)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-24 23:30:39 UTC (rev 10100)
@@ -10,7 +10,7 @@
<title>XML Descriptors</title>
<sect1>
<title>Changes from previous releases</title>
- <para>The previous releases of JBoss Portal did not have an external schema to validate the various XML descriptors; however, it was internally validated by the portal. Since JBoss Portal 2.6, a Document Type Definition (DTD) has been provided to validate descriptors.
+ <para>The previous releases of JBoss Portal did not have an external schema to validate XML descriptors; however, they were internally validated by the portal. Since JBoss Portal 2.6, a Document Type Definition (DTD) has been provided to validate descriptors.
</para>
<para>
To use the DTD, add the following declaration to the start of the desired descriptors:
@@ -24,7 +24,7 @@
</screen>
</para>
<para>
- If you do not use the DTD declaration, the previous mechanism for XML validation will be used. The DTD is more strict, specifically with the order of XML elements. The following is an example from a <filename>*-object.xml</filename> descriptor, which will be valid if you are not using the DTD, but will be rejected if you are:
+ If you do not use the DTD declaration, the previous mechanism for XML validation is used. The DTD is more strict, specifically with the order of XML elements. The following is an example from a <filename>*-object.xml</filename> descriptor, which is valid if you are not using the DTD, but will be rejected if you are:
</para>
<para>
<screen><![CDATA[
@@ -33,7 +33,7 @@
</screen>
</para>
<para>
- The correct element order, and one which would be valid against the DTD, would be as follows:
+ The correct element order, and one which is valid against the DTD, is as follows:
</para>
<para>
<screen><![CDATA[
@@ -102,7 +102,7 @@
</para>
<para>
The <computeroutput><trans-attribute></computeroutput> element specifies the behavior of the portlet when it is invoked at runtime with respect to the transactional context. Depending on how the portlet is
- invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context. The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction will be suspended for the duration of the session. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
+ invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context. The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction will be suspended for the duration of the portlet's invocation. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
</para>
<para>
The following is an example section from a <filename>WEB-INF/portlet.xml</filename> file, which uses the <computeroutput><portlet-name></computeroutput>, <computeroutput><remotable></computeroutput>, and <computeroutput><trans-attribute></computeroutput> elements:
@@ -202,12 +202,12 @@
</screen>
</para>
<para>
- The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction will be suspended for the duration of the session. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
+ The default value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction will be suspended for the duration of the portlet's invocation. Accepted values are <computeroutput>Required</computeroutput>, <computeroutput>Mandatory</computeroutput>, <computeroutput>Never</computeroutput>, <computeroutput>Supports</computeroutput>, <computeroutput>NotSupported</computeroutput>, and <computeroutput>RequiresNew</computeroutput>.
</para>
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-<!ELEMENT header-content (link | script | meta)*>]]>
+<!ELEMENT header-content (link|script|meta)*>]]>
</screen></term>
<listitem>
<para>
@@ -291,7 +291,7 @@
</screen>
</para>
<para>
- The <computeroutput><service-ref></computeroutput> defines the reference to the service. In the JMX Microkernel environment, this consist of the JMX name of the service MBean. For an MBean reference, if the domain is left out, then the current domain of the portal is used.
+ The <computeroutput><service-ref></computeroutput> element defines the reference to the service. In the JMX Microkernel environment, this consist of the JMX name of the service MBean. For an MBean reference, if the domain is left out, then the current domain of the portal is used.
</para>
</listitem>
</varlistentry>
18 years, 2 months
JBoss Portal SVN: r10099 - modules/portlet/trunk/build.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-24 13:33:20 -0500 (Sun, 24 Feb 2008)
New Revision: 10099
Modified:
modules/portlet/trunk/build/pom.xml
Log:
use JBoss Unit 1.2 Beta 2
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-02-24 18:29:52 UTC (rev 10098)
+++ modules/portlet/trunk/build/pom.xml 2008-02-24 18:33:20 UTC (rev 10099)
@@ -35,7 +35,7 @@
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
<version.jboss.portal.common>1.2.0-Beta1</version.jboss.portal.common>
<version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
- <version.jboss.unit>1.2.0-SNAPSHOT</version.jboss.unit>
+ <version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
<version.apache.commons-httpclient>3.0.1</version.apache.commons-httpclient>
18 years, 2 months
JBoss Portal SVN: r10098 - in modules/portlet/trunk: controller and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-24 13:29:52 -0500 (Sun, 24 Feb 2008)
New Revision: 10098
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/controller/pom.xml
modules/portlet/trunk/test/pom.xml
Log:
- remove unnecessary dependencies
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-02-24 17:54:00 UTC (rev 10097)
+++ modules/portlet/trunk/build/pom.xml 2008-02-24 18:29:52 UTC (rev 10098)
@@ -26,17 +26,12 @@
<properties>
<version.apache.portals.bridges>1.0.3</version.apache.portals.bridges>
<version.apache-taglibs>1.1.2</version.apache-taglibs>
- <version.activation>1.0.2</version.activation>
<version.concurrent>1.3.4</version.concurrent>
<version.javax.servlet>2.5</version.javax.servlet>
<version.javax.servlet.jsp>2.1</version.javax.servlet.jsp>
<version.apache.tomcat>5.5.12</version.apache.tomcat>
- <version.jboss-common-core>2.2.1.GA</version.jboss-common-core>
<version.jboss-logging>2.0.3.GA</version.jboss-logging>
- <version.jboss-vfs>2.0.0.Beta6</version.jboss-vfs>
- <version.jboss.aop>2.0.0.beta1</version.jboss.aop>
<version.jbossxb>2.0.0.CR5</version.jbossxb>
- <version.javassist>3.6-beta</version.javassist>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
<version.jboss.portal.common>1.2.0-Beta1</version.jboss.portal.common>
<version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
@@ -44,11 +39,9 @@
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
<version.apache.commons-httpclient>3.0.1</version.apache.commons-httpclient>
- <version.trove>2.1.1</version.trove>
<version.jboss.microcontainer>2.0.0.Beta9</version.jboss.microcontainer>
<version.cargo>0.9-portal</version.cargo>
<version.junit>3.8.1</version.junit>
- <version.xerces>2.7.1</version.xerces>
<version.ant>1.7.0</version.ant>
<version.sun-jaxb>2.1.4</version.sun-jaxb>
<version.portlet-api>2.0-Draft32</version.portlet-api>
@@ -151,11 +144,6 @@
<version>${version.sun-jaxb}</version>
</dependency>
- <!--<dependency>-->
- <!--<artifactId>junit</artifactId>-->
- <!--<groupId>junit</groupId>-->
- <!--<version>${version.junit}</version>-->
- <!--</dependency>-->
<dependency>
<groupId>org.jboss.portal.common</groupId>
<artifactId>common-common</artifactId>
@@ -177,11 +165,6 @@
<version>${version.jboss.portal.web}</version>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${version.javax.servlet}</version>
@@ -191,11 +174,6 @@
<artifactId>jsp-api</artifactId>
<version>${version.javax.servlet.jsp}</version>
</dependency>
- <!--<dependency>-->
- <!--<groupId>apache-tomcat</groupId>-->
- <!--<artifactId>catalina</artifactId>-->
- <!--<version>${version.apache.tomcat}</version>-->
- <!--</dependency>-->
<dependency>
<groupId>concurrent</groupId>
@@ -238,16 +216,6 @@
<version>${version.jboss.unit}</version>
</dependency>
<dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- <version>${version.trove}</version>
- </dependency>
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>resolver</artifactId>
- <version>${version.xerces}</version>
- </dependency>
- <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
<version>${version.jbossxb}</version>
@@ -268,11 +236,6 @@
<version>${version.jboss-remoting}</version>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>${version.jboss-vfs}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-aop-mc-int</artifactId>
<version>${version.jboss.microcontainer}</version>
@@ -353,46 +316,6 @@
<version>${version.jboss.microcontainer}</version>
</dependency>
<dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <version>${version.jboss.aop}</version>
- </dependency>
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-as4-deployer</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-deployer-jdk50</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-jdk50</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-jdk50-client</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-standalone-aspect-library-jdk50</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jrockit-pluggable-instrumentor</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>pluggable-instrumentor</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${version.apache.commons-logging}</version>
Modified: modules/portlet/trunk/controller/pom.xml
===================================================================
--- modules/portlet/trunk/controller/pom.xml 2008-02-24 17:54:00 UTC (rev 10097)
+++ modules/portlet/trunk/controller/pom.xml 2008-02-24 18:29:52 UTC (rev 10098)
@@ -37,163 +37,6 @@
</dependency>
<!--TEST SCOPE-->
- <!--dependency>
- <groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-portlet</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>concurrent</groupId>
- <artifactId>concurrent</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.portal.common</groupId>
- <artifactId>common-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>javassist</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-remote</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-tooling-ant</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>portal-test</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>portal-test-generic</artifactId>
- </dependency>
- <dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- </dependency>
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>resolver</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-jdk</artifactId>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-remoting</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-aop-mc-int</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-classloader</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-managed</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-metatype</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <version>${version.jboss.aop}</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </dependency>
- <dependency>
- <groupId>cargo</groupId>
- <artifactId>cargo-manager</artifactId>
- <type>war</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.portal.web</groupId>
- <artifactId>web-web</artifactId>
- <type>jar</type>
- </dependency-->
<!--
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
Modified: modules/portlet/trunk/test/pom.xml
===================================================================
--- modules/portlet/trunk/test/pom.xml 2008-02-24 17:54:00 UTC (rev 10097)
+++ modules/portlet/trunk/test/pom.xml 2008-02-24 18:29:52 UTC (rev 10098)
@@ -38,10 +38,6 @@
<artifactId>common-mc</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>javassist</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
</dependency>
@@ -66,14 +62,6 @@
<artifactId>portal-test-generic</artifactId>
</dependency>
<dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- </dependency>
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>resolver</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
</dependency>
@@ -90,10 +78,6 @@
<artifactId>jboss-remoting</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-aop-mc-int</artifactId>
</dependency>
@@ -158,11 +142,6 @@
<artifactId>jboss-metatype</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <version>${version.jboss.aop}</version>
- </dependency>
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
18 years, 2 months
JBoss Portal SVN: r10097 - in modules/web/trunk: web and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-24 12:54:00 -0500 (Sun, 24 Feb 2008)
New Revision: 10097
Modified:
modules/web/trunk/build/pom.xml
modules/web/trunk/web/pom.xml
Log:
- update to use JBoss Unit 1.2 Beta 2
- trim down pom to remove dependencies resolved transitively
Modified: modules/web/trunk/build/pom.xml
===================================================================
--- modules/web/trunk/build/pom.xml 2008-02-24 17:22:51 UTC (rev 10096)
+++ modules/web/trunk/build/pom.xml 2008-02-24 17:54:00 UTC (rev 10097)
@@ -25,27 +25,19 @@
<description>JBoss Portal Web Module</description>
<properties>
- <version.activation>1.0.2</version.activation>
<version.concurrent>1.3.4</version.concurrent>
<version.sun.servlet>2.4</version.sun.servlet>
<version.apache.tomcat>5.5.12</version.apache.tomcat>
- <version.jboss-common-core>2.2.1.GA</version.jboss-common-core>
<version.jboss-logging>2.0.3.GA</version.jboss-logging>
- <version.jboss-vfs>2.0.0.Beta6</version.jboss-vfs>
- <version.jboss.aop>2.0.0.CR1</version.jboss.aop>
- <version.jbossxb>2.0.0.CR3</version.jbossxb>
- <version.javassist>3.6-beta</version.javassist>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
<version.jboss.portal.common>1.2.0-Beta1</version.jboss.portal.common>
- <version.jboss.unit>1.2.0-SNAPSHOT</version.jboss.unit>
+ <version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
<version.apache.commons-httpclient>3.0.1</version.apache.commons-httpclient>
- <version.trove>2.1.1</version.trove>
<version.jboss.microcontainer>2.0.0.Beta9</version.jboss.microcontainer>
<version.cargo>0.9-portal</version.cargo>
<version.junit>3.8.1</version.junit>
- <version.xerces>2.7.1</version.xerces>
<version.ant>1.7.0</version.ant>
</properties>
@@ -98,11 +90,6 @@
<version>${version.jboss.portal.common}</version>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- </dependency>
- <dependency>
<groupId>sun-servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${version.sun.servlet}</version>
@@ -154,22 +141,7 @@
<version>${version.jboss.unit}</version>
</dependency>
<dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- <version>${version.trove}</version>
- </dependency>
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>resolver</artifactId>
- <version>${version.xerces}</version>
- </dependency>
- <dependency>
<groupId>jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <version>${version.jbossxb}</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
<artifactId>jboss-logging-jdk</artifactId>
<version>${version.jboss-logging}</version>
</dependency>
@@ -184,11 +156,6 @@
<version>${version.jboss-remoting}</version>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>${version.jboss-vfs}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-aop-mc-int</artifactId>
<version>${version.jboss.microcontainer}</version>
@@ -269,46 +236,6 @@
<version>${version.jboss.microcontainer}</version>
</dependency>
<dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <version>${version.jboss.aop}</version>
- </dependency>
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-as4-deployer</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-deployer-jdk50</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-jdk50</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-jdk50-client</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-standalone-aspect-library-jdk50</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jrockit-pluggable-instrumentor</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>pluggable-instrumentor</artifactId>-->
- <!--<version>${version.jboss.aop}</version>-->
- <!--</dependency>-->
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${version.apache.commons-logging}</version>
Modified: modules/web/trunk/web/pom.xml
===================================================================
--- modules/web/trunk/web/pom.xml 2008-02-24 17:22:51 UTC (rev 10096)
+++ modules/web/trunk/web/pom.xml 2008-02-24 17:54:00 UTC (rev 10097)
@@ -44,11 +44,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>javassist</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
<scope>test</scope>
@@ -79,22 +74,7 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>resolver</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
<artifactId>jboss-logging-jdk</artifactId>
<scope>test</scope>
</dependency>
@@ -108,11 +88,6 @@
<artifactId>jboss-remoting</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-aop-mc-int</artifactId>
<scope>test</scope>
@@ -193,46 +168,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <scope>test</scope>
- </dependency>
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-as4-deployer</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-deployer-jdk50</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-jdk50</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-aop-jdk50-client</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jboss-standalone-aspect-library-jdk50</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>jrockit-pluggable-instrumentor</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>jboss.aop</groupId>-->
- <!--<artifactId>pluggable-instrumentor</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<scope>test</scope>
@@ -248,16 +183,6 @@
<type>war</type>
<scope>test</scope>
</dependency>
- <!--<dependency>-->
- <!--<groupId>org.jboss.unit</groupId>-->
- <!--<artifactId>jboss-unit-tooling-ant</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>cargo</groupId>-->
- <!--<artifactId>cargo-core-uberjar</artifactId>-->
- <!--<scope>test</scope>-->
- <!--</dependency>-->
</dependencies>
<build>
@@ -325,19 +250,12 @@
<property name="dependency.jboss-managed.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-managed.jar.path}"/>
<property name="dependency.jboss-metatype.jar" value="${maven.dependency.org.jboss.microcontainer.jboss.metatype.jar.path}"/>
<property name="dependency.jboss-aop.jar" value="${maven.dependency.org.jboss.aop.jboss-aop.jar.path}"/>
- <!--<property name="dependency.jboss-aop-as4-deployer.jar" value="${maven.dependency.jboss.aop.jboss-aop-as4-deployer.jar.path}"/>-->
- <!--<property name="dependency.jboss-aop-deployer-jdk50.jar" value="${maven.dependency.jboss.aop.jboss-aop-deployer-jdk50.jar.path}"/>-->
- <!--<property name="dependency.jboss-aop-jdk50.jar" value="${maven.dependency.jboss.aop.jboss-aop-jdk50.jar.path}"/>-->
- <!--<property name="dependency.jboss-aop-jdk50-client.jar" value="${maven.dependency.jboss.aop.jboss-aop-jdk50-client.jar.path}"/>-->
- <!--<property name="dependency.jboss-standalone-aspect-library-jdk50.jar" value="${maven.dependency.jboss.aop.jboss-standalone-aspect-library-jdk50.jar.path}"/>-->
- <!--<property name="dependency.jrockit-pluggable-instrumentor.jar" value="${maven.dependency.jboss.aop.jrockit-pluggable-instrumentor.jar.path}"/>-->
- <!--<property name="dependency.pluggable-instrumentor.jar" value="${maven.dependency.jboss.aop.pluggable-instrumentor.jar.path}"/>-->
<property name="dependency.javassist.jar" value="${maven.dependency.org.jboss.javassist.jar.path}"/>
<property name="dependency.jboss-common-core.jar" value="${maven.dependency.org.jboss.jboss-common-core.jar.path}"/>
<property name="dependency.resolver.jar" value="${maven.dependency.apache-xerces.resolver.jar.path}"/>
<property name="dependency.xercesImpl.jar" value="${maven.dependency.apache-xerces.xercesImpl.jar.path}"/>
<property name="dependency.xml-apis.jar" value="${maven.dependency.apache-xerces.xml-apis.jar.path}"/>
- <property name="dependency.jbossxb.jar" value="${maven.dependency.jboss.jbossxb.jar.path}"/>
+ <property name="dependency.jbossxb.jar" value="${maven.dependency.org.jboss.jbossxb.jar.path}"/>
<property name="dependency.jboss-remoting.jar" value="${maven.dependency.jboss.jboss-remoting.jar.path}"/>
<property name="dependency.portal-common.jar" value="${maven.dependency.org.jboss.portal.common.common-common.jar.path}"/>
<property name="dependency.portal-common-mc.jar" value="${maven.dependency.org.jboss.portal.common.common-mc.jar.path}"/>
18 years, 2 months
JBoss Portal SVN: r10096 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-24 12:22:51 -0500 (Sun, 24 Feb 2008)
New Revision: 10096
Modified:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit/ExtendedAssert.java
Log:
better log of byte array comparison failure
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit/ExtendedAssert.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit/ExtendedAssert.java 2008-02-24 16:53:47 UTC (rev 10095)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/junit/ExtendedAssert.java 2008-02-24 17:22:51 UTC (rev 10096)
@@ -81,9 +81,35 @@
{
return;
}
- fail(format(message, expected, actual));
+
+ //
+ fail(format(message, toString(expected), toString(actual)));
}
+ private static String toString(byte[] expected)
+ {
+ StringBuffer expectedBuffer = new StringBuffer("[");
+
+ //
+ for (byte expectedByte : expected)
+ {
+ expectedBuffer.append(expectedByte).append(',');
+ }
+
+ //
+ if (expectedBuffer.length() == 1)
+ {
+ expectedBuffer.append(']');
+ }
+ else
+ {
+ expectedBuffer.setCharAt(expectedBuffer.length(), ']');
+ }
+
+ //
+ return expectedBuffer.toString();
+ }
+
private static String format(String message, Object expected, Object actual)
{
String formatted = "";
18 years, 2 months
JBoss Portal SVN: r10095 - in modules/common/trunk: common and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-24 11:53:47 -0500 (Sun, 24 Feb 2008)
New Revision: 10095
Modified:
modules/common/trunk/build/pom.xml
modules/common/trunk/common/pom.xml
modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/CachingLocaleFormat.java
modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/ValveTestCase.java
modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/io/IOToolsTestCase.java
Log:
JBPORTAL-1923 : Replace oswego by java.util.concurrent
Modified: modules/common/trunk/build/pom.xml
===================================================================
--- modules/common/trunk/build/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
+++ modules/common/trunk/build/pom.xml 2008-02-24 16:53:47 UTC (rev 10095)
@@ -15,12 +15,10 @@
<properties>
<version.activation>1.1</version.activation>
- <version.concurrent>1.3.4</version.concurrent>
<version.javax.servlet>2.4</version.javax.servlet>
<version.jboss-j2ee>4.2.0.GA</version.jboss-j2ee>
<version.jboss-jmx>4.2.0.GA</version.jboss-jmx>
<version.jboss-system>4.2.0.GA</version.jboss-system>
- <version.jboss-backport-concurrent>2.1.0.GA</version.jboss-backport-concurrent>
<version.jboss-common-core>2.2.0.GA</version.jboss-common-core>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-httpclient>3.0.1</version.apache.commons-httpclient>
@@ -71,12 +69,6 @@
</dependency>
<dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>${version.concurrent}</version>
- </dependency>
-
- <dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${version.activation}</version>
@@ -119,12 +111,6 @@
</dependency>
<dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-backport-concurrent</artifactId>
- <version>${version.jboss-backport-concurrent}</version>
- </dependency>
-
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${version.javax.servlet}</version>
Modified: modules/common/trunk/common/pom.xml
===================================================================
--- modules/common/trunk/common/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
+++ modules/common/trunk/common/pom.xml 2008-02-24 16:53:47 UTC (rev 10095)
@@ -19,11 +19,6 @@
</dependency>
<dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- </dependency>
-
- <dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
@@ -59,11 +54,6 @@
</dependency>
<dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-backport-concurrent</artifactId>
- </dependency>
-
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/CachingLocaleFormat.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/CachingLocaleFormat.java 2008-02-23 00:17:20 UTC (rev 10094)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/CachingLocaleFormat.java 2008-02-24 16:53:47 UTC (rev 10095)
@@ -22,12 +22,12 @@
******************************************************************************/
package org.jboss.portal.common.i18n;
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
import org.jboss.portal.common.util.ConversionException;
import org.jboss.portal.common.text.CharWriter;
import java.io.IOException;
import java.util.Locale;
+import java.util.concurrent.ConcurrentHashMap;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -40,10 +40,10 @@
private final LocaleFormat delegate;
/** . */
- private final ConcurrentHashMap localeCache;
+ private final ConcurrentHashMap<String, Locale> localeCache;
/** . */
- private final ConcurrentHashMap stringCache;
+ private final ConcurrentHashMap<Locale, String> stringCache;
/**
* @param delegate the delegate when the cache value has not been found
@@ -56,13 +56,13 @@
throw new IllegalArgumentException("No null delegate is possible");
}
this.delegate = delegate;
- this.localeCache = new ConcurrentHashMap();
- this.stringCache = new ConcurrentHashMap();
+ this.localeCache = new ConcurrentHashMap<String, Locale>();
+ this.stringCache = new ConcurrentHashMap<Locale, String>();
}
public Locale getLocale(String value) throws ConversionException
{
- Locale locale = (Locale)localeCache.get(value);
+ Locale locale = localeCache.get(value);
//
if (locale != null)
@@ -81,7 +81,7 @@
public String toString(Locale locale) throws ConversionException
{
- String string = (String)stringCache.get(locale);
+ String string = stringCache.get(locale);
//
if (string != null)
Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/ValveTestCase.java
===================================================================
--- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/ValveTestCase.java 2008-02-23 00:17:20 UTC (rev 10094)
+++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/ValveTestCase.java 2008-02-24 16:53:47 UTC (rev 10095)
@@ -23,13 +23,13 @@
package org.jboss.portal.test.common;
import java.io.PrintStream;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.BrokenBarrierException;
import junit.framework.TestCase;
import org.jboss.portal.common.concurrent.Valve;
-import EDU.oswego.cs.dl.util.concurrent.CyclicBarrier;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5451 $
@@ -135,11 +135,15 @@
assertTrue(valve.beforeInvocation());
// The valve is enterred
- barrier.barrier();
+ barrier.await();
// Wait
- barrier.barrier();
+ barrier.await();
}
+ catch (BrokenBarrierException e)
+ {
+ fail("" + e.getMessage());
+ }
catch (InterruptedException ignore)
{
}
@@ -149,8 +153,12 @@
try
{
// Tell the other thread we have finished
- barrier.barrier();
+ barrier.await();
}
+ catch (BrokenBarrierException e)
+ {
+ fail("" + e.getMessage());
+ }
catch (InterruptedException ignore)
{
}
@@ -163,7 +171,7 @@
thread.start();
// Wait until the thread called beforeInvocation
- barrier.barrier();
+ barrier.await();
// Attemtp to close
assertFalse(valve.closing(100));
@@ -172,10 +180,10 @@
assertEquals(Valve.CLOSING, valve.getState());
// Ask the invoker thread to finish
- barrier.barrier();
+ barrier.await();
// Wait until invocation is finished
- barrier.barrier();
+ barrier.await();
// Close, no thread are inside
valve.closing();
Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/io/IOToolsTestCase.java
===================================================================
--- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/io/IOToolsTestCase.java 2008-02-23 00:17:20 UTC (rev 10094)
+++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/io/IOToolsTestCase.java 2008-02-24 16:53:47 UTC (rev 10095)
@@ -36,9 +36,8 @@
import java.io.CharArrayWriter;
import java.io.CharArrayReader;
import java.util.Random;
+import java.util.concurrent.atomic.AtomicBoolean;
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
-
/**
* todo:
* <ul>
@@ -215,7 +214,7 @@
public void testOutputStreamSafeClose()
{
IOTools.safeClose((OutputStream)null);
- final SynchronizedBoolean called = new SynchronizedBoolean(false);
+ final AtomicBoolean called = new AtomicBoolean(false);
IOTools.safeClose(new AbstractOutputStream()
{
public void close() throws IOException
@@ -275,7 +274,7 @@
public void testInputStreamSafeClose()
{
IOTools.safeClose((InputStream)null);
- final SynchronizedBoolean called = new SynchronizedBoolean(false);
+ final AtomicBoolean called = new AtomicBoolean(false);
IOTools.safeClose(new AbstractInputStream()
{
public void close() throws IOException
@@ -336,7 +335,7 @@
public void testReaderSafeClose()
{
IOTools.safeClose((Reader)null);
- final SynchronizedBoolean called = new SynchronizedBoolean(false);
+ final AtomicBoolean called = new AtomicBoolean(false);
IOTools.safeClose(new AbstractReader()
{
public void close() throws IOException
@@ -397,7 +396,7 @@
public void testWriterSafeClose()
{
IOTools.safeClose((Writer)null);
- final SynchronizedBoolean called = new SynchronizedBoolean(false);
+ final AtomicBoolean called = new AtomicBoolean(false);
IOTools.safeClose(new AbstractWriter()
{
public void close() throws IOException
@@ -479,7 +478,7 @@
}
//
- final SynchronizedBoolean closeCalled1 = new SynchronizedBoolean(false);
+ final AtomicBoolean closeCalled1 = new AtomicBoolean(false);
final IOException ioException1 = new IOException();
try
{
@@ -503,7 +502,7 @@
}
//
- final SynchronizedBoolean closeCalled2 = new SynchronizedBoolean(false);
+ final AtomicBoolean closeCalled2 = new AtomicBoolean(false);
IOTools.copy(new AbstractInputStream()
{
public int read() throws IOException
@@ -519,7 +518,7 @@
//
final IOException ioException2 = new IOException();
- final SynchronizedBoolean closeCalled3 = new SynchronizedBoolean(false);
+ final AtomicBoolean closeCalled3 = new AtomicBoolean(false);
try
{
IOTools.copy(new ByteArrayInputStream(new byte[1]), new AbstractOutputStream()
@@ -541,7 +540,7 @@
}
//
- final SynchronizedBoolean closeCalled4 = new SynchronizedBoolean(false);
+ final AtomicBoolean closeCalled4 = new AtomicBoolean(false);
IOTools.copy(new ByteArrayInputStream(new byte[1]), new AbstractOutputStream()
{
public void close() throws IOException
@@ -581,7 +580,7 @@
}
//
- final SynchronizedBoolean closeCalled1 = new SynchronizedBoolean(false);
+ final AtomicBoolean closeCalled1 = new AtomicBoolean(false);
final IOException ioException1 = new IOException();
try
{
@@ -605,7 +604,7 @@
}
//
- final SynchronizedBoolean closeCalled2 = new SynchronizedBoolean(false);
+ final AtomicBoolean closeCalled2 = new AtomicBoolean(false);
IOTools.copy(new AbstractReader()
{
public int read(char cbuf[], int off, int len) throws IOException
@@ -621,7 +620,7 @@
//
final IOException ioException2 = new IOException();
- final SynchronizedBoolean closeCalled3 = new SynchronizedBoolean(false);
+ final AtomicBoolean closeCalled3 = new AtomicBoolean(false);
try
{
IOTools.copy(new CharArrayReader(new char[1]), new AbstractWriter()
@@ -643,7 +642,7 @@
}
//
- final SynchronizedBoolean closeCalled4 = new SynchronizedBoolean(false);
+ final AtomicBoolean closeCalled4 = new AtomicBoolean(false);
IOTools.copy(new CharArrayReader(new char[1]), new AbstractWriter()
{
public void close() throws IOException
18 years, 2 months
JBoss Portal SVN: r10094 - in modules/test/trunk: build and 18 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-22 19:17:20 -0500 (Fri, 22 Feb 2008)
New Revision: 10094
Added:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/xml/NoSuchElementException.java
Removed:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/Log4JWriter.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/MultiValuedPropertyMap.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/ParameterValidation.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/Tools.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/Serialization.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/SerializationFilter.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/UndeclaredIOException.java
Modified:
modules/test/trunk/build/pom.xml
modules/test/trunk/docs/pom.xml
modules/test/trunk/docs/user-guide/pom.xml
modules/test/trunk/mc/pom.xml
modules/test/trunk/pom.xml
modules/test/trunk/remote/pom.xml
modules/test/trunk/test/agent/pom.xml
modules/test/trunk/test/core/pom.xml
modules/test/trunk/test/generic/pom.xml
modules/test/trunk/test/jboss/pom.xml
modules/test/trunk/test/opends/pom.xml
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/IOTools.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/xml/XMLTools.java
modules/test/trunk/tooling/ant/pom.xml
modules/test/trunk/tooling/core/pom.xml
modules/test/trunk/tooling/examples/maven2/pom.xml
modules/test/trunk/tooling/maven2/pom.xml
modules/test/trunk/tooling/pom.xml
modules/test/trunk/unit/pom.xml
Log:
back to 1.2.0.SNAPSHOT + trim down forked utils
Modified: modules/test/trunk/build/pom.xml
===================================================================
--- modules/test/trunk/build/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/build/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Portal Test Module</name>
<url>http://www.jboss.com/products/jbossmc</url>
Modified: modules/test/trunk/docs/pom.xml
===================================================================
--- modules/test/trunk/docs/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/docs/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -4,13 +4,13 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Docs Aggregator</name>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<url>http://labs.jboss.com/jbossportal</url>
<modules>
Modified: modules/test/trunk/docs/user-guide/pom.xml
===================================================================
--- modules/test/trunk/docs/user-guide/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/docs/user-guide/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -60,7 +60,7 @@
<groupId>org.jboss.unit</groupId>
<artifactId>user-guide-${translation}</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>User_Guide_(${translation})</name>
Modified: modules/test/trunk/mc/pom.xml
===================================================================
--- modules/test/trunk/mc/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/mc/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/pom.xml
===================================================================
--- modules/test/trunk/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -5,7 +5,7 @@
<artifactId>module-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Modules Test</name>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
Modified: modules/test/trunk/remote/pom.xml
===================================================================
--- modules/test/trunk/remote/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/remote/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/agent/pom.xml
===================================================================
--- modules/test/trunk/test/agent/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/agent/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/core/pom.xml
===================================================================
--- modules/test/trunk/test/core/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/core/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/generic/pom.xml
===================================================================
--- modules/test/trunk/test/generic/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/generic/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/jboss/pom.xml
===================================================================
--- modules/test/trunk/test/jboss/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/jboss/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/opends/pom.xml
===================================================================
--- modules/test/trunk/test/opends/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/opends/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/Log4JWriter.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/Log4JWriter.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/Log4JWriter.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -1,86 +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.framework.common;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-
-import java.io.Writer;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
- */
-public class Log4JWriter extends Writer
-{
-
- /** The open/closed status. */
- private boolean open;
-
- /** The logger. */
- private Logger log;
-
- /** The logging level. */
- private Level level;
-
- /**
- * @throws IllegalArgumentException if log or level is null
- */
- public Log4JWriter(Logger log, Level level) throws IllegalArgumentException
- {
- if (log == null)
- {
- throw new IllegalArgumentException("No logger provided");
- }
- if (level == null)
- {
- throw new IllegalArgumentException("No level provided");
- }
- this.open = false;
- this.log = log;
- this.level = level;
- }
-
- public void write(char cbuf[], int off, int len) throws IOException
- {
- if (open)
- {
- log.log(level, new String(cbuf, off, len));
- }
- else
- {
- throw new IOException("Stream closed");
- }
- }
-
- public void flush() throws IOException
- {
- }
-
- public void close() throws IOException
- {
- open = false;
- }
-}
-
Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/MultiValuedPropertyMap.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/MultiValuedPropertyMap.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/MultiValuedPropertyMap.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -1,44 +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.framework.common;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * A property map with multi valued properties.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface MultiValuedPropertyMap<T>
-{
- T getValue(String key) throws IllegalArgumentException;
- List<T> getValues(String key) throws IllegalArgumentException;
- void addValue(String key, T value) throws IllegalArgumentException;
- void setValue(String key, T value) throws IllegalArgumentException;
- Set<String> keySet();
- void clear();
- int size();
- void append(MultiValuedPropertyMap<T> appended) throws IllegalArgumentException;
-}
Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/ParameterValidation.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/ParameterValidation.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/ParameterValidation.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -1,67 +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.framework.common;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 5757 $
- * @since 2.4 (May 31, 2006)
- */
-public class ParameterValidation
-{
- public static void throwIllegalArgExceptionIfNullOrEmpty(String valueToCheck, String valueName, String contextName)
- {
- if (isNullOrEmpty(valueToCheck))
- {
- throw new IllegalArgumentException((contextName != null ? contextName + " r" : "R") + "equires a non-null, non-empty " + valueName);
- }
- }
-
- /** @since 2.6 */
- public static boolean isNullOrEmpty(String valueToCheck)
- {
- return valueToCheck == null || valueToCheck.length() == 0;
- }
-
- public static void throwIllegalArgExceptionIfNull(Object objectToTest, String name)
- {
- if (objectToTest == null)
- {
- throw new IllegalArgumentException("Must pass a non null " + name);
- }
- }
-
- /** @since 2.4.1 */
- public static void throwIllegalArgExceptionIfNullOrEmpty(Object[] array, String name)
- {
- if (array == null)
- {
- throw new IllegalArgumentException("Must pass a non-null " + name);
- }
- if (array.length == 0)
- {
- throw new IllegalArgumentException("Must pass a non-empty " + name);
- }
- }
-}
-
Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/Tools.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/Tools.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/Tools.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -1,1023 +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.framework.common;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.lang.reflect.Array;
-import java.math.BigInteger;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.UnknownHostException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 7377 $
- */
-public class Tools
-{
-
- public static final int DEFAULT_BUFFER_SIZE = 512;
-
- public static final Logger log = Logger.getLogger(Tools.class);
-
- /** 16 chars long VMID. */
- public static final String VMID = VMID();
-
- private static String VMID()
- {
- try
- {
- BigInteger bi = BigInteger.valueOf(0);
- byte[] address = java.net.InetAddress.getLocalHost().getAddress();
- for (int i = 0; i < 4; i++)
- {
- bi = bi.shiftLeft(8);
- bi = bi.add(BigInteger.valueOf(address[i]));
- }
- bi = bi.shiftLeft(32);
- int code = System.identityHashCode(new Object());
- bi = bi.add(BigInteger.valueOf(code));
- byte[] bytes = bi.toByteArray();
- StringBuffer buffer = new StringBuffer();
- char[] chars = "0123456789ABCDEF".toCharArray();
- for (int i = 0; i < bytes.length; i++)
- {
- buffer.append(chars[(bytes[i] & 0xF0) >> 4]).append(chars[bytes[i] & 0xF]);
- }
- return buffer.toString();
- }
- catch (UnknownHostException e)
- {
- e.printStackTrace(System.err);
- throw new Error("Cannot create VMID");
- }
- }
-
- public static final Enumeration EMPTY_ENUMERATION = new Enumeration()
- {
- public boolean hasMoreElements()
- {
- return false;
- }
-
- public Object nextElement()
- {
- throw new NoSuchElementException();
- }
- };
-
- public static final Iterator EMPTY_ITERATOR = new Iterator()
- {
- public boolean hasNext()
- {
- return false;
- }
-
- public Object next()
- {
- throw new NoSuchElementException();
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- };
-
- public static final ResourceBundle EMPTY_BUNDLE = new ResourceBundle()
- {
- protected Object handleGetObject(String key)
- {
- return null;
- }
-
- public Enumeration getKeys()
- {
- return EMPTY_ENUMERATION;
- }
- };
-
- public static <E> Enumeration<E> emptyEnumeration()
- {
- return (Enumeration<E>)EMPTY_ENUMERATION;
- }
-
- public static <E> Iterator<E> emptyIterator()
- {
- return (Iterator<E>)EMPTY_ITERATOR;
- }
-
- public static <E> Enumeration<E> toEnumeration(final Iterator<E> iterator)
- {
- if (iterator == null)
- {
- throw new IllegalArgumentException();
- }
- return new Enumeration<E>()
- {
- public boolean hasMoreElements()
- {
- return iterator.hasNext();
- }
-
- public E nextElement()
- {
- return iterator.next();
- }
- };
- }
-
- public static <E> Enumeration<E> toEnumeration(final E[] objects)
- {
- if (objects == null)
- {
- throw new IllegalArgumentException();
- }
- return new Enumeration<E>()
- {
- int index = 0;
-
- public boolean hasMoreElements()
- {
- return index < objects.length;
- }
-
- public E nextElement()
- {
- if (index < objects.length)
- {
- return objects[index++];
- }
- else
- {
- throw new NoSuchElementException();
- }
- }
- };
- }
-
- public static <E> Enumeration<E> toEnumeration(final E o)
- {
- return new Enumeration<E>()
- {
- boolean hasMore = true;
-
- public boolean hasMoreElements()
- {
- return hasMore;
- }
-
- public E nextElement()
- {
- if (hasMore)
- {
- hasMore = false;
- }
- else
- {
- throw new NoSuchElementException();
- }
- return o;
- }
- };
- }
-
- public static <E> Set<E> toSet(Enumeration<E> e)
- {
- if (e == null)
- {
- throw new IllegalArgumentException();
- }
- HashSet<E> set = new HashSet<E>();
- while (e.hasMoreElements())
- {
- set.add(e.nextElement());
- }
- return set;
- }
-
- public static <E> Set<E> toSet(E... objects)
- {
- if (objects == null)
- {
- throw new IllegalArgumentException();
- }
- HashSet<E> set = new HashSet<E>();
- for (E object : objects)
- {
- set.add(object);
- }
- return set;
- }
-
- /**
- * Transforms an iterator into an unordered Set
- *
- * @param iterator The iterator to transform
- * @return A HashSet
- */
- public static <E> Set<E> toSet(Iterator<E> iterator)
- {
- if (iterator == null)
- {
- throw new IllegalArgumentException();
- }
- return toSet(iterator, false);
- }
-
- /**
- * Transforms an iterator into a Set
- *
- * @param iterator The iterator to transform
- * @param preserveOrder true if the set must respect the ordering of the iterator
- * @return a LinkedHashSet if ordered is true, a HashSet otherwise
- */
- public static <E> Set<E> toSet(Iterator<E> iterator, boolean preserveOrder)
- {
- if (iterator == null)
- {
- throw new IllegalArgumentException();
- }
- Set<E> set;
- if (preserveOrder)
- {
- set = new LinkedHashSet<E>();
- }
- else
- {
- set = new HashSet<E>();
- }
- while (iterator.hasNext())
- {
- set.add(iterator.next());
- }
- return set;
- }
-
- public static <E> List<E> toList(Enumeration<E> e)
- {
- if (e == null)
- {
- throw new IllegalArgumentException();
- }
- List<E> list = new ArrayList<E>();
- while (e.hasMoreElements())
- {
- list.add(e.nextElement());
- }
- return list;
- }
-
- public static <E> List<E> toList(Iterator<E> iterator)
- {
- if (iterator == null)
- {
- throw new IllegalArgumentException();
- }
- List<E> list = new ArrayList<E>();
- while (iterator.hasNext())
- {
- list.add(iterator.next());
- }
- return list;
- }
-
- public static <E> List<E> toList(E... objects)
- {
- if (objects == null)
- {
- throw new IllegalArgumentException();
- }
- List<E> list = new ArrayList<E>(objects.length);
- for (E object : objects)
- {
- list.add(object);
- }
- return list;
- }
-
- /**
- * Consider remove this method as it cannot be generified.
- *
- * @param i
- * @return
- */
- @Deprecated
- public static Object[] toArray(Iterator i)
- {
- // This method cannot be generified.
- return toList(i).toArray();
- }
-
- /**
- * Returns a singleton iterator.
- *
- * @param o the singleton object
- * @return the iterator
- */
- public static <E> Iterator<E> iterator(final E o)
- {
- return new Iterator<E>()
- {
- /** The status of the iterator. */
- boolean done = false;
-
- public boolean hasNext()
- {
- return !done;
- }
-
- public E next()
- {
- if (done)
- {
- throw new NoSuchElementException("Already iterated");
- }
- done = true;
- return o;
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException("read only");
- }
- };
- }
-
- /**
- * Returns an iterator over the array elements.
- *
- * @param objects the array containing the objects to iterate on
- * @return the iterator
- * @throws IllegalArgumentException if the object array is null or the specified range is not valid
- */
- public static <E> Iterator<E> iterator(final E... objects) throws IllegalArgumentException
- {
- if (objects == null)
- {
- throw new IllegalArgumentException("No null object array");
- }
- return iterator(objects, 0, objects.length);
- }
-
- /**
- * Returns an iterator over the array elements within the specified range. The range is considered as valid
- * if the from argument is greater or equals than zero, the to argument is lesser or equals than array size
- * and the from argument is lesser or equals to the to argument.
- *
- * @param objects the array containing the objects to iterate on
- * @param from the inclusive start index
- * @param to the exclusive stop index
- * @return the iterator
- * @throws IllegalArgumentException if the object array is null or the specified range is not valid or if the range is not valid
- */
- public static <E> Iterator<E> iterator(final E[] objects, final int from, final int to) throws IllegalArgumentException
- {
- if (objects == null)
- {
- throw new IllegalArgumentException("No null object array");
- }
- if (from > to || from < 0 || to > objects.length)
- {
- throw new IllegalArgumentException("Invalid range [" + from + "," + to + "] for array of length " + objects.length);
- }
- return new Iterator<E>()
- {
- /** . */
- int index = from;
-
- public boolean hasNext()
- {
- return index < to;
- }
-
- public E next()
- {
- if (index >= to)
- {
- throw new NoSuchElementException("Index is greater than the array length");
- }
- return objects[index++];
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException("read only");
- }
- };
- }
-
- public static int computeStringHash(int hash, String s)
- {
- char[] chars = s.toCharArray();
- int length = chars.length;
- for (int i = 0; i < length; i++)
- {
- char c = chars[i];
- hash = 31 * hash + c;
- }
- return hash;
- }
-
- /**
- * Computes an md5 hash of a string.
- *
- * @param text the hashed string
- * @return the string hash
- * @throws NullPointerException if text is null
- */
- public static byte[] md5(String text)
- {
- // arguments check
- if (text == null)
- {
- throw new NullPointerException("null text");
- }
-
- try
- {
- MessageDigest md = MessageDigest.getInstance("MD5");
- md.update(text.getBytes());
- return md.digest();
- }
- catch (NoSuchAlgorithmException e)
- {
- log.error("Cannot find MD5 algorithm", e);
- throw new RuntimeException("Cannot find MD5 algorithm");
- }
- }
-
- /**
- * Computes an md5 hash and returns the result as a string in hexadecimal format.
- *
- * @param text the hashed string
- * @return the string hash
- * @throws NullPointerException if text is null
- */
- public static String md5AsHexString(String text)
- {
- return toHexString(md5(text));
- }
-
- /**
- * Computes a hash with specified algorighm and returns the result as a string in hexadecimal format
- *
- * @param text
- * @param algorithm
- * @param encoding
- * @return
- * @throws NoSuchAlgorithmException
- */
- public static String hashAndEncodeString(String text, String algorithm, String encoding) throws NoSuchAlgorithmException
- {
- // arguments check
- if (text == null)
- {
- throw new NullPointerException("null text");
- }
- if (algorithm == null)
- {
- throw new NullPointerException("null algorithm");
- }
- if (encoding == null)
- {
- throw new NullPointerException("null encoding");
- }
-
- MessageDigest md = MessageDigest.getInstance(algorithm);
- md.update(text.getBytes());
- byte[] encoded = md.digest();
-
- if ("HEX".equalsIgnoreCase(encoding))
- {
- return toHexString(encoded);
- }
- //TODO: add base64 support here
- else
- {
- throw new IllegalArgumentException("Not supported encoding: " + encoding);
- }
-
- }
-
-
- /**
- * Returns a string in the hexadecimal format.
- *
- * @param bytes the converted bytes
- * @return the hexadecimal string representing the bytes data
- * @throws IllegalArgumentException if the byte array is null
- */
- public static String toHexString(byte[] bytes)
- {
- if (bytes == null)
- {
- throw new IllegalArgumentException("byte array must not be null");
- }
- StringBuffer hex = new StringBuffer(bytes.length * 2);
- for (int i = 0; i < bytes.length; i++)
- {
- hex.append(Character.forDigit((bytes[i] & 0XF0) >> 4, 16));
- hex.append(Character.forDigit((bytes[i] & 0X0F), 16));
- }
- return hex.toString();
- }
-
- /**
- * Returns a byte array converted from the hexadecimal format.
- *
- * @param hex the string to convert
- * @return the byte array corresponding
- * @throws IllegalArgumentException if the string is null or does not have the good format
- */
- public static byte[] fromHexString(String hex)
- {
- if (hex == null)
- {
- throw new IllegalArgumentException("Hex string must not be null");
- }
- if (hex.length() % 2 == 1)
- {
- throw new IllegalArgumentException("Hex string length is not even : " + hex.length());
- }
- int index = 0;
- byte[] bytes = new byte[hex.length() / 2];
- for (int i = 0; i < bytes.length; i++)
- {
- char chigh = hex.charAt(index++);
- int high = Character.digit(chigh, 16);
- if (high == -1)
- {
- throw new IllegalArgumentException("Hex string contains a bad char : " + chigh);
- }
- char clow = hex.charAt(index++);
- int low = Character.digit(clow, 16);
- if (low == -1)
- {
- throw new IllegalArgumentException("Hex string contains a bad char : " + clow);
- }
- byte value = (byte)((high << 4) + low);
- bytes[i] = value;
- }
- return bytes;
- }
-
- /**
- *
- */
- public static String generateTemporaryHash(String value, long time)
- {
- if (value == null)
- {
- throw new IllegalArgumentException("id must not be null");
- }
-
- Calendar calendar = Calendar.getInstance();
- calendar.setTimeInMillis(time);
- calendar.set(Calendar.MINUTE, 0);
- calendar.set(Calendar.SECOND, 0);
- calendar.set(Calendar.MILLISECOND, 0);
- return md5AsHexString(value + calendar.getTimeInMillis());
- }
-
- /**
- *
- */
- public static boolean confirmTemporaryHash(String hash, String value, long time)
- {
- if (hash == null)
- {
- return false;
- }
- if (value == null)
- {
- throw new IllegalArgumentException("value must not be null");
- }
-
- Calendar calendar = Calendar.getInstance();
- calendar.setTimeInMillis(time);
- calendar.set(Calendar.MINUTE, 0);
- calendar.set(Calendar.SECOND, 0);
- calendar.set(Calendar.MILLISECOND, 0);
- String expected = md5AsHexString(value + calendar.getTimeInMillis());
- if (expected.equals(hash))
- {
- return true;
- }
- calendar.add(Calendar.HOUR_OF_DAY, -1);
- expected = md5AsHexString(value + calendar.getTimeInMillis());
- return expected.equals(hash);
- }
-
- public static String getShortNameOf(Class clazz)
- {
- return clazz.getSimpleName();
- }
-
- public static String getPackageOf(Class clazz)
- {
- String name = clazz.getName();
- int index = name.lastIndexOf('.');
- if (index != -1)
- {
- name = name.substring(0, index);
- }
- else
- {
- name = "";
- }
- return name;
- }
-
- public static String buildClassLoaderInfo(ClassLoader loader)
- {
- if (loader == null)
- {
- throw new IllegalArgumentException("no loader");
- }
- StringBuffer buffer = new StringBuffer();
- buffer.append("ClassLoader[Name=").append(loader.getClass().getName());
- buffer.append(",HashCode=").append(loader.hashCode());
- buffer.append(",IdentityHashCode=").append(System.identityHashCode(loader));
- if (loader instanceof URLClassLoader)
- {
- URLClassLoader urlLoader = (URLClassLoader)loader;
- URL[] urls = urlLoader.getURLs();
- for (int i = 0; i < urls.length; i++)
- {
- URL url = urls[i];
- buffer.append(",URL(").append(i).append(")=").append(url);
- }
- }
- try
- {
- Class uclClass = Thread.currentThread().getContextClassLoader().loadClass("org.jboss.mx.loading.UnifiedClassLoader");
- Class loaderClass = loader.getClass();
- if (uclClass.isAssignableFrom(loaderClass))
- {
- URL url = (URL)loaderClass.getMethod("getURL", new Class[0]).invoke(loader, new Object[0]);
- buffer.append(",GetURL=").append(url);
- }
- }
- catch (Exception e)
- {
- log.error("Cannot get UCL infos", e);
- }
- buffer.append("]");
- return buffer.toString();
- }
-
- public static String dumpClassLoaderHierarchyInfo(ClassLoader loader)
- {
- StringWriter writer = new StringWriter();
- dumpClassLoaderHierarchyInfo(writer, loader);
- return writer.toString();
- }
-
- public static void dumpClassLoaderHierarchyInfo(Writer writer, ClassLoader loader)
- {
- if (writer == null)
- {
- throw new IllegalArgumentException("no writer");
- }
- if (loader == null)
- {
- throw new IllegalArgumentException("no loader");
- }
-
- //
- PrintWriter pw = null;
- if (writer instanceof PrintWriter)
- {
- pw = (PrintWriter)writer;
- }
- else
- {
- pw = new PrintWriter(writer);
- }
-
- pw.println("<classloader-dump>");
- while (loader != null)
- {
- pw.println(buildClassLoaderInfo(loader));
- loader = loader.getParent();
- }
- pw.print("</classloader-dump>");
- pw.flush();
- }
-
- public static void dumpClassLoaderHierarchyInfo(Logger log, ClassLoader loader)
- {
- Writer writer = new Log4JWriter(log, Level.DEBUG);
- dumpClassLoaderHierarchyInfo(writer, loader);
- }
-
- public static void dumpClassLoaderHierarchyInfo(Logger log, Level level, ClassLoader loader)
- {
- Writer writer = new Log4JWriter(log, level);
- dumpClassLoaderHierarchyInfo(writer, loader);
- }
-
- /**
- * Replace occurence in a string.
- *
- * @param string the source string
- * @param pattern the replaced pattern
- * @param replacement the replacement text
- * @return the new string
- */
- public static String replace(String string, String pattern, String replacement)
- {
- StringBuffer buffer = new StringBuffer(string.length());
- int previous = 0;
- int current = string.indexOf(pattern);
- while (current != -1)
- {
- buffer.append(string.substring(previous, current));
- buffer.append(replacement);
- previous = current + pattern.length();
- current = string.indexOf(pattern, previous);
- }
- buffer.append(string.substring(previous));
- return buffer.toString();
- }
-
- /**
- * Append an object to an array of objects. The original array is not modified. The returned array
- * will be of the same component type of the provided array and its first n elements where n is the size
- * of the provided array will be the elements of the provided array. The last element of the array will be
- * the provided object to append.
- *
- * @param array the array to augment
- * @param o the object to append
- * @return a new array
- * @throws IllegalArgumentException if the array is null
- * @throws ClassCastException if the appended object class prevents it from being added to the array
- */
- public static <E> E[] appendTo(E[] array, E o) throws IllegalArgumentException, ClassCastException
- {
- if (array == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- Class componentType = array.getClass().getComponentType();
- if (o != null && !componentType.isAssignableFrom(o.getClass()))
- {
- throw new ClassCastException("Object with class " + o.getClass().getName() + " cannot be casted to class " + componentType.getName());
- }
-
- //
- E[] copy = (E[])Array.newInstance(componentType, array.length + 1);
- System.arraycopy(array, 0, copy, 0, array.length);
- copy[array.length] = o;
-
- //
- return copy;
- }
-
- /**
- * Return true if
- * <ul>
- * <li>o1 is null and o2 is null</li<
- * <li>o1 is not null and the invocation of <code>equals(Object o)</code> on o1 wit o2 as argument returns true</li>
- * </ul>
- *
- * @param o1 the first argument
- * @param o2 the second argument
- * @return if arguments are equals according to the semantic defined by the method contract
- */
- public static boolean safeEquals(Object o1, Object o2)
- {
- if (o1 == null)
- {
- return o2 == null;
- }
- else
- {
- return o1.equals(o2);
- }
- }
-
- public static String replaceAllInstancesOfBoundedString(String initial, String prefix, String suffix, String replacement)
- {
- return replaceBoundedString(initial, prefix, suffix, replacement, true, false);
- }
-
- /**
- * Todo : define what "bounded" means.
- *
- * @param initial
- * @param prefix
- * @param suffix
- * @param replacement
- * @param replaceIfBoundedStringEmpty
- * @param keepBoundaries
- * @return
- */
- public static String replaceBoundedString(String initial, String prefix, String suffix, String replacement,
- boolean replaceIfBoundedStringEmpty, boolean keepBoundaries)
- {
- if (initial == null || initial.length() == 0)
- {
- return initial;
- }
-
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(prefix, "prefix", "Tools.replaceBoundedString");
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(suffix, "suffix", "Tools.replaceBoundedString");
- ParameterValidation.throwIllegalArgExceptionIfNull(replacement, "replacement");
-
- StringBuffer tmp = new StringBuffer(initial);
- int prefixIndex = tmp.indexOf(prefix);
- int suffixLength = suffix.length();
- int prefixLength = prefix.length();
-
- while (prefixIndex != -1)
- {
- int suffixIndex = tmp.indexOf(suffix, prefixIndex);
-
- if (suffixIndex != -1)
- {
- // we don't care about empty bounded strings or prefix and suffix don't delimit an empty String => replace!
- if (replaceIfBoundedStringEmpty || suffixIndex != prefixIndex + prefixLength)
- {
- if (keepBoundaries)
- {
- tmp.delete(prefixIndex + prefixLength, suffixIndex);
- tmp.insert(prefixIndex + prefixLength, replacement);
- }
- else
- {
- tmp.delete(prefixIndex, suffixIndex + suffixLength);
- tmp.insert(prefixIndex, replacement);
- }
- }
- }
-
- prefixIndex = tmp.indexOf(prefix, prefixIndex + prefixLength);
- }
-
- return tmp.toString();
- }
-
- /**
- * Determines if value is contained in array.
- *
- * todo: correct this method contract in order to make it more reusable, it looks like for now like a method
- * which has a contract convenient only for some kind of callers.
- *
- * 1/ null value should be accepted (or the method should be called isContainedInButNotForNullValue ?)
- * 2/ null array should not be accepted (or the method should be called isContainedInExceptIfThePassedArrayIsNull ?)
- *
- * @param value
- * @param array
- * @return
- * @since 2.4.2
- */
- public static boolean isContainedIn(Object value, Object[] array)
- {
- if (value == null)
- {
- return false;
- }
-
- //
- if (array != null)
- {
- for (Object anArray : array)
- {
- if (value.equals(anArray))
- {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Attempt to cast the value argument to the provided type argument. If the value argument type is assignable
- * to the provided type, the value is returned, otherwise if it is not or the value is null, null is returned.
- *
- * todo: Move that to common package.
- *
- * @param value the value to cast
- * @param type the type to downcast
- * @return the casted value or null
- */
- public static <T> T safeCast(Object value, Class<T> type)
- {
- if (value == null)
- {
- return null;
- }
- else
- {
- if (type.isAssignableFrom(value.getClass()))
- {
- return type.cast(value);
- }
- else
- {
- return null;
- }
- }
- }
-
- public static <T> MultiValuedPropertyMap<T> emptyMultiValuedPropertyMap()
- {
- return new MultiValuedPropertyMap<T>()
- {
- public T getValue(String key) throws IllegalArgumentException
- {
- if (key == null)
- {
- throw new IllegalArgumentException("Key cannot be null");
- }
- return null;
- }
-
- public List<T> getValues(String key) throws IllegalArgumentException
- {
- if (key == null)
- {
- throw new IllegalArgumentException("Key cannot be null");
- }
- return null;
- }
-
- public void addValue(String key, T value) throws IllegalArgumentException
- {
- throw new UnsupportedOperationException();
- }
-
- public void setValue(String key, T value) throws IllegalArgumentException
- {
- throw new UnsupportedOperationException();
- }
-
- public Set<String> keySet()
- {
- return Collections.emptySet();
- }
-
- public int size()
- {
- return 0;
- }
-
- public void clear()
- {
- throw new UnsupportedOperationException();
- }
-
- public void append(MultiValuedPropertyMap<T> appended) throws IllegalArgumentException
- {
- throw new UnsupportedOperationException();
- }
- };
- }
-
-}
\ No newline at end of file
Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/IOTools.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/IOTools.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/IOTools.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -22,7 +22,6 @@
package org.jboss.portal.test.framework.common.io;
-import org.jboss.portal.test.framework.common.Tools;
import org.apache.log4j.Logger;
import java.lang.reflect.Method;
@@ -32,16 +31,9 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
-import java.io.ByteArrayOutputStream;
import java.io.Writer;
-import java.io.Serializable;
-import java.io.ObjectOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ObjectInputStream;
-import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
-import java.io.DataOutputStream;
-import java.util.Map;
+import java.io.BufferedInputStream;
/**
* IO tools.
@@ -53,7 +45,7 @@
{
/** The logger. */
- public static final Logger log = Logger.getLogger(IOTools.class);
+ private static final Logger log = Logger.getLogger(IOTools.class);
/** . */
private static final Object[] EMPTY_ARGS = new Object[0];
@@ -205,241 +197,6 @@
}
/**
- * @see #getBytes(java.io.InputStream, int)
- * @param in the input stream
- * @return the bytes read from the stream
- * @throws java.io.IOException
- * @throws IllegalArgumentException if the input stream is null
- */
- public static byte[] getBytes(InputStream in) throws IOException, IllegalArgumentException
- {
- return getBytes(in, Tools.DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * Get the bytes from the provided input stream. No attempt will be made to close the stream.
- *
- * @param in the input stream
- * @param bufferSize the buffer size used to copy the bytes
- * @return the bytes read from the stream
- * @throws java.io.IOException
- * @throws IllegalArgumentException if the input stream is null or the buffer size < 1
- */
- public static byte[] getBytes(InputStream in, int bufferSize) throws IOException, IllegalArgumentException
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- copy(in, out, bufferSize);
- return out.toByteArray();
- }
-
- /**
- * @see #copy(java.io.InputStream, java.io.OutputStream, int)
- * @param in the incoming stream
- * @param out the outcoming stream
- * @throws IllegalArgumentException if an argument is null
- */
- public static void copy(InputStream in, OutputStream out) throws IOException
- {
- copy(in, out, Tools.DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * Pipe an incoming stream in an outcoming stream until no bytes is available from the input stream.
- * No attempts will be made to close the streams.
- *
- * @param in the incoming stream
- * @param out the outcoming stream
- * @param bufferSize the buffer size
- * @throws IllegalArgumentException if bufferSize < 1 or an argument is null
- */
- public static void copy(InputStream in, OutputStream out, int bufferSize) throws IOException
- {
- // arguments check
- if (in == null)
- {
- throw new IllegalArgumentException("null in");
- }
- if (out == null)
- {
- throw new IllegalArgumentException("null out");
- }
- if (bufferSize < 1)
- {
- throw new IllegalArgumentException("Buffer size is too small");
- }
-
- // do the job
- byte[] buffer = new byte[bufferSize];
- while (true)
- {
- int i = in.read(buffer);
- if (i == 0)
- {
- continue;
- }
- if (i == -1)
- {
- break;
- }
- out.write(buffer, 0, i);
- }
- }
-
- /**
- * Pipe an input stream in an output stream.
- *
- * @param reader the incoming reader
- * @param writer the outcoming writer
- * @throws IllegalArgumentException if an argument is null
- */
- public static void copy(Reader reader, Writer writer) throws IOException
- {
- copy(reader, writer, Tools.DEFAULT_BUFFER_SIZE);
- }
-
- /**
- * Pipe an incoming stream in an outcoming stream.
- *
- * @param reader the incoming reader
- * @param writer the outcoming writer
- * @param bufferSize the buffer size
- * @throws IllegalArgumentException if bufferSize < 1 or an argument is null
- */
- public static void copy(Reader reader, Writer writer, int bufferSize) throws IOException
- {
- // arguments check
- if (reader == null)
- {
- throw new IllegalArgumentException("null in");
- }
- if (writer == null)
- {
- throw new IllegalArgumentException("null out");
- }
- if (bufferSize < 1)
- {
- throw new IllegalArgumentException("Buffer size is too small");
- }
-
- // do the job
- char[] buffer = new char[bufferSize];
- while (true)
- {
- int i = reader.read(buffer);
- if (i == 0)
- {
- continue;
- }
- if (i == -1)
- {
- break;
- }
- writer.write(buffer, 0, i);
- }
- }
-
- /**
- * Clone an object implementing the <code>Serializable</code> interface.
- *
- * @param serializable
- * @return
- * @throws IllegalArgumentException if the serializable object is null
- * @throws IOException
- */
- public static <S extends Serializable> S clone(S serializable) throws IllegalArgumentException, IOException
- {
- if (serializable == null)
- {
- throw new IllegalArgumentException("Cannot clone null");
- }
- try
- {
- return (S)unserialize(serialize(serializable));
- }
- catch (ClassNotFoundException e)
- {
- throw new Error("Got a class not found exception for a class that was used", e);
- }
- }
-
- public static byte[] serialize(Serializable serializable) throws IllegalArgumentException, IOException
- {
- if (serializable == null)
- {
- throw new IllegalArgumentException("No null serializable accepted");
- }
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(serializable);
- oos.close();
- return baos.toByteArray();
- }
-
- public static Serializable unserialize(byte[] bytes) throws IllegalArgumentException, IOException, ClassNotFoundException
- {
- if (bytes == null)
- {
- throw new IllegalArgumentException("No null serializable accepted");
- }
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- ObjectInputStream ois = new ObjectInputStream(bais);
- return (Serializable)ois.readObject();
- }
-
- public static <T> byte[] serialize(Serialization<T> serialization, T t)
- {
- return serialize(serialization, SerializationFilter.TRIVIAL, t);
- }
-
- public static <T> byte[] serialize(Serialization<T> serialization, SerializationFilter filter, T t)
- {
- if (serialization == null)
- {
- throw new IllegalArgumentException();
- }
- if (t == null)
- {
- throw new IllegalArgumentException("No null object to serialize");
- }
- try
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- filter.serialize(serialization, t, baos);
- return baos.toByteArray();
- }
- catch (IOException e)
- {
- throw new UndeclaredIOException(e);
- }
- }
-
- public static <T> T unserialize(Serialization<T> serialization, byte[] bytes)
- {
- return unserialize(serialization, SerializationFilter.TRIVIAL, bytes);
- }
-
- public static <T> T unserialize(Serialization<T> serialization, SerializationFilter filter, byte[] bytes)
- {
- if (serialization == null)
- {
- throw new IllegalArgumentException();
- }
- if (bytes == null)
- {
- throw new IllegalArgumentException("No null bytes to unserialize");
- }
- try
- {
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- return filter.unserialize(serialization, bais);
- }
- catch (IOException e)
- {
- throw new UndeclaredIOException(e);
- }
- }
-
- /**
* Check that the provided input stream is buffered. If the argument is already an instance of <code>BufferedInputStream</code>
* no operation will be performed, otherwise a instance of <code>BufferedInputStream</code> will be created and returned.
*
Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/Serialization.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/Serialization.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/Serialization.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -1,121 +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.framework.common.io;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.DataInputStream;
-import java.io.OutputStream;
-import java.io.InputStream;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface Serialization<T>
-{
-
- Serialization<Map<String, String[]>> PARAMETER_MAP = new Serialization<Map<String, String[]>>()
- {
- public void serialize(Map<String, String[]> map, OutputStream out) throws IOException, IllegalArgumentException
- {
- if (map == null)
- {
- throw new IllegalArgumentException("No null map allowed");
- }
-
- //
- DataOutputStream data = out instanceof DataOutputStream ? (DataOutputStream)out : new DataOutputStream(out);
-
- //
- data.writeInt(map.size());
-
- //
- for (Map.Entry entry : map.entrySet())
- {
- String name = (String)entry.getKey();
- data.writeUTF(name);
-
- //
- String[] values = (String[])entry.getValue();
- if (values == null)
- {
- throw new IllegalArgumentException("No null values are allowed in the map");
- }
-
- //
- int length = values.length;
- data.writeInt(length);
-
- //
- for (String value : values)
- {
- if (value == null)
- {
- throw new IllegalArgumentException("No null value in the String[] are allowed in the map");
- }
- data.writeUTF(value);
- }
- }
-
- //
- data.flush();
- }
-
- public Map<String, String[]> unserialize(InputStream in) throws IOException
- {
- if (in == null)
- {
- throw new IllegalArgumentException("No null input stream");
- }
-
- //
- DataInputStream data = in instanceof DataInputStream ? (DataInputStream)in : new DataInputStream(in);
-
- //
- int size = data.readInt();
- Map<String, String[]> tmp = new HashMap<String, String[]>(size);
- while (size-- > 0)
- {
- String name = data.readUTF();
- int length = data.readInt();
- String[] values = new String[length];
- for (int i = 0;i < length;i++)
- {
- values[i] = data.readUTF();
- }
- tmp.put(name, values);
- }
-
- //
- return tmp;
- }
- };
-
- public abstract void serialize(T t, OutputStream out) throws IOException, IllegalArgumentException;
-
- public abstract T unserialize(InputStream in) throws IOException, IllegalArgumentException;
-
-}
Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/SerializationFilter.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/SerializationFilter.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/SerializationFilter.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -1,77 +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.framework.common.io;
-
-import java.io.OutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.GZIPOutputStream;
-import java.util.zip.GZIPInputStream;
-
-/**
- * Filters a stream for serialize/unserialize operations.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface SerializationFilter
-{
-
- SerializationFilter TRIVIAL = new SerializationFilter()
- {
- public <T> void serialize(Serialization<T> serialization, T t, OutputStream out) throws IllegalArgumentException, IOException
- {
- serialization.serialize(t, out);
- }
-
- public <T> T unserialize(Serialization<T> serialization, InputStream in) throws IllegalArgumentException, IOException
- {
- return serialization.unserialize(in);
- }
- };
-
- /**
- * Use GZIP streams.
- */
- SerializationFilter COMPRESSOR = new SerializationFilter()
- {
- public <T> void serialize(Serialization<T> serialization, T t, OutputStream out) throws IllegalArgumentException, IOException
- {
- GZIPOutputStream zos = new GZIPOutputStream(out);
- serialization.serialize(t, zos);
- zos.finish();
- }
-
- public <T> T unserialize(Serialization<T> serialization, InputStream in) throws IllegalArgumentException, IOException
- {
- GZIPInputStream zis = new GZIPInputStream(in);
- return serialization.unserialize(zis);
- }
- };
-
- <T> void serialize(Serialization<T> serialization, T t, OutputStream out) throws IllegalArgumentException, IOException;
-
- <T> T unserialize(Serialization<T> serialization, InputStream in) throws IllegalArgumentException, IOException;
-
-}
-
Deleted: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/UndeclaredIOException.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/UndeclaredIOException.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/io/UndeclaredIOException.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -1,45 +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.framework.common.io;
-
-import java.io.IOException;
-import java.lang.reflect.UndeclaredThrowableException;
-
-/**
- * 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: 7228 $
- */
-public class UndeclaredIOException extends UndeclaredThrowableException
-{
- public UndeclaredIOException(IOException undeclaredIOException)
- {
- super(undeclaredIOException);
- }
-
- public UndeclaredIOException(IOException undeclaredIOException, String s)
- {
- super(undeclaredIOException, s);
- }
-}
\ No newline at end of file
Added: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/xml/NoSuchElementException.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/xml/NoSuchElementException.java (rev 0)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/xml/NoSuchElementException.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.framework.common.xml;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class NoSuchElementException extends RuntimeException
+{
+ public NoSuchElementException()
+ {
+ }
+
+ public NoSuchElementException(String message)
+ {
+ super(message);
+ }
+
+ public NoSuchElementException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public NoSuchElementException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Modified: modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/xml/XMLTools.java
===================================================================
--- modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/xml/XMLTools.java 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/common/xml/XMLTools.java 2008-02-23 00:17:20 UTC (rev 10094)
@@ -48,7 +48,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
-import java.util.NoSuchElementException;
/**
* Utilities for dealing with XML.
Modified: modules/test/trunk/tooling/ant/pom.xml
===================================================================
--- modules/test/trunk/tooling/ant/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/tooling/ant/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/tooling/core/pom.xml
===================================================================
--- modules/test/trunk/tooling/core/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/tooling/core/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/tooling/examples/maven2/pom.xml
===================================================================
--- modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/tooling/examples/maven2/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -11,7 +11,7 @@
<dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
</dependency>
</dependencies>
@@ -39,7 +39,7 @@
<plugin>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit-tooling-maven2</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<executions>
<execution>
<phase>test</phase>
Modified: modules/test/trunk/tooling/maven2/pom.xml
===================================================================
--- modules/test/trunk/tooling/maven2/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/tooling/maven2/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/tooling/pom.xml
===================================================================
--- modules/test/trunk/tooling/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/tooling/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -11,7 +11,7 @@
<artifactId>jboss-unit-tooling-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Unit Tooling (aggregator)</name>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<modules>
<module>core</module>
<module>ant</module>
Modified: modules/test/trunk/unit/pom.xml
===================================================================
--- modules/test/trunk/unit/pom.xml 2008-02-22 23:35:21 UTC (rev 10093)
+++ modules/test/trunk/unit/pom.xml 2008-02-23 00:17:20 UTC (rev 10094)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>module-parent</artifactId>
- <version>1.2.0.Beta2</version>
+ <version>1.2.0.SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
18 years, 2 months