From 931886030e9868e1fc83556435c799cf4923dba7 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Sat, 31 Aug 2013 12:13:18 +0200 Subject: [PATCH] Made config keys shorter and renamed some more context to session. --- .../src/main/java/org/x4o/xml/X4ODriver.java | 32 +++++------- .../org/x4o/xml/io/AbstractX4OReader.java | 24 ++++----- ...ext.java => AbstractX4OReaderSession.java} | 37 +++++++------ .../org/x4o/xml/io/AbstractX4OWriter.java | 10 ++-- ...ext.java => AbstractX4OWriterSession.java} | 18 +++---- .../java/org/x4o/xml/io/DefaultX4OReader.java | 4 +- .../java/org/x4o/xml/io/DefaultX4OWriter.java | 4 +- .../main/java/org/x4o/xml/io/X4OReader.java | 10 ++-- ...aderContext.java => X4OReaderSession.java} | 32 ++++++------ ...iterContext.java => X4OWriterSession.java} | 12 ++--- .../org/x4o/xml/core/NamespaceUriTest.java | 20 +++---- ...extTest.java => X4OReaderSessionTest.java} | 52 +++++++++---------- .../java/org/x4o/xml/io/X4OReaderTest.java | 2 +- ...extTest.java => X4OWriterSessionTest.java} | 24 ++++----- .../x4o/xml/io/sax/ContentWriterXmlTest.java | 4 +- .../java/org/x4o/xml/test/TestDriver.java | 4 +- .../x4o/xml/lang/meta/ParentObjectTest.java | 8 +-- .../x4o/xml/lang/meta/ReferenceStoreTest.java | 20 +++---- .../junit/test-write-language-doc.xml | 16 +++--- .../junit/test-write-language-schema.xml | 10 ++-- .../resources/junit/test-plugin-conf-all.pom | 9 ++-- .../resources/junit/test-plugin-conf-lang.pom | 2 +- 22 files changed, 173 insertions(+), 181 deletions(-) rename x4o-driver/src/main/java/org/x4o/xml/io/{AbstractX4OReaderContext.java => AbstractX4OReaderSession.java} (83%) rename x4o-driver/src/main/java/org/x4o/xml/io/{AbstractX4OWriterContext.java => AbstractX4OWriterSession.java} (75%) rename x4o-driver/src/main/java/org/x4o/xml/io/{X4OReaderContext.java => X4OReaderSession.java} (80%) rename x4o-driver/src/main/java/org/x4o/xml/io/{X4OWriterContext.java => X4OWriterSession.java} (83%) rename x4o-driver/src/test/java/org/x4o/xml/io/{X4OReaderContextTest.java => X4OReaderSessionTest.java} (83%) rename x4o-driver/src/test/java/org/x4o/xml/io/{X4OWriterContextTest.java => X4OWriterSessionTest.java} (88%) diff --git a/x4o-driver/src/main/java/org/x4o/xml/X4ODriver.java b/x4o-driver/src/main/java/org/x4o/xml/X4ODriver.java index 3c94b9a..c6a2a02 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/X4ODriver.java +++ b/x4o-driver/src/main/java/org/x4o/xml/X4ODriver.java @@ -27,14 +27,13 @@ import java.util.List; import org.x4o.xml.io.DefaultX4OReader; import org.x4o.xml.io.DefaultX4OWriter; import org.x4o.xml.io.X4OReader; -import org.x4o.xml.io.X4OReaderContext; +import org.x4o.xml.io.X4OReaderSession; import org.x4o.xml.io.X4OWriter; -import org.x4o.xml.io.X4OWriterContext; +import org.x4o.xml.io.X4OWriterSession; import org.x4o.xml.lang.X4OLanguageConfiguration; import org.x4o.xml.lang.X4OLanguage; import org.x4o.xml.lang.phase.X4OPhaseManager; import org.x4o.xml.lang.task.X4OLanguageTask; -import org.x4o.xml.lang.task.X4OLanguageTaskExecutor; /** * X4ODriver Is the x4o language driver to interact with xml. @@ -84,18 +83,18 @@ public abstract class X4ODriver { // =============== Reader public X4OReader createReader() { - return createReaderContext(); + return createReaderSession(); } public X4OReader createReader(String version) { - return createReaderContext(version); + return createReaderSession(version); } - public X4OReaderContext createReaderContext() { - return createReaderContext(getLanguageVersionDefault()); + public X4OReaderSession createReaderSession() { + return createReaderSession(getLanguageVersionDefault()); } - public X4OReaderContext createReaderContext(String version) { + public X4OReaderSession createReaderSession(String version) { return new DefaultX4OReader(createLanguage(version)); } @@ -104,18 +103,18 @@ public abstract class X4ODriver { // =============== Writer public X4OWriter createWriter() { - return createWriterContext(); + return createWriterSession(); } public X4OWriter createWriter(String version) { - return createWriterContext(version); + return createWriterSession(version); } - public X4OWriterContext createWriterContext() { - return createWriterContext(getLanguageVersionDefault()); + public X4OWriterSession createWriterSession() { + return createWriterSession(getLanguageVersionDefault()); } - public X4OWriterContext createWriterContext(String version) { + public X4OWriterSession createWriterSession(String version) { return new DefaultX4OWriter(createLanguage(version)); } @@ -175,11 +174,4 @@ public abstract class X4ODriver { final public List getLanguageTasks() { return X4ODriverManager.getX4OLanguageTasks(); } - - public void t() { - X4OLanguageTask t = null; - //PropertyConfig conf = t.createTaskConfig(); - //X4OLanguageTaskExecutor exe = t.createTaskExecutor(conf); - //exe.execute(language); - } } diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReader.java b/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReader.java index 5d30ba2..35ed041 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReader.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReader.java @@ -38,14 +38,14 @@ import org.xml.sax.SAXException; * @version 1.0 Aug 11, 2005 */ @SuppressWarnings("unchecked") -abstract public class AbstractX4OReader extends AbstractX4OReaderContext implements X4OReader { +abstract public class AbstractX4OReader extends AbstractX4OReaderSession implements X4OReader { public AbstractX4OReader(X4OLanguage language) { super(language); } public T read(InputStream input, String systemId, URL basePath) throws X4OConnectionException,SAXException,IOException { - return (T)readContext(input, systemId, basePath).getRootElement().getElementObject(); + return (T)readSession(input, systemId, basePath).getRootElement().getElementObject(); } /** @@ -55,10 +55,10 @@ abstract public class AbstractX4OReader extends AbstractX4OReaderContext i * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ public T readFile(String fileName) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { - return (T)readFileContext(fileName).getRootElement().getElementObject(); + return (T)readFileSession(fileName).getRootElement().getElementObject(); } /** @@ -68,10 +68,10 @@ abstract public class AbstractX4OReader extends AbstractX4OReaderContext i * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ public T readFile(File file) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { - return (T)readFileContext(file).getRootElement().getElementObject(); + return (T)readFileSession(file).getRootElement().getElementObject(); } /** @@ -80,10 +80,10 @@ abstract public class AbstractX4OReader extends AbstractX4OReaderContext i * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ public T readResource(String resourceName) throws X4OConnectionException,SAXException,IOException { - return (T)readResourceContext(resourceName).getRootElement().getElementObject(); + return (T)readResourceSession(resourceName).getRootElement().getElementObject(); } /** @@ -92,10 +92,10 @@ abstract public class AbstractX4OReader extends AbstractX4OReaderContext i * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ public T readString(String xmlString) throws X4OConnectionException,SAXException,IOException { - return (T)readStringContext(xmlString).getRootElement().getElementObject(); + return (T)readStringSession(xmlString).getRootElement().getElementObject(); } /** @@ -104,9 +104,9 @@ abstract public class AbstractX4OReader extends AbstractX4OReaderContext i * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ public T readUrl(URL url) throws X4OConnectionException,SAXException,IOException { - return (T)readUrlContext(url).getRootElement().getElementObject(); + return (T)readUrlSession(url).getRootElement().getElementObject(); } } diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReaderContext.java b/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReaderSession.java similarity index 83% rename from x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReaderContext.java rename to x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReaderSession.java index 41549d7..7a380bd 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReaderContext.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OReaderSession.java @@ -36,15 +36,14 @@ import org.x4o.xml.lang.X4OLanguageSession; import org.xml.sax.SAXException; /** - * AbstractX4OContextReader - + * AbstractX4OReaderSession * * @author Willem Cazander * @version 1.0 Apr 6, 2013 */ -abstract public class AbstractX4OReaderContext extends AbstractX4OConnection implements X4OReaderContext { +abstract public class AbstractX4OReaderSession extends AbstractX4OConnection implements X4OReaderSession { - public AbstractX4OReaderContext(X4OLanguage language) { + public AbstractX4OReaderSession(X4OLanguage language) { super(language); } @@ -55,13 +54,13 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - public X4OLanguageSession readFileContext(String fileName) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { + public X4OLanguageSession readFileSession(String fileName) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { if (fileName==null) { throw new NullPointerException("Can't convert null fileName to file object."); } - return readFileContext(new File(fileName)); + return readFileSession(new File(fileName)); } /** @@ -71,9 +70,9 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - public X4OLanguageSession readFileContext(File file) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { + public X4OLanguageSession readFileSession(File file) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { if (file==null) { throw new NullPointerException("Can't read null file."); } @@ -86,7 +85,7 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection URL basePath = new File(file.getAbsolutePath()).toURI().toURL(); InputStream inputStream = new FileInputStream(file); try { - return readContext(inputStream,file.getAbsolutePath(),basePath); + return readSession(inputStream,file.getAbsolutePath(),basePath); } finally { inputStream.close(); } @@ -98,9 +97,9 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - public X4OLanguageSession readResourceContext(String resourceName) throws X4OConnectionException,SAXException,IOException { + public X4OLanguageSession readResourceSession(String resourceName) throws X4OConnectionException,SAXException,IOException { if (resourceName==null) { throw new NullPointerException("Can't read null resourceName from classpath."); } @@ -116,7 +115,7 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection URL basePath = new URL(baseUrl); InputStream inputStream = X4OLanguageClassLoader.getResourceAsStream(resourceName); try { - return readContext(inputStream,url.toExternalForm(),basePath); + return readSession(inputStream,url.toExternalForm(),basePath); } finally { inputStream.close(); } @@ -128,15 +127,15 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - public X4OLanguageSession readStringContext(String xmlString) throws X4OConnectionException,SAXException,IOException { + public X4OLanguageSession readStringSession(String xmlString) throws X4OConnectionException,SAXException,IOException { if (xmlString==null) { throw new NullPointerException("Can't read null xml string."); } URL basePath = new File(System.getProperty("user.dir")).toURI().toURL(); String encoding = (String)getProperty(DefaultX4OReader.INPUT_ENCODING); - return readContext(new ByteArrayInputStream(xmlString.getBytes(encoding)),"inline-xml",basePath); + return readSession(new ByteArrayInputStream(xmlString.getBytes(encoding)),"inline-xml",basePath); } /** @@ -145,13 +144,13 @@ abstract public class AbstractX4OReaderContext extends AbstractX4OConnection * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - public X4OLanguageSession readUrlContext(URL url) throws X4OConnectionException,SAXException,IOException { + public X4OLanguageSession readUrlSession(URL url) throws X4OConnectionException,SAXException,IOException { if (url==null) { throw new NullPointerException("Can't read null url."); } URL basePath = new URL(url.toExternalForm().substring(0,url.toExternalForm().length()-url.getFile().length())); - return readContext(url.openStream(),url.toExternalForm(),basePath); + return readSession(url.openStream(),url.toExternalForm(),basePath); } } diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriter.java b/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriter.java index 4b82129..85b41b9 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriter.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriter.java @@ -38,7 +38,7 @@ import org.xml.sax.SAXException; * @author Willem Cazander * @version 1.0 Apr 6, 2013 */ -public abstract class AbstractX4OWriter extends AbstractX4OWriterContext implements X4OWriter { +public abstract class AbstractX4OWriter extends AbstractX4OWriterSession implements X4OWriter { public AbstractX4OWriter(X4OLanguage language) { super(language); @@ -63,18 +63,18 @@ public abstract class AbstractX4OWriter extends AbstractX4OWriterContext i } public void write(T object,OutputStream output) throws X4OConnectionException,SAXException,IOException { - writeContext(toObjectContext(object), output); + writeSession(toObjectContext(object), output); } public void writeFile(T object,String fileName) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { - writeFileContext(toObjectContext(object), fileName); + writeFileSession(toObjectContext(object), fileName); } public void writeFile(T object,File file) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { - writeFileContext(toObjectContext(object), file); + writeFileSession(toObjectContext(object), file); } public String writeString(T object) throws X4OConnectionException,SAXException,IOException,FileNotFoundException { - return writeStringContext(toObjectContext(object)); + return writeStringSession(toObjectContext(object)); } } diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriterContext.java b/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriterSession.java similarity index 75% rename from x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriterContext.java rename to x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriterSession.java index a80bb46..b5286f0 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriterContext.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/AbstractX4OWriterSession.java @@ -34,39 +34,39 @@ import org.x4o.xml.lang.X4OLanguageSession; import org.xml.sax.SAXException; /** - * AbstractX4OWriterContext. + * AbstractX4OWriterSession. * * @author Willem Cazander * @version 1.0 Apr 6, 2013 */ -public abstract class AbstractX4OWriterContext extends AbstractX4OConnection implements X4OWriterContext { +public abstract class AbstractX4OWriterSession extends AbstractX4OConnection implements X4OWriterSession { - public AbstractX4OWriterContext(X4OLanguage language) { + public AbstractX4OWriterSession(X4OLanguage language) { super(language); } - public void writeFileContext(X4OLanguageSession context,String fileName) throws X4OConnectionException,SAXException,IOException { + public void writeFileSession(X4OLanguageSession languageSession,String fileName) throws X4OConnectionException,SAXException,IOException { if (fileName==null) { throw new NullPointerException("Can't convert null fileName to file object."); } - writeFileContext(context,new File(fileName)); + writeFileSession(languageSession,new File(fileName)); } - public void writeFileContext(X4OLanguageSession context,File file) throws X4OConnectionException,SAXException,IOException { + public void writeFileSession(X4OLanguageSession languageSession,File file) throws X4OConnectionException,SAXException,IOException { if (file==null) { throw new NullPointerException("Can't read null file."); } OutputStream outputStream = new FileOutputStream(file); try { - writeContext(context,outputStream); + writeSession(languageSession,outputStream); } finally { outputStream.close(); } } - public String writeStringContext(X4OLanguageSession context) throws X4OConnectionException,SAXException,IOException { + public String writeStringSession(X4OLanguageSession languageSession) throws X4OConnectionException,SAXException,IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(4096); - writeContext(context, out); + writeSession(languageSession, out); String encoding = (String)getProperty(ContentWriterXml.OUTPUT_ENCODING); return out.toString(encoding); } diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java b/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java index 67253d5..f95b10f 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OReader.java @@ -113,7 +113,7 @@ public class DefaultX4OReader extends AbstractX4OReader { return propertyConfig; } - public X4OLanguageSession readContext(InputStream input, String systemId, URL basePath) throws X4OConnectionException, SAXException, IOException { + public X4OLanguageSession readSession(InputStream input, String systemId, URL basePath) throws X4OConnectionException, SAXException, IOException { setProperty(INPUT_STREAM, input); setProperty(INPUT_SYSTEM_ID, systemId); setProperty(INPUT_BASE_PATH, basePath); @@ -247,7 +247,7 @@ public class DefaultX4OReader extends AbstractX4OReader { } } - public void releaseContext(X4OLanguageSession context) throws X4OPhaseException { + public void releaseSession(X4OLanguageSession context) throws X4OPhaseException { if (context==null) { return; } diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java b/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java index 3a92ce0..ed79700 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/DefaultX4OWriter.java @@ -98,9 +98,9 @@ public class DefaultX4OWriter extends AbstractX4OWriter { } /** - * @see org.x4o.xml.io.X4OWriterContext#writeContext(org.x4o.xml.lang.X4OLanguageSession, java.io.OutputStream) + * @see org.x4o.xml.io.X4OWriterSession#writeSession(org.x4o.xml.lang.X4OLanguageSession, java.io.OutputStream) */ - public void writeContext(X4OLanguageSession languageSession,OutputStream output) throws X4OConnectionException,SAXException,IOException { + public void writeSession(X4OLanguageSession languageSession,OutputStream output) throws X4OConnectionException,SAXException,IOException { setProperty(OUTPUT_STREAM, output); addPhaseSkip(X4OPhase.WRITE_RELEASE); try { diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/X4OReader.java b/x4o-driver/src/main/java/org/x4o/xml/io/X4OReader.java index f3ebc15..619d135 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/X4OReader.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/X4OReader.java @@ -61,7 +61,7 @@ public interface X4OReader extends X4OConnection { * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ T readFile(String fileName) throws X4OConnectionException,SAXException,IOException,FileNotFoundException; @@ -72,7 +72,7 @@ public interface X4OReader extends X4OConnection { * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ T readFile(File file) throws X4OConnectionException,SAXException,IOException,FileNotFoundException; @@ -82,7 +82,7 @@ public interface X4OReader extends X4OConnection { * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ T readResource(String resourceName) throws X4OConnectionException,SAXException,IOException; @@ -92,7 +92,7 @@ public interface X4OReader extends X4OConnection { * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ T readString(String xmlString) throws X4OConnectionException,SAXException,IOException; @@ -102,7 +102,7 @@ public interface X4OReader extends X4OConnection { * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ T readUrl(URL url) throws X4OConnectionException,SAXException,IOException; } diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/X4OReaderContext.java b/x4o-driver/src/main/java/org/x4o/xml/io/X4OReaderSession.java similarity index 80% rename from x4o-driver/src/main/java/org/x4o/xml/io/X4OReaderContext.java rename to x4o-driver/src/main/java/org/x4o/xml/io/X4OReaderSession.java index 3a592d9..7d8e7e4 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/X4OReaderContext.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/X4OReaderSession.java @@ -33,14 +33,14 @@ import org.x4o.xml.lang.phase.X4OPhaseException; import org.xml.sax.SAXException; /** - * X4OReaderContext is reader with language context. + * X4OReaderSession is reader with language session. * * @author Willem Cazander * @version 1.0 Apr 6, 2013 */ -public interface X4OReaderContext extends X4OReader { +public interface X4OReaderSession extends X4OReader { - void releaseContext(X4OLanguageSession context) throws X4OPhaseException; + void releaseSession(X4OLanguageSession context) throws X4OPhaseException; /** * Method to parse the xml data. @@ -49,7 +49,7 @@ public interface X4OReaderContext extends X4OReader { * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. */ - X4OLanguageSession readContext(InputStream input,String systemId,URL basePath) throws X4OConnectionException,SAXException,IOException; + X4OLanguageSession readSession(InputStream input,String systemId,URL basePath) throws X4OConnectionException,SAXException,IOException; /** * Reads the file fileName and parses it as an InputStream. @@ -58,9 +58,9 @@ public interface X4OReaderContext extends X4OReader { * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - X4OLanguageSession readFileContext(String fileName) throws X4OConnectionException,SAXException,IOException,FileNotFoundException; + X4OLanguageSession readFileSession(String fileName) throws X4OConnectionException,SAXException,IOException,FileNotFoundException; /** * Reads the file and parses it as an InputStream. @@ -69,9 +69,9 @@ public interface X4OReaderContext extends X4OReader { * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - X4OLanguageSession readFileContext(File file) throws X4OConnectionException,SAXException,IOException,FileNotFoundException; + X4OLanguageSession readFileSession(File file) throws X4OConnectionException,SAXException,IOException,FileNotFoundException; /** * Parses an resource locaction. @@ -79,27 +79,27 @@ public interface X4OReaderContext extends X4OReader { * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - X4OLanguageSession readResourceContext(String resourceName) throws X4OConnectionException,SAXException,IOException; + X4OLanguageSession readResourceSession(String resourceName) throws X4OConnectionException,SAXException,IOException; /** - * Converts a String to a InputStream to is can me parsed by SAX. + * Converts a String to a InputStream to is can be parsed by SAX. * @param xmlString The xml as String to parse. * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - X4OLanguageSession readStringContext(String xmlString) throws X4OConnectionException,SAXException,IOException; + X4OLanguageSession readStringSession(String xmlString) throws X4OConnectionException,SAXException,IOException; /** - * Fetched the data direct from remote url to a InputStream to is can me parsed by SAX. + * Fetched the data direct from remote url to a InputStream to is can be parsed by SAX. * @param url The url to parse. * @throws X4OConnectionException Is thrown after x4o exception. * @throws SAXException Is thrown after sax xml exception. * @throws IOException Is thrown after io exception. - * @see org.x4o.xml.io.X4OReaderContext#readContext(java.io.InputStream,java.lang.String,java.net.URL) + * @see org.x4o.xml.io.X4OReaderSession#readSession(java.io.InputStream,java.lang.String,java.net.URL) */ - X4OLanguageSession readUrlContext(URL url) throws X4OConnectionException,SAXException,IOException; + X4OLanguageSession readUrlSession(URL url) throws X4OConnectionException,SAXException,IOException; } diff --git a/x4o-driver/src/main/java/org/x4o/xml/io/X4OWriterContext.java b/x4o-driver/src/main/java/org/x4o/xml/io/X4OWriterSession.java similarity index 83% rename from x4o-driver/src/main/java/org/x4o/xml/io/X4OWriterContext.java rename to x4o-driver/src/main/java/org/x4o/xml/io/X4OWriterSession.java index 3d5cbd4..e309e8f 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/io/X4OWriterContext.java +++ b/x4o-driver/src/main/java/org/x4o/xml/io/X4OWriterSession.java @@ -30,18 +30,18 @@ import org.x4o.xml.lang.X4OLanguageSession; import org.xml.sax.SAXException; /** - * X4OWriterContext is writer with language context. + * X4OWriterSession is writer with language session. * * @author Willem Cazander * @version 1.0 Apr 6, 2013 */ -public interface X4OWriterContext extends X4OWriter { +public interface X4OWriterSession extends X4OWriter { - void writeContext(X4OLanguageSession context,OutputStream out) throws X4OConnectionException,SAXException,IOException; + void writeSession(X4OLanguageSession context,OutputStream out) throws X4OConnectionException,SAXException,IOException; - void writeFileContext(X4OLanguageSession context,String fileName) throws X4OConnectionException,SAXException,IOException; + void writeFileSession(X4OLanguageSession context,String fileName) throws X4OConnectionException,SAXException,IOException; - void writeFileContext(X4OLanguageSession context,File file) throws X4OConnectionException,SAXException,IOException; + void writeFileSession(X4OLanguageSession context,File file) throws X4OConnectionException,SAXException,IOException; - String writeStringContext(X4OLanguageSession context) throws X4OConnectionException,SAXException,IOException; + String writeStringSession(X4OLanguageSession context) throws X4OConnectionException,SAXException,IOException; } diff --git a/x4o-driver/src/test/java/org/x4o/xml/core/NamespaceUriTest.java b/x4o-driver/src/test/java/org/x4o/xml/core/NamespaceUriTest.java index 57d2c54..862d68e 100644 --- a/x4o-driver/src/test/java/org/x4o/xml/core/NamespaceUriTest.java +++ b/x4o-driver/src/test/java/org/x4o/xml/core/NamespaceUriTest.java @@ -23,7 +23,7 @@ package org.x4o.xml.core; import org.x4o.xml.io.DefaultX4OReader; -import org.x4o.xml.io.X4OReaderContext; +import org.x4o.xml.io.X4OReaderSession; import org.x4o.xml.lang.X4OLanguageSession; import org.x4o.xml.lang.phase.X4OPhase; import org.x4o.xml.test.TestDriver; @@ -42,40 +42,40 @@ public class NamespaceUriTest extends TestCase { public void testSimpleUri() throws Exception { X4OLanguageSession context = null; TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); reader.addPhaseSkip(X4OPhase.READ_RELEASE); try { - context = reader.readResourceContext("tests/namespace/uri-simple.xml"); + context = reader.readResourceSession("tests/namespace/uri-simple.xml"); assertEquals(true,context.getRootElement().getChilderen().size()==1); } finally { - reader.releaseContext(context); + reader.releaseSession(context); } } public void testEmptyUri() throws Exception { X4OLanguageSession context = null; TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); reader.addPhaseSkip(X4OPhase.READ_RELEASE); reader.setProperty(DefaultX4OReader.DOC_EMPTY_NAMESPACE_URI, "http://test.x4o.org/xml/ns/test-lang"); try { - context = reader.readResourceContext("tests/namespace/uri-empty.xml"); + context = reader.readResourceSession("tests/namespace/uri-empty.xml"); assertEquals(true,context.getRootElement().getChilderen().size()==1); } finally { - reader.releaseContext(context); + reader.releaseSession(context); } } public void testSchemaUri() throws Exception { X4OLanguageSession context = null; TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); reader.addPhaseSkip(X4OPhase.READ_RELEASE); try { - context = reader.readResourceContext("tests/namespace/uri-schema.xml"); + context = reader.readResourceSession("tests/namespace/uri-schema.xml"); assertEquals(true,context.getRootElement().getChilderen().size()==1); } finally { - reader.releaseContext(context); + reader.releaseSession(context); } } } diff --git a/x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderContextTest.java b/x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderSessionTest.java similarity index 83% rename from x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderContextTest.java rename to x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderSessionTest.java index ef6ef1b..c73f09f 100644 --- a/x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderContextTest.java +++ b/x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderSessionTest.java @@ -37,12 +37,12 @@ import org.x4o.xml.test.models.TestObjectRoot; import junit.framework.TestCase; /** - * X4OReaderContextTest. + * X4OReaderSessionTest. * * @author Willem Cazander * @version 1.0 Apr 15, 2013 */ -public class X4OReaderContextTest extends TestCase { +public class X4OReaderSessionTest extends TestCase { private File copyResourceToTempFile() throws IOException { File tempFile = File.createTempFile("test-resource", ".xml"); @@ -60,9 +60,9 @@ public class X4OReaderContextTest extends TestCase { public void testReadFileName() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); File xmlFile = copyResourceToTempFile(); - X4OLanguageSession context = reader.readFileContext(xmlFile.getAbsolutePath()); + X4OLanguageSession context = reader.readFileSession(xmlFile.getAbsolutePath()); TestObjectRoot root = (TestObjectRoot)context.getRootElement().getElementObject(); assertNotNull(root); assertTrue(root.getTestBeans().size()>0); @@ -72,11 +72,11 @@ public class X4OReaderContextTest extends TestCase { public void testReadFileNameNull() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); Exception e = null; try { String nullFileName = null; - reader.readFileContext(nullFileName); + reader.readFileSession(nullFileName); } catch (Exception catchE) { e = catchE; } @@ -88,9 +88,9 @@ public class X4OReaderContextTest extends TestCase { public void testReadFile() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); File xmlFile = copyResourceToTempFile(); - X4OLanguageSession context = reader.readFileContext(xmlFile); + X4OLanguageSession context = reader.readFileSession(xmlFile); TestObjectRoot root = (TestObjectRoot)context.getRootElement().getElementObject(); assertNotNull(root); assertTrue(root.getTestBeans().size()>0); @@ -100,11 +100,11 @@ public class X4OReaderContextTest extends TestCase { public void testReadFileNull() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); Exception e = null; try { File nullFile = null; - reader.readFileContext(nullFile); + reader.readFileSession(nullFile); } catch (Exception catchE) { e = catchE; } @@ -116,12 +116,12 @@ public class X4OReaderContextTest extends TestCase { public void testReadFileNotExists() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); Exception e = null; try { File tempFile = File.createTempFile("test-file", ".xml"); tempFile.delete(); - reader.readFileContext(tempFile); + reader.readFileSession(tempFile); } catch (Exception catchE) { e = catchE; } @@ -136,10 +136,10 @@ public class X4OReaderContextTest extends TestCase { return; // only test on real os. } TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); Exception e = null; try { - reader.readFileContext(new File("/etc/shadow")); + reader.readFileSession(new File("/etc/shadow")); } catch (Exception catchE) { e = catchE; } @@ -152,18 +152,18 @@ public class X4OReaderContextTest extends TestCase { public void testReadResource() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); - X4OLanguageSession context = reader.readResourceContext("tests/attributes/test-bean.xml"); + X4OReaderSession reader = driver.createReaderSession(); + X4OLanguageSession context = reader.readResourceSession("tests/attributes/test-bean.xml"); TestObjectRoot root = (TestObjectRoot)context.getRootElement().getElementObject(); assertNotNull(root); } public void testReadResourceNull() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); Exception e = null; try { - reader.readResourceContext(null); + reader.readResourceSession(null); } catch (Exception catchE) { e = catchE; } @@ -175,8 +175,8 @@ public class X4OReaderContextTest extends TestCase { public void testReadString() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); - X4OLanguageSession context = reader.readStringContext( + X4OReaderSession reader = driver.createReaderSession(); + X4OLanguageSession context = reader.readStringSession( ""+ ""+ ""+ @@ -192,10 +192,10 @@ public class X4OReaderContextTest extends TestCase { public void testReadStringNull() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); Exception e = null; try { - reader.readStringContext(null); + reader.readStringSession(null); } catch (Exception catchE) { e = catchE; } @@ -207,9 +207,9 @@ public class X4OReaderContextTest extends TestCase { public void testReadUrl() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); URL xmlUrl = Thread.currentThread().getContextClassLoader().getResource("tests/attributes/test-bean.xml"); - X4OLanguageSession context = reader.readUrlContext(xmlUrl); + X4OLanguageSession context = reader.readUrlSession(xmlUrl); TestObjectRoot root = (TestObjectRoot)context.getRootElement().getElementObject(); assertNotNull(root); assertTrue(root.getTestBeans().size()>0); @@ -219,10 +219,10 @@ public class X4OReaderContextTest extends TestCase { public void testReadUrlNull() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); Exception e = null; try { - reader.readUrlContext(null); + reader.readUrlSession(null); } catch (Exception catchE) { e = catchE; } diff --git a/x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderTest.java b/x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderTest.java index 41edff5..1189abd 100644 --- a/x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderTest.java +++ b/x4o-driver/src/test/java/org/x4o/xml/io/X4OReaderTest.java @@ -60,7 +60,7 @@ public class X4OReaderTest extends TestCase { public void testReadInputStream() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); File xmlFile = copyResourceToTempFile(); URL basePath = new File(xmlFile.getAbsolutePath()).toURI().toURL(); InputStream inputStream = new FileInputStream(xmlFile); diff --git a/x4o-driver/src/test/java/org/x4o/xml/io/X4OWriterContextTest.java b/x4o-driver/src/test/java/org/x4o/xml/io/X4OWriterSessionTest.java similarity index 88% rename from x4o-driver/src/test/java/org/x4o/xml/io/X4OWriterContextTest.java rename to x4o-driver/src/test/java/org/x4o/xml/io/X4OWriterSessionTest.java index 216db9c..dd7d5e1 100644 --- a/x4o-driver/src/test/java/org/x4o/xml/io/X4OWriterContextTest.java +++ b/x4o-driver/src/test/java/org/x4o/xml/io/X4OWriterSessionTest.java @@ -38,12 +38,12 @@ import org.xml.sax.SAXException; import junit.framework.TestCase; /** - * X4OWriterContextTest. + * X4OWriterSessionTest. * * @author Willem Cazander * @version 1.0 Apr 28, 2013 */ -public class X4OWriterContextTest extends TestCase { +public class X4OWriterSessionTest extends TestCase { private File createOutputFile() throws IOException { File outputFile = File.createTempFile("test-writer-context", ".xml"); @@ -72,9 +72,9 @@ public class X4OWriterContextTest extends TestCase { public void testWriteFile() throws Exception { File outputFile = createOutputFile(); X4ODriver driver = TestDriver.getInstance(); - X4OWriterContext writer = driver.createWriterContext(); + X4OWriterSession writer = driver.createWriterSession(); - writer.writeFileContext(createContext(), outputFile); + writer.writeFileSession(createContext(), outputFile); String text = X4OWriterTest.readFile( outputFile ); outputFile.delete(); @@ -86,11 +86,11 @@ public class X4OWriterContextTest extends TestCase { public void testWriteFileNull() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OWriterContext writer = driver.createWriterContext(); + X4OWriterSession writer = driver.createWriterSession(); Exception e = null; File nullFile = null; try { - writer.writeFileContext(createContext(), nullFile); + writer.writeFileSession(createContext(), nullFile); } catch (Exception catchE) { e = catchE; } @@ -103,9 +103,9 @@ public class X4OWriterContextTest extends TestCase { public void testWriteFileName() throws Exception { File outputFile = createOutputFile(); X4ODriver driver = TestDriver.getInstance(); - X4OWriterContext writer = driver.createWriterContext(); + X4OWriterSession writer = driver.createWriterSession(); - writer.writeFileContext(createContext(), outputFile.getAbsolutePath()); + writer.writeFileSession(createContext(), outputFile.getAbsolutePath()); String text = X4OWriterTest.readFile( outputFile ); outputFile.delete(); @@ -117,11 +117,11 @@ public class X4OWriterContextTest extends TestCase { public void testWriteFileNameNull() throws Exception { TestDriver driver = TestDriver.getInstance(); - X4OWriterContext writer = driver.createWriterContext(); + X4OWriterSession writer = driver.createWriterSession(); Exception e = null; String nullFileName = null; try { - writer.writeFileContext(createContext(), nullFileName); + writer.writeFileSession(createContext(), nullFileName); } catch (Exception catchE) { e = catchE; } @@ -134,11 +134,11 @@ public class X4OWriterContextTest extends TestCase { public void testWriteStream() throws Exception { File outputFile = createOutputFile(); X4ODriver driver = TestDriver.getInstance(); - X4OWriterContext writer = driver.createWriterContext(); + X4OWriterSession writer = driver.createWriterSession(); OutputStream outputStream = new FileOutputStream(outputFile); try { - writer.writeContext(createContext(),outputStream); + writer.writeSession(createContext(),outputStream); } finally { outputStream.close(); } diff --git a/x4o-driver/src/test/java/org/x4o/xml/io/sax/ContentWriterXmlTest.java b/x4o-driver/src/test/java/org/x4o/xml/io/sax/ContentWriterXmlTest.java index 19c47d0..5c0b50b 100644 --- a/x4o-driver/src/test/java/org/x4o/xml/io/sax/ContentWriterXmlTest.java +++ b/x4o-driver/src/test/java/org/x4o/xml/io/sax/ContentWriterXmlTest.java @@ -235,7 +235,7 @@ public class ContentWriterXmlTest extends TestCase { String output = outputWriter.toString(); assertNotNull(output); assertTrue(output.length()>0); - assertTrue(output.equals("\n")); + assertTrue(output.equals("\n")); } public void testCommentEscape() throws Exception { @@ -243,7 +243,7 @@ public class ContentWriterXmlTest extends TestCase { ContentWriterXml writer = new ContentWriterXml(outputWriter); writer.startDocument(); - writer.comment(""); + writer.comment(""); writer.endDocument(); String output = outputWriter.toString(); diff --git a/x4o-driver/src/test/java/org/x4o/xml/test/TestDriver.java b/x4o-driver/src/test/java/org/x4o/xml/test/TestDriver.java index 350ad00..4ec44ae 100644 --- a/x4o-driver/src/test/java/org/x4o/xml/test/TestDriver.java +++ b/x4o-driver/src/test/java/org/x4o/xml/test/TestDriver.java @@ -24,8 +24,8 @@ package org.x4o.xml.test; import org.x4o.xml.X4ODriver; import org.x4o.xml.X4ODriverManager; -import org.x4o.xml.io.X4OReaderContext; -import org.x4o.xml.io.X4OWriterContext; +import org.x4o.xml.io.X4OReaderSession; +import org.x4o.xml.io.X4OWriterSession; import org.x4o.xml.test.models.TestObjectRoot; public class TestDriver extends X4ODriver { diff --git a/x4o-meta/src/test/java/org/x4o/xml/lang/meta/ParentObjectTest.java b/x4o-meta/src/test/java/org/x4o/xml/lang/meta/ParentObjectTest.java index 71960df..3598ae1 100644 --- a/x4o-meta/src/test/java/org/x4o/xml/lang/meta/ParentObjectTest.java +++ b/x4o-meta/src/test/java/org/x4o/xml/lang/meta/ParentObjectTest.java @@ -26,7 +26,7 @@ import javax.swing.JLabel; import org.x4o.xml.element.DefaultElement; import org.x4o.xml.element.Element; -import org.x4o.xml.io.X4OReaderContext; +import org.x4o.xml.io.X4OReaderSession; import org.x4o.xml.lang.X4OLanguageSession; import org.x4o.xml.lang.phase.X4OPhase; @@ -43,16 +43,16 @@ public class ParentObjectTest extends TestCase { public void testParentElement() throws Exception { X4OLanguageSession context = null; MTestDriver driver = new MTestDriver(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); reader.addPhaseSkip(X4OPhase.READ_RELEASE); try { - context = reader.readResourceContext("junit/test-meta-parent-element.xml"); + context = reader.readResourceSession("junit/test-meta-parent-element.xml"); assertEquals(1,context.getRootElement().getChilderen().size()); Element childElement = context.getRootElement().getChilderen().get(0); JLabel test = (JLabel)childElement.getElementObject(); assertEquals("parentTest",test.getText()); } finally { - reader.releaseContext(context); + reader.releaseSession(context); } } diff --git a/x4o-meta/src/test/java/org/x4o/xml/lang/meta/ReferenceStoreTest.java b/x4o-meta/src/test/java/org/x4o/xml/lang/meta/ReferenceStoreTest.java index b81981f..1584af5 100644 --- a/x4o-meta/src/test/java/org/x4o/xml/lang/meta/ReferenceStoreTest.java +++ b/x4o-meta/src/test/java/org/x4o/xml/lang/meta/ReferenceStoreTest.java @@ -24,7 +24,7 @@ package org.x4o.xml.lang.meta; import java.util.Date; -import org.x4o.xml.io.X4OReaderContext; +import org.x4o.xml.io.X4OReaderSession; import org.x4o.xml.lang.X4OLanguageSession; import org.x4o.xml.lang.phase.X4OPhase; @@ -41,42 +41,42 @@ public class ReferenceStoreTest extends TestCase { public void testMetaGeneric() throws Exception { X4OLanguageSession context = null; MTestDriver driver = new MTestDriver(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); reader.addPhaseSkip(X4OPhase.READ_RELEASE); try { - context = reader.readResourceContext("junit/test-meta-generic.xml"); + context = reader.readResourceSession("junit/test-meta-generic.xml"); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(0).getElementObject().getClass().getName()); } finally { - reader.releaseContext(context); + reader.releaseSession(context); } } public void testLoadClass() throws Exception { X4OLanguageSession context = null; MTestDriver driver = new MTestDriver(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); reader.addPhaseSkip(X4OPhase.READ_RELEASE); try { - context = reader.readResourceContext("junit/test-meta-reference.xml"); + context = reader.readResourceSession("junit/test-meta-reference.xml"); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(0).getElementObject().getClass().getName()); } finally { - reader.releaseContext(context); + reader.releaseSession(context); } } public void testStoreRef() throws Exception { X4OLanguageSession context = null; MTestDriver driver = new MTestDriver(); - X4OReaderContext reader = driver.createReaderContext(); + X4OReaderSession reader = driver.createReaderSession(); reader.addPhaseSkip(X4OPhase.READ_RELEASE); try { - context = reader.readResourceContext("junit/test-meta-reference.xml"); + context = reader.readResourceSession("junit/test-meta-reference.xml"); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(0).getElementObject().getClass().getName()); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(1).getElementObject().getClass().getName()); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(2).getElementObject().getClass().getName()); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(3).getElementObject().getClass().getName()); } finally { - reader.releaseContext(context); + reader.releaseSession(context); } } diff --git a/x4o-plugin/x4o-plugin-ant/src/test/resources/junit/test-write-language-doc.xml b/x4o-plugin/x4o-plugin-ant/src/test/resources/junit/test-write-language-doc.xml index 97c45e3..e023c30 100644 --- a/x4o-plugin/x4o-plugin-ant/src/test/resources/junit/test-write-language-doc.xml +++ b/x4o-plugin/x4o-plugin-ant/src/test/resources/junit/test-write-language-doc.xml @@ -37,7 +37,7 @@ @@ -47,7 +47,7 @@ @@ -57,7 +57,7 @@ @@ -67,24 +67,24 @@ diff --git a/x4o-plugin/x4o-plugin-ant/src/test/resources/junit/test-write-language-schema.xml b/x4o-plugin/x4o-plugin-ant/src/test/resources/junit/test-write-language-schema.xml index 95aa3ed..b2793e7 100644 --- a/x4o-plugin/x4o-plugin-ant/src/test/resources/junit/test-write-language-schema.xml +++ b/x4o-plugin/x4o-plugin-ant/src/test/resources/junit/test-write-language-schema.xml @@ -37,7 +37,7 @@ @@ -47,11 +47,11 @@ @@ -61,11 +61,11 @@ diff --git a/x4o-plugin/x4o-plugin-maven/src/test/resources/junit/test-plugin-conf-all.pom b/x4o-plugin/x4o-plugin-maven/src/test/resources/junit/test-plugin-conf-all.pom index 1831bcb..3d72e16 100644 --- a/x4o-plugin/x4o-plugin-maven/src/test/resources/junit/test-plugin-conf-all.pom +++ b/x4o-plugin/x4o-plugin-maven/src/test/resources/junit/test-plugin-conf-all.pom @@ -46,10 +46,11 @@ x4o-plugin-maven - target/jtest/test-plugin-conf-all - - 1.0 - + cel + eld-xsd + + http://x4o.org/properties/eld-xsd/output/path=target/jtest/test-plugin-conf-all/cel + false false diff --git a/x4o-plugin/x4o-plugin-maven/src/test/resources/junit/test-plugin-conf-lang.pom b/x4o-plugin/x4o-plugin-maven/src/test/resources/junit/test-plugin-conf-lang.pom index 8c23a77..25990ec 100644 --- a/x4o-plugin/x4o-plugin-maven/src/test/resources/junit/test-plugin-conf-lang.pom +++ b/x4o-plugin/x4o-plugin-maven/src/test/resources/junit/test-plugin-conf-lang.pom @@ -49,7 +49,7 @@ cel eld-xsd - http://language.x4o.org/xml/properties/eld-xsd/output/path=target/jtest/test-plugin-conf-lang/cel + http://x4o.org/properties/eld-xsd/output/path=target/jtest/test-plugin-conf-lang/cel