Expression exp;
v.add(new StringConstant(string));
v.add(ic4);
v.add(ic5);
v.add(lr);
Expression esnnl = new MiddleSubstring(v,true);
v.clear();
v.add(new StringConstant(string));
v.add(ic4);
v.add(ic5);
v.add(rl);
Expression esnnr = new MiddleSubstring(v,true);
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(ic5);
v.add(lr);
Expression essnl = new MiddleSubstring(v,true);
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(ic5);
v.add(rl);
Expression essnr = new MiddleSubstring(v,true);
v.clear();
v.add(new StringConstant(string));
v.add(ic4);
v.add(new StringConstant("\"om\""));
v.add(lr);
Expression esnsl = new MiddleSubstring(v,true);
v.clear();
v.add(new StringConstant(string));
v.add(ic4);
v.add(new StringConstant("\"om\""));
v.add(rl);
Expression esnsr = new MiddleSubstring(v,true);
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"on\""));
v.add(new StringConstant("\"om\""));
v.add(lr);
Expression esssl = new MiddleSubstring(v,true);
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"on\""));
v.add(new StringConstant("\"om\""));
v.add(rl);
Expression esssr = new MiddleSubstring(v,true);
assertTrue(((String) esnnl.evaluate()).equals("nomic"));
assertTrue(((String) esnnr.evaluate()).equals("ing"));
assertTrue(((String) essnl.evaluate()).equals("icCom"));
assertTrue(((String) essnr.evaluate()).equals("putin"));
assertTrue(((String) esnsl.evaluate()).equals("n"));
assertTrue(((String) esnsr.evaluate()).equals("pu"));
assertTrue(((String) esssl.evaluate()).equals(""));
assertTrue(((String) esssr.evaluate()).equals("Aut"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(4));
v.add(new IntegerConstant(5));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("nomic"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(4));
v.add(new IntegerConstant(5));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("ing"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(4));
v.add(new IntegerConstant(-1));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("o"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(8));
v.add(new IntegerConstant(-1));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("o"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(-1));
v.add(new IntegerConstant(5));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("g"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(-1));
v.add(new IntegerConstant(5));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("tonom"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(-1));
v.add(new IntegerConstant(-1));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("n"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(-1));
v.add(new IntegerConstant(-1));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("u"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(19));
v.add(new IntegerConstant(5));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(19));
v.add(new IntegerConstant(5));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("Auton"));
//////////////////////////////////////////////////////
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new IntegerConstant(5));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("icCom"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new IntegerConstant(5));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("putin"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new IntegerConstant(18));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("icComputing"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new IntegerConstant(18));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("puting"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new IntegerConstant(-1));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("n"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new IntegerConstant(-1));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("C"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new IntegerConstant(5));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new IntegerConstant(5));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new IntegerConstant(-1));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new IntegerConstant(-1));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new IntegerConstant(20));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new IntegerConstant(20));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
///////////////////////////////////////////////
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(4));
v.add(new StringConstant("\"om\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("n"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(4));
v.add(new StringConstant("\"om\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("pu"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(7));
v.add(new StringConstant("\"om\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("icC"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(7));
v.add(new StringConstant("\"om\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(-1));
v.add(new StringConstant("\"om\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("g"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(-1));
v.add(new StringConstant("\"om\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(-1));
v.add(new StringConstant("\"bz\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("g"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(-1));
v.add(new StringConstant("\"bz\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(4));
v.add(new StringConstant("\"bz\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(
((String) exp.evaluate()).equals("nomicComputing"));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(4));
v.add(new StringConstant("\"bz\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(20));
v.add(new StringConstant("\"om\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(20));
v.add(new StringConstant("\"om\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(20));
v.add(new StringConstant("\"bz\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new IntegerConstant(20));
v.add(new StringConstant("\"bz\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
/////////////////////////////////////
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new StringConstant("\"om\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("icC"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new StringConstant("\"om\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("icC"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new StringConstant("\"om\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new StringConstant("\"om\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new StringConstant("\"bz\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("icComputing"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new StringConstant("\"bz\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals("AutonomicC"));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new StringConstant("\"bz\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"bz\""));
v.add(new StringConstant("\"bz\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new StringConstant("\"icC\""));
v.add(lr);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
v.clear();
v.add(new StringConstant(string));
v.add(new StringConstant("\"om\""));
v.add(new StringConstant("\"icC\""));
v.add(rl);
exp = new MiddleSubstring(v,true);
assertTrue(((String) exp.evaluate()).equals(""));
} catch (SPLException e) {
fail("Received evaluation exception " + e.getMessage());