[jboss-cvs] jboss-seam/src/test/integration/src/org/jboss/seam/test/integration ...
Peter Muir
peter at bleepbleep.org.uk
Fri Oct 12 06:26:48 EDT 2007
User: pmuir
Date: 07/10/12 06:26:48
Modified: src/test/integration/src/org/jboss/seam/test/integration
testng.xml IdentifierTest.java
Added: src/test/integration/src/org/jboss/seam/test/integration
ELTest.java
Log:
Move some tests around, add hibernate entity identifier tests
Revision Changes Path
1.4 +13 -0 jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/testng.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: testng.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/testng.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testng.xml 11 Oct 2007 15:07:30 -0000 1.3
+++ testng.xml 12 Oct 2007 10:26:48 -0000 1.4
@@ -20,10 +20,23 @@
</classes>
</test>
+ <test name="Seam Core - Integration: EL">
+ <classes>
+ <class name="org.jboss.seam.test.integration.ELTest"/>
+ </classes>
+ </test>
+
<test name="Seam Core - Integration: Framework">
<classes>
<class name="org.jboss.seam.test.integration.IdentifierTest"/>
</classes>
</test>
+ <test name="Seam Core - Integration: i8ln">
+ <classes>
+ <class name="org.jboss.seam.test.integration.i8ln.TimeZoneTest"/>
+ <class name="org.jboss.seam.test.integration.i8ln.LocaleTest"/>
+ </classes>
+ </test>
+
</suite>
\ No newline at end of file
1.3 +0 -1 jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/IdentifierTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: IdentifierTest.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/IdentifierTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- IdentifierTest.java 11 Oct 2007 15:24:40 -0000 1.2
+++ IdentifierTest.java 12 Oct 2007 10:26:48 -0000 1.3
@@ -2,7 +2,6 @@
import javax.persistence.EntityManager;
-import org.drools.lang.DRLParser.identifier_return;
import org.hibernate.Session;
import org.jboss.seam.framework.EntityIdentifier;
import org.jboss.seam.framework.HibernateEntityIdentifier;
1.1 date: 2007/10/12 10:26:48; author: pmuir; state: Exp;jboss-seam/src/test/integration/src/org/jboss/seam/test/integration/ELTest.java
Index: ELTest.java
===================================================================
package org.jboss.seam.test.integration;
import javax.el.ELException;
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
import org.jboss.seam.jsf.UnifiedELMethodBinding;
import org.jboss.seam.jsf.UnifiedELValueBinding;
import org.jboss.seam.mock.SeamTest;
import org.testng.annotations.Test;
/**
*
* @author Pete Muir
*
*/
public class ELTest extends SeamTest
{
@Override
protected void startJbossEmbeddedIfNecessary()
throws org.jboss.deployers.spi.DeploymentException ,java.io.IOException {}
@Test
public void testUnifiedELMethodBinding() throws Exception
{
new FacesRequest()
{
@SuppressWarnings("deprecation")
@Override
protected void invokeApplication() throws Exception
{
MethodBinding methodBinding = new UnifiedELMethodBinding("#{action.go}", new Class[0]);
assert "#{action.go}".equals(methodBinding.getExpressionString());
assert String.class.equals(methodBinding.getType(getFacesContext()));
Object result = methodBinding.invoke(getFacesContext(), new Object[0]);
assert result instanceof String;
assert "success".equals(result);
}
}.run();
}
@Test
public void testUnifiedELMethodBindingWithNull() throws Exception
{
new FacesRequest()
{
@SuppressWarnings("deprecation")
@Override
protected void invokeApplication() throws Exception
{
MethodBinding methodBinding = new UnifiedELMethodBinding("#{action.go}", null);
assert String.class.equals(methodBinding.getType(getFacesContext()));
Object result = methodBinding.invoke(getFacesContext(), null);
assert result instanceof String;
assert "success".equals(result);
}
}.run();
}
@Test
public void testEmptyUnifiedELMethodBinding() throws Exception
{
new FacesRequest()
{
@SuppressWarnings("deprecation")
@Override
protected void invokeApplication() throws Exception
{
MethodBinding methodBinding = new UnifiedELMethodBinding();
boolean failed = false;
try
{
methodBinding.invoke(getFacesContext(), null);
}
catch (ELException e) {
failed = true;
}
assert failed;
}
}.run();
}
@Test
public void testUnifiedELValueBinding() throws Exception
{
new FacesRequest()
{
@SuppressWarnings("deprecation")
@Override
protected void invokeApplication() throws Exception
{
ValueBinding valueBinding = new UnifiedELValueBinding("#{person.name}");
assert "#{person.name}".equals(valueBinding.getExpressionString());
assert !valueBinding.isReadOnly(getFacesContext());
assert String.class.equals(valueBinding.getType(getFacesContext()));
valueBinding.setValue(getFacesContext(), "Pete");
assert "Pete".equals(valueBinding.getValue(getFacesContext()));
}
}.run();
}
@Test
public void testEmptyUnifiedELValueBinding() throws Exception
{
new FacesRequest()
{
@SuppressWarnings("deprecation")
@Override
protected void invokeApplication() throws Exception
{
ValueBinding valueBinding = new UnifiedELValueBinding();
boolean failed = false;
try
{
valueBinding.setValue(getFacesContext(), "Pete");
valueBinding.getValue(getFacesContext());
}
catch (ELException e) {
failed = true;
}
assert failed;
}
}.run();
}
}
More information about the jboss-cvs-commits
mailing list