FileUtil { public static InputStream open(Class<?> clazz, String name) { return open(clazz, name, Location.FILESYSTEM, Location.CONTEXT_RESOURCE, Location.CLASS_RESOURCE, Location.CLASSLOADER_RESOURCE, Location.URL); }  static String fileAppendPath(String pathPrefix, String pathSuffix); static String sessionIdFileName(SessionID sessionID); static InputStream open(Class<?> clazz, String name); static InputStream open(Class<?> clazz, String name, Location... locations);  }
@Test public void testFileLocation() throws Exception { InputStream in = FileUtil.open(null, "LICENSE"); in.close(); assertNotNull("File not found", in); }
@Test public void testClassResourceLocation() throws Exception { InputStream in = FileUtil.open(Message.class, "Session.class"); in.close(); assertNotNull("Resource not found", in); }
@Test public void testClassLoaderResourceLocation() throws Exception { InputStream in = FileUtil.open(Message.class, "quickfix/test/acceptance/definitions/client/Normal.def"); in.close(); assertNotNull("Resource not found", in); }
@Test public void testURLLocation() throws Exception { if (isInternetAccessible()) { InputStream in = FileUtil.open(Message.class, "http: if (in != null) { in.close(); } assertNotNull("Resource not found", in); } }