[seam-commits] Seam SVN: r12209 - modules/faces/trunk/src/test/java/org/jboss/seam/faces/event.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Mar 17 08:18:23 EDT 2010


Author: nickarls
Date: 2010-03-17 08:18:22 -0400 (Wed, 17 Mar 2010)
New Revision: 12209

Modified:
   modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java
   modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java
Log:
cleanup

Modified: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java	2010-03-17 12:13:29 UTC (rev 12208)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/PhaseListenerTests.java	2010-03-17 12:18:22 UTC (rev 12209)
@@ -10,7 +10,7 @@
 import org.jboss.shrinkwrap.api.Archives;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
-import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.jboss.test.faces.mock.context.MockFacesContext;
 import org.jboss.test.faces.mock.lifecycle.MockLifecycle;
 import org.testng.annotations.Test;
 
@@ -28,90 +28,90 @@
 
    @Inject PhaseEventListener phaseEventListener;
 
-   private MockFacesEnvironment environment = MockFacesEnvironment.createEnvironment();
+   private MockFacesContext facesContext = new MockFacesContext();
    private MockLifecycle lifecycle = new MockLifecycle();
    
    @Test
    public void testBeforeRenderResponseObserver()
    {
-      phaseEventListener.beforePhase(new PhaseEvent(environment.getFacesContext(), PhaseId.RENDER_RESPONSE, lifecycle));
+      phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, lifecycle));
       assert PhaseListenerObserver.observeBeforeRenderResponse;
    }
    
    @Test
    public void testAfterRenderResponseObserver()
    {
-      phaseEventListener.afterPhase(new PhaseEvent(environment.getFacesContext(), PhaseId.RENDER_RESPONSE, lifecycle));
+      phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, lifecycle));
       assert PhaseListenerObserver.observeAfterRenderResponse;
    }
    
    @Test
    public void testBeforeApplyRequestValuesObserver()
    {
-      phaseEventListener.beforePhase(new PhaseEvent(environment.getFacesContext(), PhaseId.APPLY_REQUEST_VALUES, lifecycle));
+      phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES, lifecycle));
       assert PhaseListenerObserver.observeBeforeApplyRequestValues;
    }
    
    @Test
    public void testAfterApplyRequestValuesObserver()
    {
-      phaseEventListener.afterPhase(new PhaseEvent(environment.getFacesContext(), PhaseId.APPLY_REQUEST_VALUES, lifecycle));
+      phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES, lifecycle));
       assert PhaseListenerObserver.observeAfterApplyRequestValues;
    }   
 
    @Test
    public void testBeforeInvokeApplicationObserver()
    {
-      phaseEventListener.beforePhase(new PhaseEvent(environment.getFacesContext(), PhaseId.INVOKE_APPLICATION, lifecycle));
+      phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, lifecycle));
       assert PhaseListenerObserver.observeBeforeInvokeApplication;
    }
    
    @Test
    public void testAfterInvokeApplicationObserver()
    {
-      phaseEventListener.afterPhase(new PhaseEvent(environment.getFacesContext(), PhaseId.INVOKE_APPLICATION, lifecycle));
+      phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, lifecycle));
       assert PhaseListenerObserver.observeAfterInvokeApplication;
    }   
 
    @Test
    public void testBeforeProcessValidationsObserver()
    {
-      phaseEventListener.beforePhase(new PhaseEvent(environment.getFacesContext(), PhaseId.PROCESS_VALIDATIONS, lifecycle));
+      phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.PROCESS_VALIDATIONS, lifecycle));
       assert PhaseListenerObserver.observeBeforeProcessValidations;
    }
    
    @Test
    public void testAfterProcessValidationsObserver()
    {
-      phaseEventListener.afterPhase(new PhaseEvent(environment.getFacesContext(), PhaseId.PROCESS_VALIDATIONS, lifecycle));
+      phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.PROCESS_VALIDATIONS, lifecycle));
       assert PhaseListenerObserver.observeAfterProcessValidations;
    }   
 
    @Test
    public void testBeforeRestoreViewObserver()
    {
-      phaseEventListener.beforePhase(new PhaseEvent(environment.getFacesContext(), PhaseId.RESTORE_VIEW, lifecycle));
+      phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, lifecycle));
       assert PhaseListenerObserver.observeBeforeRestoreView;
    }
    
    @Test
    public void testAfterRestoreViewObserver()
    {
-      phaseEventListener.afterPhase(new PhaseEvent(environment.getFacesContext(), PhaseId.RESTORE_VIEW, lifecycle));
+      phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, lifecycle));
       assert PhaseListenerObserver.observeAfterRestoreView;
    }   
 
    @Test
    public void testBeforeUpdateModelValuesObserver()
    {
-      phaseEventListener.beforePhase(new PhaseEvent(environment.getFacesContext(), PhaseId.UPDATE_MODEL_VALUES, lifecycle));
+      phaseEventListener.beforePhase(new PhaseEvent(facesContext, PhaseId.UPDATE_MODEL_VALUES, lifecycle));
       assert PhaseListenerObserver.observeBeforeUpdateModelValues;
    }
    
    @Test
    public void testAfterUpdateModelValuesObserver()
    {
-      phaseEventListener.afterPhase(new PhaseEvent(environment.getFacesContext(), PhaseId.UPDATE_MODEL_VALUES, lifecycle));
+      phaseEventListener.afterPhase(new PhaseEvent(facesContext, PhaseId.UPDATE_MODEL_VALUES, lifecycle));
       assert PhaseListenerObserver.observeAfterUpdateModelValues;
    }   
 

Modified: modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java
===================================================================
--- modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java	2010-03-17 12:13:29 UTC (rev 12208)
+++ modules/faces/trunk/src/test/java/org/jboss/seam/faces/event/SystemEventListenerTests.java	2010-03-17 12:18:22 UTC (rev 12209)
@@ -2,7 +2,6 @@
 
 import java.util.HashMap;
 
-import javax.faces.application.Application;
 import javax.faces.event.ComponentSystemEvent;
 import javax.faces.event.ExceptionQueuedEvent;
 import javax.faces.event.ExceptionQueuedEventContext;
@@ -19,10 +18,9 @@
 import org.jboss.shrinkwrap.api.Archives;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
-import org.jboss.test.faces.mock.MockFacesEnvironment;
 import org.jboss.test.faces.mock.application.MockApplication;
 import org.jboss.test.faces.mock.component.MockUIComponent;
-import org.jboss.test.faces.mock.lifecycle.MockLifecycle;
+import org.jboss.test.faces.mock.context.MockFacesContext;
 import org.testng.annotations.Test;
 
 @Test
@@ -39,7 +37,7 @@
    
    @Inject SystemEventListener systemEventListener;
 
-   private MockFacesEnvironment environment = MockFacesEnvironment.createEnvironment();
+   private MockFacesContext facesContext = new MockFacesContext();
    private MockApplication application = new MockApplication();
    
    @SuppressWarnings("serial")
@@ -53,7 +51,7 @@
    @Test
    public void testExceptionQueuedEventObserver()
    {
-      ExceptionQueuedEventContext eqec = new ExceptionQueuedEventContext(environment.getFacesContext(), new NullPointerException());
+      ExceptionQueuedEventContext eqec = new ExceptionQueuedEventContext(facesContext, new NullPointerException());
       ExceptionQueuedEvent eqe = new ExceptionQueuedEvent(eqec);
       systemEventListener.processEvent(eqe);
       assert SystemEventObserver.excecptionQueuedEvent;



More information about the seam-commits mailing list