Package org.hornetq.core.filter.impl

Examples of org.hornetq.core.filter.impl.Identifier


   public void testIds() throws Exception
   {
      FilterParserTest.log.trace("parse(a + b * c / d = e)");
      Operator result = (Operator)parser.parse(new SimpleString("a + b * c / d = e"), identifierMap);
      // 4 + 2 * 3 / 2 = 7
      Identifier a = identifierMap.get(new SimpleString("a"));
      a.setValue(new Long(4));
      Identifier b = identifierMap.get(new SimpleString("b"));
      b.setValue(new Long(2));
      Identifier c = identifierMap.get(new SimpleString("c"));
      c.setValue(new Long(3));
      Identifier d = identifierMap.get(new SimpleString("d"));
      d.setValue(new Long(2));
      Identifier e = identifierMap.get(new SimpleString("e"));
      e.setValue(new Long(7));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue("is true", bool.booleanValue());

   }
View Full Code Here


   public void testTrueINOperator() throws Exception
   {
      FilterParserTest.log.trace("parse(Status IN ('new', 'cleared', 'acknowledged'))");
      Operator result = (Operator)parser.parse(new SimpleString("Status IN ('new', 'cleared', 'acknowledged')"),
                                               identifierMap);
      Identifier a = identifierMap.get(new SimpleString("Status"));
      a.setValue(new SimpleString("new"));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue("is true", bool.booleanValue());
   }
View Full Code Here

   public void testFalseINOperator() throws Exception
   {
      FilterParserTest.log.trace("parse(Status IN ('new', 'cleared', 'acknowledged'))");
      Operator result = (Operator)parser.parse(new SimpleString("Status IN ('new', 'cleared', 'acknowledged')"),
                                               identifierMap);
      Identifier a = identifierMap.get(new SimpleString("Status"));
      a.setValue(new SimpleString("none"));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue("is false", !bool.booleanValue());
   }
View Full Code Here

   public void testTrueNOTINOperator() throws Exception
   {
      FilterParserTest.log.trace("parse(Status IN ('new', 'cleared', 'acknowledged'))");
      Operator result = (Operator)parser.parse(new SimpleString("Status NOT IN ('new', 'cleared', 'acknowledged')"),
                                               identifierMap);
      Identifier a = identifierMap.get(new SimpleString("Status"));
      a.setValue(new SimpleString("none"));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue(bool.booleanValue());
   }
View Full Code Here

   public void testFalseNOTINOperator() throws Exception
   {
      FilterParserTest.log.trace("parse(Status IN ('new', 'cleared', 'acknowledged'))");
      Operator result = (Operator)parser.parse(new SimpleString("Status NOT IN ('new', 'cleared', 'acknowledged')"),
                                               identifierMap);
      Identifier a = identifierMap.get(new SimpleString("Status"));
      a.setValue(new SimpleString("new"));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertFalse(bool.booleanValue());
   }
View Full Code Here

   public void testTrueOROperator() throws Exception
   {
      FilterParserTest.log.trace("parse((Status = 'new') OR (Status = 'cleared') OR (Status = 'acknowledged'))");
      Operator result = (Operator)parser.parse(new SimpleString("(Status = 'new') OR (Status = 'cleared') OR (Status= 'acknowledged')"),
                                               identifierMap);
      Identifier a = identifierMap.get(new SimpleString("Status"));
      a.setValue(new SimpleString("new"));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue("is true", bool.booleanValue());
   }
View Full Code Here

   public void testFalseOROperator() throws Exception
   {
      FilterParserTest.log.trace("parse((Status = 'new') OR (Status = 'cleared') OR (Status = 'acknowledged'))");
      Operator result = (Operator)parser.parse(new SimpleString("(Status = 'new') OR (Status = 'cleared') OR (Status = 'acknowledged')"),
                                               identifierMap);
      Identifier a = identifierMap.get(new SimpleString("Status"));
      a.setValue(new SimpleString("none"));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue("is false", !bool.booleanValue());
   }
View Full Code Here

   public void testIds() throws Exception
   {
      FilterParserTest.log.trace("parse(a + b * c / d = e)");
      Operator result = (Operator)parser.parse(new SimpleString("a + b * c / d = e"), identifierMap);
      // 4 + 2 * 3 / 2 = 7
      Identifier a = identifierMap.get(new SimpleString("a"));
      a.setValue(new Long(4));
      Identifier b = identifierMap.get(new SimpleString("b"));
      b.setValue(new Long(2));
      Identifier c = identifierMap.get(new SimpleString("c"));
      c.setValue(new Long(3));
      Identifier d = identifierMap.get(new SimpleString("d"));
      d.setValue(new Long(2));
      Identifier e = identifierMap.get(new SimpleString("e"));
      e.setValue(new Long(7));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue("is true", bool.booleanValue());

   }
View Full Code Here

   public void testTrueINOperator() throws Exception
   {
      FilterParserTest.log.trace("parse(Status IN ('new', 'cleared', 'acknowledged'))");
      Operator result = (Operator)parser.parse(new SimpleString("Status IN ('new', 'cleared', 'acknowledged')"),
                                               identifierMap);
      Identifier a = identifierMap.get(new SimpleString("Status"));
      a.setValue(new SimpleString("new"));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue("is true", bool.booleanValue());
   }
View Full Code Here

   public void testFalseINOperator() throws Exception
   {
      FilterParserTest.log.trace("parse(Status IN ('new', 'cleared', 'acknowledged'))");
      Operator result = (Operator)parser.parse(new SimpleString("Status IN ('new', 'cleared', 'acknowledged')"),
                                               identifierMap);
      Identifier a = identifierMap.get(new SimpleString("Status"));
      a.setValue(new SimpleString("none"));
      FilterParserTest.log.trace("result -> " + result);
      Boolean bool = (Boolean)result.apply();
      Assert.assertTrue("is false", !bool.booleanValue());
   }
View Full Code Here

TOP

Related Classes of org.hornetq.core.filter.impl.Identifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.