You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Gurkan Erdogdu <gu...@yahoo.com> on 2009/01/18 09:55:43 UTC

Re: Context map question

Hi;

I will check it via spec Mark! And also its great to start TCK stuffs.

Thanks;

/Gurkan




________________________________
From: Mark Struberg <st...@yahoo.de>
To: openwebbeans-dev@incubator.apache.org
Sent: Sunday, January 18, 2009 12:18:07 AM
Subject: Context map question 

Hi!

I'm currently doing my first TCK runs and came to the following point I do not understand:

One of the tests [1] checks that it's not possible to to store 2 active Contexts for a Scope.

This works, but apart of that, our code seems to be even more restrictive:
ManagerImpl#contextMap is a Map, and the key is the scope.

So it will not be possible to store 1 active Context and other inactive Contexts.

I'm note sure if this is needed in praxis, but that's what the TCK says.

Although: 
> 9.1 The Context Interface
> The isActive() method returns false when the scope of the context 
> object is inactive, and true when it is active.
sounds more like gurkans implementation is correct!?

Any ideas?

txs and LieGrue,
strub

[1] webbeans-tck-impl org.jboss.webbeans.tck.tests.context.ContextTest#testGetContextWithTooManyActiveContextsFails

   @Test(expectedExceptions={IllegalArgumentException.class}, groups={"manager"}) @SpecAssertion(section="8.6")
   public void testGetContextWithTooManyActiveContextsFails()
   {
      Context firstContext = new DummyContext() {};
      Context secondContext = new DummyContext() {};
      manager.addContext(firstContext);
      manager.addContext(secondContext);
      manager.getContext(Dummy.class);
   }

in this test 'secondContext' simply overrides the 'firstContext' and getContext(Dummy.class) wont have problems getting the proper context.


      

Re: Context map question

Posted by Mark Struberg <st...@yahoo.de>.
If someone is interested in the TCKs integration at this early point:

You can take a look at the first TCK integration it via

$> git-clone http://ns1.backwork.net/git/openwebbeans.git
$> cd openwebbeans
$> git-pull http://ns1.backwork.net/git/openwebbeans.git tck:tck
$> git-checkout tck

Please note that you have to checkout and locally mvn install the TCKs from JBoss SVN
svn co http://anonsvn.jboss.org/repos/webbeans/tck/trunk


how does it work:

I've added the maven-jar-plugin to generate an attached test-jars artifact. 
This will be referenced in the webbeans-tck/pom.xml since the TCK integration needs MockManager, etc from the impl tests.

The TCKs pom first copies the TestNG suite.xml configuration to ./target/dependency/webbeans-tck-impl-version-suite.xml and tells the surefire plugin to execute those tests.

The tests are solely in the JBoss jars, all necessary callbacks are invoked via the interfaces to the classes in src/test/java (configuraion via properties in src/test/resources).

now you should be able to do a 
$> mvn test
 - but don't expect it to pass ;)

If you like to debug through with Eclipse, then you need the TestNG integration. 
Since Eclipse does not detect Test classes which resides in a jar file, we have to set the class ourself:
Debug As -> Debug Configuration -> New TestNG
give it a name (e.g. "webbeans TCK ContextTest") and set the proper test class e.g.:
org.jboss.webbeans.tck.tests.context.ContextTest

voila.

There is still a lot to do, sometimes we will see problems in our implementation, but there are also not all things golden on the TCK side. I'll check this with Peter Muir if I'm sure that the test cases and the spec do not match.

LieGrue,
strub

--- Gurkan Erdogdu <gu...@yahoo.com> schrieb am So, 18.1.2009:

> Von: Gurkan Erdogdu <gu...@yahoo.com>
> Betreff: Re: Context map question
> An: openwebbeans-dev@incubator.apache.org
> Datum: Sonntag, 18. Januar 2009, 9:55
> Hi;
> 
> I will check it via spec Mark! And also its great to start
> TCK stuffs.
> 
> Thanks;
> 
> /Gurkan
> 
> 
> 
> 
> ________________________________
> From: Mark Struberg <st...@yahoo.de>
> To: openwebbeans-dev@incubator.apache.org
> Sent: Sunday, January 18, 2009 12:18:07 AM
> Subject: Context map question 
> 
> Hi!
> 
> I'm currently doing my first TCK runs and came to the
> following point I do not understand:
> 
> One of the tests [1] checks that it's not possible to
> to store 2 active Contexts for a Scope.
> 
> This works, but apart of that, our code seems to be even
> more restrictive:
> ManagerImpl#contextMap is a Map, and the key is the scope.
> 
> So it will not be possible to store 1 active Context and
> other inactive Contexts.
> 
> I'm note sure if this is needed in praxis, but
> that's what the TCK says.
> 
> Although: 
> > 9.1 The Context Interface
> > The isActive() method returns false when the scope of
> the context 
> > object is inactive, and true when it is active.
> sounds more like gurkans implementation is correct!?
> 
> Any ideas?
> 
> txs and LieGrue,
> strub
> 
> [1] webbeans-tck-impl
> org.jboss.webbeans.tck.tests.context.ContextTest#testGetContextWithTooManyActiveContextsFails
> 
>   
> @Test(expectedExceptions={IllegalArgumentException.class},
> groups={"manager"})
> @SpecAssertion(section="8.6")
>    public void
> testGetContextWithTooManyActiveContextsFails()
>    {
>       Context firstContext = new DummyContext() {};
>       Context secondContext = new DummyContext() {};
>       manager.addContext(firstContext);
>       manager.addContext(secondContext);
>       manager.getContext(Dummy.class);
>    }
> 
> in this test 'secondContext' simply overrides the
> 'firstContext' and getContext(Dummy.class) wont have
> problems getting the proper context.