1 24 package org.objectweb.cjdbc.scenario.raidb1.xml; 25 26 import org.objectweb.cjdbc.common.xml.XmlComponent; 27 import org.objectweb.cjdbc.controller.core.ControllerConstants; 28 import org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase; 29 import org.objectweb.cjdbc.scenario.templates.Raidb1Template; 30 31 36 public class XmlGenerationScenario extends Raidb1Template 37 { 38 39 45 public void testDatabaseXml() throws Exception 46 { 47 VirtualDatabase vd = controller.getVirtualDatabase("myDB"); 48 String xml1 = vd.getXml(); 49 xml1 = XmlComponent.XML_VERSION +XmlComponent.DOCTYPE_DB + xml1; 50 controller.removeVirtualDatabase("myDB"); 51 System.out.println(xml1); 52 controller.addVirtualDatabases(xml1,"myDB",ControllerConstants.AUTO_ENABLE_TRUE,""); 53 VirtualDatabase vd2 = controller.getVirtualDatabase("myDB"); 54 String xml2 = vd2.getXml(); 55 xml2 = XmlComponent.XML_VERSION +XmlComponent.DOCTYPE_DB + xml2; 56 System.out.println(xml2); 57 58 controller.removeVirtualDatabase("myDB"); 59 controller.addVirtualDatabases(xml2,"myDB",ControllerConstants.AUTO_ENABLE_TRUE,""); 60 VirtualDatabase vd3 = controller.getVirtualDatabase("myDB"); 61 String xml3 = vd3.getXml(); 62 xml3 = XmlComponent.XML_VERSION +XmlComponent.DOCTYPE_DB + xml3; 63 64 assertEquals("Xml files are different",xml3,xml2); 65 } 66 } 67 | Popular Tags |