[jboss-cvs] jboss-seam/src/test/misc/org/jboss/seam/test ...
Gavin King
gavin.king at jboss.com
Mon Jun 25 12:49:39 EDT 2007
User: gavin
Date: 07/06/25 12:49:39
Modified: src/test/misc/org/jboss/seam/test ComponentTest.java
Foo.java InterceptorTest.java
Log:
its 2.0, so I can remove stuff I hate :)
Revision Changes Path
1.10 +1 -9 jboss-seam/src/test/misc/org/jboss/seam/test/ComponentTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ComponentTest.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/test/misc/org/jboss/seam/test/ComponentTest.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- ComponentTest.java 20 Jun 2007 17:47:21 -0000 1.9
+++ ComponentTest.java 25 Jun 2007 16:49:39 -0000 1.10
@@ -1,4 +1,4 @@
-//$Id: ComponentTest.java,v 1.9 2007/06/20 17:47:21 gavin Exp $
+//$Id: ComponentTest.java,v 1.10 2007/06/25 16:49:39 gavin Exp $
package org.jboss.seam.test;
import org.jboss.seam.Component;
@@ -44,7 +44,6 @@
assert c.getUnwrapMethod()==null;
assert c.getOutAttributes().size()==2;
assert c.getRemoveMethods().size()==0;
- assert c.getValidateMethods().size()==0;
assert c.isInstance( new Bar() );
c = new Component(Foo.class);
@@ -60,7 +59,6 @@
assert c.getUnwrapMethod()==null;
assert c.getOutAttributes().size()==0;
assert c.getRemoveMethods().size()==1;
- assert c.getValidateMethods().size()==1;
assert c.isInstance( new Foo() );
c = new Component(EjbBean.class);
@@ -76,7 +74,6 @@
assert c.getUnwrapMethod()==null;
assert c.getOutAttributes().size()==0;
assert c.getRemoveMethods().size()==1;
- assert c.getValidateMethods().size()==0;
assert c.isInstance( new Ejb() {
public void destroy() {}
public void foo() {}
@@ -98,7 +95,6 @@
assert c.getUnwrapMethod()==null;
assert c.getOutAttributes().size()==0;
assert c.getRemoveMethods().size()==0;
- assert c.getValidateMethods().size()==0;
c = new Component(Init.class);
assert c.getName().equals("org.jboss.seam.settings");
@@ -113,8 +109,6 @@
assert c.getUnwrapMethod()==null;
assert c.getOutAttributes().size()==0;
assert c.getRemoveMethods().size()==0;
- assert c.getValidateMethods().size()==0;
-
c = new Component(ManagedPersistenceContext.class, "pc");
assert c.getName().equals("pc");
assert c.getBeanClass()==ManagedPersistenceContext.class;
@@ -128,7 +122,6 @@
assert c.getUnwrapMethod().getName().equals("getEntityManager");
assert c.getOutAttributes().size()==0;
assert c.getRemoveMethods().size()==0;
- assert c.getValidateMethods().size()==0;
c = new Component(ManagedHibernateSession.class, "pc");
assert c.getName().equals("pc");
@@ -143,6 +136,5 @@
assert c.getUnwrapMethod().getName().equals("getSession");
assert c.getOutAttributes().size()==0;
assert c.getRemoveMethods().size()==0;
- assert c.getValidateMethods().size()==0;
}
}
1.8 +1 -3 jboss-seam/src/test/misc/org/jboss/seam/test/Foo.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Foo.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/test/misc/org/jboss/seam/test/Foo.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- Foo.java 21 Dec 2006 02:38:29 -0000 1.7
+++ Foo.java 25 Jun 2007 16:49:39 -0000 1.8
@@ -14,13 +14,12 @@
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.End;
-import org.jboss.seam.annotations.IfInvalid;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
/**
* @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
@Name("foo")
@Scope(ScopeType.SESSION)
@@ -47,7 +46,6 @@
this.value = value;
}
- @IfInvalid(outcome="baz")
public String bar()
{
return "bar";
1.35 +2 -81 jboss-seam/src/test/misc/org/jboss/seam/test/InterceptorTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InterceptorTest.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/test/misc/org/jboss/seam/test/InterceptorTest.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- InterceptorTest.java 20 Jun 2007 08:23:20 -0000 1.34
+++ InterceptorTest.java 25 Jun 2007 16:49:39 -0000 1.35
@@ -1,10 +1,9 @@
-//$Id: InterceptorTest.java,v 1.34 2007/06/20 08:23:20 gavin Exp $
+//$Id: InterceptorTest.java,v 1.35 2007/06/25 16:49:39 gavin Exp $
package org.jboss.seam.test;
import java.lang.reflect.Method;
import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
import org.jboss.seam.Component;
@@ -26,7 +25,6 @@
import org.jboss.seam.interceptors.ConversationInterceptor;
import org.jboss.seam.interceptors.ConversationalInterceptor;
import org.jboss.seam.interceptors.RemoveInterceptor;
-import org.jboss.seam.interceptors.ValidationInterceptor;
import org.jboss.seam.mock.MockApplication;
import org.jboss.seam.mock.MockExternalContext;
import org.jboss.seam.mock.MockFacesContext;
@@ -531,7 +529,7 @@
try
{
- String result = (String) ci.aroundInvoke( new MockInvocationContext() {
+ ci.aroundInvoke( new MockInvocationContext() {
@Override
public Method getMethod()
{
@@ -643,83 +641,6 @@
Manager.instance().setCurrentConversationId("1");
FacesLifecycle.resumeConversation(externalContext);
- ValidationInterceptor vi = new ValidationInterceptor();
- vi.setComponent( new Component(Foo.class, appContext) );
-
- final Foo foo = new Foo();
-
- String result = (String) vi.aroundInvoke( new MockInvocationContext() {
- @Override
- public Method getMethod()
- {
- return InterceptorTest.getMethod("foo");
- }
- @Override
- public Object getTarget()
- {
- return foo;
- }
-
- @Override
- public Object proceed() throws Exception
- {
- return foo.foo();
- }
- });
-
- assert "foo".equals(result);
- FacesMessages.afterPhase();
- FacesMessages.instance().beforeRenderResponse();
- assert !FacesContext.getCurrentInstance().getMessages().hasNext();
-
- result = (String) vi.aroundInvoke( new MockInvocationContext() {
- @Override
- public Method getMethod()
- {
- return InterceptorTest.getMethod("bar");
- }
- @Override
- public Object getTarget()
- {
- return foo;
- }
-
- @Override
- public Object proceed() throws Exception
- {
- assert false;
- return foo.bar();
- }
- });
-
- assert "baz".equals(result);
- FacesMessages.afterPhase();
- FacesMessages.instance().beforeRenderResponse();
- assert FacesContext.getCurrentInstance().getMessages().hasNext();
-
- foo.setValue("not null");
-
- result = (String) vi.aroundInvoke( new MockInvocationContext() {
- @Override
- public Method getMethod()
- {
- return InterceptorTest.getMethod("bar");
- }
- @Override
- public Object getTarget()
- {
- return foo;
- }
-
- @Override
- public Object proceed() throws Exception
- {
- return foo.bar();
- }
- });
-
- assert "bar".equals(result);
-
ServletLifecycle.endApplication();
}
More information about the jboss-cvs-commits
mailing list