Skip to content

Commit

Permalink
Cleaned unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Mar 29, 2013
1 parent 8b1ff8e commit bb821ac
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 47 deletions.
18 changes: 1 addition & 17 deletions fcrepo-kernel/src/main/java/org/fcrepo/Datastream.java
Expand Up @@ -2,33 +2,22 @@
package org.fcrepo;

import static com.google.common.base.Joiner.on;
import static com.google.common.collect.Collections2.filter;
import static com.google.common.collect.ImmutableSet.copyOf;
import static com.google.common.collect.Sets.difference;
import static com.yammer.metrics.MetricRegistry.name;
import static java.security.MessageDigest.getInstance;
import static org.fcrepo.services.PathService.getDatastreamJcrNodePath;
import static org.fcrepo.services.ServiceHelpers.getNodePropertySize;
import static org.fcrepo.services.RepositoryService.metrics;
import static org.fcrepo.services.ServiceHelpers.getNodePropertySize;
import static org.fcrepo.utils.FedoraTypesUtils.map;
import static org.fcrepo.utils.FedoraTypesUtils.value2string;
import static org.fcrepo.utils.FixityResult.FixityState.REPAIRED;
import static org.fcrepo.utils.FixityResult.FixityState.SUCCESS;
import static org.modeshape.jcr.api.JcrConstants.JCR_CONTENT;
import static org.modeshape.jcr.api.JcrConstants.JCR_DATA;
import static org.modeshape.jcr.api.JcrConstants.NT_FILE;
import static org.modeshape.jcr.api.JcrConstants.NT_RESOURCE;
import static org.slf4j.LoggerFactory.getLogger;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.Set;

import javax.jcr.Node;
import javax.jcr.Property;
Expand All @@ -43,16 +32,11 @@
import org.fcrepo.services.LowLevelStorageService;
import org.fcrepo.utils.ContentDigest;
import org.fcrepo.utils.FedoraJcrTypes;
import org.fcrepo.utils.FixityResult;
import org.fcrepo.utils.LowLevelCacheEntry;
import org.modeshape.jcr.api.Binary;
import org.modeshape.jcr.api.JcrTools;
import org.slf4j.Logger;

import com.google.common.base.Predicate;
import com.yammer.metrics.Counter;
import com.yammer.metrics.Histogram;
import com.yammer.metrics.Timer;

/**
* Abstraction for a Fedora datastream backed by a JCR node.
Expand Down
29 changes: 12 additions & 17 deletions fcrepo-kernel/src/test/java/org/fcrepo/DatastreamTest.java
@@ -1,28 +1,26 @@
package org.fcrepo;

import static org.fcrepo.TestHelpers.checksumString;
import static org.fcrepo.TestHelpers.getContentNodeMock;
import static org.fcrepo.services.PathService.getDatastreamJcrNodePath;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.modeshape.jcr.api.JcrConstants.JCR_CONTENT;
import static org.modeshape.jcr.api.JcrConstants.JCR_DATA;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;

import static org.fcrepo.TestHelpers.*;
import static org.fcrepo.services.PathService.getDatastreamJcrNodePath;

import static org.mockito.Mockito.*;

import static org.modeshape.jcr.api.JcrConstants.*;

import javax.jcr.AccessDeniedException;
import javax.jcr.Binary;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.PathNotFoundException;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.RepositoryException;
Expand All @@ -35,10 +33,7 @@

import org.apache.tika.io.IOUtils;
import org.fcrepo.exception.InvalidChecksumException;
import org.fcrepo.utils.ContentDigest;
import org.fcrepo.utils.FedoraJcrTypes;
import org.fcrepo.utils.FixityResult;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -167,13 +162,13 @@ public void testGetObject() throws RepositoryException {

@Test
public void testGetMimeType() throws RepositoryException {
String actual = testObj.getMimeType();
testObj.getMimeType();
verify(mockDsNode).hasProperty(FEDORA_CONTENTTYPE);
}

@Test
public void testGetLabel() throws RepositoryException {
String actual = testObj.getLabel();
testObj.getLabel();
verify(mockDsNode).hasProperty(DC_TITLE);
}

Expand Down
11 changes: 3 additions & 8 deletions fcrepo-kernel/src/test/java/org/fcrepo/ObjectTest.java
Expand Up @@ -2,19 +2,14 @@
package org.fcrepo;

import static org.fcrepo.utils.FedoraJcrTypes.DC_TITLE;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import static org.junit.Assert.assertEquals;

import static org.mockito.Mockito.*;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import javax.inject.Inject;
import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;

import org.junit.Before;
import org.junit.Test;
Expand Down
10 changes: 5 additions & 5 deletions fcrepo-kernel/src/test/java/org/fcrepo/TestHelpers.java
@@ -1,17 +1,16 @@
package org.fcrepo;

import static org.fcrepo.utils.FedoraJcrTypes.*;

import static org.fcrepo.utils.FedoraJcrTypes.CONTENT_SIZE;
import static org.fcrepo.utils.FedoraJcrTypes.DIGEST_ALGORITHM;
import static org.fcrepo.utils.FedoraJcrTypes.DIGEST_VALUE;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import static org.modeshape.jcr.api.JcrConstants.JCR_DATA;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
Expand Down Expand Up @@ -72,7 +71,8 @@ public static Datastream mockDatastream(String pid, String dsId, String content)
return mockDs;
}

public static PropertyIterator getPropertyIterator(int numValues, long size) {
@SuppressWarnings("unchecked")
public static PropertyIterator getPropertyIterator(int numValues, long size) {
PropertyIterator mock = mock(PropertyIterator.class);
Property mockProp = mock(Property.class);
try{
Expand Down

0 comments on commit bb821ac

Please sign in to comment.