deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: [1/3] git commit: Fix BeanProviderTest so order doesn't matter
Date Thu, 12 Jul 2012 09:05:12 GMT
with something like public void observes(@Observes final
EventContext<ClassEvent> event) { (probably with a fixed event and not a
classevent) we should be able to reset class attributes

then being null testenricher will inject again

- Romain


2012/7/12 Mark Struberg <struberg@yahoo.de>

> 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: "lightguardjp@apache.org" <lightguardjp@apache.org>
> > To: deltaspike-commits@incubator.apache.org
> > 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 <lightguardjp@apache.org>
> > Authored: Wed Jul 11 09:22:42 2012 -0600
> > Committer: Jason Porter <lightguardjp@apache.org>
> > 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
> >      }
> > }
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message