[weld-issues] [JBoss JIRA] (CDITCK-223) EnterpriseBeanLifecycleTest.testCreateSFSB

Martin Kouba (JIRA) jira-events at lists.jboss.org
Thu Apr 19 05:40:17 EDT 2012


     [ https://issues.jboss.org/browse/CDITCK-223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Kouba resolved CDITCK-223.
---------------------------------

         Assignee: Martin Kouba
    Fix Version/s: 1.1.0.Alpha2
       Resolution: Done


Test fixed in proposed way.
                
> EnterpriseBeanLifecycleTest.testCreateSFSB
> ------------------------------------------
>
>                 Key: CDITCK-223
>                 URL: https://issues.jboss.org/browse/CDITCK-223
>             Project: CDI TCK
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Tests
>    Affects Versions: 1.0.4.Final
>            Reporter: David Blevins
>            Assignee: Martin Kouba
>             Fix For: 1.0.5.CR1, 1.1.0.Alpha2
>
>
> This test is good except the last part where it checks for Serializable as an interface:
> {code}
>       // Verify that the instance returned is a proxy by checking for all local interfaces
>       assert getCurrentConfiguration().getBeans().isProxy(stadtInstance);
>       Set<Class> interfaces = new HashSet<Class>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
>       Class c = stadtInstance.getClass();
>       Class[] cs = c.getInterfaces();
>       assert interfaces.contains(KleinStadt.class);
>       assert interfaces.contains(SchoeneStadt.class);
>       assert interfaces.contains(Serializable.class);
> {code}
> It isn't valid to check Serializable is a business local interface.  Remote proxies are required to be serializable, but there's no explicit requirement for local proxies.  Most vendors may do that for internal purposes (makes supporting passivation easier), but that's not something CDI needs to worry about.
> Our proxies actually are serializable -- they just don't implement the interface directly.  It's done through another internal interface that takes care of a few other details, so this assert fails.  On that note, we should probably change these asserts to:
> {code}
>       // Verify that the instance returned is a proxy by checking for all local interfaces
>       assert getCurrentConfiguration().getBeans().isProxy(stadtInstance);
>       assert stadtInstance instanceof KleinStadt;
>       assert stadtInstance instanceof SchoeneStadt;
> {code}
> Probably CDI doesn't need to care about the details on how the vendor ensures a proxy is assignable to the business local interfaces.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list