Class SelectorTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
All Implemented Interfaces:
junit.framework.Test

public class SelectorTest extends PTPTestCase
Test the message selector features of JMS
Version:
$Id: SelectorTest.java,v 1.3 2007/10/02 14:59:35 csuconic Exp $
Author:
Jeff Mesnil (jmesnil@)
  • Field Summary

    Fields inherited from class org.objectweb.jtests.jms.framework.JMSTestCase

    admin, PROP_FILE_NAME, startServer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static junit.framework.Test
    Method to use this class in a Test suite
    void
    Test the BETWEEN condition in message selector.
    void
    Test that an empty string as a message selector indicates that there is no message selector for the message consumer.
    void
    Test the "=" condition in message selector.
    void
    Test the ">" condition in message selector.
    void
    Test that conversions that apply to the get methods for properties do not apply when a property is used in a message selector expression.
    void
    Test the IN condition in message selector.
    void
    Test that the JMS property JMSDeliveryMode is treated as having the values 'PERSISTENT' or 'NON_PERSISTENT' when used in a message selector (chapter 3.8.1.3).
    void
    Test the LIKE condition with '%' in the pattern.
    void
    Test the LIKE condition with '_' in the pattern.
    void
    Test the LIKE ...
    void
    Test the "<>" (not equal) condition in message selector.
    void
    Test the NULL value in message selector.
    void
    Test the message selector using the filter example provided by the JMS specifications.
    void
    Tats that String literals are well handled by the message selector.

    Methods inherited from class org.objectweb.jtests.jms.framework.PTPTestCase

    setUp, tearDown

    Methods inherited from class org.objectweb.jtests.jms.framework.JMSTestCase

    fail, getProviderProperties

    Methods inherited from class junit.framework.TestCase

    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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SelectorTest

      public SelectorTest(String name)
  • Method Details

    • testEmptyStringAsSelector

      public void testEmptyStringAsSelector() throws Exception
      Test that an empty string as a message selector indicates that there is no message selector for the message consumer.
      Throws:
      Exception
    • testStringLiterals

      public void testStringLiterals() throws Exception
      Tats that String literals are well handled by the message selector.
      • "string = 'literal''s;" is true for "literal's" and false for "literal"
      Throws:
      Exception
    • testJMSDeliveryModeInSelector

      public void testJMSDeliveryModeInSelector() throws Exception
      Test that the JMS property JMSDeliveryMode is treated as having the values 'PERSISTENT' or 'NON_PERSISTENT' when used in a message selector (chapter 3.8.1.3).
      Throws:
      Exception
    • testIdentifierConversion

      public void testIdentifierConversion() throws Exception
      Test that conversions that apply to the get methods for properties do not apply when a property is used in a message selector expression. Based on the example of chapter 3.8.1.1 about identifiers.
      Throws:
      Exception
    • testSelectorExampleFromSpecs

      public void testSelectorExampleFromSpecs() throws Exception
      Test the message selector using the filter example provided by the JMS specifications.
      • "JMSType = 'car' AND color = 'blue' AND weight > 2500"
      Throws:
      Exception
    • testGreaterThan

      public void testGreaterThan() throws Exception
      Test the ">" condition in message selector.
      • "weight > 2500" is true for 3000 and false for 1000
      Throws:
      Exception
    • testEquals

      public void testEquals() throws Exception
      Test the "=" condition in message selector.
      • "weight = 2500" is true for 2500 and false for 1000
      Throws:
      Exception
    • testNotEquals

      public void testNotEquals() throws Exception
      Test the "<>" (not equal) condition in message selector.
      • "weight <> 2500" is true for 1000 and false for 2500
      Throws:
      Exception
    • testBetween

      public void testBetween() throws Exception
      Test the BETWEEN condition in message selector.
      • "age BETWEEN 15 and 19" is true for 17 and false for 20
      Throws:
      Exception
    • testIn

      public void testIn() throws Exception
      Test the IN condition in message selector.
      • "Country IN ('UK', 'US', 'France')" is true for 'UK' and false for 'Peru'
      Throws:
      Exception
    • testLikeEscape

      public void testLikeEscape() throws Exception
      Test the LIKE ... ESCAPE condition in message selector
      • "underscored LIKE '\_%' ESCAPE '\'" is true for '_foo' and false for 'bar'
      Throws:
      Exception
    • testLike_2

      public void testLike_2() throws Exception
      Test the LIKE condition with '_' in the pattern.
      • "word LIKE 'l_se'" is true for 'lose' and false for 'loose'
      Throws:
      Exception
    • testLike_1

      public void testLike_1() throws Exception
      Test the LIKE condition with '%' in the pattern.
      • "phone LIKE '12%3'" is true for '12993' and false for '1234'
      Throws:
      Exception
    • testNull

      public void testNull() throws Exception
      Test the NULL value in message selector.
      • "prop IS NULL"
      Throws:
      Exception
    • suite

      public static junit.framework.Test suite()
      Method to use this class in a Test suite