org.exolab.jmscts.test.selector
Class FloatTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--org.exolab.jmscts.core.JMSTestCase
                    |
                    +--org.exolab.jmscts.core.AbstractConnectionFactoryTestCase
                          |
                          +--org.exolab.jmscts.core.AbstractConnectionTestCase
                                |
                                +--org.exolab.jmscts.core.AbstractSessionTestCase
                                      |
                                      +--org.exolab.jmscts.core.AbstractMessageTestCase
                                            |
                                            +--org.exolab.jmscts.core.AbstractSendReceiveTestCase
                                                  |
                                                  +--org.exolab.jmscts.test.selector.AbstractSelectorTestCase
                                                        |
                                                        +--org.exolab.jmscts.test.selector.FloatTest
All Implemented Interfaces:
ConnectionFactoryTestCase, ConnectionTestCase, JMSTest, MessageTestCase, SendReceiveTestCase, SessionTestCase, junit.framework.Test

public class FloatTest
extends AbstractSelectorTestCase

This class tests selectors containing floating point literals and objects.

Version:
$Revision: 1.7 $
Author:
Tim Anderson
See Also:
AbstractSelectorTestCase

Constructor Summary
FloatTest(java.lang.String name)
          Create an instance of this class for a specific test case, testing against all delivery types
 
Method Summary
static junit.framework.Test suite()
          Sets up the test suite
 void testDivisionByZero()
          Verifies that the selector 10 / zero = 10 / zero selects all messages, when the double property 'zero' is set, with value 0.0
 void testDoubleNaN1()
          Verifies that the selector doubleNaN = doubleNaN selects no messages, when the double property 'doubleNaN' is set, with value Double.NaN (as NaN != NaN)
 void testDoubleNaN2()
          Verifies that the selector doubleNaN <> doubleNaN selects all messages, when the double property 'doubleNaN' is set, with value Double.NaN
 void testEquals1()
          Verifies that the selector 0.0 = 0.0 selects all messages
 void testEquals2()
          Verifies that the selector 0.0 = 1.0 selects no messages
 void testEquals3()
          Verifies that the selector 0.2 = 0.2 selects all messages
 void testEquals4()
          Verifies that the selector 0.2 = 0.0 selects no messages
 void testEquals5()
          Verifies that the selector 92d = 92 selects all messages
 void testEquals6()
          Verifies that the selector 93f = 93 selects all messages
 void testEqualsProperty()
          Verifies that the selector rate = 0.2 selects all messages, when the double property 'rate' is set, with value 0.2
 void testFloatNaN1()
          Verifies that the selector floatNaN = floatNaN selects no messages, when the float property 'floatNaN' is set, with value Float.NaN (as NaN != NaN)
 void testFloatNaN2()
          Verifies that the selector floatNaN <> floatNaN selects all messages, when the float property 'floatNaN' is set, with value Float.NaN
 void testGreaterEquals1()
          Verifies that the selector 2.0 >= 1.0 selects all messages
 void testGreaterEquals2()
          Verifies that the selector 1.0 >= 2.0 selects no messages
 void testGreaterThan1()
          Verifies that the selector 2.0 > 1.0 selects all messages
 void testGreaterThan2()
          Verifies that the selector 1.0 > 2.0 selects no messages
 void testInvalid1()
          Verifies that the selector 1.0 throws InvalidSelectorException
 void testInvalid2()
          Verifies that the selector -1.0 throws InvalidSelectorException
 void testInvalid3()
          Verifies that the selector 2.0 < '3.0' throws InvalidSelectorException
 void testInvalid4()
          Verifies that the selector 1.0 <> false throws InvalidSelectorException
 void testInvalid5()
          Verifies that the selector 1a.0 = 1a.0 throws InvalidSelectorException
 void testLessEquals1()
          Verifies that the selector 1.0 <= 2.0 selects all messages
 void testLessEquals2()
          Verifies that the selector 2.0 <= 1.0 selects no messages
 void testLessThan1()
          Verifies that the selector 1.0 < 2.0 selects all messages
 void testLessThan2()
          Verifies that the selector 2.0 < 1.0 selects no messages
 void testNotEquals1()
          Verifies that the selector 1.0 <> 2.0 selects all messages
 void testNotEquals2()
          Verifies that the selector 1.0 <> 1.0 selects no messages
 void testNotEquals3()
          Verifies that the selector 1.0 <> 1.0 selects all messages
 void testNotEqualsProperty()
          Verifies that the selector rate <> 0.2 selects no messages, when the double property 'rate' is set, with value 0.2
 void testNumericRange()
          Verifies that selectors can have approximate numeric literals in the range Double.MIN_VALUE..Double.MAX_VALUE, using the selector {min-value}={min-value} and {max-value} = {max-value} where {min-value} and {max-value} are the values of Double.MIN_VALUE and Double.MAX_VALUE respectively.
 void testUnaryMinus1()
          Verifies that the selector -1.0 = -1.0 selects all messages
 void testUnaryMinus2()
          Verifies that the selector -1.0 = 1.0 selects no messages
 void testUnaryMinus3()
          Verifies that the selector --1.0 = 1.0 selects all messages
 void testUnsetProperty1()
          Verifies that the selector dummy + 10.0 = 10.0 selects no messages, for the unset property 'dummy'
 void testUnsetProperty2()
          Verifies that the selector dummy - 10.0 = -10.0 selects no messages, for the unset property 'dummy'
 void testUnsetProperty3()
          Verifies that the selector 10.0 + dummy = 10.0 selects no messages, for the unset property 'dummy'
 void testUnsetProperty4()
          Verifies that the selector 10.0 - dummy = 0.0 selects no messages, for the unset property 'dummy'
 void testUnsetProperty5()
          Verifies that the selector dummy * 10.0 = 0.0 selects no messages, for the unset property 'dummy'
 void testUnsetProperty6()
          Verifies that the selector 10.0 * dummy = 0.0 selects no messages, for the unset property 'dummy'
 void testUnsetProperty7()
          Verifies that the selector dummy / 10.0 = 0.0 selects no messages, for the unset property 'dummy'
 void testUnsetProperty8()
          Verifies that the selector 10.0 / dummy = 0.0 selects no messages, for the unset property 'dummy'
 
Methods inherited from class org.exolab.jmscts.test.selector.AbstractSelectorTestCase
checkInvalidSelector, checkSelector, checkSelector, getDestinations, getMessagePopulator
 
Methods inherited from class org.exolab.jmscts.core.AbstractSendReceiveTestCase
close, close, close, close, createReceiver, createReceiver, createReceivers, createReceivers, createSender, createSender, createSenders, createSenders, getDeliveryTypes, getDestination, getDurableOnly, receive, receive, receive, receive, receive, receive, recreate, send, send, send, send, send, send, send, send, sendReceive, sendReceive, setDestinations
 
Methods inherited from class org.exolab.jmscts.core.AbstractMessageTestCase
getMessageTypes, shouldCreateMessage, startConnection
 
Methods inherited from class org.exolab.jmscts.core.AbstractSessionTestCase
getAckTypes
 
Methods inherited from class org.exolab.jmscts.core.AbstractConnectionTestCase
setClientID
 
Methods inherited from class org.exolab.jmscts.core.AbstractConnectionFactoryTestCase
getConnectionFactoryTypes
 
Methods inherited from class org.exolab.jmscts.core.JMSTestCase
getContext, getRequirements, setContext, share
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
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
 
Methods inherited from interface org.exolab.jmscts.core.MessageTestCase
getMessageTypes, shouldCreateMessage, startConnection
 
Methods inherited from interface org.exolab.jmscts.core.SessionTestCase
getAckTypes
 
Methods inherited from interface org.exolab.jmscts.core.ConnectionTestCase
setClientID
 
Methods inherited from interface org.exolab.jmscts.core.ConnectionFactoryTestCase
getConnectionFactoryTypes
 
Methods inherited from interface org.exolab.jmscts.core.JMSTest
getContext, setContext, share
 
Methods inherited from interface junit.framework.Test
countTestCases, run
 

Constructor Detail

FloatTest

public FloatTest(java.lang.String name)
Create an instance of this class for a specific test case, testing against all delivery types
Parameters:
name - the name of test case
Method Detail

suite

public static junit.framework.Test suite()
Sets up the test suite
Returns:
an instance of this class that may be run by JMSTestRunner

testEquals1

public void testEquals1()
                 throws java.lang.Exception
Verifies that the selector 0.0 = 0.0 selects all messages
Throws:
java.lang.Exception - for any error

testEquals2

public void testEquals2()
                 throws java.lang.Exception
Verifies that the selector 0.0 = 1.0 selects no messages
Throws:
java.lang.Exception - for any error

testEquals3

public void testEquals3()
                 throws java.lang.Exception
Verifies that the selector 0.2 = 0.2 selects all messages
Throws:
java.lang.Exception - for any error

testEquals4

public void testEquals4()
                 throws java.lang.Exception
Verifies that the selector 0.2 = 0.0 selects no messages
Throws:
java.lang.Exception - for any error

testEquals5

public void testEquals5()
                 throws java.lang.Exception
Verifies that the selector 92d = 92 selects all messages
Throws:
java.lang.Exception - for any error

testEquals6

public void testEquals6()
                 throws java.lang.Exception
Verifies that the selector 93f = 93 selects all messages
Throws:
java.lang.Exception - for any error

testNotEquals1

public void testNotEquals1()
                    throws java.lang.Exception
Verifies that the selector 1.0 <> 2.0 selects all messages
Throws:
java.lang.Exception - for any error

testNotEquals2

public void testNotEquals2()
                    throws java.lang.Exception
Verifies that the selector 1.0 <> 1.0 selects no messages
Throws:
java.lang.Exception - for any error

testNotEquals3

public void testNotEquals3()
                    throws java.lang.Exception
Verifies that the selector 1.0 <> 1.0 selects all messages
Throws:
java.lang.Exception - for any error

testLessThan1

public void testLessThan1()
                   throws java.lang.Exception
Verifies that the selector 1.0 < 2.0 selects all messages
Throws:
java.lang.Exception - for any error

testLessThan2

public void testLessThan2()
                   throws java.lang.Exception
Verifies that the selector 2.0 < 1.0 selects no messages
Throws:
java.lang.Exception - for any error

testGreaterThan1

public void testGreaterThan1()
                      throws java.lang.Exception
Verifies that the selector 2.0 > 1.0 selects all messages
Throws:
java.lang.Exception - for any error

testGreaterThan2

public void testGreaterThan2()
                      throws java.lang.Exception
Verifies that the selector 1.0 > 2.0 selects no messages
Throws:
java.lang.Exception - for any error

testLessEquals1

public void testLessEquals1()
                     throws java.lang.Exception
Verifies that the selector 1.0 <= 2.0 selects all messages
Throws:
java.lang.Exception - for any error

testLessEquals2

public void testLessEquals2()
                     throws java.lang.Exception
Verifies that the selector 2.0 <= 1.0 selects no messages
Throws:
java.lang.Exception - for any error

testGreaterEquals1

public void testGreaterEquals1()
                        throws java.lang.Exception
Verifies that the selector 2.0 >= 1.0 selects all messages
Throws:
java.lang.Exception - for any error

testGreaterEquals2

public void testGreaterEquals2()
                        throws java.lang.Exception
Verifies that the selector 1.0 >= 2.0 selects no messages
Throws:
java.lang.Exception - for any error

testUnaryMinus1

public void testUnaryMinus1()
                     throws java.lang.Exception
Verifies that the selector -1.0 = -1.0 selects all messages
Throws:
java.lang.Exception - for any error

testUnaryMinus2

public void testUnaryMinus2()
                     throws java.lang.Exception
Verifies that the selector -1.0 = 1.0 selects no messages
Throws:
java.lang.Exception - for any error

testUnaryMinus3

public void testUnaryMinus3()
                     throws java.lang.Exception
Verifies that the selector --1.0 = 1.0 selects all messages
Throws:
java.lang.Exception - for any error

testEqualsProperty

public void testEqualsProperty()
                        throws java.lang.Exception
Verifies that the selector rate = 0.2 selects all messages, when the double property 'rate' is set, with value 0.2
Throws:
java.lang.Exception - for any error

testNotEqualsProperty

public void testNotEqualsProperty()
                           throws java.lang.Exception
Verifies that the selector rate <> 0.2 selects no messages, when the double property 'rate' is set, with value 0.2
Throws:
java.lang.Exception - for any error

testUnsetProperty1

public void testUnsetProperty1()
                        throws java.lang.Exception
Verifies that the selector dummy + 10.0 = 10.0 selects no messages, for the unset property 'dummy'
Throws:
java.lang.Exception - for any error

testUnsetProperty2

public void testUnsetProperty2()
                        throws java.lang.Exception
Verifies that the selector dummy - 10.0 = -10.0 selects no messages, for the unset property 'dummy'
Throws:
java.lang.Exception - for any error

testUnsetProperty3

public void testUnsetProperty3()
                        throws java.lang.Exception
Verifies that the selector 10.0 + dummy = 10.0 selects no messages, for the unset property 'dummy'
Throws:
java.lang.Exception - for any error

testUnsetProperty4

public void testUnsetProperty4()
                        throws java.lang.Exception
Verifies that the selector 10.0 - dummy = 0.0 selects no messages, for the unset property 'dummy'
Throws:
java.lang.Exception - for any error

testUnsetProperty5

public void testUnsetProperty5()
                        throws java.lang.Exception
Verifies that the selector dummy * 10.0 = 0.0 selects no messages, for the unset property 'dummy'
Throws:
java.lang.Exception - for any error

testUnsetProperty6

public void testUnsetProperty6()
                        throws java.lang.Exception
Verifies that the selector 10.0 * dummy = 0.0 selects no messages, for the unset property 'dummy'
Throws:
java.lang.Exception - for any error

testUnsetProperty7

public void testUnsetProperty7()
                        throws java.lang.Exception
Verifies that the selector dummy / 10.0 = 0.0 selects no messages, for the unset property 'dummy'
Throws:
java.lang.Exception - for any error

testUnsetProperty8

public void testUnsetProperty8()
                        throws java.lang.Exception
Verifies that the selector 10.0 / dummy = 0.0 selects no messages, for the unset property 'dummy'
Throws:
java.lang.Exception - for any error

testNumericRange

public void testNumericRange()
                      throws java.lang.Exception
Verifies that selectors can have approximate numeric literals in the range Double.MIN_VALUE..Double.MAX_VALUE, using the selector {min-value}={min-value} and {max-value} = {max-value} where {min-value} and {max-value} are the values of Double.MIN_VALUE and Double.MAX_VALUE respectively. This should select all messages.
Throws:
java.lang.Exception - for any error

testDivisionByZero

public void testDivisionByZero()
                        throws java.lang.Exception
Verifies that the selector 10 / zero = 10 / zero selects all messages, when the double property 'zero' is set, with value 0.0
Throws:
java.lang.Exception - for any error

testFloatNaN1

public void testFloatNaN1()
                   throws java.lang.Exception
Verifies that the selector floatNaN = floatNaN selects no messages, when the float property 'floatNaN' is set, with value Float.NaN (as NaN != NaN)
Throws:
java.lang.Exception - for any error

testFloatNaN2

public void testFloatNaN2()
                   throws java.lang.Exception
Verifies that the selector floatNaN <> floatNaN selects all messages, when the float property 'floatNaN' is set, with value Float.NaN
Throws:
java.lang.Exception - for any error

testDoubleNaN1

public void testDoubleNaN1()
                    throws java.lang.Exception
Verifies that the selector doubleNaN = doubleNaN selects no messages, when the double property 'doubleNaN' is set, with value Double.NaN (as NaN != NaN)
Throws:
java.lang.Exception - for any error

testDoubleNaN2

public void testDoubleNaN2()
                    throws java.lang.Exception
Verifies that the selector doubleNaN <> doubleNaN selects all messages, when the double property 'doubleNaN' is set, with value Double.NaN
Throws:
java.lang.Exception - for any error

testInvalid1

public void testInvalid1()
                  throws java.lang.Exception
Verifies that the selector 1.0 throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testInvalid2

public void testInvalid2()
                  throws java.lang.Exception
Verifies that the selector -1.0 throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testInvalid3

public void testInvalid3()
                  throws java.lang.Exception
Verifies that the selector 2.0 < '3.0' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testInvalid4

public void testInvalid4()
                  throws java.lang.Exception
Verifies that the selector 1.0 <> false throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testInvalid5

public void testInvalid5()
                  throws java.lang.Exception
Verifies that the selector 1a.0 = 1a.0 throws InvalidSelectorException
Throws:
java.lang.Exception - for any error


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.