Skip to content

Commit

Permalink
fix FedoraRepositoryTest for new urls
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jan 31, 2013
1 parent 619e634 commit a3373cd
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 3 deletions.
@@ -0,0 +1,96 @@
package org.fcrepo.modeshape.storage;

import org.infinispan.Cache;
import org.infinispan.container.entries.InternalCacheEntry;
import org.infinispan.loaders.*;
import org.infinispan.marshall.StreamingMarshaller;

import java.io.File;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.net.URI;
import java.util.Set;


@CacheLoaderMetadata(configurationClass = DurableFileCacheStoreConfig.class)
public class DurableFileCacheStore extends AbstractCacheStore {

DurableFileCacheStoreConfig config;
File root;
/**
* @return root directory where all files for this {@link org.infinispan.loaders.CacheStore CacheStore} are written.
*/
public File getRoot() {
return root;
}

@Override
public void init(CacheLoaderConfig config, Cache<?, ?> cache, StreamingMarshaller m) throws CacheLoaderException {
super.init(config, cache, m);
this.config = (DurableFileCacheStoreConfig) config;
}

@Override
public Class<? extends CacheLoaderConfig> getConfigurationClass() {
return DurableFileCacheStoreConfig.class;
}

@Override
// Loads an entry mapped to by a given key. Should return null if the entry does not exist. Expired entries are not returned.
public InternalCacheEntry load(Object key) throws CacheLoaderException {
return null;
}

@Override
// Loads all entries in the loader. Expired entries are not returned.
public Set<InternalCacheEntry> loadAll() throws CacheLoaderException {
return null;
}

@Override
// Loads up to a specific number of entries. There is no guarantee as to order of entries loaded. The set returned would contain up to a maximum of numEntries entries, and no more.
public Set<InternalCacheEntry> load(int numEntries) throws CacheLoaderException {
return null;
}

@Override
// Loads a set of all keys, excluding a filter set.
public Set<Object> loadAllKeys(Set<Object> objects) throws CacheLoaderException {
return null;
}

@Override
protected void purgeInternal() throws CacheLoaderException {
//To change body of implemented methods use File | Settings | File Templates.
}

@Override
// Stores an entry
public void store(InternalCacheEntry internalCacheEntry) throws CacheLoaderException {
//To change body of implemented methods use File | Settings | File Templates.
}

@Override
// Writes contents of the stream to the store. Implementations should expect that the stream contains data in an implementation-specific format, typically generated using toStream(java.io.ObjectOutput). While not a requirement, it is recommended that implementations make use of the StreamingMarshaller when dealing with the stream to make use of efficient marshalling.
public void fromStream(ObjectInput objectInput) throws CacheLoaderException {
//To change body of implemented methods use File | Settings | File Templates.
}

@Override
// Loads the entire state into a stream, using whichever format is most efficient for the cache loader implementation. Typically read and parsed by fromStream(java.io.ObjectInput).
public void toStream(ObjectOutput objectOutput) throws CacheLoaderException {
//To change body of implemented methods use File | Settings | File Templates.
}

@Override
// Clears all entries in the store
public void clear() throws CacheLoaderException {
//To change body of implemented methods use File | Settings | File Templates.
}

@Override
// Removes an entry in the store.
public boolean remove(Object key) throws CacheLoaderException {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
}
@@ -0,0 +1,24 @@
package org.fcrepo.modeshape.storage;


import org.infinispan.loaders.AbstractCacheStoreConfig;

public class DurableFileCacheStoreConfig extends AbstractCacheStoreConfig {

private String location = "Infinispan-FileCacheStore";

public String getLocation() {
return location;
}

private void setLocation(String location) {
testImmutability("location");
this.location = location;
}

public DurableFileCacheStoreConfig location(String location) {
setLocation(location);
return this;
}

}
6 changes: 3 additions & 3 deletions src/test/java/org/fcrepo/modeshape/FedoraRepositoryTest.java
Expand Up @@ -20,7 +20,7 @@ public class FedoraRepositoryTest {
public void testDescribeModeshape() throws Exception {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT
+ "/fedora/describe/modeshape");
+ "/describe/modeshape");
int status = client.executeMethod(method);
assertEquals(200, status);
}
Expand All @@ -29,7 +29,7 @@ public void testDescribeModeshape() throws Exception {
public void testDescribe() throws Exception {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT
+ "/fedora/describe");
+ "/describe");
int status = client.executeMethod(method);
assertEquals(200, status);
}
Expand All @@ -38,7 +38,7 @@ public void testDescribe() throws Exception {
public void testGetObjects() throws Exception {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod("http://localhost:" + SERVER_PORT
+ "/fedora/objects");
+ "/objects");
int status = client.executeMethod(method);
assertEquals(200, status);
}
Expand Down

0 comments on commit a3373cd

Please sign in to comment.