[seam-commits] Seam SVN: r12796 - in modules: faces/trunk/api/src/main/resources/META-INF and 11 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue May 25 14:36:04 EDT 2010


Author: lincolnthree
Date: 2010-05-25 14:36:02 -0400 (Tue, 25 May 2010)
New Revision: 12796

Added:
   modules/faces/trunk/api/src/main/resources/META-INF/
   modules/faces/trunk/api/src/main/resources/META-INF/beans.xml
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/MessagesAdapter.java
   modules/international/trunk/api/src/main/resources/META-INF/
   modules/international/trunk/api/src/main/resources/META-INF/beans.xml
Removed:
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContext.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContextFactory.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamResourceResolver.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/SeamMessages.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerAccessor.java
   modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/environment/SeamResourceResolverTest.java
Modified:
   modules/faces/trunk/impl/pom.xml
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java
   modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml
   modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml
   modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java
   modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java
   modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java
Log:
Repackaged and removed unnecessary ResourceResolver extensions.

Added: modules/faces/trunk/api/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/faces/trunk/api/src/main/resources/META-INF/beans.xml	                        (rev 0)
+++ modules/faces/trunk/api/src/main/resources/META-INF/beans.xml	2010-05-25 18:36:02 UTC (rev 12796)
@@ -0,0 +1,27 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+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.
+--> 
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="
+      http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+	
+</beans>
\ No newline at end of file

Modified: modules/faces/trunk/impl/pom.xml
===================================================================
--- modules/faces/trunk/impl/pom.xml	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/pom.xml	2010-05-25 18:36:02 UTC (rev 12796)
@@ -35,6 +35,7 @@
 		<dependency>
 			<groupId>javax.servlet</groupId>
 			<artifactId>servlet-api</artifactId>
+			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<artifactId>seam-faces-api</artifactId>

Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -41,7 +41,7 @@
 
 import org.jboss.seam.faces.event.qualifier.After;
 import org.jboss.seam.faces.event.qualifier.Before;
-import org.jboss.seam.faces.util.BeanManagerAccessor;
+import org.jboss.weld.extensions.beanManager.BeanManagerAccessor;
 
 /**
  * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>

Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContext.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContext.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContext.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,36 +0,0 @@
-package org.jboss.seam.faces.environment;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.ExternalContextWrapper;
-import javax.faces.view.facelets.ResourceResolver;
-
-public class SeamExternalContext extends ExternalContextWrapper
-{
-   private final ExternalContext wrapped;
-   private final ResourceResolver resolver = new SeamResourceResolver();
-
-   public SeamExternalContext(final ExternalContext wrapped)
-   {
-      this.wrapped = wrapped;
-   }
-
-   @Override
-   public URL getResource(final String path) throws MalformedURLException
-   {
-      URL url = resolver.resolveUrl(path);
-      if (url == null)
-      {
-         url = getWrapped().getResource(path);
-      }
-      return url;
-   }
-
-   @Override
-   public ExternalContext getWrapped()
-   {
-      return wrapped;
-   }
-}

Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContextFactory.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContextFactory.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContextFactory.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,28 +0,0 @@
-package org.jboss.seam.faces.environment;
-
-import javax.faces.FacesException;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.ExternalContextFactory;
-
-public class SeamExternalContextFactory extends ExternalContextFactory
-{
-   private final ExternalContextFactory parent;
-
-   public SeamExternalContextFactory(final ExternalContextFactory parent)
-   {
-      super();
-      this.parent = parent;
-   }
-
-   @Override
-   public ExternalContext getExternalContext(final Object context, final Object request, final Object response) throws FacesException
-   {
-      return new SeamExternalContext(getWrapped().getExternalContext(context, request, response));
-   }
-
-   @Override
-   public ExternalContextFactory getWrapped()
-   {
-      return parent;
-   }
-}

Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamResourceResolver.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamResourceResolver.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamResourceResolver.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * 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.seam.faces.environment;
-
-import java.net.URL;
-
-import javax.faces.view.facelets.ResourceResolver;
-
-/**
- * Allow resolution of classpath resources.
- * 
- * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
- * 
- */
-public class SeamResourceResolver extends ResourceResolver
-{
-   private final ResourceResolver parent;
-
-   public SeamResourceResolver()
-   {
-      this.parent = null;
-   }
-
-   public SeamResourceResolver(final ResourceResolver parent)
-   {
-      this.parent = parent;
-   }
-
-   @Override
-   public URL resolveUrl(final String path)
-   {
-      URL result = null;
-      if (path != null)
-      {
-         String canonicalPath = path;
-         if (path.startsWith("/"))
-         {
-            canonicalPath = path.substring(1);
-         }
-
-         result = Thread.currentThread().getContextClassLoader().getResource(canonicalPath);
-         if ((result == null) && (parent != null))
-         {
-            result = parent.resolveUrl(path);
-         }
-      }
-      return result;
-   }
-}

Copied: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status (from rev 12795, modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display)

Copied: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/MessagesAdapter.java (from rev 12795, modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/SeamMessages.java)
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/MessagesAdapter.java	                        (rev 0)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/MessagesAdapter.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.seam.faces.status;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Observes;
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.event.PhaseEvent;
+import javax.inject.Inject;
+
+import org.jboss.seam.faces.event.qualifier.Before;
+import org.jboss.seam.faces.event.qualifier.RenderResponse;
+import org.jboss.seam.international.status.Level;
+import org.jboss.seam.international.status.Message;
+import org.jboss.seam.international.status.Messages;
+
+/**
+ * Convert Seam Messages into FacesMessages before RenderResponse phase.<br>
+ * TODO perform EL evaluation.
+ * 
+ * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
+ * 
+ */
+ at SessionScoped
+public class MessagesAdapter implements Serializable
+{
+   private static final long serialVersionUID = -2908193057765795662L;
+
+   @Inject
+   private Messages messages;
+
+   @SuppressWarnings("unused")
+   private void convert(@Observes @Before @RenderResponse final PhaseEvent event)
+   {
+      for (Message m : messages.getAll())
+      {
+         event.getFacesContext().addMessage(m.getTargets(), new FacesMessage(getSeverity(m.getLevel()), m.getText(), null));
+      }
+      messages.clear();
+   }
+
+   private Severity getSeverity(final Level level)
+   {
+      Severity result = FacesMessage.SEVERITY_INFO;
+      switch (level)
+      {
+      case INFO:
+         break;
+      case WARN:
+         result = FacesMessage.SEVERITY_WARN;
+         break;
+      case ERROR:
+         result = FacesMessage.SEVERITY_ERROR;
+         break;
+      case FATAL:
+         result = FacesMessage.SEVERITY_FATAL;
+         break;
+      default:
+         break;
+      }
+      return result;
+   }
+
+}

Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/SeamMessages.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/SeamMessages.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/SeamMessages.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * 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.seam.faces.display;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.event.Observes;
-import javax.faces.application.FacesMessage;
-import javax.faces.application.FacesMessage.Severity;
-import javax.faces.event.PhaseEvent;
-import javax.inject.Inject;
-
-import org.jboss.seam.faces.event.qualifier.Before;
-import org.jboss.seam.faces.event.qualifier.RenderResponse;
-import org.jboss.seam.international.status.Level;
-import org.jboss.seam.international.status.Message;
-import org.jboss.seam.international.status.Messages;
-
-/**
- * Convert Seam Messages into FacesMessages <br>
- * TODO perform EL evaluation.
- * 
- * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
- * 
- */
- at SessionScoped
-public class SeamMessages implements Serializable
-{
-   private static final long serialVersionUID = -2908193057765795662L;
-
-   @Inject
-   Messages sm;
-
-   @SuppressWarnings("unused")
-   private void convert(@Observes @Before @RenderResponse final PhaseEvent event)
-   {
-      for (Message m : sm.getAll())
-      {
-         event.getFacesContext().addMessage(m.getTargets(), new FacesMessage(getSeverity(m.getLevel()), m.getText(), null));
-      }
-      sm.clear();
-   }
-
-   private Severity getSeverity(final Level level)
-   {
-      Severity result = FacesMessage.SEVERITY_INFO;
-      switch (level)
-      {
-      case INFO:
-         break;
-      case WARN:
-         result = FacesMessage.SEVERITY_WARN;
-         break;
-      case ERROR:
-         result = FacesMessage.SEVERITY_ERROR;
-         break;
-      case FATAL:
-         result = FacesMessage.SEVERITY_FATAL;
-         break;
-      default:
-         break;
-      }
-      return result;
-   }
-
-}

Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerAccessor.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerAccessor.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerAccessor.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * 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.seam.faces.util;
-
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.extensions.beanManager.BeanManagerAware;
-
-/**
- * <b>***DO NOT USE THIS CLASS***</b>
- * <p>
- * See {@link BeanManagerAware}
- * 
- * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
- * 
- */
-public class BeanManagerAccessor extends BeanManagerAware
-{
-   public static BeanManager getManager()
-   {
-      return new BeanManagerAccessor().getBeanManager();
-   }
-}

Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -47,7 +47,7 @@
    private BeanManager manager;
 
    @Inject
-   FormValidationTypeOverrideExtension classExtension;
+   private FormValidationTypeOverrideExtension classExtension;
 
    /**
     * Perform @{@link Inject} on an object as if it were a bean managed by CDI.
@@ -79,6 +79,9 @@
       return result;
    }
 
+   /**
+    * Determine if a bean is {@link Dependent} scoped.
+    */
    @SuppressWarnings("unchecked")
    public <T> boolean isDependentScoped(final Class<T> type)
    {
@@ -100,14 +103,17 @@
    @SuppressWarnings("unchecked")
    public <T> T getContextualInstance(final Class<T> type)
    {
+      T result = null;
       Bean<T> bean = (Bean<T>) manager.resolve(manager.getBeans(type));
       if (bean != null)
       {
          CreationalContext<T> context = manager.createCreationalContext(bean);
-         T result = (T) manager.getReference(bean, type, context);
-         return result;
+         if (context != null)
+         {
+            result = (T) manager.getReference(bean, type, context);
+         }
       }
-      return null;
+      return result;
    }
 
    /**
@@ -123,7 +129,10 @@
       for (Bean<?> bean : manager.getBeans(type))
       {
          CreationalContext<T> context = (CreationalContext<T>) manager.createCreationalContext(bean);
-         result.add((T) manager.getReference(bean, type, context));
+         if (context != null)
+         {
+            result.add((T) manager.getReference(bean, type, context));
+         }
       }
       return result;
    }

Modified: modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml	2010-05-25 18:36:02 UTC (rev 12796)
@@ -17,10 +17,6 @@
 		<phase-listener>org.jboss.seam.faces.event.DelegatingPhaseListener</phase-listener>
 	</lifecycle>
 	
-	<factory>
-		<external-context-factory>org.jboss.seam.faces.environment.SeamExternalContextFactory</external-context-factory>
-	</factory>
-
 	<application>
 		<system-event-listener>
 			<system-event-listener-class>org.jboss.seam.faces.event.DelegatingSystemEventListener</system-event-listener-class>

Modified: modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml	2010-05-25 18:36:02 UTC (rev 12796)
@@ -8,9 +8,4 @@
 		<listener-class>org.jboss.seam.faces.beanManager.BeanManagerServletContextListener</listener-class>
 	</listener>
 
-	<context-param>
-		<param-name>javax.faces.FACELETS_RESOURCE_RESOLVER</param-name>
-		<param-value>org.jboss.seam.faces.environment.SeamResourceResolver</param-value>
-	</context-param>
-
 </web-fragment>
\ No newline at end of file

Deleted: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/environment/SeamResourceResolverTest.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/environment/SeamResourceResolverTest.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/environment/SeamResourceResolverTest.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * 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.seam.faces.environment;
-
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URL;
-
-import javax.faces.view.facelets.ResourceResolver;
-
-import org.junit.Test;
-
-/**
- * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
- * 
- */
-public class SeamResourceResolverTest
-{
-   SeamResourceResolver resolver = new SeamResourceResolver(new ResourceResolver()
-   {
-      @Override
-      public URL resolveUrl(final String path)
-      {
-         return null;
-      }
-   });
-
-   @Test
-   public void testResolveClasspathUrl()
-   {
-      String validPath = "/org/jboss/seam/faces/environment/mock.resource";
-      URL url = resolver.resolveUrl(validPath);
-      assertTrue(url instanceof URL);
-   }
-
-   @Test
-   public void testResolveUnprefixedClasspathUrl()
-   {
-      String validPath = "org/jboss/seam/faces/environment/mock.resource";
-      URL url = resolver.resolveUrl(validPath);
-      assertTrue(url instanceof URL);
-   }
-
-   @Test
-   public void testNullInputYieldsNullOutput() throws Exception
-   {
-      URL url = resolver.resolveUrl(null);
-      assertNull(url);
-   }
-
-   @Test
-   public void testResolveUrlReturnsNullIfNotFound()
-   {
-      String invalidPath = "some/nonexistent/mock.resource";
-      URL url = resolver.resolveUrl(invalidPath);
-      assertNull(url);
-   }
-
-}

Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -21,6 +21,7 @@
  */
 package org.jboss.seam.international.status;
 
+import java.io.Serializable;
 import java.util.Collection;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -38,8 +39,10 @@
  */
 @Named
 @ApplicationScoped
-public class Bundles implements Map<String, ResourceBundle>
+public class Bundles implements Map<String, ResourceBundle>, Serializable
 {
+   private static final long serialVersionUID = 1207758648760266247L;
+
    private final Map<String, ResourceBundle> bundles = new ConcurrentHashMap<String, ResourceBundle>();
 
    public void clear()

Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -21,6 +21,8 @@
  */
 package org.jboss.seam.international.status;
 
+import java.io.Serializable;
+
 import javax.inject.Inject;
 
 import org.jboss.seam.international.status.builder.BundleKey;
@@ -28,13 +30,18 @@
 import org.jboss.seam.international.status.builder.TemplateMessage;
 
 /**
+ * A utility for building {@link Message} objects via message templates, or
+ * message bundles. See {@link TemplateMessage} or {@link BundleMessage}.
+ * 
  * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
  * 
  */
-public class MessageFactory
+public class MessageFactory implements Serializable
 {
+   private static final long serialVersionUID = -7899463141244189001L;
+
    @Inject
-   Bundles bundles;
+   private Bundles bundles;
 
    /*
     * Bundle Factory Methods

Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java	2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java	2010-05-25 18:36:02 UTC (rev 12796)
@@ -45,10 +45,11 @@
 public class Messages implements Serializable
 {
    private static final long serialVersionUID = -2908193057765795662L;
+
    private final Set<Message> messages = Collections.synchronizedSet(new HashSet<Message>());
 
    @Inject
-   MessageFactory factory;
+   private MessageFactory factory;
 
    /**
     * Clear all pending messages.

Added: modules/international/trunk/api/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/international/trunk/api/src/main/resources/META-INF/beans.xml	                        (rev 0)
+++ modules/international/trunk/api/src/main/resources/META-INF/beans.xml	2010-05-25 18:36:02 UTC (rev 12796)
@@ -0,0 +1,27 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+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.
+--> 
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="
+      http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+	
+</beans>
\ No newline at end of file



More information about the seam-commits mailing list