public void testPathTranslation()
throws Exception
{
Configuration conf = vs.getConfiguration();
ExtendedProperties ep = ((TurbineVelocityService) vs).createVelocityProperties(conf);
String rootPath = Turbine.getRealPath("");
String [] test1 = ep.getStringArray("test1.resource.loader.path");
assertEquals("No Test1 Property found", 1, test1.length);
assertEquals("Test1 Path translation failed", rootPath
+fileSeperator+"relative"+fileSeperator+"path" , test1[0]);
String [] test2 = ep.getStringArray("test2.resource.loader.path");
assertEquals("No Test2 Property found", 1, test2.length);
assertEquals("Test2 Path translation failed", rootPath
+fileSeperator+"absolute"+fileSeperator+"path" , test2[0]);
String [] test3 = ep.getStringArray("test3.resource.loader.path");
assertEquals("No Test3 Property found", 1, test2.length);
assertEquals("Test3 Path translation failed", rootPath
+fileSeperator+"jar-file.jar!/", test3[0]);
String [] test4 = ep.getStringArray("test4.resource.loader.path");
assertEquals("No Test4 Property found", 1, test4.length);
assertEquals("Test4 Path translation failed", rootPath
+fileSeperator+"jar-file.jar!/with/some/extensions" , test4[0]);
String [] test5 = ep.getStringArray("test5.resource.loader.path");
assertEquals("No Test5 Property found", 1, test5.length);
assertEquals("Test5 Path translation failed", rootPath
+fileSeperator+"jar-file.jar" , test5[0]);
String [] test6 = ep.getStringArray("test6.resource.loader.path");
assertEquals("No Test6 Property found", 1, test6.length);
assertEquals("Test6 Path translation failed", "jar:http://jar.on.website/" , test6[0]);
String [] test7 = ep.getStringArray("test7.resource.loader.path");
assertEquals("No Test7 Property found", 1, test7.length);
assertEquals("Test7 Path translation failed", rootPath
+fileSeperator+"file"+fileSeperator
+"system"+fileSeperator+"reference" , test7[0]);
String [] test8 = ep.getStringArray("test8.resource.loader.path");
assertEquals("No Test8 Property found", 1, test8.length);
assertEquals("Test8 Path translation failed", "http://reference.on.website/" , test8[0]);
}