[java-identity-provider COMMIT] /trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/CryptoTransien...

noreply at shibboleth.net noreply at shibboleth.net
Sun Feb 2 12:20:10 EST 2014


Author: rdw
Date: Sun Feb  2 12:20:10 2014
New Revision: 5301

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5301&view=rev
Log:
why is svn whining about this file

Modified:
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/CryptoTransientDecoderTest.java

Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/CryptoTransientDecoderTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/CryptoTransientDecoderTest.java?rev=5301&r1=5300&r2=5301&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/CryptoTransientDecoderTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/CryptoTransientDecoderTest.java Sun Feb  2 12:20:10 2014
@@ -17,20 +17,6 @@
 
 package net.shibboleth.idp.saml.impl.nameid;
 
-import java.io.IOException;
-
-import net.shibboleth.idp.authn.SubjectCanonicalizationException;
-import net.shibboleth.idp.saml.nameid.NameDecoderException;
-import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
-import net.shibboleth.utilities.java.support.security.DataSealer;
-import net.shibboleth.utilities.java.support.security.DataSealerException;
-
-import org.opensaml.profile.ProfileException;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 
 /**
  * test for {@link CryptoTransientDecoder}.
@@ -45,102 +31,4 @@
 
     private final static String RECIPIENT = "https://sp.example.org/recipient";
 
-    private DataSealer dataSealer;
-
-    private CryptoTransientDecoder decoder;
-
-    /**
-     * Set up the data sealer. We take advantage of the fact that Spring a {@link ClassPathResource} wraps a files.
-     * 
-     * @throws IOException
-     * @throws DataSealerException
-     * @throws ComponentInitializationException
-     */
-    @BeforeClass public void setupDataSealer() throws IOException, DataSealerException,
-            ComponentInitializationException {
-
-        final Resource keyStore = new ClassPathResource("/net/shibboleth/idp/saml/impl/attribute/resolver/SealerKeyStore.jks");
-        Assert.assertTrue(keyStore.exists());
-
-        final String keyStorePath = keyStore.getFile().getAbsolutePath();
-
-        dataSealer = new DataSealer();
-        dataSealer.setCipherKeyAlias("secret");
-        dataSealer.setCipherKeyPassword("kpassword");
-
-        dataSealer.setKeystorePassword("password");
-        dataSealer.setKeystorePath(keyStorePath);
-
-        dataSealer.initialize();
-
-        decoder = new CryptoTransientDecoder();
-        decoder.setDataSealer(dataSealer);
-        decoder.setId("Decoder");
-        decoder.initialize();
-    }
-
-    private String code(String principalName, String attributeIssuerID, String attributeRecipientID, long timeout)
-            throws DataSealerException {
-        final String principalTokenId =
-                new StringBuilder().append(attributeIssuerID).append("!").append(attributeRecipientID).append("!")
-                        .append(principalName).toString();
-        return dataSealer.wrap(principalTokenId, System.currentTimeMillis() + timeout);
-    }
-
-    private String code(String principalName, String attributeIssuerID, String attributeRecipientID)
-            throws DataSealerException {
-        return code(principalName, attributeIssuerID, attributeRecipientID, TIMEOUT);
-    }
-
-    @Test public void testSucess() throws ProfileException, ComponentInitializationException, IOException,
-            DataSealerException {
-        String ct = code(PRINCIPAL, ISSUER, RECIPIENT);
-
-        Assert.assertEquals(decoder.decode(ct, ISSUER, RECIPIENT), PRINCIPAL);
-    }
-
-    @Test(expectedExceptions = {NameDecoderException.class,}) public void noTransient()
-            throws SubjectCanonicalizationException, NameDecoderException {
-        decoder.decode(null, ISSUER, RECIPIENT);
-    }
-
-    @Test(expectedExceptions = {NameDecoderException.class,}) public void timeout()
-            throws SubjectCanonicalizationException, DataSealerException, NameDecoderException {
-        String ct = code(PRINCIPAL, ISSUER, RECIPIENT, -10);
-
-        decoder.decode(ct, ISSUER, RECIPIENT);
-    }
-
-    @Test(expectedExceptions = {NameDecoderException.class,}) public void baddata()
-            throws SubjectCanonicalizationException, DataSealerException, NameDecoderException {
-        String ct = code(PRINCIPAL, ISSUER, RECIPIENT);
-
-        decoder.decode(ct.toUpperCase(), ISSUER, RECIPIENT);
-    }
-
-    @Test(expectedExceptions = {SubjectCanonicalizationException.class,}) public void baddata2()

[... 26 lines stripped ...]


More information about the commits mailing list