Seam SVN: r12874 - in modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces: status and 1 other directory.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-05-27 13:56:16 -0400 (Thu, 27 May 2010)
New Revision: 12874
Modified:
modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/PhaseTestBase.java
modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/status/MessagesAdapterTest.java
Log:
Updated messages API and tests
Modified: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/PhaseTestBase.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/PhaseTestBase.java 2010-05-27 17:54:30 UTC (rev 12873)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/PhaseTestBase.java 2010-05-27 17:56:16 UTC (rev 12874)
@@ -24,13 +24,14 @@
import java.util.ArrayList;
import java.util.List;
+import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.inject.Inject;
import org.jboss.seam.faces.event.PhaseEventBridge;
-import org.jboss.test.faces.mock.context.MockFacesContext;
import org.jboss.test.faces.mock.lifecycle.MockLifecycle;
+import org.jboss.test.faces.stub.faces.StubFacesContext;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
@@ -41,7 +42,7 @@
@Inject
PhaseEventBridge phaseEventBridge;
- protected MockFacesContext facesContext = new MockFacesContext();
+ protected FacesContext facesContext = new StubFacesContext();
protected final MockLifecycle lifecycle = new MockLifecycle();
static List<PhaseId> ALL_PHASES = new ArrayList<PhaseId>()
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-05-27 17:54:30 UTC (rev 12873)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/status/MessagesAdapterTest.java 2010-05-27 17:56:16 UTC (rev 12874)
@@ -22,6 +22,7 @@
package org.jboss.seam.faces.status;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import javax.faces.event.PhaseId;
@@ -39,7 +40,7 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
-import org.jboss.test.faces.mock.context.MockFacesContext;
+import org.jboss.test.faces.stub.faces.StubFacesContext;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -60,35 +61,38 @@
@Inject
Messages messages;
+ String text = "Hey! This is a message";
+
@Before
public void before()
{
- facesContext = new MockFacesContext();
- facesContext.getControl().resetToNice();
- facesContext.getControl().replay();
+ facesContext = new StubFacesContext();
}
@Test
public void testMessagesAreTransferredBeforeRenderResponse()
{
- messages.add(messages.info("Hey! This is a message"));
+ messages.add(messages.info(text));
assertEquals(1, messages.getAll().size());
fireBeforePhase(PhaseId.RENDER_RESPONSE);
assertTrue(messages.getAll().isEmpty());
- // assertNotNull(facesContext.getMessages());
+ assertNotNull(facesContext.getMessages());
+ assertEquals(text, facesContext.getMessages().next().getSummary());
+
}
@Test
public void testMessageTargetsTransferredToFacesMessageComponentId()
{
- messages.add(messages.info("Hey! This is a message").targets("component"));
+ messages.add(messages.info(text).targets("component"));
assertEquals(1, messages.getAll().size());
fireBeforePhase(PhaseId.RENDER_RESPONSE);
assertTrue(messages.getAll().isEmpty());
- // assertNotNull(facesContext.getMessages("component"));
+ assertNotNull(facesContext.getMessages("component"));
+ assertEquals(text, facesContext.getMessages("component").next().getSummary());
}
}
13 years, 11 months
Seam SVN: r12873 - in modules/international/trunk: api/src/main/java/org/jboss/seam/international/status/builder and 7 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-05-27 13:54:30 -0400 (Thu, 27 May 2010)
New Revision: 12873
Added:
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleTemplateMessage.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/MessagesTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder/
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder/BundleTemplateMessageTest.java
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/status/
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/status/TestBundle.properties
Removed:
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/status/builder/
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/Messages.java
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/Interpolator.java
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/TemplateMessage.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/status/MessageImpl.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder/TemplateMessageTest.java
Log:
Repackaged, updated Messages API to be more user-friendly.
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-27 15:56:14 UTC (rev 12872)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -26,12 +26,12 @@
import javax.inject.Inject;
import org.jboss.seam.international.status.builder.BundleKey;
-import org.jboss.seam.international.status.builder.BundleMessage;
+import org.jboss.seam.international.status.builder.BundleTemplateMessage;
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}.
+ * message bundles. See {@link TemplateMessage} or {@link BundleTemplateMessage}.
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
@@ -46,44 +46,44 @@
/*
* Bundle Factory Methods
*/
- public BundleMessage info(final BundleKey message)
+ public BundleTemplateMessage info(final BundleKey message)
{
- return new BundleMessage(bundles, Level.INFO).text(message);
+ return new BundleTemplateMessage(bundles, Level.INFO).text(message);
}
- public BundleMessage info(final BundleKey message, final Object... params)
+ public BundleTemplateMessage info(final BundleKey message, final Object... params)
{
- return new BundleMessage(bundles, Level.INFO).text(message).textParams(params);
+ return new BundleTemplateMessage(bundles, Level.INFO).text(message).textParams(params);
}
- public BundleMessage warn(final BundleKey message)
+ public BundleTemplateMessage warn(final BundleKey message)
{
- return new BundleMessage(bundles, Level.WARN).text(message);
+ return new BundleTemplateMessage(bundles, Level.WARN).text(message);
}
- public BundleMessage warn(final BundleKey message, final Object... params)
+ public BundleTemplateMessage warn(final BundleKey message, final Object... params)
{
- return new BundleMessage(bundles, Level.WARN).text(message).textParams(params);
+ return new BundleTemplateMessage(bundles, Level.WARN).text(message).textParams(params);
}
- public BundleMessage error(final BundleKey message)
+ public BundleTemplateMessage error(final BundleKey message)
{
- return new BundleMessage(bundles, Level.ERROR).text(message);
+ return new BundleTemplateMessage(bundles, Level.ERROR).text(message);
}
- public BundleMessage error(final BundleKey message, final Object... params)
+ public BundleTemplateMessage error(final BundleKey message, final Object... params)
{
- return new BundleMessage(bundles, Level.ERROR).text(message).textParams(params);
+ return new BundleTemplateMessage(bundles, Level.ERROR).text(message).textParams(params);
}
- public BundleMessage fatal(final BundleKey message)
+ public BundleTemplateMessage fatal(final BundleKey message)
{
- return new BundleMessage(bundles, Level.FATAL).text(message);
+ return new BundleTemplateMessage(bundles, Level.FATAL).text(message);
}
- public BundleMessage fatal(final BundleKey message, final Object... params)
+ public BundleTemplateMessage fatal(final BundleKey message, final Object... params)
{
- return new BundleMessage(bundles, Level.FATAL).text(message).textParams(params);
+ return new BundleTemplateMessage(bundles, Level.FATAL).text(message).textParams(params);
}
/*
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-27 15:56:14 UTC (rev 12872)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -31,7 +31,7 @@
import javax.inject.Inject;
import org.jboss.seam.international.status.builder.BundleKey;
-import org.jboss.seam.international.status.builder.BundleMessage;
+import org.jboss.seam.international.status.builder.BundleTemplateMessage;
import org.jboss.seam.international.status.builder.TemplateMessage;
/**
@@ -47,6 +47,7 @@
private static final long serialVersionUID = -2908193057765795662L;
private final Set<Message> messages = Collections.synchronizedSet(new HashSet<Message>());
+ private final Set<MessageBuilder> builders = Collections.synchronizedSet(new HashSet<MessageBuilder>());
@Inject
private MessageFactory factory;
@@ -61,11 +62,24 @@
/**
* Retrieve all pending {@link Messages} in their final state - as they will
- * be displayed to the user.
+ * be displayed to the user. Calling this method will call
+ * {@link MessageBuilder#build()} on any queued {@link MessageBuilder}
+ * instances, adding the resulting {@link Message} objects to the message
+ * cache, and clearing the builders from the builder cache.
*/
public Set<Message> getAll()
{
Set<Message> result = new HashSet<Message>();
+
+ synchronized (builders)
+ {
+ for (MessageBuilder builder : builders)
+ {
+ messages.add(builder.build());
+ }
+ builders.clear();
+ }
+
synchronized (messages)
{
result.addAll(messages);
@@ -86,55 +100,66 @@
}
/**
- * Add a {@link Message} object, produced by the provided
- * {@link MessageBuilder}, to the pending message cache.
+ * Add a {@link MessageBuilder} object to the pending builder cache. A
+ * subsequent call to {@link Messages#getAll()} will trigger,
+ * {@link MessageBuilder#build()} to be called called on each builder added
+ * in this way.
*/
public void add(final MessageBuilder builder)
{
- messages.add(builder.build());
+ builders.add(builder);
}
+ /**
+ * Convenience add & pass-through for factory methods.
+ */
+ private <T extends MessageBuilder> T enqueueBuilder(final T builder)
+ {
+ add(builder);
+ return builder;
+ }
+
/*
* Bundle Factory Methods
*/
- public BundleMessage info(final BundleKey message)
+ public BundleTemplateMessage info(final BundleKey message)
{
- return factory.info(message);
+ return enqueueBuilder(factory.info(message));
}
- public BundleMessage info(final BundleKey message, final Object... params)
+ public BundleTemplateMessage info(final BundleKey message, final Object... params)
{
- return factory.info(message, params);
+ return enqueueBuilder(factory.info(message, params));
}
- public BundleMessage warn(final BundleKey message)
+ public BundleTemplateMessage warn(final BundleKey message)
{
- return factory.warn(message);
+ return enqueueBuilder(factory.warn(message));
}
- public BundleMessage warn(final BundleKey message, final Object... params)
+ public BundleTemplateMessage warn(final BundleKey message, final Object... params)
{
- return factory.warn(message, params);
+ return enqueueBuilder(factory.warn(message, params));
}
- public BundleMessage error(final BundleKey message)
+ public BundleTemplateMessage error(final BundleKey message)
{
- return factory.error(message);
+ return enqueueBuilder(factory.error(message));
}
- public BundleMessage error(final BundleKey message, final Object... params)
+ public BundleTemplateMessage error(final BundleKey message, final Object... params)
{
- return factory.error(message, params);
+ return enqueueBuilder(factory.error(message, params));
}
- public BundleMessage fatal(final BundleKey message)
+ public BundleTemplateMessage fatal(final BundleKey message)
{
- return factory.fatal(message);
+ return enqueueBuilder(factory.fatal(message));
}
- public BundleMessage fatal(final BundleKey message, final Object... params)
+ public BundleTemplateMessage fatal(final BundleKey message, final Object... params)
{
- return factory.fatal(message, params);
+ return enqueueBuilder(factory.fatal(message, params));
}
/*
@@ -142,42 +167,42 @@
*/
public TemplateMessage info(final String message)
{
- return factory.info(message);
+ return enqueueBuilder(factory.info(message));
}
public TemplateMessage info(final String message, final Object... params)
{
- return factory.info(message, params);
+ return enqueueBuilder(factory.info(message, params));
}
public TemplateMessage warn(final String message)
{
- return factory.warn(message);
+ return enqueueBuilder(factory.warn(message));
}
public TemplateMessage warn(final String message, final Object... params)
{
- return factory.warn(message, params);
+ return enqueueBuilder(factory.warn(message, params));
}
public TemplateMessage error(final String message)
{
- return factory.error(message);
+ return enqueueBuilder(factory.error(message));
}
public TemplateMessage error(final String message, final Object... params)
{
- return factory.error(message, params);
+ return enqueueBuilder(factory.error(message, params));
}
public TemplateMessage fatal(final String message)
{
- return factory.fatal(message);
+ return enqueueBuilder(factory.fatal(message));
}
public TemplateMessage fatal(final String message, final Object... params)
{
- return factory.fatal(message, params);
+ return enqueueBuilder(factory.fatal(message, params));
}
}
Deleted: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java 2010-05-27 15:56:14 UTC (rev 12872)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -1,134 +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.international.status.builder;
-
-import org.jboss.seam.international.status.Bundles;
-import org.jboss.seam.international.status.Level;
-import org.jboss.seam.international.status.Message;
-import org.jboss.seam.international.status.MessageBuilder;
-
-/**
- * This {@link MessageBuilder} implementation creates {@link Message} objects by
- * loading resource bundle keys as templates with values supplied as parameters.
- * <p>
- * <b>For example:</b>
- * <p>
- * Given the following {@link Message} m
- *
- * <pre>
- * Message m = {@link MessageFactory}.info(new {@link BundleKey}("messageBundle", "keyName"), 5, "green")
- * .defaultText("This is default text.").build();
- * </pre>
- *
- * And the corresponding messageBundle.properties file:<br>
- *
- * <pre>
- * keyName=There are {0} cars, and they are all {1}.
- * </pre>
- *
- * A subsequent call to <code>m.getText()</code> will return:<br/>
- *
- * <pre>
- * "There are 5 cars, and they are all green."
- * </pre>
- *
- * <b>Note:</b> If a bundle/key pair cannot be resolved, the default template
- * will be used instead. If there is no default template, a String
- * representation of the {@link BundleKey} will be displayed instead.
- * <p>
- *
- * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
- *
- */
-public class BundleMessage implements MessageBuilder
-{
- private final TemplateMessage template;
- private String textDefault;
- private BundleKey textKey;
-
- private final Bundles bundles;
-
- public BundleMessage(final Bundles bundles, final Level level)
- {
- this.bundles = bundles;
- this.template = new TemplateMessage(level);
- }
-
- /**
- * Produce a {@link Message} object as represented by the current state of
- * <code>this</code> builder.
- */
- public Message build()
- {
- String text;
- try
- {
- text = bundles.get(textKey.getBundle()).getString(textKey.getKey());
- }
- catch (Exception e)
- {
- text = textDefault;
- }
-
- if ((text == null) || "".equals(text))
- {
- text = textKey.toString();
- }
-
- template.text(text);
- return template.build();
- }
-
- /*
- * Setters
- */
-
- public BundleMessage text(final BundleKey text)
- {
- this.textKey = text;
- return this;
- }
-
- public BundleMessage textDefault(final String text)
- {
- this.textDefault = text;
- return this;
- }
-
- public BundleMessage textParams(final Object... textParams)
- {
- this.template.textParams(textParams);
- return this;
- }
-
- public BundleMessage targets(final String targets)
- {
- this.template.targets(targets);
- return this;
- }
-
- public BundleMessage setLevel(final Level level)
- {
- this.template.level(level);
- return this;
- }
-}
Copied: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleTemplateMessage.java (from rev 12817, modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java)
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleTemplateMessage.java (rev 0)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleTemplateMessage.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -0,0 +1,179 @@
+/*
+ * 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.international.status.builder;
+
+import org.jboss.seam.international.status.Bundles;
+import org.jboss.seam.international.status.Level;
+import org.jboss.seam.international.status.Message;
+import org.jboss.seam.international.status.MessageBuilder;
+
+/**
+ * This {@link MessageBuilder} implementation creates {@link Message} objects by
+ * loading resource bundle keys as templates with values supplied as parameters.
+ * <p>
+ * <b>For example:</b>
+ * <p>
+ * Given the following {@link Message} m
+ *
+ * <pre>
+ * Message m = {@link MessageFactory}.info(new {@link BundleKey}("messageBundle", "keyName"), 5, "green")
+ * .defaultText("This is default text.").build();
+ * </pre>
+ *
+ * And the corresponding messageBundle.properties file:<br>
+ *
+ * <pre>
+ * keyName=There are {0} cars, and they are all {1}.
+ * </pre>
+ *
+ * A subsequent call to <code>m.getText()</code> will return:<br/>
+ *
+ * <pre>
+ * "There are 5 cars, and they are all green."
+ * </pre>
+ *
+ * <b>Note:</b> If a bundle/key pair cannot be resolved, the default template
+ * will be used instead. If there is no default template, a String
+ * representation of the {@link BundleKey} will be displayed instead.
+ * <p>
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class BundleTemplateMessage implements MessageBuilder
+{
+ private final TemplateMessage template;
+ private String textDefault;
+ private BundleKey textKey;
+
+ private final Bundles bundles;
+
+ public BundleTemplateMessage(final Bundles bundles, final Level level)
+ {
+ this.bundles = bundles;
+ this.template = new TemplateMessage(level);
+ }
+
+ /**
+ * Produce a {@link Message} object as represented by the current state of
+ * <code>this</code> builder.
+ */
+ public Message build()
+ {
+ String text;
+ try
+ {
+ text = bundles.get(textKey.getBundle()).getString(textKey.getKey());
+ }
+ catch (Exception e)
+ {
+ text = textDefault;
+ }
+
+ if ((text == null) || "".equals(text))
+ {
+ text = textKey.toString();
+ }
+
+ template.text(text);
+ return template.build();
+ }
+
+ /*
+ * Setters
+ */
+
+ public BundleTemplateMessage text(final BundleKey text)
+ {
+ this.textKey = text;
+ return this;
+ }
+
+ public BundleTemplateMessage textDefault(final String text)
+ {
+ this.textDefault = text;
+ return this;
+ }
+
+ public BundleTemplateMessage textParams(final Object... textParams)
+ {
+ this.template.textParams(textParams);
+ return this;
+ }
+
+ public BundleTemplateMessage targets(final String targets)
+ {
+ this.template.targets(targets);
+ return this;
+ }
+
+ public BundleTemplateMessage setLevel(final Level level)
+ {
+ this.template.level(level);
+ return this;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((template == null) ? 0 : template.hashCode());
+ result = prime * result + ((textDefault == null) ? 0 : textDefault.hashCode());
+ result = prime * result + ((textKey == null) ? 0 : textKey.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ BundleTemplateMessage other = (BundleTemplateMessage) obj;
+ if (template == null)
+ {
+ if (other.template != null)
+ return false;
+ }
+ else if (!template.equals(other.template))
+ return false;
+ if (textDefault == null)
+ {
+ if (other.textDefault != null)
+ return false;
+ }
+ else if (!textDefault.equals(other.textDefault))
+ return false;
+ if (textKey == null)
+ {
+ if (other.textKey != null)
+ return false;
+ }
+ else if (!textKey.equals(other.textKey))
+ return false;
+ return true;
+ }
+}
Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/Interpolator.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/Interpolator.java 2010-05-27 15:56:14 UTC (rev 12872)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/Interpolator.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -48,7 +48,7 @@
public String populate(final String template, final Object... params)
{
StringBuffer result = new StringBuffer();
- if (template != null)
+ if ((template != null) && (params != null))
{
Matcher matcher = templatePattern.matcher(template);
while (matcher.find())
@@ -67,6 +67,10 @@
}
matcher.appendTail(result);
}
+ else if (template != null)
+ {
+ result = new StringBuffer(template);
+ }
return result.toString();
}
}
Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/TemplateMessage.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/TemplateMessage.java 2010-05-27 15:56:14 UTC (rev 12872)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/TemplateMessage.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -21,6 +21,8 @@
*/
package org.jboss.seam.international.status.builder;
+import java.util.Arrays;
+
import org.jboss.seam.international.status.Level;
import org.jboss.seam.international.status.Message;
import org.jboss.seam.international.status.MessageBuilder;
@@ -47,7 +49,7 @@
{
private static final String MESSAGE_IMPL_CLASS = "org.jboss.seam.international.status.MessageImpl";
- private final Interpolator templater = new Interpolator();
+ private final Interpolator interpolator = new Interpolator();
private String summary;
private Object[] summaryParams;
@@ -73,7 +75,7 @@
MutableMessage message = (MutableMessage) type.newInstance();
message.setLevel(level);
- message.setText(templater.populate(summary, summaryParams));
+ message.setText(interpolator.populate(summary, summaryParams));
message.setTargets(targets);
return message;
@@ -110,4 +112,72 @@
this.level = level;
return this;
}
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((level == null) ? 0 : level.hashCode());
+ result = prime * result + ((summary == null) ? 0 : summary.hashCode());
+ result = prime * result + Arrays.hashCode(summaryParams);
+ result = prime * result + ((targets == null) ? 0 : targets.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+ TemplateMessage other = (TemplateMessage) obj;
+ if (level == null)
+ {
+ if (other.level != null)
+ {
+ return false;
+ }
+ }
+ else if (!level.equals(other.level))
+ {
+ return false;
+ }
+ if (summary == null)
+ {
+ if (other.summary != null)
+ {
+ return false;
+ }
+ }
+ else if (!summary.equals(other.summary))
+ {
+ return false;
+ }
+ if (!Arrays.equals(summaryParams, other.summaryParams))
+ {
+ return false;
+ }
+ if (targets == null)
+ {
+ if (other.targets != null)
+ {
+ return false;
+ }
+ }
+ else if (!targets.equals(other.targets))
+ {
+ return false;
+ }
+ return true;
+ }
}
Modified: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/status/MessageImpl.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/status/MessageImpl.java 2010-05-27 15:56:14 UTC (rev 12872)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/status/MessageImpl.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -32,7 +32,6 @@
private static final long serialVersionUID = -1812292372048679525L;
private String summary;
- private String details;
private String targets;
private Level level;
@@ -41,10 +40,9 @@
{
final int prime = 31;
int result = 1;
- result = prime * result + ((details == null) ? 0 : details.hashCode());
- result = prime * result + ((targets == null) ? 0 : targets.hashCode());
result = prime * result + ((level == null) ? 0 : level.hashCode());
result = prime * result + ((summary == null) ? 0 : summary.hashCode());
+ result = prime * result + ((targets == null) ? 0 : targets.hashCode());
return result;
}
@@ -64,50 +62,39 @@
return false;
}
MessageImpl other = (MessageImpl) obj;
- if (details == null)
+ if (level == null)
{
- if (other.details != null)
+ if (other.level != null)
{
return false;
}
}
- else if (!details.equals(other.details))
+ else if (!level.equals(other.level))
{
return false;
}
- if (targets == null)
+ if (summary == null)
{
- if (other.targets != null)
+ if (other.summary != null)
{
return false;
}
}
- else if (!targets.equals(other.targets))
+ else if (!summary.equals(other.summary))
{
return false;
}
- if (level == null)
+ if (targets == null)
{
- if (other.level != null)
+ if (other.targets != null)
{
return false;
}
}
- else if (!level.equals(other.level))
+ else if (!targets.equals(other.targets))
{
return false;
}
- if (summary == null)
- {
- if (other.summary != null)
- {
- return false;
- }
- }
- else if (!summary.equals(other.summary))
- {
- return false;
- }
return true;
}
@@ -119,11 +106,6 @@
return summary;
}
- public String getDetails()
- {
- return details;
- }
-
public String getTargets()
{
return targets;
@@ -139,11 +121,6 @@
this.summary = summary;
}
- public void setDetails(final String details)
- {
- this.details = details;
- }
-
public void setTargets(final String targets)
{
this.targets = targets;
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/MessagesTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/MessagesTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/MessagesTest.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -0,0 +1,120 @@
+/*
+ * 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.international.test.status;
+
+import static org.junit.Assert.assertEquals;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.status.Bundles;
+import org.jboss.seam.international.status.Level;
+import org.jboss.seam.international.status.MessageFactory;
+import org.jboss.seam.international.status.MessageImpl;
+import org.jboss.seam.international.status.Messages;
+import org.jboss.seam.international.status.MutableMessage;
+import org.jboss.seam.international.status.builder.BundleKey;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class MessagesTest
+{
+ private static final String BUNDLE_PATH = "org.jboss.seam.international.test.status.TestBundle";
+
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(Messages.class, MessageFactory.class, Bundles.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ Messages messages;
+
+ @Before
+ public void before()
+ {
+ messages.clear();
+ }
+
+ @Test
+ public void testMessageBuildersAreAddedWhenUsingFactoryMethods()
+ {
+ messages.info("This is a message");
+ assertEquals(1, messages.getAll().size());
+ assertEquals(Level.INFO, messages.getAll().iterator().next().getLevel());
+ }
+
+ @Test
+ public void testMessageBuildersAreAddedWhenUsingFactoryMethodsBundle()
+ {
+ messages.error(new BundleKey(BUNDLE_PATH, "key1"));
+ assertEquals(1, messages.getAll().size());
+ assertEquals(Level.ERROR, messages.getAll().iterator().next().getLevel());
+ }
+
+ @Test
+ public void testDuplicateMessageBuildersAreIgnored()
+ {
+ messages.warn("This is a message");
+ messages.warn("This is a message");
+ messages.warn("This is a message");
+ assertEquals(1, messages.getAll().size());
+
+ assertEquals(Level.WARN, messages.getAll().iterator().next().getLevel());
+ }
+
+ @Test
+ public void testDuplicateMessageBuildersResultMessagesAreIgnored()
+ {
+ messages.fatal("This is a message");
+ messages.fatal(new BundleKey(BUNDLE_PATH, "key2"));
+ assertEquals(1, messages.getAll().size());
+
+ assertEquals(Level.FATAL, messages.getAll().iterator().next().getLevel());
+ }
+
+ @Test
+ public void testDuplicateMessagesAreIgnored() throws Exception
+ {
+ MutableMessage message = new MessageImpl();
+ String text = "This is a message!";
+ message.setText(text);
+ messages.add(message);
+
+ message = new MessageImpl();
+ message.setText(text);
+ messages.add(message);
+
+ assertEquals(1, messages.getAll().size());
+ }
+}
Copied: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder (from rev 12817, modules/international/trunk/impl/src/test/java/org/jboss/seam/international/status/builder)
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder/BundleTemplateMessageTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder/BundleTemplateMessageTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder/BundleTemplateMessageTest.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -0,0 +1,88 @@
+/*
+ * 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.international.test.status.builder;
+
+import static org.junit.Assert.assertEquals;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.status.Bundles;
+import org.jboss.seam.international.status.MessageFactory;
+import org.jboss.seam.international.status.builder.TemplateMessage;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class BundleTemplateMessageTest
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MessageFactory.class, Bundles.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ MessageFactory factory;
+
+ @Test
+ public void testParameterizedTemplate() throws Exception
+ {
+ String expected = "There are 5 cars, and they are all green; green is the best color.";
+ TemplateMessage builder = factory.info("There are {0} cars, and they are all {1}; {1} is the best color.", 5, "green");
+ assertEquals(expected, builder.build().getText());
+ }
+
+ @Test
+ public void testParameterizedTemplateInsertsParamNumbersIfNotEnoughParamValues() throws Exception
+ {
+ String expected = "There are 5 cars, and they are all {1}; {1} is the best color.";
+ TemplateMessage builder = factory.warn("There are {0} cars, and they are all {1}; {1} is the best color.", 5);
+ assertEquals(expected, builder.build().getText());
+ }
+
+ @Test
+ public void testPlainTextTemplate() throws Exception
+ {
+ String expected = "There are 5 cars, and they are all green; green is the best color.";
+ TemplateMessage builder = factory.error("There are 5 cars, and they are all green; green is the best color.");
+ assertEquals(expected, builder.build().getText());
+ }
+
+ @Test
+ public void testPlainTextTemplateWithParamsIsUnmodified() throws Exception
+ {
+ String expected = "There are 5 cars, and they are all green; green is the best color.";
+ TemplateMessage builder = factory.fatal("There are 5 cars, and they are all green; green is the best color.", "blue", "red", 6);
+ assertEquals(expected, builder.build().getText());
+ }
+}
Modified: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder/TemplateMessageTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/status/builder/TemplateMessageTest.java 2010-05-26 18:44:38 UTC (rev 12817)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/status/builder/TemplateMessageTest.java 2010-05-27 17:54:30 UTC (rev 12873)
@@ -19,7 +19,7 @@
* 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.international.status.builder;
+package org.jboss.seam.international.test.status.builder;
import static org.junit.Assert.assertEquals;
@@ -29,6 +29,7 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.international.status.Bundles;
import org.jboss.seam.international.status.MessageFactory;
+import org.jboss.seam.international.status.builder.TemplateMessage;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.ShrinkWrap;
Added: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/status/TestBundle.properties
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/status/TestBundle.properties (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/status/TestBundle.properties 2010-05-27 17:54:30 UTC (rev 12873)
@@ -0,0 +1,2 @@
+key1=This is a {0} message.
+key2=This is a message
\ No newline at end of file
13 years, 11 months
Seam SVN: r12872 - modules/drools/trunk/docs.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-27 11:56:14 -0400 (Thu, 27 May 2010)
New Revision: 12872
Modified:
modules/drools/trunk/docs/pom.xml
Log:
don't attach docs, or do the weird copy hack for Gavin
Modified: modules/drools/trunk/docs/pom.xml
===================================================================
--- modules/drools/trunk/docs/pom.xml 2010-05-27 14:58:13 UTC (rev 12871)
+++ modules/drools/trunk/docs/pom.xml 2010-05-27 15:56:14 UTC (rev 12872)
@@ -12,21 +12,6 @@
<version>3.0.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>Seam Drools Reference Guide</name>
-
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- </pluginRepository>
- </pluginRepositories>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- </repositories>
<properties>
<pdf.name>drools-reference.pdf</pdf.name>
@@ -47,43 +32,6 @@
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
</plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
- <copy file="${basedir}/target/docbook/publish/en-US/pdf/${pdf.name}" todir="${basedir}" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-zip</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>${project.build.outputDirectory}/${project.artifactId}-${project.version}.war</file>
- <type>war</type>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
13 years, 11 months
Seam SVN: r12871 - modules/xml/trunk/examples/princess-rescue.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-27 10:58:13 -0400 (Thu, 27 May 2010)
New Revision: 12871
Modified:
modules/xml/trunk/examples/princess-rescue/pom.xml
Log:
ws
Modified: modules/xml/trunk/examples/princess-rescue/pom.xml
===================================================================
--- modules/xml/trunk/examples/princess-rescue/pom.xml 2010-05-27 14:57:17 UTC (rev 12870)
+++ modules/xml/trunk/examples/princess-rescue/pom.xml 2010-05-27 14:58:13 UTC (rev 12871)
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<parent>
<artifactId>seam-xml-config-parent</artifactId>
<groupId>org.jboss.seam.xml</groupId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
-
+
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.xml</groupId>
<artifactId>princess-rescue</artifactId>
@@ -17,8 +18,10 @@
<properties>
<!--
- Explicitly declaring the source encoding eliminates the following message:
- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+ Explicitly declaring the source encoding eliminates the
+ following message: [WARNING] Using platform encoding (UTF-8
+ actually) to copy filtered resources, i.e. build is platform
+ dependent!
-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- The version of Weld extensions in use -->
@@ -40,7 +43,7 @@
<dependencies>
- <dependency>
+ <dependency>
<groupId>org.jboss.seam.xml</groupId>
<artifactId>seam-xml-config</artifactId>
<version>3.0.0-SNAPSHOT</version>
@@ -68,7 +71,8 @@
<!-- Optional, but pretty useful. -->
<!--
- <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency>
+ <dependency> <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId> </dependency>
-->
<dependency>
@@ -88,7 +92,7 @@
<version>2.0.1-FCS</version>
<scope>runtime</scope>
</dependency>
-
+
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
@@ -130,16 +134,23 @@
<configuration>
<!-- Delete this block to have Jetty run default port (8080) -->
<connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <connector
+ implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>9090</port>
</connector>
</connectors>
<!-- force friendly name instead of artifact name + version -->
<contextPath>${project.build.finalName}</contextPath>
- <!-- Where the BeanManager is constructed. This is where you'll declare datasources. -->
+ <!--
+ Where the BeanManager is constructed. This is where
+ you'll declare datasources.
+ -->
<jettyEnvXml>${basedir}/src/test/resources/jetty-env.xml</jettyEnvXml>
<!-- This parameter will auto-deploy modified classes. -->
- <!-- You can save changes in a file or class and refresh your browser to view the changes. -->
+ <!--
+ You can save changes in a file or class and refresh
+ your browser to view the changes.
+ -->
<scanIntervalSeconds>3</scanIntervalSeconds>
</configuration>
</plugin>
@@ -154,8 +165,10 @@
<!-- Embedded port -->
<port>9090</port>
<!--
- The default authentication credentials for remote deployment are username "admin" with no password To
- override credentials, define a server in settings.xml and activate it using the <server> element
+ The default authentication credentials for remote
+ deployment are username "admin" with no password To
+ override credentials, define a server in settings.xml
+ and activate it using the <server> element
-->
<url>http://localhost:8080/manager</url>
</configuration>
13 years, 11 months
Seam SVN: r12870 - modules/xml/trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-27 10:57:17 -0400 (Thu, 27 May 2010)
New Revision: 12870
Modified:
modules/xml/trunk/pom.xml
Log:
ws
Modified: modules/xml/trunk/pom.xml
===================================================================
--- modules/xml/trunk/pom.xml 2010-05-27 14:56:30 UTC (rev 12869)
+++ modules/xml/trunk/pom.xml 2010-05-27 14:57:17 UTC (rev 12870)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -27,11 +28,11 @@
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
- <finalName>seam-xml-config-${pom.version}</finalName>
+ <finalName>seam-xml-config-${pom.version}</finalName>
</configuration>
</plugin>
</plugins>
- </build>
+ </build>
<dependencyManagement>
<dependencies>
@@ -60,23 +61,23 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>1.0.1-Final</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-se</artifactId>
- <version>1.0.1-Final</version>
- </dependency>
- <dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-se</artifactId>
+ <version>1.0.1-Final</version>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.10</version>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.10</version>
- <classifier>jdk15</classifier>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.10</version>
+ <classifier>jdk15</classifier>
+ </dependency>
</dependencies>
</dependencyManagement>
<scm>
13 years, 11 months
Seam SVN: r12869 - modules/xml/trunk/impl.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-27 10:56:30 -0400 (Thu, 27 May 2010)
New Revision: 12869
Modified:
modules/xml/trunk/impl/pom.xml
Log:
ws
Modified: modules/xml/trunk/impl/pom.xml
===================================================================
--- modules/xml/trunk/impl/pom.xml 2010-05-27 14:02:22 UTC (rev 12868)
+++ modules/xml/trunk/impl/pom.xml 2010-05-27 14:56:30 UTC (rev 12869)
@@ -1,90 +1,91 @@
<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>seam-xml-config-parent</artifactId>
- <groupId>org.jboss.seam.xml</groupId>
- <version>3.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
+ <parent>
+ <artifactId>seam-xml-config-parent</artifactId>
+ <groupId>org.jboss.seam.xml</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
- <groupId>org.jboss.seam.xml</groupId>
- <artifactId>seam-xml-config</artifactId>
- <packaging>jar</packaging>
- <name>Seam XML Config Module</name>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <packaging>jar</packaging>
+ <name>Seam XML Config Module</name>
- <repositories>
- <repository>
- <id>oss.sonatype.org/jboss-snapshots</id>
- <name>JBoss (Nexus) Snapshots Repository</name>
- <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </repository>
- </repositories>
+ <repositories>
+ <repository>
+ <id>oss.sonatype.org/jboss-snapshots</id>
+ <name>JBoss (Nexus) Snapshots Repository</name>
+ <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
- <dependencies>
- <dependency>
- <groupId>javax.enterprise</groupId>
- <artifactId>cdi-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-core</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-se</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
+ <dependency>
<groupId>org.jboss.weld</groupId>
+ <artifactId>weld-se</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <scope>test</scope>
- <version>5.10</version>
- <classifier>jdk15</classifier>
- </dependency>
- </dependencies>
+ </dependency>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/xml/trunk/impl</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/xml/trunk/impl</developerConnection>
- <url>http://fisheye.jboss.org/browse/Seam/modules/xml/trunk/impl</url>
- </scm>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>5.10</version>
+ <classifier>jdk15</classifier>
+ </dependency>
+ </dependencies>
- <build>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/xml/trunk/impl</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/xml/trunk/impl</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Seam/modules/xml/trunk/impl</url>
+ </scm>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkMode>once</forkMode>
- <argLine>-Xmx512m</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>once</forkMode>
+ <argLine>-Xmx512m</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
13 years, 11 months
Seam SVN: r12868 - branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-05-27 10:02:22 -0400 (Thu, 27 May 2010)
New Revision: 12868
Modified:
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Dependencies.xml
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Migration.xml
Log:
JBPAPP-4089 added list of changed jars from seam 2.0 to Seam 2.2
Modified: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Dependencies.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Dependencies.xml 2010-05-27 09:27:23 UTC (rev 12867)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Dependencies.xml 2010-05-27 14:02:22 UTC (rev 12868)
@@ -1111,7 +1111,7 @@
<para>runtime</para>
</entry>
<entry align="center">
- <para>EAR</para>
+ <filename>EAR</filename>
</entry>
<entry>
<para></para>
@@ -1167,7 +1167,7 @@
<para>runtime</para>
</entry>
<entry align="center">
- <para>EAR</para>
+ <filename>EAR</filename>
</entry>
<entry>
<para></para>
@@ -1182,7 +1182,7 @@
<para>runtime</para>
</entry>
<entry align="center">
- <para>EAR</para>
+ <filename>EAR</filename>
</entry>
<entry>
<para></para>
Modified: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Migration.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Migration.xml 2010-05-27 09:27:23 UTC (rev 12867)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Migration.xml 2010-05-27 14:02:22 UTC (rev 12868)
@@ -196,7 +196,7 @@
</event>]]></programlisting>
</note>
<para>
- In Seam 2.1, security events use the <literal>org.jboss.seam.security></literal> prefix instead of <literal>org.jboss.seam</literal>. (For example, <literal>org.jboss.seam.security.notLoggedIn</literal>.)
+ In Seam 2.2, security events use the <literal>org.jboss.seam.security></literal> prefix instead of <literal>org.jboss.seam</literal>. (For example, <literal>org.jboss.seam.security.notLoggedIn</literal>.)
</para>
<note>
<para>
@@ -323,10 +323,325 @@
</section>
</section>
<section id="MigrationFrom20">
- <title>Migrating from Seam 2.0 to Seam 2.1 or 2.2</title>
+ <title>Migrating from Seam 2.0 to Seam 2.2</title>
<para>
This section describes the changes between Seam 2.0 and Seam 2.1 or 2.2. If you are trying to migrate from Seam 1.2.x, you will need to read the previous section, <xref linkend="MigrationFrom12"/>, before following any steps outlined in this section.
</para>
+
+ <section id="Migration20.JarChanges">
+ <title>Changes to dependency jar names</title>
+ <para>
+ The following table describes new jars in Seam distribution:
+ <table>
+ <title></title>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="4*"></colspec>
+ <colspec colnum="2" colwidth="2*"></colspec>
+ <thead>
+ <row>
+ <entry align="center">
+ <para>
+ Name
+ </para>
+ </entry>
+ <entry align="center">
+ <para>
+ Note
+ </para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para> <filename>drools-api.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Drools 5 API </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>drools-decisiontables.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Drools 5 decision rules features </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>drools-templates.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Drools 5 rule template features </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>mvel2.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Expression language dependency for Drools 5 </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>jboss-seam-excel.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> MS Excel integration module in Seam </para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para> <filename>jxl.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Dependency for MS Excel integration module in Seam </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>jboss-seam-resteasy.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Resteasy integration module in Seam </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>resteasy-atom-provider.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Dependency for Resteasy integration module in Seam </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>resteasy-jaxb-provider.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Dependency for Resteasy integration module in Seam </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>resteasy-jaxrs.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Dependency for Resteasy integration module in Seam </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>jaxrs-api.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Dependency for Resteasy integration module in Seam - JAXRS API </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>slf4j-api.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Logging bridge for log4j usued by Hibernate and other dependencies in Seam </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>slf4j-log4j12.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Logging bridge for log4j usued by Hibernate and other dependencies in Seam </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>openid4java.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> OpenID java API for integration in Security Seam module </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>openxri-syntax.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> OpenXRI parser, a dependency for OpenID integration</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>openxri-client.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> OpenXRI resolver, a dependency for OpenID integration </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>itext-rtf.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Dependency for extended export features into RTF by itext </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>darkx.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> New plugable Richfaces skin DarkX </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>glassx.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> New plugable Richfaces skin GlassX </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>laguna.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> New plugable Richfaces skin Laguna </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>htmlparser.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> HTML parser, dependency for OpenID features </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>testng-jdk50.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> TestNG framework </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>jcl-over-slf4j</filename> </para>
+ </entry>
+ <entry>
+ <para> Bridging legacy logging APIs, a dependency for Resteasy integration module </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>ehcache.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Alternative cache provider </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>FastInfoset.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Required by Resteasy integration module</para>
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <para>
+ The following table describes deleted jars from Seam distribution:
+ <table>
+ <title></title>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="4*"></colspec>
+ <colspec colnum="2" colwidth="2*"></colspec>
+ <thead>
+ <row>
+ <entry align="center">
+ <para>
+ Name
+ </para>
+ </entry>
+ <entry align="center">
+ <para>
+ Note
+ </para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para> <filename>hibernate3.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> hibernate is now divided into modules, there is hibernate-core.jar instead of hibernate3.jar </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>dom4j.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> dom4j is provided by JBoss AS </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>javasist.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Javasist is provided by JBoss AS </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>activation.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Activation is bundled with Java 6 so not required to be in distribution </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>testng.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> TestNG framework replaced by testng-jdk50.jar </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>commons-lang.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Commons Lang library is not needed any more </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para> <filename>mvel.jar</filename> </para>
+ </entry>
+ <entry>
+ <para> Mvel dependency was upgraded/replaced by Mvel2 </para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ </section>
+
<section id="Migration20.Changes">
<title>Changes to Components</title>
<formalpara id="Migration20.Changes.Testing">
@@ -501,21 +816,13 @@
<formalpara id="Migration20.Changes.Cache">
<title>Changes to Cache Support</title>
<para>
- Cache support in Seam has been rewritten to support JBoss Cache, JBoss POJO Cache, JBoss
-Cache 2 and EHCache. If you use JBoss AS 4.2.x, JBoss Cache 1.x will be used. If you use JBoss 5.x, then JBoss Cache 2 will be installed. Further information is available in <xref linkend="cache"/>.
+ Cache support in Seam has been rewritten to support JBoss Cache 3.2, JBoss Cache 2 and EHCache. Further information is available in <xref linkend="cache"/>.
</para>
</formalpara>
<para>
- The <literal><![CDATA[<s:cache />]]></literal> has not changed, but the <literal>pojoCache</literal> component can no longer be injected. Instead, configure JBoss POJO Cache as your cache provider in <filename>components.xml</filename>, like so:
+ The <literal><![CDATA[<s:cache />]]></literal> has not changed, but the <literal>pojoCache</literal> component can no longer be supported.
</para>
-<programlisting role="XML"><![CDATA[<cache:jboss-pojo-cache-provider />]]>
-</programlisting>
<para>
- Then, inject it:
- </para>
-<programlisting><![CDATA[@In CacheProvider<PojoCache> cacheProvider;]]>
-</programlisting>
- <para>
The <literal>CacheProvider</literal> provides a Map-like interface. The <literal>getDelegate()</literal> method can then be used to retrieve the underlying cache.
</para>
<formalpara>
13 years, 11 months
Seam SVN: r12867 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-27 05:27:23 -0400 (Thu, 27 May 2010)
New Revision: 12867
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
improve exceptions, make class non-abstract
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-27 08:45:53 UTC (rev 12866)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-27 09:27:23 UTC (rev 12867)
@@ -16,7 +16,7 @@
*
* @author Shane Bryzak
*/
-public abstract class AnnotatedBeanProperty<T extends Annotation>
+public class AnnotatedBeanProperty<T extends Annotation>
{
private Field propertyField;
private Method propertyGetter;
@@ -114,14 +114,17 @@
}
/**
- * This method must be provided by a concrete implementation of this class. It
- * may be used to scan for an annotation with one or more particular attribute
- * values.
+ * This method may be overridden by a subclass. It can be used to scan
+ * for an annotation with particular attribute values, or to allow a match
+ * based on more complex logic.
*
* @param annotation The potential match
* @return true if the specified annotation is a match
*/
- protected abstract boolean isMatch(T annotation);
+ protected boolean isMatch(T annotation)
+ {
+ return true;
+ }
/**
* This method sets the property value for a specified bean to the specified
@@ -228,25 +231,30 @@
private Object getFieldValue(Field field, Object obj)
{
+ field.setAccessible(true);
try
{
return field.get(obj);
}
- catch (Exception e)
+ catch (IllegalAccessException e)
{
- if (e instanceof RuntimeException)
- {
- throw (RuntimeException) e;
- }
- else
- {
- throw new IllegalArgumentException(
- String.format("Exception reading [%s] field from object [%s].",
- field.getName(), obj), e);
- }
- }
+ throw new RuntimeException(buildGetFieldValueErrorMessage(field, obj), e);
+ }
+ catch (NullPointerException ex)
+ {
+ NullPointerException ex2 = new NullPointerException(
+ buildGetFieldValueErrorMessage(field, obj));
+ ex2.initCause(ex.getCause());
+ throw ex2;
+ }
}
+ private String buildGetFieldValueErrorMessage(Field field, Object obj)
+ {
+ return String.format("Exception reading [%s] field from object [%s].",
+ field.getName(), obj);
+ }
+
private void setFieldValue(Field field, Object obj, Object value)
{
field.setAccessible(true);
@@ -254,21 +262,25 @@
{
field.set(obj, value);
}
- catch (Exception e)
+ catch (IllegalAccessException e)
{
- if (e instanceof RuntimeException)
- {
- throw (RuntimeException) e;
- }
- else
- {
- throw new IllegalArgumentException(
- String.format("Exception setting [%s] field on object [%s] to value [%s]",
- field.getName(), obj, value), e);
- }
- }
+ throw new RuntimeException(buildSetFieldValueErrorMessage(field, obj, value), e);
+ }
+ catch (NullPointerException ex)
+ {
+ NullPointerException ex2 = new NullPointerException(
+ buildSetFieldValueErrorMessage(field, obj, value));
+ ex2.initCause(ex.getCause());
+ throw ex2;
+ }
}
+ private String buildSetFieldValueErrorMessage(Field field, Object obj, Object value)
+ {
+ return String.format("Exception setting [%s] field on object [%s] to value [%s]",
+ field.getName(), obj, value);
+ }
+
private Object invokeMethod(Method method, Object obj, Object... args)
{
try
13 years, 11 months
Seam SVN: r12866 - branches/enterprise/JBPAPP_5_0_1_JBPAPP-4385/seam-gen/view/layout.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-05-27 04:45:53 -0400 (Thu, 27 May 2010)
New Revision: 12866
Modified:
branches/enterprise/JBPAPP_5_0_1_JBPAPP-4385/seam-gen/view/layout/template.xhtml
Log:
JBPAPP-4385 - back porting for one-off support patch
Modified: branches/enterprise/JBPAPP_5_0_1_JBPAPP-4385/seam-gen/view/layout/template.xhtml
===================================================================
--- branches/enterprise/JBPAPP_5_0_1_JBPAPP-4385/seam-gen/view/layout/template.xhtml 2010-05-27 07:52:25 UTC (rev 12865)
+++ branches/enterprise/JBPAPP_5_0_1_JBPAPP-4385/seam-gen/view/layout/template.xhtml 2010-05-27 08:45:53 UTC (rev 12866)
@@ -12,7 +12,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>@projectName@</title>
<link rel="shortcut icon" href="#{request.contextPath}/favicon.ico"/>
- <a:loadStyle src="resource:///stylesheet/theme.xcss"/>
+ <a:loadStyle src="/stylesheet/theme.xcss"/>
<a:loadStyle src="/stylesheet/theme.css"/>
<ui:insert name="head"/>
</head>
13 years, 11 months
Seam SVN: r12865 - branches/enterprise.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-05-27 03:52:25 -0400 (Thu, 27 May 2010)
New Revision: 12865
Added:
branches/enterprise/JBPAPP_5_0_1_JBPAPP-4385/
Removed:
branches/enterprise/JBPAPP_5_0_JBPAPP-4385/
Log:
Copied: branches/enterprise/JBPAPP_5_0_1_JBPAPP-4385 (from rev 12864, branches/enterprise/JBPAPP_5_0_JBPAPP-4385)
13 years, 11 months