@Test public void testInvalidFile() throws JAXBException, SAXException { File xmldsigFile = new File("src/test/resources/ASiCManifestInvalid.xml"); JAXBContext jc = asicManifestUtils.getJAXBContext(); assertNotNull(jc); Schema schema = asicManifestUtils.getSchema(); assertNotNull(schema); Unmarshaller unmarshaller = jc.createUnmarshaller(); unmarshaller.setSchema(schema); assertThrows(UnmarshalException.class, () -> { unmarshaller.unmarshal(xmldsigFile); }); }
@Override public JAXBContext getJAXBContext() throws JAXBException { if (jc == null) { jc = JAXBContext.newInstance(ObjectFactory.class, eu.europa.esig.asic.manifest.jaxb.ObjectFactory.class); } return jc; }
ASiCManifestUtils extends XSDAbstractUtils { @Override public JAXBContext getJAXBContext() throws JAXBException { if (jc == null) { jc = JAXBContext.newInstance(ObjectFactory.class, eu.europa.esig.asic.manifest.jaxb.ObjectFactory.class); } return jc; } }
ASiCManifestUtils extends XSDAbstractUtils { @Override public JAXBContext getJAXBContext() throws JAXBException { if (jc == null) { jc = JAXBContext.newInstance(ObjectFactory.class, eu.europa.esig.asic.manifest.jaxb.ObjectFactory.class); } return jc; } private  ASiCManifestUtils(); }
ASiCManifestUtils extends XSDAbstractUtils { @Override public JAXBContext getJAXBContext() throws JAXBException { if (jc == null) { jc = JAXBContext.newInstance(ObjectFactory.class, eu.europa.esig.asic.manifest.jaxb.ObjectFactory.class); } return jc; } private  ASiCManifestUtils(); static ASiCManifestUtils getInstance(); @Override JAXBContext getJAXBContext(); @Override List<Source> getXSDSources(); }
ASiCManifestUtils extends XSDAbstractUtils { @Override public JAXBContext getJAXBContext() throws JAXBException { if (jc == null) { jc = JAXBContext.newInstance(ObjectFactory.class, eu.europa.esig.asic.manifest.jaxb.ObjectFactory.class); } return jc; } private  ASiCManifestUtils(); static ASiCManifestUtils getInstance(); @Override JAXBContext getJAXBContext(); @Override List<Source> getXSDSources(); static final String ASIC_MANIFEST; }