Skip to content

Commit

Permalink
HV-740 Disabling around construct callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
hferentschik authored and gunnarmorling committed Mar 11, 2013
1 parent 106ab01 commit 26fcd6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -23,7 +23,6 @@
import java.util.Set;
import javax.annotation.Priority;
import javax.inject.Inject;
import javax.interceptor.AroundConstruct;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
Expand Down Expand Up @@ -107,12 +106,10 @@ public Object validateMethodInvocation(InvocationContext ctx) throws Exception {
*
* @param ctx The context of the intercepted constructor invocation.
*
* @return The result of the constructor invocation.
*
* @throws Exception Any exception caused by the intercepted constructor invocation. A {@link ConstraintViolationException}
* in case at least one constraint violation occurred either during parameter or return value validation.
*/
@AroundConstruct
// @AroundConstruct
@SuppressWarnings("unchecked")
public void validateConstructorInvocation(InvocationContext ctx) throws Exception {
ExecutableValidator executableValidator = validator.forExecutables();
Expand All @@ -128,11 +125,12 @@ public void validateConstructorInvocation(InvocationContext ctx) throws Exceptio
);
}

Object result = ctx.proceed();
ctx.proceed();
Object createdObject = ctx.getTarget();

violations = validator.forExecutables().validateConstructorReturnValue(
ctx.getConstructor(),
result
createdObject
);

if ( !violations.isEmpty() ) {
Expand Down
Expand Up @@ -25,6 +25,7 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -67,6 +68,7 @@ public void testInjection() throws Exception {
}

@Test
@Ignore
public void testInstanceInjection() throws Exception {
assertNotNull( repeaterInstance );
try {
Expand Down

0 comments on commit 26fcd6d

Please sign in to comment.