org.davesag.generica.test
Class UserTest

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

public class UserTest
extends TestCase
implements Serializable

The UserTest is collection of all of the tests on User s and UserPeer s.

Since:
Generica 1.0
Version:
CVS Revision $Id: UserTest.java,v 1.18 2004/04/06 15:40:42 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Serialized Form

Field Summary
static Session SESSION
          the hibernate session
static SessionFactory SESSION_FACTORY
          the hibernate session factory
 
Constructor Summary
UserTest()
          null constructor
UserTest(String name)
          constructor that takes a test name
 
Method Summary
 void setUp()
          create the hibernnate session factory and open the session.
static Test suite()
          test suite
 void tearDown()
          close the hibernate session
 void testCreateExistsLoginEditAndDeleteUser()
          Tests that we can create a user, that they then exist, that we can log in as them, edit them resave them and then delete them.
 void testInit()
          just tests that set up and tear down work okay.
 void testLoadAll()
          creates 4 users, tests that we calload them with various sort orders then deletes them again.
 String toString()
          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
 

Field Detail

SESSION_FACTORY

public static SessionFactory SESSION_FACTORY
the hibernate session factory


SESSION

public static Session SESSION
the hibernate session

Constructor Detail

UserTest

public UserTest()
null constructor


UserTest

public UserTest(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.


testCreateExistsLoginEditAndDeleteUser

public void testCreateExistsLoginEditAndDeleteUser()
Tests that we can create a user, that they then exist, that we can log in as them, edit them resave them and then delete them. Finally tests that they are properly deleted.


testLoadAll

public void testLoadAll()
creates 4 users, tests that we calload them with various sort orders then deletes them again.


setUp

public void setUp()
           throws Exception
create the hibernnate session factory and open the session.

Throws:
Exception - if anything went wrong

tearDown

public void tearDown()
              throws Exception
close the hibernate session

Throws:
Exception - if anything went wrong

suite

public static Test suite()
test suite

Returns:
suite of tests

toString

public String toString()
test name

Returns:
name of test


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