org.exolab.jmscts.test.selector
Class StringTest

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.StringTest
All Implemented Interfaces:
ConnectionFactoryTestCase, ConnectionTestCase, JMSTest, MessageTestCase, SendReceiveTestCase, SessionTestCase, junit.framework.Test

public class StringTest
extends AbstractSelectorTestCase

This class tests selectors containing string literals and objects

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

Constructor Summary
StringTest(java.lang.String name)
          Create an instance of this class for a specific test case
 
Method Summary
static junit.framework.Test suite()
          Sets up the test suite
 void testCaseComparison1()
          Verifies that string literals are case sensitive, using the selector 'abc' = 'ABC'.
 void testCaseComparison2()
          Verifies that string literals are case sensitive, using the selector 'abc' <> 'ABC'.
 void testCaseComparison3()
          Verifies that string literals are case sensitive when compared with string properties, using the selector Country = 'france', and the string property 'Country', with value 'France'.
 void testCheckSingleQuotes1()
          Verifies that string literals can contain embedded quotes, using the selector 'it''s' = 'it''s'.
 void testCheckSingleQuotes2()
          Verifies that the quotes are preserved in string literals with embedded quotes, using the selector 'it''s' = 'its'.
 void testEquals()
          Verifies that the selector 'abc' = 'abc' selects all messages
 void testEqualsProperty()
          Verifies that the selector Country = 'France' selects all messages, when the string property 'Country' is set, with value 'France'
 void testGreaterEquals1()
          Verifies that the selector 'abc' >= 'abc' throws InvalidSelectorException
 void testGreaterEquals2()
          Verifies that the selector dummy >= 'abc' throws InvalidSelectorException
 void testGreaterEquals3()
          Verifies that the selector 'abc' >= dummy throws InvalidSelectorException
 void testGreaterThan1()
          Verifies that the selector 'abc' > 'abc' throws InvalidSelectorException
 void testGreaterThan2()
          Verifies that the selector dummy > 'abc' throws InvalidSelectorException
 void testGreaterThan3()
          Verifies that the selector 'abc' > dummy throws InvalidSelectorException
 void testInvalid1()
          Verifies that the selector 'abc' throws InvalidSelectorException
 void testInvalid2()
          Verifies that the selector 'abc' = 'abc throws InvalidSelectorException
 void testInvalid3()
          Verifies that the selector 'abc' = abc' throws InvalidSelectorException
 void testInvalid4()
          Verifies that the selector 'abc = 'abc' throws InvalidSelectorException
 void testInvalid5()
          Verifies that the selector 'abc'''' = 'abc' throws InvalidSelectorException
 void testInvalid6()
          Verifies that the selector "abc" = "abc" throws InvalidSelectorException
 void testLessEquals1()
          Verifies that the selector 'abc' <= 'abc' throws InvalidSelectorException
 void testLessEquals2()
          Verifies that the selector dummy <= 'abc' throws InvalidSelectorException
 void testLessEquals3()
          Verifies that the selector 'abc' <= dummy throws InvalidSelectorException
 void testLessThan1()
          Verifies that the selector 'abc' < 'abc' throws InvalidSelectorException
 void testLessThan2()
          Verifies that the selector dummy < 'abc' throws InvalidSelectorException
 void testLessThan3()
          Verifies that the selector 'abc' < dummy throws InvalidSelectorException
 
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

StringTest

public StringTest(java.lang.String name)
Create an instance of this class for a specific test case
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

testEquals

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

testEqualsProperty

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

testCaseComparison1

public void testCaseComparison1()
                         throws java.lang.Exception
Verifies that string literals are case sensitive, using the selector 'abc' = 'ABC'. This shouldn't select any messages.
Throws:
java.lang.Exception - for any error

testCaseComparison2

public void testCaseComparison2()
                         throws java.lang.Exception
Verifies that string literals are case sensitive, using the selector 'abc' <> 'ABC'. This should select all messages.
Throws:
java.lang.Exception - for any error

testCaseComparison3

public void testCaseComparison3()
                         throws java.lang.Exception
Verifies that string literals are case sensitive when compared with string properties, using the selector Country = 'france', and the string property 'Country', with value 'France'. This should select no messages.
Throws:
java.lang.Exception - for any error

testCheckSingleQuotes1

public void testCheckSingleQuotes1()
                            throws java.lang.Exception
Verifies that string literals can contain embedded quotes, using the selector 'it''s' = 'it''s'. This should select all messages
Throws:
java.lang.Exception - for any error

testCheckSingleQuotes2

public void testCheckSingleQuotes2()
                            throws java.lang.Exception
Verifies that the quotes are preserved in string literals with embedded quotes, using the selector 'it''s' = 'its'. This should select no messages
Throws:
java.lang.Exception - for any error

testLessThan1

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

testLessThan2

public void testLessThan2()
                   throws java.lang.Exception
Verifies that the selector dummy < 'abc' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testLessThan3

public void testLessThan3()
                   throws java.lang.Exception
Verifies that the selector 'abc' < dummy throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testGreaterThan1

public void testGreaterThan1()
                      throws java.lang.Exception
Verifies that the selector 'abc' > 'abc' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testGreaterThan2

public void testGreaterThan2()
                      throws java.lang.Exception
Verifies that the selector dummy > 'abc' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testGreaterThan3

public void testGreaterThan3()
                      throws java.lang.Exception
Verifies that the selector 'abc' > dummy throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testLessEquals1

public void testLessEquals1()
                     throws java.lang.Exception
Verifies that the selector 'abc' <= 'abc' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testLessEquals2

public void testLessEquals2()
                     throws java.lang.Exception
Verifies that the selector dummy <= 'abc' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testLessEquals3

public void testLessEquals3()
                     throws java.lang.Exception
Verifies that the selector 'abc' <= dummy throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testGreaterEquals1

public void testGreaterEquals1()
                        throws java.lang.Exception
Verifies that the selector 'abc' >= 'abc' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testGreaterEquals2

public void testGreaterEquals2()
                        throws java.lang.Exception
Verifies that the selector dummy >= 'abc' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testGreaterEquals3

public void testGreaterEquals3()
                        throws java.lang.Exception
Verifies that the selector 'abc' >= dummy throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testInvalid1

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

testInvalid2

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

testInvalid3

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

testInvalid4

public void testInvalid4()
                  throws java.lang.Exception
Verifies that the selector 'abc = 'abc' throws InvalidSelectorException
Throws:
java.lang.Exception - for any error

testInvalid5

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

testInvalid6

public void testInvalid6()
                  throws java.lang.Exception
Verifies that the selector "abc" = "abc" throws InvalidSelectorException
Throws:
java.lang.Exception - for any error


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