Package org.apache.imperius.spl.parser.expressions.impl

Examples of org.apache.imperius.spl.parser.expressions.impl.Substring


      Expression exp;

      Vector v = new Vector();
      v.add(new StringConstant(s1));
      v.add(new IntegerConstant(8));
      exp = new Substring(v,true);
      assertTrue(exp.evaluate().equals("DigitsAndLetters12345"));

      v.clear();
      v.add(propertySensor1);
      v.add(new IntegerConstant(8));
      exp = new Substring(v,true);
      assertTrue(exp.evaluate().equals("DigitsAndLetters12345"));

      v.clear();
      v.add(new StringConstant(s1));
      v.add(new IntegerConstant(8));
      v.add(new IntegerConstant(24));
      exp = new Substring(v,true);
      assertTrue(exp.evaluate().equals("DigitsAndLetters"));

      v.clear();
      v.add(propertySensor1);
      v.add(new IntegerConstant(8));
      v.add(new IntegerConstant(24));
      exp = new Substring(v,true);
      assertTrue(exp.evaluate().equals("DigitsAndLetters"));
    } catch (SPLException e) {
      e.printStackTrace();
      fail("Received evaluation exception " + e.getMessage());
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.parser.expressions.impl.Substring

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.