mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
57385: Fixed failing tests by not loading the config at all, BDE-195 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61812 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,12 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.web.forms.xforms;
|
package org.alfresco.web.forms.xforms;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Vector;
|
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
import junit.framework.AssertionFailedError;
|
import junit.framework.AssertionFailedError;
|
||||||
|
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.util.BaseTest;
|
import org.alfresco.util.BaseTest;
|
||||||
import org.alfresco.util.XMLUtil;
|
import org.alfresco.util.XMLUtil;
|
||||||
@@ -31,16 +34,20 @@ import org.apache.commons.jxpath.JXPathContext;
|
|||||||
import org.apache.commons.jxpath.Pointer;
|
import org.apache.commons.jxpath.Pointer;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.chiba.xml.ns.NamespaceConstants;
|
import org.chiba.xml.events.DOMEventNames;
|
||||||
import org.chiba.xml.events.XFormsEventNames;
|
import org.chiba.xml.events.XFormsEventNames;
|
||||||
import org.chiba.xml.events.XMLEvent;
|
import org.chiba.xml.events.XMLEvent;
|
||||||
|
import org.chiba.xml.ns.NamespaceConstants;
|
||||||
import org.chiba.xml.xforms.ChibaBean;
|
import org.chiba.xml.xforms.ChibaBean;
|
||||||
|
import org.chiba.xml.xforms.config.Config;
|
||||||
import org.chiba.xml.xforms.exception.XFormsException;
|
import org.chiba.xml.xforms.exception.XFormsException;
|
||||||
import org.chiba.xml.xforms.XFormsElement;
|
import org.springframework.extensions.config.source.ClassPathConfigSource;
|
||||||
import org.chiba.xml.events.DOMEventNames;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.*;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.events.*;
|
import org.w3c.dom.events.Event;
|
||||||
import org.xml.sax.*;
|
import org.w3c.dom.events.EventListener;
|
||||||
|
import org.w3c.dom.events.EventTarget;
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JUnit tests to exercise the the schema to xforms converter
|
* JUnit tests to exercise the the schema to xforms converter
|
||||||
@@ -615,22 +622,14 @@ public class Schema2XFormsTest
|
|||||||
private Document loadTestResourceDocument(final String path)
|
private Document loadTestResourceDocument(final String path)
|
||||||
throws IOException, SAXException
|
throws IOException, SAXException
|
||||||
{
|
{
|
||||||
File f = new File(this.getResourcesDir());
|
ClassPathConfigSource source = new ClassPathConfigSource(path);
|
||||||
for (final String p : path.split("/"))
|
return XMLUtil.parse(source.getInputStream(path));
|
||||||
{
|
|
||||||
f = new File(f, p);
|
|
||||||
}
|
|
||||||
return XMLUtil.parse(f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ChibaBean runXForm(final Document xformsDocument)
|
private ChibaBean runXForm(final Document xformsDocument)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
final ChibaBean chibaBean = new ChibaBean();
|
final ChibaBean chibaBean = new ChibaBean();
|
||||||
String webResourceDir = System.getProperty("alfresco.web.resources.dir",
|
|
||||||
this.getResourcesDir() + File.separator + ".." + File.separator + "web");
|
|
||||||
chibaBean.setConfig(webResourceDir + File.separator +
|
|
||||||
"WEB-INF" + File.separator + "chiba.xml");
|
|
||||||
chibaBean.setXMLContainer(xformsDocument);
|
chibaBean.setXMLContainer(xformsDocument);
|
||||||
chibaBean.init();
|
chibaBean.init();
|
||||||
return chibaBean;
|
return chibaBean;
|
||||||
|
Reference in New Issue
Block a user