@Test public void simpleHibersapXmlWithANamespaceCanBeBuilt() { final HibersapJaxbXmlParser hiberSapJaxbXmlParser = new HibersapJaxbXmlParser(); HibersapConfig config = hiberSapJaxbXmlParser.parseResource("/xml-configurations/hibersapSample.xml"); SessionManagerConfig sessionManagerNSP = config.getSessionManager("NSP"); assertThat(sessionManagerNSP).isNotNull(); assertThat(sessionManagerNSP.getJcaConnectionFactory()).isEqualTo("java:jboss/eis/sap/NSP"); }
public HibersapConfig parseResource(final String resourceName) { InputStream resourceStream = null; try { resourceStream = findResource(resourceName); return parseResource(resourceStream, resourceName); } finally { if (resourceStream != null) { try { resourceStream.close(); } catch (IOException e) { } } } }
HibersapJaxbXmlParser { public HibersapConfig parseResource(final String resourceName) { InputStream resourceStream = null; try { resourceStream = findResource(resourceName); return parseResource(resourceStream, resourceName); } finally { if (resourceStream != null) { try { resourceStream.close(); } catch (IOException e) { } } } } }
HibersapJaxbXmlParser { public HibersapConfig parseResource(final String resourceName) { InputStream resourceStream = null; try { resourceStream = findResource(resourceName); return parseResource(resourceStream, resourceName); } finally { if (resourceStream != null) { try { resourceStream.close(); } catch (IOException e) { } } } } HibersapJaxbXmlParser(); }
HibersapJaxbXmlParser { public HibersapConfig parseResource(final String resourceName) { InputStream resourceStream = null; try { resourceStream = findResource(resourceName); return parseResource(resourceStream, resourceName); } finally { if (resourceStream != null) { try { resourceStream.close(); } catch (IOException e) { } } } } HibersapJaxbXmlParser(); HibersapConfig parseResource(final String resourceName); HibersapConfig parseResource(final InputStream resourceStream, final String resourceName); }
HibersapJaxbXmlParser { public HibersapConfig parseResource(final String resourceName) { InputStream resourceStream = null; try { resourceStream = findResource(resourceName); return parseResource(resourceStream, resourceName); } finally { if (resourceStream != null) { try { resourceStream.close(); } catch (IOException e) { } } } } HibersapJaxbXmlParser(); HibersapConfig parseResource(final String resourceName); HibersapConfig parseResource(final InputStream resourceStream, final String resourceName);  }