Skip to content
Permalink
Browse files
timeout config overriding
  • Loading branch information
rmannibucau committed Nov 26, 2018
1 parent 4624333 commit 77e4105ea11efb57a940c165201e5b1577c0155a
Showing 2 changed files with 9 additions and 2 deletions.
@@ -37,6 +37,7 @@
import javax.interceptor.InvocationContext;

import org.apache.safeguard.impl.annotation.AnnotationFinder;
import org.apache.safeguard.impl.config.ConfigurationMapper;
import org.apache.safeguard.impl.customizable.Safeguard;
import org.apache.safeguard.impl.metrics.FaultToleranceMetrics;
import org.eclipse.microprofile.faulttolerance.Timeout;
@@ -123,12 +124,15 @@ public static class Cache {
@Inject
private FaultToleranceMetrics metrics;

@Inject
private ConfigurationMapper mapper;

public Map<Method, Model> getTimeouts() {
return timeouts;
}

public Model create(final InvocationContext context) {
final Timeout timeout = finder.findAnnotation(Timeout.class, context);
final Timeout timeout = mapper.map(finder.findAnnotation(Timeout.class, context), context.getMethod(), Timeout.class);
if (timeout.value() < 0) {
throw new FaultToleranceDefinitionException("Timeout can't be < 0: " + context.getMethod());
}
@@ -18,7 +18,10 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Dev Manual Test Run" verbose="2" configfailurepolicy="continue" >
<test name="Manual Run">
<classes>
<packages> <!-- all TCK -->
<package name="org.eclipse.microprofile.fault.tolerance.tck" />
</packages>
<classes> <!-- for dev you can filter them out -->
<!--
<class name="org.eclipse.microprofile.fault.tolerance.tck.config.ConfigPropertyGlobalVsClassVsMethodTest">
</class>

0 comments on commit 77e4105

Please sign in to comment.