Commits

Sam Adams committed 7d8d7ee

Tidying up imports

Comments (0)

Files changed (11)

crystallography-common/src/main/java/net/chempound/crystal/rdf/impl/CrystalEyeEntryImpl.java

 import com.hp.hpl.jena.rdf.model.Resource;
 import com.hp.hpl.jena.sparql.vocabulary.FOAF;
 import com.hp.hpl.jena.vocabulary.RDF;
-import org.apache.commons.io.FilenameUtils;
 import net.chempound.crystal.rdf.CrystalEyeEntry;
 import net.chempound.crystal.rdf.CrystalStructure;
 import net.chempound.crystal.rdf.ont.CrystalEye;
 import net.chempound.rdf.chempound.ItemImpl;
 import net.chempound.rdf.dc.DCUtils;
 import net.chempound.util.MimeType;
+import org.apache.commons.io.FilenameUtils;
 
 import java.net.URI;
 

crystallography-handler/src/main/java/net/chempound/crystal/display/CrystalStructureSplashPageWriter.java

 import freemarker.template.Template;
 import freemarker.template.TemplateException;
 import freemarker.template.TemplateHashModel;
-import org.apache.commons.io.IOUtils;
 import net.chempound.crystal.rdf.CrystalEyeEntry;
 import net.chempound.crystal.rdf.CrystalStructure;
 import net.chempound.crystal.rdf.ont.CifDict;
 import net.chempound.rdf.DCTerms;
 import net.chempound.services.FreemarkerService;
 import net.chempound.webapp.output.SplashPageWriter;
+import org.apache.commons.io.IOUtils;
 
 import javax.inject.Inject;
 import java.io.IOException;

crystallography-handler/src/main/java/net/chempound/crystal/search/CrystalSearchProvider.java

 package net.chempound.crystal.search;
 
 import com.hp.hpl.jena.rdf.model.Property;
-import org.apache.commons.io.IOUtils;
 import net.chempound.crystal.rdf.ont.CifDict;
 import net.chempound.crystal.rdf.ont.Cryst;
 import net.chempound.webapp.search.AbstractSearchProvider;
 import net.chempound.webapp.search.SparqlQuery;
+import org.apache.commons.io.IOUtils;
 
 import java.io.IOException;
 import java.io.InputStream;

crystallography-importer/pom.xml

             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-
         <dependency>
-            <groupId>net.chempound.chemistry</groupId>
-            <artifactId>chemistry-import-testutils</artifactId>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
 

crystallography-importer/src/main/java/net/chempound/crystal/importer/CmlRdfUtils.java

 import com.hp.hpl.jena.rdf.model.RDFNode;
 import com.hp.hpl.jena.rdf.model.Resource;
 import com.hp.hpl.jena.vocabulary.RDF;
+import net.chempound.rdf.cml.CmlRdf;
 import org.xmlcml.cml.base.CMLElement;
 import org.xmlcml.cml.element.CMLScalar;
 import org.xmlcml.cml.interfacex.HasDictRef;
-import net.chempound.rdf.cml.CmlRdf;
 
 /**
  * @author Sam Adams

crystallography-importer/src/main/java/net/chempound/crystal/importer/CrystalStructureImporter.java

 import net.chempound.chemistry.ImageGenerator;
 import net.chempound.chemistry.InChIGenerator;
 import net.chempound.chemistry.cml.ChemicalMime;
-import net.chempound.chemistry.inchi.InchiTool;
 import net.chempound.content.DefaultDepositRequest;
 import net.chempound.content.DepositRequest;
 import net.chempound.crystal.importer.utils.CifIO;
 import org.xmlcml.cml.converters.cif.CIFXML2CMLConverter;
 import org.xmlcml.cml.converters.cif.RawCML2CompleteCMLConverter;
 import org.xmlcml.cml.element.CMLCml;
-import org.xmlcml.cml.element.CMLIdentifier;
 import org.xmlcml.cml.element.CMLMolecule;
 import org.xmlcml.cml.tools.ConnectionTableTool;
 

crystallography-importer/src/test/java/net/chempound/crystal/importer/CrystalCml2RdfConverterTest.java

 import com.hp.hpl.jena.rdf.model.StmtIterator;
 import com.hp.hpl.jena.vocabulary.DCTerms;
 import com.hp.hpl.jena.vocabulary.RDF;
+import net.chempound.crystal.rdf.CrystalPersonalities;
+import net.chempound.crystal.rdf.ont.CifDict;
+import net.chempound.crystal.rdf.ont.Cryst;
+import net.chempound.rdf.cml.CmlRdf;
 import nu.xom.Document;
 import nu.xom.ParsingException;
 import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 import org.xmlcml.cml.base.CMLBuilder;
 import org.xmlcml.cml.element.CMLCml;
-import net.chempound.crystal.rdf.CrystalPersonalities;
-import net.chempound.crystal.rdf.ont.CifDict;
-import net.chempound.crystal.rdf.ont.Cryst;
-import net.chempound.rdf.ChempoundPersonalities;
-import net.chempound.rdf.cml.CmlRdf;
 
 import java.io.IOException;
 import java.io.InputStream;

crystallography-importer/src/test/java/net/chempound/crystal/importer/CrystalStructureImporterTest.java

 import com.hp.hpl.jena.rdf.model.RDFReader;
 import net.chempound.chemistry.ImageGenerator;
 import net.chempound.chemistry.InChIGenerator;
+import net.chempound.content.DepositRequest;
+import net.chempound.crystal.importer.utils.CifIO;
+import net.chempound.crystal.rdf.CrystalPersonalities;
+import net.chempound.crystal.rdf.CrystalStructure;
+import net.chempound.crystal.rdf.UnitCell;
+import net.chempound.rdf.DCTerms;
 import net.chempound.rdf.IgnoringEmptyBaseUriErrorHandler;
 import net.chempound.storage.DepositResource;
 import net.chempound.util.MimeType;
 import org.junit.Test;
 import org.xmlcml.cif.CIF;
 import org.xmlcml.cif.CIFException;
-import net.chempound.content.DepositRequest;
-import net.chempound.crystal.importer.utils.CifIO;
-import net.chempound.crystal.rdf.CrystalPersonalities;
-import net.chempound.crystal.rdf.CrystalStructure;
-import net.chempound.crystal.rdf.UnitCell;
-import net.chempound.rdf.DCTerms;
 
 import java.io.IOException;
 import java.io.InputStream;
 
-import static net.chempound.chemistry.testutil.ImageGeneratorStubber.stubImageGenerator;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.mock;
 
 /**
  * @author Sam Adams
 
     @Before
     public void setUp() throws Exception {
-        imageGenerator = stubImageGenerator();
-        inchiGenerator = new InChIGenerator();
+        imageGenerator = mock(ImageGenerator.class);
+        inchiGenerator = mock(InChIGenerator.class);
     }
 
     @Test

crystallography-test-harness/pom.xml

             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-
         <dependency>
-            <groupId>net.chempound.chemistry</groupId>
-            <artifactId>chemistry-import-testutils</artifactId>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
 

crystallography-test-harness/src/test/java/net/chempound/crystal/CrystalIntegrationTest.java

 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 
-import static net.chempound.chemistry.testutil.ImageGeneratorStubber.stubImageGenerator;
 import static org.junit.Assert.*;
+import static org.mockito.Mockito.mock;
 
 /**
  * @author sea36
     @Before
     public void init() throws Exception {
 
-        imageGenerator = stubImageGenerator();
-        inchiGenerator = new InChIGenerator();
+        imageGenerator = mock(ImageGenerator.class);
+        inchiGenerator = mock(InChIGenerator.class);
 
         workspace = createWorkspace();
 

crystallography-test-harness/src/test/java/net/chempound/crystal/CrystalSearchIntegrationTest.java

 import java.net.URI;
 import java.util.UUID;
 
-import static net.chempound.chemistry.testutil.ImageGeneratorStubber.stubImageGenerator;
 import static org.junit.Assert.*;
+import static org.mockito.Mockito.mock;
 
 /**
  * @author Sam Adams
     @BeforeClass
     public static void init() throws Exception {
 
-        imageGenerator = stubImageGenerator();
-        inchiGenerator = new InChIGenerator();
+        imageGenerator = mock(ImageGenerator.class);
+        inchiGenerator = mock(InChIGenerator.class);
 
         workspace = createWorkspace();