@Test
public void testPartitionExpression() throws IvoryException {

       Feed feed = (Feed) parser.parseAndValidate(ProcessEntityParserTest.class
               .getResourceAsStream(FEED_XML));
       
       //When there are more than 1 src clusters, there should be partition expression
       org.apache.ivory.entity.v0.feed.Cluster newCluster = new org.apache.ivory.entity.v0.feed.Cluster();
       newCluster.setName("newCluster");
       newCluster.setType(ClusterType.SOURCE);
       newCluster.setPartition("${cluster.colo}");
       feed.getClusters().getClusters().add(newCluster);
       try {
           parser.validate(feed);
           Assert.fail("Expected ValidationException");
       } catch(ValidationException e) { }
       
       //When there are more than 1 src clusters, the partition expression should contain cluster variable
       feed.getClusters().getClusters().get(0).setPartition("*");
       try {
           parser.validate(feed);
           Assert.fail("Expected ValidationException");
       } catch(ValidationException e) { }
       
       //When there are more than 1 target cluster, there should be partition expre
       newCluster.setType(ClusterType.TARGET);
       try {
           parser.validate(feed);
           Assert.fail("Expected ValidationException");
       } catch(ValidationException e) { }
       
       //When there are more than 1 target clusters, the partition expression should contain cluster variable
       feed.getClusters().getClusters().get(1).setPartition("*");
       try {
           parser.validate(feed);
           Assert.fail("Expected ValidationException");
       } catch(ValidationException e) { }
       
       //Number of parts in partition expression < number of partitions defined for feed
       feed.getClusters().getClusters().get(1).setPartition("*/*");
       try {
           parser.validate(feed);
           Assert.fail("Expected ValidationException");
       } catch(ValidationException e) { }
       feed.getClusters().getClusters().get(0).setPartition(null);
       feed.getClusters().getClusters().get(1).setPartition(null);
       feed.getClusters().getClusters().remove(2);
       feed.setPartitions(null);
       parser.validate(feed);
}