@Test public void testNotXml() { assertEquals(Collections.emptyList(), PersistenceUtils.getNames("not-xml.txt")); }
public static List<String> getNames(final String fileName) { try (final InputStream in = PersistenceUtils.class.getClassLoader().getResourceAsStream(fileName)) { if (in == null) { return Collections.emptyList(); } return scanPersistenceXml(in); } catch (final Exception ex) { LOG.warn("Error reading persistence.xml: {}", ex.getMessage(), ex); return Collections.emptyList(); } }
PersistenceUtils { public static List<String> getNames(final String fileName) { try (final InputStream in = PersistenceUtils.class.getClassLoader().getResourceAsStream(fileName)) { if (in == null) { return Collections.emptyList(); } return scanPersistenceXml(in); } catch (final Exception ex) { LOG.warn("Error reading persistence.xml: {}", ex.getMessage(), ex); return Collections.emptyList(); } } }
PersistenceUtils { public static List<String> getNames(final String fileName) { try (final InputStream in = PersistenceUtils.class.getClassLoader().getResourceAsStream(fileName)) { if (in == null) { return Collections.emptyList(); } return scanPersistenceXml(in); } catch (final Exception ex) { LOG.warn("Error reading persistence.xml: {}", ex.getMessage(), ex); return Collections.emptyList(); } } PersistenceUtils(); }
PersistenceUtils { public static List<String> getNames(final String fileName) { try (final InputStream in = PersistenceUtils.class.getClassLoader().getResourceAsStream(fileName)) { if (in == null) { return Collections.emptyList(); } return scanPersistenceXml(in); } catch (final Exception ex) { LOG.warn("Error reading persistence.xml: {}", ex.getMessage(), ex); return Collections.emptyList(); } } PersistenceUtils(); static List<String> getNames(final String fileName); }
PersistenceUtils { public static List<String> getNames(final String fileName) { try (final InputStream in = PersistenceUtils.class.getClassLoader().getResourceAsStream(fileName)) { if (in == null) { return Collections.emptyList(); } return scanPersistenceXml(in); } catch (final Exception ex) { LOG.warn("Error reading persistence.xml: {}", ex.getMessage(), ex); return Collections.emptyList(); } } PersistenceUtils(); static List<String> getNames(final String fileName);  }