Is an interceptor with @Target(METHOD, CONSTRUCTOR, TYPE) a problem?
by Marcin Zajączkowski
Hi,
I'm trying to write mocked unit tests for my interceptor using
mechanisms given by AbstractWeldTest and jboss-test-harness package.
My test class extends AbstractWeldTest, had Artifact and WebBeans
(pointing to beans.xml with my interceptor defined) annotations.
My interceptor seems normal for me:
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@InterceptorBinding
public @interface Perf4jProfiled {
}
When I run a very simple test, I've got:
23:06:53.505 [main] DEBUG org.jboss.weld.Reflection - WELD-000602
interface net.sf.perf4cdi.api.Perf4jProfiled is not declared
@Target(TYPE, METHOD) or @Target(TYPE)
org.jboss.weld.exceptions.DeploymentException: WELD-000069 An
interceptor must have at least one binding, but
net.sf.perf4cdi.Perf4jProfiledInterceptor has none
at org.jboss.weld.bean.InterceptorImpl.<init>(InterceptorImpl.java:71)
at org.jboss.weld.bean.InterceptorImpl.of(InterceptorImpl.java:55)
at
org.jboss.weld.bootstrap.AbstractBeanDeployer.createInterceptor(AbstractBeanDeployer.java:255)
at org.jboss.weld.bootstrap.BeanDeployer.createBeans(BeanDeployer.java:106)
at
org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:151)
at
org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:377)
at
org.jboss.weld.mock.MockServletLifecycle.beginApplication(MockServletLifecycle.java:121)
at org.jboss.weld.mock.TestContainer.startContainer(TestContainer.java:85)
at
org.jboss.weld.test.harness.AbstractStandaloneContainersImpl.deploy(AbstractStandaloneContainersImpl.java:40)
at org.jboss.testharness.AbstractTest.deployArtifact(AbstractTest.java:103)
at org.jboss.testharness.AbstractTest.beforeClass(AbstractTest.java:206)
at
org.jboss.weld.test.AbstractWeldTest.beforeClass(AbstractWeldTest.java:57)
When I remove CONSTRUCTOR it works better (there is another problem, but
not related I have to debug it).
I would like to ask if this is a limitation of CDI that an interceptor
cannot be put on constructor?
Regards
Marcin
14 years, 4 months
Contributor matching
by Pete Muir
All,
I have been working on testing an import of Weld core to github - http://github.com/weld/core
To provide a good commit history, I need to match svn usernames to people's real names, and more critically, email addresses associated with github. If you don't have an account on github, then it should be the email address you would use when you create an account...
Please review the attached file, and send me any modifications you would like off list.
14 years, 4 months
Repositories temporarily down
by Pete Muir
All,
Sonatype have just migrated the snapshot repo to a new URL (the old URLs will be around for a couple of weeks still). I am working on updating the builds and website, but until I'm done deploying snapshots won't work.
Pete
14 years, 4 months
Wire Compatibility
by Andrew Lee Rubinger
Hey guys:
Had a good talk w/ Dan and Lincoln at the conclusion of JBossWorld
regarding wire compatibility and was asked to pass references along to
this list.
The key is that marking a class as "implements Serializable" isn't
sufficient to:
1) Make it really Serializable
2) Ensure that the wire protocol maintains compatibility across releases
I've been using a technique documented by Bob Lee awhile back:
http://crazybob.org/2006/01/unit-testing-serialization-evolution_13.html
The idea is that after you've formalized your protocol (ie.
Externalizable or readObject/writeObject explicitly), you make a copy of
this original class. Then, using a special ObjectOutputStream, you can
redefine this class as a new name, hence converting from old to new or
new to old.
For instance, I implement this here in ShrinkWrap to make Archives
Serializable:
http://anonsvn.jboss.org/repos/common/shrinkwrap/trunk/impl-base/src/test...
Recommend this approach, or one similar. Some folks like to serialize
the original version into a .ser file which stays in SCM, and ends up
being the basis for the test point. But that can only test compat in
one direction.
S,
ALR
14 years, 5 months
Weld promotions schedule?
by Sivakumar Thyagarajan
Hi
Could you let me know where I could find the schedule for build
promotions of Weld 1.1? Do we have weekly promotions? I couldn't find
them at the public downloads page at [1] or at the seamframework.org
site.
We were planning to do an initial integration of Weld 1.1 for an
upcoming GlassFish v3.1 milestone and was trying to use a latest
promoted build. Any help here is appreciated. Thanks
Thanks
--Siva.
[1] http://sourceforge.net/projects/jboss/files/Weld/
14 years, 5 months