1 package org
.argeo
.slc
.core
.execution
.tasks
;
3 import org
.argeo
.slc
.SlcException
;
4 import org
.argeo
.slc
.core
.test
.context
.SimpleContextAware
;
5 import org
.argeo
.slc
.test
.context
.ContextAware
;
7 public class OverrideContextAware
implements Runnable
{
9 private ContextAware source
;
11 private SimpleContextAware target
;
14 public void setSource(ContextAware source
) {
19 public void setTarget(SimpleContextAware target
) {
26 if(source
.getValues() != null)
27 for(String key
: source
.getValues().keySet()) {
28 if(!target
.getValues().containsKey(key
)) {
29 throw new SlcException("No entry in target values for key '" + key
+ "'");
31 target
.getValues().put(key
, source
.getValues().get(key
));
34 // override expected values
35 if(source
.getExpectedValues() != null)
36 for(String key
: source
.getExpectedValues().keySet()) {
37 if(!target
.getExpectedValues().containsKey(key
)) {
38 throw new SlcException("No entry in target expected values for key '" + key
+ "'");
40 target
.getExpectedValues().put(key
, source
.getExpectedValues().get(key
));