Package org.hornetq.core.filter.impl

Examples of org.hornetq.core.filter.impl.Operator.apply()


      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());
   }

   public void testTrueOROperator() throws Exception
   {
View Full Code Here


      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());
   }

   public void testFalseOROperator() throws Exception
   {
View Full Code Here

      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());
   }

   public void testInvalidSelector() throws Exception
   {
View Full Code Here

      {
         FilterParserTest.log.trace("parse(weight > 2500)");
         Operator result = (Operator)parser.parse(new SimpleString("weight > 2500"), identifierMap);
         identifierMap.get(new SimpleString("weight")).setValue(new Integer(3000));
         FilterParserTest.log.trace("result -> " + result);
         Boolean bool = (Boolean)result.apply();
         Assert.assertTrue("is true", bool.booleanValue());
      }
      catch (Exception e)
      {
         FilterParserTest.log.trace("failed", e);
View Full Code Here

      {
         FilterParserTest.log.trace("parse(weight > 2500)");
         Operator result = (Operator)parser.parse(new SimpleString("weight > 2500"), identifierMap);
         identifierMap.get(new SimpleString("weight")).setValue(new Float(3000));
         FilterParserTest.log.trace("result -> " + result);
         Boolean bool = (Boolean)result.apply();
         Assert.assertTrue("is true", bool.booleanValue());
      }
      catch (Exception e)
      {
         FilterParserTest.log.trace("failed", e);
View Full Code Here

      {
         FilterParserTest.log.trace("parse(weight < 1.5)");
         Operator result = (Operator)parser.parse(new SimpleString("weight < 1.5"), identifierMap);
         identifierMap.get(new SimpleString("weight")).setValue(new Double(1.2));
         FilterParserTest.log.trace("result -> " + result);
         Boolean bool = (Boolean)result.apply();
         Assert.assertTrue("is true", bool.booleanValue());
      }
      catch (Exception e)
      {
         FilterParserTest.log.trace("failed", e);
View Full Code Here

         identifierMap.get(new SimpleString("JMSType")).setValue(new SimpleString("car"));
         identifierMap.get(new SimpleString("color")).setValue(new SimpleString("blue"));
         identifierMap.get(new SimpleString("weight")).setValue(new SimpleString("3000"));

         FilterParserTest.log.trace("result -> " + result);
         Boolean bool = (Boolean)result.apply();
         Assert.assertTrue("is false", !bool.booleanValue());
      }
      catch (Exception e)
      {
         FilterParserTest.log.trace("failed", e);
View Full Code Here

         Operator result = (Operator)parser.parse(new SimpleString("Category IN ('category1') AND Rating >= 2"),
                                                  identifierMap);
         identifierMap.get(new SimpleString("Category")).setValue(new SimpleString("category1"));
         identifierMap.get(new SimpleString("Rating")).setValue(new Integer(3));
         FilterParserTest.log.trace("result -> " + result);
         Boolean bool = (Boolean)result.apply();
         Assert.assertTrue("is true", bool.booleanValue());
      }
      catch (Exception e)
      {
         FilterParserTest.log.trace("failed", e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.