public SimpleInterceptorInvocation(Object instance, InterceptionType interceptionType, List<Method> interceptorMethods, boolean targetClass) { this.instance = instance; this.interceptionType = interceptionType; this.targetClass = targetClass; if (interceptorMethods.size() == 1) { // Very often there will be only one interceptor method interceptorMethodInvocations = ImmutableList.<InterceptorMethodInvocation> of(new SimpleMethodInvocation(interceptorMethods.get(0))); } else { ImmutableList.Builder<InterceptorMethodInvocation> builder = ImmutableList.builder(); for (Method method : interceptorMethods) { builder.add(new SimpleMethodInvocation(method)); } interceptorMethodInvocations = builder.build(); } }
public SimpleInterceptorInvocation(Object instance, InterceptionType interceptionType, List<Method> interceptorMethods, boolean targetClass) { this.instance = instance; this.interceptionType = interceptionType; this.targetClass = targetClass; if (interceptorMethods.size() == 1) { // Very often there will be only one interceptor method interceptorMethodInvocations = ImmutableList.<InterceptorMethodInvocation> of(new SimpleMethodInvocation(interceptorMethods.get(0))); } else { ImmutableList.Builder<InterceptorMethodInvocation> builder = ImmutableList.builder(); for (Method method : interceptorMethods) { builder.add(new SimpleMethodInvocation(method)); } interceptorMethodInvocations = builder.build(); } }
public static <X> List<AnnotatedParameter<X>> forExecutable(Executable executable, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache cache) { final Parameter[] parameters = executable.getParameters(); if (parameters.length == 0) { return Collections.emptyList(); } ImmutableList.Builder<AnnotatedParameter<X>> builder = ImmutableList.builder(); for (int i = 0; i < parameters.length; i++) { builder.add(BackedAnnotatedParameter.of(parameters[i], i, declaringCallable, cache)); } return builder.build(); }
@Override public void beforeAll(ExtensionContext context) throws Exception { // we are storing them into root context, hence only needs to be done once per test suite if (getEnrichersFromStore(context) == null) { ImmutableList.Builder<WeldJunitEnricher> enrichers = ImmutableList.builder(); ServiceLoader.load(WeldJunitEnricher.class).forEach(enrichers::add); setEnrichersToStore(context, enrichers.build()); } }
/** * Returns all observer methods. First part of the list consists of the ordered sequence of {@link TransactionPhase#IN_PROGRESS} observers followed by the * ordered sequence of async obervers followed by an ordered sequence of transactional observers. */ public List<ObserverMethod<? super T>> getAllObservers() { return ImmutableList.<ObserverMethod<? super T>> builder().addAll(immediateSyncObservers).addAll(asyncObservers).addAll(transactionObservers).build(); } }
public static <T> List<T> copyOf(Iterable<T> source) { Preconditions.checkNotNull(source); if (source instanceof Collection<?>) { return copyOf((Collection<T>) source); } return ImmutableList.<T>builder().addAll(source).build(); }
@Override public void beforeAll(ExtensionContext context) throws Exception { // we are storing them into root context, hence only needs to be done once per test suite if (getEnrichersFromStore(context) == null) { ImmutableList.Builder<WeldJunitEnricher> enrichers = ImmutableList.builder(); ServiceLoader.load(WeldJunitEnricher.class).forEach(enrichers::add); setEnrichersToStore(context, enrichers.build()); } }
public static <X> List<AnnotatedParameter<X>> forExecutable(Executable executable, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache cache) { final Parameter[] parameters = executable.getParameters(); if (parameters.length == 0) { return Collections.emptyList(); } ImmutableList.Builder<AnnotatedParameter<X>> builder = ImmutableList.builder(); for (int i = 0; i < parameters.length; i++) { builder.add(BackedAnnotatedParameter.of(parameters[i], i, declaringCallable, cache)); } return builder.build(); }
public static <X> List<AnnotatedParameter<X>> forExecutable(Executable executable, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache cache) { final Parameter[] parameters = executable.getParameters(); if (parameters.length == 0) { return Collections.emptyList(); } ImmutableList.Builder<AnnotatedParameter<X>> builder = ImmutableList.builder(); for (int i = 0; i < parameters.length; i++) { builder.add(BackedAnnotatedParameter.of(parameters[i], i, declaringCallable, cache)); } return builder.build(); }
public static <T> List<T> copyOf(Iterable<T> source) { Preconditions.checkNotNull(source); if (source instanceof Collection<?>) { return copyOf((Collection<T>) source); } return ImmutableList.<T>builder().addAll(source).build(); }
/** * Returns all observer methods. First part of the list consists of the ordered sequence of {@link TransactionPhase#IN_PROGRESS} observers followed by the * ordered sequence of async obervers followed by an ordered sequence of transactional observers. */ public List<ObserverMethod<? super T>> getAllObservers() { return ImmutableList.<ObserverMethod<? super T>> builder().addAll(immediateSyncObservers).addAll(asyncObservers).addAll(transactionObservers).build(); } }
/** * Returns all observer methods. First part of the list consists of the ordered sequence of {@link TransactionPhase#IN_PROGRESS} observers followed by the * ordered sequence of async obervers followed by an ordered sequence of transactional observers. */ public List<ObserverMethod<? super T>> getAllObservers() { return ImmutableList.<ObserverMethod<? super T>> builder().addAll(immediateSyncObservers).addAll(asyncObservers).addAll(transactionObservers).build(); } }
public static <X> List<AnnotatedParameter<X>> forExecutable(Executable executable, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache cache) { final Parameter[] parameters = executable.getParameters(); if (parameters.length == 0) { return Collections.emptyList(); } ImmutableList.Builder<AnnotatedParameter<X>> builder = ImmutableList.builder(); for (int i = 0; i < parameters.length; i++) { builder.add(BackedAnnotatedParameter.of(parameters[i], i, declaringCallable, cache)); } return builder.build(); }
public static <T> List<T> copyOf(Iterable<T> source) { Preconditions.checkNotNull(source); if (source instanceof Collection<?>) { return copyOf((Collection<T>) source); } return ImmutableList.<T> builder().addAll(source).build(); }
public static <X> List<AnnotatedParameter<X>> forExecutable(Executable executable, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache cache) { final Parameter[] parameters = executable.getParameters(); if (parameters.length == 0) { return Collections.emptyList(); } ImmutableList.Builder<AnnotatedParameter<X>> builder = ImmutableList.builder(); for (int i = 0; i < parameters.length; i++) { builder.add(BackedAnnotatedParameter.of(parameters[i], i, declaringCallable, cache)); } return builder.build(); }
public static <T> List<T> copyOf(Iterable<T> source) { Preconditions.checkNotNull(source); if (source instanceof Collection<?>) { return copyOf((Collection<T>) source); } return ImmutableList.<T>builder().addAll(source).build(); }
public static <T> List<T> copyOf(Iterable<T> source) { Preconditions.checkNotNull(source); if (source instanceof Collection<?>) { return copyOf((Collection<T>) source); } return ImmutableList.<T>builder().addAll(source).build(); }
/** * Returns all observer methods. First part of the list consists of the ordered sequence of {@link TransactionPhase#IN_PROGRESS} observers followed by the * ordered sequence of async obervers followed by an ordered sequence of transactional observers. */ public List<ObserverMethod<? super T>> getAllObservers() { return ImmutableList.<ObserverMethod<? super T>> builder().addAll(immediateSyncObservers).addAll(asyncObservers).addAll(transactionObservers).build(); } }
/** * Returns all observer methods. First part of the list consists of the ordered sequence of {@link TransactionPhase#IN_PROGRESS} observers followed by the * ordered sequence of async obervers followed by an ordered sequence of transactional observers. */ public List<ObserverMethod<? super T>> getAllObservers() { return ImmutableList.<ObserverMethod<? super T>> builder().addAll(immediateSyncObservers).addAll(asyncObservers).addAll(transactionObservers).build(); } }
public static <T> List<T> copyOf(Iterable<T> source) { Preconditions.checkNotNull(source); if (source instanceof Collection<?>) { return copyOf((Collection<T>) source); } return ImmutableList.<T>builder().addAll(source).build(); }