name.angoca.db2sa.core.lexical.model
Class TokenTest

Package class diagram package TokenTest
java.lang.Object
  extended by name.angoca.db2sa.core.lexical.model.TokenTest

public final class TokenTest
extends Object

This class tests the Token object and its principal methods.

Control Version

Version:
1.3.1 2010-05-14
Author:
Andres Gomez Casanova (AngocA)

Constructor Summary
TokenTest()
          Default constructor.
 
Method Summary
 void testCongruent()
          Tests if two consecutive calls returns the same value.
 void testCreation()
          A token cannot be a empty string.
 void testEqualsDifferentObject()
          Tests the equals method with two different objects.
 void testEqualsIdenticalObject()
          Tests the equals method with two identical objects.
 void testEqualsNull()
          Tests the equal method with a null value.
 void testHashCode()
          Tests that the hashcode is different to 1, 0 and -1.
 void testHashCodeDifferentObject()
          Tests that the hashcode of two different objects are different.
 void testHashCodeIdenticalObject()
          Test that the hashcode of two objects with the same parameters have the same hashcode.
 void testSimpleMethods()
          Tests the simple methods.
 void testSymmetric()
          Tests the symmetry of equals.
 void testTokenNullParam()
          Tests that the constructor cannot receive a null parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenTest

public TokenTest()
Default constructor.

Method Detail

testCongruent

public void testCongruent()
                   throws InvalidTokenException
Tests if two consecutive calls returns the same value.

Throws:
InvalidTokenException - Never.

testCreation

public void testCreation()
                  throws InvalidTokenException
A token cannot be a empty string.

Throws:
InvalidTokenException - Always, this method test this thrown.

testEqualsDifferentObject

public void testEqualsDifferentObject()
                               throws InvalidTokenException
Tests the equals method with two different objects.

Throws:
InvalidTokenException - Never.

testEqualsIdenticalObject

public void testEqualsIdenticalObject()
                               throws InvalidTokenException
Tests the equals method with two identical objects.

Throws:
InvalidTokenException - Never.

testEqualsNull

public void testEqualsNull()
                    throws InvalidTokenException
Tests the equal method with a null value.

Throws:
InvalidTokenException - Never.

testHashCode

public void testHashCode()
                  throws InvalidTokenException
Tests that the hashcode is different to 1, 0 and -1.

Throws:
InvalidTokenException - Never.

testHashCodeDifferentObject

public void testHashCodeDifferentObject()
                                 throws InvalidTokenException
Tests that the hashcode of two different objects are different.

Throws:
InvalidTokenException - Never.

testHashCodeIdenticalObject

public void testHashCodeIdenticalObject()
                                 throws InvalidTokenException
Test that the hashcode of two objects with the same parameters have the same hashcode.

Throws:
InvalidTokenException - Never.

testSimpleMethods

public void testSimpleMethods()
                       throws InvalidTokenException
Tests the simple methods.

Throws:
InvalidTokenException - Never.

testSymmetric

public void testSymmetric()
                   throws InvalidTokenException
Tests the symmetry of equals.

Throws:
InvalidTokenException - Never

testTokenNullParam

public void testTokenNullParam()
                        throws InvalidTokenException
Tests that the constructor cannot receive a null parameter.

Throws:
InvalidTokenException - Never.


Andres Gomez Casanova (AngocA) 2009-2010 Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.