diff options
Diffstat (limited to 'eaaf_core/src/test')
33 files changed, 2436 insertions, 0 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java new file mode 100644 index 00000000..92b2a709 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java @@ -0,0 +1,257 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.module.test; + +import java.util.Map; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration; +import at.gv.egiz.eaaf.core.exceptions.EAAFStorageException; + +/** + * @author tlenz + * + */ +public class TestRequestImpl implements IRequest { + + private String processInstanceID = null; + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#requestedModule() + */ + @Override + public String requestedModule() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#requestedAction() + */ + @Override + public String requestedAction() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#isPassiv() + */ + @Override + public boolean isPassiv() { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#forceAuth() + */ + @Override + public boolean forceAuth() { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#getGenericData(java.lang.String) + */ + @Override + public Object getGenericData(String key) { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#getGenericData(java.lang.String, java.lang.Class) + */ + @Override + public <T> T getGenericData(String key, Class<T> clazz) { + // TODO Auto-generated method stub + return null; + } + + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#getUniqueTransactionIdentifier() + */ + @Override + public String getUniqueTransactionIdentifier() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#getUniqueSessionIdentifier() + */ + @Override + public String getUniqueSessionIdentifier() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#getProcessInstanceId() + */ + @Override + public String getProcessInstanceId() { + return processInstanceID; + + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#getAuthURL() + */ + @Override + public String getAuthURL() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#getAuthURLWithOutSlash() + */ + @Override + public String getAuthURLWithOutSlash() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#isNeedAuthentication() + */ + @Override + public boolean isNeedAuthentication() { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#needSingleSignOnFunctionality() + */ + @Override + public boolean needSingleSignOnFunctionality() { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#setNeedSingleSignOnFunctionality(boolean) + */ + @Override + public void setNeedSingleSignOnFunctionality(boolean needSSO) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#isAuthenticated() + */ + @Override + public boolean isAuthenticated() { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#setAuthenticated(boolean) + */ + @Override + public void setAuthenticated(boolean isAuthenticated) { + // TODO Auto-generated method stub + + } + + /** + * @param processInstanceID the processInstanceID to set + */ + public void setProcessInstanceID(String processInstanceID) { + this.processInstanceID = processInstanceID; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#isAbortedByUser() + */ + @Override + public boolean isAbortedByUser() { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.moduls.IRequest#setAbortedByUser(boolean) + */ + @Override + public void setAbortedByUser(boolean isAborted) { + // TODO Auto-generated method stub + + } + + @Override + public String getSPEntityId() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setGenericDataToSession(Map<String, Object> map) throws EAAFStorageException { + // TODO Auto-generated method stub + + } + + @Override + public Map<String, Object> genericFullDataStorage() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getPendingRequestId() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getSSOSessionIdentifier() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setSSOSessionIdentifier(String internalSSOSessionId) { + // TODO Auto-generated method stub + + } + + @Override + public boolean isNeedUserConsent() { + // TODO Auto-generated method stub + return false; + } + + @Override + public void setNeedUserConsent(boolean needConsent) { + // TODO Auto-generated method stub + + } + + @Override + public ISPConfiguration getServiceProviderConfiguration() { + // TODO Auto-generated method stub + return null; + } + + @Override + public <T> T getServiceProviderConfiguration(Class<T> decorator) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setGenericDataToSession(String key, Object object) throws EAAFStorageException { + // TODO Auto-generated method stub + + } + + + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/DummyTransactionStorage.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/DummyTransactionStorage.java new file mode 100644 index 00000000..15359261 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/DummyTransactionStorage.java @@ -0,0 +1,165 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; + +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import javax.sql.DataSource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import at.gv.egiz.eaaf.core.api.storage.ITransactionStorage; +import at.gv.egiz.eaaf.core.exceptions.EAAFException; + +/** + * Dummy DataSource implementation for convenience in test cases where a + * database connection will never actually be acquired. + * + * @see DataSource + * @author Chris Beams + */ +public class DummyTransactionStorage implements ITransactionStorage { + + private static final Logger log = LoggerFactory.getLogger(DummyTransactionStorage.class); + + + public class DummyDBEntry{ + public DummyDBEntry(String key, Object value){ + this.obj =value; + this.key = key; + } + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + public Object getObj() { + return obj; + } + public void setObj(Object obj) { + this.obj = obj; + } + private String key; + private Object obj; + } + + private ArrayList<DummyDBEntry> ds = new ArrayList<DummyDBEntry>(); + + + + @Override + public boolean containsKey(String key) { + // TODO Auto-generated method stub + Iterator<DummyDBEntry> it = ds.iterator(); + while(it.hasNext()){ + DummyDBEntry t = it.next(); + if(t.getKey().equals(key)) + return true; + } + return false; + } + + @Override + public void put(String key, Object value, int timeout) + throws EAAFException { + // TODO Auto-generated method stub + this.remove(key); + this.ds.add(new DummyDBEntry(key, value)); + + } + + @Override + public Object get(String key) throws EAAFException { + // TODO Auto-generated method stub + Iterator<DummyDBEntry> it = ds.iterator(); + while(it.hasNext()){ + DummyDBEntry t = it.next(); + if(t.getKey().equals(key)) + return t; + } + return null; + } + + @Override + public <T> T get(String key, Class<T> clazz) throws EAAFException { + + DummyDBEntry o = (DummyDBEntry) get(key); + if(o == null) + return null; + try { + @SuppressWarnings("unchecked") + T test = (T) (clazz.cast(o.getObj())); + return test; + + } catch (Exception e) { + log.warn("Sessioninformation Cast-Exception by using Artifact=" + key); + throw new EAAFException("Sessioninformation Cast-Exception"); + + } + } + + @Override + public <T> T get(String key, Class<T> clazz, long dataTimeOut) + throws EAAFException { + // TODO Auto-generated method stub + return get(key,clazz); + } + + @Override + public void changeKey(String oldKey, String newKey, Object value) + throws EAAFException { + this.remove(oldKey); + this.put(newKey, value, -1); + + } + + @Override + public void remove(String key) { + Iterator<DummyDBEntry> it = ds.iterator(); + while(it.hasNext()){ + DummyDBEntry t = it.next(); + if(t.getKey().equals(key)){ + this.ds.remove(t); + return; + } + } + + } + + @Override + public List<String> clean(Date now, long dataTimeOut) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getRaw(String key) throws EAAFException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void putRaw(String key, Object element) throws EAAFException { + // TODO Auto-generated method stub + + } + +// @Override +// public Object getAssertionStore(String key) throwsEAAFException { +// // TODO Auto-generated method stub +// return null; +// } +// +// @Override +// public void putAssertionStore(Object element) throws EAAFException { +// // TODO Auto-generated method stub +// +// } + + +}
\ No newline at end of file diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/ExpressionContextAdapter.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/ExpressionContextAdapter.java new file mode 100644 index 00000000..0a25ffe1 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/ExpressionContextAdapter.java @@ -0,0 +1,54 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; + + +import java.io.Serializable; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import at.gv.egiz.eaaf.core.api.idp.process.ExpressionEvaluationContext; + +/** + * Adapter class for {@link ExpressionEvaluationContext}. Intended to be used for testing purposes. + * + * @author tknall + * + */ +public class ExpressionContextAdapter implements ExpressionEvaluationContext { + + private static final long serialVersionUID = 1L; + + private Map<String, Serializable> ctxData = Collections.synchronizedMap(new HashMap<String, Serializable>()); + + /** + * Returns a certain {@link Serializable} object associated with a certain {@code key}. + * + * @param key + * The key. + * @return The object or {@code null} if no object was found stored with that key or if a {@code null} value was + * stored. + */ + Serializable get(String key) { + return ctxData.get(key); + } + + /** + * Stores a {@link Serializable} with a certain {@code key}. + * + * @param key + * The key. + * @param object + * The object. + */ + void put(String key, Serializable object) { + ctxData.put(key, object); + } + + @Override + public Map<String, Serializable> getCtx() { + return Collections.unmodifiableMap(ctxData); + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SimplePojo.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SimplePojo.java new file mode 100644 index 00000000..de25ae3f --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SimplePojo.java @@ -0,0 +1,43 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; + +import at.gv.egiz.eaaf.core.api.idp.process.ExpressionEvaluator; + +/** + * A dummy pojo used to test {@link ExpressionEvaluator} with Spring EL referencing Spring beans. + * + * @author tknall + * + */ +public class SimplePojo { + + private Boolean booleanValue; + private String stringValue; + private Integer integerValue; + + public Boolean getBooleanValue() { + return booleanValue; + } + + public void setBooleanValue(Boolean booleanValue) { + this.booleanValue = booleanValue; + } + + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + public Integer getIntegerValue() { + return integerValue; + } + + public void setIntegerValue(Integer integerValue) { + this.integerValue = integerValue; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SpringExpressionAwareProcessEngineTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SpringExpressionAwareProcessEngineTest.java new file mode 100644 index 00000000..a12e3856 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SpringExpressionAwareProcessEngineTest.java @@ -0,0 +1,153 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; + +import static at.gv.egiz.eaaf.core.impl.idp.process.ProcessInstanceState.NOT_STARTED; +import static at.gv.egiz.eaaf.core.impl.idp.process.ProcessInstanceState.SUSPENDED; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.io.IOException; +import java.io.InputStream; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.ProcessEngine; +import at.gv.egiz.eaaf.core.exceptions.ProcessExecutionException; +import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessDefinitionParserException; +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessEngineImpl; +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessInstance; +import at.gv.egiz.eaaf.core.impl.idp.process.spring.SpringExpressionEvaluator; + +/** + * Tests the process engine using processes based on Spring EL referencing the process context and further Spring beans. + * + * @author tknall + * + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("/process/spring/test/SpringExpressionAwareProcessEngineTest-context.xml") +public class SpringExpressionAwareProcessEngineTest { + + @Autowired private static ProcessEngine pe; + @Autowired private ApplicationContext applicationContext; + + private boolean isInitialized = false; + + @Before + public void init() throws IOException, ProcessDefinitionParserException { + + if (!isInitialized) { + + if (pe == null) { + pe = applicationContext.getBean("processEngine", ProcessEngine.class); + + } + + ((ProcessEngineImpl) pe).setTransitionConditionExpressionEvaluator(new SpringExpressionEvaluator()); + try (InputStream in = SpringExpressionAwareProcessEngineTest.class.getResourceAsStream("/process/spring/test/SampleProcessDefinitionWithExpression1.xml")) { + ((ProcessEngineImpl) pe).registerProcessDefinition(in); + } + try (InputStream in = SpringExpressionAwareProcessEngineTest.class.getResourceAsStream("/process/spring/test/SampleProcessDefinitionForSAML1Authentication.xml")) { + ((ProcessEngineImpl) pe).registerProcessDefinition(in); + } + + //initHibernateForTesting(); + } + } + + private static void initHibernateForTesting() throws IOException{ + +// InputStream in = SpringExpressionAwareProcessEngineTest.class.getResourceAsStream("/at/gv/egovernment/moa/id/process/hibernate.configuration.test.properties"); +// Properties props = new Properties(); +// props.load(in); +// +// try { +// //ConfigurationDBUtils.initHibernate(props); +// Configuration config = new Configuration(); +// config.addProperties(props); +// //config.addAnnotatedClass(ProcessInstanceStore.class); +// config.addAnnotatedClass(AssertionStore.class); +// //MOASessionDBUtils.initHibernate(config, props); +// } catch (Exception e) { +// e.printStackTrace(); +// } + } + + + @Test + public void testSampleProcessDefinitionWithExpression1() throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + TestRequestImpl req = new TestRequestImpl(); + + String piId = pe.createProcessInstance("SampleProcessWithExpression1"); + ProcessInstance pi = pe.getProcessInstance(piId); + assertEquals(NOT_STARTED, pi.getState()); + + + // start process + req.setProcessInstanceID(piId); + pe.start(req); + + //processInstance should be removed when it ends + try { + pi = pe.getProcessInstance(piId); + throw new ProcessExecutionException("ProcessInstance should be removed already, but it was found."); + //assertEquals(ENDED, pi.getState()); + + } catch (IllegalArgumentException e) { + // do nothing because processInstance should be already removed + + } + } + + @Test + public void testSampleProcessDefinitionForSAML1Authentication() throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + TestRequestImpl req = new TestRequestImpl(); + + String piId = pe.createProcessInstance("SampleProcessDefinitionForSAML1Authentication"); + ProcessInstance pi = pe.getProcessInstance(piId); + assertEquals(NOT_STARTED, pi.getState()); + + // start process + req.setProcessInstanceID(piId); + pe.start(req); + pi = pe.getProcessInstance(piId); + assertEquals(SUSPENDED, pi.getState()); + + ExecutionContext ec = pi.getExecutionContext(); + assertNotNull(ec); + System.out.println(ec.keySet()); + + assertNotNull(ec.get("bkuURL")); + assertNotNull(ec.get("IdentityLink")); + assertNotNull(ec.get("isIdentityLinkValidated")); + assertNotNull(ec.get("SignedAuthBlock")); + assertNotNull(ec.get("isSignedAuthBlockValidated")); + assertNotNull(ec.get("SAML1Assertion")); + + pe.signal(req); + try { + pi = pe.getProcessInstance(piId); + throw new ProcessExecutionException("ProcessInstance should be removed already, but it was found."); + //assertEquals(ENDED, pi.getState()); + + } catch (IllegalArgumentException e) { + // do nothing because processInstance should be already removed + + } + + + + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SpringExpressionEvaluatorTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SpringExpressionEvaluatorTest.java new file mode 100644 index 00000000..8f1ac098 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/SpringExpressionEvaluatorTest.java @@ -0,0 +1,56 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import at.gv.egiz.eaaf.core.api.idp.process.ExpressionEvaluator; + +/** + * Tests the {@link ExpressionEvaluator} using a Spring EL based implementation capable of dereferencing Spring beans. + * + * @author tknall + * + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("/process/spring/test/SpringExpressionEvaluatorTest-context.xml") +public class SpringExpressionEvaluatorTest { + + private ExpressionContextAdapter ctx; + + @Autowired + private ExpressionEvaluator expressionEvaluator; + + @Before + public void prepareTest() { + ctx = new ExpressionContextAdapter(); + } + + @Test + public void testEvaluateSimpleExpression() { + assertTrue(expressionEvaluator.evaluate(ctx, "'true'")); + } + + @Test + public void testEvaluateExpressionWithCtx() { + ctx.put("myProperty", false); + assertFalse(expressionEvaluator.evaluate(ctx, "ctx['myProperty']")); + } + +// @Test + public void testEvaluateExpressionWithBeanReference() { + assertTrue(expressionEvaluator.evaluate(ctx, "@simplePojo.booleanValue")); + assertTrue(expressionEvaluator.evaluate(ctx, "'HelloWorld'.equals(@simplePojo.stringValue)")); + assertTrue(expressionEvaluator.evaluate(ctx, "@simplePojo.integerValue == 42")); + assertTrue(expressionEvaluator.evaluate(ctx, "@simplePojo.stringValue.length() == 10")); + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/CreateSAML1AssertionTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/CreateSAML1AssertionTask.java new file mode 100644 index 00000000..cd1d8c0e --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/CreateSAML1AssertionTask.java @@ -0,0 +1,63 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Objects; + +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.Task; +import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; + +/** + * A dummy task simulating the creation of a SAML1 assertion. + * <p> + * Requires context data: + * <ul> + * <li>{@code IdentityLink}</li> + * <li>{@code isIdentityLinkValidated}</li> + * <li>{@code SignedAuthBlock}</li> + * <li>{@code isSignedAuthBlockValidated}</li> + * </ul> + * </p> + * <p> + * Enriches context data with: + * <ul> + * <li>{@code SAML1Assertion}</li> + * </ul> + * </p> + * + * @author tknall + * + */ +@Service("CreateSAML1AssertionTask") +public class CreateSAML1AssertionTask implements Task { + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(IRequest penReq, ExecutionContext executionContext) throws TaskExecutionException { + Objects.requireNonNull(executionContext.get("IdentityLink")); + assert (Boolean.TRUE.equals(Objects.requireNonNull(executionContext.get("isIdentityLinkValidated")))); + Objects.requireNonNull(executionContext.get("SignedAuthBlock")); + assert (Boolean.TRUE.equals(Objects.requireNonNull(executionContext.get("isSignedAuthBlockValidated")))); + + log.debug("Using IdentityLink and signed auth block in order to create SAML1 assertion."); + + try (InputStream in = getClass().getResourceAsStream("/process/spring/test/task/SAML1Assertion.xml")) { + executionContext.put("SAML1Assertion", IOUtils.toString(in, "UTF-8")); + } catch (IOException e) { + throw new TaskExecutionException(null, "", e); + } + + return null; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/GetIdentityLinkTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/GetIdentityLinkTask.java new file mode 100644 index 00000000..6f7246f1 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/GetIdentityLinkTask.java @@ -0,0 +1,60 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Objects; + +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.Task; +import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; + +/** + * A dummy task simulating the retrieval of an IdentityLink. + * <p/> + * Asynchonous + * <p> + * Requires context data: + * <ul> + * <li>{@code bkuURL}</li> + * </ul> + * </p> + * <p> + * Enriches context data with: + * <ul> + * <li>{@code IdentityLink}</li> + * </ul> + * </p> + * + * @author tknall + * + */ +@Service("GetIdentityLinkTask") +public class GetIdentityLinkTask implements Task { + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(IRequest penReq, ExecutionContext executionContext) throws TaskExecutionException { + Objects.requireNonNull(executionContext.get("bkuURL")); + + log.debug("Using bkuURL in order to retrieve IdentityLink."); + + try (InputStream in = getClass().getResourceAsStream("/process/spring/test/task/IdentityLink_Max_Mustermann.xml")) { + executionContext.put("IdentityLink", IOUtils.toString(in, "UTF-8")); + + } catch (IOException e) { + throw new TaskExecutionException(null, "", e); + } + + return null; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/SelectBKUTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/SelectBKUTask.java new file mode 100644 index 00000000..a763c759 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/SelectBKUTask.java @@ -0,0 +1,39 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.Task; + +/** + * A dummy task simulating a bku selection. + * <p/> + * Asynchonous + * <p> + * Enriches context data with: + * <ul> + * <li>{@code bkuURL}</li> + * </ul> + * </p> + * + * @author tknall + * + */ +@Service("SelectBKUTask") +public class SelectBKUTask implements Task { + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(IRequest penReq, ExecutionContext executionContext) { + log.debug("Providing BKU selection."); + executionContext.put("bkuURL", "https://127.0.0.1:3496/https-security-layer-request"); + return null; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/SignAuthBlockTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/SignAuthBlockTask.java new file mode 100644 index 00000000..5b3158e3 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/SignAuthBlockTask.java @@ -0,0 +1,62 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Objects; + +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.Task; +import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; + +/** + * A dummy task simulating the signature of an auth block. + * <p/> + * Asynchonous + * <p> + * Requires context data: + * <ul> + * <li>{@code IdentityLink}</li> + * <li>{@code isIdentityLinkValidated}</li> + * <li>{@code bkuURL}</li> + * </ul> + * </p> + * <p> + * Enriches context data with: + * <ul> + * <li>{@code SignedAuthBlock}</li> + * </ul> + * </p> + * + * @author tknall + * + */ +@Service("SignAuthBlockTask") +public class SignAuthBlockTask implements Task { + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(IRequest penReq, ExecutionContext executionContext) throws TaskExecutionException { + Objects.requireNonNull(executionContext.get("IdentityLink")); + assert (Boolean.TRUE.equals(Objects.requireNonNull(executionContext.get("isIdentityLinkValidated")))); + Objects.requireNonNull(executionContext.get("bkuURL")); + + log.debug("Using validated IdentityLink and bkuURL in order to sign auth block."); + try (InputStream in = getClass().getResourceAsStream("/process/spring/test/task/SignedAuthBlock.xml")) { + executionContext.put("SignedAuthBlock", IOUtils.toString(in, "UTF-8")); + } catch (IOException e) { + throw new TaskExecutionException(null, "", e); + + } + return null; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/ValidateIdentityLinkTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/ValidateIdentityLinkTask.java new file mode 100644 index 00000000..8d4d507b --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/ValidateIdentityLinkTask.java @@ -0,0 +1,48 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; + +import java.util.Objects; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.Task; + +/** + * Dummy task simulating the validation of an IdentityLink. + * <p> + * Requires context data: + * <ul> + * <li>{@code IdentityLink}</li> + * </ul> + * </p> + * <p> + * Enriches context data with: + * <ul> + * <li>{@code isIdentityLinkValidated}</li> + * </ul> + * </p> + * + * @author tknall + * + */ +@Service("ValidateIdentityLinkTask") +public class ValidateIdentityLinkTask implements Task { + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(IRequest penReq, ExecutionContext executionContext) { + Objects.requireNonNull(executionContext.get("IdentityLink")); + + log.debug("Validating IdentityLink."); + + executionContext.put("isIdentityLinkValidated", true); + return null; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/ValidateSignedAuthBlockTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/ValidateSignedAuthBlockTask.java new file mode 100644 index 00000000..26d1146d --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/ValidateSignedAuthBlockTask.java @@ -0,0 +1,53 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; + +import java.util.Objects; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.Task; +import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; + +/** + * A dummy task simulating the validation of an auth block. + * <p> + * Requires context data: + * <ul> + * <li>{@code IdentityLink}</li> + * <li>{@code isIdentityLinkValidated}</li> + * <li>{@code SignedAuthBlock}</li> + * </ul> + * </p> + * <p> + * Enriches context data with: + * <ul> + * <li>{@code isSignedAuthBlockValidated}</li> + * </ul> + * </p> + * + * @author tknall + * + */ +@Service("ValidateSignedAuthBlockTask") +public class ValidateSignedAuthBlockTask implements Task { + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(IRequest penReq, ExecutionContext executionContext) throws TaskExecutionException { + Objects.requireNonNull(executionContext.get("IdentityLink")); + assert (Boolean.TRUE.equals(Objects.requireNonNull(executionContext.get("isIdentityLinkValidated")))); + Objects.requireNonNull(executionContext.get("SignedAuthBlock")); + + log.debug("Using validated IdentityLink and signed auth block in order to validate signed auth block."); + + executionContext.put("isSignedAuthBlockValidated", true); + return null; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/BooleanStringExpressionEvaluator.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/BooleanStringExpressionEvaluator.java new file mode 100644 index 00000000..9b03f60f --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/BooleanStringExpressionEvaluator.java @@ -0,0 +1,26 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.test; + +import java.util.Objects; + +import org.apache.commons.lang3.BooleanUtils; + +import at.gv.egiz.eaaf.core.api.idp.process.ExpressionEvaluationContext; +import at.gv.egiz.eaaf.core.api.idp.process.ExpressionEvaluator; + +/** + * Expression evaluator that guesses the boolean value from a String. Refer to {@link BooleanUtils#toBoolean(String)} + * for further information. + * + * @author tknall + * + */ +public class BooleanStringExpressionEvaluator implements ExpressionEvaluator { + + @Override + public boolean evaluate(ExpressionEvaluationContext expressionContext, String expression) { + return BooleanUtils.toBoolean(Objects.requireNonNull(expression, "Expression must not be null.")); + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/HalloWeltTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/HalloWeltTask.java new file mode 100644 index 00000000..62e82bac --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/HalloWeltTask.java @@ -0,0 +1,26 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.test; + +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.Task; + +/** + * Simple task that just outputs a "Hallo World" text to the console. + * + * @author tknall + * + */ +@Service("HalloWeltTask") +public class HalloWeltTask implements Task { + + @Override + public IRequest execute(IRequest pendingReq, ExecutionContext executionContext) { + System.out.println("Hallo Welt"); + return null; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/HelloWorldTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/HelloWorldTask.java new file mode 100644 index 00000000..1338ca50 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/HelloWorldTask.java @@ -0,0 +1,26 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.test; + +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.process.Task; + +/** + * Simple task that just outputs a "Hello World" text to the console. + * + * @author tknall + * + */ +@Service("HelloWorldTask") +public class HelloWorldTask implements Task { + + @Override + public IRequest execute(IRequest pendingReq, ExecutionContext executionContext) { + System.out.println("Hello World"); + return null; + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessDefinitionParserTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessDefinitionParserTest.java new file mode 100644 index 00000000..47b52ce7 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessDefinitionParserTest.java @@ -0,0 +1,139 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; + +import org.junit.Test; + +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessDefinitionParser; +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessDefinitionParserException; +import at.gv.egiz.eaaf.core.impl.idp.process.model.EndEvent; +import at.gv.egiz.eaaf.core.impl.idp.process.model.ProcessDefinition; +import at.gv.egiz.eaaf.core.impl.idp.process.model.ProcessNode; +import at.gv.egiz.eaaf.core.impl.idp.process.model.StartEvent; +import at.gv.egiz.eaaf.core.impl.idp.process.model.TaskInfo; +import at.gv.egiz.eaaf.core.impl.idp.process.model.Transition; + +public class ProcessDefinitionParserTest { + + @Test(expected = ProcessDefinitionParserException.class) + public void testParseInvalidProcessDefinition_MultipleStartEvents() throws IOException, ProcessDefinitionParserException { + try (InputStream in = getClass().getResourceAsStream("InvalidProcessDefinition_MultipleStartEvents.xml")) { + new ProcessDefinitionParser().parse(in); + } + } + + @Test(expected = ProcessDefinitionParserException.class) + public void testParseInvalidProcessDefinition_TransitionLoop() throws IOException, ProcessDefinitionParserException { + try (InputStream in = getClass().getResourceAsStream("InvalidProcessDefinition_TransitionLoop.xml")) { + new ProcessDefinitionParser().parse(in); + } + } + + @Test(expected = ProcessDefinitionParserException.class) + public void testParseInvalidProcessDefinition_TransitionStartsFromEndEvent() throws IOException, ProcessDefinitionParserException { + try (InputStream in = getClass().getResourceAsStream("InvalidProcessDefinition_TransitionStartsFromEndEvent.xml")) { + new ProcessDefinitionParser().parse(in); + } + } + + @Test(expected = ProcessDefinitionParserException.class) + public void testParseInvalidProcessDefinition_TransitionRefsTransition() throws IOException, ProcessDefinitionParserException { + try (InputStream in = getClass().getResourceAsStream("InvalidProcessDefinition_TransitionRefsTransition.xml")) { + new ProcessDefinitionParser().parse(in); + } + } + + @Test(expected = ProcessDefinitionParserException.class) + public void testParseInvalidProcessDefinition_NoStartEvents() throws IOException, ProcessDefinitionParserException { + try (InputStream in = getClass().getResourceAsStream("InvalidProcessDefinition_NoStartEvents.xml")) { + new ProcessDefinitionParser().parse(in); + } + } + + @Test + public void testParseSampleProcessDefinition() throws IOException, ProcessDefinitionParserException { + try (InputStream in = getClass().getResourceAsStream("/process/test/SampleProcessDefinition1.xml")) { + + ProcessDefinitionParser parser = new ProcessDefinitionParser(); + ProcessDefinition pd = parser.parse(in); + + assertNotNull(pd); + assertEquals("SampleProcess1", pd.getId()); + + // first assert tasks then transitions + // start event + StartEvent startEvent = pd.getStartEvent(); + assertNotNull(startEvent); + assertEquals("start", startEvent.getId()); + assertEquals(startEvent, pd.getProcessNode("start")); + // task1 + ProcessNode processNode = pd.getProcessNode("task1"); + assertNotNull(processNode); + assertTrue(processNode instanceof TaskInfo); + TaskInfo task1 = (TaskInfo) processNode; + assertEquals("task1", task1.getId()); + assertFalse(task1.isAsync()); + // task2 + processNode = pd.getProcessNode("task2"); + assertNotNull(processNode); + assertTrue(processNode instanceof TaskInfo); + TaskInfo task2 = (TaskInfo) processNode; + assertEquals("task2", task2.getId()); + assertTrue(task2.isAsync()); + // end event + processNode = pd.getProcessNode("end"); + assertNotNull(processNode); + assertTrue(processNode instanceof EndEvent); + EndEvent endEvent = (EndEvent) processNode; + assertEquals("end", endEvent.getId()); + + // assert transitions + // start event + assertNotNull(startEvent.getIncomingTransitions()); + assertTrue(startEvent.getIncomingTransitions().isEmpty()); + assertNotNull(startEvent.getOutgoingTransitions()); + assertEquals(1, startEvent.getOutgoingTransitions().size()); + // transition from start to task1 + Transition startToTask1 = startEvent.getOutgoingTransitions().get(0); + assertEquals("fromStart", startToTask1.getId()); + assertEquals(startEvent, startToTask1.getFrom()); + assertEquals(task1, startToTask1.getTo()); + assertEquals("true", startToTask1.getConditionExpression()); + // task1 + assertNotNull(task1.getIncomingTransitions()); + assertEquals(1, task1.getIncomingTransitions().size()); + assertEquals(startToTask1, task1.getIncomingTransitions().get(0)); + assertNotNull(task1.getOutgoingTransitions()); + assertEquals(1, task1.getOutgoingTransitions().size()); + // transition from task1 to task2 + Transition task1ToTask2 = task1.getOutgoingTransitions().get(0); + assertNull(task1ToTask2.getId()); + assertEquals(task1, task1ToTask2.getFrom()); + assertEquals(task2, task1ToTask2.getTo()); + assertNull(task1ToTask2.getConditionExpression()); + // task2 + assertNotNull(task2.getIncomingTransitions()); + assertEquals(1, task2.getIncomingTransitions().size()); + assertEquals(task1ToTask2, task2.getIncomingTransitions().get(0)); + assertNotNull(task2.getOutgoingTransitions()); + assertEquals(1, task2.getOutgoingTransitions().size()); + // transition from task2 to end + Transition task2ToEnd = task2.getOutgoingTransitions().get(0); + assertNull(task2ToEnd.getId()); + assertEquals(task2, task2ToEnd.getFrom()); + assertEquals(endEvent, task2ToEnd.getTo()); + assertNull(task2ToEnd.getConditionExpression()); + + } + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessEngineTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessEngineTest.java new file mode 100644 index 00000000..fe07f74d --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ProcessEngineTest.java @@ -0,0 +1,145 @@ +/******************************************************************************* + *******************************************************************************/ +package at.gv.egiz.eaaf.core.impl.idp.process.test; + +import static at.gv.egiz.eaaf.core.impl.idp.process.ProcessInstanceState.NOT_STARTED; +import static at.gv.egiz.eaaf.core.impl.idp.process.ProcessInstanceState.SUSPENDED; +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.io.InputStream; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import at.gv.egiz.eaaf.core.api.idp.process.ProcessEngine; +import at.gv.egiz.eaaf.core.exceptions.ProcessExecutionException; +import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessDefinitionParser; +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessDefinitionParserException; +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessEngineImpl; +import at.gv.egiz.eaaf.core.impl.idp.process.ProcessInstance; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("/process/spring/test/SpringExpressionAwareProcessEngineTest-context.xml") +public class ProcessEngineTest { + + @Autowired private static ProcessEngine pe; + + @Autowired private ApplicationContext applicationContext; + + private boolean isInitialized = false; + + @Before + public void init() throws IOException, ProcessDefinitionParserException { + + if (!isInitialized) { + ProcessDefinitionParser pdp = new ProcessDefinitionParser(); + + if (pe == null) { + pe = applicationContext.getBean("processEngine", ProcessEngine.class); + + } + + ((ProcessEngineImpl) pe).setTransitionConditionExpressionEvaluator(new BooleanStringExpressionEvaluator()); + try (InputStream in = ProcessEngineTest.class.getResourceAsStream("/process/test/SampleProcessDefinition1.xml")) { + ((ProcessEngineImpl) pe).registerProcessDefinition(pdp.parse(in)); + } + try (InputStream in = ProcessEngineTest.class.getResourceAsStream("/process/test/SampleProcessDefinition2.xml")) { + ((ProcessEngineImpl) pe).registerProcessDefinition(pdp.parse(in)); + } + + //initHibernateForTesting(); + isInitialized = true; + } + } + + private static void initHibernateForTesting() throws IOException{ + +// InputStream in = ProcessEngineTest.class.getResourceAsStream("/at/gv/egovernment/moa/id/process/hibernate.configuration.test.properties"); +// Properties props = new Properties(); +// props.load(in); +// +// try { +// //ConfigurationDBUtils.initHibernate(props); +// Configuration config = new Configuration(); +// config.addProperties(props); +// //config.addAnnotatedClass(ProcessInstanceStore.class); +// config.addAnnotatedClass(AssertionStore.class); +// //MOASessionDBUtils.initHibernate(config, props); +// } catch (Exception e) { +// e.printStackTrace(); +// } + } + + @Test + public void testSampleProcess1() throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + TestRequestImpl testReq = new TestRequestImpl(); + + String piId = pe.createProcessInstance("SampleProcess1"); + ProcessInstance pi = pe.getProcessInstance(piId); + assertEquals(NOT_STARTED, pi.getState()); + + // start process + testReq.setProcessInstanceID(piId); + pe.start(testReq); + pi = pe.getProcessInstance(piId); + assertEquals(SUSPENDED, pi.getState()); + + System.out.println("Do something asynchronously"); + testReq.setProcessInstanceID(piId); + pe.signal(testReq); + try { + pi = pe.getProcessInstance(piId); + throw new ProcessExecutionException("ProcessInstance should be removed already, but it was found."); + //assertEquals(ENDED, pi.getState()); + + } catch (IllegalArgumentException e) { + // do nothing because processInstance should be already removed + + } + } + + @Test + public void testSampleProcess2() throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + TestRequestImpl testReq = new TestRequestImpl(); + + String piId = pe.createProcessInstance("SampleProcess2"); + ProcessInstance pi = pe.getProcessInstance(piId); + assertEquals(NOT_STARTED, pi.getState()); + + // start process + testReq.setProcessInstanceID(piId); + pe.start(testReq); + pi = pe.getProcessInstance(piId); + assertEquals(SUSPENDED, pi.getState()); + + System.out.println("Do something asynchronously"); + testReq.setProcessInstanceID(piId); + pe.signal(testReq); + try { + pi = pe.getProcessInstance(piId); + throw new ProcessExecutionException("ProcessInstance should be removed already, but it was found."); + //assertEquals(ENDED, pi.getState()); + + } catch (IllegalArgumentException e) { + // do nothing because processInstance should be already removed + + } + + + } + + @Test(expected = IllegalArgumentException.class) + public void testProcessInstanceDoesNotExist() { + pe.getProcessInstance("does not exist"); + } + +} diff --git a/eaaf_core/src/test/resources/log4j.xml b/eaaf_core/src/test/resources/log4j.xml new file mode 100644 index 00000000..6685c1e8 --- /dev/null +++ b/eaaf_core/src/test/resources/log4j.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> + +<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> + <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender"> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} %5p %c{1} - %m%n" /> + </layout> + </appender> + + <root> + <priority value="info" /> + <appender-ref ref="consoleAppender" /> + </root> + +</log4j:configuration> diff --git a/eaaf_core/src/test/resources/process/hibernate.configuration.test.properties b/eaaf_core/src/test/resources/process/hibernate.configuration.test.properties new file mode 100644 index 00000000..c4faa6d0 --- /dev/null +++ b/eaaf_core/src/test/resources/process/hibernate.configuration.test.properties @@ -0,0 +1,12 @@ +# minimal Hibnerate configuration for testing the process engine +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.connection.url=jdbc:h2:mem:moa.id-session;DB_CLOSE_DELAY=-1 +hibernate.connection.charSet=utf-8 +hibernate.connection.driver_class=org.h2.Driver +hibernate.connection.username= +hibernate.connection.password= + +hibernate.format_sql=true +hibernate.show_sql=false +hibernate.transaction.auto_close_session=true +hibernate.hbm2ddl.auto=update diff --git a/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionForSAML1Authentication.xml b/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionForSAML1Authentication.xml new file mode 100644 index 00000000..3ccc837f --- /dev/null +++ b/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionForSAML1Authentication.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<pd:ProcessDefinition xmlns:pd="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + id="SampleProcessDefinitionForSAML1Authentication"> + + <!-- + returns String 'bkuURL' + --> + <pd:Task id="bkuSelectionTask" class="SelectBKUTask" /> + + <!-- + requires 'bkuURL' + returns String 'IdentityLink' + --> + <pd:Task id="getIdentityLinkTask" class="GetIdentityLinkTask" /> + + <!-- + requires 'IdentityLink' + returns Boolean 'isIdentityLinkValidated' + --> + <pd:Task id="validateIdentityLinkTask" class="ValidateIdentityLinkTask" /> + + <!-- + requires 'IdentityLink', 'isIdentityLinkValidated', 'bkuURL' + returns String 'SignedAuthBlock' + --> + <pd:Task id="signAuthBlockTask" class="SignAuthBlockTask" /> + + <!-- + requires 'IdentityLink', 'isIdentityLinkValidated', 'SignedAuthBlock' + returns Boolean 'isSignedAuthBlockValidated' + --> + <pd:Task id="validateSignedAuthBlockTask" class="ValidateSignedAuthBlockTask" /> + + <!-- + requires 'IdentityLink', 'isIdentityLinkValidated', 'SignedAuthBlock', 'isSignedAuthBlockValidated'; + returns 'SAML1Assertion' + --> + <pd:Task id="createAssertionTask" class="CreateSAML1AssertionTask" /> + + <pd:Task id="task2" class="HelloWorldTask" async="true" /> + + <pd:StartEvent id="start" /> + <pd:EndEvent id="end" /> + + <pd:Transition from="start" to="bkuSelectionTask" conditionExpression="ctx['bkuURL'] == null" /> + <pd:Transition from="start" to="getIdentityLinkTask" /> + + <pd:Transition from="bkuSelectionTask" to="getIdentityLinkTask" /> + <pd:Transition from="getIdentityLinkTask" to="validateIdentityLinkTask" /> + <pd:Transition from="validateIdentityLinkTask" to="signAuthBlockTask" conditionExpression="ctx['isIdentityLinkValidated']" /> + <pd:Transition from="signAuthBlockTask" to="validateSignedAuthBlockTask" /> + <pd:Transition from="validateSignedAuthBlockTask" to="createAssertionTask" conditionExpression="ctx['isSignedAuthBlockValidated']" /> + + <pd:Transition from="createAssertionTask" to="task2" /> + + <pd:Transition from="task2" to="end" /> + +</pd:ProcessDefinition> diff --git a/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionWithExpression1.xml b/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionWithExpression1.xml new file mode 100644 index 00000000..dfe18642 --- /dev/null +++ b/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionWithExpression1.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<pd:ProcessDefinition xmlns:pd="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + id="SampleProcessWithExpression1"> + + <pd:Task id="task1" /> + <pd:Task id="task2" /> + <pd:Task id="task3" /> + <pd:Task id="task4" /> + + <pd:StartEvent id="start" /> + <pd:EndEvent id="end" /> + + <pd:Transition from="start" to="task1" conditionExpression="'true'" /> + <pd:Transition from="task1" to="task2" conditionExpression="'true'" /> + <pd:Transition from="task2" to="task3" conditionExpression="'true'" /> + <pd:Transition from="task3" to="task4" conditionExpression="'true'" /> + <pd:Transition from="task4" to="end" conditionExpression="'true'" /> + +</pd:ProcessDefinition> diff --git a/eaaf_core/src/test/resources/process/spring/test/SpringExpressionAwareProcessEngineTest-context.xml b/eaaf_core/src/test/resources/process/spring/test/SpringExpressionAwareProcessEngineTest-context.xml new file mode 100644 index 00000000..2f4648de --- /dev/null +++ b/eaaf_core/src/test/resources/process/spring/test/SpringExpressionAwareProcessEngineTest-context.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xmlns:tx="http://www.springframework.org/schema/tx" + xmlns:aop="http://www.springframework.org/schema/aop" + xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> + + <bean id="springElAwareExpressionEvaluator" class="at.gv.egiz.eaaf.core.impl.idp.process.spring.SpringExpressionEvaluator" /> + + <bean id="processEngine" class="at.gv.egiz.eaaf.core.impl.idp.process.ProcessEngineImpl"> + <property name="transitionConditionExpressionEvaluator" ref="springElAwareExpressionEvaluator" /> + </bean> + + <bean id="TransactionStorage" + class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.DummyTransactionStorage"/> + + <bean id="ProcessInstanceStoreage" + class="at.gv.egiz.eaaf.core.impl.idp.process.dao.ProcessInstanceStoreDAOImpl"/> + + <bean id="HelloWorldTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.test.HelloWorldTask"/> + + <bean id="HalloWeltTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.test.HalloWeltTask"/> + + <bean id="SelectBKUTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task.SelectBKUTask"/> + + <bean id="CreateSAML1AssertionTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task.CreateSAML1AssertionTask"/> + + <bean id="GetIdentityLinkTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task.GetIdentityLinkTask"/> + + <bean id="SignAuthBlockTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task.SignAuthBlockTask"/> + + <bean id="ValidateIdentityLinkTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task.ValidateIdentityLinkTask"/> + + <bean id="ValidateSignedAuthBlockTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task.ValidateSignedAuthBlockTask"/> + +</beans> diff --git a/eaaf_core/src/test/resources/process/spring/test/SpringExpressionEvaluatorTest-context.xml b/eaaf_core/src/test/resources/process/spring/test/SpringExpressionEvaluatorTest-context.xml new file mode 100644 index 00000000..97dfe6fb --- /dev/null +++ b/eaaf_core/src/test/resources/process/spring/test/SpringExpressionEvaluatorTest-context.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + + <bean id="simplePojo" class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.SimplePojo"> + <property name="booleanValue" value="true" /> + <property name="integerValue" value="42" /> + <property name="stringValue" value="HelloWorld" /> + </bean> + + <bean id="expressionEvaluator" class="at.gv.egiz.eaaf.core.impl.idp.process.spring.SpringExpressionEvaluator" /> + +</beans> diff --git a/eaaf_core/src/test/resources/process/spring/test/task/IdentityLink_Max_Mustermann.xml b/eaaf_core/src/test/resources/process/spring/test/task/IdentityLink_Max_Mustermann.xml new file mode 100644 index 00000000..c68972f1 --- /dev/null +++ b/eaaf_core/src/test/resources/process/spring/test/task/IdentityLink_Max_Mustermann.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?><saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:ecdsa="http://www.w3.org/2001/04/xmldsig-more#" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" xmlns:si="http://www.w3.org/2001/XMLSchema-instance" AssertionID="szr.bmi.gv.at-AssertionID132860852347311974" IssueInstant="2012-02-07T10:55:23+01:00" Issuer="http://portal.bmi.gv.at/ref/szr/issuer" MajorVersion="1" MinorVersion="0"> + <saml:AttributeStatement> + <saml:Subject> + <saml:SubjectConfirmation> + <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</saml:ConfirmationMethod> + <saml:SubjectConfirmationData> + <pr:Person si:type="pr:PhysicalPersonType"><pr:Identification><pr:Value>tqCQEC7+AqGEeeL390V5Jg==</pr:Value><pr:Type>urn:publicid:gv.at:baseid</pr:Type></pr:Identification><pr:Name><pr:GivenName>Max</pr:GivenName><pr:FamilyName primary="undefined">Mustermann</pr:FamilyName></pr:Name><pr:DateOfBirth>1940-01-01</pr:DateOfBirth></pr:Person> + </saml:SubjectConfirmationData> + </saml:SubjectConfirmation> + </saml:Subject> + <saml:Attribute AttributeName="CitizenPublicKey" AttributeNamespace="urn:publicid:gv.at:namespaces:identitylink:1.2"><saml:AttributeValue><ecdsa:ECDSAKeyValue><ecdsa:DomainParameters><ecdsa:NamedCurve URN="urn:oid:1.2.840.10045.3.1.7"/></ecdsa:DomainParameters><ecdsa:PublicKey><ecdsa:X Value="111409151487007036894649069746411000129419717653159596280366627647453458115517" si:type="ecdsa:PrimeFieldElemType"/><ecdsa:Y Value="94725036374184689337892465478597728884477416796494369571140658859618867645034" si:type="ecdsa:PrimeFieldElemType"/></ecdsa:PublicKey></ecdsa:ECDSAKeyValue></saml:AttributeValue></saml:Attribute></saml:AttributeStatement> + <dsig:Signature> + <dsig:SignedInfo> + <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> + <dsig:Reference URI=""> + <dsig:Transforms> + <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> + <dsig:XPath>not(ancestor-or-self::pr:Identification)</dsig:XPath> + </dsig:Transform> + <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> + </dsig:Transforms> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>Rmr5vkWXL/PvpoXnbK632QmzYms=</dsig:DigestValue> + </dsig:Reference> + <dsig:Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest"> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>HoPZWYll8aMFpKOlRSwckt5iCQk=</dsig:DigestValue> + </dsig:Reference> + </dsig:SignedInfo> + <dsig:S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Q2gQqFuExdWYxvsowjiSbiis9iUf1c0zscvDS3mIZxGs4M89XHsjHnIyb+Fuwnamw65QrFvM1tNB1ZMjxJ3x+YmHLHdtT3BEBcr3/NCRHd2S0HoBspNz9HVgJaZY1llR7poKBvnAc4g1i+QTvyVb00PtKxR9Lw/9ABInX/1pzpxqrPy7Ib2OP8z6dd3WHmIsCiSHUaj0Dxwwln6fYJjhxZ141SnbovlCLYtrsZLXoi9ljIqX4xO0PwMI2RfNc9cXxTRrRS6rEOvX7PpvgXiDXhp592Yyp4=</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo> + <dsig:Object> + <dsig:Manifest Id="manifest"> + <dsig:Reference URI=""> + <dsig:Transforms> + <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> + <dsig:XPath>not(ancestor-or-self::dsig:Signature)</dsig:XPath> + </dsig:Transform> + </dsig:Transforms> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>7IkIdYti2dh3VZQ4Fp+9lPT67cM=</dsig:DigestValue> + </dsig:Reference> + </dsig:Manifest> + </dsig:Object> + </dsig:Signature> +</saml:Assertion>
\ No newline at end of file diff --git a/eaaf_core/src/test/resources/process/spring/test/task/SAML1Assertion.xml b/eaaf_core/src/test/resources/process/spring/test/task/SAML1Assertion.xml new file mode 100644 index 00000000..3aeedd59 --- /dev/null +++ b/eaaf_core/src/test/resources/process/spring/test/task/SAML1Assertion.xml @@ -0,0 +1,487 @@ +<?xml version="1.0" encoding="UTF-8"?> +<saml:Assertion AssertionID="6025428631468682100" IssueInstant="2008-07-14T17:51:38+02:00" Issuer="https://localhost:18443/moa-id-auth/" MajorVersion="1" MinorVersion="0" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:si="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <saml:AttributeStatement> + <saml:Subject> + <saml:NameIdentifier NameQualifier="urn:publicid:gv.at:wbpk+FN+www.act.at">K2YMyx3/5kIpNJR+SAD/rbRYH+c=</saml:NameIdentifier> + <saml:SubjectConfirmation> + <saml:ConfirmationMethod>http://reference.e-government.gv.at/namespace/moa/20020822#cm</saml:ConfirmationMethod> + <saml:SubjectConfirmationData> + <saml:Assertion AssertionID="any" IssueInstant="2008-07-14T17:51:26+02:00" Issuer="Thomas Knall" MajorVersion="1" MinorVersion="0" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"> + <saml:AttributeStatement> + <saml:Subject> + <saml:NameIdentifier>https://localhost:18443/moa-id-auth/</saml:NameIdentifier> + </saml:Subject> + <saml:Attribute AttributeName="wbPK" AttributeNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#"> + <saml:AttributeValue> + <pr:Identification> + <pr:Value>K2YMyx3/5kIpNJR+SAD/rbRYH+c=</pr:Value> + <pr:Type>urn:publicid:gv.at:wbpk+FN+www.act.at</pr:Type> + </pr:Identification> + </saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="OA" AttributeNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#"> + <saml:AttributeValue>https://localhost:48443/mandates/</saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="Geburtsdatum" AttributeNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#"> + <saml:AttributeValue>1978-04-29</saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="RepresentationType" AttributeNamespace="http://reference.e-government.gv.at/namespace/mandates/20040701#"> + <saml:AttributeValue>Vollmachtsvertreter</saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="MandatorName" AttributeNamespace="http://reference.e-government.gv.at/namespace/mandates/20040701#"> + <saml:AttributeValue>MeineTestFirma</saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="MandatorWbpk" AttributeNamespace="http://reference.e-government.gv.at/namespace/mandates/20040701#"> + <saml:AttributeValue>123456i</saml:AttributeValue> + </saml:Attribute> + </saml:AttributeStatement> + <dsig:Signature Id="signature-1216050695-35956125-21395" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"> + <dsig:SignedInfo> + <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> + <dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"/> + <dsig:Reference Id="signed-data-reference-0-1216050695-35956125-19584" URI=""> + <dsig:Transforms> + <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> + <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116"> + <xsl:stylesheet version="1.0" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="/" xmlns="http://www.w3.org/1999/xhtml"> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>Signatur der Anmeldedaten</title> + <style media="screen" type="text/css"> + .boldstyle { font-weight: bold; } + .italicstyle { font-style: italic; } + .annotationstyle { font-size: small; } + </style> + </head> + <body> + <h1>Signatur der Anmeldedaten</h1> + <p/> + <h4>Mit meiner elektronischen Signatur beantrage ich, + <span class="boldstyle"> + <xsl:value-of select="//@Issuer"/> + </span>, geboren am + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,9,2)"/>. + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,6,2)"/>. + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,1,4)"/>, + <xsl:if test="//saml:Attribute[@AttributeName='OIDTextualDescription']"> + in der Rolle als <xsl:value-of select="//saml:Attribute[@AttributeName='OIDTextualDescription']/saml:AttributeValue"/> + (OID***= <xsl:value-of select="//saml:Attribute[@AttributeName='OID']/saml:AttributeValue"/>), + </xsl:if> + den Zugang zur gesicherten Anwendung. + </h4> + <p/> + <h4>Datum und Uhrzeit: + <xsl:value-of select="substring(//@IssueInstant,9,2)"/>. + <xsl:value-of select="substring(//@IssueInstant,6,2)"/>. + <xsl:value-of select="substring(//@IssueInstant,1,4)"/>, + <xsl:value-of select="substring(//@IssueInstant,12,2)"/>: + <xsl:value-of select="substring(//@IssueInstant,15,2)"/>: + <xsl:value-of select="substring(//@IssueInstant,18,2)"/> + </h4> + <xsl:if test="//saml:Attribute[@AttributeName='HPI']"> + <h4>HPI(**): <xsl:value-of select="//saml:Attribute[@AttributeName='HPI']/saml:AttributeValue"/> + </h4> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='wbPK']"> + <h4>wbPK(*): <xsl:value-of select="//saml:Attribute[@AttributeName='wbPK']/saml:AttributeValue/pr:Identification/pr:Value"/> + </h4> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='MandatorName']"> + <hr/> + <h4>Ich bin weiters ermächtigt als <xsl:value-of select="//saml:Attribute[@AttributeName='RepresentationType']/saml:AttributeValue/text()"/> + von <xsl:value-of select="//saml:Attribute[@AttributeName='MandatorName']/saml:AttributeValue/text()"/> + <xsl:if test="//saml:Attribute[@AttributeName='MandatorDateOfBirth']">, geboren am + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='MandatorDateOfBirth']/saml:AttributeValue,9,2)"/>. + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='MandatorDateOfBirth']/saml:AttributeValue,6,2)"/>. + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='MandatorDateOfBirth']/saml:AttributeValue,1,4)"/> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='MandatorDomainIdentifier']">, + <xsl:value-of select="//saml:Attribute[@AttributeName='MandatorDomainIdentifier']/saml:AttributeValue/text()"/> + </xsl:if>, in deren Auftrag zu handeln. + </h4> + <xsl:if test="//saml:Attribute[@AttributeName='MandatorWbpk']"> + <h4>wbPK(*) des Vollmachtgebers: <xsl:value-of select="//saml:Attribute[@AttributeName='MandatorWbpk']/saml:AttributeValue/text()"/> + </h4> + </xsl:if> + <p/> + </xsl:if> + <xsl:choose> + <xsl:when test="//saml:Attribute[@AttributeName='OID']"> + <p/> + <hr/> + </xsl:when> + <xsl:when test="//saml:Attribute[@AttributeName='HPI']"> + <p/> + <hr/> + </xsl:when> + <xsl:when test="//saml:Attribute[@AttributeName='wbPK']"> + <p/> + <hr/> + </xsl:when> + </xsl:choose> + <xsl:if test="//saml:Attribute[@AttributeName='wbPK']"> + <div class="annotationstyle">(*) wbPK: Das <span class="italicstyle">wirtschaftsbereichsspezifische Personenkennzeichen</span> wird aus den + jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum + Wirtschaftsunternehmen.</div> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='HPI']"> + <div class="annotationstyle">(**) HPI: Der <span class="italicstyle">eHealth Professional Identifier</span> wird aus den jeweiligen + Stammzahlen der Gesundheitsdiensteanbieterinnen / Gesundheitsdiensteanbieter berechnet und ermöglicht eine eindeutige Zuordnung der + Gesundheitsdiensteanbieterin / des Gesundheitsdiensteanbieters im Gesundheitsbereich.</div> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='OID']"> + <div class="annotationstyle">(***) OID: <span class="italicstyle">Object Identifier</span> sind standardisierte Objekt-Bezeichner und + beschreiben eindeutig die Rollen des GDA-Token Inhabers.</div> + </xsl:if> + </body> + </html> + </xsl:template> + </xsl:stylesheet> + </dsig:Transform> + <dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/> + </dsig:Transforms> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>0q9QWyqAyyiVNNLu1rIcU+nKsEE=</dsig:DigestValue> + </dsig:Reference> + <dsig:Reference Id="etsi-data-reference-0-1216050695-35956125-7815" Type="http://uri.etsi.org/01903/v1.1.1#SignedProperties" URI="#xmlns(etsi=http://uri.etsi.org/01903/v1.1.1%23)%20xpointer(id('etsi-data-object-0-1216050695-35956125-20638')/child::etsi:QualifyingProperties/child::etsi:SignedProperties)"> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>WtB0/ptvoB/r/7+fauSUIBULymg=</dsig:DigestValue> + </dsig:Reference> + </dsig:SignedInfo> + <dsig:SignatureValue>mZt9DuZiDqG81scsf30qjSDdy6vKC2/n034ZZwMUAvfWOXy3+Ubsk5X5CHhz ++lyI</dsig:SignatureValue> + <dsig:KeyInfo> + <dsig:X509Data> + <dsig:X509Certificate>MIIEtDCCA5ygAwIBAgIDAgTEMA0GCSqGSIb3DQEBBQUAMIGXMQswCQYDVQQG +EwJBVDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lz +dGVtZSBpbSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMR4wHAYDVQQLDBVh +LXNpZ24tUHJlbWl1bS1TaWctMDIxHjAcBgNVBAMMFWEtc2lnbi1QcmVtaXVt +LVNpZy0wMjAeFw0wNjA0MDQwOTUyMjhaFw0xMTA0MDQwOTUyMjhaMGkxCzAJ +BgNVBAYTAkFUMRUwEwYDVQQDDAxUaG9tYXMgS25hbGwxDjAMBgNVBAQMBUtu +YWxsMQ8wDQYDVQQqDAZUaG9tYXMxFTATBgNVBAUTDDUzNTE5ODkyMzM0OTEL +MAkGA1UEDAwCREkwSTATBgcqhkjOPQIBBggqhkjOPQMBAQMyAARrnYW5sXCQ +6M3irWaanDPi/ROXueKWiPRyZGjNH0Cp/NaiOuvrpv2RDVEKQm2tBiajggIP +MIICCzATBgNVHSMEDDAKgAhN3+H/S9nJ3zAnBggrBgEFBQcBAwEB/wQYMBYw +CAYGBACORgEBMAoGCC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id="etsi-data-object-0-1216050695-35956125-20638"> + <etsi:QualifyingProperties Target="#signature-1216050695-35956125-21395" xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#"> + <etsi:SignedProperties> + <etsi:SignedSignatureProperties> + <etsi:SigningTime>2008-07-14T15:51:35Z</etsi:SigningTime> + <etsi:SigningCertificate> + <etsi:Cert> + <etsi:CertDigest> + <etsi:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <etsi:DigestValue>inMYWBmAxMHP7mDENjLFaEtv0Zk=</etsi:DigestValue> + </etsi:CertDigest> + <etsi:IssuerSerial> + <dsig:X509IssuerName>CN=a-sign-Premium-Sig-02,OU=a-sign-Premium-Sig-02,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT</dsig:X509IssuerName> + <dsig:X509SerialNumber>132292</dsig:X509SerialNumber> + </etsi:IssuerSerial> + </etsi:Cert> + </etsi:SigningCertificate> + <etsi:SignaturePolicyIdentifier> + <etsi:SignaturePolicyImplied/> + </etsi:SignaturePolicyIdentifier> + </etsi:SignedSignatureProperties> + <etsi:SignedDataObjectProperties> + <etsi:DataObjectFormat ObjectReference="#signed-data-reference-0-1216050695-35956125-19584"> + <etsi:MimeType>application/xhtml+xml</etsi:MimeType> + </etsi:DataObjectFormat> + </etsi:SignedDataObjectProperties> + </etsi:SignedProperties> + </etsi:QualifyingProperties> + </dsig:Object> + </dsig:Signature> + </saml:Assertion> + <saml:Assertion AssertionID="szr.bmi.gv.at-AssertionID11936526102761952" IssueInstant="2007-10-29T10:10:10+01:00" Issuer="http://portal.bmi.gv.at/ref/szr/issuer" MajorVersion="1" MinorVersion="0" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:ecdsa="http://www.w3.org/2001/04/xmldsig-more#" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:si="http://www.w3.org/2001/XMLSchema-instance"> + <saml:AttributeStatement> + <saml:Subject> + <saml:SubjectConfirmation> + <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</saml:ConfirmationMethod> + <saml:SubjectConfirmationData> + <pr:Person si:type="pr:PhysicalPersonType"> + <pr:Identification> + <pr:Value>K2YMyx3/5kIpNJR+SAD/rbRYH+c=</pr:Value> + <pr:Type>urn:publicid:gv.at:wbpk+FN+www.act.at</pr:Type> + </pr:Identification> + <pr:Name> + <pr:GivenName>Thomas</pr:GivenName> + <pr:FamilyName primary="undefined">Knall</pr:FamilyName> + </pr:Name> + <pr:DateOfBirth>1978-04-29</pr:DateOfBirth> + </pr:Person> + </saml:SubjectConfirmationData> + </saml:SubjectConfirmation> + </saml:Subject> + <saml:Attribute AttributeName="CitizenPublicKey" AttributeNamespace="urn:publicid:gv.at:namespaces:identitylink:1.2"> + <saml:AttributeValue> + <ecdsa:ECDSAKeyValue> + <ecdsa:DomainParameters> + <ecdsa:NamedCurve URN="urn:oid:1.2.840.10045.3.1.1"/> + </ecdsa:DomainParameters> + <ecdsa:PublicKey> + <ecdsa:X Value="2638720011055700682018137297354399374048880611104468142324" si:type="ecdsa:PrimeFieldElemType"/> + <ecdsa:Y Value="2804889174475641803405778188053052844820705830770276369958" si:type="ecdsa:PrimeFieldElemType"/> + </ecdsa:PublicKey> + </ecdsa:ECDSAKeyValue> + </saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="CitizenPublicKey" AttributeNamespace="urn:publicid:gv.at:namespaces:identitylink:1.2"> + <saml:AttributeValue> + <dsig:RSAKeyValue> + <dsig:Modulus>sWOqPZzPTn9VvBR5LjuopIWYdh5aGzuX2vMjofhn8bStba1CDW1qkDdlYW4Rs/DfU/I1uqor4Lje +/G3Yzh82yD0MHdzlW8MYUJ8RJe+czbjRUPaSbC/NRqhyF3eKnflxM++sJb2abrUH/9TV0q8P5QRS +uZC/JpAEYpSazysPz/fv8AEnU8oxcTvCiax1jf2GZPmm3qFjPc4qDYNHqfnE8yWYt7kHeqPV/cRw +x3aMGW8mRwQZb7VRFLW5g37nrt9N</dsig:Modulus> + <dsig:Exponent>AQAB</dsig:Exponent> + </dsig:RSAKeyValue> + </saml:AttributeValue> + </saml:Attribute> + </saml:AttributeStatement> + <dsig:Signature> + <dsig:SignedInfo> + <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> + <dsig:Reference URI=""> + <dsig:Transforms> + <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> + <dsig:XPath>not(ancestor-or-self::pr:Identification)</dsig:XPath> + </dsig:Transform> + <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> + </dsig:Transforms> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>b3d/wcQb0Bl0/6GSPsrMxWpdRLA=</dsig:DigestValue> + </dsig:Reference> + <dsig:Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest"> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>eet0q3Thmw6+cbO1fazbEg0556I=</dsig:DigestValue> + </dsig:Reference> + </dsig:SignedInfo> + <dsig:SignatureValue> +oy55Cq7IyYy7z/TO2a3+m7tjG/ztiKhxhGzVqEYIWIObEOs/GVJDCCI4oe/HS8Fhc4TaXDcZXk4y +qBp4JJ288TeaNjPYkPzp38nWJ4xRatEyo7VaySXy+TqgwiBT5uhxrwkroCr4ZIWwOvt1uR5UBVAf +qk1ii+LPW2WYE3bMpoHfrM9CdFSPzWTRl/0zsEURc64EBPyIdKz+c70DaexeX2E0JVelKcj+jDaJ +mHsFhi/9QoscqPEVA87qv07yhyK5S41+f3HDvpuhYwvQDdOq50sclfsI+g9r473VxiRsOmJ9Ak4/ +k2KP0tgfAQ+h5hRGQUUo5LYP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BBQUHMAKGOWh0dHA6Ly93d3cuYS10cnVzdC5hdC9jZXJ0cy9h +LXNpZ24tY29ycG9yYXRlLWxpZ2h0LTAzLmNydDBYBgNVHSAEUTBPME0GByooABEB +BwEwQjBABggrBgEFBQcCARY0aHR0cDovL3d3dy5hLXRydXN0LmF0L2RvY3MvY3Av +YS1zaWduLWNvcnBvcmF0ZS1saWdodDCBngYDVR0fBIGWMIGTMIGQoIGNoIGKhoGH +bGRhcDovL2xkYXAuYS10cnVzdC5hdC9vdT1hLXNpZ24tY29ycG9yYXRlLWxpZ2h0 +LTAzLG89QS1UcnVzdCxjPUFUP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3Q/YmFz +ZT9vYmplY3RjbGFzcz1laWRDZXJ0aWZpY2F0aW9uQXV0aG9yaXR5MBEGA1UdDgQK +BAhMCA6eGvS1ujAOBgNVHQ8BAf8EBAMCBLAwCQYDVR0TBAIwADAOBgcqKAAKAQcB +BAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAEoIvqPLAg0n2wCS27zTL+hmLi7zSbes +Od4e6pFT1l3cwGfdTkhiHVPnPRaDGLQkS384fAXBrOp6W13X9m2jD9csO6vZhd+T +nERXN1AqayoaecXFyHPykVUTLhn6pMdiSE21mEozfGLUDGMz74lvphEKFAOOCgp1 +o5ZCR09RbGAEbQNNn+ucXJxIa3mYjr1h3AElVbXoeoz12qUpqsNm9znymSkcmcNo +B5Pk6qXXx9UeC/Tj0aTglNkcMOSCFayldzOBaY6+qWKguPdzQUEryhGiNuARQpM5 +KMzvI0rmpc4Gau5HT9rQZHadr++VS8v1k6935uIyyZF9s+gdS5ywnSM= +</dsig:X509Certificate> + </dsig:X509Data> + </dsig:KeyInfo> + <dsig:Object> + <dsig:Manifest Id="manifest"> + <dsig:Reference URI=""> + <dsig:Transforms> + <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> + <dsig:XPath>not(ancestor-or-self::dsig:Signature)</dsig:XPath> + </dsig:Transform> + </dsig:Transforms> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>JZGwiDzQAtJtnJMeeXyypTrDjwY=</dsig:DigestValue> + </dsig:Reference> + </dsig:Manifest> + </dsig:Object> + </dsig:Signature> + </saml:Assertion> + </saml:SubjectConfirmationData> + </saml:SubjectConfirmation> + </saml:Subject> + <saml:Attribute AttributeName="PersonData" AttributeNamespace="http://reference.e-government.gv.at/namespace/persondata/20020228#"> + <saml:AttributeValue> + <pr:Person si:type="pr:PhysicalPersonType" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" xmlns:si="http://www.w3.org/2001/XMLSchema-instance"> + <pr:Identification> + <pr:Value>K2YMyx3/5kIpNJR+SAD/rbRYH+c=</pr:Value> + <pr:Type>urn:publicid:gv.at:wbpk+FN+www.act.at</pr:Type> + </pr:Identification> + <pr:Name> + <pr:GivenName>Thomas</pr:GivenName> + <pr:FamilyName primary="undefined">Knall</pr:FamilyName> + </pr:Name> + <pr:DateOfBirth>1978-04-29</pr:DateOfBirth> + </pr:Person> + </saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="isQualifiedCertificate" AttributeNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#"> + <saml:AttributeValue>true</saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="bkuURL" AttributeNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#"> + <saml:AttributeValue>https://127.0.0.1:3496/https-security-layer-request</saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="SignerCertificate" AttributeNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#"> + <saml:AttributeValue>MIIEtDCCA5ygAwIBAgIDAgTEMA0GCSqGSIb3DQEBBQUAMIGXMQswCQYDVQQGEwJB +VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp +bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMR4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Tk3ODA0 +MjkwMDAwMDBaMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQEFBQADggEBAFkSCJE0YD4p +4izU3ekQYPv4Z7gm/VFlpma5hXNvwkajVjHlAqo/ylYn8NQ4mMkD+yCDNtm8m8nr +0K/yICb8Gnkbv59i6nh2AbzYBBb49VnYYGL6uunLH0aFUpAhy+3mDdlH8uhhIQBH +wCfgwG1qa5zXY7bz4Vzkac/h6T+JVFkIegO8OHQDadhgJvW80qspiao2DTac6vVg +x4tGvjpdmw1R2pXBYhHD5rkPHlkfGoeL3ak6hq4ea94Oy5VfNTIJv5MA0J2G1mwn +W9B8uPWSM5EYPoWJyBOWcKBLSSUqOt9D/9215ZGfbchkdRZjx0dTAD3FIhgG8nA7 +2/uCFrBzyTk=</saml:AttributeValue> + </saml:Attribute> + <saml:Attribute AttributeName="Mandate" AttributeNamespace="http://reference.e-government.gv.at/namespace/mandates/20040701#"> + <saml:AttributeValue> + <md:Mandate MandateID="https://egov.act.at/mandates/20080714174835/886164" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:md="http://reference.e-government.gv.at/namespace/mandates/20040701#" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#"> + <md:Annotation>Prokura - MeineTestFirma</md:Annotation> + <md:StatusInformationService>http://localhost:58080/omsp/OMSPRequest</md:StatusInformationService> + <md:Representative> + <pr:PhysicalPerson> + <pr:Identification> + <pr:Value>K2YMyx3/5kIpNJR+SAD/rbRYH+c=</pr:Value> + <pr:Type>urn:publicid:gv.at:wbpk+FN+www.act.at</pr:Type> + </pr:Identification> + <pr:Name> + <pr:GivenName>Thomas</pr:GivenName> + <pr:FamilyName primary="undefined">Knall</pr:FamilyName> + </pr:Name> + <pr:DateOfBirth>1978-04-29</pr:DateOfBirth> + </pr:PhysicalPerson> + </md:Representative> + <md:Mandator> + <pr:CorporateBody> + <pr:Identification> + <pr:Value>123456i</pr:Value> + <pr:Type>urn:publicid:gv.at:baseid+XFN</pr:Type> + </pr:Identification> + <pr:FullName>MeineTestFirma</pr:FullName> + </pr:CorporateBody> + </md:Mandator> + <md:Issued> + <md:Place>Wien</md:Place> + <md:Date>2008-07-14</md:Date> + </md:Issued> + <md:Properties> + <md:SubstitutionAllowed>false</md:SubstitutionAllowed> + </md:Properties> + <md:SimpleMandateContent> + <md:TextualDescription>Der/Die Bevollmächtigte wird zum Prokuristen/Prokuristin bestellt.</md:TextualDescription> + </md:SimpleMandateContent> + <dsig:Signature Id="signature-1-1" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"> + <dsig:SignedInfo> + <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> + <dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"/> + <dsig:Reference Id="reference-1-1" URI=""> + <dsig:Transforms> + <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> + <dsig:XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:moa="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#">not(ancestor-or-self::pr:Identification or ancestor-or-self::dsig:Signature)</dsig:XPath> + </dsig:Transform> + <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> + <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </dsig:Transforms> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>PRRF0sWBgoywztCKWEXafZfhpd0=</dsig:DigestValue> + </dsig:Reference> + <dsig:Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#dsig-manifest-1-1"> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>NorNorUqPFMA06JfxSJopOq7Qv0=</dsig:DigestValue> + </dsig:Reference> + </dsig:SignedInfo> + <dsig:SignatureValue>IQMZFc57XZd9LjeiaZqSfzZtWuXhuikAqbKA7pWuDK02DLFSYZPXsGjcvnwNdVaP</dsig:SignatureValue> + <dsig:KeyInfo> + <dsig:X509Data> + <dsig:X509Certificate>MIICtjCCAm6gAwIBAgIBATAJBgcqhkjOPQQBMGoxCzAJBgNVBAYTAkFUMQ0wCwYD +VQQHEwRXaWVuMRkwFwYDVQQJExBFc3NsaW5nZ2Fzc2UgNS85MQwwCgYDVQQKEwNB +Q1QxIzAhBgNVBAMTGlZvbGxtYWNodGVuIFNpZ25hdHVyZGllbnN0MB4XDTA4MDcw +ODE1MTk1MFoXDTEyMTIzMTIxNTk1OVowajELMAkGA1UEBhMCQVQxDTALBgNVBAcT +BFdpZW4xGTAXBgNVBAkTEEVzc2xpbmdnYXNzZSA1LzkxDDAKBgNVBAoTA0FDVDEj +MCEGA1UEAxMaVm9sbG1hY2h0ZW4gU2lnbmF0dXJkaWVuc3QwgfMwgbwGByqGSM49 +AgEwgbACAQEwJAYHKoZIzj0BAQIZAP////////////////////7//////////zA0 +BBj////////////////////+//////////wEGGQhBRnlnIDnD6fpq3IkMEn+uN7s +wUa5sQQxBBiNqA6wMJD2fL8g60OhiAD0/wr9gv8QEgcZK5X/yNp4YxAR7WskzdVz ++XehHnlIEQIZAP///////////////5ne+DYUa8mxtNIoMQIBAQMyAAS908G9FD5/ +LLYruwFbp9giXahdQ1FAqKwzohSn9pgsVTQBnvXxU8IWIzhPHs49DZCjazBpMAwG +A1UdEwEB/wQCMAAwHQYDVR0OBBYEFLOSgnkLSJ3l4Ah49rHX/FAV1wWcMBkGA1Ud +IAQSMBAwDgYMKwYBBAGVEgECBAEBMB8GA1UdIwQYMBaAFLOSgnkLSJ3l4Ah49rHX +/FAV1wWcMAkGByqGSM49BAEDNwAwNAIYTTppZzS6wqoLDFcf9frHzf1kMheY04dT +Ahg4Nrb54vE3DTRf9sbO4xs4dTARHSt1ihA=</dsig:X509Certificate> + </dsig:X509Data> + </dsig:KeyInfo> + <dsig:Object> + <dsig:Manifest Id="dsig-manifest-1-1"> + <dsig:Reference Id="reference-1-2" URI=""> + <dsig:Transforms> + <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> + <dsig:XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:moa="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#">not(ancestor-or-self::dsig:Signature)</dsig:XPath> + </dsig:Transform> + <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> + <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </dsig:Transforms> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>oz6ThHPL3V7RNibfPrDSWVhUgi8=</dsig:DigestValue> + </dsig:Reference> + </dsig:Manifest> + </dsig:Object> + </dsig:Signature> + </md:Mandate> + </saml:AttributeValue> + </saml:Attribute> + </saml:AttributeStatement> +</saml:Assertion> diff --git a/eaaf_core/src/test/resources/process/spring/test/task/SignedAuthBlock.xml b/eaaf_core/src/test/resources/process/spring/test/task/SignedAuthBlock.xml new file mode 100644 index 00000000..450ba90f --- /dev/null +++ b/eaaf_core/src/test/resources/process/spring/test/task/SignedAuthBlock.xml @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dsig:Signature Id="signature-1216050695-35956125-21395" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"> + <dsig:SignedInfo> + <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> + <dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"/> + <dsig:Reference Id="signed-data-reference-0-1216050695-35956125-19584" URI=""> + <dsig:Transforms> + <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> + <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116"> + <xsl:stylesheet version="1.0" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="/" xmlns="http://www.w3.org/1999/xhtml"> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>Signatur der Anmeldedaten</title> + <style media="screen" type="text/css"> +.boldstyle { font-weight: bold; } +.italicstyle { font-style: italic; } +.annotationstyle { font-size: small; } +</style> + </head> + <body> + <h1>Signatur der Anmeldedaten</h1> + <p/> + <h4>Mit meiner elektronischen Signatur beantrage ich, +<span class="boldstyle"> + <xsl:value-of select="//@Issuer"/> + </span>, geboren am +<xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,9,2)"/>. +<xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,6,2)"/>. +<xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,1,4)"/>, +<xsl:if test="//saml:Attribute[@AttributeName='OIDTextualDescription']"> +in der Rolle als <xsl:value-of select="//saml:Attribute[@AttributeName='OIDTextualDescription']/saml:AttributeValue"/> +(OID***= <xsl:value-of select="//saml:Attribute[@AttributeName='OID']/saml:AttributeValue"/>), +</xsl:if> +den Zugang zur gesicherten Anwendung. +</h4> + <p/> + <h4>Datum und Uhrzeit: +<xsl:value-of select="substring(//@IssueInstant,9,2)"/>. +<xsl:value-of select="substring(//@IssueInstant,6,2)"/>. +<xsl:value-of select="substring(//@IssueInstant,1,4)"/>, +<xsl:value-of select="substring(//@IssueInstant,12,2)"/>: +<xsl:value-of select="substring(//@IssueInstant,15,2)"/>: +<xsl:value-of select="substring(//@IssueInstant,18,2)"/> + </h4> + <xsl:if test="//saml:Attribute[@AttributeName='HPI']"> + <h4>HPI(**): <xsl:value-of select="//saml:Attribute[@AttributeName='HPI']/saml:AttributeValue"/> + </h4> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='wbPK']"> + <h4>wbPK(*): <xsl:value-of select="//saml:Attribute[@AttributeName='wbPK']/saml:AttributeValue/pr:Identification/pr:Value"/> + </h4> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='MandatorName']"> + <hr/> + <h4>Ich bin weiters ermächtigt als <xsl:value-of select="//saml:Attribute[@AttributeName='RepresentationType']/saml:AttributeValue/text()"/> +von <xsl:value-of select="//saml:Attribute[@AttributeName='MandatorName']/saml:AttributeValue/text()"/> + <xsl:if test="//saml:Attribute[@AttributeName='MandatorDateOfBirth']">, geboren am + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='MandatorDateOfBirth']/saml:AttributeValue,9,2)"/>. + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='MandatorDateOfBirth']/saml:AttributeValue,6,2)"/>. + <xsl:value-of select="substring(//saml:Attribute[@AttributeName='MandatorDateOfBirth']/saml:AttributeValue,1,4)"/> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='MandatorDomainIdentifier']">, + <xsl:value-of select="//saml:Attribute[@AttributeName='MandatorDomainIdentifier']/saml:AttributeValue/text()"/> + </xsl:if>, in deren Auftrag zu handeln. +</h4> + <xsl:if test="//saml:Attribute[@AttributeName='MandatorWbpk']"> + <h4>wbPK(*) des Vollmachtgebers: <xsl:value-of select="//saml:Attribute[@AttributeName='MandatorWbpk']/saml:AttributeValue/text()"/> + </h4> + </xsl:if> + <p/> + </xsl:if> + <xsl:choose> + <xsl:when test="//saml:Attribute[@AttributeName='OID']"> + <p/> + <hr/> + </xsl:when> + <xsl:when test="//saml:Attribute[@AttributeName='HPI']"> + <p/> + <hr/> + </xsl:when> + <xsl:when test="//saml:Attribute[@AttributeName='wbPK']"> + <p/> + <hr/> + </xsl:when> + </xsl:choose> + <xsl:if test="//saml:Attribute[@AttributeName='wbPK']"> + <div class="annotationstyle">(*) wbPK: Das <span class="italicstyle">wirtschaftsbereichsspezifische Personenkennzeichen</span> wird aus den +jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum +Wirtschaftsunternehmen.</div> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='HPI']"> + <div class="annotationstyle">(**) HPI: Der <span class="italicstyle">eHealth Professional Identifier</span> wird aus den jeweiligen +Stammzahlen der Gesundheitsdiensteanbieterinnen / Gesundheitsdiensteanbieter berechnet und ermöglicht eine eindeutige Zuordnung der +Gesundheitsdiensteanbieterin / des Gesundheitsdiensteanbieters im Gesundheitsbereich.</div> + </xsl:if> + <xsl:if test="//saml:Attribute[@AttributeName='OID']"> + <div class="annotationstyle">(***) OID: <span class="italicstyle">Object Identifier</span> sind standardisierte Objekt-Bezeichner und +beschreiben eindeutig die Rollen des GDA-Token Inhabers.</div> + </xsl:if> + </body> + </html> + </xsl:template> + </xsl:stylesheet> + </dsig:Transform> + <dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/> + </dsig:Transforms> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>0q9QWyqAyyiVNNLu1rIcU+nKsEE=</dsig:DigestValue> + </dsig:Reference> + <dsig:Reference Id="etsi-data-reference-0-1216050695-35956125-7815" Type="http://uri.etsi.org/01903/v1.1.1#SignedProperties" URI="#xmlns(etsi=http://uri.etsi.org/01903/v1.1.1%23)%20xpointer(id('etsi-data-object-0-1216050695-35956125-20638')/child::etsi:QualifyingProperties/child::etsi:SignedProperties)"> + <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <dsig:DigestValue>WtB0/ptvoB/r/7+fauSUIBULymg=</dsig:DigestValue> + </dsig:Reference> + </dsig:SignedInfo> + <dsig:SignatureValue>mZt9DuZiDqG81scsf30qjSDdy6vKC2/n034ZZwMUAvfWOXy3+Ubsk5X5CHhz ++lyI</dsig:SignatureValue>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y0wMixvPUEt +VHJ1c3QsYz1BVD9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0P2Jhc2U/b2Jq +ZWN0Y2xhc3M9ZWlkQ2VydGlmaWNhdGlvbkF1dGhvcml0eTARBgNVHQ4ECgQI +SNyH29WUoCgwDgYDVR0PAQH/BAQDAgbAMCgGA1UdCQQhMB8wHQYIKwYBBQUH +CQExERgPMTk3ODA0MjkwMDAwMDBaMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQEF +BQADggEBAFkSCJE0YD4p4izU3ekQYPv4Z7gm/VFlpma5hXNvwkajVjHlAqo/ +ylYn8NQ4mMkD+yCDNtm8m8nr0K/yICb8Gnkbv59i6nh2AbzYBBb49VnYYGL6 +uunLH0aFUpAhy+3mDdlH8uhhIQBHwCfgwG1qa5zXY7bz4Vzkac/h6T+JVFkI +egO8OHQDadhgJvW80qspiao2DTac6vVgx4tGvjpdmw1R2pXBYhHD5rkPHlkf +GoeL3ak6hq4ea94Oy5VfNTIJv5MA0J2G1mwnW9B8uPWSM5EYPoWJyBOWcKBL +SSUqOt9D/9215ZGfbchkdRZjx0dTAD3FIhgG8nA72/uCFrBzyTk= +</dsig:X509Certificate> + </dsig:X509Data> + </dsig:KeyInfo> + <dsig:Object Id="etsi-data-object-0-1216050695-35956125-20638"> + <etsi:QualifyingProperties Target="#signature-1216050695-35956125-21395" xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#"> + <etsi:SignedProperties> + <etsi:SignedSignatureProperties> + <etsi:SigningTime>2008-07-14T15:51:35Z</etsi:SigningTime> + <etsi:SigningCertificate> + <etsi:Cert> + <etsi:CertDigest> + <etsi:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> + <etsi:DigestValue>inMYWBmAxMHP7mDENjLFaEtv0Zk=</etsi:DigestValue> + </etsi:CertDigest> + <etsi:IssuerSerial> + <dsig:X509IssuerName>CN=a-sign-Premium-Sig-02,OU=a-sign-Premium-Sig-02,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT</dsig:X509IssuerName> + <dsig:X509SerialNumber>132292</dsig:X509SerialNumber> + </etsi:IssuerSerial> + </etsi:Cert> + </etsi:SigningCertificate> + <etsi:SignaturePolicyIdentifier> + <etsi:SignaturePolicyImplied/> + </etsi:SignaturePolicyIdentifier> + </etsi:SignedSignatureProperties> + <etsi:SignedDataObjectProperties> + <etsi:DataObjectFormat ObjectReference="#signed-data-reference-0-1216050695-35956125-19584"> + <etsi:MimeType>application/xhtml+xml</etsi:MimeType> + </etsi:DataObjectFormat> + </etsi:SignedDataObjectProperties> + </etsi:SignedProperties> + </etsi:QualifyingProperties> + </dsig:Object> +</dsig:Signature>
\ No newline at end of file diff --git a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_MultipleStartEvents.xml b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_MultipleStartEvents.xml new file mode 100644 index 00000000..2f492efa --- /dev/null +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_MultipleStartEvents.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:ProcessDefinition + id="SampleProcess2" + xmlns:tns="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://reference.e-government.gv.at/namespace/moa/process/definition/v1 ../../main/resources/at/gv/egovernment/moa/id/process/ProcessDefinition.xsd "> + + <tns:StartEvent id="start1" /> + + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" class="HalloWeltTask" /> + <tns:Task id="task3" /> + + <tns:StartEvent id="start2" /> + <tns:EndEvent id="end" /> + + <tns:Transition id="fromStart" from="start1" to="task1" conditionExpression="true" /> + <tns:Transition from="task1" to="task2" /> + <tns:Transition from="task2" to="task3" /> + <tns:Transition from="task3" to="end" /> + +</tns:ProcessDefinition> diff --git a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_NoStartEvents.xml b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_NoStartEvents.xml new file mode 100644 index 00000000..3a5b9527 --- /dev/null +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_NoStartEvents.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:ProcessDefinition + id="SampleProcess1" + xmlns:tns="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://reference.e-government.gv.at/namespace/moa/process/definition/v1 ../../main/resources/at/gv/egovernment/moa/id/process/ProcessDefinition.xsd "> + + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> + + <tns:EndEvent id="end" /> + + <tns:Transition from="task1" to="task2" /> + <tns:Transition from="task2" to="end" /> + +</tns:ProcessDefinition> diff --git a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionLoop.xml b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionLoop.xml new file mode 100644 index 00000000..541f7e2b --- /dev/null +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionLoop.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:ProcessDefinition + id="SampleProcess1" + xmlns:tns="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://reference.e-government.gv.at/namespace/moa/process/definition/v1 ../../main/resources/at/gv/egovernment/moa/id/process/ProcessDefinition.xsd "> + + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> + + <tns:StartEvent id="start" /> + <tns:EndEvent id="end" /> + + <tns:Transition id="fromStart" from="start" to="task1" conditionExpression="true" /> + <tns:Transition from="task1" to="task2" /> + <tns:Transition from="task2" to="end" /> + + <!-- Must be loop since we have no conditionExpression set. --> + <tns:Transition id="loop" from="task1" to="task1" /> + +</tns:ProcessDefinition> diff --git a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionRefsTransition.xml b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionRefsTransition.xml new file mode 100644 index 00000000..4b7a55e4 --- /dev/null +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionRefsTransition.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:ProcessDefinition + id="SampleProcess1" + xmlns:tns="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://reference.e-government.gv.at/namespace/moa/process/definition/v1 ../../main/resources/at/gv/egovernment/moa/id/process/ProcessDefinition.xsd "> + + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> + + <tns:StartEvent id="start" /> + <tns:EndEvent id="end" /> + + <tns:Transition id="fromStart" from="start" to="task1" conditionExpression="true" /> + <tns:Transition from="task1" to="task2" /> + <tns:Transition id="invalidTransition" from="task1" to="fromStart" /> + <tns:Transition from="task2" to="end" /> + +</tns:ProcessDefinition> diff --git a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionStartsFromEndEvent.xml b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionStartsFromEndEvent.xml new file mode 100644 index 00000000..795990a1 --- /dev/null +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionStartsFromEndEvent.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:ProcessDefinition + id="SampleProcess1" + xmlns:tns="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://reference.e-government.gv.at/namespace/moa/process/definition/v1 ../../main/resources/at/gv/egovernment/moa/id/process/ProcessDefinition.xsd "> + + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> + + <tns:StartEvent id="start" /> + <tns:EndEvent id="end" /> + + <tns:Transition id="fromStart" from="start" to="task1" conditionExpression="true" /> + <tns:Transition from="task1" to="task2" /> + <tns:Transition from="task2" to="end" /> + <tns:Transition from="end" to="task1" /> + +</tns:ProcessDefinition> diff --git a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition1.xml b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition1.xml new file mode 100644 index 00000000..67134393 --- /dev/null +++ b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition1.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:ProcessDefinition + id="SampleProcess1" + xmlns:tns="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://reference.e-government.gv.at/namespace/moa/process/definition/v1 ../../main/resources/process/ProcessDefinition.xsd "> + + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> + + <tns:StartEvent id="start" /> + <tns:EndEvent id="end" /> + + <tns:Transition id="fromStart" from="start" to="task1" conditionExpression="true" /> + <tns:Transition from="task1" to="task2" /> + <tns:Transition from="task2" to="end" /> + +</tns:ProcessDefinition> diff --git a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition2.xml b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition2.xml new file mode 100644 index 00000000..51601331 --- /dev/null +++ b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition2.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:ProcessDefinition + id="SampleProcess2" + xmlns:tns="http://reference.e-government.gv.at/namespace/moa/process/definition/v1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://reference.e-government.gv.at/namespace/moa/process/definition/v1 ../../main/resources/process/ProcessDefinition.xsd "> + + <tns:StartEvent id="start" /> + + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" class="HelloWorldTask" /> + <tns:Task id="task3" /> + + <tns:EndEvent id="end" /> + + <tns:Transition id="fromStart" from="start" to="task1" conditionExpression="true" /> + <tns:Transition from="task1" to="task2" /> + <tns:Transition from="task2" to="task3" /> + <tns:Transition from="task3" to="end" /> + +</tns:ProcessDefinition> |