Description: Removing tests which depend on not yet packaged Java stuff.
Author: Andrius Merkys <merkys@debian.org>
--- a/mmtf-serialization/src/test/java/org/rcsb/mmtf/dataholders/TestDataHolders.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.rcsb.mmtf.dataholders;
-
-
-import static org.junit.Assert.assertNotNull;
-
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-
-import org.junit.Test;
-import org.unitils.reflectionassert.ReflectionAssert;
-
-import uk.co.jemos.podam.api.PodamFactory;
-import uk.co.jemos.podam.api.PodamFactoryImpl;
-
-/**
- * A class to test the dataholders.
- * @author Anthony Bradley
- *
- */
-public class TestDataHolders {
-	
-	/**
-	 * Test the available beans
-	 * @throws IllegalAccessException related to Jackson conversion
-	 * @throws IllegalArgumentException related to Jackson conversion
-	 * @throws InvocationTargetException related to Jackson conversion
-	 * @throws IntrospectionException related to Jackson conversion
-	 */
-	@Test
-	public void testBeans() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, IntrospectionException{
-		PodamFactory factory = new PodamFactoryImpl();
-		// Tests if setters are set appropriately
-		ReflectionAssert.assertPropertiesNotNull("Some properties null.", 
-				factory.manufacturePojo(MmtfStructure.class));
-		testData(MmtfStructure.class, factory.manufacturePojo(MmtfStructure.class));
-		
-		ReflectionAssert.assertPropertiesNotNull("Some properties null.", 
-				factory.manufacturePojo(BioAssemblyData.class));
-		testData(BioAssemblyData.class, factory.manufacturePojo(BioAssemblyData.class));
-		
-		ReflectionAssert.assertPropertiesNotNull("Some properties null.", 
-				factory.manufacturePojo(BioAssemblyTransformation.class));
-		testData(BioAssemblyTransformation.class, factory.manufacturePojo(BioAssemblyTransformation.class));
-
-		ReflectionAssert.assertPropertiesNotNull("Some properties null.", 
-				factory.manufacturePojo(Entity.class));
-		testData(Entity.class, factory.manufacturePojo(Entity.class));
-		
-		ReflectionAssert.assertPropertiesNotNull("Some properties null.", 
-				factory.manufacturePojo(Group.class));
-		testData(Group.class, factory.manufacturePojo(Group.class));
-
-	}
-	
-	
-	private void testData(@SuppressWarnings("rawtypes") Class beanClass, Object object) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, IntrospectionException {
-		for(PropertyDescriptor propertyDescriptor : 
-		    Introspector.getBeanInfo(beanClass).getPropertyDescriptors()){
-			assertNotNull(propertyDescriptor.getReadMethod().invoke(object));
-		}
-	}
-
-
-}
--- a/mmtf-serialization/src/test/java/org/rcsb/mmtf/serialization/TestMessagePack.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.rcsb.mmtf.serialization;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.text.ParseException;
-
-import org.junit.Test;
-import org.rcsb.mmtf.dataholders.MmtfStructure;
-
-import uk.co.jemos.podam.api.PodamFactory;
-import uk.co.jemos.podam.api.PodamFactoryImpl;
-
-/**
- * Class to test the message pack serializer and deserializer.
- * @author Anthony Bradley
- *
- */
-public class TestMessagePack {
-
-	
-	/**
-	 * Test the deserialize.
-	 */
-	@Test
-	public void testDeserialize() throws ParseException, IOException {
-		MessagePackSerialization mmtfBeanSeDeMessagePackImpl = new MessagePackSerialization();
-		byte[] source = new byte[] {(byte) (char) 129, (byte) (char)162, (byte) (char)100, (byte) (char)111, (byte) (char)1};
-		ByteArrayInputStream bis = new ByteArrayInputStream(source);
-		MmtfStructure mmtfBean = mmtfBeanSeDeMessagePackImpl.deserialize(bis);
-		assertNotNull(mmtfBean);
-	}
-	
-	/**
-	 * Test the serialize.
-	 */
-	@Test
-	public void testSerialize() throws IOException {
-		MessagePackSerialization mmtfBeanSeDeMessagePackImpl = new MessagePackSerialization();
-		PodamFactory factory = new PodamFactoryImpl();
-		MmtfStructure mmtfBean = factory.manufacturePojo(MmtfStructure.class);
-		ByteArrayOutputStream bos = new ByteArrayOutputStream();
-		mmtfBeanSeDeMessagePackImpl.serialize(mmtfBean, bos);
-		assertNotNull(bos.toByteArray());
-	}
-}
--- a/mmtf-codec/src/test/java/org/rcsb/mmtf/decoder/TestGenericDecoder.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.rcsb.mmtf.decoder;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.text.ParseException;
-
-import org.junit.Test;
-import org.rcsb.mmtf.codec.Utils;
-import org.rcsb.mmtf.dataholders.MmtfStructure;
-import org.unitils.reflectionassert.ReflectionAssert;
-
-/**
- * Test that the {@link GenericDecoder} works.
- * @author Anthony Bradley
- *
- */
-public class TestGenericDecoder {
-
-	/**
-	 * Check that we decode all fields and that all getters are not null.
-	 * @throws IOException an error reading in data
-	 * @throws IntrospectionException an error with introspection
-	 * @throws InvocationTargetException  an error with introspection
-	 * @throws IllegalArgumentException  an error with introspection
-	 * @throws IllegalAccessException  an error with introspection
-	 */
-	@Test
-	public void testDecodeAllFields() throws IOException, ParseException, IllegalAccessException,
-		IllegalArgumentException, InvocationTargetException, IntrospectionException {
-		ClassLoader classLoader = getClass().getClassLoader();
-		MmtfStructure mmtfBean = ReaderUtils.getDataFromFile(Utils.getResource("/mmtf/4CUP.mmtf"));
-		GenericDecoder genericDecoder = new GenericDecoder(mmtfBean);
-		ReflectionAssert.assertPropertiesNotNull("Some properties null after decoding", 
-			genericDecoder);
-		for(PropertyDescriptor propertyDescriptor : 
-			Introspector.getBeanInfo(MmtfStructure.class).getPropertyDescriptors()){
-			assertNotNull(propertyDescriptor.getReadMethod().invoke(mmtfBean));
-		}
-		// Check the decoder has been populated to
-		for(PropertyDescriptor propertyDescriptor :
-			Introspector.getBeanInfo(GenericDecoder.class).getPropertyDescriptors()){
-			if(propertyDescriptor.getReadMethod()!=null){
-				assertNotNull(propertyDescriptor.getReadMethod().invoke(genericDecoder));
-			}
-		}
-	}
-
-	/**
-	 * Test that we can pass data into the inflator.
-	 */
-	@Test
-	public void testReader() {
-		DummyApiImpl dummyApiImpl = new DummyApiImpl();
-		new StructureDataToAdapter(dummyApiImpl, new DummyTransferImpl());
-	}
-
-}
--- a/mmtf-codec/src/test/java/org/rcsb/mmtf/encoder/TestEncoder.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.rcsb.mmtf.encoder;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-import org.rcsb.mmtf.api.StructureAdapterInterface;
-import org.unitils.reflectionassert.ReflectionAssert;
-
-/**
- * A class to test the encoding of data using the encoders.
- * @author Anthony Bradley
- *
- */
-public class TestEncoder {
-	
-    /**
-     * A test folder for testing writing files.
-     */
-    @Rule
-    public TemporaryFolder testFolder = new TemporaryFolder();	
-	
-	/**
-	 * Test whether calling all the set methods gives a none null get.
-	 * @throws IOException an error converting byte arrays
-	 */
-	@Test
-	public void testGenricEncoder() throws IOException {
-		DummyApiImpl dummyApiImpl = new DummyApiImpl();
-		EncoderInterface encoder = new GenericEncoder(dummyApiImpl);
-		ReflectionAssert.assertPropertiesNotNull("Some properties null after encoding",  encoder.getMmtfEncodedStructure());
-	}
-
-
-	/**
-	 * Test the writer of data.
-	 * @throws IllegalAccessException reflection based error
-	 * @throws IllegalArgumentException reflection based error
-	 * @throws InvocationTargetException reflection based error
-	 * @throws IntrospectionException reflection based error
-	 */
-	@Test
-	public void testWriter() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, IntrospectionException {
-		AdapterToStructureData adapterToStructureData = getWriterEncoder();
-		ReflectionAssert.assertPropertiesNotNull("Some properties null after writing", adapterToStructureData);
-		for(PropertyDescriptor propertyDescriptor : 
-			Introspector.getBeanInfo(AdapterToStructureData.class).getPropertyDescriptors()){
-			if(propertyDescriptor.getReadMethod()!=null){
-				assertNotNull(propertyDescriptor.getReadMethod().invoke(adapterToStructureData));
-			}
-		}
-	}
-
-
-	/**
-	 * Test writing the data to a file.
-	 * @throws IOException an error accessing the file system
-	 */
-	@Test
-	public void testWriteToFile() throws IOException {
-		AdapterToStructureData AdapterToStructureData = getWriterEncoder();
-		File tempFile = testFolder.newFile("tmpfile");
-		WriterUtils.writeDataToFile(AdapterToStructureData, tempFile.toPath());
-	}
-	
-	
-	/**
-	 * Utility function for getting the base data into the {@link AdapterToStructureData} 
-	 * implementation of the {@link StructureAdapterInterface}.
-	 * @return the {@link AdapterToStructureData} instance
-	 */
-	private AdapterToStructureData getWriterEncoder() {
-		AdapterToStructureData adapterToStructureData = new AdapterToStructureData();
-		adapterToStructureData.initStructure(1, 1, 1, 1, 1, "ABC");
-		adapterToStructureData.setModelInfo(0, 1);
-		adapterToStructureData.setChainInfo("A","A",10);
-		adapterToStructureData.setGroupInfo("HET", 1, 'a', "D", 1, 1, 'A', 0, -1);
-		adapterToStructureData.setAtomInfo("A", 1, 'a', 1.0f, 1.0f, 1.0f,1.0f, 1.0f, "A", 1);
-		adapterToStructureData.setEntityInfo(new int[1], "A", "A", "A");
-		adapterToStructureData.setGroupBond(0, 0, 1);
-		adapterToStructureData.setHeaderInfo(1.0f, 1.0f, 1.0f, "A", "A", "A", new String[1]);
-		adapterToStructureData.setInterGroupBond(0, 0, 1);
-		adapterToStructureData.setBioAssemblyTrans(0, new int[1], new double[6], "1");
-		adapterToStructureData.setXtalInfo("A", new float[6], new double[16][16]);
-		adapterToStructureData.finalizeStructure();
-		return adapterToStructureData;
-	}
-}
--- a/mmtf-codec/src/test/java/org/rcsb/mmtf/serialization/mp/MessagePackSerializationTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.rcsb.mmtf.serialization.mp;
-
-import org.rcsb.mmtf.utils.Lines;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import org.junit.Test;
-import org.rcsb.mmtf.api.StructureDataInterface;
-import org.rcsb.mmtf.dataholders.MmtfStructure;
-import org.rcsb.mmtf.decoder.GenericDecoder;
-import org.rcsb.mmtf.decoder.ReaderUtils;
-import org.rcsb.mmtf.serialization.MessagePackSerialization;
-
-import org.unitils.reflectionassert.ReflectionAssert;
-
-/**
- * Tests if both MessagePack decoding methods, Jackson and the manual object
- * creation gives identical data.
- *
- */
-public class MessagePackSerializationTest {
-
-	private final int n = 10; // how many structures should be tested
-	private final List<String> testCodes;
-
-	public MessagePackSerializationTest() throws IOException {
-		testCodes = getTestCodes();
-	}
-
-	private List<String> getTestCodes() throws IOException {		
-		List<String> result = new ArrayList<>();
-		Random random = new Random();
-		int seed = random.nextInt();		
-		System.out.println("Using seed " + seed + " to select " + n + " random "
-			+ "structures for MessagePack testing.");
-		random = new Random(seed);
-		List<String> codes = getAllPdbCodes();
-		for (int i = 0; i < Math.min(n, codes.size()); i++) {
-			int r = random.nextInt(codes.size());
-			String code = codes.get(r);
-			codes.remove(r);
-			result.add(code);
-		}
-		return result;
-	}
-
-	public List<String> getAllPdbCodes() throws IOException {
-		List<String> codes = new ArrayList<>();
-		for (String line : Lines.readResource("/mmtf/pdb_codes.gz")) {
-			String code = line.trim().substring(0, 4);
-			codes.add(code);
-		}
-		return codes;
-	}
-
-	/**
-	 * Decodes the MMTF from the MessagePack data.
-	 */
-	private StructureDataInterface parse(byte[] bytes) throws IOException, ParseException {
-		MmtfStructure mmtf = ReaderUtils.getDataFromInputStream(
-			new ByteArrayInputStream(bytes));
-		GenericDecoder gd = new GenericDecoder(mmtf);
-		return gd;
-	}
-
-	private byte[] fetchMmtf(String code) throws IOException {
-		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-		String url = "http://mmtf.rcsb.org/v1.0/full/" + code + ".mmtf.gz";
-		try (InputStream is = new URL(url).openStream()) {
-			byte[] chunk = new byte[4096];
-			int bytesRead;
-			while ((bytesRead = is.read(chunk)) > 0) {
-				outputStream.write(chunk, 0, bytesRead);
-			}
-		}
-		return outputStream.toByteArray();
-	}
-
-	@Test
-	public void testByComparisonWithJackson() throws IOException {
-
-		for (String code : testCodes) {
-			try {
-				byte[] zipped = fetchMmtf(code);
-				byte[] bytes = ReaderUtils.deflateGzip(zipped);
-
-				MessagePackSerialization.setJackson(false);
-				StructureDataInterface sdiJmol = parse(bytes);
-
-				MessagePackSerialization.setJackson(true);
-				StructureDataInterface sdiJackson = parse(bytes);
-
-				ReflectionAssert.assertReflectionEquals(sdiJackson, sdiJmol);
-			} catch (Exception ex) {
-				throw new RuntimeException(code, ex);
-			}
-		}
-	}
-
-}
