[seam-commits] Seam SVN: r12920 - in modules/faces/trunk: impl/src/test/java/org/jboss/seam/faces/context and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Jun 1 13:22:36 EDT 2010


Author: lincolnthree
Date: 2010-06-01 13:22:35 -0400 (Tue, 01 Jun 2010)
New Revision: 12920

Added:
   modules/faces/trunk/api/src/test/java/org/jboss/seam/faces/test/
   modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/context/MockFlashContext.java
Modified:
   modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/status/MessagesAdapterTest.java
Log:
Updated tests.

Added: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/context/MockFlashContext.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/context/MockFlashContext.java	                        (rev 0)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/context/MockFlashContext.java	2010-06-01 17:22:35 UTC (rev 12920)
@@ -0,0 +1,69 @@
+/*
+ * 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.context;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.enterprise.inject.Typed;
+
+/**
+ * A mock {@link FlashContext} that can be injected into tests.
+ * 
+ * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
+ * 
+ */
+ at Typed(FlashContext.class)
+public class MockFlashContext implements FlashContext, Serializable
+{
+   private static final long serialVersionUID = 7502050909452181348L;
+   private String id = null;
+   private final Map<String, Object> map = new ConcurrentHashMap<String, Object>();
+
+   public Object get(final String key)
+   {
+      return map.get(key);
+   }
+
+   public String getId()
+   {
+      return id;
+   }
+
+   public void setId(final String id)
+   {
+      this.id = id;
+   }
+
+   public boolean isEmpty()
+   {
+      return map.isEmpty();
+   }
+
+   public void put(final String key, final Object value)
+   {
+      map.put(key, value);
+   }
+
+}

Modified: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/status/MessagesAdapterTest.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/status/MessagesAdapterTest.java	2010-06-01 17:09:56 UTC (rev 12919)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/status/MessagesAdapterTest.java	2010-06-01 17:22:35 UTC (rev 12920)
@@ -32,10 +32,13 @@
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.seam.faces.MockLogger;
 import org.jboss.seam.faces.PhaseTestBase;
+import org.jboss.seam.faces.context.MockFlashContext;
 import org.jboss.seam.faces.event.PhaseEventBridge;
 import org.jboss.seam.international.status.Bundles;
 import org.jboss.seam.international.status.MessageFactory;
 import org.jboss.seam.international.status.Messages;
+import org.jboss.seam.international.status.builder.BundleTemplateMessageImpl;
+import org.jboss.seam.international.status.builder.TemplateMessageImpl;
 import org.jboss.shrinkwrap.api.ArchivePaths;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
@@ -55,7 +58,7 @@
    @Deployment
    public static JavaArchive createTestArchive()
    {
-      return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MessagesAdapter.class, Messages.class, MessageFactory.class, Bundles.class, PhaseEventBridge.class, MockLogger.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+      return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MessagesAdapter.class, Messages.class, MockFlashContext.class, MessageFactory.class, TemplateMessageImpl.class, BundleTemplateMessageImpl.class, Bundles.class, PhaseEventBridge.class, MockLogger.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
    }
 
    @Inject



More information about the seam-commits mailing list