test.junit.fedora.server.journal.MockServerForJournalTesting Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fcrepo-client Show documentation
Show all versions of fcrepo-client Show documentation
The Fedora Client is a Java Library that allows API access to a Fedora Repository. The client is typically one part of a full Fedora installation.
The newest version!
package fedora.server.journal;
import java.util.ArrayList;
import java.util.List;
import fedora.server.errors.ServerException;
import fedora.server.management.ManagementDelegate;
public class MockServerForJournalTesting
implements ServerInterface {
// -------------------------------------------------------------------------
// Mocking infrastructure.
// -------------------------------------------------------------------------
private final String hashValue;
private final List logCache = new ArrayList();
private final ManagementDelegate managementDelegate;
public MockServerForJournalTesting(ManagementDelegate managementDelegate,
String hashValue) {
this.hashValue = hashValue;
this.managementDelegate = managementDelegate;
}
// -------------------------------------------------------------------------
// Mocked methods.
// -------------------------------------------------------------------------
public ManagementDelegate getManagementDelegate() {
return managementDelegate;
}
public String getRepositoryHash() throws ServerException {
return hashValue;
}
public void logSevere(String message) {
logCache.add(message);
}
public void logInfo(String message) {
logCache.add(message);
}
public boolean hasInitialized() {
return true;
}
// -------------------------------------------------------------------------
// Non-implemented methods.
// -------------------------------------------------------------------------
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy