Skip to content

Commit 26ab786

Browse files
committed
Make tests run under Eclipse
1 parent 0e6ad71 commit 26ab786

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

logicaldoc-core/src/main/java/com/logicaldoc/core/HibernatePersistentObjectDAO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public abstract class HibernatePersistentObjectDAO<T extends PersistentObject> i
4949

5050
private static final String AND = " and (";
5151

52-
private static final String ORDER_BY = "order by";
52+
protected static final String ORDER_BY = " order by ";
5353

5454
protected Logger log = LoggerFactory.getLogger(HibernatePersistentObjectDAO.class);
5555

@@ -60,7 +60,7 @@ public abstract class HibernatePersistentObjectDAO<T extends PersistentObject> i
6060

6161
protected static final String ASPECT_STORING = "storing";
6262

63-
private static final String DEFAULT_WHERE_PREAMBLE = " " + ENTITY + " where " + ENTITY + ".deleted=0 ";
63+
protected static final String DEFAULT_WHERE_PREAMBLE = " " + ENTITY + " where " + ENTITY + ".deleted=0 ";
6464

6565
public void setSessionFactory(SessionFactory sessionFactory) {
6666
this.sessionFactory = sessionFactory;

logicaldoc-util/src/main/java/com/logicaldoc/util/config/XMLBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public XMLBean(InputStream is) {
9292
* Initializes the SAX builder
9393
*/
9494
private void initDocument() {
95-
SAXBuilder builder = new SAXBuilder(XMLReaders.DTDVALIDATING);
95+
SAXBuilder builder = new SAXBuilder(XMLReaders.NONVALIDATING);
9696

9797
builder.setFeature("http://xml.org/sax/features/validation", false);
9898
builder.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);

logicaldoc-webapp/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,13 @@
448448
<artifactId>mockito-core</artifactId>
449449
<scope>test</scope>
450450
</dependency>
451+
452+
<dependency>
453+
<groupId>xerces</groupId>
454+
<artifactId>xercesImpl</artifactId>
455+
<version>2.12.2</version>
456+
<scope>test</scope>
457+
</dependency>
451458
</dependencies>
452459
<build>
453460
<plugins>

logicaldoc-webapp/src/main/java/com/logicaldoc/web/service/SystemServiceImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ public void installPlugin() throws ServerException {
876876

877877
try (ZipUtil zipUtil = new ZipUtil();) {
878878
File pluginPackage = uploadedFilesMap.values().iterator().next();
879+
879880
ContextProperties config = Context.get().getProperties();
880881
File rootFolder;
881882
if (getThreadLocalRequest() != null)

logicaldoc-webapp/src/test/java/com/logicaldoc/web/service/SystemServiceImplTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public void setUp() throws IOException, SQLException, PluginException {
5454
File testWebappFolder = new File("target/webapp");
5555
testWebappFolder.mkdir();
5656
SystemServiceImpl.defaultWebappRootFolder = testWebappFolder;
57+
58+
// This is to make JAXP happy even when running inside Eclipse
59+
System.setProperty("javax.xml.parsers.SAXParserFactory", "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl");
5760
}
5861

5962
@Override

0 commit comments

Comments
 (0)