Seam SVN: r9512 - in trunk/src/main/org/jboss/seam: core and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-11-05 21:03:32 -0500 (Wed, 05 Nov 2008)
New Revision: 9512
Modified:
trunk/src/main/org/jboss/seam/Component.java
trunk/src/main/org/jboss/seam/core/Events.java
Log:
JBSEAM-2232
Modified: trunk/src/main/org/jboss/seam/Component.java
===================================================================
--- trunk/src/main/org/jboss/seam/Component.java 2008-11-05 23:45:22 UTC (rev 9511)
+++ trunk/src/main/org/jboss/seam/Component.java 2008-11-06 02:03:32 UTC (rev 9512)
@@ -1483,7 +1483,7 @@
public void initialize(Object bean) throws Exception
{
- if ( log.isDebugEnabled() ) log.debug("initializing new instance of: " + name);
+ if ( log.isTraceEnabled() ) log.trace("initializing new instance of: " + name);
injectLog(bean);
@@ -1500,7 +1500,7 @@
setFieldValue(bean, field, field.getName(), initialValue );
}
- if ( log.isDebugEnabled() ) log.debug("done initializing: " + name);
+ if ( log.isTraceEnabled() ) log.trace("done initializing: " + name);
}
/**
@@ -2074,8 +2074,8 @@
public Object newInstance()
{
- if (log.isDebugEnabled()) {
- log.debug("instantiating Seam component: " + name);
+ if (log.isTraceEnabled()) {
+ log.trace("instantiating Seam component: " + name);
}
Object instance;
Modified: trunk/src/main/org/jboss/seam/core/Events.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Events.java 2008-11-05 23:45:22 UTC (rev 9511)
+++ trunk/src/main/org/jboss/seam/core/Events.java 2008-11-06 02:03:32 UTC (rev 9512)
@@ -59,7 +59,7 @@
public void raiseEvent(String type, Object... parameters)
{
//TODO: find a way to map event parameters to params in an EL-defined listener
- log.debug("Processing event:" + type);
+ log.trace("Processing event:" + type);
List<Init.ObserverMethodExpression> list = Init.instance().getObserverMethodExpressions(type);
if (list!=null)
{
15 years, 6 months
Seam SVN: r9511 - trunk/src/pdf/org/jboss/seam/pdf/ui.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-11-05 18:45:22 -0500 (Wed, 05 Nov 2008)
New Revision: 9511
Modified:
trunk/src/pdf/org/jboss/seam/pdf/ui/UICell.java
trunk/src/pdf/org/jboss/seam/pdf/ui/UITable.java
Log:
JBSEAM-3673
Modified: trunk/src/pdf/org/jboss/seam/pdf/ui/UICell.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ui/UICell.java 2008-11-05 22:08:40 UTC (rev 9510)
+++ trunk/src/pdf/org/jboss/seam/pdf/ui/UICell.java 2008-11-05 23:45:22 UTC (rev 9511)
@@ -7,352 +7,321 @@
import javax.faces.context.FacesContext;
-public class UICell extends UIRectangle
-{
- public static final String COMPONENT_TYPE = "org.jboss.seam.pdf.ui.UICell";
+public class UICell extends UIRectangle {
+ public static final String COMPONENT_TYPE = "org.jboss.seam.pdf.ui.UICell";
- PdfPCell cell;
- String horizontalAlignment;
- String verticalAlignment;
- Float padding;
- Float paddingLeft;
- Float paddingRight;
- Float paddingTop;
- Float paddingBottom;
- Boolean useBorderPadding;
- Float leading;
- Float multipliedLeading;
- Float indent;
- Float extraParagraphSpace;
- Float fixedHeight;
- Boolean noWrap;
- Float minimumHeight;
- Integer colspan;
- Float followingIndent;
- Float rightIndent;
- Integer spaceCharRatio;
- Integer runDirection;
- Integer arabicOptions;
- Boolean useAscender;
- Float grayFill;
- Integer rotation;
+ PdfPCell cell;
+ String horizontalAlignment;
+ String verticalAlignment;
+ Float padding;
+ Float paddingLeft;
+ Float paddingRight;
+ Float paddingTop;
+ Float paddingBottom;
+ Boolean useBorderPadding;
+ Float leading;
+ Float multipliedLeading;
+ Float indent;
+ Float extraParagraphSpace;
+ Float fixedHeight;
+ Boolean noWrap;
+ Float minimumHeight;
+ Integer colspan;
+ Float followingIndent;
+ Float rightIndent;
+ Integer spaceCharRatio;
+ Integer runDirection;
+ Integer arabicOptions;
+ Boolean useAscender;
+ Float grayFill;
+ Integer rotation;
- boolean hasContent = false;
+ boolean hasContent = false;
- public void setGrayFill(Float grayFill)
- {
- this.grayFill = grayFill;
- }
+ public void setGrayFill(Float grayFill) {
+ this.grayFill = grayFill;
+ }
- public void setHorizontalAlignment(String horizontalAlignment)
- {
- this.horizontalAlignment = horizontalAlignment;
- }
+ public void setHorizontalAlignment(String horizontalAlignment) {
+ this.horizontalAlignment = horizontalAlignment;
+ }
- public void setVerticalAlignment(String verticalAlignment)
- {
- this.verticalAlignment = verticalAlignment;
- }
+ public void setVerticalAlignment(String verticalAlignment) {
+ this.verticalAlignment = verticalAlignment;
+ }
- public void setPadding(Float padding)
- {
- this.padding = padding;
- }
+ public void setPadding(Float padding) {
+ this.padding = padding;
+ }
- public void setPaddingLeft(Float paddingLeft)
- {
- this.paddingLeft = paddingLeft;
- }
+ public void setPaddingLeft(Float paddingLeft) {
+ this.paddingLeft = paddingLeft;
+ }
- public void setPaddingRight(Float paddingRight)
- {
- this.paddingRight = paddingRight;
- }
+ public void setPaddingRight(Float paddingRight) {
+ this.paddingRight = paddingRight;
+ }
- public void setPaddingTop(Float paddingTop)
- {
- this.paddingTop = paddingTop;
- }
+ public void setPaddingTop(Float paddingTop) {
+ this.paddingTop = paddingTop;
+ }
- public void setPaddingBottom(Float paddingBottom)
- {
- this.paddingBottom = paddingBottom;
- }
+ public void setPaddingBottom(Float paddingBottom) {
+ this.paddingBottom = paddingBottom;
+ }
- public void setUseBorderPadding(Boolean useBorderPadding)
- {
- this.useBorderPadding = useBorderPadding;
- }
+ public void setUseBorderPadding(Boolean useBorderPadding) {
+ this.useBorderPadding = useBorderPadding;
+ }
- public void setLeading(Float leading)
- {
- this.leading = leading;
- }
+ public void setLeading(Float leading) {
+ this.leading = leading;
+ }
- public void setMultipliedLeading(Float multipliedLeading)
- {
- this.multipliedLeading = multipliedLeading;
- }
+ public void setMultipliedLeading(Float multipliedLeading) {
+ this.multipliedLeading = multipliedLeading;
+ }
- public void setIndent(Float indent)
- {
- this.indent = indent;
- }
+ public void setIndent(Float indent) {
+ this.indent = indent;
+ }
- public void setExtraParagraphSpace(Float extraParagraphSpace)
- {
- this.extraParagraphSpace = extraParagraphSpace;
- }
+ public void setExtraParagraphSpace(Float extraParagraphSpace) {
+ this.extraParagraphSpace = extraParagraphSpace;
+ }
- public void setFixedHeight(Float fixedHeight)
- {
- this.fixedHeight = fixedHeight;
- }
+ public void setFixedHeight(Float fixedHeight) {
+ this.fixedHeight = fixedHeight;
+ }
- public void setNoWrap(Boolean noWrap)
- {
- this.noWrap = noWrap;
- }
+ public void setNoWrap(Boolean noWrap) {
+ this.noWrap = noWrap;
+ }
- public void setMinimumHeight(Float minimumHeight)
- {
- this.minimumHeight = minimumHeight;
- }
+ public void setMinimumHeight(Float minimumHeight) {
+ this.minimumHeight = minimumHeight;
+ }
- public void setColspan(Integer colspan)
- {
- this.colspan = colspan;
- }
+ public void setColspan(Integer colspan) {
+ this.colspan = colspan;
+ }
- public void setFollowingIndent(Float followingIndent)
- {
- this.followingIndent = followingIndent;
- }
+ public void setFollowingIndent(Float followingIndent) {
+ this.followingIndent = followingIndent;
+ }
- public void setRightIndent(Float rightIndent)
- {
- this.rightIndent = rightIndent;
- }
+ public void setRightIndent(Float rightIndent) {
+ this.rightIndent = rightIndent;
+ }
- public void setSpaceCharRatio(Integer spaceCharRatio)
- {
- this.spaceCharRatio = spaceCharRatio;
- }
+ public void setSpaceCharRatio(Integer spaceCharRatio) {
+ this.spaceCharRatio = spaceCharRatio;
+ }
- public void setRunDirection(Integer runDirection)
- {
- this.runDirection = runDirection;
- }
+ public void setRunDirection(Integer runDirection) {
+ this.runDirection = runDirection;
+ }
- public void setArabicOptions(Integer arabicOptions)
- {
- this.arabicOptions = arabicOptions;
- }
+ public void setArabicOptions(Integer arabicOptions) {
+ this.arabicOptions = arabicOptions;
+ }
- public void setUseAscender(Boolean useAscender)
- {
- this.useAscender = useAscender;
- }
+ public void setUseAscender(Boolean useAscender) {
+ this.useAscender = useAscender;
+ }
- public void setRotation(Integer rotation)
- {
- this.rotation = rotation;
- }
+ public void setRotation(Integer rotation) {
+ this.rotation = rotation;
+ }
- @Override
- public Object getITextObject()
- {
- return cell;
- }
+ @Override
+ public Object getITextObject() {
+ return cell;
+ }
- @Override
- public void removeITextObject()
- {
- cell = null;
- }
+ @Override
+ public void removeITextObject() {
+ cell = null;
+ }
- @Override
- public void createITextObject(FacesContext context)
- {
- PdfPCell defaultCell = getDefaultCellFromTable();
- if (defaultCell != null)
- {
- cell = new PdfPCell(defaultCell);
- }
- else
- {
- cell = new PdfPCell();
- }
+ @Override
+ public void createITextObject(FacesContext context) {
+ PdfPCell defaultCell = getDefaultCellFromTable();
+ if (defaultCell != null) {
+ cell = new PdfPCell(defaultCell);
+ } else {
+ cell = new PdfPCell();
+ }
- horizontalAlignment = (String) valueBinding(context, "horizontalAlignment", horizontalAlignment);
- if (horizontalAlignment != null)
- {
- cell.setHorizontalAlignment(ITextUtils.alignmentValue(horizontalAlignment));
- }
+ horizontalAlignment = (String) valueBinding(context,
+ "horizontalAlignment", horizontalAlignment);
+ if (horizontalAlignment != null) {
+ cell.setHorizontalAlignment(ITextUtils
+ .alignmentValue(horizontalAlignment));
+ System.out.println("!!! " + cell.getHorizontalAlignment());
+ }
- verticalAlignment = (String) valueBinding(context, "verticalAlignment", verticalAlignment);
- if (verticalAlignment != null)
- {
- cell.setVerticalAlignment(ITextUtils.alignmentValue(verticalAlignment));
- }
+ verticalAlignment = (String) valueBinding(context, "verticalAlignment",
+ verticalAlignment);
+ if (verticalAlignment != null) {
+ cell.setVerticalAlignment(ITextUtils
+ .alignmentValue(verticalAlignment));
+ }
- padding = (Float) valueBinding(context, "padding", padding);
- if (padding != null)
- {
- cell.setPadding(padding);
- }
+ padding = (Float) valueBinding(context, "padding", padding);
+ if (padding != null) {
+ cell.setPadding(padding);
+ }
- paddingLeft = (Float) valueBinding(context, "paddingLeft", paddingLeft);
- if (paddingLeft != null)
- {
- cell.setPaddingLeft(paddingLeft);
- }
+ paddingLeft = (Float) valueBinding(context, "paddingLeft", paddingLeft);
+ if (paddingLeft != null) {
+ cell.setPaddingLeft(paddingLeft);
+ }
- paddingRight = (Float) valueBinding(context, "paddingRight", paddingRight);
- if (paddingRight != null)
- {
- cell.setPaddingRight(paddingRight);
- }
+ paddingRight = (Float) valueBinding(context, "paddingRight",
+ paddingRight);
+ if (paddingRight != null) {
+ cell.setPaddingRight(paddingRight);
+ }
- paddingTop = (Float) valueBinding(context, "paddingTop", paddingTop);
- if (paddingTop != null)
- {
- cell.setPaddingTop(paddingTop);
- }
+ paddingTop = (Float) valueBinding(context, "paddingTop", paddingTop);
+ if (paddingTop != null) {
+ cell.setPaddingTop(paddingTop);
+ }
- paddingBottom = (Float) valueBinding(context, "paddingBottom", paddingBottom);
- if (paddingBottom != null)
- {
- cell.setPaddingBottom(paddingBottom);
- }
+ paddingBottom = (Float) valueBinding(context, "paddingBottom",
+ paddingBottom);
+ if (paddingBottom != null) {
+ cell.setPaddingBottom(paddingBottom);
+ }
- useBorderPadding = (Boolean) valueBinding(context, "useBorderPadding", useBorderPadding);
- if (useBorderPadding != null)
- {
- cell.setUseBorderPadding(useBorderPadding);
- }
+ useBorderPadding = (Boolean) valueBinding(context, "useBorderPadding",
+ useBorderPadding);
+ if (useBorderPadding != null) {
+ cell.setUseBorderPadding(useBorderPadding);
+ }
- leading = (Float) valueBinding(context, "leading", leading);
- multipliedLeading = (Float) valueBinding(context, "multipliedLeading", multipliedLeading);
- if (leading != null || multipliedLeading != null)
- {
- cell.setLeading(leading == null ? 0 : leading.floatValue(), multipliedLeading == null ? 0 : multipliedLeading.floatValue());
- }
+ leading = (Float) valueBinding(context, "leading", leading);
+ multipliedLeading = (Float) valueBinding(context, "multipliedLeading",
+ multipliedLeading);
+ if (leading != null || multipliedLeading != null) {
+ cell.setLeading(leading == null ? 0 : leading.floatValue(),
+ multipliedLeading == null ? 0 : multipliedLeading
+ .floatValue());
+ }
- indent = (Float) valueBinding(context, "indent", indent);
- if (indent != null)
- {
- cell.setIndent(indent);
- }
+ indent = (Float) valueBinding(context, "indent", indent);
+ if (indent != null) {
+ cell.setIndent(indent);
+ }
- extraParagraphSpace = (Float) valueBinding(context, "extraParagraphSpace", extraParagraphSpace);
- if (extraParagraphSpace != null)
- {
- cell.setExtraParagraphSpace(extraParagraphSpace);
- }
+ extraParagraphSpace = (Float) valueBinding(context,
+ "extraParagraphSpace", extraParagraphSpace);
+ if (extraParagraphSpace != null) {
+ cell.setExtraParagraphSpace(extraParagraphSpace);
+ }
- fixedHeight = (Float) valueBinding(context, "fixedHeight", fixedHeight);
- if (fixedHeight != null)
- {
- cell.setFixedHeight(fixedHeight);
- }
+ fixedHeight = (Float) valueBinding(context, "fixedHeight", fixedHeight);
+ if (fixedHeight != null) {
+ cell.setFixedHeight(fixedHeight);
+ }
- noWrap = (Boolean) valueBinding(context, "noWrap", noWrap);
- if (noWrap != null)
- {
- cell.setNoWrap(noWrap);
- }
+ noWrap = (Boolean) valueBinding(context, "noWrap", noWrap);
+ if (noWrap != null) {
+ cell.setNoWrap(noWrap);
+ }
- minimumHeight = (Float) valueBinding(context, "minimumHeight", minimumHeight);
- if (minimumHeight != null)
- {
- cell.setMinimumHeight(minimumHeight);
- }
+ minimumHeight = (Float) valueBinding(context, "minimumHeight",
+ minimumHeight);
+ if (minimumHeight != null) {
+ cell.setMinimumHeight(minimumHeight);
+ }
- colspan = (Integer) valueBinding(context, "colspan", colspan);
- if (colspan != null)
- {
- cell.setColspan(colspan);
- }
+ colspan = (Integer) valueBinding(context, "colspan", colspan);
+ if (colspan != null) {
+ cell.setColspan(colspan);
+ }
- followingIndent = (Float) valueBinding(context, "followingIndent", followingIndent);
- if (followingIndent != null)
- {
- cell.setFollowingIndent(followingIndent);
- }
- rightIndent = (Float) valueBinding(context, "rightIndent", rightIndent);
- if (rightIndent != null)
- {
- cell.setRightIndent(rightIndent);
- }
- spaceCharRatio = (Integer) valueBinding(context, "spaceCharRatio", spaceCharRatio);
- if (spaceCharRatio != null)
- {
- cell.setSpaceCharRatio(spaceCharRatio);
- }
- runDirection = (Integer) valueBinding(context, "runDirection", runDirection);
- if (runDirection != null)
- {
- cell.setRunDirection(runDirection);
- }
- arabicOptions = (Integer) valueBinding(context, "arabicOptions", arabicOptions);
- if (arabicOptions != null)
- {
- cell.setArabicOptions(arabicOptions);
- }
- useAscender = (Boolean) valueBinding(context, "useAscender", useAscender);
- if (useAscender != null)
- {
- cell.setUseAscender(useAscender);
- }
+ followingIndent = (Float) valueBinding(context, "followingIndent",
+ followingIndent);
+ if (followingIndent != null) {
+ cell.setFollowingIndent(followingIndent);
+ }
+ rightIndent = (Float) valueBinding(context, "rightIndent", rightIndent);
+ if (rightIndent != null) {
+ cell.setRightIndent(rightIndent);
+ }
+ spaceCharRatio = (Integer) valueBinding(context, "spaceCharRatio",
+ spaceCharRatio);
+ if (spaceCharRatio != null) {
+ cell.setSpaceCharRatio(spaceCharRatio);
+ }
+ runDirection = (Integer) valueBinding(context, "runDirection",
+ runDirection);
+ if (runDirection != null) {
+ cell.setRunDirection(runDirection);
+ }
+ arabicOptions = (Integer) valueBinding(context, "arabicOptions",
+ arabicOptions);
+ if (arabicOptions != null) {
+ cell.setArabicOptions(arabicOptions);
+ }
+ useAscender = (Boolean) valueBinding(context, "useAscender",
+ useAscender);
+ if (useAscender != null) {
+ cell.setUseAscender(useAscender);
+ }
- grayFill = (Float) valueBinding(context, "grayFill", grayFill);
- if (grayFill != null)
- {
- cell.setGrayFill(grayFill);
- }
+ grayFill = (Float) valueBinding(context, "grayFill", grayFill);
+ if (grayFill != null) {
+ cell.setGrayFill(grayFill);
+ }
- rotation = (Integer) valueBinding(context, "rotation", rotation);
- if (rotation != null)
- {
- cell.setRotation(rotation);
- }
+ rotation = (Integer) valueBinding(context, "rotation", rotation);
+ if (rotation != null) {
+ cell.setRotation(rotation);
+ }
- applyRectangleProperties(context, cell);
- }
+ applyRectangleProperties(context, cell);
+ }
- private PdfPCell getDefaultCellFromTable()
- {
- UITable parentTable = (UITable) findITextParent(this, UITable.class);
- if (parentTable != null)
- {
- return parentTable.getDefaultCellFacet();
- }
- return null;
- }
+ private PdfPCell getDefaultCellFromTable() {
+ UITable parentTable = (UITable) findITextParent(this, UITable.class);
+ if (parentTable != null) {
+ return parentTable.getDefaultCellFacet();
+ }
+ return null;
+ }
- @Override
- public void handleAdd(Object o)
- {
- if (!hasContent && o instanceof Image)
- {
- // added by user request, but it mages the logic here rather ugly.
- cell.setImage((Image) o);
+ @Override
+ public void handleAdd(Object o) {
+ if (!hasContent) {
+ if (o instanceof Image) {
+ // added by user request, but it mages the logic here rather
+ // ugly.
+ cell.setImage((Image) o);
+ } else if (o instanceof Phrase) {
+ cell.setPhrase((Phrase) o);
+ } else if (o instanceof Element) {
+ cell.addElement((Element) o);
+ } else {
+ throw new RuntimeException("Can't add "
+ + o.getClass().getName() + " to cell");
+ }
- }
- else if (o instanceof Element)
- {
- if (cell.getImage() != null)
- {
- cell.addElement(cell.getImage());
- }
- cell.addElement((Element) o);
- }
- else
- {
- throw new RuntimeException("Can't add " + o.getClass().getName() + " to cell");
- }
- hasContent = true;
- }
+ hasContent = true;
+ } else if (o instanceof Element) {
+ if (cell.getImage() != null) {
+ cell.addElement(cell.getImage());
+ }
+ if (cell.getPhrase() != null) {
+ cell.addElement(cell.getPhrase());
+ }
+ cell.addElement((Element) o);
+ } else {
+ throw new RuntimeException("Can't add " + o.getClass().getName()
+ + " to cell");
+ }
+ }
}
Modified: trunk/src/pdf/org/jboss/seam/pdf/ui/UITable.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ui/UITable.java 2008-11-05 22:08:40 UTC (rev 9510)
+++ trunk/src/pdf/org/jboss/seam/pdf/ui/UITable.java 2008-11-05 23:45:22 UTC (rev 9511)
@@ -1,5 +1,7 @@
package org.jboss.seam.pdf.ui;
+import java.awt.Color;
+
import javax.faces.context.FacesContext;
import org.jboss.seam.pdf.ITextUtils;
@@ -225,29 +227,20 @@
}
@Override
- public void handleAdd(Object o)
- {
- if (o instanceof PdfPCell)
- {
- table.addCell((PdfPCell) o);
- }
- else if (o instanceof PdfPTable)
- {
- table.addCell((PdfPTable) o);
- }
- else if (o instanceof Phrase)
- {
- table.addCell((Phrase) o);
- }
- else if (o instanceof Image)
- {
- table.addCell((Image) o);
- }
- else
- {
- throw new RuntimeException("Can't add " + o.getClass().getName() + " to table");
- }
- }
+ public void handleAdd(Object o) {
+ if (o instanceof PdfPCell) {
+ table.addCell((PdfPCell) o);
+ } else if (o instanceof PdfPTable) {
+ table.addCell((PdfPTable) o);
+ } else if (o instanceof Phrase) {
+ table.addCell((Phrase) o);
+ } else if (o instanceof Image) {
+ table.addCell((Image) o);
+ } else {
+ throw new RuntimeException("Can't add " + o.getClass().getName()
+ + " to table");
+ }
+ }
public PdfPCell getDefaultCellFacet()
{
15 years, 6 months
Seam SVN: r9510 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-11-05 17:08:40 -0500 (Wed, 05 Nov 2008)
New Revision: 9510
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
Log:
Updated Glassfish chapter.
Modified: trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-11-05 17:59:39 UTC (rev 9509)
+++ trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-11-05 22:08:40 UTC (rev 9510)
@@ -70,12 +70,13 @@
<programlisting>$ bin/asadmin start-domain domain1</programlisting>
<para>
- The web adminstration console is available at <literal>http://localhost:4848/</literal>.
+ The web administration console is available at <literal>http://localhost:4848/</literal>.
You can access the web admin console with the default username
(<literal>admin</literal>) and password (<literal>adminadmin</literal>).
- Alternatively, you could copy EAR/WAR file to
- <literal>glassfish/domains/domain1/autodeploy</literal> to deploy
- it.
+ We will be using the the admin console to deploy our examples.
+ You can also copy EAR/WAR files to the
+ <literal>glassfish/domains/domain1/autodeploy</literal> directory
+ to deploy them, although we are not going to cover that.
</para>
<para>
@@ -95,7 +96,23 @@
designed to run on GlassFish. It is located in
<literal>$SEAM_DIST/examples/jee5/booking</literal>.
</para>
+
+ <section>
+ <title>Building the <literal>jee5/booking</literal> example</title>
+ <para>
+ To build the example, simply execute the default
+ <literal>ant</literal> target:
+ </para>
+
+ <programlisting>$ ant</programlisting>
+
+ <para>
+ in the <literal>examples/jee5/booking</literal> directory. This
+ will create the <literal>dist</literal> and
+ <literal>exploded-archives</literal> directories.
+ </para>
+ </section>
<section id="jee5-glassfish-deploy">
<title>Deploying the application to GlassFish</title>
@@ -187,7 +204,8 @@
<para>
This is very similar to the <literal>jee5</literal> example at
- <xref linkend="jee5-glassfish-deploy" />.
+ <xref linkend="jee5-glassfish-deploy" /> except that this is a
+ <literal>war</literal> and not an <literal>ear</literal>.
</para>
<itemizedlist>
@@ -245,7 +263,7 @@
</note>
</section>
- <section>
+ <section id="glassfish_jpa_diff">
<title>What's different for GlassFish v2 UR2</title>
<itemizedlist>
@@ -291,9 +309,7 @@
quickly get an application up and running, and provides a foundation to
add your own functionality. Out of box <literal>seam-gen</literal> will
produce applications configured to run on JBoss AS. These instructions
- will show the steps needed to get it to run on GlassFish. As stated
- above in <xref linkend="jee5-glassfish-section" /> it's easy to deploy
- either an EJB3 or a Seam POJOs application on Glassfish.
+ will show the steps needed to get it to run on GlassFish.
</para>
<section>
@@ -419,9 +435,9 @@
</listitem>
<listitem>
<para>
- Add or change the properties below. These are
- described in detail at
- <xref linkend="jee5-glassfish-section" />:
+ Replace all of the properties with the following.
+ The key differences are briefly described in
+ <xref linkend="glassfish_jpa_diff" />:
</para>
<programlisting role="XML"><![CDATA[<property name="hibernate.dialect" value="GlassFishDerbyDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
@@ -499,7 +515,7 @@
<listitem>
<para>
Alter the <literal>jndi-pattern</literal> to
- <literal>java:comp/env/seamgen_example/#{ejbName}/local</literal>
+ <literal>java:comp/env/seamgen_example/#{ejbName}</literal>
</para>
</listitem>
</itemizedlist>
@@ -604,7 +620,6 @@
This application has similar requirements as the
<literal>jee5/booking</literal> example.
</para>
-
<itemizedlist>
<listitem>
<para>
@@ -614,30 +629,12 @@
<programlisting role="XML"><![CDATA[<project name="seamgen_example" default="archive" basedir=".">]]></programlisting>
</listitem>
-
<listitem>
<para>
- Websphere looks for the drools <literal>/security.drl</literal>
- file in the root of the <literal>war</literal> file instead of the root of the
- <literal>seamgen_example.jar</literal> so we need to have
- the <literal>build.xml</literal> move it to the correct
- location at build time. The following must be added at the
- top of the <literal><![CDATA[<target name="war" depends="compile" description="Build the distribution .war file">]]></literal>
- target.
- </para>
-
- <programlisting role="XML"><![CDATA[<copy todir="${war.dir}">
- <fileset dir="${basedir}/resources">
- <include name="*.drl" />
- </fileset>
-</copy>]]></programlisting>
- </listitem>
-
- <listitem>
- <para>
We need to get the <literal>GlassFishDerbyDialect.class</literal>
into our application jar. To do that find the <literal>jar</literal>
- task and modify the top of it so that it looks like this:
+ task and add the <literal>GlassFishDerbyDialect.class</literal>
+ line as shown below:
</para>
<programlisting role="XML"><![CDATA[<target name="jar" depends="compile,copyclasses" description="Build the distribution .jar file">
@@ -650,156 +647,65 @@
</copy>
...]]></programlisting>
</listitem>
-
<listitem>
<para>
- Next we need to get the <literal>jboss-seam.jar</literal>
- into the base of the <literal>EAR</literal> file. For
- deployment GlassFish requires this jar to be in both the
- <literal>/lib</literal> directory and at the base of the
- <literal>EAR</literal>. You must add the following to the
- <literal>archive</literal> task:
+ Now we need to get extra jars into the <literal>ear</literal>
+ file. Look for the
+ <literal><![CDATA[<copy todir="${ear.dir}/lib">]]></literal>
+ section of the <literal>ear</literal> target. Add the following
+ to the child
+ <literal><![CDATA[<fileset dir="${lib.dir}">]]></literal>
+ element.
</para>
-
- <programlisting role="XML"><![CDATA[<fileset dir="${lib.dir}">
- <include name="jboss-seam.jar" >
-</fileset>]]></programlisting>
-
- <para>
- So that the whole <literal>archive</literal> task looks
- like:
- </para>
-
- <programlisting role="XML"><![CDATA[<target name="archive" depends="jar,war,ear" description="Package the archives">
- <jar jarfile="${dist.dir}/${project.name}.jar" basedir="${jar.dir}"/>
- <jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
- <jar jarfile="${dist.dir}/${project.name}.ear">
- <fileset dir="${ear.dir}"/>
- <fileset dir="${dist.dir}">
- <include name="${project.name}.jar"/>
- <include name="${project.name}.war"/>
- </fileset>
- <fileset dir="${lib.dir}">
- <include name="jboss-seam.jar" />
- </fileset>
- </jar>
-</target>]]></programlisting>
</listitem>
- <listitem>
- <para>
- Now we need to get extra jars into the <literal>build.xml</literal>.
- Look for the <literal><![CDATA[<fileset dir="${basedir}">]]></literal>
- section of the task below. Add the new includes at the
- bottom of the fileset.
- </para>
-
- <programlisting role="XML"><![CDATA[<target name="ear" description="Build the EAR">
- <copy todir="${ear.dir}">
- <fileset dir="${basedir}/resources">
- <include name="*jpdl.xml" />
- <include name="*hibernate.cfg.xml" />
- <include name="jbpm.cfg.xml" />
- </fileset>
- <fileset dir="${lib.dir}">
- <include name="jboss-seam.jar" />
- </fileset>
- <fileset dir="${basedir}">
- <include name="lib/jbpm*.jar" />
- <include name="lib/jboss-el.jar" />
- <include name="lib/drools-*.jar"/>
- <include name="lib/core.jar"/>
- <include name="lib/janino*.jar"/>
- <include name="lib/antlr-*.jar"/>
- <include name="lib/mvel*.jar"/>
- <include name="lib/richfaces-api*.jar" />
- </fileset>
- </copy>
- <copy todir="${ear.dir}/META-INF">
- <fileset dir="${basedir}/resources/META-INF">
- <include name="application.xml" />
- <include name="jboss-app.xml" />
- </fileset>
- </copy>
-</target>]]></programlisting>
-
+ <listitem>
<itemizedlist>
<listitem>
<para>Add Hibernate dependencies</para>
-
<programlisting role="XML"><![CDATA[<!-- Hibernate and deps -->
-<include name="lib/hibernate.jar"/>
-<include name="lib/hibernate-commons-annotations.jar"/>
-<include name="lib/hibernate-annotations.jar"/>
-<include name="lib/hibernate-entitymanager.jar"/>
-<include name="lib/hibernate-validator.jar"/>
-<include name="lib/jboss-common-core.jar"/>]]></programlisting>
+<include name="hibernate.jar"/>
+<include name="hibernate-commons-annotations.jar"/>
+<include name="hibernate-annotations.jar"/>
+<include name="hibernate-entitymanager.jar"/>
+<include name="hibernate-validator.jar"/>
+<include name="jboss-common-core.jar"/>]]></programlisting>
</listitem>
-
<listitem>
- <para>
- Add JSF dependencies. You will need to copy the
- <literal>el-ri.jar</literal> from the
- <literal>$SEAM_DIST/lib</literal> directory.
- </para>
-
- <programlisting role="XML"><![CDATA[<!-- jsf libs -->
-<include name="lib/jsf-api.jar" />
-<include name="lib/jsf-impl.jar" />
-<include name="lib/el-api.jar" />
-<include name="lib/el-ri.jar"/>]]></programlisting>
- </listitem>
-
- <listitem>
<para>Add third party dependencies.</para>
-
<programlisting role="XML"><![CDATA[<!-- 3rd party and supporting jars -->
-<include name="lib/javassist.jar"/>
-<include name="lib/dom4j.jar"/>
-<include name="lib/concurrent.jar" />
-<include name="lib/cglib.jar"/>
-<include name="lib/asm.jar"/>
-<include name="lib/antlr.jar" />
-<include name="lib/commons-logging.jar" />
-<include name="lib/commons-collections.jar" />]]></programlisting>
+<include name="javassist.jar"/>
+<include name="dom4j.jar"/>
+<include name="concurrent.jar" />
+<include name="cglib.jar"/>
+<include name="asm.jar"/>
+<include name="antlr.jar" />
+<include name="commons-logging.jar" />
+<include name="commons-collections.jar" />]]></programlisting>
</listitem>
</itemizedlist>
<para>You should end up with something like:</para>
- <programlisting role="XML"><![CDATA[<fileset dir="${basedir}">
- <include name="lib/jbpm*.jar" />
- <include name="lib/jboss-el.jar" />
- <include name="lib/drools-*.jar"/>
- <include name="lib/core.jar"/>
- <include name="lib/janino*.jar"/>
- <include name="lib/antlr-*.jar"/>
- <include name="lib/mvel*.jar"/>
- <include name="lib/richfaces-api*.jar" />
-
+ <programlisting role="XML"><![CDATA[<fileset dir="${lib.dir}">
+ <includesfile name="deployed-jars-ear.list" />
+
<!-- Hibernate and deps -->
- <include name="lib/hibernate.jar"/>
- <include name="lib/hibernate-commons-annotations.jar"/>
- <include name="lib/hibernate-annotations.jar"/>
- <include name="lib/hibernate-entitymanager.jar"/>
- <include name="lib/hibernate-validator.jar"/>
- <include name="lib/jboss-common-core.jar" />
-
- <!-- jsf libs -->
- <include name="lib/jsf-api.jar" />
- <include name="lib/jsf-impl.jar" />
- <include name="lib/el-api.jar" />
- <include name="lib/el-ri.jar"/>
-
+ <include name="hibernate.jar"/>
+ <include name="hibernate-commons-annotations.jar"/>
+ <include name="hibernate-annotations.jar"/>
+ <include name="hibernate-entitymanager.jar"/>
+ <include name="hibernate-validator.jar"/>
+ <include name="jboss-common-core.jar" />
+
<!-- 3rd party and supporting jars -->
- <include name="lib/javassist.jar" />
- <include name="lib/dom4j.jar" />
- <include name="lib/concurrent.jar" />
- <include name="lib/cglib.jar" />
- <include name="lib/asm.jar" />
- <include name="lib/antlr.jar" />
- <include name="lib/commons-logging.jar" />
- <include name="lib/commons-collections.jar" />
-
+ <include name="javassist.jar" />
+ <include name="dom4j.jar" />
+ <include name="concurrent.jar" />
+ <include name="cglib.jar" />
+ <include name="asm.jar" />
+ <include name="antlr.jar" />
+ <include name="commons-logging.jar" />
+ <include name="commons-collections.jar" />
</fileset>]]></programlisting>
</listitem>
</itemizedlist>
15 years, 6 months
Seam SVN: r9509 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-11-05 12:59:39 -0500 (Wed, 05 Nov 2008)
New Revision: 9509
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Cache.xml
Log:
JBSEAM-3627
Modified: trunk/doc/Seam_Reference_Guide/en-US/Cache.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Cache.xml 2008-11-05 14:32:19 UTC (rev 9508)
+++ trunk/doc/Seam_Reference_Guide/en-US/Cache.xml 2008-11-05 17:59:39 UTC (rev 9509)
@@ -300,18 +300,21 @@
<para>Now you can inject the cache into any Seam component:</para>
- <programlisting role="JAVA"><![CDATA[@Name("chatroom")
-public class Chatroom {
- @In CacheProvider cacheProvider;
-
- public void join(String username) {
- Set<String> userList = (Set<String>) pojoCache.get("chatroom", "userList");
- if (userList==null) {
- userList = new HashSet<String>();
- cacheProvider.put("chatroom", "userList", userList);
- }
- userList.put(username);
- }
+ <programlisting role="JAVA"><![CDATA[@Name("chatroomUsers")
+(a)Scope(ScopeType.STATELESS)
+public class ChatroomUsers
+{
+ @In CacheProvider cacheProvider;
+
+ @Unwrap
+ public Set<String> getUsers() throws CacheException {
+ Set<String> userList = (Set<String>) cacheProvider.get("chatroom", "userList");
+ if (userList==null) {
+ userList = new HashSet<String>();
+ cacheProvider.put("chatroom", "userList", userList);
+ }
+ return userList;
+ }
}]]></programlisting>
<para>
15 years, 6 months
Seam SVN: r9508 - branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-11-05 09:32:19 -0500 (Wed, 05 Nov 2008)
New Revision: 9508
Modified:
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build-war.xml
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build.xml
Log:
JBPAPP-1156
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build-war.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build-war.xml 2008-11-05 13:19:33 UTC (rev 9507)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build-war.xml 2008-11-05 14:32:19 UTC (rev 9508)
@@ -326,6 +326,8 @@
<path refid="build.classpath" />
</path>
<testng outputdir="${basedir}/test-report">
+ <!-- java 6 requires this -->
+ <jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/>
<classpath refid="test.path" />
<xmlfileset dir="${test.dir}" includes="*Test.xml" />
</testng>
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build.xml 2008-11-05 13:19:33 UTC (rev 9507)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build.xml 2008-11-05 14:32:19 UTC (rev 9508)
@@ -300,6 +300,8 @@
<path refid="build.classpath" />
</path>
<testng outputdir="${basedir}/test-report">
+ <!-- java 6 requires this -->
+ <jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/>
<classpath refid="test.path" />
<xmlfileset dir="${test.dir}" includes="*Test.xml" />
</testng>
15 years, 6 months
Seam SVN: r9507 - branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-11-05 08:19:33 -0500 (Wed, 05 Nov 2008)
New Revision: 9507
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml
Log:
JBPAPP-1167
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-11-05 10:53:57 UTC (rev 9506)
+++ branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-11-05 13:19:33 UTC (rev 9507)
@@ -314,8 +314,8 @@
<para>
Don't forget to update the XSD's in <literal>pages.xml</literal> and
<literal>components.xml</literal> to point at the ones for Seam 2.
- Just change the suffix from <literal>-1.2.xml</literal> to
- <literal>-2.0.xml</literal>.
+ Just change the suffix from <literal>-1.2.xsd</literal> to
+ <literal>-2.0.xsd</literal>.
</para>
</important>
15 years, 6 months
Seam SVN: r9506 - in trunk: src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium and 4 other directories.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2008-11-05 05:53:57 -0500 (Wed, 05 Nov 2008)
New Revision: 9506
Added:
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/NestedSimpleBookingTest.java
Modified:
trunk/examples/nestedbooking/view/confirm.xhtml
trunk/examples/nestedbooking/view/main.xhtml
trunk/examples/nestedbooking/view/rooms.xhtml
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties
trunk/src/test/ftest/examples/nestedbooking/testng.xml
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java
Log:
minor fixes and enhancements in selenium tests
Modified: trunk/examples/nestedbooking/view/confirm.xhtml
===================================================================
--- trunk/examples/nestedbooking/view/confirm.xhtml 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/examples/nestedbooking/view/confirm.xhtml 2008-11-05 10:53:57 UTC (rev 9506)
@@ -64,7 +64,7 @@
<ui:define name="label">Credit Card #:</ui:define>
#{booking.creditCard}
</s:decorate>
- <s:decorate template="output.xhtml">
+ <s:decorate id="buttonDecorate" template="output.xhtml">
<ui:define name="label"> </ui:define>
<h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/> 
<s:button id="revise" value="Revise" view="/payment.xhtml"/> 
Modified: trunk/examples/nestedbooking/view/main.xhtml
===================================================================
--- trunk/examples/nestedbooking/view/main.xhtml 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/examples/nestedbooking/view/main.xhtml 2008-11-05 10:53:57 UTC (rev 9506)
@@ -13,7 +13,7 @@
<h:form id="main">
<span class="errors">
- <h:messages globalOnly="true"/>
+ <h:messages id="messages" globalOnly="true"/>
</span>
<h1>Search Hotels</h1>
@@ -43,7 +43,7 @@
<a:outputPanel id="searchResults">
<div class="section">
- <h:outputText id="NoBookingsFoundMessage" value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
+ <h:outputText id="NoHotelsFoundMessage" value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
<h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
<h:column id="column1">
<f:facet id="NameFacet" name="header">Name</f:facet>
Modified: trunk/examples/nestedbooking/view/rooms.xhtml
===================================================================
--- trunk/examples/nestedbooking/view/rooms.xhtml 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/examples/nestedbooking/view/rooms.xhtml 2008-11-05 10:53:57 UTC (rev 9506)
@@ -23,7 +23,7 @@
<br/><br/>
- <h:dataTable value="#{availableRooms}" var="room" rendered="#{availableRooms.rowCount > 0}">
+ <h:dataTable id="rooms" value="#{availableRooms}" var="room" rendered="#{availableRooms.rowCount > 0}">
<h:column>
<f:facet name="header">Name</f:facet>
#{room.name}
Modified: trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties
===================================================================
--- trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties 2008-11-05 10:53:57 UTC (rev 9506)
@@ -27,8 +27,8 @@
LOGIN_SUBMIT id=login:login
LOGOUT id=logout
PASSWORD_UPDATED_MESSAGE Password updated
-PASSWORD_REENTER_MESSAGE verify
-PASSWORD_VALUE_REQUIRED_MESSAGE //*[@id\='setpassword\:Message']
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE //*[contains(@id, 'Decorate:message')]
PASSWORD_LENGTH_MESSAGE length must be between
PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
@@ -43,10 +43,10 @@
BOOKING_CANCEL id=hotel:cancel
HOTEL_BED_FIELD id=booking:bedsDecorate:beds
HOTEL_BED_FIELD_SELECT_CRITERIA value=
-HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDate_calendarInputtext
-HOTEL_CHECKIN_DATE_MESSAGE id=booking:Message
-HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDate_calendarInputtext
-HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Message
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:checkinDateDecorate:message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:checkoutDateDecorate:message
HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:_1
HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:_2
HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
@@ -65,7 +65,8 @@
REGISTRATION_VERIFY id=registration:verifyDecorate:verify
REGISTRATION_VERIFY_MESSAGE id=registration:verifyDecorate:message
REGISTRATION_SUBMIT id=registration:register
-REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_CANCEL id=registration:cancel
+REGISTRATION_REENTER_MESSAGE Re-enter your password
REGISTRATION_LENGTH_MESSAGE length must be between
REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
@@ -76,9 +77,13 @@
BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
-BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+BOOKING_INVALID_DATE_MESSAGE2 Check In Date
WORKSPACE_BOOKING_TEXT Book hotel: {0}
WORKSPACE_VIEW_TEXT View hotel: {0}
WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
WORKSPACE_TABLE_ROW_COUNT = //table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
-SPINNER id\=searchCriteria\:Spinner\:connection-working
\ No newline at end of file
+SPINNER id\=searchCriteria\:Spinner\:connection-working
+FOOTER id=footer
+
+USE_ICEFACES_FORMS TRUE
+
Added: trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/NestedSimpleBookingTest.java
===================================================================
--- trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/NestedSimpleBookingTest.java (rev 0)
+++ trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/NestedSimpleBookingTest.java 2008-11-05 10:53:57 UTC (rev 9506)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.nestedbooking.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest;
+
+/**
+ * This class alters behaviour of SimpleBookingTest to match nestedbooking example
+ *
+ * @author jharting
+ */
+public class NestedSimpleBookingTest extends SimpleBookingTest {
+
+ @Override
+ protected int bookHotel(String hotelName) {
+ return bookHotel(hotelName, 0, CREDIT_CARD, CREDIT_CARD_NAME);
+ }
+
+ protected int bookHotel(String hotelName, int room, String creditCard, String creditCardName) {
+ if (!isLoggedIn()) {
+ return -1;
+ }
+
+ if (!browser.isElementPresent(getProperty("SEARCH_SUBMIT"))) {
+ browser.open(getProperty("MAIN_PAGE"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+
+ enterSearchQuery(hotelName);
+ browser.click(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // hotel page
+ browser.click(getProperty("BOOKING_BOOK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // book page
+ browser.click(getProperty("BOOKING_SELECT_ROOM"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // room select page
+ browser.click(MessageFormat.format(getProperty("ROOM_LINK"), room));
+ browser.waitForPageToLoad(TIMEOUT);
+ // payment page
+ browser.type(getProperty("PAYMENT_CREDIT_CARD"), creditCard);
+ browser.type(getProperty("PAYMENT_CREDIT_CARD_NAME"), creditCardName);
+ browser.click(getProperty("PAYMENT_PROCEED"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // confirm page
+ browser.click(getProperty("CONFIRM_CONFIRM"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // main page
+ String message = browser.getText(getProperty("HOTEL_MESSAGE"));
+ if (message.matches(MessageFormat.format(
+ getProperty("BOOKING_CONFIRMATION_MESSAGE"), EXPECTED_NAME, hotelName))) {
+ String[] messageParts = message.split(" ");
+ int confirmationNumber = Integer.parseInt(messageParts[messageParts.length - 1]);
+ return confirmationNumber;
+ } else {
+ return -1;
+ }
+ }
+
+ @Override
+ protected void populateBookingFields() {}
+}
Modified: trunk/src/test/ftest/examples/nestedbooking/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/nestedbooking/testng.xml 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/src/test/ftest/examples/nestedbooking/testng.xml 2008-11-05 10:53:57 UTC (rev 9506)
@@ -29,6 +29,7 @@
<class
name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest" />
<class name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ <class name="org.jboss.seam.example.nestedbooking.test.selenium.NestedSimpleBookingTest"></class>
</classes>
</test>
</suite>
\ No newline at end of file
Modified: trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java
===================================================================
--- trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java 2008-11-05 10:53:57 UTC (rev 9506)
@@ -35,13 +35,8 @@
protected void populateBookingFields(int bed, int smoking,
String creditCard, String creditCardName) {
super.populateBookingFields(bed, smoking, creditCard, creditCardName);
- populateBookingFields();
- }
-
- protected void populateBookingFields() {
- browser
- .select(getProperty("HOTEL_CREDIT_CARD_EXPIRY_MONTH"),
- "index=1");
+ browser.select(getProperty("HOTEL_CREDIT_CARD_EXPIRY_MONTH"),
+ "index=1");
browser.select(getProperty("HOTEL_CREDIT_CARD_EXPIRY_YEAR"), "index=1");
}
}
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java 2008-11-05 10:53:57 UTC (rev 9506)
@@ -18,7 +18,7 @@
* 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.example.common.test.booking.selenium;
import org.testng.annotations.BeforeMethod;
@@ -105,6 +105,6 @@
browser.type(getProperty("PASSWORD_PASSWORD"), newPassword);
browser.type(getProperty("PASSWORD_VERIFY"), verify);
browser.click(getProperty("PASSWORD_SUBMIT"));
- browser.waitForPageToLoad(TIMEOUT);
+ waitForForm();
}
}
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java 2008-11-05 10:53:57 UTC (rev 9506)
@@ -53,7 +53,6 @@
@BeforeMethod
public void setUp() {
startBrowser();
- assertTrue("Login failed.", login());
}
@Override
@@ -128,7 +127,7 @@
browser.type(getProperty("REGISTRATION_PASSWORD"), password);
browser.type(getProperty("REGISTRATION_VERIFY"), verify);
browser.click(getProperty("REGISTRATION_SUBMIT"));
- browser.waitForPageToLoad(TIMEOUT);
+ waitForForm();
}
}
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java 2008-11-05 10:53:57 UTC (rev 9506)
@@ -107,12 +107,20 @@
if (click) {
browser.click(getProperty("SEARCH_SUBMIT"));
}
+ // wait for javascript to show spinner
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ // wait for page to get updated
new Wait() {
+ @Override
public boolean until() {
return !browser.isVisible(getProperty("SPINNER"));
}
}.wait("Spinner hasn't come out.");
new Wait() {
+ @Override
public boolean until() {
return (browser.isElementPresent(getProperty("SEARCH_RESULT_TABLE")) || browser
.isElementPresent(getProperty("NO_HOTELS_FOUND")));
@@ -126,4 +134,18 @@
browser.click(getProperty("SEARCH_SUBMIT"));
browser.waitForPageToLoad(TIMEOUT);
}
+
+ public void waitForForm() {
+ if (getProperty("USE_ICEFACES_FORMS").equalsIgnoreCase("TRUE")) {
+ new Wait() {
+ @Override
+ public boolean until() {
+ return !browser.isElementPresent("xpath=//*[@style='cursor: wait;']")
+ && browser.isElementPresent(getProperty("FOOTER"));
+ }
+ }.wait("Page was not refreshed.");
+ } else {
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+ }
}
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java 2008-11-05 10:01:54 UTC (rev 9505)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java 2008-11-05 10:53:57 UTC (rev 9506)
@@ -36,9 +36,9 @@
*/
public class SimpleBookingTest extends SeleniumBookingTest {
- private final String EXPECTED_NAME = "Demo User";
- private final String CREDIT_CARD = "0123456789012345";
- private final String CREDIT_CARD_NAME = "visa";
+ protected final String EXPECTED_NAME = "Demo User";
+ protected final String CREDIT_CARD = "0123456789012345";
+ protected final String CREDIT_CARD_NAME = "visa";
/**
* Tries searching for non existing hotel.
@@ -55,7 +55,7 @@
*/
@Test(enabled = true)
public void simpleBookingTest() {
- String hotelName = "Swissotel";
+ String hotelName = "W Hotel";
int confirmationNumber;
confirmationNumber = bookHotel(hotelName);
assertTrue("Booking with confirmation number " + confirmationNumber
@@ -68,7 +68,7 @@
*/
@Test(enabled = true)
public void invalidDatesTest() {
- String hotelName = "Swissotel";
+ String hotelName = "W Hotel";
enterSearchQuery(hotelName);
browser.click(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
browser.waitForPageToLoad(TIMEOUT);
@@ -76,16 +76,12 @@
browser.click(getProperty("BOOKING_BOOK"));
browser.waitForPageToLoad(TIMEOUT);
// booking page
- String checkIn = browser.getValue(getProperty("HOTEL_CHECKIN_DATE_FIELD"));
String checkOut = browser.getValue(getProperty("HOTEL_CHECKOUT_DATE_FIELD"));
populateBookingFields();
// switch check in and check out date
browser.type(getProperty("HOTEL_CHECKIN_DATE_FIELD"), checkOut);
- browser.type(getProperty("HOTEL_CHECKOUT_DATE_FIELD"), checkIn);
- browser.type(getProperty("HOTEL_CREDIT_CARD"), CREDIT_CARD);
- browser.type(getProperty("HOTEL_CREDIT_CARD_NAME"), CREDIT_CARD_NAME);
browser.click(getProperty("HOTEL_PROCEED"));
- browser.waitForPageToLoad(TIMEOUT);
+ waitForForm();
assertTrue("Date verification #1 failed.", browser
.isTextPresent(getProperty("BOOKING_INVALID_DATE_MESSAGE1")));
assertTrue("Check-out date error message expected.", browser
@@ -93,7 +89,7 @@
// set check in to past
browser.type(getProperty("HOTEL_CHECKIN_DATE_FIELD"), "01/01/1970");
browser.click(getProperty("HOTEL_PROCEED"));
- browser.waitForPageToLoad(TIMEOUT);
+ waitForForm();
assertTrue("Date verification #2 failed.", browser
.isTextPresent(getProperty("BOOKING_INVALID_DATE_MESSAGE2")));
assertTrue("Checkin-date error message expected.", browser
@@ -112,7 +108,6 @@
// make 3 bookings
for (int i = 0; i < 3; i++) {
int confirmationNumber = bookHotel(hotelNames[i]);
- assertNotSame("Booking process failed.", -1, confirmationNumber);
confirmationNumbers[i] = confirmationNumber;
}
// assert that there bookings are listed in hotel booking list
@@ -138,7 +133,7 @@
protected int bookHotel(String hotelName, int bed, int smoking,
String creditCard, String creditCardName) {
if (!isLoggedIn())
- return -1;
+ fail();
if (!browser.isElementPresent(getProperty("SEARCH_SUBMIT"))) {
browser.open(getProperty("MAIN_PAGE"));
browser.waitForPageToLoad(TIMEOUT);
@@ -160,15 +155,12 @@
browser.waitForPageToLoad(TIMEOUT);
// main page
String message = browser.getText(getProperty("HOTEL_MESSAGE"));
- if (message.matches(MessageFormat.format(
- getProperty("BOOKING_CONFIRMATION_MESSAGE"), EXPECTED_NAME, hotelName))) {
+ assertTrue("Booking failed. Confirmation message does not match.", message.matches(
+ MessageFormat.format(getProperty("BOOKING_CONFIRMATION_MESSAGE"), EXPECTED_NAME, hotelName)));
String[] messageParts = message.split(" ");
int confirmationNumber = Integer
.parseInt(messageParts[messageParts.length - 1]);
return confirmationNumber;
- } else {
- return -1;
- }
}
protected int bookHotel(String hotelName) {
@@ -189,5 +181,6 @@
}
protected void populateBookingFields() {
+ populateBookingFields(2, 0, CREDIT_CARD, CREDIT_CARD_NAME);
}
}
15 years, 6 months
Seam SVN: r9505 - in branches/enterprise/JBPAPP_4_3_FP01/src: test/unit/org/jboss/seam/test/unit and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-11-05 05:01:54 -0500 (Wed, 05 Nov 2008)
New Revision: 9505
Added:
branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java
Modified:
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/core/BijectionInterceptor.java
branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/InterceptorTest.java
Log:
JBPAPP-1122
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/core/BijectionInterceptor.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/core/BijectionInterceptor.java 2008-11-04 23:54:11 UTC (rev 9504)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/core/BijectionInterceptor.java 2008-11-05 10:01:54 UTC (rev 9505)
@@ -1,13 +1,13 @@
//$Id$
package org.jboss.seam.core;
+import java.util.concurrent.locks.ReentrantLock;
+
import org.jboss.seam.Component;
import org.jboss.seam.annotations.intercept.AroundInvoke;
import org.jboss.seam.annotations.intercept.Interceptor;
import org.jboss.seam.intercept.AbstractInterceptor;
import org.jboss.seam.intercept.InvocationContext;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
/**
* Before invoking the component, inject all dependencies. After
@@ -20,40 +20,89 @@
{
private static final long serialVersionUID = 4686458105931528659L;
- private static final LogProvider log = Logging.getLogProvider(BijectionInterceptor.class);
+ private boolean injected;
- private boolean reentrant; //OK, since all Seam components are single-threaded
+ private int counter = 0;
+ private ReentrantLock lock = new ReentrantLock();
+
@AroundInvoke
public Object aroundInvoke(InvocationContext invocation) throws Exception
{
- if (reentrant)
+ Component component = getComponent();
+ boolean enforceRequired = !component.isLifecycleMethod( invocation.getMethod() );
+
+ try
{
- if ( log.isTraceEnabled() )
+ lock.lock();
+ try
{
- log.trace("reentrant call to component: " + getComponent().getName() );
+ if (!injected)
+ {
+ component.inject( invocation.getTarget(), enforceRequired );
+ injected = true;
+ }
+ counter++;
}
- return invocation.proceed();
- }
- else
- {
- reentrant = true;
+
+ finally
+ {
+ lock.unlock();
+ }
+
+ Object result = invocation.proceed();
+
+ lock.lock();
try
{
- Component component = getComponent();
- boolean enforceRequired = !component.isLifecycleMethod( invocation.getMethod() );
- component.inject( invocation.getTarget(), enforceRequired );
- Object result = invocation.proceed();
- component.outject( invocation.getTarget(), enforceRequired );
- component.disinject( invocation.getTarget() );
- return result;
+ counter--;
+ if (counter == 0)
+ {
+ try
+ {
+ component.outject( invocation.getTarget(), enforceRequired );
+ }
+ finally
+ {
+ // Avoid an extra lock by disinjecting here instead of the finally block
+ if (injected)
+ {
+ injected = false;
+ component.disinject( invocation.getTarget() );
+ }
+ }
+ }
}
finally
{
- reentrant = false;
+ lock.unlock();
}
+
+ return result;
}
+ finally
+ {
+ if (injected)
+ {
+ lock.lock();
+ try
+ {
+ component.disinject( invocation.getTarget() );
+ counter--;
+
+ if (counter == 0)
+ {
+ injected = false;
+ }
+ }
+ finally
+ {
+ lock.unlock();
+ }
+
+ }
+ }
}
}
Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java 2008-11-05 10:01:54 UTC (rev 9505)
@@ -0,0 +1,23 @@
+ package org.jboss.seam.test.unit;
+import java.util.concurrent.CountDownLatch;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+@Name("fooBar")
+(a)Scope(ScopeType.APPLICATION)
+public class FooBar
+{
+ @In Foo foo;
+
+ public Foo delayedGetFoo(CountDownLatch latch)
+ {
+ try
+ {
+ latch.await();
+ }
+ catch (InterruptedException ex) {}
+
+ return foo;
+ }
+}
\ No newline at end of file
Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/FooBar.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/InterceptorTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/InterceptorTest.java 2008-11-04 23:54:11 UTC (rev 9504)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/InterceptorTest.java 2008-11-05 10:01:54 UTC (rev 9505)
@@ -2,6 +2,7 @@
package org.jboss.seam.test.unit;
import java.lang.reflect.Method;
+import java.util.concurrent.CountDownLatch;
import javax.faces.context.ExternalContext;
import javax.faces.event.PhaseId;
@@ -25,6 +26,7 @@
import org.jboss.seam.core.Manager;
import org.jboss.seam.ejb.RemoveInterceptor;
import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.intercept.InvocationContext;
import org.jboss.seam.mock.MockApplication;
import org.jboss.seam.mock.MockExternalContext;
import org.jboss.seam.mock.MockFacesContext;
@@ -235,6 +237,101 @@
}
@Test
+ public void testReentrantBijection() throws Exception
+ {
+ MockServletContext servletContext = new MockServletContext();
+ ServletLifecycle.beginApplication(servletContext);
+ MockExternalContext externalContext = new MockExternalContext(servletContext);
+ Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
+ appContext.set( Seam.getComponentName(Init.class), new Init() );
+ appContext.set( Seam.getComponentName(ConversationEntries.class) + ".component",
+ new Component(ConversationEntries.class, appContext) );
+ appContext.set( Seam.getComponentName(Manager.class) + ".component",
+ new Component(Manager.class, appContext) );
+ appContext.set( Seam.getComponentName(Foo.class) + ".component",
+ new Component(Foo.class, appContext) );
+ appContext.set( Seam.getComponentName(FooBar.class) + ".component",
+ new Component(FooBar.class, appContext) );
+ FacesLifecycle.beginRequest(externalContext);
+ Manager.instance().setCurrentConversationId("1");
+ FacesLifecycle.resumeConversation(externalContext);
+ FacesLifecycle.setPhaseId(PhaseId.RENDER_RESPONSE);
+
+ final Foo foo = new Foo();
+ final FooBar fooBar = new FooBar();
+ Contexts.getSessionContext().set("foo", foo);
+
+ final BijectionInterceptor bi = new BijectionInterceptor();
+ bi.setComponent( new Component(FooBar.class, appContext) );
+
+ final Method m = FooBar.class.getMethod("delayedGetFoo", CountDownLatch.class);
+
+ final CountDownLatch latchA = new CountDownLatch(1);
+ final CountDownLatch latchB = new CountDownLatch(1);
+ final CountDownLatch latchC = new CountDownLatch(1);
+ final CountDownLatch latchD = new CountDownLatch(1);
+
+ final InvocationContext invocationA = new MockInvocationContext() {
+ @Override public Object getTarget() { return fooBar; }
+ @Override public Method getMethod() { return m; }
+ @Override public Object[] getParameters() { return new Object[] { latchA }; }
+ };
+ final InvocationContext invocationB = new MockInvocationContext() {
+ @Override public Object getTarget() { return fooBar; }
+ @Override public Method getMethod() { return m; }
+ @Override public Object[] getParameters() { return new Object[] { latchB }; }
+ };
+
+ new Thread(new Runnable() {
+ public void run() {
+ try
+ {
+ Foo result = (Foo) bi.aroundInvoke( invocationA );
+ assert result == foo;
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ finally
+ {
+ latchC.countDown();
+ }
+ }
+ }).start();
+
+ new Thread(new Runnable() {
+ public void run() {
+ try
+ {
+ Foo result = (Foo) bi.aroundInvoke( invocationB );
+ assert result == foo;
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ finally
+ {
+ latchD.countDown();
+ }
+ }
+ }).start();
+
+ // Allow invocationA to complete
+ latchA.countDown();
+
+ // Wait for invocationA to finalise
+ latchC.await();
+
+ // Allow invocationB to proceed
+ latchB.countDown();
+
+ // Wait for invocationB
+ latchD.await();
+ }
+
+ @Test
public void testConversationInterceptor() throws Exception
{
MockServletContext servletContext = new MockServletContext();
15 years, 6 months
Seam SVN: r9504 - branches/community/Seam_2_0/src/main/org/jboss/seam/contexts.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2008-11-04 18:54:11 -0500 (Tue, 04 Nov 2008)
New Revision: 9504
Modified:
branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/BusinessProcessContext.java
branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/Lifecycle.java
branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/TestLifecycle.java
Log:
JBSEAM-3656
Modified: branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/BusinessProcessContext.java
===================================================================
--- branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/BusinessProcessContext.java 2008-11-04 23:53:17 UTC (rev 9503)
+++ branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/BusinessProcessContext.java 2008-11-04 23:54:11 UTC (rev 9504)
@@ -35,13 +35,25 @@
private final Map<String, Object> additions = new HashMap<String, Object>();
private final Set<String> removals = new HashSet<String>();
+ private final boolean enabled;
public ScopeType getType()
{
return ScopeType.BUSINESS_PROCESS;
}
- public BusinessProcessContext() {}
+ public BusinessProcessContext()
+ {
+ Init init = Init.instance();
+ if (init == null)
+ {
+ enabled = false;
+ }
+ else
+ {
+ enabled = init.isJbpmInstalled();
+ }
+ }
public Object get(String name)
{
@@ -208,8 +220,7 @@
private org.jbpm.graph.exe.ProcessInstance getProcessInstance()
{
- Init init = Init.instance(); //may be null in some tests
- if ( init==null || !init.isJbpmInstalled() )
+ if (!enabled)
{
return null;
}
@@ -221,8 +232,7 @@
private org.jbpm.taskmgmt.exe.TaskInstance getTaskInstance()
{
- Init init = Init.instance(); //may be null in some tests
- if ( init==null || !init.isJbpmInstalled() )
+ if (!enabled)
{
return null;
}
Modified: branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/Lifecycle.java
===================================================================
--- branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/Lifecycle.java 2008-11-04 23:53:17 UTC (rev 9503)
+++ branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/Lifecycle.java 2008-11-04 23:54:11 UTC (rev 9504)
@@ -81,11 +81,11 @@
public static void beginCall()
{
log.debug( ">>> Begin call" );
+ Contexts.applicationContext.set( new ApplicationContext(getApplication()) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.sessionContext.set( new BasicContext(ScopeType.SESSION) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
Contexts.businessProcessContext.set( new BusinessProcessContext() );
- Contexts.applicationContext.set( new ApplicationContext(getApplication()) );
}
public static void endCall()
Modified: branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/TestLifecycle.java
===================================================================
--- branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/TestLifecycle.java 2008-11-04 23:53:17 UTC (rev 9503)
+++ branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/TestLifecycle.java 2008-11-04 23:54:11 UTC (rev 9504)
@@ -29,11 +29,11 @@
public static void beginTest(ServletContext context, Map<String, Object> session)
{
log.debug( ">>> Begin test" );
+ Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(context) ) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
Contexts.businessProcessContext.set( new BusinessProcessContext() );
Contexts.sessionContext.set( new SessionContext(session) );
- Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(context) ) );
}
public static void endTest()
15 years, 6 months
Seam SVN: r9503 - branches/community/Seam_2_0/src/main/org/jboss/seam/contexts.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2008-11-04 18:53:17 -0500 (Tue, 04 Nov 2008)
New Revision: 9503
Modified:
branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/PageContext.java
Log:
JBSEAM-3656
Modified: branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/PageContext.java
===================================================================
--- branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/PageContext.java 2008-11-04 23:52:08 UTC (rev 9502)
+++ branches/community/Seam_2_0/src/main/org/jboss/seam/contexts/PageContext.java 2008-11-04 23:53:17 UTC (rev 9503)
@@ -38,6 +38,7 @@
public class PageContext implements Context
{
+ private static final String PAGE_CONTEXT_PREFIX = ScopeType.PAGE.getPrefix() + '$';
private Map<String, Object> previousPageMap;
private Map<String, Object> nextPageMap;
@@ -59,7 +60,7 @@
private String getPrefix()
{
- return ScopeType.PAGE.getPrefix() + '$';
+ return PAGE_CONTEXT_PREFIX;
}
public Object get(String name)
15 years, 6 months