org.davesag.generica.test
Class FaqPersistenceTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.davesag.generica.test.FaqPersistenceTest
All Implemented Interfaces:
Serializable, Test

public class FaqPersistenceTest
extends TestCase
implements Serializable

The FaqPersistenceTest tests that we can persist a Faq using either Hibernate or JDO, via the persistence framework.

Since:
Generica 1.0
Version:
CVS Revision $Id: FaqPersistenceTest.java,v 1.6 2004/04/06 15:40:41 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Archivist, Transaction, Faq, Serialized Form

Constructor Summary
FaqPersistenceTest()
          null constructor
FaqPersistenceTest(String name)
          constructor that takes a test name
 
Method Summary
 void setUp()
          set up the archivist
static Test suite()
          the test suite.
 void tearDown()
          close the archivist.
 void testCreateSaveEditLoadAndDeleteFaq()
          Tests that we can create a Faq and save it.
 void testCreateSaveEditLoadAndDeleteFaqUsingPeer()
          Tests that we can create a Faq and save it via the FaqPersistencePeer.
 void testInit()
          just tests that set up and tear down work okay.
 String toString()
          the test name
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FaqPersistenceTest

public FaqPersistenceTest()
null constructor


FaqPersistenceTest

public FaqPersistenceTest(String name)
constructor that takes a test name

Parameters:
name - the name of this suite of tests
Method Detail

testInit

public void testInit()
just tests that set up and tear down work okay.


testCreateSaveEditLoadAndDeleteFaq

public void testCreateSaveEditLoadAndDeleteFaq()
Tests that we can create a Faq and save it. Then tests that we can edit it, resave it, load it and delete it. So as to not clash with actual faqs in the database we are setting the Locale of our test Faqs to Locale.PRC.


testCreateSaveEditLoadAndDeleteFaqUsingPeer

public void testCreateSaveEditLoadAndDeleteFaqUsingPeer()
Tests that we can create a Faq and save it via the FaqPersistencePeer. Then tests that we can edit it, resave it, load it and delete it. So as to not clash with actual faqs in the database we are setting the Locale of our test Faqs to Locale.PRC.


setUp

public void setUp()
           throws Exception
set up the archivist

Throws:
Exception - if anything went wrong

tearDown

public void tearDown()
              throws Exception
close the archivist.

Throws:
Exception - if anything went wrong.

suite

public static Test suite()
the test suite.

Returns:
the suite of tests.

toString

public String toString()
the test name

Returns:
the test name


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.