Ard Schrijvers pushed to branch feature/REPO-1811-2 at cms-community / 
hippo-repository


Commits:
547542ef by Ard Schrijvers at 2017-09-27T16:29:14+02:00
REPO-1811 Fix test to have flexible logger node test

- - - - -


2 changed files:

- modules/src/main/java/org/hippoecm/repository/logging/RepositoryLogger.java
- test/src/test/java/org/hippoecm/repository/logging/RepositoryLoggerTest.java


Changes:

=====================================
modules/src/main/java/org/hippoecm/repository/logging/RepositoryLogger.java
=====================================
--- 
a/modules/src/main/java/org/hippoecm/repository/logging/RepositoryLogger.java
+++ 
b/modules/src/main/java/org/hippoecm/repository/logging/RepositoryLogger.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2012-2014 Hippo B.V. (http://www.onehippo.com)
+ *  Copyright 2012-2017 Hippo B.V. (http://www.onehippo.com)
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -71,7 +71,7 @@ public class RepositoryLogger implements DaemonModule {
         if (!rootLogFolder.isNodeType("hippolog:folder")) {
             throw new RepositoryException("Root log folder is not of the 
expected type");
         }
-        String clusterId = getClusterNodeId();
+        String clusterId = getClusterNodeId(session);
         if (rootLogFolder.hasNode(clusterId)) {
             logFolder = rootLogFolder.getNode(clusterId);
         } else {
@@ -188,7 +188,7 @@ public class RepositoryLogger implements DaemonModule {
     }
 
 
-    private String getClusterNodeId() {
+    static String getClusterNodeId(final Session session) {
         String clusterNodeId = 
session.getRepository().getDescriptor("jackrabbit.cluster.id");
         if (clusterNodeId == null) {
             clusterNodeId = DEFAULT_CLUSTER_NODE_ID;


=====================================
test/src/test/java/org/hippoecm/repository/logging/RepositoryLoggerTest.java
=====================================
--- 
a/test/src/test/java/org/hippoecm/repository/logging/RepositoryLoggerTest.java
+++ 
b/test/src/test/java/org/hippoecm/repository/logging/RepositoryLoggerTest.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2012-2013 Hippo B.V. (http://www.onehippo.com)
+ *  Copyright 2012-2017 Hippo B.V. (http://www.onehippo.com)
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public class RepositoryLoggerTest extends RepositoryTestCase {
     public void testCreateRepositoryLogger() throws Exception {
         final RepositoryLogger repositoryLogger = new RepositoryLogger();
         repositoryLogger.initialize(session);
-        assertTrue(session.itemExists("/hippo:log/default"));
+        assertTrue(session.itemExists("/hippo:log/" + 
RepositoryLogger.getClusterNodeId(session)));
     }
 
     @Test



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-repository/commit/547542ef06ff69322da19789469e315f36033436

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-repository/commit/547542ef06ff69322da19789469e315f36033436
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to