+++ /dev/null
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.axyus.generator.pespj;
-
-import com.axyus.generator.pespj.models.PESAller;
-import com.axyus.generator.pespj.models.commun.BaseAnnee;
-import com.axyus.generator.pespj.models.facture.TPESFacture;
-import java.io.InputStream;
-import java.net.URL;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import junit.framework.TestCase;
-import sun.security.util.Resources;
-
-/**
- *
- * @author jp.tessier
- */
-public class JaxbTest extends TestCase {
-
- public void testMain() throws Exception {
- should_parse_recipe();
- }
-
- public void should_parse_recipe() throws JAXBException {
- //URL xmlUrl = Resources.getResource("recipe.xml");
- TPESFacture facture = parse(this.getClass().getResourceAsStream("/com/axyus/generator/pespj/pesFacture1.xml"), TPESFacture.class);
- //assertEquals(Integer.valueOf(15), PESAller.get.getDuration());
- BaseAnnee annee = facture.getAnnee();
- }
-
- private <T> T parse(InputStream input, Class<T> clazz) throws JAXBException {
- Unmarshaller unmarshaller = JAXBContext.newInstance(clazz).createUnmarshaller();
- return clazz.cast(unmarshaller.unmarshal(input));
- }
-
-}
\ No newline at end of file