Yikes, good catch.

But the origin of this is really dangerous. 


It seems that Arquillian doesn't clean the contexts between @Test method 
invocations.

So any @Inject will always have the state of whatever test runs first. This 
will be a _huge_ problem once we go test JPA and JTA stuff.
Aslak, is there anything we can do against this?
I remember we talked about manual context control for arquillian tests already 
(for simulating multi-request use cases by simply stopping and restarting the 
request context).


LieGrue,
strub



----- Original Message -----
> From: "[email protected]" <[email protected]>
> To: [email protected]
> Cc: 
> Sent: Thursday, July 12, 2012 9:28 AM
> Subject: [1/3] git commit: Fix BeanProviderTest so order doesn't matter
> 
> Updated Branches:
>   refs/heads/master d5b0327e0 -> b1623a764
> 
> 
> Fix BeanProviderTest so order doesn't matter
> 
> Was seeing an issue (seems to be jvm dependent due to test ordering)
> where the test would fail because we didn't reset the bean's properties
> when we were done with the test.
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
> Commit: 
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/c021b63a
> Tree: 
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/c021b63a
> Diff: 
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/c021b63a
> 
> Branch: refs/heads/master
> Commit: c021b63ae3474ace10afb48ba1d1011030231d47
> Parents: d5b0327
> Author: Jason Porter <[email protected]>
> Authored: Wed Jul 11 09:22:42 2012 -0600
> Committer: Jason Porter <[email protected]>
> Committed: Thu Jul 12 01:27:46 2012 -0600
> 
> ----------------------------------------------------------------------
> .../test/core/api/provider/BeanProviderTest.java   |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/c021b63a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java
> ----------------------------------------------------------------------
> diff --git 
> a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java
>  
> b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java
> index 6348473..4a7ab2b 100644
> --- 
> a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java
> +++ 
> b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/provider/BeanProviderTest.java
> @@ -191,5 +191,7 @@ public class BeanProviderTest
>          TestBean testBean = 
> BeanProvider.getContextualReference(TestBean.class);
> 
>          Assert.assertEquals(newValue, testBean.getI());
> +
> +        testBean.setI(4711); // reset the value if this test is executed 
> first
>      }
> }
>

Reply via email to