@Test
public void testForwardedPojo() {

	String[] forwardedFields = { "int1->int2; int3->int1; string1 " };
	SingleInputSemanticProperties sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, pojoType, pojoType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(0));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(3));
	forwardedFields[0] = "f1->int1; f0->int3 ";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, threeIntTupleType, pojoType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(0));
	forwardedFields[0] = "int1->f2; int2->f0; int3->f1";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, pojoType, threeIntTupleType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(0));
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(1));
	forwardedFields[0] = "*->pojo1.*";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, pojoType, nestedPojoType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(3));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(4));
	forwardedFields[0] = "*->pojo1";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, pojoType, nestedPojoType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(3));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(4));
	forwardedFields[0] = "int1; string1; int2->pojo1.int3";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, pojoType, nestedPojoType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(0));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(3));
	assertTrue(sp.getForwardingTargetFields(0, 2).size() == 0);
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(5));
	forwardedFields[0] = "pojo1.*->f2.*; int1->f1";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, nestedPojoType, pojoInTupleType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(3));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(4));
	assertTrue(sp.getForwardingTargetFields(0, 4).contains(5));
	forwardedFields[0] = "f2.*->*";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, pojoInTupleType, pojoType);
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(0));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 4).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 5).contains(3));
	forwardedFields[0] = "pojo1->f2; int1->f1";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, nestedPojoType, pojoInTupleType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(3));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(4));
	assertTrue(sp.getForwardingTargetFields(0, 4).contains(5));
	forwardedFields[0] = "f2->*";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, pojoInTupleType, pojoType);
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(0));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 4).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 5).contains(3));
	forwardedFields[0] = "int2; string1";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, pojoType, pojoType);
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(3));
	assertTrue(sp.getForwardingTargetFields(0, 0).size() == 0);
	assertTrue(sp.getForwardingTargetFields(0, 2).size() == 0);
	forwardedFields[0] = "pojo1.int1; string1";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, nestedPojoType, nestedPojoType);
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 5).contains(5));
	assertTrue(sp.getForwardingTargetFields(0, 0).size() == 0);
	assertTrue(sp.getForwardingTargetFields(0, 2).size() == 0);
	assertTrue(sp.getForwardingTargetFields(0, 3).size() == 0);
	assertTrue(sp.getForwardingTargetFields(0, 4).size() == 0);
	forwardedFields[0] = "pojo1.*; int1";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, nestedPojoType, nestedPojoType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(0));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(3));
	assertTrue(sp.getForwardingTargetFields(0, 4).contains(4));
	assertTrue(sp.getForwardingTargetFields(0, 5).size() == 0);
	forwardedFields[0] = "pojo1; int1";
	sp = new SingleInputSemanticProperties();
	SemanticPropUtil.getSemanticPropsSingleFromString(sp, forwardedFields, null, null, nestedPojoType, nestedPojoType);
	assertTrue(sp.getForwardingTargetFields(0, 0).contains(0));
	assertTrue(sp.getForwardingTargetFields(0, 1).contains(1));
	assertTrue(sp.getForwardingTargetFields(0, 2).contains(2));
	assertTrue(sp.getForwardingTargetFields(0, 3).contains(3));
	assertTrue(sp.getForwardingTargetFields(0, 4).contains(4));
	assertTrue(sp.getForwardingTargetFields(0, 5).size() == 0);
}