deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-487 tests and minor cleanup
Date Fri, 28 Feb 2014 17:51:59 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 258bec620 -> 457e20da5


DELTASPIKE-487 tests and minor cleanup


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/457e20da
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/457e20da
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/457e20da

Branch: refs/heads/master
Commit: 457e20da50bdaa3be6b57b1f39e5d4717208d048
Parents: 258bec6
Author: gpetracek <gpetracek@apache.org>
Authored: Fri Feb 28 18:45:32 2014 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Fri Feb 28 18:47:51 2014 +0100

----------------------------------------------------------------------
 .../impl/scope/DeltaSpikeContextExtension.java  |   2 +-
 .../scope/viewaccess/ViewAccessContext.java     |  24 +-
 .../viewaccess/ViewAccessScopedBeanHistory.java |   5 -
 .../scope/viewaccess/ViewAccessScopedBeanX.java |  41 +++
 .../scope/viewaccess/ViewAccessScopedBeanY.java |  41 +++
 .../scope/viewaccess/ViewAccessScopedTest.java  | 254 +++++++++++++++++++
 6 files changed, 342 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/457e20da/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/DeltaSpikeContextExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/DeltaSpikeContextExtension.java
b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/DeltaSpikeContextExtension.java
index dfddff5..bf64c14 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/DeltaSpikeContextExtension.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/DeltaSpikeContextExtension.java
@@ -97,7 +97,7 @@ public class DeltaSpikeContextExtension implements Extension, Deactivatable
             BeanProvider.getContextualReference(beanManager, ViewAccessScopedBeanHolder.class,
false);
         ViewAccessScopedBeanHistory viewAccessScopedBeanHistory =
             BeanProvider.getContextualReference(beanManager, ViewAccessScopedBeanHistory.class,
false);
-        viewAccessScopedContext.init(viewAccessScopedBeanHolder, windowIdHolder, viewAccessScopedBeanHistory);
+        viewAccessScopedContext.init(viewAccessScopedBeanHolder, viewAccessScopedBeanHistory);
     }
 
     public WindowContextImpl getWindowContext()

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/457e20da/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
index f9ae8af..553d01d 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
@@ -20,24 +20,23 @@ package org.apache.deltaspike.core.impl.scope.viewaccess;
 
 import java.lang.annotation.Annotation;
 import java.util.Map;
-import javax.enterprise.context.ContextNotActiveException;
 import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.PassivationCapable;
 import org.apache.deltaspike.core.api.scope.ViewAccessScoped;
 import org.apache.deltaspike.core.impl.scope.window.WindowContextImpl;
-import org.apache.deltaspike.core.impl.scope.window.WindowIdHolder;
 import org.apache.deltaspike.core.util.context.AbstractContext;
 import org.apache.deltaspike.core.util.context.ContextualInstanceInfo;
 import org.apache.deltaspike.core.util.context.ContextualStorage;
 
 public class ViewAccessContext extends AbstractContext
 {
+    private static final String KEY = "VAS"; //TODO re-visit key (e.g. view-id instead of
using one big storage)
+
     private final BeanManager beanManager;
     private final WindowContextImpl windowContext;
 
-    private WindowIdHolder windowIdHolder;
     private ViewAccessScopedBeanHolder viewAccessScopedBeanHolder;
     private ViewAccessScopedBeanHistory viewAccessScopedBeanHistory;
     
@@ -49,11 +48,10 @@ public class ViewAccessContext extends AbstractContext
         this.windowContext = windowContext;
     }
 
-    public void init(ViewAccessScopedBeanHolder viewAccessScopedBeanHolder, WindowIdHolder
windowIdHolder,
+    public void init(ViewAccessScopedBeanHolder viewAccessScopedBeanHolder,
             ViewAccessScopedBeanHistory viewAccessScopedBeanHistory)
     {
         this.viewAccessScopedBeanHolder = viewAccessScopedBeanHolder;
-        this.windowIdHolder = windowIdHolder;
         this.viewAccessScopedBeanHistory = viewAccessScopedBeanHistory;
     }
 
@@ -94,13 +92,7 @@ public class ViewAccessContext extends AbstractContext
     @Override
     protected ContextualStorage getContextualStorage(Contextual<?> contextual, boolean
createIfNotExist)
     {
-        String windowId = getCurrentWindowId();
-        if (windowId == null)
-        {
-            throw new ContextNotActiveException("WindowContext: no windowId set for the current
Thread yet!");
-        }
-        
-        return this.viewAccessScopedBeanHolder.getContextualStorage(this.beanManager, windowId,
createIfNotExist);
+        return this.viewAccessScopedBeanHolder.getContextualStorage(this.beanManager, KEY,
createIfNotExist);
     }
 
     @Override
@@ -114,11 +106,6 @@ public class ViewAccessContext extends AbstractContext
     {
         return this.windowContext.isActive(); //autom. active once a window is active
     }
-    
-    public String getCurrentWindowId()
-    {
-        return windowIdHolder.getWindowId();
-    }
 
     public void onRenderingFinished(String view)
     {
@@ -136,8 +123,7 @@ public class ViewAccessContext extends AbstractContext
     
     private void destroyExpiredBeans()
     {
-        ContextualStorage storage =
-                viewAccessScopedBeanHolder.getContextualStorage(beanManager, getCurrentWindowId(),
false);
+        ContextualStorage storage = viewAccessScopedBeanHolder.getContextualStorage(beanManager,
KEY, false);
         if (storage != null)
         {
             for (Map.Entry<Object, ContextualInstanceInfo<?>> storageEntry :
storage.getStorage().entrySet())

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/457e20da/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
index e917301..390688b 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
@@ -37,11 +37,6 @@ public class ViewAccessScopedBeanHistory implements Serializable
         return accessedBeans;
     }
 
-    public void setAccessedBeans(List<String> accessedBeans)
-    {
-        this.accessedBeans = accessedBeans;
-    }
-
     public String getLastView()
     {
         return lastView;

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/457e20da/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedBeanX.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedBeanX.java
b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedBeanX.java
new file mode 100644
index 0000000..faa3a6c
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedBeanX.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.test.core.api.scope.viewaccess;
+
+import org.apache.deltaspike.core.api.scope.ViewAccessScoped;
+
+import java.io.Serializable;
+
+@ViewAccessScoped
+public class ViewAccessScopedBeanX implements Serializable
+{
+    private static final long serialVersionUID = -1291355584482007178L;
+
+    private String value;
+
+    public String getValue()
+    {
+        return value;
+    }
+
+    public void setValue(String value)
+    {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/457e20da/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedBeanY.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedBeanY.java
b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedBeanY.java
new file mode 100644
index 0000000..de19e83
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedBeanY.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.test.core.api.scope.viewaccess;
+
+import org.apache.deltaspike.core.api.scope.ViewAccessScoped;
+
+import java.io.Serializable;
+
+@ViewAccessScoped
+public class ViewAccessScopedBeanY implements Serializable
+{
+    private static final long serialVersionUID = -1291355584482007178L;
+
+    private String value;
+
+    public String getValue()
+    {
+        return value;
+    }
+
+    public void setValue(String value)
+    {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/457e20da/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedTest.java
b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedTest.java
new file mode 100644
index 0000000..42e0e0a
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/scope/viewaccess/ViewAccessScopedTest.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.test.core.api.scope.viewaccess;
+
+import org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension;
+import org.apache.deltaspike.core.spi.scope.window.WindowContext;
+import org.apache.deltaspike.test.category.SeCategory;
+import org.apache.deltaspike.test.util.ArchiveUtils;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import javax.inject.Inject;
+
+@RunWith(Arquillian.class)
+@Category(SeCategory.class)
+public class ViewAccessScopedTest
+{
+    @Deployment
+    public static WebArchive deploy()
+    {
+        String simpleName = ViewAccessScopedTest.class.getSimpleName();
+        String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
+
+        JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar")
+                .addPackage(ViewAccessScopedTest.class.getPackage().getName())
+                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+
+        return ShrinkWrap.create(WebArchive.class, archiveName + ".war")
+                .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
+                .addAsLibraries(testJar)
+                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+    }
+
+    @Inject
+    private WindowContext windowContext;
+
+    @Inject
+    private ViewAccessScopedBeanX viewAccessScopedBeanX;
+
+    @Inject
+    private ViewAccessScopedBeanY viewAccessScopedBeanY;
+
+    @Inject
+    private DeltaSpikeContextExtension contextExtension;
+
+    @Test
+    public void usageOnOnePageTest()
+    {
+        windowContext.activateWindow("w1");
+
+        viewAccessScopedBeanX.setValue("x1");
+        viewAccessScopedBeanY.setValue("y1");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        //no access
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+
+        windowContext.closeWindow("w1");
+
+        windowContext.activateWindow("w2");
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+        windowContext.closeWindow("w2");
+    }
+
+    @Test
+    public void usageOnOnePageTestAndNavigationAfterwards()
+    {
+        windowContext.activateWindow("w1");
+
+        viewAccessScopedBeanX.setValue("x1");
+        viewAccessScopedBeanY.setValue("y1");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewB");
+
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+
+        windowContext.closeWindow("w1");
+    }
+
+    @Test
+    public void usageOnTwoPagesTest1()
+    {
+        windowContext.activateWindow("w1");
+
+        viewAccessScopedBeanX.setValue("x1");
+        viewAccessScopedBeanY.setValue("y1");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewB");
+
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+
+        windowContext.closeWindow("w1");
+
+        windowContext.activateWindow("w2");
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+        windowContext.closeWindow("w2");
+    }
+
+    @Test
+    public void usageOnTwoPagesTest2()
+    {
+        windowContext.activateWindow("w1");
+
+        viewAccessScopedBeanX.setValue("x1");
+        viewAccessScopedBeanY.setValue("y1");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewB");
+
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+
+        windowContext.closeWindow("w1");
+
+        windowContext.activateWindow("w2");
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+        windowContext.closeWindow("w2");
+    }
+
+    @Test
+    public void usageOnOnePageDifferentRequests()
+    {
+        windowContext.activateWindow("w1");
+
+        viewAccessScopedBeanX.setValue("x1");
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+
+        viewAccessScopedBeanY.setValue("y1");
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        //no access
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+
+        windowContext.closeWindow("w1");
+
+        windowContext.activateWindow("w2");
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+        windowContext.closeWindow("w2");
+    }
+
+    @Test
+    public void usageOnOnePageDifferentRequestsAndNavigationAfterwards1()
+    {
+        windowContext.activateWindow("w1");
+
+        viewAccessScopedBeanX.setValue("x1");
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+
+        viewAccessScopedBeanY.setValue("y1");
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewB");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+
+        windowContext.closeWindow("w1");
+
+        windowContext.activateWindow("w2");
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+        windowContext.closeWindow("w2");
+    }
+
+    @Test
+    public void usageOnOnePageDifferentRequestsAndNavigationAfterwards2()
+    {
+        windowContext.activateWindow("w1");
+
+        viewAccessScopedBeanX.setValue("x1");
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("x1", viewAccessScopedBeanX.getValue());
+
+        viewAccessScopedBeanY.setValue("y1");
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewA");
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+
+        contextExtension.getViewAccessScopedContext().onRenderingFinished("viewB");
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertEquals("y1", viewAccessScopedBeanY.getValue());
+
+        windowContext.closeWindow("w1");
+
+        windowContext.activateWindow("w2");
+        Assert.assertNull(viewAccessScopedBeanX.getValue());
+        Assert.assertNull(viewAccessScopedBeanY.getValue());
+        windowContext.closeWindow("w2");
+    }
+}


Mime
View raw message