diff options
Diffstat (limited to 'eaaf_core/src/test')
61 files changed, 4618 insertions, 3550 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/AuthenticationDataBuilderTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/AuthenticationDataBuilderTest.java index c4acbaad..072dbb95 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/AuthenticationDataBuilderTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/AuthenticationDataBuilderTest.java @@ -15,93 +15,201 @@ import at.gv.egiz.eaaf.core.api.idp.IAuthData; import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper; import at.gv.egiz.eaaf.core.impl.idp.auth.data.SimpleIdentityLinkAssertionParser; import at.gv.egiz.eaaf.core.impl.idp.module.test.DummyConfiguration; -import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySPConfiguration; +import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/SpringTest-context_eaaf_core.xml") public class AuthenticationDataBuilderTest { - @Autowired private TestAuthenticationDataBuilder authBuilder; - @Autowired private DummyConfiguration authConfig; - - private static final String DUMMY_IDL_2 = "PHNhbWw6QXNzZXJ0aW9uIEFzc2VydGlvbklEPSJlbGdhdGVzdC5lZ2l6Lmd2LmF0LUFzc2VydGlvbklEWFhYxZB6Z8O8cl9YWFhUw7x6ZWvDp2kiIElzc3VlSW5zdGFudD0iMjAxOS0wMy0wNFQxNTo1MzowNCswMTowMCIgSXNzdWVyPSJodHRwOi8vcG9ydGFsLmJtaS5ndi5hdC9yZWYvc3pyL2lzc3VlciIgTWFqb3JWZXJzaW9uPSIxIiBNaW5vclZlcnNpb249IjAiIHhtbG5zOmRzaWc9Imh0dHA6Ly93d3cudzMub3JnLzIwM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b3JtPjwvZHNpZzpUcmFuc2Zvcm1zPjxkc2lnOkRpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNzaGExIi8+PGRzaWc6RGlnZXN0VmFsdWU+QXN4VHprWmRBWUM0U0s1cTh5c0pLVDd5ZHVRPTwvZHNpZzpEaWdlc3RWYWx1ZT48L2RzaWc6UmVmZXJlbmNlPjwvZHNpZzpNYW5pZmVzdD48L2RzaWc6T2JqZWN0PjwvZHNpZzpTaWduYXR1cmU+PC9zYW1sOkFzc2VydGlvbj4="; - - @Test - public void dummyTest() throws Exception { - - - } - - - - @Test - public void buildAuthDataWithIDLOnly_2_without_flag() throws Exception { - buildAuthDataWithIDLOnly_2(null, "XXXŐz'gür", "XXXTüzekçi"); - System.out.println("IDPParser and AuthDataBuilder without escape config --> Successfull"); - - } - - - @Test - public void buildAuthDataWithIDLOnly_2_with_flag_true() throws Exception { - buildAuthDataWithIDLOnly_2(true, "XXXŐz'gür", "XXXTüzekçi"); - System.out.println("IDPParser and AuthDataBuilder with escape config 'true' --> Successfull"); - - } - - @Test - public void buildAuthDataWithIDLOnly_2_with_flag_false() throws Exception { - buildAuthDataWithIDLOnly_2(false, "XXXŐz'gür", "XXXTüzekçi"); - System.out.println("IDPParser and AuthDataBuilder with escape config 'false' --> Successfull"); - - } - - private void buildAuthDataWithIDLOnly_2(Boolean idlEscaptionFlag, String givenName, String familyName) throws Exception { - IAuthData authData = null; - - try { - authConfig.setIsIDLEscapingEnabled(idlEscaptionFlag); - - TestRequestImpl pendingReq = new TestRequestImpl(); - Map<String, String> spConfigMap = new HashMap<String, String>(); - spConfigMap.put("target", "urn:publicid:gv.at:cdid+ZP-MH"); - - DummySPConfiguration spConfig = new DummySPConfiguration(spConfigMap , authConfig); - pendingReq.setSpConfig(spConfig); - - HashMap<String, Object> sessionStore = new HashMap<String, Object>(); - AuthProcessDataWrapper wrapper = new AuthProcessDataWrapper(sessionStore); - wrapper.setIdentityLink(new SimpleIdentityLinkAssertionParser(new ByteArrayInputStream(Base64Utils.decode(DUMMY_IDL_2.getBytes()))).parseIdentityLink()); - pendingReq.setRawDataToTransaction(sessionStore); - - authData = authBuilder.buildAuthenticationData(pendingReq); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - - } - - if (authData == null) - throw new Exception("AuthenticationData is 'null'"); - - if (!authData.getFamilyName().equals(familyName)) - throw new Exception("Familyname wrong"); - - if (!authData.getGivenName().equals(givenName)) - throw new Exception("GivenName wrong"); - - if (!authData.getFormatedDateOfBirth().equals("1973-06-04")) - throw new Exception("DateOfBirth wrong"); - - - if (!authData.getIdentificationValue().equals("RUxHQVRlc3RQQjBYWFjFkHpnw7xyX1hYWFTDvHpla8OnaQ==")) - throw new Exception("baseId wrong"); - - if (!authData.getIdentificationType().equals("urn:publicid:gv.at:baseid")) - throw new Exception("baseIdType wrong"); - - } - + @Autowired + private TestAuthenticationDataBuilder authBuilder; + @Autowired + private DummyConfiguration authConfig; + + public static final String DUMMY_IDL_2 = + "PHNhbWw6QXNzZXJ0aW9uIEFzc2VydGlvbklEPSJlbGdhdGVzdC5lZ2l6Lmd2LmF0LUFzc2VydGlvbklEWFhYxZB6Z8O8" + + "cl9YWFhUw7x6ZWvDp2kiIElzc3VlSW5zdGFudD0iMjAxOS0wMy0wNFQxNTo1MzowNCswMTowMCIgSXNzdWVyPSJodH" + + "RwOi8vcG9ydGFsLmJtaS5ndi5hdC9yZWYvc3pyL2lzc3VlciIgTWFqb3JWZXJzaW9uPSIxIiBNaW5vclZlcnNpb249" + + "IjAiIHhtbG5zOmRzaWc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyMiIHhtbG5zOmVjZHNhPSJodH" + + "RwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSMiIHhtbG5zOnByPSJodHRwOi8vcmVmZXJlbmNlLmUt" + + "Z292ZXJubWVudC5ndi5hdC9uYW1lc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JodHRwOi8vd3d3LnczLm9yZy9UUi8xOTk5" + + "L1JFQy14cGF0aC0xOTk5MTExNiI+PGRzaWc6WFBhdGggeG1sbnM6ZHNpZz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC" + + "8wOS94bWxkc2lnIyI+bm90KGFuY2VzdG9yLW9yLXNlbGY6OmRzaWc6U2lnbmF0dXJlKTwvZHNpZzpYUGF0aD48L2Rz" + + "aWc6VHJhbnNmb3JtPjwvZHNpZzpUcmFuc2Zvcm1zPjxkc2lnOkRpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly" + + "93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNzaGExIi8+PGRzaWc6RGlnZXN0VmFsdWU+QXN4VHprWmRBWUM0U0s1" + + "cTh5c0pLVDd5ZHVRPTwvZHNpZzpEaWdlc3RWYWx1ZT48L2RzaWc6UmVmZXJlbmNlPjwvZHNpZzpNYW5pZmVzdD48L2" + + "RzaWc6T2JqZWN0PjwvZHNpZzpTaWduYXR1cmU+PC9zYW1sOkFzc2VydGlvbj4="; + + @Test + public void dummyTest() throws Exception { + + } + + @Test + public void buildAuthDataWithIdlOnly_2_without_flag() throws Exception { + buildAuthDataWithIdlOnly_2(null, "XXXŐz'gür", "XXXTüzekçi"); + System.out.println("IDPParser and AuthDataBuilder without escape config --> Successfull"); + + } + + @Test + public void buildAuthDataWithIdlOnly_2_with_flag_true() throws Exception { + buildAuthDataWithIdlOnly_2(true, "XXXŐz'gür", "XXXTüzekçi"); + System.out.println("IDPParser and AuthDataBuilder with escape config 'true' --> Successfull"); + + } + + @Test + public void buildAuthDataWithIdlOnly_2_with_flag_false() throws Exception { + buildAuthDataWithIdlOnly_2(false, "XXXŐz'gür", "XXXTüzekçi"); + System.out.println("IDPParser and AuthDataBuilder with escape config 'false' --> Successfull"); + + } + + private void buildAuthDataWithIdlOnly_2(final Boolean idlEscaptionFlag, final String givenName, + final String familyName) throws Exception { + IAuthData authData = null; + + try { + authConfig.setIsIdlEscapingEnabled(idlEscaptionFlag); + + final TestRequestImpl pendingReq = new TestRequestImpl(); + final Map<String, String> spConfigMap = new HashMap<>(); + spConfigMap.put("target", "urn:publicid:gv.at:cdid+ZP-MH"); + + final DummySpConfiguration spConfig = new DummySpConfiguration(spConfigMap, authConfig); + pendingReq.setSpConfig(spConfig); + + final HashMap<String, Object> sessionStore = new HashMap<>(); + final AuthProcessDataWrapper wrapper = new AuthProcessDataWrapper(sessionStore); + wrapper.setIdentityLink(new SimpleIdentityLinkAssertionParser( + new ByteArrayInputStream(Base64Utils.decode(DUMMY_IDL_2.getBytes()))) + .parseIdentityLink()); + pendingReq.setRawDataToTransaction(sessionStore); + + authData = authBuilder.buildAuthenticationData(pendingReq); + + } catch (final Exception e) { + e.printStackTrace(); + throw e; + + } + + if (authData == null) { + throw new Exception("AuthenticationData is 'null'"); + } + + if (!authData.getFamilyName().equals(familyName)) { + throw new Exception("Familyname wrong"); + } + + if (!authData.getGivenName().equals(givenName)) { + throw new Exception("GivenName wrong"); + } + + if (!authData.getFormatedDateOfBirth().equals("1973-06-04")) { + throw new Exception("DateOfBirth wrong"); + } + + if (!authData.getIdentificationValue() + .equals("RUxHQVRlc3RQQjBYWFjFkHpnw7xyX1hYWFTDvHpla8OnaQ==")) { + throw new Exception("baseId wrong"); + } + + if (!authData.getIdentificationType().equals("urn:publicid:gv.at:baseid")) { + throw new Exception("baseIdType wrong"); + } + + } + } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java index 368a1915..6d2ca67e 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java @@ -5,22 +5,23 @@ import javax.servlet.http.HttpServletResponse; 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.slo.ISLOInformationContainer; -import at.gv.egiz.eaaf.core.exceptions.EAAFException; +import at.gv.egiz.eaaf.core.api.idp.slo.ISloInformationContainer; +import at.gv.egiz.eaaf.core.exceptions.EaafException; import at.gv.egiz.eaaf.core.impl.idp.controller.protocols.RequestImpl; public class DummyAuthManager extends AbstractAuthenticationManager { - @Override - public ISLOInformationContainer performSingleLogOut(HttpServletRequest httpReq, HttpServletResponse httpResp, - IRequest pendingReq, String internalSSOId) throws EAAFException { - return null; - } + @Override + public ISloInformationContainer performSingleLogOut(final HttpServletRequest httpReq, + final HttpServletResponse httpResp, final IRequest pendingReq, final String internalSsoId) + throws EaafException { + return null; + } - @Override - protected void populateExecutionContext(ExecutionContext executionContext, RequestImpl pendingReq, - HttpServletRequest httpReq) throws EAAFException { + @Override + protected void populateExecutionContext(final ExecutionContext executionContext, + final RequestImpl pendingReq, final HttpServletRequest httpReq) throws EaafException { - } + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyHttpClientFactory.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyHttpClientFactory.java index 752932ce..9a924f83 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyHttpClientFactory.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyHttpClientFactory.java @@ -6,16 +6,16 @@ import at.gv.egiz.eaaf.core.impl.utils.IHttpClientFactory; public class DummyHttpClientFactory implements IHttpClientFactory { - @Override - public CloseableHttpClient getHttpClient() { - // TODO Auto-generated method stub - return null; - } + @Override + public CloseableHttpClient getHttpClient() { + // TODO Auto-generated method stub + return null; + } - @Override - public CloseableHttpClient getHttpClient(boolean followRedirects) { - // TODO Auto-generated method stub - return null; - } + @Override + public CloseableHttpClient getHttpClient(final boolean followRedirects) { + // TODO Auto-generated method stub + return null; + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreMessageSourceTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreMessageSourceTest.java new file mode 100644 index 00000000..a354b873 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreMessageSourceTest.java @@ -0,0 +1,41 @@ +package at.gv.egiz.eaaf.core.impl.idp.auth; + +import java.util.List; + +import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration({ "/eaaf_core.beans.xml", + "/SpringTest-context_eaaf_core.xml", + "/SpringTest-context_authManager.xml"}) +public class EaafCoreMessageSourceTest { + + @Autowired + private ResourceLoader loader; + @Autowired(required = false) + private List<IMessageSourceLocation> messageSources; + + @Test + public void checkMessageSources() { + Assert.assertNotNull("No messageSource", messageSources); + + for (final IMessageSourceLocation messageSource : messageSources) { + Assert.assertNotNull("No sourcePath", messageSource.getMessageSourceLocation()); + + for (final String el : messageSource.getMessageSourceLocation()) { + final Resource messages = loader.getResource(el + ".properties"); + Assert.assertTrue("Source not exist", messages.exists()); + + } + } + } +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreSpringResourceProviderTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreSpringResourceProviderTest.java new file mode 100644 index 00000000..cbe8d815 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreSpringResourceProviderTest.java @@ -0,0 +1,56 @@ +package at.gv.egiz.eaaf.core.impl.idp.auth; + +import java.io.IOException; +import java.io.InputStream; + +import org.apache.commons.io.IOUtils; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.BlockJUnit4ClassRunner; +import org.springframework.core.io.Resource; + +import at.gv.egiz.eaaf.core.impl.idp.EaafCoreSpringResourceProvider; +import at.gv.egiz.eaaf.core.test.TestConstants; + + + +@RunWith(BlockJUnit4ClassRunner.class) +public class EaafCoreSpringResourceProviderTest { + + @Test + public void testSpringConfig() { + final EaafCoreSpringResourceProvider test = + new EaafCoreSpringResourceProvider(); + for (final Resource el : test.getResourcesToLoad()) { + try { + IOUtils.toByteArray(el.getInputStream()); + + } catch (final IOException e) { + Assert.fail("Ressouce: " + el.getFilename() + " not found"); + } + + } + + Assert.assertNotNull("no Name", test.getName()); + Assert.assertNull("Find package definitions", test.getPackagesToScan()); + + } + + @Test + public void testSpILoaderConfig() { + final InputStream el = this.getClass().getResourceAsStream(TestConstants.TEST_SPI_LOADER_PATH); + try { + final String spiFile = IOUtils.toString(el, "UTF-8"); + + Assert.assertEquals("Wrong classpath in SPI file", + EaafCoreSpringResourceProvider.class.getName(), spiFile); + + + } catch (final IOException e) { + Assert.fail("Ressouce: " + TestConstants.TEST_SPI_LOADER_PATH + " not found"); + + } + } + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/IdentityLinkTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/IdentityLinkTest.java new file mode 100644 index 00000000..16c2079a --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/IdentityLinkTest.java @@ -0,0 +1,103 @@ +package at.gv.egiz.eaaf.core.impl.idp.auth; + +import java.io.ByteArrayInputStream; +import java.io.UnsupportedEncodingException; +import java.math.BigInteger; +import java.security.PublicKey; +import java.security.interfaces.RSAPublicKey; + +import org.apache.commons.lang3.RandomStringUtils; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.BlockJUnit4ClassRunner; +import org.springframework.util.Base64Utils; + +import at.gv.egiz.eaaf.core.exceptions.EaafParserException; +import at.gv.egiz.eaaf.core.impl.idp.auth.data.IdentityLink; +import at.gv.egiz.eaaf.core.impl.idp.auth.data.SimpleIdentityLinkAssertionParser; + +@RunWith(BlockJUnit4ClassRunner.class) +public class IdentityLinkTest { + + private IdentityLink idl = null; + + /** + * jUnit test set-up. + * + * @throws EaafParserException In case of an error + * @throws UnsupportedEncodingException In case of an unsupported encoding + */ + @Before + public void testInit() throws EaafParserException, UnsupportedEncodingException { + idl = (IdentityLink) new SimpleIdentityLinkAssertionParser( + new ByteArrayInputStream(Base64Utils.decode(AuthenticationDataBuilderTest.DUMMY_IDL_2.getBytes( + "UTF-8")))).parseIdentityLink(); + + } + + @Test + public void checkElement() { + Assert.assertNotNull("DateOfBirth", idl.getDateOfBirth()); + Assert.assertNotNull("FamilyName", idl.getFamilyName()); + Assert.assertNotNull("GivenNamae", idl.getGivenName()); + Assert.assertNotNull("baseIdType", idl.getIdentificationType()); + Assert.assertNotNull("baseid", idl.getIdentificationValue()); + Assert.assertNotNull("IssuerInstant", idl.getIssueInstant()); + Assert.assertNotNull("name", idl.getName()); + Assert.assertNotNull("prPerson", idl.getPrPerson()); + Assert.assertNotNull("Assertion element", idl.getSamlAssertion()); + Assert.assertNotNull("Assertion serialized", idl.getSerializedSamlAssertion()); + Assert.assertNotNull("Transform ref", idl.getDsigReferenceTransforms()); + Assert.assertEquals("Transform Size not match", 1, idl.getDsigReferenceTransforms().length); + + } + + @Test + public void checkPubKeys() { + final PublicKey[] publicKey = new RSAPublicKey[2]; + publicKey[0] = generatePubKey(); + publicKey[1] = generatePubKey(); + + idl.setPublicKey(publicKey); + + Assert.assertNotNull("PubKey", idl.getPublicKey()); + Assert.assertEquals("PubKeys not match", publicKey.length, idl.getPublicKey().length); + + } + + private PublicKey generatePubKey() { + return new RSAPublicKey() { + private static final long serialVersionUID = 1L; + + @Override + public BigInteger getModulus() { + return new BigInteger(RandomStringUtils.randomNumeric(10)); + } + + @Override + public String getFormat() { + // TODO Auto-generated method stub + return null; + } + + @Override + public byte[] getEncoded() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAlgorithm() { + // TODO Auto-generated method stub + return null; + } + + @Override + public BigInteger getPublicExponent() { + return new BigInteger(RandomStringUtils.randomNumeric(2)); + } + }; + } +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/TestAuthenticationDataBuilder.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/TestAuthenticationDataBuilder.java index c5610bc9..229076a6 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/TestAuthenticationDataBuilder.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/TestAuthenticationDataBuilder.java @@ -2,11 +2,11 @@ package at.gv.egiz.eaaf.core.impl.idp.auth; import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.idp.IAuthData; -import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration; +import at.gv.egiz.eaaf.core.api.idp.ISpConfiguration; import at.gv.egiz.eaaf.core.api.idp.auth.data.IAuthProcessDataContainer; -import at.gv.egiz.eaaf.core.exceptions.EAAFAuthenticationException; -import at.gv.egiz.eaaf.core.exceptions.EAAFBuilderException; -import at.gv.egiz.eaaf.core.exceptions.EAAFException; +import at.gv.egiz.eaaf.core.exceptions.EaafAuthenticationException; +import at.gv.egiz.eaaf.core.exceptions.EaafBuilderException; +import at.gv.egiz.eaaf.core.exceptions.EaafException; import at.gv.egiz.eaaf.core.impl.data.Pair; import at.gv.egiz.eaaf.core.impl.idp.AuthenticationData; import at.gv.egiz.eaaf.core.impl.idp.auth.builder.AbstractAuthenticationDataBuilder; @@ -14,46 +14,47 @@ import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper; public class TestAuthenticationDataBuilder extends AbstractAuthenticationDataBuilder { - @Override - protected IAuthData getAuthDataInstance(IRequest pendingReq) throws EAAFException { - throw new EAAFException("Not supported yet"); - } - - @Override - protected void buildServiceSpecificAuthenticationData(IAuthData authData, IRequest pendingReq) - throws EAAFException { - throw new EAAFException("Not supported yet"); - - } - - @Override - @Deprecated - protected IAuthData buildDeprecatedAuthData(IRequest pendingReq) throws EAAFException { - final AuthenticationData authData = new AuthenticationData(); - try { - generateDeprecatedBasicAuthData(authData, pendingReq, pendingReq.getSessionData(AuthProcessDataWrapper.class)); - - } catch (final Exception e) { - e.printStackTrace(); - throw new EAAFAuthenticationException("AuthDataGeneration FAILED", null, e); - - } - return authData; - } - - @Override - protected Pair<String, String> getEncryptedbPKFromPVPAttribute(IAuthProcessDataContainer authProcessDataContainer, - AuthenticationData authData, ISPConfiguration spConfig) throws EAAFBuilderException { - // TODO Auto-generated method stub - return null; - } - - @Override - protected Pair<String, String> getbaseIDFromSZR(AuthenticationData authData, String notValidbPK, - String notValidbPKType) { - // TODO Auto-generated method stub - return null; - } + @Override + protected IAuthData getAuthDataInstance(final IRequest pendingReq) throws EaafException { + throw new EaafException("Not supported yet"); + } + @Override + protected void buildServiceSpecificAuthenticationData(final IAuthData authData, + final IRequest pendingReq) throws EaafException { + throw new EaafException("Not supported yet"); + + } + + @Override + @Deprecated + protected IAuthData buildDeprecatedAuthData(final IRequest pendingReq) throws EaafException { + final AuthenticationData authData = new AuthenticationData(); + try { + generateDeprecatedBasicAuthData(authData, pendingReq, + pendingReq.getSessionData(AuthProcessDataWrapper.class)); + + } catch (final Exception e) { + e.printStackTrace(); + throw new EaafAuthenticationException("AuthDataGeneration FAILED", null, e); + + } + return authData; + } + + @Override + protected Pair<String, String> getEncryptedBpkFromPvpAttribute( + final IAuthProcessDataContainer authProcessDataContainer, final AuthenticationData authData, + final ISpConfiguration spConfig) throws EaafBuilderException { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Pair<String, String> getbaseIdFromSzr(final AuthenticationData authData, + final String notValidBpk, final String notValidBpkType) { + // TODO Auto-generated method stub + return null; + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/AbstractAttributeBuilderTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/AbstractAttributeBuilderTest.java index 68cc16ed..96e870ee 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/AbstractAttributeBuilderTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/AbstractAttributeBuilderTest.java @@ -10,60 +10,165 @@ import org.springframework.util.Base64Utils; import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator; import at.gv.egiz.eaaf.core.api.idp.IAuthData; -import at.gv.egiz.eaaf.core.exceptions.EAAFParserException; -import at.gv.egiz.eaaf.core.exceptions.EAAFStorageException; +import at.gv.egiz.eaaf.core.exceptions.EaafParserException; +import at.gv.egiz.eaaf.core.exceptions.EaafStorageException; import at.gv.egiz.eaaf.core.impl.idp.auth.TestAuthenticationDataBuilder; import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper; import at.gv.egiz.eaaf.core.impl.idp.auth.data.SimpleIdentityLinkAssertionParser; import at.gv.egiz.eaaf.core.impl.idp.builder.SimpleStringAttributeGenerator; import at.gv.egiz.eaaf.core.impl.idp.module.test.DummyConfiguration; -import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySPConfiguration; +import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; public abstract class AbstractAttributeBuilderTest { + @Autowired + private TestAuthenticationDataBuilder authBuilder; + private static final String DUMMY_IDL_2 = + "PHNhbWw6QXNzZXJ0aW9uIEFzc2VydGlvbklEPSJlbGdhdGVzdC5lZ2l6Lmd2LmF0LUFzc2VydGlvbklEWFhYxZB6Z8O8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U0KMUI3M3pzNytwQThZZ0txRXhESFhjMVNob3U1SHZTdVRYU21hVE1V" + + "SHJDa2hvdEhmcHFZaHJKaUFtSitPZnROdgo2b3hNUGZOaFpnMDFlT290bTFKK1dWMm1KYmdjUFROU0MxT05jU0ZkUT" + + "V2WlpMTDI0SjJIY3c9PTwvZHNpZzpYNTA5Q2VydGlmaWNhdGU+PC9kc2lnOlg1MDlEYXRhPjwvZHNpZzpLZXlJbmZv" + + "Pjxkc2lnOk9iamVjdD48ZHNpZzpNYW5pZmVzdCBJZD0ibWFuaWZlc3QiPjxkc2lnOlJlZmVyZW5jZSBVUkk9IiI+PG" + + "RzaWc6VHJhbnNmb3Jtcz48ZHNpZzpUcmFuc2Zvcm0gQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy9UUi8xOTk5" + + "L1JFQy14cGF0aC0xOTk5MTExNiI+PGRzaWc6WFBhdGggeG1sbnM6ZHNpZz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC" + + "8wOS94bWxkc2lnIyI+bm90KGFuY2VzdG9yLW9yLXNlbGY6OmRzaWc6U2lnbmF0dXJlKTwvZHNpZzpYUGF0aD48L2Rz" + + "aWc6VHJhbnNmb3JtPjwvZHNpZzpUcmFuc2Zvcm1zPjxkc2lnOkRpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly" + + "93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNzaGExIi8+PGRzaWc6RGlnZXN0VmFsdWU+QXN4VHprWmRBWUM0U0s1" + + "cTh5c0pLVDd5ZHVRPTwvZHNpZzpEaWdlc3RWYWx1ZT48L2RzaWc6UmVmZXJlbmNlPjwvZHNpZzpNYW5pZmVzdD48L2" + + "RzaWc6T2JqZWN0PjwvZHNpZzpTaWduYXR1cmU+PC9zYW1sOkFzc2VydGlvbj4="; + + protected IAttributeGenerator<String> gen = new SimpleStringAttributeGenerator(); + protected static DummySpConfiguration spConfig = null; + + private static final Map<String, String> spConfigMap = new HashMap<>(); + private static final TestRequestImpl pendingReq = new TestRequestImpl(); + + /** + * jUnit class initializer. + * + * @throws EaafParserException In case of an error + * @throws EaafStorageException In case of an error + */ + @BeforeClass + public static void intialize() throws EaafParserException, EaafStorageException { + spConfigMap.put("target", "urn:publicid:gv.at:cdid+ZP-MH"); + + spConfig = new DummySpConfiguration(spConfigMap, new DummyConfiguration()); + pendingReq.setSpConfig(spConfig); + + final HashMap<String, Object> sessionStore = new HashMap<>(); + final AuthProcessDataWrapper wrapper = new AuthProcessDataWrapper(sessionStore); + wrapper.setIdentityLink(new SimpleIdentityLinkAssertionParser( + new ByteArrayInputStream(Base64Utils.decode(DUMMY_IDL_2.getBytes()))).parseIdentityLink()); + pendingReq.setRawDataToTransaction(sessionStore); + + } + + protected void putIntoSpConfigMap(final String key, final String value) { + spConfigMap.put(key, value); + + } + + protected IAuthData buildAuthData() throws Exception { + try { + return authBuilder.buildAuthenticationData(pendingReq); + + } catch (final Exception e) { + e.printStackTrace(); + throw e; + + } + + } - @Autowired private TestAuthenticationDataBuilder authBuilder; - private static final String DUMMY_IDL_2 = "PHNhbWw6QXNzZXJ0aW9uIEFzc2VydGlvbklEPSJlbGdhdGVzdC5lZ2l6Lmd2LmF0LUFzc2VydGlvbklEWFhYxZB6Z8O8cl9YWFhUw7x6ZWvDp2kiIElzc3VlSW5zdGFudD0iMjAxOS0wMy0wNFQxNTo1MzowNCswMTowMCIgSXNzdWVyPSJodHRwOi8vcG9ydGFsLmJtaS5ndi5hdC9yZWYvc3pyL2lzc3VlciIgTWFqb3JWZXJzaW9uPSIxIiBNaW5vclZlcnNpb249IjAiIHhtbG5zOmRzaWc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyMiIHhtbG5zOmVjZHNhPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSMiIHhtbG5zOnByPSJodHRwOi8vcmVmZXJlbmNlLmUtZ292ZXJubWVudC5ndi5hdC9uYW1lc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WmRBWUM0U0s1cTh5c0pLVDd5ZHVRPTwvZHNpZzpEaWdlc3RWYWx1ZT48L2RzaWc6UmVmZXJlbmNlPjwvZHNpZzpNYW5pZmVzdD48L2RzaWc6T2JqZWN0PjwvZHNpZzpTaWduYXR1cmU+PC9zYW1sOkFzc2VydGlvbj4="; - - protected IAttributeGenerator<String> g = new SimpleStringAttributeGenerator(); - protected static DummySPConfiguration spConfig = null; - - private final static Map<String, String> spConfigMap = new HashMap<String, String>(); - private final static TestRequestImpl pendingReq = new TestRequestImpl(); - - - - @BeforeClass - public static void intialize() throws EAAFParserException, EAAFStorageException { - spConfigMap.put("target", "urn:publicid:gv.at:cdid+ZP-MH"); - - spConfig = new DummySPConfiguration(spConfigMap, new DummyConfiguration()); - pendingReq.setSpConfig(spConfig); - - final HashMap<String, Object> sessionStore = new HashMap<String, Object>(); - final AuthProcessDataWrapper wrapper = new AuthProcessDataWrapper(sessionStore); - wrapper.setIdentityLink(new SimpleIdentityLinkAssertionParser(new ByteArrayInputStream(Base64Utils.decode(DUMMY_IDL_2.getBytes()))).parseIdentityLink()); - pendingReq.setRawDataToTransaction(sessionStore); - - - } - - protected void putIntoSPConfigMap(String key, String value) { - spConfigMap.put(key, value); - - } - - protected IAuthData buildAuthData() throws Exception { - try { - return authBuilder.buildAuthenticationData(pendingReq); - - } catch (final Exception e) { - e.printStackTrace(); - throw e; - - } - - } - } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/BirthdayAttrBuilderTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/BirthdayAttrBuilderTest.java index 5f1913a3..21cf71a9 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/BirthdayAttrBuilderTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/BirthdayAttrBuilderTest.java @@ -9,31 +9,33 @@ import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import at.gv.egiz.eaaf.core.api.data.PVPAttributeDefinitions; +import at.gv.egiz.eaaf.core.api.data.PvpAttributeDefinitions; import at.gv.egiz.eaaf.core.api.idp.IAttributeBuilder; import at.gv.egiz.eaaf.core.api.idp.IAuthData; import at.gv.egiz.eaaf.core.impl.idp.builder.attributes.BirthdateAttributeBuilder; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/SpringTest-context_eaaf_core.xml") -public class BirthdayAttrBuilderTest extends AbstractAttributeBuilderTest{ - - private final IAttributeBuilder attrBuilde = new BirthdateAttributeBuilder(); - - @Test - public void performTest_ok() { - try { - final IAuthData authData = buildAuthData(); - final String value = attrBuilde.build(spConfig, authData, g); - - final DateFormat format = new SimpleDateFormat(PVPAttributeDefinitions.BIRTHDATE_FORMAT_PATTERN); - Assert.assertEquals("Birthday does NOT match", authData.getDateOfBirth(), format.parse(value)); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder has an exception", e == null); - - } - - } +public class BirthdayAttrBuilderTest extends AbstractAttributeBuilderTest { + + private final IAttributeBuilder attrBuilde = new BirthdateAttributeBuilder(); + + @Test + public void performTest_ok() { + try { + final IAuthData authData = buildAuthData(); + final String value = attrBuilde.build(spConfig, authData, gen); + + final DateFormat format = + new SimpleDateFormat(PvpAttributeDefinitions.BIRTHDATE_FORMAT_PATTERN); + Assert.assertEquals("Birthday does NOT match", authData.getDateOfBirth(), + format.parse(value)); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder has an exception", e == null); + + } + + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/FamilyNameAttrBuilderTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/FamilyNameAttrBuilderTest.java index 51a6a2c2..f9abb0d3 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/FamilyNameAttrBuilderTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/FamilyNameAttrBuilderTest.java @@ -7,7 +7,7 @@ import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import at.gv.egiz.eaaf.core.api.data.PVPAttributeDefinitions; +import at.gv.egiz.eaaf.core.api.data.PvpAttributeDefinitions; import at.gv.egiz.eaaf.core.api.idp.IAttributeBuilder; import at.gv.egiz.eaaf.core.api.idp.IAuthData; import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException; @@ -16,57 +16,61 @@ import at.gv.egiz.eaaf.core.impl.idp.builder.attributes.PrincipalNameAttributeBu @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/SpringTest-context_eaaf_core.xml") -public class FamilyNameAttrBuilderTest extends AbstractAttributeBuilderTest{ - - private final IAttributeBuilder attrBuilde = new PrincipalNameAttributeBuilder(); - - @Test - public void performTest_ok() { - try { - final IAuthData authData = buildAuthData(); - final String value = attrBuilde.build(spConfig, authData, g); - Assert.assertEquals("FamilyName does NOT match", authData.getFamilyName(), value); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder has an exception", e == null); - - } - - } - - @Test - public void performTest_null() { - try { - final AuthenticationData authData = (AuthenticationData) buildAuthData(); - authData.setFamilyName(null); - - attrBuilde.build(spConfig, authData, g); - Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder provide wrong exception", e instanceof UnavailableAttributeException); - Assert.assertEquals("Attr. name in exception does NOT match", - PVPAttributeDefinitions.PRINCIPAL_NAME_NAME, ((UnavailableAttributeException) e).getAttributeName()); - - } - - } - - @Test - public void performTest_emtpty() { - try { - final AuthenticationData authData = (AuthenticationData) buildAuthData(); - authData.setFamilyName(StringUtils.EMPTY); - - attrBuilde.build(spConfig, authData, g); - Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder provide wrong exception", e instanceof UnavailableAttributeException); - Assert.assertEquals("Attr. name in exception does NOT match", - PVPAttributeDefinitions.PRINCIPAL_NAME_NAME, ((UnavailableAttributeException) e).getAttributeName()); - - } - - } +public class FamilyNameAttrBuilderTest extends AbstractAttributeBuilderTest { + + private final IAttributeBuilder attrBuilde = new PrincipalNameAttributeBuilder(); + + @Test + public void performTest_ok() { + try { + final IAuthData authData = buildAuthData(); + final String value = attrBuilde.build(spConfig, authData, gen); + Assert.assertEquals("FamilyName does NOT match", authData.getFamilyName(), value); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder has an exception", e == null); + + } + + } + + @Test + public void performTest_null() { + try { + final AuthenticationData authData = (AuthenticationData) buildAuthData(); + authData.setFamilyName(null); + + attrBuilde.build(spConfig, authData, gen); + Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder provide wrong exception", + e instanceof UnavailableAttributeException); + Assert.assertEquals("Attr. name in exception does NOT match", + PvpAttributeDefinitions.PRINCIPAL_NAME_NAME, + ((UnavailableAttributeException) e).getAttributeName()); + + } + + } + + @Test + public void performTest_emtpty() { + try { + final AuthenticationData authData = (AuthenticationData) buildAuthData(); + authData.setFamilyName(StringUtils.EMPTY); + + attrBuilde.build(spConfig, authData, gen); + Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder provide wrong exception", + e instanceof UnavailableAttributeException); + Assert.assertEquals("Attr. name in exception does NOT match", + PvpAttributeDefinitions.PRINCIPAL_NAME_NAME, + ((UnavailableAttributeException) e).getAttributeName()); + + } + + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java index dd1dfa5e..eb48ce21 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java @@ -7,7 +7,7 @@ import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import at.gv.egiz.eaaf.core.api.data.PVPAttributeDefinitions; +import at.gv.egiz.eaaf.core.api.data.PvpAttributeDefinitions; import at.gv.egiz.eaaf.core.api.idp.IAttributeBuilder; import at.gv.egiz.eaaf.core.api.idp.IAuthData; import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException; @@ -16,57 +16,61 @@ import at.gv.egiz.eaaf.core.impl.idp.builder.attributes.GivenNameAttributeBuilde @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/SpringTest-context_eaaf_core.xml") -public class GivenNameAttrBuilderTest extends AbstractAttributeBuilderTest{ - - private final IAttributeBuilder attrBuilde = new GivenNameAttributeBuilder(); - - @Test - public void performTest_ok() { - try { - final IAuthData authData = buildAuthData(); - final String value = attrBuilde.build(spConfig, authData, g); - Assert.assertEquals("GivenName does NOT match", authData.getGivenName(), value); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder has an exception", e == null); - - } - - } - - @Test - public void performTest_null() { - try { - final AuthenticationData authData = (AuthenticationData) buildAuthData(); - authData.setGivenName(null); - - attrBuilde.build(spConfig, authData, g); - Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder provide wrong exception", e instanceof UnavailableAttributeException); - Assert.assertEquals("Attr. name in exception does NOT match", - PVPAttributeDefinitions.GIVEN_NAME_NAME, ((UnavailableAttributeException) e).getAttributeName()); - - } - - } - - @Test - public void performTest_emtpty() { - try { - final AuthenticationData authData = (AuthenticationData) buildAuthData(); - authData.setGivenName(StringUtils.EMPTY); - - attrBuilde.build(spConfig, authData, g); - Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder provide wrong exception", e instanceof UnavailableAttributeException); - Assert.assertEquals("Attr. name in exception does NOT match", - PVPAttributeDefinitions.GIVEN_NAME_NAME, ((UnavailableAttributeException) e).getAttributeName()); - - } - - } +public class GivenNameAttrBuilderTest extends AbstractAttributeBuilderTest { + + private final IAttributeBuilder attrBuilde = new GivenNameAttributeBuilder(); + + @Test + public void performTest_ok() { + try { + final IAuthData authData = buildAuthData(); + final String value = attrBuilde.build(spConfig, authData, gen); + Assert.assertEquals("GivenName does NOT match", authData.getGivenName(), value); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder has an exception", e == null); + + } + + } + + @Test + public void performTest_null() { + try { + final AuthenticationData authData = (AuthenticationData) buildAuthData(); + authData.setGivenName(null); + + attrBuilde.build(spConfig, authData, gen); + Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder provide wrong exception", + e instanceof UnavailableAttributeException); + Assert.assertEquals("Attr. name in exception does NOT match", + PvpAttributeDefinitions.GIVEN_NAME_NAME, + ((UnavailableAttributeException) e).getAttributeName()); + + } + + } + + @Test + public void performTest_emtpty() { + try { + final AuthenticationData authData = (AuthenticationData) buildAuthData(); + authData.setGivenName(StringUtils.EMPTY); + + attrBuilde.build(spConfig, authData, gen); + Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder provide wrong exception", + e instanceof UnavailableAttributeException); + Assert.assertEquals("Attr. name in exception does NOT match", + PvpAttributeDefinitions.GIVEN_NAME_NAME, + ((UnavailableAttributeException) e).getAttributeName()); + + } + + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java new file mode 100644 index 00000000..be71a29c --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java @@ -0,0 +1,36 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.gui; + +import java.net.MalformedURLException; +import java.net.URI; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.gui.IGuiBuilderConfiguration; +import at.gv.egiz.eaaf.core.api.gui.IGuiBuilderConfigurationFactory; +import at.gv.egiz.eaaf.core.api.gui.IVelocityGuiBuilderConfiguration; + +public class DummyGuiBuilderConfigurationFactory implements IGuiBuilderConfigurationFactory { + + private IGuiBuilderConfiguration errorGuiConfig; + private IVelocityGuiBuilderConfiguration velocityBuilderConfig; + + @Override + public IGuiBuilderConfiguration getDefaultErrorGui(String authUrl) { + return errorGuiConfig; + } + + @Override + public IVelocityGuiBuilderConfiguration getSpSpecificSaml2PostConfiguration(IRequest pendingReq, + String viewName, URI configRootContextDir) throws MalformedURLException { + return velocityBuilderConfig; + } + + public void setErrorGuiConfig(IGuiBuilderConfiguration errorGuiConfig) { + this.errorGuiConfig = errorGuiConfig; + } + + public void setVelocityBuilderConfig(IVelocityGuiBuilderConfiguration velocityBuilderConfig) { + this.velocityBuilderConfig = velocityBuilderConfig; + } + + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java new file mode 100644 index 00000000..e2cdd1ee --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java @@ -0,0 +1,36 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.gui; + +import java.io.InputStream; + +import at.gv.egiz.eaaf.core.api.gui.IVelocityGuiBuilderConfiguration; +import at.gv.egiz.eaaf.core.exceptions.GuiBuildException; +import at.gv.egiz.eaaf.core.impl.gui.AbstractVelocityGuiFormBuilderImpl; + +public class DummyVelocityGuiFormBuilder extends AbstractVelocityGuiFormBuilderImpl { + + private InputStream internalTemplate = null; + + public DummyVelocityGuiFormBuilder() throws GuiBuildException { + super(); + } + + @Override + protected InputStream getInternalTemplate(IVelocityGuiBuilderConfiguration config) + throws GuiBuildException { + return internalTemplate; + + } + + /** + * Set internal template that should be loaded by builder. + * + * @param internalTemplate Tempalte + */ + public void setInternalTemplate(InputStream internalTemplate) { + this.internalTemplate = internalTemplate; + } + + + + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfig.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfig.java new file mode 100644 index 00000000..a6f24c6d --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfig.java @@ -0,0 +1,72 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.test; + +import java.net.URI; +import java.net.URL; + +import org.apache.commons.lang3.StringUtils; + +import at.gv.egiz.eaaf.core.api.idp.ISpConfiguration; +import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; +import at.gv.egiz.eaaf.core.exceptions.EaafException; +import at.gv.egiz.eaaf.core.impl.idp.conf.AbstractSpringBootConfigurationImpl; + + +public class DummyAuthConfig extends AbstractSpringBootConfigurationImpl { + + private ISpConfiguration spconfig = null; + + private String configPropPrefix = StringUtils.EMPTY; + + public void setSpConfig(final ISpConfiguration spConfig) { + this.spconfig = spConfig; + + } + + + + @Override + public URI getConfigurationRootDirectory() { + return new java.io.File(".").toURI(); + } + + @Override + public ISpConfiguration getServiceProviderConfiguration(final String arg0) + throws EaafConfigurationException { + return spconfig; + } + + @SuppressWarnings("unchecked") + @Override + public <T> T getServiceProviderConfiguration(final String arg0, final Class<T> arg1) + throws EaafConfigurationException { + return (T) spconfig; + + } + + @Override + public String validateIdpUrl(final URL arg0) throws EaafException { + return arg0.toString(); + } + + + @Override + protected String getBackupConfigPath() { + return null; + } + + + @Override + public String getApplicationSpecificKeyPrefix() { + return configPropPrefix; + + } + + + + public void setConfigPropPrefix(final String configPropPrefix) { + this.configPropPrefix = configPropPrefix; + } + + + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfigMap.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfigMap.java new file mode 100644 index 00000000..42d07e8e --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfigMap.java @@ -0,0 +1,130 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.test; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP; +import at.gv.egiz.eaaf.core.api.idp.ISpConfiguration; +import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; +import at.gv.egiz.eaaf.core.exceptions.EaafException; +import at.gv.egiz.eaaf.core.impl.utils.KeyValueUtils; +import org.apache.commons.lang3.StringUtils; + +/** + * Dummy Application-configuration implementation for jUnit tests. + * + * @author tlenz + * + */ +public class DummyAuthConfigMap implements IConfigurationWithSP { + + private Map<String, String> config = new HashMap<>(); + + /** + * Dummy Application-configuration. + * + * @param configIs Property based configuration + * @throws IOException In case of an configuration read error + */ + public DummyAuthConfigMap(final InputStream configIs) throws IOException { + + final Properties props = new Properties(); + props.load(configIs); + + config = KeyValueUtils.convertPropertiesToMap(props); + + } + + /** + * Dummy Application-configuration. + * + * @param path Path to property based configuration + * @throws IOException In case of an configuration read error + */ + public DummyAuthConfigMap(final String path) throws IOException { + + final Properties props = new Properties(); + props.load(this.getClass().getResourceAsStream(path)); + + config = KeyValueUtils.convertPropertiesToMap(props); + + } + + + @Override + public String getBasicConfiguration(final String key) { + return config.get(key); + + } + + @Override + public String getBasicConfiguration(final String key, final String defaultValue) { + final String value = getBasicConfiguration(key); + if (StringUtils.isEmpty(value)) { + return defaultValue; + } else { + return value; + } + + } + + @Override + public boolean getBasicConfigurationBoolean(final String key) { + final String value = getBasicConfiguration(key); + if (StringUtils.isEmpty(value)) { + return false; + } else { + return Boolean.valueOf(value); + } + } + + @Override + public boolean getBasicConfigurationBoolean(final String key, final boolean defaultValue) { + return Boolean.parseBoolean(getBasicConfiguration(key, String.valueOf(defaultValue))); + + } + + @Override + public Map<String, String> getBasicConfigurationWithPrefix(final String prefix) { + return KeyValueUtils.getSubSetWithPrefix(config, prefix); + + } + + @Override + public ISpConfiguration getServiceProviderConfiguration(final String uniqueID) + throws EaafConfigurationException { + return null; + } + + @Override + public <T> T getServiceProviderConfiguration(final String spIdentifier, final Class<T> decorator) + throws EaafConfigurationException { + return null; + } + + @Override + public URI getConfigurationRootDirectory() { + return new java.io.File(".").toURI(); + + } + + @Override + public String validateIdpUrl(final URL authReqUrl) throws EaafException { + return null; + } + + public void putConfigValue(final String key, final String value) { + config.put(key, value); + } + + public void removeConfigValue(final String key) { + config.remove(key); + + } + + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyConfiguration.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyConfiguration.java index 816f6871..e295d69a 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyConfiguration.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyConfiguration.java @@ -5,80 +5,80 @@ import java.net.URL; import java.util.Map; import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP; -import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration; -import at.gv.egiz.eaaf.core.exceptions.EAAFConfigurationException; -import at.gv.egiz.eaaf.core.exceptions.EAAFException; +import at.gv.egiz.eaaf.core.api.idp.ISpConfiguration; +import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; +import at.gv.egiz.eaaf.core.exceptions.EaafException; import at.gv.egiz.eaaf.core.impl.idp.auth.builder.AbstractAuthenticationDataBuilder; public class DummyConfiguration implements IConfigurationWithSP { - private Boolean isIDLEscapingEnabled = null; - - @Override - public String getBasicConfiguration(String key) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getBasicConfiguration(String key, String defaultValue) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Map<String, String> getBasicConfigurationWithPrefix(String prefix) { - // TODO Auto-generated method stub - return null; - } - - @Override - public ISPConfiguration getServiceProviderConfiguration(String uniqueID) throws EAAFConfigurationException { - // TODO Auto-generated method stub - return null; - } - - @Override - public <T> T getServiceProviderConfiguration(String spIdentifier, Class<T> decorator) - throws EAAFConfigurationException { - // TODO Auto-generated method stub - return null; - } - - @Override - public URI getConfigurationRootDirectory() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String validateIDPURL(URL authReqUrl) throws EAAFException { - // TODO Auto-generated method stub - return null; - } - - public void setIsIDLEscapingEnabled(Boolean isIDLEscapingEnabled) { - this.isIDLEscapingEnabled = isIDLEscapingEnabled; - } - - @Override - public Boolean getBasicConfigurationBoolean(String key) { - return null; - - } - - @Override - public boolean getBasicConfigurationBoolean(String key, boolean defaultValue) { - if (AbstractAuthenticationDataBuilder.CONFIG_PROP_ENABLE_IDL_ATTRIBUTE_ESCAPEING.equals(key)) { - if (isIDLEscapingEnabled == null) - return defaultValue; - else - return isIDLEscapingEnabled; - - } - - - return false; - - } + private Boolean isIdlEscapingEnabled = null; + + @Override + public String getBasicConfiguration(final String key) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getBasicConfiguration(final String key, final String defaultValue) { + return defaultValue; + } + + @Override + public Map<String, String> getBasicConfigurationWithPrefix(final String prefix) { + // TODO Auto-generated method stub + return null; + } + + @Override + public ISpConfiguration getServiceProviderConfiguration(final String uniqueID) + throws EaafConfigurationException { + // TODO Auto-generated method stub + return null; + } + + @Override + public <T> T getServiceProviderConfiguration(final String spIdentifier, final Class<T> decorator) + throws EaafConfigurationException { + // TODO Auto-generated method stub + return null; + } + + @Override + public URI getConfigurationRootDirectory() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String validateIdpUrl(final URL authReqUrl) throws EaafException { + // TODO Auto-generated method stub + return null; + } + + public void setIsIdlEscapingEnabled(final Boolean isIdlEscapingEnabled) { + this.isIdlEscapingEnabled = isIdlEscapingEnabled; + } + + @Override + public boolean getBasicConfigurationBoolean(final String key) { + return false; + + } + + @Override + public boolean getBasicConfigurationBoolean(final String key, final boolean defaultValue) { + if (AbstractAuthenticationDataBuilder.CONFIG_PROP_ENABLE_IDL_ATTRIBUTE_ESCAPEING.equals(key)) { + if (isIdlEscapingEnabled == null) { + return defaultValue; + } else { + return isIdlEscapingEnabled; + } + + } + + return false; + + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java index 94209dd6..300a390d 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java @@ -7,75 +7,74 @@ import javax.servlet.http.HttpServletResponse; import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.idp.auth.services.IProtocolAuthenticationService; -import at.gv.egiz.eaaf.core.exceptions.EAAFException; +import at.gv.egiz.eaaf.core.exceptions.EaafException; public class DummyProtocolAuthService implements IProtocolAuthenticationService { - - private IRequest pendingReq; - private HttpServletRequest httpReq; - private HttpServletResponse httpResp; - private Throwable exception; - private boolean writeToStatisticLog; - - - @Override - public void performAuthentication(HttpServletRequest req, HttpServletResponse resp, IRequest pendingReq) - throws IOException, EAAFException { - this.pendingReq = pendingReq; - this.httpReq = req; - this.httpResp = resp; - - } - - @Override - public void finalizeAuthentication(HttpServletRequest req, HttpServletResponse resp, IRequest pendingReq) - throws EAAFException, IOException { - this.pendingReq = pendingReq; - this.httpReq = req; - this.httpResp = resp; - - } - - @Override - public void buildProtocolSpecificErrorResponse(Throwable throwable, HttpServletRequest req, - HttpServletResponse resp, IRequest pendingReq) throws IOException, EAAFException { - this.pendingReq = pendingReq; - this.httpReq = req; - this.httpResp = resp; - this.exception = throwable; - - } - - @Override - public void handleErrorNoRedirect(Throwable throwable, HttpServletRequest req, HttpServletResponse resp, - boolean writeExceptionToStatisticLog) throws IOException, EAAFException { - this.httpReq = req; - this.httpResp = resp; - this.exception = throwable; - this.writeToStatisticLog = writeExceptionToStatisticLog; - - } - - public IRequest getPendingReq() { - return pendingReq; - } - - public HttpServletRequest getHttpReq() { - return httpReq; - } - - public HttpServletResponse getHttpResp() { - return httpResp; - } - - public Throwable getException() { - return exception; - } - - public boolean isWriteToStatisticLog() { - return writeToStatisticLog; - } - - + + private IRequest pendingReq; + private HttpServletRequest httpReq; + private HttpServletResponse httpResp; + private Throwable exception; + private boolean writeToStatisticLog; + + @Override + public void performAuthentication(final HttpServletRequest req, final HttpServletResponse resp, + final IRequest pendingReq) throws IOException, EaafException { + this.pendingReq = pendingReq; + this.httpReq = req; + this.httpResp = resp; + + } + + @Override + public void finalizeAuthentication(final HttpServletRequest req, final HttpServletResponse resp, + final IRequest pendingReq) throws EaafException, IOException { + this.pendingReq = pendingReq; + this.httpReq = req; + this.httpResp = resp; + + } + + @Override + public void buildProtocolSpecificErrorResponse(final Throwable throwable, + final HttpServletRequest req, final HttpServletResponse resp, final IRequest pendingReq) + throws IOException, EaafException { + this.pendingReq = pendingReq; + this.httpReq = req; + this.httpResp = resp; + this.exception = throwable; + + } + + @Override + public void handleErrorNoRedirect(final Throwable throwable, final HttpServletRequest req, + final HttpServletResponse resp, final boolean writeExceptionToStatisticLog) + throws IOException, EaafException { + this.httpReq = req; + this.httpResp = resp; + this.exception = throwable; + this.writeToStatisticLog = writeExceptionToStatisticLog; + + } + + public IRequest getPendingReq() { + return pendingReq; + } + + public HttpServletRequest getHttpReq() { + return httpReq; + } + + public HttpServletResponse getHttpResp() { + return httpResp; + } + + public Throwable getException() { + return exception; + } + + public boolean isWriteToStatisticLog() { + return writeToStatisticLog; + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummySPConfiguration.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummySPConfiguration.java deleted file mode 100644 index f51c95ab..00000000 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummySPConfiguration.java +++ /dev/null @@ -1,21 +0,0 @@ -package at.gv.egiz.eaaf.core.impl.idp.module.test; - -import java.util.Map; - -import at.gv.egiz.eaaf.core.api.idp.IConfiguration; -import at.gv.egiz.eaaf.core.impl.idp.conf.SPConfigurationImpl; - -public class DummySPConfiguration extends SPConfigurationImpl { - - public DummySPConfiguration(Map<String, String> spConfig, IConfiguration authConfig) { - super(spConfig, authConfig); - - } - - @Override - public String getAreaSpecificTargetIdentifier() { - return getConfigurationValue("target"); - - } - -} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummySpConfiguration.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummySpConfiguration.java new file mode 100644 index 00000000..87e91609 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummySpConfiguration.java @@ -0,0 +1,23 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.test; + +import java.util.Map; + +import at.gv.egiz.eaaf.core.api.idp.IConfiguration; +import at.gv.egiz.eaaf.core.impl.idp.conf.SpConfigurationImpl; + +public class DummySpConfiguration extends SpConfigurationImpl { + + private static final long serialVersionUID = 3837138426712775909L; + + public DummySpConfiguration(final Map<String, String> spConfig, final IConfiguration authConfig) { + super(spConfig, authConfig); + + } + + @Override + public String getAreaSpecificTargetIdentifier() { + return getConfigurationValue("target"); + + } + +} 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 index 80451399..8f8f8114 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.module.test; import java.io.Serializable; @@ -31,313 +24,368 @@ import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; -import org.apache.commons.lang3.StringUtils; - 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; +import at.gv.egiz.eaaf.core.api.idp.ISpConfiguration; +import at.gv.egiz.eaaf.core.exceptions.EaafStorageException; import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper; +import org.apache.commons.lang3.StringUtils; + /** + * Test pending-request for jUnit tests. + * * @author tlenz * */ public class TestRequestImpl implements IRequest { - private String processInstanceID = null; - private ISPConfiguration spConfig = null; - private final Map<String, Object> storage = new HashMap<String, Object>(); - private String transactionId = null; - private String pendingReqId = null; - private String authURL = null; - private boolean authenticated; - private boolean needAuthentication = false; - - /* (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 getRawData(String key) { - return storage.get(key); - } - - /* (non-Javadoc) - * @see at.gv.egovernment.moa.id.moduls.IRequest#getGenericData(java.lang.String, java.lang.Class) - */ - @Override - public <T> T getRawData(String key, Class<T> clazz) { - return (T)storage.get(key); - } - - - /* (non-Javadoc) - * @see at.gv.egovernment.moa.id.moduls.IRequest#getUniqueTransactionIdentifier() - */ - @Override - public String getUniqueTransactionIdentifier() { - return this.transactionId; - } - - /* (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() { - return this.authURL; - } - - /* (non-Javadoc) - * @see at.gv.egovernment.moa.id.moduls.IRequest#getAuthURLWithOutSlash() - */ - @Override - public String getAuthURLWithOutSlash() { - if (this.authURL != null && this.authURL.endsWith("/")) - return this.authURL.substring(0, this.authURL.length()-1); - else - return this.authURL; - } - - /* (non-Javadoc) - * @see at.gv.egovernment.moa.id.moduls.IRequest#isNeedAuthentication() - */ - @Override - public boolean isNeedAuthentication() { - return this.needAuthentication; - - } - - /* (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() { - return this.authenticated; - } - - /* (non-Javadoc) - * @see at.gv.egovernment.moa.id.moduls.IRequest#setAuthenticated(boolean) - */ - @Override - public void setAuthenticated(boolean isAuthenticated) { - this.authenticated = isAuthenticated; - - } - - /** - * @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 setRawDataToTransaction(Map<String, Object> map) throws EAAFStorageException { - storage.putAll(map); - - } - - @Override - public String getPendingRequestId() { - return this.pendingReqId; - } - - @Override - public String getInternalSSOSessionIdentifier() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void setInternalSSOSessionIdentifier(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() { - return spConfig; - - } - - @Override - public <T> T getServiceProviderConfiguration(Class<T> decorator) { - return (T)spConfig; - } - - @Override - public void setRawDataToTransaction(String key, Object object) throws EAAFStorageException { - if (StringUtils.isEmpty(key)) { - throw new EAAFStorageException("Generic request-data can not be stored with a 'null' key", null); - - } - - if (object != null) { - if (!Serializable.class.isInstance(object)) { - throw new EAAFStorageException("Generic request-data can only store objects which implements the 'Seralizable' interface", null); - - } - } - - storage.put(key, object); - - } - - public void setSpConfig(ISPConfiguration spConfig) { - this.spConfig = spConfig; - } - - @Override - public <T> T getSessionData(Class<T> wrapper) { - if (wrapper != null) { - if (AuthProcessDataWrapper.class.isAssignableFrom(wrapper)) { - try { - return wrapper.getConstructor(Map.class).newInstance(this.storage); - - } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException - | IllegalArgumentException | InvocationTargetException e) { - throw new RuntimeException("Can NOT instance wrapper: " + wrapper.getName(), e); - - } - - } - - throw new RuntimeException("Can NOT wrap generic data into session data. " - + "Reason: Wrapper " + wrapper.getName() + " is NOT a valid wrapper"); - - } - - return null; - } - - public void setTransactionId(String transactionId) { - this.transactionId = transactionId; - } - - public void setPendingReqId(String pendingReqId) { - this.pendingReqId = pendingReqId; - } - - public void setAuthURL(String authURL) { - this.authURL = authURL; - } - - public void setNeedAuthentication(boolean needAuthentication) { - this.needAuthentication = needAuthentication; - } - - - - - - - + private static final long serialVersionUID = 3000578812622938236L; + private String processInstanceID = null; + private ISpConfiguration spConfig = null; + private final Map<String, Object> storage = new HashMap<>(); + private String transactionId = null; + private String pendingReqId = null; + private String authUrl = null; + private boolean authenticated; + private boolean needAuthentication = false; + private boolean stoppedByUser; + private String piiTransactionId; + + /* + * (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 getRawData(final String key) { + return storage.get(key); + } + + /* + * (non-Javadoc) + * + * @see + * at.gv.egovernment.moa.id.moduls.IRequest#getGenericData(java.lang.String, + * java.lang.Class) + */ + @Override + public <T> T getRawData(final String key, final Class<T> clazz) { + return (T) storage.get(key); + } + + /* + * (non-Javadoc) + * + * @see + * at.gv.egovernment.moa.id.moduls.IRequest#getUniqueTransactionIdentifier() + */ + @Override + public String getUniqueTransactionIdentifier() { + return this.transactionId; + } + + /* + * (non-Javadoc) + * + * @see at.gv.egovernment.moa.id.moduls.IRequest#getUniqueSessionIdentifier() + */ + @Override + public String getUniqueSessionIdentifier() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getUniquePiiTransactionIdentifier() { + return this.piiTransactionId; + } + + /* + * (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() { + return this.authUrl; + } + + /* + * (non-Javadoc) + * + * @see at.gv.egovernment.moa.id.moduls.IRequest#getAuthURLWithOutSlash() + */ + @Override + public String getAuthUrlWithOutSlash() { + if (this.authUrl != null && this.authUrl.endsWith("/")) { + return this.authUrl.substring(0, this.authUrl.length() - 1); + } else { + return this.authUrl; + } + } + + /* + * (non-Javadoc) + * + * @see at.gv.egovernment.moa.id.moduls.IRequest#isNeedAuthentication() + */ + @Override + public boolean isNeedAuthentication() { + return this.needAuthentication; + + } + + /* + * (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(final boolean needSso) { + // TODO Auto-generated method stub + + } + + /* + * (non-Javadoc) + * + * @see at.gv.egovernment.moa.id.moduls.IRequest#isAuthenticated() + */ + @Override + public boolean isAuthenticated() { + return this.authenticated; + } + + /* + * (non-Javadoc) + * + * @see at.gv.egovernment.moa.id.moduls.IRequest#setAuthenticated(boolean) + */ + @Override + public void setAuthenticated(final boolean isAuthenticated) { + this.authenticated = isAuthenticated; + + } + + /** + * Set process-instance id. + * + * @param processInstanceID the processInstanceID to set + */ + public void setProcessInstanceID(final String processInstanceID) { + this.processInstanceID = processInstanceID; + } + + /* + * (non-Javadoc) + * + * @see at.gv.egovernment.moa.id.moduls.IRequest#isAbortedByUser() + */ + @Override + public boolean isAbortedByUser() { + return this.stoppedByUser; + + } + + /* + * (non-Javadoc) + * + * @see at.gv.egovernment.moa.id.moduls.IRequest#setAbortedByUser(boolean) + */ + @Override + public void setAbortedByUser(final boolean isAborted) { + this.stoppedByUser = isAborted; + + } + + @Override + public String getSpEntityId() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setRawDataToTransaction(final String key, final Object object) + throws EaafStorageException { + if (StringUtils.isEmpty(key)) { + throw new EaafStorageException("Generic request-data can not be stored with a 'null' key", + null); + + } + + if (object != null) { + if (!Serializable.class.isInstance(object)) { + throw new EaafStorageException( + "Generic request-data can only store objects which implements the 'Seralizable' interface", + null); + + } + } + + storage.put(key, object); + + } + + @Override + public void setRawDataToTransaction(final Map<String, Object> map) throws EaafStorageException { + storage.putAll(map); + + } + + @Override + public String getPendingRequestId() { + return this.pendingReqId; + } + + @Override + public String getInternalSsoSessionIdentifier() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setInternalSsoSessionIdentifier(final String internalSsoSessionId) { + // TODO Auto-generated method stub + + } + + @Override + public boolean isNeedUserConsent() { + // TODO Auto-generated method stub + return false; + } + + @Override + public void setNeedUserConsent(final boolean needConsent) { + // TODO Auto-generated method stub + + } + + @Override + public ISpConfiguration getServiceProviderConfiguration() { + return spConfig; + + } + + @Override + public <T> T getServiceProviderConfiguration(final Class<T> decorator) { + return (T) spConfig; + } + + public void setSpConfig(final ISpConfiguration spConfig) { + this.spConfig = spConfig; + } + + @Override + public <T> T getSessionData(final Class<T> wrapper) { + if (wrapper != null) { + if (AuthProcessDataWrapper.class.isAssignableFrom(wrapper)) { + try { + return wrapper.getConstructor(Map.class).newInstance(this.storage); + + } catch (NoSuchMethodException | SecurityException | InstantiationException + | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + throw new RuntimeException("Can NOT instance wrapper: " + wrapper.getName(), e); + + } + + } + + throw new RuntimeException("Can NOT wrap generic data into session data. " + + "Reason: Wrapper " + wrapper.getName() + " is NOT a valid wrapper"); + + } + + return null; + } + + public void setTransactionId(final String transactionId) { + this.transactionId = transactionId; + } + + public void setPendingReqId(final String pendingReqId) { + this.pendingReqId = pendingReqId; + } + + public void setPiiTransactionId(String piiTransactionId) { + this.piiTransactionId = piiTransactionId; + } + + public void setAuthUrl(final String authUrl) { + this.authUrl = authUrl; + } + + public void setNeedAuthentication(final boolean needAuthentication) { + this.needAuthentication = needAuthentication; + } } 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 index 4795fdf4..fb326eba 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; import java.util.ArrayList; @@ -37,7 +30,7 @@ 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; +import at.gv.egiz.eaaf.core.exceptions.EaafException; /** * Dummy DataSource implementation for convenience in test cases where a @@ -48,142 +41,145 @@ import at.gv.egiz.eaaf.core.exceptions.EAAFException; */ 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 + private static final Logger log = LoggerFactory.getLogger(DummyTransactionStorage.class); + + public class DummyDbEntry { + public DummyDbEntry(final String key, final Object value) { + this.obj = value; + this.key = key; + } + + public String getKey() { + return key; + } + + public void setKey(final String key) { + this.key = key; + } + + public Object getObj() { + return obj; + } + + public void setObj(final Object obj) { + this.obj = obj; + } + + private String key; + private Object obj; + } + + private final ArrayList<DummyDbEntry> ds = new ArrayList<>(); + + @Override + public boolean containsKey(final String key) { + // TODO Auto-generated method stub + final Iterator<DummyDbEntry> it = ds.iterator(); + while (it.hasNext()) { + final DummyDbEntry t = it.next(); + if (t.getKey().equals(key)) { + return true; + } + } + return false; + } + + @Override + public void put(final String key, final Object value, final int timeout) throws EaafException { + // TODO Auto-generated method stub + this.remove(key); + this.ds.add(new DummyDbEntry(key, value)); + + } + + @Override + public Object get(final String key) throws EaafException { + // TODO Auto-generated method stub + final Iterator<DummyDbEntry> it = ds.iterator(); + while (it.hasNext()) { + final DummyDbEntry t = it.next(); + if (t.getKey().equals(key)) { + return t; + } + } + return null; + } + + @Override + public <T> T get(final String key, final Class<T> clazz) throws EaafException { + + final DummyDbEntry o = (DummyDbEntry) get(key); + if (o == null) { + return null; + } + try { + @SuppressWarnings("unchecked") + final T test = clazz.cast(o.getObj()); + return test; + + } catch (final Exception e) { + log.warn("Sessioninformation Cast-Exception by using Artifact=" + key); + throw new EaafException("Sessioninformation Cast-Exception"); + + } + } + + @Override + public <T> T get(final String key, final Class<T> clazz, final long dataTimeOut) + throws EaafException { + // TODO Auto-generated method stub + return get(key, clazz); + } + + @Override + public void changeKey(final String oldKey, final String newKey, final Object value) + throws EaafException { + this.remove(oldKey); + this.put(newKey, value, -1); + + } + + @Override + public void remove(final String key) { + final Iterator<DummyDbEntry> it = ds.iterator(); + while (it.hasNext()) { + final DummyDbEntry t = it.next(); + if (t.getKey().equals(key)) { + this.ds.remove(t); + return; + } + } + + } + + @Override + public List<String> clean(final Date now, final long dataTimeOut) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getRaw(final String key) throws EaafException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void putRaw(final String key, final 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 + // + // } + +} 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 index 9a05f905..fff256bf 100644 --- 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 @@ -1,31 +1,23 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ +package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; import java.io.Serializable; import java.util.Collections; @@ -35,44 +27,44 @@ 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. - * + * 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>()); + private static final long serialVersionUID = 1L; + + private final 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); - } + /** + * 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(final 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); - } + /** + * Stores a {@link Serializable} with a certain {@code key}. + * + * @param key The key. + * @param object The object. + */ + void put(final String key, final Serializable object) { + ctxData.put(key, object); + } - @Override - public Map<String, Serializable> getCtx() { - return Collections.unmodifiableMap(ctxData); - } + @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 index fa6a9f10..96576b2d 100644 --- 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 @@ -1,67 +1,61 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + 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. - * + * 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; + private Boolean booleanValue; + private String stringValue; + private Integer integerValue; - public Boolean getBooleanValue() { - return booleanValue; - } + public Boolean getBooleanValue() { + return booleanValue; + } - public void setBooleanValue(Boolean booleanValue) { - this.booleanValue = booleanValue; - } + public void setBooleanValue(final Boolean booleanValue) { + this.booleanValue = booleanValue; + } - public String getStringValue() { - return stringValue; - } + public String getStringValue() { + return stringValue; + } - public void setStringValue(String stringValue) { - this.stringValue = stringValue; - } + public void setStringValue(final String stringValue) { + this.stringValue = stringValue; + } - public Integer getIntegerValue() { - return integerValue; - } + public Integer getIntegerValue() { + return integerValue; + } - public void setIntegerValue(Integer integerValue) { - this.integerValue = integerValue; - } + public void setIntegerValue(final 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 index 67675ff9..23d99837 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; import static at.gv.egiz.eaaf.core.impl.idp.process.ProcessInstanceState.NOT_STARTED; @@ -52,126 +45,120 @@ 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. - * + * 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 - - } - - - - } + @Autowired + private static ProcessEngine pe; + @Autowired + private ApplicationContext applicationContext; + + private final boolean isInitialized = false; + + /** + * jUnit test set-up. + * + * @throws IOException in case of an error + * @throws ProcessDefinitionParserException in case of an error + */ + @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(); + } + } + + @Test + public void testSampleProcessDefinitionWithExpression1() + throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + final TestRequestImpl req = new TestRequestImpl(); + + final 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 (final IllegalArgumentException e) { + // do nothing because processInstance should be already removed + + } + } + + @Test + public void testSampleProcessDefinitionForSaml1Authentication() + throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + final TestRequestImpl req = new TestRequestImpl(); + + final 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()); + + final 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 (final 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 index bde24824..26e2e17b 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.spring.test; import static org.junit.Assert.assertFalse; @@ -39,42 +32,43 @@ 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. - * + * 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; + private ExpressionContextAdapter ctx; - @Autowired - private ExpressionEvaluator expressionEvaluator; + @Autowired + private ExpressionEvaluator expressionEvaluator; - @Before - public void prepareTest() { - ctx = new ExpressionContextAdapter(); - } + @Before + public void prepareTest() { + ctx = new ExpressionContextAdapter(); + } - @Test - public void testEvaluateSimpleExpression() { - assertTrue(expressionEvaluator.evaluate(ctx, "'true'")); - } + @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 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")); - } + @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 deleted file mode 100644 index 9caba080..00000000 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/CreateSAML1AssertionTask.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * https://joinup.ec.europa.eu/news/understanding-eupl-v12 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -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/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..f29fa265 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/CreateSaml1AssertionTask.java @@ -0,0 +1,84 @@ +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: + * https://joinup.ec.europa.eu/news/understanding-eupl-v12 + * + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + +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 final Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(final IRequest penReq, final 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 (final 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 index e6f12d1e..b4f3d7c8 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; import java.io.IOException; @@ -56,29 +49,31 @@ import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; * <li>{@code IdentityLink}</li> * </ul> * </p> - * + * * @author tknall - * + * */ @Service("GetIdentityLinkTask") -public class GetIdentityLinkTask implements Task { +public class GetIdentityLinkTask implements Task { + + private final Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(final IRequest penReq, final ExecutionContext executionContext) + throws TaskExecutionException { + Objects.requireNonNull(executionContext.get("bkuURL")); - private Logger log = LoggerFactory.getLogger(getClass()); + log.debug("Using bkuURL in order to retrieve IdentityLink."); - @Override - public IRequest execute(IRequest penReq, ExecutionContext executionContext) throws TaskExecutionException { - Objects.requireNonNull(executionContext.get("bkuURL")); + try (InputStream in = getClass() + .getResourceAsStream("/process/spring/test/task/IdentityLink_Max_Mustermann.xml")) { + executionContext.put("IdentityLink", IOUtils.toString(in, "UTF-8")); - log.debug("Using bkuURL in order to retrieve IdentityLink."); + } catch (final IOException e) { + throw new TaskExecutionException(null, "", e); + } - 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; - } + 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 deleted file mode 100644 index 4cff97c6..00000000 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/SelectBKUTask.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * https://joinup.ec.europa.eu/news/understanding-eupl-v12 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -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/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..4d1edd53 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/spring/test/task/SelectBkuTask.java @@ -0,0 +1,56 @@ +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: + * https://joinup.ec.europa.eu/news/understanding-eupl-v12 + * + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + +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 final Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public IRequest execute(final IRequest penReq, final 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 index a2203676..16c375c9 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; import java.io.IOException; @@ -58,29 +51,32 @@ import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; * <li>{@code SignedAuthBlock}</li> * </ul> * </p> - * + * * @author tknall - * + * */ @Service("SignAuthBlockTask") -public class SignAuthBlockTask implements Task { +public class SignAuthBlockTask implements Task { + + private final Logger log = LoggerFactory.getLogger(getClass()); - private Logger log = LoggerFactory.getLogger(getClass()); + @Override + public IRequest execute(final IRequest penReq, final ExecutionContext executionContext) + throws TaskExecutionException { + Objects.requireNonNull(executionContext.get("IdentityLink")); + assert Boolean.TRUE + .equals(Objects.requireNonNull(executionContext.get("isIdentityLinkValidated"))); + Objects.requireNonNull(executionContext.get("bkuURL")); - @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 (final IOException e) { + throw new TaskExecutionException(null, "", e); - 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; - } + } + 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 index 7a1ba734..be1bfb01 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; import java.util.Objects; @@ -50,23 +43,23 @@ import at.gv.egiz.eaaf.core.api.idp.process.Task; * <li>{@code isIdentityLinkValidated}</li> * </ul> * </p> - * - * @author tknall - * + * + * @author tknall + * */ @Service("ValidateIdentityLinkTask") public class ValidateIdentityLinkTask implements Task { - private Logger log = LoggerFactory.getLogger(getClass()); + private final Logger log = LoggerFactory.getLogger(getClass()); - @Override - public IRequest execute(IRequest penReq, ExecutionContext executionContext) { - Objects.requireNonNull(executionContext.get("IdentityLink")); + @Override + public IRequest execute(final IRequest penReq, final ExecutionContext executionContext) { + Objects.requireNonNull(executionContext.get("IdentityLink")); - log.debug("Validating IdentityLink."); + log.debug("Validating IdentityLink."); - executionContext.put("isIdentityLinkValidated", true); - return null; - } + 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 index 1509033f..6e42d19c 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.spring.test.task; import java.util.Objects; @@ -53,25 +46,28 @@ import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; * <li>{@code isSignedAuthBlockValidated}</li> * </ul> * </p> - * + * * @author tknall - * + * */ @Service("ValidateSignedAuthBlockTask") public class ValidateSignedAuthBlockTask implements Task { - private Logger log = LoggerFactory.getLogger(getClass()); + private final 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")); + @Override + public IRequest execute(final IRequest penReq, final 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."); + log.debug( + "Using validated IdentityLink and signed auth block in order to validate signed auth block."); - executionContext.put("isSignedAuthBlockValidated", true); - return null; - } + 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 index 517e7ce7..4540a01d 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.test; import java.util.Objects; @@ -34,17 +27,18 @@ 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. - * + * 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.")); - } + @Override + public boolean evaluate(final ExpressionEvaluationContext expressionContext, final 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 index 743a61da..eadb023d 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.test; import org.springframework.stereotype.Service; @@ -34,17 +27,17 @@ 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 pendingReq; - } + + @Override + public IRequest execute(final IRequest pendingReq, final ExecutionContext executionContext) { + System.out.println("Hallo Welt"); + return pendingReq; + } } 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 index c6da16b4..e3e01b90 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.test; import org.springframework.stereotype.Service; @@ -34,17 +27,17 @@ 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 pendingReq; - } + + @Override + public IRequest execute(final IRequest pendingReq, final ExecutionContext executionContext) { + System.out.println("Hello World"); + return pendingReq; + } } 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 index 90c8ce6f..56259663 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.test; import static org.junit.Assert.assertEquals; @@ -47,117 +40,129 @@ 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()); - - } - } + + @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")) { + + final ProcessDefinitionParser parser = new ProcessDefinitionParser(); + final ProcessDefinition pd = parser.parse(in); + + assertNotNull(pd); + assertEquals("SampleProcess1", pd.getId()); + + // first assert tasks then transitions + // start event + final 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); + final TaskInfo task1 = (TaskInfo) processNode; + assertEquals("task1", task1.getId()); + assertFalse(task1.isAsync()); + // task2 + processNode = pd.getProcessNode("task2"); + assertNotNull(processNode); + assertTrue(processNode instanceof TaskInfo); + final TaskInfo task2 = (TaskInfo) processNode; + assertEquals("task2", task2.getId()); + assertTrue(task2.isAsync()); + // end event + processNode = pd.getProcessNode("end"); + assertNotNull(processNode); + assertTrue(processNode instanceof EndEvent); + final 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 + final 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 + final 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 + final 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 index dc45534e..7ce4c6b3 100644 --- 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 @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.test; import static at.gv.egiz.eaaf.core.impl.idp.process.ProcessInstanceState.NOT_STARTED; @@ -55,172 +48,194 @@ 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) { - final 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)); - } - - try (InputStream in = ProcessEngineTest.class.getResourceAsStream("/process/test/SampleProcessDefinition4.xml")) { - ((ProcessEngineImpl) pe).registerProcessDefinition(pdp.parse(in)); - } - - try (InputStream in = ProcessEngineTest.class.getResourceAsStream("/process/test/SampleProcessDefinition5.xml")) { - ((ProcessEngineImpl) pe).registerProcessDefinition(pdp.parse(in)); - } - - //initHibernateForTesting(); - isInitialized = true; - } - } - - @Test - public void wrongProcessDefinition() throws IOException { - try (InputStream in = ProcessEngineTest.class.getResourceAsStream("/process/test/SampleProcessDefinition3.xml")) { - try { - ((ProcessEngineImpl) pe).registerProcessDefinition(in); - Assert.fail(); - - } catch (final ProcessDefinitionParserException e) { - Assert.assertTrue(e.getMessage().contains("Post-validation find an error in process definition")); - } - } - - } - - @Test - public void testSampleProcess1() throws IOException, ProcessDefinitionParserException, ProcessExecutionException { - - final TestRequestImpl testReq = new TestRequestImpl(); - - final 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 (final IllegalArgumentException e) { - // do nothing because processInstance should be already removed - - } - } - - @Test - public void testSampleProcess2() throws IOException, ProcessDefinitionParserException, ProcessExecutionException { - - final TestRequestImpl testReq = new TestRequestImpl(); - - final 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 (final IllegalArgumentException e) { - // do nothing because processInstance should be already removed - - } - - } - - @Test - public void testSampleProcess4() throws IOException, ProcessDefinitionParserException, ProcessExecutionException { - - final TestRequestImpl testReq = new TestRequestImpl(); - testReq.setPendingReqId(RandomStringUtils.randomAlphanumeric(5)); - - final String piId = pe.createProcessInstance("SampleProcess4"); - final ProcessInstance pi = pe.getProcessInstance(piId); - assertEquals(NOT_STARTED, pi.getState()); - - // start process - testReq.setProcessInstanceID(piId); - try { - pe.start(testReq); - Assert.fail("Task exception not handled"); - - } catch (final ProcessExecutionException e1) { - org.springframework.util.Assert.isInstanceOf(TaskExecutionException.class, e1.getCause(), "No TaskExecutionException"); - Assert.assertEquals("Wrong error-msg", "jUnit Test", e1.getCause().getMessage()); - Assert.assertEquals("Wrong pendingReqId", testReq.getPendingRequestId(), ((TaskExecutionException) e1.getCause()).getPendingRequestID()); - org.springframework.util.Assert.isInstanceOf(RuntimeException.class, e1.getCause().getCause(), "Wrong Exception in TaskExecutionException"); - } - - - } - - @Test - public void testSampleProcess5() throws IOException, ProcessDefinitionParserException, ProcessExecutionException { - - final TestRequestImpl testReq = new TestRequestImpl(); - - final String piId = pe.createProcessInstance("SampleProcess5"); - ProcessInstance pi = pe.getProcessInstance(piId); - assertEquals(NOT_STARTED, pi.getState()); - - // start process - testReq.setProcessInstanceID(piId); - pe.start(testReq); - - try { - pi = pe.getProcessInstance(piId); - - } catch (final IllegalArgumentException e) { - Assert.assertTrue("wrong error-msg", e.getMessage().contains("does not/no longer exist.")); - Assert.assertTrue("wrong process-instance-id", e.getMessage().contains(piId)); - - } - - - } - - @Test(expected = IllegalArgumentException.class) - public void testProcessInstanceDoesNotExist() { - pe.getProcessInstance("does not exist"); - } + + @Autowired + private static ProcessEngine pe; + + @Autowired + private ApplicationContext applicationContext; + + private boolean isInitialized = false; + + /** + * jUnit test set-up. + * + * @throws IOException in case of an error + * @throws ProcessDefinitionParserException in case of an error + */ + @Before + public void init() throws IOException, ProcessDefinitionParserException { + + if (!isInitialized) { + final 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)); + } + + try (InputStream in = ProcessEngineTest.class + .getResourceAsStream("/process/test/SampleProcessDefinition4.xml")) { + ((ProcessEngineImpl) pe).registerProcessDefinition(pdp.parse(in)); + } + + try (InputStream in = ProcessEngineTest.class + .getResourceAsStream("/process/test/SampleProcessDefinition5.xml")) { + ((ProcessEngineImpl) pe).registerProcessDefinition(pdp.parse(in)); + } + + // initHibernateForTesting(); + isInitialized = true; + } + } + + @Test + public void wrongProcessDefinition() throws IOException { + try (InputStream in = + ProcessEngineTest.class.getResourceAsStream("/process/test/SampleProcessDefinition3.xml")) { + try { + ((ProcessEngineImpl) pe).registerProcessDefinition(in); + Assert.fail(); + + } catch (final ProcessDefinitionParserException e) { + Assert.assertTrue( + e.getMessage().contains("Post-validation find an error in process definition")); + } + } + + } + + @Test + public void testSampleProcess1() + throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + final TestRequestImpl testReq = new TestRequestImpl(); + + final 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 (final IllegalArgumentException e) { + // do nothing because processInstance should be already removed + + } + } + + @Test + public void testSampleProcess2() + throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + final TestRequestImpl testReq = new TestRequestImpl(); + + final 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 (final IllegalArgumentException e) { + // do nothing because processInstance should be already removed + + } + + } + + @Test + public void testSampleProcess4() + throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + final TestRequestImpl testReq = new TestRequestImpl(); + testReq.setPendingReqId(RandomStringUtils.randomAlphanumeric(5)); + + final String piId = pe.createProcessInstance("SampleProcess4"); + final ProcessInstance pi = pe.getProcessInstance(piId); + assertEquals(NOT_STARTED, pi.getState()); + + // start process + testReq.setProcessInstanceID(piId); + try { + pe.start(testReq); + Assert.fail("Task exception not handled"); + + } catch (final ProcessExecutionException e1) { + org.springframework.util.Assert.isInstanceOf(TaskExecutionException.class, e1.getCause(), + "No TaskExecutionException"); + Assert.assertEquals("Wrong error-msg", "jUnit Test", e1.getCause().getMessage()); + Assert.assertEquals("Wrong pendingReqId", testReq.getPendingRequestId(), + ((TaskExecutionException) e1.getCause()).getPendingRequestID()); + org.springframework.util.Assert.isInstanceOf(RuntimeException.class, e1.getCause().getCause(), + "Wrong Exception in TaskExecutionException"); + } + + } + + @Test + public void testSampleProcess5() + throws IOException, ProcessDefinitionParserException, ProcessExecutionException { + + final TestRequestImpl testReq = new TestRequestImpl(); + + final String piId = pe.createProcessInstance("SampleProcess5"); + ProcessInstance pi = pe.getProcessInstance(piId); + assertEquals(NOT_STARTED, pi.getState()); + + // start process + testReq.setProcessInstanceID(piId); + pe.start(testReq); + + try { + pi = pe.getProcessInstance(piId); + + } catch (final IllegalArgumentException e) { + Assert.assertTrue("wrong error-msg", e.getMessage().contains("does not/no longer exist.")); + Assert.assertTrue("wrong process-instance-id", e.getMessage().contains(piId)); + + } + + } + + @Test(expected = IllegalArgumentException.class) + public void testProcessInstanceDoesNotExist() { + pe.getProcessInstance("does not exist"); + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/StopProcessFlagTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/StopProcessFlagTask.java index 8cd76eaa..e2fd80a8 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/StopProcessFlagTask.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/StopProcessFlagTask.java @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.test; import org.springframework.stereotype.Service; @@ -34,19 +27,19 @@ 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 StopProcessFlagTask implements Task { - - @Override - public IRequest execute(IRequest pendingReq, ExecutionContext executionContext) { - System.out.println("Stop process-flow dynamically from task"); - executionContext.setCanceleProcessFlag(); - - return pendingReq; - } + + @Override + public IRequest execute(final IRequest pendingReq, final ExecutionContext executionContext) { + System.out.println("Stop process-flow dynamically from task"); + executionContext.setCanceleProcessFlag(); + + return pendingReq; + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ThrowExceptionTask.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ThrowExceptionTask.java index ecd139c8..759e3460 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ThrowExceptionTask.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/process/test/ThrowExceptionTask.java @@ -1,29 +1,22 @@ -/******************************************************************************* - * Copyright 2017 Graz University of Technology - * EAAF-Core Components has been developed in a cooperation between EGIZ, - * A-SIT Plus, A-SIT, and Graz University of Technology. +/* + * Copyright 2017 Graz University of Technology EAAF-Core Components has been developed in a + * cooperation between EGIZ, A-SIT Plus, A-SIT, and Graz University of Technology. * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in + * compliance with the Licence. You may obtain a copy of the Licence at: * https://joinup.ec.europa.eu/news/understanding-eupl-v12 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ -/******************************************************************************* - *******************************************************************************/ + * Unless required by applicable law or agreed to in writing, software distributed under the Licence + * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the Licence for the specific language governing permissions and limitations under + * the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text file for details on the + * various modules and licenses. The "NOTICE" text file is part of the distribution. Any derivative + * works that you distribute must include a readable copy of the "NOTICE" text file. +*/ + package at.gv.egiz.eaaf.core.impl.idp.process.test; import org.springframework.stereotype.Service; @@ -35,18 +28,20 @@ import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; /** * Simple task that just outputs a "Hello World" text to the console. - * + * * @author tknall - * + * */ @Service("HelloWorldTask") public class ThrowExceptionTask implements Task { - - @Override - public IRequest execute(IRequest pendingReq, ExecutionContext executionContext) throws TaskExecutionException { - System.out.println("Stop process-flow dynamically from task"); - throw new TaskExecutionException(pendingReq, "jUnit Test", new RuntimeException("jUnit test exception handling")); - - } + + @Override + public IRequest execute(final IRequest pendingReq, final ExecutionContext executionContext) + throws TaskExecutionException { + System.out.println("Stop process-flow dynamically from task"); + throw new TaskExecutionException(pendingReq, "jUnit Test", + new RuntimeException("jUnit test exception handling")); + + } } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/utils/KeyValueUtilsTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/utils/KeyValueUtilsTest.java index 9df11ed6..36406304 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/utils/KeyValueUtilsTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/utils/KeyValueUtilsTest.java @@ -18,430 +18,429 @@ import org.junit.runners.BlockJUnit4ClassRunner; @RunWith(BlockJUnit4ClassRunner.class) public class KeyValueUtilsTest { - @Test - public void getFirstChildTest_1() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String child = RandomStringUtils.randomAlphabetic(2); - final String key = prefix + KeyValueUtils.KEY_DELIMITER + child + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(4); - final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, prefix); - Assert.assertEquals("First child not match", child, resut); - - } - - @Test - public void getFirstChildTest_2() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String child = RandomStringUtils.randomAlphabetic(2); - final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; - final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, prefix); - Assert.assertEquals("First child not match", child, resut); - - } - - @Test - public void getFirstChildTest_3() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String child = RandomStringUtils.randomAlphabetic(2); - final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; - final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, key); - Assert.assertNull("First child not null", resut); - - } - - @Test - public void getFirstChildTest_4() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String child = RandomStringUtils.randomAlphabetic(2); - final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; - final String resut = KeyValueUtils.getFirstChildAfterPrefix( - RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + key, - key); - Assert.assertNull("First child not null", resut); - - } - - @Test - public void getFirstChildTest_5() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String child = RandomStringUtils.randomAlphabetic(2); - final String key = child + KeyValueUtils.KEY_DELIMITER + prefix; - final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, null); - Assert.assertEquals("First child not match", child, resut); - - } - - @Test - public void getFirstChildTest_6() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String child = RandomStringUtils.randomAlphabetic(2); - final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; - final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, key); - Assert.assertNull("First child not null", resut); - - } - - @Test - public void getPrefixFromKey_1() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String child = RandomStringUtils.randomAlphabetic(2); - final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; - final String resut = KeyValueUtils.getPrefixFromKey(key, child); - Assert.assertEquals("Prefix not match", prefix, resut); - - } - - @Test - public void getPrefixFromKey_2() { - final String child = RandomStringUtils.randomAlphabetic(2); - final String resut = KeyValueUtils.getPrefixFromKey(null, child); - Assert.assertNull("Prefix not null", resut); - - } - - @Test - public void getPrefixFromKey_3() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String key = prefix + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(4); - final String resut = KeyValueUtils.getPrefixFromKey(key, RandomStringUtils.randomAlphabetic(5)); - Assert.assertNull("Prefix not null", resut); - - } - - @Test - public void getPrefixFromKey_4() { - final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String child = KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(2); - final String key = prefix + child; - final String resut = KeyValueUtils.getPrefixFromKey(key, child); - Assert.assertEquals("Prefix not match", prefix, resut); - - } - - @Test - public void getPrefixFromKey_5() { - final String key = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String resut = KeyValueUtils.getPrefixFromKey(key, null); - Assert.assertNull("Prefix not null", resut); - - } - - @Test - public void getRemovePrefixesFromKeys_1() { - final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final Map<String, String> testMap = generateTestMap(testPrefix , 5, 5); - - final Map<String, String> result = KeyValueUtils.removePrefixFromKeys(testMap, testPrefix); - Assert.assertNotNull("Result is null", result); - Assert.assertFalse("Result is empty", result.isEmpty()); - Assert.assertEquals("Result size not match", 5, result.size()); - final Iterator<Entry<String, String>> it = result.entrySet().iterator(); - while(it.hasNext()) { - final Entry<String, String> next = it.next(); - Assert.assertNotNull("Key is null", next.getKey()); - Assert.assertNotNull("Value is null", next.getValue()); - Assert.assertTrue("Key is null", testMap.containsKey(testPrefix + "." + next.getKey())); - Assert.assertEquals("Value not match", testMap.get(testPrefix + "." + next.getKey()), next.getValue()); - - } - - } - - @Test - public void getSubSetWithPrefixTest_1() { - final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final Map<String, String> testMap = generateTestMap(testPrefix , 5, 5); - - final Map<String, String> result = KeyValueUtils.getSubSetWithPrefix(testMap, testPrefix); - Assert.assertNotNull("Result is null", result); - Assert.assertFalse("Result is empty", result.isEmpty()); - Assert.assertEquals("Result size not match", 5, result.size()); - final Iterator<Entry<String, String>> it = result.entrySet().iterator(); - while(it.hasNext()) { - final Entry<String, String> next = it.next(); - Assert.assertNotNull("Key is null", next.getKey()); - Assert.assertNotNull("Value is null", next.getValue()); - Assert.assertTrue("Key is null", testMap.containsKey(testPrefix + "." + next.getKey())); - Assert.assertEquals("Value not match", testMap.get(testPrefix + "." + next.getKey()), next.getValue()); - - } - - } - - @Test - public void makeKeysAbsolutTest_1() { - final String absTestPrefixtestPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String prefix = absTestPrefixtestPrefix + "." + RandomStringUtils.randomAlphabetic(4); - final Map<String, String> testMap = generateTestMap(prefix, 5, 5); - final Map<String, String> result = KeyValueUtils.makeKeysAbsolut( - testMap, - absTestPrefixtestPrefix, - prefix); - - Assert.assertNotNull("Result is null", result); - Assert.assertFalse("Result is empty", result.isEmpty()); - Assert.assertEquals("Result size not match", 10, result.size()); - final Iterator<Entry<String, String>> it = result.entrySet().iterator(); - while(it.hasNext()) { - final Entry<String, String> next = it.next(); - Assert.assertNotNull("Key is null", next.getKey()); - Assert.assertNotNull("Value is null", next.getValue()); - if (testMap.containsKey(next.getKey())) - Assert.assertEquals("Value not match", testMap.get(next.getKey()), next.getValue()); - else { - Assert.assertTrue("Key not found", testMap.containsKey( - next.getKey().substring( - absTestPrefixtestPrefix.length() + 1)) - ); - Assert.assertEquals("Value not match", testMap.get( - next.getKey().substring( - absTestPrefixtestPrefix.length() + 1)), - next.getValue()); - } - } - } - - @Test - public void getParentKeyTest_1() { - final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final String result = KeyValueUtils.getParentKey(testPrefix + "." + RandomStringUtils.randomAlphabetic(5)); - Assert.assertNotNull("Result is null", result); - Assert.assertEquals("Parent not match", testPrefix, result); - - } - - @Test - public void getParentKeyTest_2() { - final String result = KeyValueUtils.getParentKey(RandomStringUtils.randomAlphabetic(5)); - Assert.assertNotNull("Result is null", result); - Assert.assertTrue("Result not empty", result.isEmpty()); - - } - - @Test - public void findNextFreeListCoutnerTest_1() { - final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final Set<String> propList = new HashSet<String>(); - propList.add(testPrefix + ".1"); - propList.add(testPrefix + ".2"); - propList.add(testPrefix + ".0"); - propList.add(testPrefix + ".4"); - propList.add(testPrefix + ".3"); - - final int result = KeyValueUtils.findNextFreeListCounter(propList, testPrefix); - Assert.assertEquals("Next free element not fount", 5, result); - - } - - @Test - public void findNextFreeListCoutnerTest_2() { - final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final Set<String> propList = new HashSet<String>(); - propList.add(testPrefix + ".1"); - propList.add(testPrefix + ".5"); - propList.add(testPrefix + ".0"); - propList.add(testPrefix + ".4"); - propList.add(testPrefix + ".3"); - - final int result = KeyValueUtils.findNextFreeListCounter(propList, testPrefix); - Assert.assertEquals("Next free element not fount", 6, result); - - } - - @Test - public void findNextFreeListCoutnerTest_3() { - final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final Set<String> propList = new HashSet<String>();; - - final int result = KeyValueUtils.findNextFreeListCounter(propList, testPrefix); - Assert.assertEquals("Next free element not fount", 0, result); - - } - - @Test - public void findNextFreeListCoutnerTest_4() { - final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - final java.util.List<String> propList = new ArrayList<String>(); - - final int result = KeyValueUtils.findNextFreeListCounter(propList.stream().toArray(String[]::new), testPrefix); - Assert.assertEquals("Next free element not fount", 0, result); - - } - - @Test - public void normalizeCSVValueStringTest_1() { - final String csv1 = RandomStringUtils.randomAlphanumeric(5); - final String csv2 = RandomStringUtils.randomAlphanumeric(5); - final String csv3 = RandomStringUtils.randomAlphanumeric(5); - final String csv4 = RandomStringUtils.randomAlphanumeric(5); - final String testValue = " " + csv1 + " ," + csv2 + "," + csv3 + "\n," + csv4 + " "; - - final String result = KeyValueUtils.normalizeCSVValueString(testValue); - - Assert.assertNotNull("Result is null", result); - Assert.assertFalse("Result is empty", result.isEmpty()); - final String[] check = result.split(","); - Assert.assertEquals("Result size wrong", 4, check.length); - Assert.assertEquals("Result 1 wrong", csv1, check[0]); - Assert.assertEquals("Result 2 wrong", csv2, check[1]); - Assert.assertEquals("Result 3 wrong", csv3, check[2]); - Assert.assertEquals("Result 4 wrong", csv4, check[3]); - - } - - @Test - public void isCSVValueStringTest_1() { - final String csv1 = RandomStringUtils.randomAlphanumeric(5); - final String csv2 = RandomStringUtils.randomAlphanumeric(5); - final String csv3 = RandomStringUtils.randomAlphanumeric(5); - final String csv4 = RandomStringUtils.randomAlphanumeric(5); - final String testValue = " " + csv1 + " ," + csv2 + "," + csv3 + "\n," + csv4 + " "; - final boolean result = KeyValueUtils.isCSVValueString(testValue); - Assert.assertTrue("CSV value not detected", result); - - } - - @Test - public void isCSVValueStringTest_2() { - final String csv1 = RandomStringUtils.randomAlphanumeric(5); - final String testValue = " " + csv1 + " ,"; - final boolean result = KeyValueUtils.isCSVValueString(testValue); - Assert.assertFalse("CSV value not detected", result); - - } - - @Test - public void isCSVValueStringTest_3() { - final String csv1 = RandomStringUtils.randomAlphanumeric(5); - final String testValue = " " + csv1; - final boolean result = KeyValueUtils.isCSVValueString(testValue); - Assert.assertFalse("CSV value not detected", result); - - } - - @Test - public void getListOfCSVValuesTest_1() { - final String csv1 = RandomStringUtils.randomAlphanumeric(5); - final String csv2 = RandomStringUtils.randomAlphanumeric(5); - final String csv3 = RandomStringUtils.randomAlphanumeric(5); - final String csv4 = RandomStringUtils.randomAlphanumeric(5); - final String testValue = " " + csv1 + " ," + csv2 + "," + csv3 + "\n," + csv4 + " "; - - final List<String> result = KeyValueUtils.getListOfCSVValues(testValue); - - Assert.assertNotNull("Result is null", result); - Assert.assertFalse("Result is empty", result.isEmpty()); - Assert.assertEquals("Result size wrong", 4, result.size()); - Assert.assertEquals("Result 1 wrong", csv1, result.get(0)); - Assert.assertEquals("Result 2 wrong", csv2, result.get(1)); - Assert.assertEquals("Result 3 wrong", csv3, result.get(2)); - Assert.assertEquals("Result 4 wrong", csv4, result.get(3)); - - } - - @Test - public void convertListToMapTest_1() { - final java.util.List<String> propList = new ArrayList<String>(); - final String prefix = RandomStringUtils.randomAlphabetic(4) + "."; - final String key1 = RandomStringUtils.randomAlphabetic(5); - final String value1 = RandomStringUtils.randomAlphanumeric(10); - final String key2 = RandomStringUtils.randomAlphabetic(5); - final String value2 = RandomStringUtils.randomAlphanumeric(10); - final String key3 = RandomStringUtils.randomAlphabetic(5); - final String value3 = RandomStringUtils.randomAlphanumeric(10); - final String key4 = RandomStringUtils.randomAlphabetic(5); - final String value4 = RandomStringUtils.randomAlphanumeric(10); - final String key5 = RandomStringUtils.randomAlphabetic(5); - final String value5 = RandomStringUtils.randomAlphanumeric(10); - final String key6 = RandomStringUtils.randomAlphabetic(5); - final String value6 = "="+RandomStringUtils.randomAlphanumeric(10); - - propList.add(prefix + key1 + "=" + value1); - propList.add(prefix + key2 + "=" + value2); - propList.add(prefix + key3 + "=" + value3); - propList.add(prefix + key4 + "=" + value4); - propList.add(prefix + key5 + "+" + value5); - propList.add(prefix + key6 + "=" + value6); - - final Map<String, String> result = KeyValueUtils.convertListToMap(propList); - Assert.assertNotNull("Result is null", result); - Assert.assertFalse("Result is empty", result.isEmpty()); - Assert.assertEquals("Result size not match", 5, result.size()); - - Assert.assertTrue("Key1 not found", result.containsKey(prefix+key1)); - Assert.assertEquals("Value1 not found", value1, result.get(prefix+key1)); - Assert.assertTrue("Key2 not found", result.containsKey(prefix+key2)); - Assert.assertEquals("Value2 not found", value2, result.get(prefix+key2)); - Assert.assertTrue("Key3 not found", result.containsKey(prefix+key3)); - Assert.assertEquals("Value3 not found", value3, result.get(prefix+key3)); - Assert.assertTrue("Key4 not found", result.containsKey(prefix+key4)); - Assert.assertEquals("Value4 not found", value4, result.get(prefix+key4)); - - } - - @Test - public void convertListToMapTest_2() { - final java.util.List<String> propList = new ArrayList<String>(); - - final Map<String, String> result = KeyValueUtils.convertListToMap(propList); - Assert.assertNotNull("Result is null", result); - Assert.assertTrue("Result is not empty", result.isEmpty()); - - } - - private Map<String, String> generateTestMap(String testPrefix, int entriesWithPrefix, int entriesWithoutPrefix) { - final Map<String, String> result = new HashMap<String, String>(); - for (int i=0; i<entriesWithPrefix; i++) - result.put( - testPrefix + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(5), - RandomStringUtils.randomAlphabetic(5)); - - final String key = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER - + RandomStringUtils.randomAlphabetic(5); - for (int i=0; i<entriesWithoutPrefix; i++) - result.put( - key + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(5), - RandomStringUtils.randomAlphabetic(5)); - - return result; - - } - + @Test + public void getFirstChildTest_1() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String child = RandomStringUtils.randomAlphabetic(2); + final String key = prefix + KeyValueUtils.KEY_DELIMITER + child + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(4); + final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, prefix); + Assert.assertEquals("First child not match", child, resut); + + } + + @Test + public void getFirstChildTest_2() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String child = RandomStringUtils.randomAlphabetic(2); + final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; + final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, prefix); + Assert.assertEquals("First child not match", child, resut); + + } + + @Test + public void getFirstChildTest_3() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String child = RandomStringUtils.randomAlphabetic(2); + final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; + final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, key); + Assert.assertNull("First child not null", resut); + + } + + @Test + public void getFirstChildTest_4() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String child = RandomStringUtils.randomAlphabetic(2); + final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; + final String resut = KeyValueUtils.getFirstChildAfterPrefix( + RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + key, key); + Assert.assertNull("First child not null", resut); + + } + + @Test + public void getFirstChildTest_5() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String child = RandomStringUtils.randomAlphabetic(2); + final String key = child + KeyValueUtils.KEY_DELIMITER + prefix; + final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, null); + Assert.assertEquals("First child not match", child, resut); + + } + + @Test + public void getFirstChildTest_6() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String child = RandomStringUtils.randomAlphabetic(2); + final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; + final String resut = KeyValueUtils.getFirstChildAfterPrefix(key, key); + Assert.assertNull("First child not null", resut); + + } + + @Test + public void getPrefixFromKey_1() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String child = RandomStringUtils.randomAlphabetic(2); + final String key = prefix + KeyValueUtils.KEY_DELIMITER + child; + final String resut = KeyValueUtils.getPrefixFromKey(key, child); + Assert.assertEquals("Prefix not match", prefix, resut); + + } + + @Test + public void getPrefixFromKey_2() { + final String child = RandomStringUtils.randomAlphabetic(2); + final String resut = KeyValueUtils.getPrefixFromKey(null, child); + Assert.assertNull("Prefix not null", resut); + + } + + @Test + public void getPrefixFromKey_3() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String key = prefix + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(4); + final String resut = KeyValueUtils.getPrefixFromKey(key, RandomStringUtils.randomAlphabetic(5)); + Assert.assertNull("Prefix not null", resut); + + } + + @Test + public void getPrefixFromKey_4() { + final String prefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String child = KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(2); + final String key = prefix + child; + final String resut = KeyValueUtils.getPrefixFromKey(key, child); + Assert.assertEquals("Prefix not match", prefix, resut); + + } + + @Test + public void getPrefixFromKey_5() { + final String key = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String resut = KeyValueUtils.getPrefixFromKey(key, null); + Assert.assertNull("Prefix not null", resut); + + } + + @Test + public void getRemovePrefixesFromKeys_1() { + final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final Map<String, String> testMap = generateTestMap(testPrefix, 5, 5); + + final Map<String, String> result = KeyValueUtils.removePrefixFromKeys(testMap, testPrefix); + Assert.assertNotNull("Result is null", result); + Assert.assertFalse("Result is empty", result.isEmpty()); + Assert.assertEquals("Result size not match", 5, result.size()); + final Iterator<Entry<String, String>> it = result.entrySet().iterator(); + while (it.hasNext()) { + final Entry<String, String> next = it.next(); + Assert.assertNotNull("Key is null", next.getKey()); + Assert.assertNotNull("Value is null", next.getValue()); + Assert.assertTrue("Key is null", testMap.containsKey(testPrefix + "." + next.getKey())); + Assert.assertEquals("Value not match", testMap.get(testPrefix + "." + next.getKey()), + next.getValue()); + + } + + } + + @Test + public void getSubSetWithPrefixTest_1() { + final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final Map<String, String> testMap = generateTestMap(testPrefix, 5, 5); + + final Map<String, String> result = KeyValueUtils.getSubSetWithPrefix(testMap, testPrefix); + Assert.assertNotNull("Result is null", result); + Assert.assertFalse("Result is empty", result.isEmpty()); + Assert.assertEquals("Result size not match", 5, result.size()); + final Iterator<Entry<String, String>> it = result.entrySet().iterator(); + while (it.hasNext()) { + final Entry<String, String> next = it.next(); + Assert.assertNotNull("Key is null", next.getKey()); + Assert.assertNotNull("Value is null", next.getValue()); + Assert.assertTrue("Key is null", testMap.containsKey(testPrefix + "." + next.getKey())); + Assert.assertEquals("Value not match", testMap.get(testPrefix + "." + next.getKey()), + next.getValue()); + + } + + } + + @Test + public void makeKeysAbsolutTest_1() { + final String absTestPrefixtestPrefix = RandomStringUtils.randomAlphabetic(4) + + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(6) + + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(5); + final String prefix = absTestPrefixtestPrefix + "." + RandomStringUtils.randomAlphabetic(4); + final Map<String, String> testMap = generateTestMap(prefix, 5, 5); + final Map<String, String> result = + KeyValueUtils.makeKeysAbsolut(testMap, absTestPrefixtestPrefix, prefix); + + Assert.assertNotNull("Result is null", result); + Assert.assertFalse("Result is empty", result.isEmpty()); + Assert.assertEquals("Result size not match", 10, result.size()); + final Iterator<Entry<String, String>> it = result.entrySet().iterator(); + while (it.hasNext()) { + final Entry<String, String> next = it.next(); + Assert.assertNotNull("Key is null", next.getKey()); + Assert.assertNotNull("Value is null", next.getValue()); + if (testMap.containsKey(next.getKey())) { + Assert.assertEquals("Value not match", testMap.get(next.getKey()), next.getValue()); + } else { + Assert.assertTrue("Key not found", + testMap.containsKey(next.getKey().substring(absTestPrefixtestPrefix.length() + 1))); + Assert.assertEquals("Value not match", + testMap.get(next.getKey().substring(absTestPrefixtestPrefix.length() + 1)), + next.getValue()); + } + } + } + + @Test + public void getParentKeyTest_1() { + final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final String result = + KeyValueUtils.getParentKey(testPrefix + "." + RandomStringUtils.randomAlphabetic(5)); + Assert.assertNotNull("Result is null", result); + Assert.assertEquals("Parent not match", testPrefix, result); + + } + + @Test + public void getParentKeyTest_2() { + final String result = KeyValueUtils.getParentKey(RandomStringUtils.randomAlphabetic(5)); + Assert.assertNotNull("Result is null", result); + Assert.assertTrue("Result not empty", result.isEmpty()); + + } + + @Test + public void findNextFreeListCoutnerTest_1() { + final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final Set<String> propList = new HashSet<>(); + propList.add(testPrefix + ".1"); + propList.add(testPrefix + ".2"); + propList.add(testPrefix + ".0"); + propList.add(testPrefix + ".4"); + propList.add(testPrefix + ".3"); + + final int result = KeyValueUtils.findNextFreeListCounter(propList, testPrefix); + Assert.assertEquals("Next free element not fount", 5, result); + + } + + @Test + public void findNextFreeListCoutnerTest_2() { + final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final Set<String> propList = new HashSet<>(); + propList.add(testPrefix + ".1"); + propList.add(testPrefix + ".5"); + propList.add(testPrefix + ".0"); + propList.add(testPrefix + ".4"); + propList.add(testPrefix + ".3"); + + final int result = KeyValueUtils.findNextFreeListCounter(propList, testPrefix); + Assert.assertEquals("Next free element not fount", 6, result); + + } + + @Test + public void findNextFreeListCoutnerTest_3() { + final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final Set<String> propList = new HashSet<>(); + + final int result = KeyValueUtils.findNextFreeListCounter(propList, testPrefix); + Assert.assertEquals("Next free element not fount", 0, result); + + } + + @Test + public void findNextFreeListCoutnerTest_4() { + final String testPrefix = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + final java.util.List<String> propList = new ArrayList<>(); + + final int result = + KeyValueUtils.findNextFreeListCounter(propList.stream().toArray(String[]::new), testPrefix); + Assert.assertEquals("Next free element not fount", 0, result); + + } + + @Test + public void normalizeCsvValueStringTest_1() { + final String csv1 = RandomStringUtils.randomAlphanumeric(5); + final String csv2 = RandomStringUtils.randomAlphanumeric(5); + final String csv3 = RandomStringUtils.randomAlphanumeric(5); + final String csv4 = RandomStringUtils.randomAlphanumeric(5); + final String testValue = " " + csv1 + " ," + csv2 + "," + csv3 + "\n," + csv4 + " "; + + final String result = KeyValueUtils.normalizeCsvValueString(testValue); + + Assert.assertNotNull("Result is null", result); + Assert.assertFalse("Result is empty", result.isEmpty()); + final String[] check = result.split(","); + Assert.assertEquals("Result size wrong", 4, check.length); + Assert.assertEquals("Result 1 wrong", csv1, check[0]); + Assert.assertEquals("Result 2 wrong", csv2, check[1]); + Assert.assertEquals("Result 3 wrong", csv3, check[2]); + Assert.assertEquals("Result 4 wrong", csv4, check[3]); + + } + + @Test + public void isCsvValueStringTest_1() { + final String csv1 = RandomStringUtils.randomAlphanumeric(5); + final String csv2 = RandomStringUtils.randomAlphanumeric(5); + final String csv3 = RandomStringUtils.randomAlphanumeric(5); + final String csv4 = RandomStringUtils.randomAlphanumeric(5); + final String testValue = " " + csv1 + " ," + csv2 + "," + csv3 + "\n," + csv4 + " "; + final boolean result = KeyValueUtils.isCsvValueString(testValue); + Assert.assertTrue("CSV value not detected", result); + + } + + @Test + public void isCsvValueStringTest_2() { + final String csv1 = RandomStringUtils.randomAlphanumeric(5); + final String testValue = " " + csv1 + " ,"; + final boolean result = KeyValueUtils.isCsvValueString(testValue); + Assert.assertFalse("CSV value not detected", result); + + } + + @Test + public void isCsvValueStringTest_3() { + final String csv1 = RandomStringUtils.randomAlphanumeric(5); + final String testValue = " " + csv1; + final boolean result = KeyValueUtils.isCsvValueString(testValue); + Assert.assertFalse("CSV value not detected", result); + + } + + @Test + public void getListOfCsvValuesTest_1() { + final String csv1 = RandomStringUtils.randomAlphanumeric(5); + final String csv2 = RandomStringUtils.randomAlphanumeric(5); + final String csv3 = RandomStringUtils.randomAlphanumeric(5); + final String csv4 = RandomStringUtils.randomAlphanumeric(5); + final String testValue = " " + csv1 + " ," + csv2 + "," + csv3 + "\n," + csv4 + " "; + + final List<String> result = KeyValueUtils.getListOfCsvValues(testValue); + + Assert.assertNotNull("Result is null", result); + Assert.assertFalse("Result is empty", result.isEmpty()); + Assert.assertEquals("Result size wrong", 4, result.size()); + Assert.assertEquals("Result 1 wrong", csv1, result.get(0)); + Assert.assertEquals("Result 2 wrong", csv2, result.get(1)); + Assert.assertEquals("Result 3 wrong", csv3, result.get(2)); + Assert.assertEquals("Result 4 wrong", csv4, result.get(3)); + + } + + @Test + public void convertListToMapTest_1() { + final java.util.List<String> propList = new ArrayList<>(); + final String prefix = RandomStringUtils.randomAlphabetic(4) + "."; + final String key1 = RandomStringUtils.randomAlphabetic(5); + final String value1 = RandomStringUtils.randomAlphanumeric(10); + final String key2 = RandomStringUtils.randomAlphabetic(5); + final String value2 = RandomStringUtils.randomAlphanumeric(10); + final String key3 = RandomStringUtils.randomAlphabetic(5); + final String value3 = RandomStringUtils.randomAlphanumeric(10); + final String key4 = RandomStringUtils.randomAlphabetic(5); + final String value4 = RandomStringUtils.randomAlphanumeric(10); + final String key5 = RandomStringUtils.randomAlphabetic(5); + final String value5 = RandomStringUtils.randomAlphanumeric(10); + final String key6 = RandomStringUtils.randomAlphabetic(5); + final String value6 = "=" + RandomStringUtils.randomAlphanumeric(10); + + propList.add(prefix + key1 + "=" + value1); + propList.add(prefix + key2 + "=" + value2); + propList.add(prefix + key3 + "=" + value3); + propList.add(prefix + key4 + "=" + value4); + propList.add(prefix + key5 + "+" + value5); + propList.add(prefix + key6 + "=" + value6); + + final Map<String, String> result = KeyValueUtils.convertListToMap(propList); + Assert.assertNotNull("Result is null", result); + Assert.assertFalse("Result is empty", result.isEmpty()); + Assert.assertEquals("Result size not match", 5, result.size()); + + Assert.assertTrue("Key1 not found", result.containsKey(prefix + key1)); + Assert.assertEquals("Value1 not found", value1, result.get(prefix + key1)); + Assert.assertTrue("Key2 not found", result.containsKey(prefix + key2)); + Assert.assertEquals("Value2 not found", value2, result.get(prefix + key2)); + Assert.assertTrue("Key3 not found", result.containsKey(prefix + key3)); + Assert.assertEquals("Value3 not found", value3, result.get(prefix + key3)); + Assert.assertTrue("Key4 not found", result.containsKey(prefix + key4)); + Assert.assertEquals("Value4 not found", value4, result.get(prefix + key4)); + + } + + @Test + public void convertListToMapTest_2() { + final java.util.List<String> propList = new ArrayList<>(); + + final Map<String, String> result = KeyValueUtils.convertListToMap(propList); + Assert.assertNotNull("Result is null", result); + Assert.assertTrue("Result is not empty", result.isEmpty()); + + } + + private Map<String, String> generateTestMap(final String testPrefix, final int entriesWithPrefix, + final int entriesWithoutPrefix) { + final Map<String, String> result = new HashMap<>(); + for (int i = 0; i < entriesWithPrefix; i++) { + result.put(testPrefix + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(5), + RandomStringUtils.randomAlphabetic(5)); + } + + final String key = RandomStringUtils.randomAlphabetic(4) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(6) + KeyValueUtils.KEY_DELIMITER + + RandomStringUtils.randomAlphabetic(5); + for (int i = 0; i < entriesWithoutPrefix; i++) { + result.put(key + KeyValueUtils.KEY_DELIMITER + RandomStringUtils.randomAlphabetic(5), + RandomStringUtils.randomAlphabetic(5)); + } + + return result; + + } } diff --git a/eaaf_core/src/test/resources/SpringTest-context_authManager.xml b/eaaf_core/src/test/resources/SpringTest-context_authManager.xml index b8eef11f..d7b148d0 100644 --- a/eaaf_core/src/test/resources/SpringTest-context_authManager.xml +++ b/eaaf_core/src/test/resources/SpringTest-context_authManager.xml @@ -1,47 +1,53 @@ <?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="TestAuthenticationDataBuilder" - class="at.gv.egiz.eaaf.core.impl.idp.auth.TestAuthenticationDataBuilder"/> - - <bean id="dummyAuthManager" - class="at.gv.egiz.eaaf.core.impl.idp.auth.DummyAuthManager" /> - - <bean id="dummyRevisionLogger" - class="at.gv.egiz.eaaf.core.impl.logging.DummyRevisionsLogger" /> - - <bean id="DummyProtocolAuthService" - class="at.gv.egiz.eaaf.core.impl.idp.module.test.DummyProtocolAuthService" /> - - <bean id="DummyTransactionStorage" - class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.DummyTransactionStorage" /> - - <bean id="DummyStatusMessager" - class="at.gv.egiz.eaaf.core.impl.logging.DummyStatusMessager" /> - - <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="ProcessInstanceStoreage" - class="at.gv.egiz.eaaf.core.impl.idp.process.dao.ProcessInstanceStoreDAOImpl"/> - - <bean id="RequestStorage" - class="at.gv.egiz.eaaf.core.impl.idp.auth.RequestStorage"/> - - <bean id="simplePendingRequestIdGenerationStrategy" - class="at.gv.egiz.eaaf.core.impl.utils.SimplePendingRequestIdGenerationStrategy" /> - + 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"> + + <import resource="classpath:/spring/eaaf_utils.beans.xml"/> + + <bean id="TestAuthenticationDataBuilder" + class="at.gv.egiz.eaaf.core.impl.idp.auth.TestAuthenticationDataBuilder" /> + + <bean id="dummyAuthManager" + class="at.gv.egiz.eaaf.core.impl.idp.auth.DummyAuthManager" /> + + <bean id="dummyRevisionLogger" + class="at.gv.egiz.eaaf.core.impl.logging.DummyRevisionsLogger" /> + + <bean id="DummyProtocolAuthService" + class="at.gv.egiz.eaaf.core.impl.idp.module.test.DummyProtocolAuthService" /> + + <bean id="DummyTransactionStorage" + class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.DummyTransactionStorage" /> + + <bean id="DummyStatusMessager" + class="at.gv.egiz.eaaf.core.impl.logging.DummyStatusMessager" /> + + <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="moduleRegistration" + class="at.gv.egiz.eaaf.core.impl.idp.auth.modules.ModuleRegistration" /> + + <bean id="ProcessInstanceStoreage" + class="at.gv.egiz.eaaf.core.impl.idp.process.dao.ProcessInstanceStoreDaoImpl" /> + + <bean id="RequestStorage" + class="at.gv.egiz.eaaf.core.impl.idp.auth.RequestStorage" /> + + <bean id="simplePendingRequestIdGenerationStrategy" + class="at.gv.egiz.eaaf.core.impl.utils.SimplePendingRequestIdGenerationStrategy" /> + </beans> diff --git a/eaaf_core/src/test/resources/SpringTest-context_eaaf_core.xml b/eaaf_core/src/test/resources/SpringTest-context_eaaf_core.xml index 523e9fc7..295bf151 100644 --- a/eaaf_core/src/test/resources/SpringTest-context_eaaf_core.xml +++ b/eaaf_core/src/test/resources/SpringTest-context_eaaf_core.xml @@ -1,20 +1,22 @@ <?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"> + 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"> + + <import resource="classpath:/spring/eaaf_utils.beans.xml"/> + + <bean id="TestAuthenticationDataBuilder" + class="at.gv.egiz.eaaf.core.impl.idp.auth.TestAuthenticationDataBuilder" /> + + + <!-- Dummy test classes --> + <bean id="DummyConfig" + class="at.gv.egiz.eaaf.core.impl.idp.module.test.DummyConfiguration" /> - <bean id="TestAuthenticationDataBuilder" - class="at.gv.egiz.eaaf.core.impl.idp.auth.TestAuthenticationDataBuilder"/> - - - <!-- Dummy test classes --> - <bean id="DummyConfig" - class="at.gv.egiz.eaaf.core.impl.idp.module.test.DummyConfiguration"/> - </beans> diff --git a/eaaf_core/src/test/resources/log4j.xml b/eaaf_core/src/test/resources/log4j.xml index 90e3c763..83d8b703 100644 --- a/eaaf_core/src/test/resources/log4j.xml +++ b/eaaf_core/src/test/resources/log4j.xml @@ -1,19 +1,21 @@ <?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> +<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> + <root> + <priority value="info" /> + <appender-ref ref="consoleAppender" /> + </root> </log4j:configuration> diff --git a/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionForSAML1Authentication.xml b/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionForSAML1Authentication.xml index 2eec2b70..da3955e6 100644 --- a/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionForSAML1Authentication.xml +++ b/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionForSAML1Authentication.xml @@ -1,61 +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 + 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 index 70c14c5d..0ca780d5 100644 --- a/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionWithExpression1.xml +++ b/eaaf_core/src/test/resources/process/spring/test/SampleProcessDefinitionWithExpression1.xml @@ -1,22 +1,27 @@ <?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: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:Task id="task1" /> + <pd:Task id="task2" /> + <pd:Task id="task3" /> + <pd:Task id="task4" /> - <pd:StartEvent id="start" /> - <pd:EndEvent id="end" /> + <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: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 index ebbd89e9..d47ed8b3 100644 --- a/eaaf_core/src/test/resources/process/spring/test/SpringExpressionAwareProcessEngineTest-context.xml +++ b/eaaf_core/src/test/resources/process/spring/test/SpringExpressionAwareProcessEngineTest-context.xml @@ -1,57 +1,58 @@ <?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="StopProcessFlagTask" - class="at.gv.egiz.eaaf.core.impl.idp.process.test.StopProcessFlagTask"/> - - <bean id="ThrowExceptionTask" - class="at.gv.egiz.eaaf.core.impl.idp.process.test.ThrowExceptionTask"/> - - <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"/> - + 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="StopProcessFlagTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.test.StopProcessFlagTask" /> + + <bean id="ThrowExceptionTask" + class="at.gv.egiz.eaaf.core.impl.idp.process.test.ThrowExceptionTask" /> + + <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 index ebf72e41..111a00c4 100644 --- a/eaaf_core/src/test/resources/process/spring/test/SpringExpressionEvaluatorTest-context.xml +++ b/eaaf_core/src/test/resources/process/spring/test/SpringExpressionEvaluatorTest-context.xml @@ -1,17 +1,18 @@ <?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"> + 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" /> + <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 index 3973a784..828727c0 100644 --- 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 @@ -1,55 +1,115 @@ <?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:SignatureValue> - NPpRwVo5/5kf5iHUyaEc7d7So3W4oPgOCYNgnKpgdZfttFkFFN+9oG60w7YvKEYSeTPhP3zp7eaH -ZFapj+naD+wd0y5ELWep9Y+s+qP7fNLrFECHQxQasLWtR4akxlWDpYQ0bvOuepK2ip1EQ6pRlccA -wJ1l4iOWFhfdA9YAg5QLkBqWSwgrNUswhLnDBM+Ot6Gj5g2rpYY7aoAOXvTR8B5Dkg94ASb4u0wv -VPV8+4mjOfP+l6QWLqywzcq3qj/qFZkbujjZbV/fNPDnDD1ff/M6ZfCGO8xzlYfjfEA7cmHuiJf2 -/ey/3nT7vI5XbpBPWChT5Sl4DQysxlfE6e4MZw== - </dsig:SignatureValue><dsig:KeyInfo><dsig:X509Data><dsig:X509Certificate>MIIF3TCCBMWgAwIBAgIDByniMA0GCSqGSIb3DQEBBQUAMIGfMQswCQYDVQQGEwJBVDFIMEYGA1UECgw/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0MFQGA1UdIARNMEswSQYGKigAEQESMD8wPQYIKwYBBQUHAgEWMWh0dHA6Ly93d3cuYS10cnVzdC5hdC9kb2NzL2NwL2Etc2lnbi1BbXRzc2lnbmF0dXIwgZ4GA1UdHwSBljCBkzCBkKCBjaCBioaBh2xkYXA6Ly9sZGFwLmEtdHJ1c3QuYXQvb3U9YS1zaWduLWNvcnBvcmF0ZS1saWdodC0wMixvPUEtVHJ1c3QsYz1BVD9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0P2Jhc2U/b2JqZWN0Y2xhc3M9ZWlkQ2VydGlmaWNhdGlvbkF1dGhvcml0eTARBgNVHQ4ECgQITAgOnhr0tbowDgYDVR0PAQH/BAQDAgSwMCAGA1UdEQQZMBeBFW1hcmN1cy5oaWxkQGRzay5ndi5hdDAJBgNVHRMEAjAAMA4GByooAAoBBwEEAwEB/zAUBgcqKAAKAQEBBAkMB0JTQi1EU0swDQYJKoZIhvcNAQEFBQADggEBAHTklnvPCH/bJSOlIPbLUEkSGuFHsektSZ8Vr22x/Yv7EzsxoQrJIiz2mQ2gQqFuExdWYxvsowjiSbiis9iUf1c0zscvDS3mIZxGs4M89XHsjHnIyb+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 + 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:SignatureValue> + NPpRwVo5/5kf5iHUyaEc7d7So3W4oPgOCYNgnKpgdZfttFkFFN+9oG60w7YvKEYSeTPhP3zp7eaH + ZFapj+naD+wd0y5ELWep9Y+s+qP7fNLrFECHQxQasLWtR4akxlWDpYQ0bvOuepK2ip1EQ6pRlccA + wJ1l4iOWFhfdA9YAg5QLkBqWSwgrNUswhLnDBM+Ot6Gj5g2rpYY7aoAOXvTR8B5Dkg94ASb4u0wv + VPV8+4mjOfP+l6QWLqywzcq3qj/qFZkbujjZbV/fNPDnDD1ff/M6ZfCGO8xzlYfjfEA7cmHuiJf2 + /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sig: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 index 1859f3a9..910bd6d6 100644 --- a/eaaf_core/src/test/resources/process/spring/test/task/SAML1Assertion.xml +++ b/eaaf_core/src/test/resources/process/spring/test/task/SAML1Assertion.xml @@ -1,490 +1,721 @@ <?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: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 -CAYGBACORgEBMAoGCCsGAQUFBwsBMHsGCCsGAQUFBwEBBG8wbTBCBggrBgEF -BQcwAoY2aHR0cDovL3d3dy5hLXRydXN0LmF0L2NlcnRzL2Etc2lnbi1QcmVt -aXVtLVNpZy0wMmEuY3J0MCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC5hLXRy -dXN0LmF0L29jc3AwWQYDVR0gBFIwUDBEBgYqKAARAQswOjA4BggrBgEFBQcC -ARYsaHR0cDovL3d3dy5hLXRydXN0LmF0L2RvY3MvY3AvYS1zaWduLVByZW1p -dW0wCAYGBACLMAEBMIGaBgNVHR8EgZIwgY8wgYyggYmggYaGgYNsZGFwOi8v -bGRhcC5hLXRydXN0LmF0L291PWEtc2lnbi1QcmVtaXVtLVNpZy0wMixvPUEt -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> - </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+h5hRGQUUo5LYPywjg7zPxe8SGGA== -</dsig:SignatureValue> - <dsig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dC5hdC9jZXJ0cy9h -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 -bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMR4wHAYDVQQLDBVhLXNpZ24tUHJl -bWl1bS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CMAAwDQYJKoZIhvcNAQEFBQADggEBAFkSCJE0YD4p -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: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> + <d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9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0P2Jhc2U/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> + </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+h5hRGQUUo5LYPywjg7zPxe8SGGA== + </dsig:SignatureValue> + <dsig:KeyInfo> + <dsig:X509Data> + <dsig:X509Certificate> + MIIFZTCCBE2gAwIBAgIDAt4cMA0GCSqGSIb3DQEBBQUAMIGfMQswCQYDVQQGEwJB + VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp + bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMSIwIAYDVQQLDBlhLXNpZ24tY29y + cG9yYXRlLWxpZ2h0LTAzMSIwIAYDVQQDDBlhLXNpZ24tY29ycG9yYXRlLWxpZ2h0 + LTAzMB4XDTA3MDExOTA5MDY0OFoXDTEyMDExOTA5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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 + bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMR4wHAYDVQQLDBVhLXNpZ24tUHJl + bWl1bS1TaWctMDIxHjAcBgNVBAMMFWEtc2lnbi1QcmVtaXVtLVNpZy0wMjAeFw0w + NjA0MDQwOTUyMjhaFw0xMTA0MDQwOTUyMjhaMGkxCzAJBgNVBAYTAkFUMRUwEwYD + VQQDDAxUaG9tYXMgS25hbGwxDjAMBgNVBAQMBUtuYWxsMQ8wDQYDVQQqDAZUaG9t + YXMxFTATBgNVBAUTDDUzNTE5ODkyMzM0OTELMAkGA1UEDAwCREkwSTATBgcqhkjO + PQIBBggqhkjOPQMBAQMyAARrnYW5sXCQ6M3irWaanDPi/ROXueKWiPRyZGjNH0Cp +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WcKBLSSUqOt9D/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 index 0879d2e1..dfe97f17 100644 --- a/eaaf_core/src/test/resources/process/spring/test/task/SignedAuthBlock.xml +++ b/eaaf_core/src/test/resources/process/spring/test/task/SignedAuthBlock.xml @@ -1,182 +1,287 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - --> +<!-- --> -<dsig:Signature Id="signature-1216050695-35956125-21395" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"> +<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: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+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nYYGL6 + 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 + 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 index 18c2f7ed..89e9f6e1 100644 --- a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_MultipleStartEvents.xml +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_MultipleStartEvents.xml @@ -1,25 +1,24 @@ <?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: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:StartEvent id="start1" /> - <tns:Task id="task1" class="HelloWorldTask" /> - <tns:Task id="task2" async="true" class="HalloWeltTask" /> - <tns:Task id="task3" /> + <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: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: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 index ec3e76ae..bcf80ad4 100644 --- a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_NoStartEvents.xml +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_NoStartEvents.xml @@ -1,19 +1,17 @@ <?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: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:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> - <tns:EndEvent id="end" /> + <tns:EndEvent id="end" /> + + <tns:Transition from="task1" to="task2" /> + <tns:Transition from="task2" to="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 index 758507b9..aaee6a87 100644 --- a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionLoop.xml +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionLoop.xml @@ -1,24 +1,23 @@ <?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: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:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> - <tns:StartEvent id="start" /> - <tns:EndEvent id="end" /> + <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 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" /> - <!-- 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 index 302f180c..ea789adb 100644 --- a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionRefsTransition.xml +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionRefsTransition.xml @@ -1,22 +1,22 @@ <?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: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:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> - <tns:StartEvent id="start" /> - <tns:EndEvent id="end" /> + <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: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 index 41d693cd..04f46564 100644 --- a/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionStartsFromEndEvent.xml +++ b/eaaf_core/src/test/resources/process/test/InvalidProcessDefinition_TransitionStartsFromEndEvent.xml @@ -1,22 +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: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:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> - <tns:StartEvent id="start" /> - <tns:EndEvent id="end" /> + <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: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 index 96773d2d..cdbcb7be 100644 --- a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition1.xml +++ b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition1.xml @@ -1,21 +1,20 @@ <?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: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:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" /> - <tns:StartEvent id="start" /> - <tns:EndEvent id="end" /> + <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 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 index 03477de5..d0878038 100644 --- a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition2.xml +++ b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition2.xml @@ -1,24 +1,23 @@ <?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: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:StartEvent id="start" /> - <tns:Task id="task1" class="HelloWorldTask" /> - <tns:Task id="task2" async="true" class="HelloWorldTask" /> - <tns:Task id="task3" /> + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" async="true" class="HelloWorldTask" /> + <tns:Task id="task3" /> - <tns:EndEvent id="end" /> + <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: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> diff --git a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition3.xml b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition3.xml index ef6999cf..36887069 100644 --- a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition3.xml +++ b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition3.xml @@ -1,24 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - --> +<!-- --> -<tns:ProcessDefinition - id="SampleProcess3" - 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:ProcessDefinition id="SampleProcess3" + 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:StartEvent id="start" /> - <tns:Task id="task1" class="NotExistTaskdTask" /> - <tns:Task id="task2" async="true" class="HelloWorldTask" /> - <tns:Task id="task3" /> + <tns:Task id="task1" class="NotExistTaskdTask" /> + <tns:Task id="task2" async="true" class="HelloWorldTask" /> + <tns:Task id="task3" /> - <tns:EndEvent id="end" /> + <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: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> diff --git a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition4.xml b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition4.xml index c88afd05..65dfc90b 100644 --- a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition4.xml +++ b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition4.xml @@ -1,24 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - --> +<!-- --> -<tns:ProcessDefinition - id="SampleProcess4" - 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:ProcessDefinition id="SampleProcess4" + 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:StartEvent id="start" /> - <tns:Task id="task1" class="HelloWorldTask" /> - <tns:Task id="task2" class="ThrowExceptionTask" /> - <tns:Task id="task3" /> + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" class="ThrowExceptionTask" /> + <tns:Task id="task3" /> - <tns:EndEvent id="end" /> + <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: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> diff --git a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition5.xml b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition5.xml index e0072e62..5142ec61 100644 --- a/eaaf_core/src/test/resources/process/test/SampleProcessDefinition5.xml +++ b/eaaf_core/src/test/resources/process/test/SampleProcessDefinition5.xml @@ -1,24 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - --> +<!-- --> -<tns:ProcessDefinition - id="SampleProcess5" - 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:ProcessDefinition id="SampleProcess5" + 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:StartEvent id="start" /> - <tns:Task id="task1" class="HelloWorldTask" /> - <tns:Task id="task2" class="StopProcessFlagTask" /> - <tns:Task id="task3" class="ThrowExceptionTask" /> + <tns:Task id="task1" class="HelloWorldTask" /> + <tns:Task id="task2" class="StopProcessFlagTask" /> + <tns:Task id="task3" class="ThrowExceptionTask" /> - <tns:EndEvent id="end" /> + <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: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> |