code.onehippo.org is currently readonly. We are migrating to code.bloomreach.com, please continue working there on Monday 14/12. See: https://docs.bloomreach.com/display/engineering/GitLab

Commit 547542ef authored by Ard Schrijvers's avatar Ard Schrijvers

REPO-1811 Fix test to have flexible logger node test

parent 79490e41
/*
* 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;
......
/*
* 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment