JBoss Portal SVN: r8607 - in branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf: hibernate/consumer and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-11 19:40:06 -0400 (Thu, 11 Oct 2007)
New Revision: 8607
Added:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml
Removed:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/ehcache.xml
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/hibernate.cfg.xml
Log:
- Moved Hibernate configuration to a location mirroring that of other modules. (last commit was incomplete :( )
Deleted: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-10-11 23:15:21 UTC (rev 8606)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-10-11 23:40:06 UTC (rev 8607)
@@ -1,145 +0,0 @@
-<?xml version="1.0"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2007, 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
- <hibernate-mapping>
- <class name="org.jboss.portal.wsrp.consumer.ProducerInfo" table="JBP_PRODUCER_INFO">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" access="field" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">wsrpconsumer_seq</param>
- </generator>
- </id>
- <many-to-one name="endpointConfigurationInfo"
- column="ENDPOINT_ID"
- class="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo"
- unique="true"
- not-null="true"
- cascade="all"
- lazy="false"/>
- <many-to-one name="registrationInfo"
- column="REGISTRATION_ID"
- class="org.jboss.portal.wsrp.consumer.RegistrationInfo"
- unique="true"
- not-null="false"
- cascade="all"
- lazy="false"/>
- <property name="expirationCacheSeconds" column="EXPIRATION_CACHE_SECONDS" type="java.lang.Integer"/>
- <property name="active" not-null="true" column="ACTIVE" type="boolean"/>
- <property name="persistentId" column="PRODUCER_ID" not-null="true" unique="true" type="java.lang.String"
- access="field"/>
- </class>
-
- <class name="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo" table="JBP_ENDPOINT_INFO">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">wsrpconsumer_seq</param>
- </generator>
- </id>
- <property name="serviceDescriptionURL" column="SD_URL" type="java.lang.String" not-null="true"/>
- <property name="markupURL" column="M_URL" type="java.lang.String" not-null="true"/>
- <property name="portletManagementURL" column="PM_URL" type="java.lang.String" not-null="false"/>
- <property name="registrationURL" column="R_URL" type="java.lang.String" not-null="false"/>
- <property name="wsdlDefinitionURL" column="WSDL_URL" type="java.lang.String" not-null="false"/>
- </class>
-
- <class name="org.jboss.portal.wsrp.consumer.RegistrationInfo" table="JBP_REGISTRATION_INFO">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">wsrpconsumer_seq</param>
- </generator>
- </id>
- <property name="consumerName" column="CONSUMER_NAME" type="java.lang.String" not-null="true"/>
- <property name="registrationHandle" column="HANDLE" type="java.lang.String"/>
- <property name="registrationState" column="STATE" type="binary" length="50000000"/>
- <map name="persistentRegistrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <key column="REG_PK" not-null="true"/>
- <map-key type="string" formula="name"/>
- <one-to-many class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
- </map>
- </class>
-
- <class name="org.jboss.portal.wsrp.consumer.RegistrationProperty" table="JBP_REG_PROPERTY">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">wsrpconsumer_seq</param>
- </generator>
- </id>
- <property name="name" column="NAME" type="java.lang.String" not-null="true"/>
- <property name="value" column="VALUE" type="java.lang.String"/>
- <property name="invalid" column="INVALID" type="java.lang.Boolean"/>
- <property name="lang" column="LANG" type="java.lang.String" not-null="true"/>
- <many-to-one
- name="description"
- column="DESC_PK"
- class="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
- unique="true"
- cascade="all"
- lazy="false"/>
- </class>
- <class name="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription" table="JBP_REG_PROP_DESC">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">portlet_seq</param>
- </generator>
- </id>
- <property name="name" column="NAME" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"/>
- <property name="type" column="TYPE" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"/>
- <property name="schemaLocation" column="SCHEMA_LOCATION" type="java.lang.String"/>
- <component name="description" class="org.jboss.portal.wsrp.registration.LocalizedString">
- <property name="value" column="DESC_VALUE"/>
- <property name="locale" column="DESC_LOCALE"/>
- <property name="resourceName" column="DESC_RES"/>
- </component>
- <component name="hint" class="org.jboss.portal.wsrp.registration.LocalizedString">
- <property name="value" column="HINT_VALUE"/>
- <property name="locale" column="HINT_LOCALE"/>
- <property name="resourceName" column="HINT_RES"/>
- </component>
- <component name="label" class="org.jboss.portal.wsrp.registration.LocalizedString">
- <property name="value" column="LABEL_VALUE"/>
- <property name="locale" column="LABEL_LOCALE"/>
- <property name="resourceName" column="LABEL_RES"/>
- </component>
- <array name="usages" table="JBP_REG_PROP_DESC_USAGES" cascade="all" fetch="join">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <key column="PK"/>
- <index column="IDX"/>
- <element column="USAGE" type="java.lang.String" not-null="true" unique="false"/>
- </array>
- <array name="aliases" table="JBP_REG_PROP_DESC_ALIASES" cascade="all" fetch="join">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <key column="PK"/>
- <index column="IDX"/>
- <element column="ALIAS" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true" unique="false"/>
- </array>
- </class>
-</hibernate-mapping>
Deleted: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/ehcache.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/ehcache.xml 2007-10-11 23:15:21 UTC (rev 8606)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/ehcache.xml 2007-10-11 23:40:06 UTC (rev 8607)
@@ -1,60 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2007, 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<ehcache>
-
- <!-- Sets the path to the directory where cache .data files are created.
-
- If the path is a Java System Property it is replaced by
- its value in the running VM.
-
- The following properties are translated:
- user.home - User's home directory
- user.dir - User's current working directory
- java.io.tmpdir - Default temp file path -->
- <diskStore path="java.io.tmpdir/wsrpconsumer"/>
-
-
- <!--Default Cache configuration. These will applied to caches programmatically created through
- the CacheManager.
-
- The following attributes are required for defaultCache:
-
- maxInMemory - Sets the maximum number of objects that will be created in memory
- eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
- is never expired.
- timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
- if the element is not eternal. Idle time is now - last accessed time
- timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
- if the element is not eternal. TTL is now - creation time
- overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
- has reached the maxInMemory limit.
-
- -->
- <defaultCache
- maxElementsInMemory="10000"
- eternal="false"
- timeToIdleSeconds="1800"
- timeToLiveSeconds="1800"
- overflowToDisk="false"
- />
-</ehcache>
\ No newline at end of file
Deleted: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/hibernate.cfg.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/hibernate.cfg.xml 2007-10-11 23:15:21 UTC (rev 8606)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/hibernate.cfg.xml 2007-10-11 23:40:06 UTC (rev 8607)
@@ -1,58 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2007, 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
- <session-factory>
- <property name="connection.datasource">java:@portal.datasource.name@</property>
- <property name="show_sql">@portal.sql.show@</property>
- <property name="cache.use_second_level_cache">true</property>
- <property name="cache.use_query_cache">true</property>
-
- <!--
- | Uncomment in clustered mode : use transactional replicated cache
- @portal.single.xml.close@
- <property name="cache.provider_class">org.jboss.portal.jems.hibernate.JMXTreeCacheProvider</property>
- <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate</property>
- @portal.single.xml.open@
- -->
-
- <!--
- | Comment in clustered mode
- @portal.clustered.xml.close@
- <property name="cache.provider_configuration_file_resource_path">conf/consumer/hibernate/ehcache.xml</property>
- <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
- @portal.clustered.xml.open@
- -->
-
- <!-- Force the dialect instead of using autodetection -->
- <!--
- <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
- -->
-
- <!-- Mapping files -->
- <mapping resource="conf/consumer/hibernate/domain.hbm.xml"/>
- </session-factory>
-</hibernate-configuration>
\ No newline at end of file
Copied: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml (from rev 8606, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml 2007-10-11 23:40:06 UTC (rev 8607)
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+ <hibernate-mapping>
+ <class name="org.jboss.portal.wsrp.consumer.ProducerInfo" table="JBP_PRODUCER_INFO">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" access="field" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <many-to-one name="endpointConfigurationInfo"
+ column="ENDPOINT_ID"
+ class="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo"
+ unique="true"
+ not-null="true"
+ cascade="all"
+ lazy="false"/>
+ <many-to-one name="registrationInfo"
+ column="REGISTRATION_ID"
+ class="org.jboss.portal.wsrp.consumer.RegistrationInfo"
+ unique="true"
+ not-null="false"
+ cascade="all"
+ lazy="false"/>
+ <property name="expirationCacheSeconds" column="EXPIRATION_CACHE_SECONDS" type="java.lang.Integer"/>
+ <property name="active" not-null="true" column="ACTIVE" type="boolean"/>
+ <property name="persistentId" column="PRODUCER_ID" not-null="true" unique="true" type="java.lang.String"
+ access="field"/>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo" table="JBP_ENDPOINT_INFO">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="serviceDescriptionURL" column="SD_URL" type="java.lang.String" not-null="true"/>
+ <property name="markupURL" column="M_URL" type="java.lang.String" not-null="true"/>
+ <property name="portletManagementURL" column="PM_URL" type="java.lang.String" not-null="false"/>
+ <property name="registrationURL" column="R_URL" type="java.lang.String" not-null="false"/>
+ <property name="wsdlDefinitionURL" column="WSDL_URL" type="java.lang.String" not-null="false"/>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.RegistrationInfo" table="JBP_REGISTRATION_INFO">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="consumerName" column="CONSUMER_NAME" type="java.lang.String" not-null="true"/>
+ <property name="registrationHandle" column="HANDLE" type="java.lang.String"/>
+ <property name="registrationState" column="STATE" type="binary" length="50000000"/>
+ <map name="persistentRegistrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <key column="REG_PK" not-null="true"/>
+ <map-key type="string" formula="name"/>
+ <one-to-many class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
+ </map>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.RegistrationProperty" table="JBP_REG_PROPERTY">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="name" column="NAME" type="java.lang.String" not-null="true"/>
+ <property name="value" column="VALUE" type="java.lang.String"/>
+ <property name="invalid" column="INVALID" type="java.lang.Boolean"/>
+ <property name="lang" column="LANG" type="java.lang.String" not-null="true"/>
+ <many-to-one
+ name="description"
+ column="DESC_PK"
+ class="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
+ unique="true"
+ cascade="all"
+ lazy="false"/>
+ </class>
+ <class name="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription" table="JBP_REG_PROP_DESC">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">portlet_seq</param>
+ </generator>
+ </id>
+ <property name="name" column="NAME" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"/>
+ <property name="type" column="TYPE" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"/>
+ <property name="schemaLocation" column="SCHEMA_LOCATION" type="java.lang.String"/>
+ <component name="description" class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="DESC_VALUE"/>
+ <property name="locale" column="DESC_LOCALE"/>
+ <property name="resourceName" column="DESC_RES"/>
+ </component>
+ <component name="hint" class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="HINT_VALUE"/>
+ <property name="locale" column="HINT_LOCALE"/>
+ <property name="resourceName" column="HINT_RES"/>
+ </component>
+ <component name="label" class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="LABEL_VALUE"/>
+ <property name="locale" column="LABEL_LOCALE"/>
+ <property name="resourceName" column="LABEL_RES"/>
+ </component>
+ <array name="usages" table="JBP_REG_PROP_DESC_USAGES" cascade="all" fetch="join">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <key column="PK"/>
+ <index column="IDX"/>
+ <element column="USAGE" type="java.lang.String" not-null="true" unique="false"/>
+ </array>
+ <array name="aliases" table="JBP_REG_PROP_DESC_ALIASES" cascade="all" fetch="join">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <key column="PK"/>
+ <index column="IDX"/>
+ <element column="ALIAS" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true" unique="false"/>
+ </array>
+ </class>
+</hibernate-mapping>
Copied: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml (from rev 8606, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/ehcache.xml)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml 2007-10-11 23:40:06 UTC (rev 8607)
@@ -0,0 +1,60 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<ehcache>
+
+ <!-- Sets the path to the directory where cache .data files are created.
+
+ If the path is a Java System Property it is replaced by
+ its value in the running VM.
+
+ The following properties are translated:
+ user.home - User's home directory
+ user.dir - User's current working directory
+ java.io.tmpdir - Default temp file path -->
+ <diskStore path="java.io.tmpdir/wsrpconsumer"/>
+
+
+ <!--Default Cache configuration. These will applied to caches programmatically created through
+ the CacheManager.
+
+ The following attributes are required for defaultCache:
+
+ maxInMemory - Sets the maximum number of objects that will be created in memory
+ eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
+ is never expired.
+ timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
+ if the element is not eternal. Idle time is now - last accessed time
+ timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
+ if the element is not eternal. TTL is now - creation time
+ overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
+ has reached the maxInMemory limit.
+
+ -->
+ <defaultCache
+ maxElementsInMemory="10000"
+ eternal="false"
+ timeToIdleSeconds="1800"
+ timeToLiveSeconds="1800"
+ overflowToDisk="false"
+ />
+</ehcache>
\ No newline at end of file
Copied: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml (from rev 8606, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/hibernate.cfg.xml)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml 2007-10-11 23:40:06 UTC (rev 8607)
@@ -0,0 +1,58 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+ <property name="connection.datasource">java:@portal.datasource.name@</property>
+ <property name="show_sql">@portal.sql.show@</property>
+ <property name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">true</property>
+
+ <!--
+ | Uncomment in clustered mode : use transactional replicated cache
+ @portal.single.xml.close@
+ <property name="cache.provider_class">org.jboss.portal.jems.hibernate.JMXTreeCacheProvider</property>
+ <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate</property>
+ @portal.single.xml.open@
+ -->
+
+ <!--
+ | Comment in clustered mode
+ @portal.clustered.xml.close@
+ <property name="cache.provider_configuration_file_resource_path">conf/consumer/hibernate/ehcache.xml</property>
+ <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+ @portal.clustered.xml.open@
+ -->
+
+ <!-- Force the dialect instead of using autodetection -->
+ <!--
+ <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+ -->
+
+ <!-- Mapping files -->
+ <mapping resource="conf/consumer/hibernate/domain.hbm.xml"/>
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8606 - in branches/JBoss_Portal_Branch_2_6: core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF and 4 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-11 19:15:21 -0400 (Thu, 11 Oct 2007)
New Revision: 8606
Added:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/
Removed:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/domain.hbm.xml
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/ehcache.xml
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/hibernate.cfg.xml
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
Log:
- JBPORTAL-1715: Added support for adding registration properties (does not work properly but committing for synchronization purpose: QNameConverter will probably be removed to avoid CCE with XB).
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-10-11 15:40:00 UTC (rev 8605)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-10-11 23:15:21 UTC (rev 8606)
@@ -25,6 +25,7 @@
import org.jboss.portal.registration.RegistrationPolicy;
import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
+import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationService;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -47,6 +48,9 @@
private ProducerConfigurationService configurationService;
private String policyClassName;
private String validatorClassName;
+ private static final String PROPERTY = "property";
+ private static int counter = 0;
+ private static final String PRODUCER = "producer";
public ProducerConfigurationService getConfigurationService()
{
@@ -157,6 +161,12 @@
log.debug(e);
beanContext.createErrorMessage("status", "Couldn't save producer configuration. Cause: " + e.getLocalizedMessage());
}
- return null;
+ return PRODUCER;
}
+
+ public String addRegistrationProperty()
+ {
+ getRegRequirements().addRegistrationProperty(new RegistrationPropertyDescription(PROPERTY + counter++, WSRPConstants.XSD_STRING));
+ return PRODUCER;
+ }
}
Added: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java 2007-10-11 23:15:21 UTC (rev 8606)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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.wsrp.admin.ui;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6.3
+ */
+public class QNameConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s)
+ {
+ return s == null ? null : QName.valueOf(s);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object o)
+ {
+ return o == null ? null : o.toString();
+ }
+}
Property changes on: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-11 15:40:00 UTC (rev 8605)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-11 23:15:21 UTC (rev 8606)
@@ -36,6 +36,10 @@
<converter-for-class>org.jboss.portal.wsrp.registration.LocalizedString</converter-for-class>
<converter-class>org.jboss.portal.wsrp.admin.ui.LocalizedStringConverter</converter-class>
</converter>
+ <converter>
+ <converter-for-class>javax.xml.namespace.QName</converter-for-class>
+ <converter-class>org.jboss.portal.wsrp.admin.ui.QNameConverter</converter-class>
+ </converter>
<managed-bean>
<managed-bean-name>beanContext</managed-bean-name>
@@ -83,7 +87,7 @@
<managed-bean>
<managed-bean-name>producer</managed-bean-name>
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.ProducerBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
+ <managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>configurationService</property-name>
<property-class>org.jboss.portal.wsrp.producer.config.ProducerConfigurationService</property-class>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml 2007-10-11 15:40:00 UTC (rev 8605)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml 2007-10-11 23:15:21 UTC (rev 8606)
@@ -56,7 +56,7 @@
headerClass="portlet-section-header">
<h:column>
<f:facet name="header">Name</f:facet>
- <h:inputText value="#{property.name}" size="60"/>
+ <h:inputText value="#{property.name}" size="30"/>
</h:column>
<h:column>
<f:facet name="header">Type</f:facet>
@@ -66,25 +66,25 @@
</h:column>
<h:column>
<f:facet name="header">Label</f:facet>
- <h:inputText value="#{property.label}" size="60"/>
+ <h:inputText value="#{property.label}" size="50"/>
</h:column>
<h:column>
<f:facet name="header">Hint</f:facet>
- <h:inputText value="#{property.hint}" size="60"/>
+ <h:inputText value="#{property.hint}" size="50"/>
</h:column>
</h:dataTable>
- <h:commandLink action="#{producer.addRegistrationProperty}" value="Add property"
- styleClass="portlet-form-button"/>
</c:when>
<c:otherwise>
<h:outputText value="No specified required registration properties."/>
</c:otherwise>
</c:choose>
+ <h:commandLink action="#{producer.addRegistrationProperty}" value="Add property"
+ styleClass="portlet-form-button"/>
</h:panelGroup>
</h:panelGroup>
<h:outputText value=" "/>
- <h:commandLink action="#{producer.save}" value="Save" styleClass="portlet-form-button"/>
+ <h:commandButton action="#{producer.save}" value="Save" styleClass="portlet-form-button"/>
</h:panelGrid>
</h:form>
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2007-10-11 15:40:00 UTC (rev 8605)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2007-10-11 23:15:21 UTC (rev 8606)
@@ -99,6 +99,11 @@
reloadConfiguration();
}
+ protected void stopService() throws Exception
+ {
+ saveConfiguration();
+ }
+
public void reloadConfiguration() throws Exception
{
URL configURL = getConfigLocationURL();
Copied: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate (from rev 8577, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate)
Deleted: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/domain.hbm.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-10-09 18:59:45 UTC (rev 8577)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/domain.hbm.xml 2007-10-11 23:15:21 UTC (rev 8606)
@@ -1,145 +0,0 @@
-<?xml version="1.0"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2007, 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
- <hibernate-mapping>
- <class name="org.jboss.portal.wsrp.consumer.ProducerInfo" table="JBP_PRODUCER_INFO">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" access="field" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">wsrpconsumer_seq</param>
- </generator>
- </id>
- <many-to-one name="endpointConfigurationInfo"
- column="ENDPOINT_ID"
- class="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo"
- unique="true"
- not-null="true"
- cascade="all"
- lazy="false"/>
- <many-to-one name="registrationInfo"
- column="REGISTRATION_ID"
- class="org.jboss.portal.wsrp.consumer.RegistrationInfo"
- unique="true"
- not-null="false"
- cascade="all"
- lazy="false"/>
- <property name="expirationCacheSeconds" column="EXPIRATION_CACHE_SECONDS" type="java.lang.Integer"/>
- <property name="active" not-null="true" column="ACTIVE" type="boolean"/>
- <property name="persistentId" column="PRODUCER_ID" not-null="true" unique="true" type="java.lang.String"
- access="field"/>
- </class>
-
- <class name="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo" table="JBP_ENDPOINT_INFO">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">wsrpconsumer_seq</param>
- </generator>
- </id>
- <property name="serviceDescriptionURL" column="SD_URL" type="java.lang.String" not-null="true"/>
- <property name="markupURL" column="M_URL" type="java.lang.String" not-null="true"/>
- <property name="portletManagementURL" column="PM_URL" type="java.lang.String" not-null="false"/>
- <property name="registrationURL" column="R_URL" type="java.lang.String" not-null="false"/>
- <property name="wsdlDefinitionURL" column="WSDL_URL" type="java.lang.String" not-null="false"/>
- </class>
-
- <class name="org.jboss.portal.wsrp.consumer.RegistrationInfo" table="JBP_REGISTRATION_INFO">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">wsrpconsumer_seq</param>
- </generator>
- </id>
- <property name="consumerName" column="CONSUMER_NAME" type="java.lang.String" not-null="true"/>
- <property name="registrationHandle" column="HANDLE" type="java.lang.String"/>
- <property name="registrationState" column="STATE" type="binary" length="50000000"/>
- <map name="persistentRegistrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <key column="REG_PK" not-null="true"/>
- <map-key type="string" formula="name"/>
- <one-to-many class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
- </map>
- </class>
-
- <class name="org.jboss.portal.wsrp.consumer.RegistrationProperty" table="JBP_REG_PROPERTY">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">wsrpconsumer_seq</param>
- </generator>
- </id>
- <property name="name" column="NAME" type="java.lang.String" not-null="true"/>
- <property name="value" column="VALUE" type="java.lang.String"/>
- <property name="invalid" column="INVALID" type="java.lang.Boolean"/>
- <property name="lang" column="LANG" type="java.lang.String" not-null="true"/>
- <many-to-one
- name="description"
- column="DESC_PK"
- class="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
- unique="true"
- cascade="all"
- lazy="false"/>
- </class>
- <class name="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription" table="JBP_REG_PROP_DESC">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <id name="key" column="PK" type="java.lang.Long">
- <generator class="native">
- <param name="sequence">portlet_seq</param>
- </generator>
- </id>
- <property name="name" column="NAME" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"/>
- <property name="type" column="TYPE" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"/>
- <property name="schemaLocation" column="SCHEMA_LOCATION" type="java.lang.String"/>
- <component name="description" class="org.jboss.portal.wsrp.registration.LocalizedString">
- <property name="value" column="DESC_VALUE"/>
- <property name="locale" column="DESC_LOCALE"/>
- <property name="resourceName" column="DESC_RES"/>
- </component>
- <component name="hint" class="org.jboss.portal.wsrp.registration.LocalizedString">
- <property name="value" column="HINT_VALUE"/>
- <property name="locale" column="HINT_LOCALE"/>
- <property name="resourceName" column="HINT_RES"/>
- </component>
- <component name="label" class="org.jboss.portal.wsrp.registration.LocalizedString">
- <property name="value" column="LABEL_VALUE"/>
- <property name="locale" column="LABEL_LOCALE"/>
- <property name="resourceName" column="LABEL_RES"/>
- </component>
- <array name="usages" table="JBP_REG_PROP_DESC_USAGES" cascade="all" fetch="join">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <key column="PK"/>
- <index column="IDX"/>
- <element column="USAGE" type="java.lang.String" not-null="true" unique="false"/>
- </array>
- <array name="aliases" table="JBP_REG_PROP_DESC_ALIASES" cascade="all" fetch="join">
- <cache usage="@portal.hibernate.cache.usage@"/>
- <key column="PK"/>
- <index column="IDX"/>
- <element column="ALIAS" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true" unique="false"/>
- </array>
- </class>
-</hibernate-mapping>
Deleted: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/ehcache.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/ehcache.xml 2007-10-09 18:59:45 UTC (rev 8577)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/ehcache.xml 2007-10-11 23:15:21 UTC (rev 8606)
@@ -1,60 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2007, 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<ehcache>
-
- <!-- Sets the path to the directory where cache .data files are created.
-
- If the path is a Java System Property it is replaced by
- its value in the running VM.
-
- The following properties are translated:
- user.home - User's home directory
- user.dir - User's current working directory
- java.io.tmpdir - Default temp file path -->
- <diskStore path="java.io.tmpdir/wsrpconsumer"/>
-
-
- <!--Default Cache configuration. These will applied to caches programmatically created through
- the CacheManager.
-
- The following attributes are required for defaultCache:
-
- maxInMemory - Sets the maximum number of objects that will be created in memory
- eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
- is never expired.
- timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
- if the element is not eternal. Idle time is now - last accessed time
- timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
- if the element is not eternal. TTL is now - creation time
- overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
- has reached the maxInMemory limit.
-
- -->
- <defaultCache
- maxElementsInMemory="10000"
- eternal="false"
- timeToIdleSeconds="1800"
- timeToLiveSeconds="1800"
- overflowToDisk="false"
- />
-</ehcache>
\ No newline at end of file
Deleted: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/hibernate.cfg.xml 2007-10-09 18:59:45 UTC (rev 8577)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/hibernate.cfg.xml 2007-10-11 23:15:21 UTC (rev 8606)
@@ -1,58 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2007, 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
- <session-factory>
- <property name="connection.datasource">java:@portal.datasource.name@</property>
- <property name="show_sql">@portal.sql.show@</property>
- <property name="cache.use_second_level_cache">true</property>
- <property name="cache.use_query_cache">true</property>
-
- <!--
- | Uncomment in clustered mode : use transactional replicated cache
- @portal.single.xml.close@
- <property name="cache.provider_class">org.jboss.portal.jems.hibernate.JMXTreeCacheProvider</property>
- <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate</property>
- @portal.single.xml.open@
- -->
-
- <!--
- | Comment in clustered mode
- @portal.clustered.xml.close@
- <property name="cache.provider_configuration_file_resource_path">conf/consumer/hibernate/ehcache.xml</property>
- <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
- @portal.clustered.xml.open@
- -->
-
- <!-- Force the dialect instead of using autodetection -->
- <!--
- <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
- -->
-
- <!-- Mapping files -->
- <mapping resource="conf/consumer/hibernate/domain.hbm.xml"/>
- </session-factory>
-</hibernate-configuration>
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8605 - in modules/test/trunk/mc/src/main/org/jboss: unit/mc and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-11 11:40:00 -0400 (Thu, 11 Oct 2007)
New Revision: 8605
Modified:
modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java
modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java
modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstrap.java
Log:
added support on the @Bootstrap annotation to specify the name under which the annotated bean will be available in the kernel
Modified: modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java 2007-10-11 15:24:17 UTC (rev 8604)
+++ modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java 2007-10-11 15:40:00 UTC (rev 8605)
@@ -30,7 +30,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-@Bootstrap(id="/blah/toto.xml")
+@Bootstrap(resourceName ="/blah/toto.xml")
public class SomeTest
{
Modified: modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java 2007-10-11 15:24:17 UTC (rev 8604)
+++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java 2007-10-11 15:40:00 UTC (rev 8605)
@@ -73,16 +73,16 @@
Class<? extends Object> testClass = testCase.getPOJO().getClass();
//
- Bootstrap blah = testClass.getAnnotation(Bootstrap.class);
- if (blah == null)
+ Bootstrap bootstrapAnnotation = testClass.getAnnotation(Bootstrap.class);
+ if (bootstrapAnnotation == null)
{
throw new TestCaseLifeCycleException("No Bootstrap annotation found");
}
- URL url = testClass.getResource(blah.id());
+ URL url = testClass.getResource(bootstrapAnnotation.resourceName());
if (url == null)
{
- throw new TestCaseLifeCycleException("No URL found for bean xml " + blah.id());
+ throw new TestCaseLifeCycleException("No URL found for bean xml " + bootstrapAnnotation.resourceName());
}
// setup MC
@@ -90,7 +90,10 @@
try
{
- AbstractBeanMetaData bmd = new AbstractBeanMetaData("TestCase", testClass.getName());
+ String beanName = bootstrapAnnotation.beanName();
+
+ //
+ AbstractBeanMetaData bmd = new AbstractBeanMetaData(beanName, testClass.getName());
AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
bmd.setConstructor(cmd);
TestCaseFactory factory = new TestCaseFactory(testCase.getPOJO());
Modified: modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstrap.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstrap.java 2007-10-11 15:24:17 UTC (rev 8604)
+++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstrap.java 2007-10-11 15:40:00 UTC (rev 8605)
@@ -31,7 +31,7 @@
import java.lang.annotation.ElementType;
/**
- * Annotate
+ * Annotate a bean that will trigger the bootstrap of a micro container kernel.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
@@ -41,5 +41,17 @@
@Provider(MCTestProvider.class)
public @interface Bootstrap
{
- String id();
+ /**
+ * Returns the resource name by which the bean definition file can be loaded.
+ *
+ * @return the resource name
+ */
+ String resourceName();
+
+ /**
+ * Returns the name under which the annotated bean will be available in the kernel. The default value is <code>TestCase</code>.
+ *
+ * @return the bean name
+ */
+ String beanName() default "TestCase";
}
16 years, 8 months
JBoss Portal SVN: r8604 - modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-11 11:24:17 -0400 (Thu, 11 Oct 2007)
New Revision: 8604
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestLifeCycle.java
Log:
add javadoc to TestLifeCycle
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestLifeCycle.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestLifeCycle.java 2007-10-11 15:12:14 UTC (rev 8603)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestLifeCycle.java 2007-10-11 15:24:17 UTC (rev 8604)
@@ -25,6 +25,15 @@
import java.util.Map;
/**
+ * Breaks down the Start/End protocol of a <code>TestDriver</code> into a protocol adapted to POJOs which have several phases:
+ * <ul>
+ * <li>instantiation : instantiate the test case</li>
+ * <li>parametrization : parametrize the test case with the start command parametrization</li>
+ * <li>create : call a create life cycle</li>
+ * <li>invoke : executes the test</li>
+ * <li>destroy : call a destroy life cycle, it is guaranteed to be always called</li>
+ * </ul>
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
16 years, 8 months
JBoss Portal SVN: r8603 - modules/test/trunk/mc/src/main/org/jboss/unit/mc.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-11 11:12:14 -0400 (Thu, 11 Oct 2007)
New Revision: 8603
Modified:
modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java
Log:
remove some system.out.println
Modified: modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java
===================================================================
--- modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java 2007-10-11 15:00:56 UTC (rev 8602)
+++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java 2007-10-11 15:12:14 UTC (rev 8603)
@@ -85,10 +85,6 @@
throw new TestCaseLifeCycleException("No URL found for bean xml " + blah.id());
}
- System.out.println("url = " + url);
- System.out.println("url = " + url);
- System.out.println("url = " + url);
-
// setup MC
run();
16 years, 8 months
JBoss Portal SVN: r8602 - in modules/test/trunk/unit: src/main/org/jboss/test/unit/runner and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-11 11:00:56 -0400 (Thu, 11 Oct 2007)
New Revision: 8602
Modified:
modules/test/trunk/unit/build.xml
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
Log:
basic tests for generic test driver
Modified: modules/test/trunk/unit/build.xml
===================================================================
--- modules/test/trunk/unit/build.xml 2007-10-11 13:38:02 UTC (rev 8601)
+++ modules/test/trunk/unit/build.xml 2007-10-11 15:00:56 UTC (rev 8602)
@@ -186,9 +186,9 @@
<target name="test" depends="output">
<java classname="org.jboss.test.unit.AllTests" fork="true">
+<!--
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
-<!--
-->
<classpath>
<path location="${build.lib}/jboss-unit-lib.jar"/>
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-10-11 13:38:02 UTC (rev 8601)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-10-11 15:00:56 UTC (rev 8602)
@@ -24,14 +24,25 @@
import org.jboss.unit.runner.impl.generic.GenericTestRunner;
import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
+import org.jboss.unit.runner.model.generic.TestDef;
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.command.StartTestCommand;
import org.jboss.unit.driver.response.EndTestResponse;
import org.jboss.unit.info.TestInfo;
import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
+import org.jboss.unit.info.impl.SimpleTestCaseInfo;
import org.jboss.unit.TestId;
+import static org.jboss.unit.api.Assert.*;
+import static org.jboss.unit.util.CollectionTools.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
@@ -41,27 +52,87 @@
public static void main(String[] args)
{
+ test1();
+ test2();
+ test3();
+ test4();
+ }
+ private static void test1()
+ {
+ Driver1.init();
+ GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
+ GenericTestRunner runner = new GenericTestRunner(suite);
+ runner.run();
+ assertEquals(list(), Driver1.ids);
+ assertEquals(list(), Driver1.parametrizations);
+ }
- GenericTestSuiteDef suite = new GenericTestSuiteDef(Blah.class.getName());
-// suite.addTest();
+ private static void test2()
+ {
+ Driver1.init();
+ Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("foo"));
+ GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
+ suite.addTest(new TestDef(new TestId("foo")));
+ GenericTestRunner runner = new GenericTestRunner(suite);
+ runner.run();
+ assertEquals(list(new TestId("foo")), Driver1.ids);
+ assertEquals(list(new HashMap()), Driver1.parametrizations);
+ }
+ private static void test3()
+ {
+ Driver1.init();
+ Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("foo"));
+ Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("bar"));
+ GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
+ suite.addTest(new TestDef(new TestId("foo")));
GenericTestRunner runner = new GenericTestRunner(suite);
runner.run();
+ assertEquals(list(new TestId("foo")), Driver1.ids);
+ assertEquals(list(new HashMap()), Driver1.parametrizations);
+ }
+ private static void test4()
+ {
+ Driver1.init();
+ Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("foo"));
+ Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("bar"));
+ GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
+ GenericTestRunner runner = new GenericTestRunner(suite);
+ runner.run();
+ assertEquals(list(new TestId("foo"), new TestId("bar")), Driver1.ids);
+ assertEquals(list(new HashMap(), new HashMap()), Driver1.parametrizations);
}
-
- public static class Blah implements TestDriver
+ public static class Driver1 implements TestDriver
{
+ static SimpleTestSuiteInfo testSuiteInfo;
+ static List<TestId> ids;
+ static List<Map<String,String>> parametrizations;
+
+ static void init()
+ {
+ testSuiteInfo = new SimpleTestSuiteInfo("foo");
+ ids = new ArrayList<TestId>();
+ parametrizations = new ArrayList<Map<String,String>>();
+ }
+
public TestInfo getInfo()
{
- return new SimpleTestSuiteInfo("blah");
+ return testSuiteInfo;
}
public DriverResponse invoke(TestId id, DriverCommand command)
{
+ if (command instanceof StartTestCommand)
+ {
+ ids.add(id);
+ parametrizations.add(((StartTestCommand)command).getParametrization());
+ }
+
+ //
return new EndTestResponse();
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-11 13:38:02 UTC (rev 8601)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-11 15:00:56 UTC (rev 8602)
@@ -72,7 +72,7 @@
// If nothing is provided we execute the whole suite
if (testDefs.isEmpty())
{
- testDefs = Collections.singleton(new TestDef(new TestId("")));
+ testDefs = Collections.singleton(new TestDef(new TestId()));
}
for (TestDef testDef : testDefs)
16 years, 8 months
JBoss Portal SVN: r8601 - in modules/test/trunk/unit: src/main/org/jboss/test/unit/blah and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-11 09:38:02 -0400 (Thu, 11 Oct 2007)
New Revision: 8601
Added:
modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/writer/
modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/writer/PrintListener.java
Removed:
modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/console/
Modified:
modules/test/trunk/unit/build.xml
modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/report/DelegatingReporter.java
Log:
change the package name of the PrintListener reporter and also make it configurable to use any stream
Modified: modules/test/trunk/unit/build.xml
===================================================================
--- modules/test/trunk/unit/build.xml 2007-10-11 09:56:02 UTC (rev 8600)
+++ modules/test/trunk/unit/build.xml 2007-10-11 13:38:02 UTC (rev 8601)
@@ -186,9 +186,9 @@
<target name="test" depends="output">
<java classname="org.jboss.test.unit.AllTests" fork="true">
-<!--
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
+<!--
-->
<classpath>
<path location="${build.lib}/jboss-unit-lib.jar"/>
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java 2007-10-11 09:56:02 UTC (rev 8600)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java 2007-10-11 13:38:02 UTC (rev 8601)
@@ -24,8 +24,8 @@
import java.io.InputStream;
-import org.jboss.unit.report.impl.console.PrintListener;
import org.jboss.unit.report.impl.junit.JUnitReporter;
+import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.model.ModelBuilder;
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java 2007-10-11 09:56:02 UTC (rev 8600)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java 2007-10-11 13:38:02 UTC (rev 8601)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.test.unit.blah;
-import org.jboss.unit.report.impl.console.PrintListener;
+import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
Added: modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/writer/PrintListener.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/writer/PrintListener.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/writer/PrintListener.java 2007-10-11 13:38:02 UTC (rev 8601)
@@ -0,0 +1,142 @@
+/******************************************************************************
+ * 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.unit.report.impl.writer;
+
+import org.jboss.unit.Failure;
+import org.jboss.unit.TestId;
+import org.jboss.unit.runner.TestResult;
+import org.jboss.unit.runner.TestRunnerEvent;
+import org.jboss.unit.runner.TestRunnerEventListener;
+import org.jboss.unit.runner.event.EndRunnerEvent;
+import org.jboss.unit.runner.event.EndTestEvent;
+import org.jboss.unit.runner.event.RunnerFailureEvent;
+import org.jboss.unit.runner.event.StartRunnerEvent;
+import org.jboss.unit.runner.event.StartTestEvent;
+import org.jboss.unit.runner.results.TestFailure;
+import org.jboss.unit.runner.results.TestSuccess;
+
+import java.io.PrintStream;
+import java.io.Writer;
+import java.io.PrintWriter;
+import java.io.OutputStream;
+
+/**
+ * A listener which output messages on a specified stream.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PrintListener implements TestRunnerEventListener
+{
+
+ /** . */
+ private final PrintWriter out;
+
+ /**
+ * Builds with the <code>System.out</code> print stream.
+ */
+ public PrintListener()
+ {
+ this(System.out);
+ }
+
+ /**
+ * Use a writer, if the writer is an instance of <code>PrintWriter</code> then this object
+ * will be reused as is.
+ *
+ * @param writer the writer
+ */
+ public PrintListener(Writer writer) throws IllegalArgumentException
+ {
+ if (writer == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (writer instanceof PrintWriter)
+ {
+ this.out = (PrintWriter)writer;
+ }
+ else
+ {
+ this.out = new PrintWriter(writer, true);
+ }
+ }
+
+ /**
+ * Uses a provided output stream.
+ *
+ * @param stream the stream
+ */
+ public PrintListener(OutputStream stream) throws IllegalArgumentException
+ {
+ if (stream == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.out = new PrintWriter(stream, true);
+ }
+
+ public void onEvent(TestRunnerEvent event)
+ {
+ if (event instanceof StartRunnerEvent)
+ {
+ out.println("--- Start ---");
+ }
+ else if (event instanceof EndRunnerEvent)
+ {
+ out.println("--- End ---");
+ }
+ else if (event instanceof RunnerFailureEvent)
+ {
+ RunnerFailureEvent failureEvent = (RunnerFailureEvent)event;
+ Failure failure = failureEvent.getFailure();
+ out.println("Runner failure: " + failure.getType() + " " + failure.getMessage());
+ failure.getCause().printStackTrace(out);
+ }
+ else if (event instanceof StartTestEvent)
+ {
+ StartTestEvent startTestEvent = (StartTestEvent)event;
+ out.println("Starting id=" + startTestEvent.getTestId() + " name=" + startTestEvent.getTestInfo().getName() + " description=" + startTestEvent.getTestInfo().getDescription());
+ }
+ else if (event instanceof EndTestEvent)
+ {
+ EndTestEvent endTestEvent = (EndTestEvent)event;
+ TestId testId = endTestEvent.getTestId();
+ TestResult testResult = endTestEvent.getTestResult();
+ if (testResult instanceof TestSuccess)
+ {
+ out.println("Test id=" + testId + " is successful (" + testResult.getDurationMillis() + "ms)");
+ }
+ else if (testResult instanceof TestFailure)
+ {
+ TestFailure testFailure = (TestFailure)testResult;
+ Failure failure = testFailure.getFailure();
+ out.println("Test id=" + testId + " " + failure.getType() + " failed " + failure.getMessage() + " (" + testResult.getDurationMillis() + "ms)");
+ if (failure.getCause() != null)
+ {
+ failure.getCause().printStackTrace(out);
+ }
+ }
+ }
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/report/DelegatingReporter.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/report/DelegatingReporter.java 2007-10-11 09:56:02 UTC (rev 8600)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/report/DelegatingReporter.java 2007-10-11 13:38:02 UTC (rev 8601)
@@ -24,7 +24,7 @@
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunnerEvent;
-import org.jboss.unit.report.impl.console.PrintListener;
+import org.jboss.unit.report.impl.writer.PrintListener;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
16 years, 8 months
JBoss Portal SVN: r8600 - branches/JBoss_Portal_Branch_2_6/tools/etc/buildfragments.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-10-11 05:56:02 -0400 (Thu, 11 Oct 2007)
New Revision: 8600
Modified:
branches/JBoss_Portal_Branch_2_6/tools/etc/buildfragments/defaults.ent
Log:
- Compiling for JDK 5
Modified: branches/JBoss_Portal_Branch_2_6/tools/etc/buildfragments/defaults.ent
===================================================================
--- branches/JBoss_Portal_Branch_2_6/tools/etc/buildfragments/defaults.ent 2007-10-11 09:36:24 UTC (rev 8599)
+++ branches/JBoss_Portal_Branch_2_6/tools/etc/buildfragments/defaults.ent 2007-10-11 09:56:02 UTC (rev 8600)
@@ -118,8 +118,8 @@
<property name="javac.depend.cachedir" value="${build.cache}/depends"/>
- <property name="javac.source" value="1.4"/>
- <property name="javac.target" value="1.4"/>
+ <property name="javac.source" value="1.5"/>
+ <property name="javac.target" value="1.5"/>
<property name="rmic.stubVersion" value="1.2"/>
<!-- classpath and local.classpath must have a value using with a path -->
16 years, 8 months
JBoss Portal SVN: r8599 - modules/test/trunk/unit/src/main/org/jboss/test/unit/runner.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-11 05:36:24 -0400 (Thu, 11 Oct 2007)
New Revision: 8599
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java
Log:
forgot to commit a class
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-10-11 09:36:24 UTC (rev 8599)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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.test.unit.runner;
+
+import org.jboss.unit.runner.impl.generic.GenericTestRunner;
+import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
+import org.jboss.unit.driver.TestDriver;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
+import org.jboss.unit.TestId;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GenericTestRunnerTests
+{
+
+ public static void main(String[] args)
+ {
+
+
+ GenericTestSuiteDef suite = new GenericTestSuiteDef(Blah.class.getName());
+// suite.addTest();
+
+ GenericTestRunner runner = new GenericTestRunner(suite);
+ runner.run();
+
+ }
+
+
+ public static class Blah implements TestDriver
+ {
+
+ public TestInfo getInfo()
+ {
+ return new SimpleTestSuiteInfo("blah");
+ }
+
+ public DriverResponse invoke(TestId id, DriverCommand command)
+ {
+ return new EndTestResponse();
+ }
+ }
+
+}
16 years, 8 months
JBoss Portal SVN: r8598 - in modules/test/trunk/unit/src/main/org/jboss: test/unit/report and 2 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-10-11 05:26:00 -0400 (Thu, 11 Oct 2007)
New Revision: 8598
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/report/
modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/
modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/JUnitReporterTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/MyTestInfo.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/MyTestReport.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/AllTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java
Log:
- junit reporter test case
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/AllTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/AllTests.java 2007-10-11 05:44:45 UTC (rev 8597)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/AllTests.java 2007-10-11 09:26:00 UTC (rev 8598)
@@ -23,9 +23,11 @@
package org.jboss.test.unit;
import org.jboss.test.unit.api.AssertTests;
+import org.jboss.test.unit.blah.BlahTestTwo;
import org.jboss.test.unit.blah.BlahTests;
import org.jboss.test.unit.pojo.AbstractPOJOTests;
import org.jboss.test.unit.pojo.junit.JUnitPOJOTests;
+import org.jboss.test.unit.report.junit.JUnitReporterTests;
import org.jboss.test.unit.runner.CompositeTestRunnerTests;
import org.jboss.test.unit.runner.ParametrizationTests;
import org.jboss.test.unit.runner.TestDriverRunnerTests;
@@ -62,5 +64,11 @@
//
BlahTests.main(args);
+
+ //
+ BlahTestTwo.main(args);
+
+ //
+ JUnitReporterTests.main(args);
}
}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/JUnitReporterTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/JUnitReporterTests.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/JUnitReporterTests.java 2007-10-11 09:26:00 UTC (rev 8598)
@@ -0,0 +1,154 @@
+/******************************************************************************
+ * 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.test.unit.report.junit;
+
+import org.jboss.unit.Failure;
+import org.jboss.unit.FailureType;
+import org.jboss.unit.TestId;
+import org.jboss.unit.api.Assert;
+import org.jboss.unit.runner.TestResult;
+import org.jboss.unit.runner.event.EndRunnerEvent;
+import org.jboss.unit.runner.event.EndTestEvent;
+import org.jboss.unit.runner.event.RunnerFailureEvent;
+import org.jboss.unit.runner.event.StartRunnerEvent;
+import org.jboss.unit.runner.event.StartTestEvent;
+import org.jboss.unit.runner.results.TestFailure;
+import org.jboss.unit.runner.results.TestSuccess;
+import org.w3c.dom.Element;
+
+import static org.jboss.unit.util.XMLTools.*;
+import static org.jboss.unit.report.impl.junit.XMLConstants.*;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JUnitReporterTests
+{
+ /** The testSuiteName */
+ private final static String testSuiteName = JUnitReporterTests.class.getName();
+
+ public static void main(String[] args) throws Exception
+ {
+ testTestSuite();
+ testTestCase();
+ testTestCaseFailure();
+ }
+
+ private static void testTestSuite()
+ {
+ MyTestReport report = new MyTestReport(testSuiteName);
+ // add StartRunnerEvent
+ report.startTestSuite(new StartRunnerEvent());
+ // add RunnerFailureEvent
+ Failure f = new Failure("fehler", FailureType.ERROR);
+ RunnerFailureEvent rfe = new RunnerFailureEvent(f);
+ report.runnerFailed(rfe);
+ // add EndRunnerEvent
+ EndRunnerEvent endRunnerEvent = new EndRunnerEvent();
+ report.endTestSuite(endRunnerEvent);
+ // get Root Element
+ Element e = report.getRootElement();
+
+ // Testing root element
+ Assert.assertEquals(TESTSUITE, e.getNodeName());
+ Assert.assertEquals(testSuiteName, e.getAttribute(ATTR_NAME));
+ Assert.assertNotNull(e.getAttribute(HOSTNAME));
+ Assert.assertNotNull(e.getAttribute(TIMESTAMP));
+ Assert.assertEquals("1", e.getAttribute(ATTR_TESTS));
+ Assert.assertEquals("1", e.getAttribute(ATTR_ERRORS));
+ Assert.assertEquals("0", e.getAttribute(ATTR_FAILURES));
+
+ // Testing properties
+ Assert.assertNotNull(child(e, PROPERTIES));
+
+ // TODO - property
+
+ e = report.getRootElement();
+ Element error = child(e, ERROR);
+ Assert.assertEquals("fehler", error.getAttribute(ATTR_MESSAGE));
+ }
+
+
+ private static void testTestCase()
+ {
+ MyTestReport report = new MyTestReport(testSuiteName);
+ report.startTestSuite(new StartRunnerEvent());
+
+ TestId testId = new TestId("foo");
+ StartTestEvent startTestEvent = new StartTestEvent(testId, new MyTestInfo());
+ report.startTest(startTestEvent);
+
+ TestResult testResult = new TestSuccess(20);
+ EndTestEvent endTestEvent = new EndTestEvent(testId, testResult);
+ report.endTest(endTestEvent);
+ // end report
+ report.endTestSuite(new EndRunnerEvent());
+ Element e = report.getRootElement();
+
+ Assert.assertEquals(TESTSUITE, e.getNodeName());
+ Assert.assertEquals("1", e.getAttribute(ATTR_TESTS));
+ Assert.assertEquals("0", e.getAttribute(ATTR_ERRORS));
+ Assert.assertEquals("0", e.getAttribute(ATTR_FAILURES));
+
+ Element testCase = child(e, TESTCASE);
+ Assert.assertEquals(TESTCASE, testCase.getNodeName());
+ Assert.assertEquals("foo", testCase.getAttribute(ATTR_NAME));
+ Assert.assertEquals("20", testCase.getAttribute(ATTR_TIME));
+
+ Assert.assertNull(child(e, ERROR));
+ }
+
+ private static void testTestCaseFailure()
+ {
+ MyTestReport report = new MyTestReport(testSuiteName);
+ report.startTestSuite(new StartRunnerEvent());
+
+ TestId testId = new TestId("foo");
+ StartTestEvent startTestEvent = new StartTestEvent(testId, new MyTestInfo());
+ report.startTest(startTestEvent);
+
+ Failure f = new Failure("foo", new AssertionError("expecting something different."), FailureType.ASSERTION);
+ TestResult testResult = new TestFailure(f, 20);
+ EndTestEvent endTestEvent = new EndTestEvent(testId, testResult);
+ report.endTest(endTestEvent);
+ // end report
+ report.endTestSuite(new EndRunnerEvent());
+ Element e = report.getRootElement();
+
+ Assert.assertEquals(TESTSUITE, e.getNodeName());
+ Assert.assertEquals("1", e.getAttribute(ATTR_TESTS));
+ Assert.assertEquals("0", e.getAttribute(ATTR_ERRORS));
+ Assert.assertEquals("1", e.getAttribute(ATTR_FAILURES));
+
+ Element testCase = child(e, TESTCASE);
+ Assert.assertEquals(TESTCASE, testCase.getNodeName());
+ Assert.assertEquals("foo", testCase.getAttribute(ATTR_NAME));
+ Assert.assertEquals("20", testCase.getAttribute(ATTR_TIME));
+
+ Element error = child(testCase, FAILURE);
+ Assert.assertEquals("expecting something different.", error.getAttribute(ATTR_MESSAGE));
+ Assert.assertEquals("java.lang.AssertionError", error.getAttribute(ATTR_TYPE));
+ Assert.assertNotNull(error.getTextContent());
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/MyTestInfo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/MyTestInfo.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/MyTestInfo.java 2007-10-11 09:26:00 UTC (rev 8598)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.test.unit.report.junit;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.unit.info.ParameterInfo;
+import org.jboss.unit.info.TestInfo;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class MyTestInfo implements TestInfo
+{
+
+ public String getDescription()
+ {
+ return null;
+ }
+
+ public Set<String> getKeywords()
+ {
+ return null;
+ }
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public Map<String, ? extends ParameterInfo> getParameters()
+ {
+ return null;
+ }
+
+}
+
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/MyTestReport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/MyTestReport.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/report/junit/MyTestReport.java 2007-10-11 09:26:00 UTC (rev 8598)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.test.unit.report.junit;
+
+import org.jboss.unit.report.impl.junit.JUnitTestReport;
+import org.w3c.dom.Element;
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class MyTestReport extends JUnitTestReport
+{
+ public MyTestReport(String testSuiteName)
+ {
+ super(testSuiteName);
+ }
+
+ public Element getRootElement()
+ {
+ return this.rootElement;
+ }
+
+}
+
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java 2007-10-11 05:44:45 UTC (rev 8597)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java 2007-10-11 09:26:00 UTC (rev 8598)
@@ -80,7 +80,7 @@
private Document document;
/** The root element */
- private Element rootElement;
+ protected Element rootElement;
/** The started Tests */
private Map<TestId, TestInfo> startedTests = new HashMap<TestId, TestInfo>();
@@ -265,7 +265,7 @@
{
try
{
-
+ toDir = checkDir(toDir);
StringBuffer filePath = new StringBuffer();
// If no test suite name is specified use default and add timestamp
@@ -299,6 +299,16 @@
}
}
+ private String checkDir(String toDir)
+ {
+ File dir = new File(toDir);
+ if (! dir.exists())
+ {
+ dir.mkdir();
+ }
+ return dir.toString();
+ }
+
private Element addError(String type, Throwable t)
{
Element error = document.createElement(type);
16 years, 8 months