package com.google.gdata.data; import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.junit.Test; import com.google.gdata.util.common.xml.XmlWriter; public class TestOutOfLineContent { @Test public void generateAtomTest() { XmlWriter w = null; FileWriter fw = null; File f = new File("dummy"); ExtensionProfile ext = new ExtensionProfile(); boolean exception = false; try { fw = new FileWriter(f); w = new XmlWriter(fw); } catch(IOException e) { exception = true; } if(exception) { try { if(fw != null) fw.close(); if(w != null) w.close(); } catch(IOException e){} } else { OutOfLineContent content = new OutOfLineContent(); try { content.generateAtom(w, ext); } catch (IOException e) { exception = true; } } } @Test public void generateRssTest() { XmlWriter w = null; FileWriter fw = null; File f = new File("dummy"); ExtensionProfile ext = new ExtensionProfile(); boolean exception = false; try { fw = new FileWriter(f); w = new XmlWriter(fw); } catch(IOException e) { exception = true; } if(exception) { try { if(fw != null) fw.close(); if(w != null) w.close(); } catch(IOException e){} } else { OutOfLineContent content = new OutOfLineContent(); try { content.generateRss(w, ext); } catch (IOException e) { exception = true; } } } }