Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weld 732 #32

Closed
wants to merge 1 commit into from
Closed

Weld 732 #32

wants to merge 1 commit into from

Conversation

ivaynberg
Copy link
Member

integration tests fail because i believe there is a bug in the tck.

test fails in EventTest:149
147: StockPrice price = new StockPrice();
148: Set<ObserverMethod<? super StockPrice>> observers = getCurrentManager().resolveObserverMethods(price);
149: assert observers.size() == 1;

the one and only one expected observer method is:
StockWatcher#public void observeStockPrice(@observes StockPrice price)

however, according to section 4.2 of the spec:
If X declares an initializer, non-static observer, @PostConstruct or @PreDestroy method x() then
Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a
superclass of Y overrides the method x().
so the two observer methods from IntermediateStockWatcher and IndirectStockWatcher subclasses of StockWatcher should also be considered.

@pmuir
Copy link
Contributor

pmuir commented Oct 26, 2010

I don't see any observer methods on IntermediateStockWatcher or IndirectStockWatcher

@ivaynberg
Copy link
Member Author

both of those extend StockWatcher so they should inherit the observer methods. which is the point of WELD-732.

@pmuir
Copy link
Contributor

pmuir commented Oct 26, 2010

oic sorry

@pmuir
Copy link
Contributor

pmuir commented Oct 26, 2010

Please can you file an issue in CDITCK so that we can get the TCK fixed.

@ivaynberg
Copy link
Member Author

created CDITCK-186

@pmuir
Copy link
Contributor

pmuir commented Oct 27, 2010

Ok, issue in TCK confirmed, please update the exclude list in Weld so that the test suite passes.

@ivaynberg
Copy link
Member Author

a question about ObserverMethodOnIncorrectBeanTest TCK test...it ignores the observer method on NonManagedBean class because it doesnt have a compatible constructor to be instantiated. what if there is a producer method for it? is it then considered a manged bean and should the observer method on it be included?

@pmuir
Copy link
Contributor

pmuir commented Oct 27, 2010

No.

@pmuir
Copy link
Contributor

pmuir commented Oct 27, 2010

A producer method doesn't make a class that is not a bean a bean, it makes the result of calling the method a bean.

@ivaynberg
Copy link
Member Author

is there an easy way to check if an instance of WeldClass is a managed bean? or do those only get created for managed beans?

@pmuir
Copy link
Contributor

pmuir commented Oct 27, 2010

We currently don't have a static util method for this that is publically available. Moving org.jboss.weld.bootstrap.AbstractBeanDeployer.isTypeManagedBeanOrDecoratorOrInterceptor(WeldClass<?>) to Beans would be the correct thing to do, it does mostly the right thing (though as the name says, it also checks for interceptors and decorators, so we would want to split that func out).

@mbogoevici
Copy link
Contributor

pulled

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants