TMXMLWriter extends AbstractTopicMapExporter implements TopicMapWriterIF { public void close() throws IOException { if (writer != null) writer.close(); } TMXMLWriter(Writer out);  TMXMLWriter(Writer out, String encoding);  TMXMLWriter(File out);  TMXMLWriter(File out, String encoding);  TMXMLWriter(OutputStream out, String encoding);  TMXMLWriter(ContentHandler out); void close(); String getDocumentElement(); void setDocumentElement(String docelem); @Override void write(TopicMapIF topicmap); void startTopicMap(TopicMapIF topicmap); void gatherPrefixes(Collection topics); void writeTopics(Collection topics); void writeTopic(TopicIF topic); void endTopicMap(); void gatherPrefixes(TopicIF topic); Map getNamespaceURIMapping(); void addPrefix(String prefix, String nsuri); @Override void setAdditionalProperties(Map<String, Object> properties); static final String PROPERTY_PREFIXES; static final String PROPERTY_DOCUMENT_ELEMENT; static final String NS_ISO; static final String NS_XTM; static final String NS_TM; static final String XSD_ANYURI; static final String XSD_STRING; }
@Test public void testWriterClosing() throws IOException { MockWriter mock = new MockWriter(); TMXMLWriter writer = new TMXMLWriter(mock); writer.close(); Assert.assertFalse("Exporter closes external writer object", mock.isClosed()); }
@Test public void testWriterClosing2() throws IOException { MockWriter mock = new MockWriter(); TMXMLWriter writer = new TMXMLWriter(mock, "iso-8859-1"); writer.close(); Assert.assertFalse("Exporter closes external writer object", mock.isClosed()); }