|
From: <pe...@us...> - 2003-12-16 15:05:04
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv10766/src/java/org/neuclear/tests
Added Files:
AbstractObjectCreationTest.java
Log Message:
Added SignedMessage contract for signing simple textual contracts.
Added NeuSender, updated SmtpSender and Sender to take plain email addresses (without the mailto:)
Added AbstractObjectCreationTest to make it quicker to write unit tests to verify
NamedObjectBuilder/SignedNamedObject Pairs.
Sample application has been expanded with a basic email application.
Updated docs for sample web app.
Added missing LGPL LICENSE.txt files to signer and sample app
--- NEW FILE: AbstractObjectCreationTest.java ---
package org.neuclear.tests;
import org.neuclear.commons.NeuClearException;
import org.neuclear.xml.XMLException;
import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.id.builders.SignedMessageBuilder;
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
import java.security.GeneralSecurityException;
/**
* Created by IntelliJ IDEA.
* User: pelleb
* Date: Dec 16, 2003
* Time: 9:28:16 AM
* To change this template use Options | File Templates.
*/
public abstract class AbstractObjectCreationTest extends AbstractSigningTest {
public AbstractObjectCreationTest(final String string) throws NeuClearException, GeneralSecurityException {
super(string);
}
public void testCreateObject() throws NeuClearException, XMLException {
NamedObjectBuilder builder=createBuilder();
assertNotNull(builder);
assertTrue(NSTools.isNamedObject(builder.getElement()));
SignedNamedObject obj=builder.sign(getSigner());
assertNotNull(obj);
verifyObject(obj);
}
protected abstract void verifyObject(SignedNamedObject obj);
protected abstract NamedObjectBuilder createBuilder() throws NeuClearException;
}
|