FeedHelper { public static String evaluateClusterExp(org.apache.ivory.entity.v0.cluster.Cluster clusterEntity, String exp) throws IvoryException { Properties properties = loadClusterProperties(clusterEntity); ExpressionHelper expHelp = ExpressionHelper.get(); expHelp.setPropertiesForVariable(properties); return expHelp.evaluateFullExpression(exp, String.class); }  static Cluster getCluster(Feed feed, String clusterName); static Location getLocation(Feed feed, LocationType type,
			String clusterName); static Location getLocation(Feed feed, LocationType type); static Location getLocation(Locations locations, LocationType type); static String normalizePartitionExpression(String part1, String part2); static String normalizePartitionExpression(String partition); static String evaluateClusterExp(org.apache.ivory.entity.v0.cluster.Cluster clusterEntity, String exp);  }
@Test public void testEvaluateExpression() throws Exception { Cluster cluster = new Cluster(); cluster.setName("name"); cluster.setColo("colo"); cluster.setProperties(new Properties()); Property prop = new Property(); prop.setName("pname"); prop.setValue("pvalue"); cluster.getProperties().getProperties().add(prop); Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.colo}US"); Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.name}pvalue"); Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "IN"), "IN"); }