Author: julien_viet
Date: 2011-06-24 16:01:11 -0400 (Fri, 24 Jun 2011)
New Revision: 6740
Removed:
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/metadata/
Modified:
components/pc/trunk/mc/pom.xml
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java
components/pc/trunk/test/core/src/main/resources/common.xml
components/pc/trunk/test/servers/jboss42/src/test/build.xml
components/pc/trunk/test/servers/jboss51/src/test/build.xml
components/pc/trunk/test/servers/jboss6/src/test/build.xml
components/pc/trunk/test/servers/jetty6/src/test/build.xml
components/pc/trunk/test/servers/src/common/resources/common.xml
components/pc/trunk/test/servers/tomcat6/src/test/build.xml
components/pc/trunk/test/servers/tomcat7/src/test/build.xml
Log:
GTNPC-57 : Remove JBoss XB dependency for server based unit tests
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2011-06-24 19:57:12 UTC (rev 6739)
+++ components/pc/trunk/mc/pom.xml 2011-06-24 20:01:11 UTC (rev 6740)
@@ -14,11 +14,6 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-portlet</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- </dependency>
<dependency>
<groupId>org.staxnav</groupId>
Modified:
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java
===================================================================
---
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java 2011-06-24
19:57:12 UTC (rev 6739)
+++
components/pc/trunk/mc/src/main/java/org/gatein/pc/mc/PortletApplicationDeployer.java 2011-06-24
20:01:11 UTC (rev 6740)
@@ -41,25 +41,13 @@
import org.gatein.pc.portlet.impl.container.PortletApplicationLifeCycle;
import org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle;
import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
-import static
org.gatein.pc.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_168_NS;
-import static
org.gatein.pc.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_286_NS;
-import org.gatein.pc.mc.metadata.factory.PortletApplicationModelFactory;
-import org.gatein.pc.mc.metadata.impl.AnnotationPortletApplication10MetaData;
-import org.gatein.pc.mc.metadata.impl.AnnotationPortletApplication20MetaData;
-import org.gatein.pc.mc.metadata.impl.ValueTrimmingFilter;
import org.gatein.wci.ServletContainer;
import org.gatein.wci.ServletContainerFactory;
import org.gatein.wci.WebApp;
import org.gatein.wci.WebAppEvent;
import org.gatein.wci.WebAppLifeCycleEvent;
import org.gatein.wci.WebAppListener;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.resolver.MutableSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
-import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Collection;
@@ -73,25 +61,6 @@
public class PortletApplicationDeployer implements WebAppListener,
PortletApplicationRegistry
{
- static
- {
- try
- {
- SingletonSchemaResolverFactory factory =
SingletonSchemaResolverFactory.getInstance();
- MutableSchemaResolver resolver = factory.getSchemaBindingResolver();
-
- /** SchemaResolver */
- resolver.mapSchemaLocation(PORTLET_JSR_168_NS,
"portlet-app_1_0.xsd");
- resolver.mapSchemaLocation(PORTLET_JSR_286_NS,
"portlet-app_2_0.xsd");
- resolver.mapLocationToClass(PORTLET_JSR_286_NS,
AnnotationPortletApplication20MetaData.class);
- resolver.mapLocationToClass(PORTLET_JSR_168_NS,
AnnotationPortletApplication10MetaData.class);
- }
- catch (Exception e)
- {
- throw new Error(e);
- }
- }
-
/** . */
private Logger log = LoggerFactory.getLogger(PortletApplicationDeployer.class);
Modified:
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java
===================================================================
---
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java 2011-06-24
19:57:12 UTC (rev 6739)
+++
components/pc/trunk/mc/src/test/java/org/gatein/pc/mc/metadata/AbstractMetaDataTestCase.java 2011-06-24
20:01:11 UTC (rev 6740)
@@ -28,27 +28,11 @@
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
-import org.gatein.pc.mc.metadata.factory.PortletApplicationModelFactory;
-import org.gatein.pc.mc.metadata.impl.AnnotationPortletApplication10MetaData;
-import org.gatein.pc.mc.metadata.impl.AnnotationPortletApplication20MetaData;
-import org.gatein.pc.mc.metadata.impl.ValueTrimmingFilter;
import org.gatein.pc.mc.staxnav.PortletApplicationMetaDataBuilder;
-import org.gatein.pc.portlet.impl.metadata.PortletApplication10MetaData;
import org.gatein.pc.portlet.impl.metadata.PortletApplication20MetaData;
-import static org.gatein.pc.portlet.impl.metadata.PortletMetaDataConstants.*;
-
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.resolver.MutableSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
-import org.jboss.xb.builder.JBossXBBuilder;
import org.xml.sax.SAXException;
-import org.jboss.util.xml.JBossEntityResolver;
-import javax.xml.stream.XMLStreamException;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
* @version $Revision$
@@ -59,49 +43,15 @@
/** Test parameter for using xml binding annotation. */
public static final String ANNOTATION_BINDING = "annotation";
- /** Test parameter for using the ObjectModelFactory. */
- public static final String FACTORY_BINDING = "factory";
-
- /** The schema resolver factory. */
- protected static SingletonSchemaResolverFactory factory;
-
- /** The schema resolver. */
- protected static MutableSchemaResolver resolver;
-
- /** The unmarshaller. */
- protected Unmarshaller unmarshaller = null;
-
/** Annotation or ObjectModelFactory parsing. */
private String parser = ANNOTATION_BINDING;
- static
+ protected PortletApplication20MetaData _unmarshall10(String file) throws SAXException,
IOException
{
- try
- {
- factory = SingletonSchemaResolverFactory.getInstance();
- resolver = factory.getSchemaBindingResolver();
-
- JBossEntityResolver.registerEntity(PORTLET_JSR_168_NS,
"metadata/portlet-app_1_0.xsd");
- JBossEntityResolver.registerEntity(PORTLET_JSR_286_NS,
"metadata/portlet-app_2_0.xsd");
-
- /** SchemaResolver */
- resolver.mapSchemaLocation(PORTLET_JSR_168_NS,
"portlet-app_1_0.xsd");
- resolver.mapSchemaLocation(PORTLET_JSR_286_NS,
"portlet-app_2_0.xsd");
- resolver.mapLocationToClass(PORTLET_JSR_286_NS,
AnnotationPortletApplication20MetaData.class);
- resolver.mapLocationToClass(PORTLET_JSR_168_NS,
AnnotationPortletApplication10MetaData.class);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- protected PortletApplication20MetaData _unmarshall10(String file) throws
JBossXBException, SAXException, IOException
- {
return _unmarshall10(file, false);
}
- protected PortletApplication20MetaData _unmarshall10(String file, boolean fail) throws
JBossXBException, SAXException, IOException
+ protected PortletApplication20MetaData _unmarshall10(String file, boolean fail) throws
SAXException, IOException
{
try
{
@@ -145,64 +95,6 @@
throw afe;
}
- protected PortletApplication10MetaData unmarshall10(String file) throws
JBossXBException, SAXException, IOException
- {
- if (ANNOTATION_BINDING.equals(parser))
- {
- return this.unmarshallAnnotation(file,
AnnotationPortletApplication10MetaData.class);
- }
- else if (FACTORY_BINDING.equals(parser))
- {
- return this.unmarshallWithFactory(file);
- }
- else
- {
- throw new IllegalArgumentException("Wrong parameter for parser: " +
parser);
- }
- }
-
- protected PortletApplication20MetaData unmarshall20(String file) throws
JBossXBException, SAXException, IOException
- {
- if (ANNOTATION_BINDING.equals(parser))
- {
- return this.unmarshallAnnotation(file,
AnnotationPortletApplication20MetaData.class);
- }
- else if (FACTORY_BINDING.equals(parser))
- {
- return (PortletApplication20MetaData)this.unmarshallWithFactory(file);
- }
- else
- {
- throw new IllegalArgumentException("Wrong parameter for parser: " +
parser);
- }
- }
-
- private PortletApplication10MetaData unmarshallWithFactory(String file) throws
JBossXBException
- {
- /** validate */
- unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setNamespaceAware(true);
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setValidation(true);
-
- PortletApplicationModelFactory factory = new PortletApplicationModelFactory();
- /** unmarshal */
- return (PortletApplication10MetaData) unmarshaller.unmarshal(getStream(file), new
ValueTrimmingFilter(factory),
- null);
- }
-
- private <T> T unmarshallAnnotation(String file, Class<T> clazz) throws
JBossXBException
- {
- /** validate */
- unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setNamespaceAware(true);
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setValidation(true);
-
- /** unmarshal */
- return clazz.cast(unmarshaller.unmarshal(getPath(file),
JBossXBBuilder.build(clazz)));
- }
-
protected String getPath(String file)
{
URL url = Thread.currentThread().getContextClassLoader().getResource(file);
Modified: components/pc/trunk/test/core/src/main/resources/common.xml
===================================================================
--- components/pc/trunk/test/core/src/main/resources/common.xml 2011-06-24 19:57:12 UTC
(rev 6739)
+++ components/pc/trunk/test/core/src/main/resources/common.xml 2011-06-24 20:01:11 UTC
(rev 6740)
@@ -46,10 +46,6 @@
<pathelement
location="${jboss:jboss-common-logging-log4j:jar}"/>
</path>
- <path id="jboss-xb">
- <pathelement location="${org.jboss:jbossxb:jar}"/>
- </path>
-
<path id="staxnav">
<pathelement location="${org.staxnav:staxnav.core:jar}"/>
</path>
Modified: components/pc/trunk/test/servers/jboss42/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss42/src/test/build.xml 2011-06-24 19:57:12 UTC
(rev 6739)
+++ components/pc/trunk/test/servers/jboss42/src/test/build.xml 2011-06-24 20:01:11 UTC
(rev 6740)
@@ -18,7 +18,6 @@
<path refid="portal-common"/>
<path refid="portal-web"/>
<path refid="portal-portlet"/>
- <path refid="jboss-xb"/>
<path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
Modified: components/pc/trunk/test/servers/jboss51/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss51/src/test/build.xml 2011-06-24 19:57:12 UTC
(rev 6739)
+++ components/pc/trunk/test/servers/jboss51/src/test/build.xml 2011-06-24 20:01:11 UTC
(rev 6740)
@@ -18,7 +18,6 @@
<path refid="portal-common"/>
<path refid="portal-web"/>
<path refid="portal-portlet"/>
- <path refid="jboss-xb"/>
<path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
Modified: components/pc/trunk/test/servers/jboss6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jboss6/src/test/build.xml 2011-06-24 19:57:12 UTC
(rev 6739)
+++ components/pc/trunk/test/servers/jboss6/src/test/build.xml 2011-06-24 20:01:11 UTC
(rev 6740)
@@ -18,7 +18,6 @@
<path refid="portal-common"/>
<path refid="portal-web"/>
<path refid="portal-portlet"/>
- <path refid="jboss-xb"/>
<path refid="staxnav"/>
<path location="${org.jboss:jboss-common-core:jar}"/>
</path>
Modified: components/pc/trunk/test/servers/jetty6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/jetty6/src/test/build.xml 2011-06-24 19:57:12 UTC
(rev 6739)
+++ components/pc/trunk/test/servers/jetty6/src/test/build.xml 2011-06-24 20:01:11 UTC
(rev 6740)
@@ -19,7 +19,6 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
- <path refid="jboss-xb"/>
<path refid="staxnav"/>
<pathelement path="${apache-xerces:xercesImpl:jar}"/>
<pathelement path="${apache-xerces:resolver:jar}"/>
Modified: components/pc/trunk/test/servers/src/common/resources/common.xml
===================================================================
--- components/pc/trunk/test/servers/src/common/resources/common.xml 2011-06-24 19:57:12
UTC (rev 6739)
+++ components/pc/trunk/test/servers/src/common/resources/common.xml 2011-06-24 20:01:11
UTC (rev 6740)
@@ -46,10 +46,6 @@
<pathelement
location="${org.jboss.logging:jboss-logging-log4j:jar}"/>
</path>
- <path id="jboss-xb">
- <pathelement location="${org.jboss:jbossxb:jar}"/>
- </path>
-
<path id="staxnav">
<pathelement location="${org.staxnav:staxnav.core:jar}"/>
</path>
Modified: components/pc/trunk/test/servers/tomcat6/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/tomcat6/src/test/build.xml 2011-06-24 19:57:12 UTC
(rev 6739)
+++ components/pc/trunk/test/servers/tomcat6/src/test/build.xml 2011-06-24 20:01:11 UTC
(rev 6740)
@@ -19,7 +19,6 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
- <path refid="jboss-xb"/>
<path refid="staxnav"/>
<pathelement location="${apache-xerces:xercesImpl:jar}"/>
<pathelement location="${apache-xerces:xml-apis:jar}"/>
Modified: components/pc/trunk/test/servers/tomcat7/src/test/build.xml
===================================================================
--- components/pc/trunk/test/servers/tomcat7/src/test/build.xml 2011-06-24 19:57:12 UTC
(rev 6739)
+++ components/pc/trunk/test/servers/tomcat7/src/test/build.xml 2011-06-24 20:01:11 UTC
(rev 6740)
@@ -19,7 +19,6 @@
<path refid="portal-web"/>
<path refid="portal-portlet"/>
<path refid="jboss-unit"/>
- <path refid="jboss-xb"/>
<path refid="staxnav"/>
<pathelement path="${apache-xerces:xercesImpl:jar}"/>
<pathelement path="${apache-xerces:resolver:jar}"/>