From a3863c16379a64937281e2a1f0a4ed095733b293 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Fri, 7 Mar 2014 16:06:10 +0100 Subject: [PATCH] Moved phase ids to the seperated phase classes. --- .../java/org/x4o/xml/io/DefaultX4OWriter.java | 3 +- .../xml/lang/DefaultX4OLanguageLoader.java | 5 +- .../lang/phase/DefaultX4OPhaseManager.java | 8 +- .../java/org/x4o/xml/lang/phase/X4OPhase.java | 11 --- .../xml/lang/phase/X4OPhaseLanguageInit.java | 18 +++-- .../xml/lang/phase/X4OPhaseLanguageRead.java | 73 +++++++++++-------- .../xml/lang/phase/X4OPhaseLanguageWrite.java | 18 +++-- .../java/org/x4o/xml/core/EmptyXmlTest.java | 1 - .../org/x4o/xml/core/NamespaceUriTest.java | 8 +- .../x4o/xml/lang/meta/ParentObjectTest.java | 4 +- .../x4o/xml/lang/meta/ReferenceStoreTest.java | 8 +- 11 files changed, 85 insertions(+), 72 deletions(-) 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 ed79700..d06853b 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 @@ -47,6 +47,7 @@ import org.x4o.xml.lang.X4OLanguageSession; import org.x4o.xml.lang.X4OLanguageModule; import org.x4o.xml.lang.phase.X4OPhase; import org.x4o.xml.lang.phase.X4OPhaseException; +import org.x4o.xml.lang.phase.X4OPhaseLanguageWrite; import org.x4o.xml.lang.phase.X4OPhaseType; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; @@ -102,7 +103,7 @@ public class DefaultX4OWriter extends AbstractX4OWriter { */ public void writeSession(X4OLanguageSession languageSession,OutputStream output) throws X4OConnectionException,SAXException,IOException { setProperty(OUTPUT_STREAM, output); - addPhaseSkip(X4OPhase.WRITE_RELEASE); + addPhaseSkip(X4OPhaseLanguageWrite.WRITE_RELEASE); try { languageSession.getLanguage().getPhaseManager().runPhases(languageSession, X4OPhaseType.XML_WRITE); } catch (X4OPhaseException e) { diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java b/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java index e0a0dcd..828289e 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/DefaultX4OLanguageLoader.java @@ -33,6 +33,7 @@ import java.util.logging.Logger; import org.x4o.xml.eld.EldDriver; import org.x4o.xml.eld.EldModuleLoader; +import org.x4o.xml.lang.phase.X4OPhaseLanguageInit; import org.x4o.xml.lang.phase.X4OPhaseLanguageInit.X4OPhaseInitLanguageSiblings; import org.xml.sax.Attributes; import org.xml.sax.InputSource; @@ -135,8 +136,8 @@ TODO: if (language.getLanguageConfiguration().hasX4ODebugWriter()) { } loadModule(languageLocal,loader,value,versionedResources); if (loader instanceof X4OLanguageModuleLoaderSibling) { - - X4OPhaseInitLanguageSiblings sibPhase = (X4OPhaseInitLanguageSiblings)languageLocal.getPhaseManager().getPhase("INIT_LANG_SIB"); + // mmm + X4OPhaseInitLanguageSiblings sibPhase = (X4OPhaseInitLanguageSiblings)languageLocal.getPhaseManager().getPhase(X4OPhaseLanguageInit.INIT_LANG_SIB); sibPhase.addLanguageModuleLoaderSibling((X4OLanguageModuleLoaderSibling)loader); } } diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/DefaultX4OPhaseManager.java b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/DefaultX4OPhaseManager.java index 6566fdd..6f2df87 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/DefaultX4OPhaseManager.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/DefaultX4OPhaseManager.java @@ -209,11 +209,11 @@ PHASE_ORDER = { *startupX4OPhase, public void doReleasePhaseManual(X4OLanguageSession languageSession) throws X4OPhaseException { List phaseSkip = languageSession.getPhaseSkip(); String releaseRequested = null; - if (phaseSkip.contains(X4OPhase.READ_RELEASE)) { - releaseRequested = X4OPhase.READ_RELEASE; + if (phaseSkip.contains(X4OPhaseLanguageRead.READ_RELEASE)) { + releaseRequested = X4OPhaseLanguageRead.READ_RELEASE; } - if (phaseSkip.contains(X4OPhase.WRITE_RELEASE)) { - releaseRequested = X4OPhase.WRITE_RELEASE; + if (phaseSkip.contains(X4OPhaseLanguageWrite.WRITE_RELEASE)) { + releaseRequested = X4OPhaseLanguageWrite.WRITE_RELEASE; } if (releaseRequested==null) { throw new IllegalStateException("No manual release requested."); diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhase.java b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhase.java index d73108c..6119fc1 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhase.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhase.java @@ -36,17 +36,6 @@ import org.x4o.xml.lang.X4OLanguageSession; */ public interface X4OPhase { - public final static String INIT_BEGIN = "INIT_BEGIN"; - public final static String INIT_END = "INIT_END"; - - public final static String READ_BEGIN = "READ_BEGIN"; - public final static String READ_END = "READ_END"; - public final static String READ_RELEASE = "READ_RELEASE"; - - public final static String WRITE_BEGIN = "WRITE_BEGIN"; - public final static String WRITE_END = "WRITE_END"; - public final static String WRITE_RELEASE = "WRITE_RELEASE"; - X4OPhaseType getType(); /** diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageInit.java b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageInit.java index 06a2e6f..99d5aa0 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageInit.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageInit.java @@ -42,6 +42,10 @@ import org.x4o.xml.lang.X4OLanguageLocal; public class X4OPhaseLanguageInit { private Logger logger = null; + public static final String INIT_START = "INIT_START"; + public static final String INIT_LANG = "INIT_LANG"; + public static final String INIT_LANG_SIB = "INIT_LANG_SIB"; + public static final String INIT_END = "INIT_END"; public X4OPhaseLanguageInit() { logger = Logger.getLogger(X4OPhaseLanguageInit.class.getName()); @@ -62,7 +66,7 @@ public class X4OPhaseLanguageInit { return X4OPhaseType.INIT; } public String getId() { - return "INIT_START"; + return INIT_START; } public String[] getPhaseDependencies() { return new String[]{}; @@ -86,10 +90,10 @@ public class X4OPhaseLanguageInit { return X4OPhaseType.INIT; } public String getId() { - return "INIT_LANG"; + return INIT_LANG; } public String[] getPhaseDependencies() { - return new String[]{"INIT_START"}; + return new String[]{INIT_START}; } public boolean isElementPhase() { return false; @@ -124,10 +128,10 @@ public class X4OPhaseLanguageInit { return X4OPhaseType.INIT; } public String getId() { - return "INIT_LANG_SIB"; + return INIT_LANG_SIB; } public String[] getPhaseDependencies() { - return new String[] {"INIT_LANG"}; + return new String[] {INIT_LANG}; } public boolean isElementPhase() { return false; @@ -161,10 +165,10 @@ public class X4OPhaseLanguageInit { return X4OPhaseType.INIT; } public String getId() { - return "INIT_END"; + return INIT_END; } public String[] getPhaseDependencies() { - return new String[]{"INIT_LANG_SIB"}; + return new String[]{INIT_LANG_SIB}; } public boolean isElementPhase() { return false; diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageRead.java b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageRead.java index 0605a8a..ad65d4a 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageRead.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageRead.java @@ -58,6 +58,21 @@ import org.xml.sax.helpers.AttributesImpl; public class X4OPhaseLanguageRead { private Logger logger = null; + public static final String READ_BEGIN = "READ_BEGIN"; + public static final String READ_CONFIG_ELEMENT = "READ_CONFIG_ELEMENT"; + public static final String READ_CONFIG_ELEMENT_INTERFACE = "READ_CONFIG_ELEMENT_INTERFACE"; + public static final String READ_CONFIG_GLOBAL_ELEMENT = "READ_CONFIG_GLOBAL_ELEMENT"; + public static final String READ_CONFIG_GLOBAL_ATTRIBUTE = "READ_CONFIG_GLOBAL_ATTRIBUTE"; + public static final String READ_RUN_ATTRIBUTE = "READ_RUN_ATTRIBUTE"; + public static final String READ_FILL_TEMPLATE = "READ_FILL_TEMPLATE"; + public static final String READ_TRANSFORM = "READ_TRANSFORM"; + public static final String READ_RUN_DIRTY = "READ_RUN_DIRTY"; + public static final String READ_BIND_ELEMENT = "READ_BIND_ELEMENT"; + public static final String READ_RUN = "READ_RUN"; + public static final String READ_RUN_CONFIGURATOR = "READ_RUN_CONFIGURATOR"; + public static final String READ_RUN_DIRTY_LAST = "READ_RUN_DIRTY_LAST"; + public static final String READ_END = "READ_END"; + public static final String READ_RELEASE = "READ_RELEASE"; public X4OPhaseLanguageRead() { logger = Logger.getLogger(X4OPhaseLanguageRead.class.getName()); @@ -136,7 +151,7 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return X4OPhase.READ_BEGIN; + return READ_BEGIN; } public String[] getPhaseDependencies() { return new String[]{}; @@ -172,10 +187,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_CONFIG_ELEMENT"; + return READ_CONFIG_ELEMENT; } public String[] getPhaseDependencies() { - return new String[] {X4OPhase.READ_BEGIN}; + return new String[] {READ_BEGIN}; } public void runElementPhase(Element element) throws X4OPhaseException { @@ -213,10 +228,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_CONFIG_ELEMENT_INTERFACE"; + return READ_CONFIG_ELEMENT_INTERFACE; } public String[] getPhaseDependencies() { - return new String[] {"READ_CONFIG_ELEMENT"}; + return new String[] {READ_CONFIG_ELEMENT}; } public void runElementPhase(Element element) throws X4OPhaseException { if (element.getElementObject()==null) { @@ -244,10 +259,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_CONFIG_GLOBAL_ELEMENT"; + return READ_CONFIG_GLOBAL_ELEMENT; } public String[] getPhaseDependencies() { - return new String[] {"READ_CONFIG_ELEMENT","READ_CONFIG_ELEMENT_INTERFACE"}; + return new String[] {READ_CONFIG_ELEMENT,READ_CONFIG_ELEMENT_INTERFACE}; } public void runElementPhase(Element element) throws X4OPhaseException { for (X4OLanguageModule mod:element.getLanguageSession().getLanguage().getLanguageModules()) { @@ -272,10 +287,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_CONFIG_GLOBAL_ATTRIBUTE"; + return READ_CONFIG_GLOBAL_ATTRIBUTE; } public String[] getPhaseDependencies() { - return new String[] {"READ_CONFIG_GLOBAL_ELEMENT"}; + return new String[] {READ_CONFIG_GLOBAL_ELEMENT}; } @SuppressWarnings("unchecked") public void runElementPhase(Element element) throws X4OPhaseException { @@ -317,10 +332,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_RUN_ATTRIBUTE"; + return READ_RUN_ATTRIBUTE; } public String[] getPhaseDependencies() { - return new String[] {"READ_CONFIG_GLOBAL_ATTRIBUTE"}; + return new String[] {READ_CONFIG_GLOBAL_ATTRIBUTE}; } public void runElementPhase(Element element) throws X4OPhaseException { // we only can config ElementObjects @@ -393,10 +408,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_FILL_TEMPLATE"; + return READ_FILL_TEMPLATE; } public String[] getPhaseDependencies() { - return new String[] {"READ_RUN_ATTRIBUTE"}; + return new String[] {READ_RUN_ATTRIBUTE}; } public void runElementPhase(Element element) throws X4OPhaseException { } @@ -410,10 +425,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_TRANSFORM"; + return READ_TRANSFORM; } public String[] getPhaseDependencies() { - return new String[] {"READ_FILL_TEMPLATE"}; + return new String[] {READ_FILL_TEMPLATE}; } public void runElementPhase(Element element) throws X4OPhaseException { if (element.isTransformingTree()==false) { @@ -442,10 +457,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_RUN_DIRTY"; + return READ_RUN_DIRTY; } public String[] getPhaseDependencies() { - return new String[] {"READ_TRANSFORM"}; + return new String[] {READ_TRANSFORM}; } public void runElementPhase(Element element) throws X4OPhaseException { Map dirtyElements = element.getLanguageSession().getDirtyElements(); @@ -473,10 +488,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_RUN_DIRTY_LAST"; + return READ_RUN_DIRTY_LAST; } public String[] getPhaseDependencies() { - return new String[] {"READ_RUN"}; + return new String[] {READ_RUN}; } public void runElementPhase(Element element) throws X4OPhaseException { Map dirtyElements = element.getLanguageSession().getDirtyElements(); @@ -500,10 +515,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_BIND_ELEMENT"; + return READ_BIND_ELEMENT; } public String[] getPhaseDependencies() { - return new String[] {"READ_RUN_DIRTY"}; + return new String[] {READ_RUN_DIRTY}; } public void runElementPhase(Element element) throws X4OPhaseException { Element parentElement = element.getParent(); @@ -545,10 +560,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_RUN"; + return READ_RUN; } public String[] getPhaseDependencies() { - return new String[] {"READ_BIND_ELEMENT"}; + return new String[] {READ_BIND_ELEMENT}; } public void runElementPhase(Element element) throws X4OPhaseException { if (element.isTransformingTree()) { @@ -574,10 +589,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return "READ_RUN_CONFIGURATOR"; + return READ_RUN_CONFIGURATOR; } public String[] getPhaseDependencies() { - return new String[] {"READ_RUN"}; + return new String[] {READ_RUN}; } public boolean isElementPhase() { return false; @@ -634,10 +649,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return X4OPhase.READ_END; + return READ_END; } public String[] getPhaseDependencies() { - return new String[]{"READ_RUN_CONFIGURATOR"}; + return new String[]{READ_RUN_CONFIGURATOR}; } public boolean isElementPhase() { return false; @@ -701,10 +716,10 @@ public class X4OPhaseLanguageRead { return X4OPhaseType.XML_READ; } public String getId() { - return X4OPhase.READ_RELEASE; + return READ_RELEASE; } public String[] getPhaseDependencies() { - return new String[] {X4OPhase.READ_END}; + return new String[] {READ_END}; } public void runPhase(X4OLanguageSession languageSession) throws X4OPhaseException { } diff --git a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageWrite.java b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageWrite.java index 8d6dad0..5714eb2 100644 --- a/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageWrite.java +++ b/x4o-driver/src/main/java/org/x4o/xml/lang/phase/X4OPhaseLanguageWrite.java @@ -43,6 +43,10 @@ import org.x4o.xml.lang.X4OLanguageSession; public class X4OPhaseLanguageWrite { private Logger logger = null; + public static final String WRITE_BEGIN = "WRITE_BEGIN"; + public static final String WRITE_FILL_TREE = "WRITE_FILL_TREE"; + public static final String WRITE_END = "WRITE_END"; + public static final String WRITE_RELEASE = "WRITE_RELEASE"; public X4OPhaseLanguageWrite() { logger = Logger.getLogger(X4OPhaseLanguageWrite.class.getName()); @@ -63,7 +67,7 @@ public class X4OPhaseLanguageWrite { return X4OPhaseType.XML_WRITE; } public String getId() { - return X4OPhase.WRITE_BEGIN; + return WRITE_BEGIN; } public String[] getPhaseDependencies() { return new String[]{}; @@ -86,10 +90,10 @@ public class X4OPhaseLanguageWrite { return X4OPhaseType.XML_WRITE; } public String getId() { - return "WRITE_FILL_TREE"; + return WRITE_FILL_TREE; } public String[] getPhaseDependencies() { - return new String[]{X4OPhase.WRITE_BEGIN}; + return new String[]{WRITE_BEGIN}; } public boolean isElementPhase() { return false; @@ -164,10 +168,10 @@ public class X4OPhaseLanguageWrite { return X4OPhaseType.XML_WRITE; } public String getId() { - return X4OPhase.WRITE_END; + return WRITE_END; } public String[] getPhaseDependencies() { - return new String[]{"WRITE_FILL_TREE"}; + return new String[]{WRITE_FILL_TREE}; } public boolean isElementPhase() { return false; @@ -184,10 +188,10 @@ public class X4OPhaseLanguageWrite { return X4OPhaseType.XML_WRITE; } public String getId() { - return X4OPhase.WRITE_RELEASE; + return WRITE_RELEASE; } public String[] getPhaseDependencies() { - return new String[] {X4OPhase.WRITE_END}; + return new String[] {WRITE_END}; } public void runPhase(X4OLanguageSession languageSession) throws X4OPhaseException { } diff --git a/x4o-driver/src/test/java/org/x4o/xml/core/EmptyXmlTest.java b/x4o-driver/src/test/java/org/x4o/xml/core/EmptyXmlTest.java index 05a398a..d58f4fc 100644 --- a/x4o-driver/src/test/java/org/x4o/xml/core/EmptyXmlTest.java +++ b/x4o-driver/src/test/java/org/x4o/xml/core/EmptyXmlTest.java @@ -29,7 +29,6 @@ import org.x4o.xml.io.X4OReader; import org.x4o.xml.test.TestDriver; import org.x4o.xml.test.models.TestObjectRoot; import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; import junit.framework.TestCase; /** 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 862d68e..a079609 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 @@ -25,7 +25,7 @@ package org.x4o.xml.core; import org.x4o.xml.io.DefaultX4OReader; import org.x4o.xml.io.X4OReaderSession; import org.x4o.xml.lang.X4OLanguageSession; -import org.x4o.xml.lang.phase.X4OPhase; +import org.x4o.xml.lang.phase.X4OPhaseLanguageRead; import org.x4o.xml.test.TestDriver; import org.x4o.xml.test.models.TestObjectRoot; @@ -43,7 +43,7 @@ public class NamespaceUriTest extends TestCase { X4OLanguageSession context = null; TestDriver driver = TestDriver.getInstance(); X4OReaderSession reader = driver.createReaderSession(); - reader.addPhaseSkip(X4OPhase.READ_RELEASE); + reader.addPhaseSkip(X4OPhaseLanguageRead.READ_RELEASE); try { context = reader.readResourceSession("tests/namespace/uri-simple.xml"); assertEquals(true,context.getRootElement().getChilderen().size()==1); @@ -56,7 +56,7 @@ public class NamespaceUriTest extends TestCase { X4OLanguageSession context = null; TestDriver driver = TestDriver.getInstance(); X4OReaderSession reader = driver.createReaderSession(); - reader.addPhaseSkip(X4OPhase.READ_RELEASE); + reader.addPhaseSkip(X4OPhaseLanguageRead.READ_RELEASE); reader.setProperty(DefaultX4OReader.DOC_EMPTY_NAMESPACE_URI, "http://test.x4o.org/xml/ns/test-lang"); try { context = reader.readResourceSession("tests/namespace/uri-empty.xml"); @@ -70,7 +70,7 @@ public class NamespaceUriTest extends TestCase { X4OLanguageSession context = null; TestDriver driver = TestDriver.getInstance(); X4OReaderSession reader = driver.createReaderSession(); - reader.addPhaseSkip(X4OPhase.READ_RELEASE); + reader.addPhaseSkip(X4OPhaseLanguageRead.READ_RELEASE); try { context = reader.readResourceSession("tests/namespace/uri-schema.xml"); assertEquals(true,context.getRootElement().getChilderen().size()==1); 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 3598ae1..40168da 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 @@ -28,7 +28,7 @@ import org.x4o.xml.element.DefaultElement; import org.x4o.xml.element.Element; import org.x4o.xml.io.X4OReaderSession; import org.x4o.xml.lang.X4OLanguageSession; -import org.x4o.xml.lang.phase.X4OPhase; +import org.x4o.xml.lang.phase.X4OPhaseLanguageRead; import junit.framework.TestCase; @@ -44,7 +44,7 @@ public class ParentObjectTest extends TestCase { X4OLanguageSession context = null; MTestDriver driver = new MTestDriver(); X4OReaderSession reader = driver.createReaderSession(); - reader.addPhaseSkip(X4OPhase.READ_RELEASE); + reader.addPhaseSkip(X4OPhaseLanguageRead.READ_RELEASE); try { context = reader.readResourceSession("junit/test-meta-parent-element.xml"); assertEquals(1,context.getRootElement().getChilderen().size()); 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 1584af5..9930d2e 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 @@ -26,7 +26,7 @@ import java.util.Date; import org.x4o.xml.io.X4OReaderSession; import org.x4o.xml.lang.X4OLanguageSession; -import org.x4o.xml.lang.phase.X4OPhase; +import org.x4o.xml.lang.phase.X4OPhaseLanguageRead; import junit.framework.TestCase; @@ -42,7 +42,7 @@ public class ReferenceStoreTest extends TestCase { X4OLanguageSession context = null; MTestDriver driver = new MTestDriver(); X4OReaderSession reader = driver.createReaderSession(); - reader.addPhaseSkip(X4OPhase.READ_RELEASE); + reader.addPhaseSkip(X4OPhaseLanguageRead.READ_RELEASE); try { context = reader.readResourceSession("junit/test-meta-generic.xml"); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(0).getElementObject().getClass().getName()); @@ -55,7 +55,7 @@ public class ReferenceStoreTest extends TestCase { X4OLanguageSession context = null; MTestDriver driver = new MTestDriver(); X4OReaderSession reader = driver.createReaderSession(); - reader.addPhaseSkip(X4OPhase.READ_RELEASE); + reader.addPhaseSkip(X4OPhaseLanguageRead.READ_RELEASE); try { context = reader.readResourceSession("junit/test-meta-reference.xml"); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(0).getElementObject().getClass().getName()); @@ -68,7 +68,7 @@ public class ReferenceStoreTest extends TestCase { X4OLanguageSession context = null; MTestDriver driver = new MTestDriver(); X4OReaderSession reader = driver.createReaderSession(); - reader.addPhaseSkip(X4OPhase.READ_RELEASE); + reader.addPhaseSkip(X4OPhaseLanguageRead.READ_RELEASE); try { context = reader.readResourceSession("junit/test-meta-reference.xml"); assertEquals(Date.class.getName(),context.getRootElement().getChilderen().get(0).getElementObject().getClass().getName());