Skip to content

Commit

Permalink
Add test dataholder class
Browse files Browse the repository at this point in the history
  • Loading branch information
abradle committed Apr 13, 2016
1 parent fec2df8 commit 0cd57c0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
Expand Up @@ -11,18 +11,14 @@
*
* @author Anthony Bradley
*/
public class BioAssemblyTrans implements Serializable {


/** Serial id for this version of the format. */
private static final long serialVersionUID = -8109941242652091495L;
public class BioAssemblyTrans {


/** The indices of the chains this bioassembly references. */
private int[] chainIndexList;

/** The 4x4 matrix transformation specifying a rotation and a translation. */
private double[] transformation;
private double[] matrix;


/**
Expand All @@ -32,8 +28,8 @@ public class BioAssemblyTrans implements Serializable {
*
* @return the transformation
*/
public final double[] getMatrix() {
return transformation;
public double[] getMatrix() {
return matrix;
}

/**
Expand All @@ -43,16 +39,16 @@ public final double[] getMatrix() {
*
* @param inputTransformation the new transformation
*/
public final void setMatrix(final double[] transformation) {
this.transformation = transformation;
public void setMatrix(double[] transformation) {
this.matrix = transformation;
}

/**
* Gets the indices of the chains this bioassembly refers to.
*
* @return a list of integers indicating the indices (zero indexed) of the chains this bioassembly refers to.
*/
public final int[] getChainIndexList() {
public int[] getChainIndexList() {
return chainIndexList;
}

Expand All @@ -61,7 +57,7 @@ public final int[] getChainIndexList() {
*
* @param a list of integers indicating the indices (zero indexed) of the chains this bioassembly refers to.
*/
public final void setChainIndexList(final int[] inputChainId) {
public void setChainIndexList(int[] inputChainId) {
this.chainIndexList = inputChainId;
}

Expand Down
@@ -0,0 +1,27 @@
package org.rcsb.mmtf.dataholders;


import org.junit.Test;
import org.unitils.reflectionassert.ReflectionAssert;

import uk.co.jemos.podam.api.PodamFactory;
import uk.co.jemos.podam.api.PodamFactoryImpl;

public class TestDataHolders {

@Test
public void testBeans(){
PodamFactory factory = new PodamFactoryImpl();
// Tests if setters are set appropriately
ReflectionAssert.assertPropertiesNotNull("Some properties null.",
factory.manufacturePojo(MmtfBean.class));
ReflectionAssert.assertPropertiesNotNull("Some properties null.",
factory.manufacturePojo(BioAssemblyData.class));
ReflectionAssert.assertPropertiesNotNull("Some properties null.",
factory.manufacturePojo(BioAssemblyTrans.class));
ReflectionAssert.assertPropertiesNotNull("Some properties null.",
factory.manufacturePojo(Entity.class));
ReflectionAssert.assertPropertiesNotNull("Some properties null.",
factory.manufacturePojo(PDBGroup.class));
}
}

0 comments on commit 0cd57c0

Please sign in to comment.