Code example for FileWriter

Methods: close, write

0
	 
	public void buildSchema () { 
		try { 
			PackageDescr packageDescr = TransformerService.parseDrl("/org/drools/testing/core/resources/drl/test.drl");
			XmlDumper xmlDumper = new XmlDumper();
			FileWriter writer = new FileWriter("drl.xml");
			writer.write(xmlDumper.dump(packageDescr));
			writer.close();
		}catch (Exception e) {
			e.printStackTrace();
		} 
	} 
	 
	public void buildTestSuite () { 
		try { 
			TransformerService trService = new TransformerService();
			TestSuite testSuite = trService.generateTestSuite("/org/drools/testing/core/resources/drl/test.drl");
		}catch (Exception e) {
			e.printStackTrace();
		} 
	}