Skip to content

Instantly share code, notes, and snippets.

@yamanyar
Created April 7, 2012 05:23
Show Gist options
  • Save yamanyar/2325509 to your computer and use it in GitHub Desktop.
Save yamanyar/2325509 to your computer and use it in GitHub Desktop.
Parse example
import org.apache.xmlbeans.XmlException;
import org.junit.Ignore;
import com.yamanyar.ish.TransactionalInfoDocument;
import java.io.File;
import java.io.IOException;
import static junit.framework.Assert.assertEquals;
/**
* @author Kaan Yamanyar
*/
public class CheckGeneratedXsdDrivenBeans {
@Test
public void testReadXML() throws XmlException, IOException {
File f = new File("pr1.xml");
TransactionalInfoDocument infoDoc = TransactionalInfoDocument.Factory.parse(f);
assertEquals("Expected material name not found!","TestMatABC.123",infoDoc.getTransactionalInfo()
.getProducts().getProductArray()[2].getMaterialName());
//TODO enhance this test
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment