diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/BooleanLogicGateReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/BooleanLogicGateReactionTest.java index 115a4dda907e719d2ef70988b9da5180b0fb5dd3..06898a1728c49b76b501ae039286cd4222ddaf29 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/BooleanLogicGateReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/BooleanLogicGateReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -111,13 +112,7 @@ public class BooleanLogicGateReactionTest { @Test public void testInvalidCopy() { try { - new BooleanLogicGateReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); + Mockito.spy(new BooleanLogicGateReaction()).copy(); fail("Exception expected"); } catch (NotImplementedException e) { } catch (Exception e) { diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/DissociationReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/DissociationReactionTest.java index 5b9f5b2f20b7b0b7f2f430a6a2611280376b4081..b3f61c48022497fc705408432abc9d0d62e1bf9a 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/DissociationReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/DissociationReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -110,13 +111,7 @@ public class DissociationReactionTest { @Test public void testInvalidCopy() { try { - new DissociationReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); + Mockito.spy(new DissociationReaction()).copy(); fail("Exception expected"); } catch (NotImplementedException e) { } catch (Exception e) { diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/HeterodimerAssociationReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/HeterodimerAssociationReactionTest.java index 0a4391e0b1de9fdd1ee44ca994e1e74265192bcd..1ef9331a159096f44f7ca10a07bb2afeb0879bfd 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/HeterodimerAssociationReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/HeterodimerAssociationReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -110,13 +111,7 @@ public class HeterodimerAssociationReactionTest { @Test public void testInvalidCopy() { try { - new HeterodimerAssociationReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); + Mockito.spy(new HeterodimerAssociationReaction()).copy(); fail("Exception expected"); } catch (NotImplementedException e) { } catch (Exception e) { diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/KnownTransitionOmittedReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/KnownTransitionOmittedReactionTest.java index 40c862a73c07ddc6177b986d782b2d6a776e91dc..09796235aa451e48b08dbc232b5cc489ffa60dc0 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/KnownTransitionOmittedReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/KnownTransitionOmittedReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -16,112 +17,105 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class KnownTransitionOmittedReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new KnownTransitionOmittedReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new KnownTransitionOmittedReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new KnownTransitionOmittedReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - KnownTransitionOmittedReaction validReaction = new KnownTransitionOmittedReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - KnownTransitionOmittedReaction original = new KnownTransitionOmittedReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - KnownTransitionOmittedReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new KnownTransitionOmittedReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testGetters() { - try { - KnownTransitionOmittedReaction original = new KnownTransitionOmittedReaction(); - assertNotNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new KnownTransitionOmittedReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new KnownTransitionOmittedReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new KnownTransitionOmittedReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + KnownTransitionOmittedReaction validReaction = new KnownTransitionOmittedReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + KnownTransitionOmittedReaction original = new KnownTransitionOmittedReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + KnownTransitionOmittedReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new KnownTransitionOmittedReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + KnownTransitionOmittedReaction original = new KnownTransitionOmittedReaction(); + assertNotNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/NegativeInfluenceReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/NegativeInfluenceReactionTest.java index b86988443782b57accf57b597bd8872043abe5f0..1f4b88049cb1fc627255d7632a25e9ea1304d815 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/NegativeInfluenceReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/NegativeInfluenceReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,111 +18,105 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class NegativeInfluenceReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new NegativeInfluenceReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new NegativeInfluenceReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new NegativeInfluenceReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - NegativeInfluenceReaction validReaction = new NegativeInfluenceReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - NegativeInfluenceReaction original = new NegativeInfluenceReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - NegativeInfluenceReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new NegativeInfluenceReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testGetters() { - try { - NegativeInfluenceReaction original = new NegativeInfluenceReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new NegativeInfluenceReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new NegativeInfluenceReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new NegativeInfluenceReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + NegativeInfluenceReaction validReaction = new NegativeInfluenceReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + NegativeInfluenceReaction original = new NegativeInfluenceReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + NegativeInfluenceReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new NegativeInfluenceReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + NegativeInfluenceReaction original = new NegativeInfluenceReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/PositiveInfluenceReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/PositiveInfluenceReactionTest.java index 2bf2f72bf750982e03a614f06a99929b6ff4449a..d0685b4988f203a0c9b36f6878a9213dafc1a016 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/PositiveInfluenceReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/PositiveInfluenceReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,111 +18,105 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class PositiveInfluenceReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new PositiveInfluenceReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new PositiveInfluenceReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new PositiveInfluenceReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - PositiveInfluenceReaction validReaction = new PositiveInfluenceReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - PositiveInfluenceReaction original = new PositiveInfluenceReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - PositiveInfluenceReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new PositiveInfluenceReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testGetters() { - try { - PositiveInfluenceReaction original = new PositiveInfluenceReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new PositiveInfluenceReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new PositiveInfluenceReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new PositiveInfluenceReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + PositiveInfluenceReaction validReaction = new PositiveInfluenceReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + PositiveInfluenceReaction original = new PositiveInfluenceReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + PositiveInfluenceReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new PositiveInfluenceReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + PositiveInfluenceReaction original = new PositiveInfluenceReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedModulationReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedModulationReactionTest.java index 162baa4aad89d76879ef3d225ff216f20eb32ed8..1437d6a1f2fca0ffc76b8628a30ce3040f9f0671 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedModulationReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedModulationReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,110 +18,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class ReducedModulationReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new ReducedModulationReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new ReducedModulationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new ReducedModulationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - ReducedModulationReaction validReaction = new ReducedModulationReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - ReducedModulationReaction original = new ReducedModulationReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - ReducedModulationReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new ReducedModulationReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - ReducedModulationReaction original = new ReducedModulationReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new ReducedModulationReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new ReducedModulationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new ReducedModulationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + ReducedModulationReaction validReaction = new ReducedModulationReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + ReducedModulationReaction original = new ReducedModulationReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + ReducedModulationReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new ReducedModulationReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + ReducedModulationReaction original = new ReducedModulationReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedPhysicalStimulationReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedPhysicalStimulationReactionTest.java index bb4eff01d58d44ca67310494c4fc56bcc4bb1e86..d065e75a383728de5d2aab474e7098f5cef904bf 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedPhysicalStimulationReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedPhysicalStimulationReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,110 +18,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class ReducedPhysicalStimulationReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new ReducedPhysicalStimulationReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new ReducedPhysicalStimulationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new ReducedPhysicalStimulationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - ReducedPhysicalStimulationReaction validReaction = new ReducedPhysicalStimulationReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - ReducedPhysicalStimulationReaction original = new ReducedPhysicalStimulationReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - ReducedPhysicalStimulationReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new ReducedPhysicalStimulationReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - ReducedPhysicalStimulationReaction original = new ReducedPhysicalStimulationReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new ReducedPhysicalStimulationReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new ReducedPhysicalStimulationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new ReducedPhysicalStimulationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + ReducedPhysicalStimulationReaction validReaction = new ReducedPhysicalStimulationReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + ReducedPhysicalStimulationReaction original = new ReducedPhysicalStimulationReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + ReducedPhysicalStimulationReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new ReducedPhysicalStimulationReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + ReducedPhysicalStimulationReaction original = new ReducedPhysicalStimulationReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedTriggerReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedTriggerReactionTest.java index 53955053d74001f9bada380a8a94bc677d754a27..04c8ad80bddf07e90ab5d108b7e33e888ac6cc97 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedTriggerReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/ReducedTriggerReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,110 +18,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class ReducedTriggerReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new ReducedTriggerReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new ReducedTriggerReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new ReducedTriggerReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - ReducedTriggerReaction validReaction = new ReducedTriggerReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - ReducedTriggerReaction original = new ReducedTriggerReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - ReducedTriggerReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new ReducedTriggerReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - ReducedTriggerReaction original = new ReducedTriggerReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new ReducedTriggerReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new ReducedTriggerReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new ReducedTriggerReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + ReducedTriggerReaction validReaction = new ReducedTriggerReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + ReducedTriggerReaction original = new ReducedTriggerReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + ReducedTriggerReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new ReducedTriggerReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + ReducedTriggerReaction original = new ReducedTriggerReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/StateTransitionReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/StateTransitionReactionTest.java index 9e63bf2ac471da11391de382510b29506d519bd5..1dbd6cb0c484dfdb00a2fdb795e50182152747ae 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/StateTransitionReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/StateTransitionReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -16,110 +17,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class StateTransitionReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new StateTransitionReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new StateTransitionReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new StateTransitionReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - StateTransitionReaction validReaction = new StateTransitionReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - StateTransitionReaction original = new StateTransitionReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - StateTransitionReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new StateTransitionReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - StateTransitionReaction original = new StateTransitionReaction(); - assertNotNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new StateTransitionReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new StateTransitionReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new StateTransitionReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + StateTransitionReaction validReaction = new StateTransitionReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + StateTransitionReaction original = new StateTransitionReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + StateTransitionReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new StateTransitionReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + StateTransitionReaction original = new StateTransitionReaction(); + assertNotNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TranscriptionReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TranscriptionReactionTest.java index 7fb334aa6f4a68b3de22b48200f4b5a8733f5ada..b670fab8bd456c2351e35ae63fcda1671c05054c 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TranscriptionReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TranscriptionReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -16,110 +17,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class TranscriptionReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new TranscriptionReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new TranscriptionReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new TranscriptionReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - TranscriptionReaction validReaction = new TranscriptionReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - TranscriptionReaction original = new TranscriptionReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - TranscriptionReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new TranscriptionReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - TranscriptionReaction original = new TranscriptionReaction(); - assertNotNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new TranscriptionReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new TranscriptionReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new TranscriptionReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + TranscriptionReaction validReaction = new TranscriptionReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + TranscriptionReaction original = new TranscriptionReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + TranscriptionReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new TranscriptionReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + TranscriptionReaction original = new TranscriptionReaction(); + assertNotNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TranslationReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TranslationReactionTest.java index 58f0741cf98450187f454d43de15cb69842bd548..1a4100eb721208b4b861388cd869e64333147757 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TranslationReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TranslationReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -16,110 +17,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class TranslationReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new TranslationReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new TranslationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new TranslationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - TranslationReaction validReaction = new TranslationReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - TranslationReaction original = new TranslationReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - TranslationReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new TranslationReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - TranslationReaction original = new TranslationReaction(); - assertNotNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new TranslationReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new TranslationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new TranslationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + TranslationReaction validReaction = new TranslationReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + TranslationReaction original = new TranslationReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + TranslationReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new TranslationReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + TranslationReaction original = new TranslationReaction(); + assertNotNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TransportReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TransportReactionTest.java index 1620cc2b66b1134979675bd7302794ca8b6530ed..9d601e4b387259862ac1c9d5b17321a957b3a87a 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TransportReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TransportReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -16,111 +17,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class TransportReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new TransportReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new TransportReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new TransportReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - TransportReaction validReaction = new TransportReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - TransportReaction original = new TransportReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - TransportReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new TransportReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - TransportReaction original = new TransportReaction(); - assertNotNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new TransportReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new TransportReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new TransportReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + TransportReaction validReaction = new TransportReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + TransportReaction original = new TransportReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + TransportReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new TransportReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + TransportReaction original = new TransportReaction(); + assertNotNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TruncationReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TruncationReactionTest.java index 21a47429b4a694bd4912c82fe885a352f38693dd..7a19cc9d59b54edbcddfd7d796b690cc26f4f257 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TruncationReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/TruncationReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -16,112 +17,107 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class TruncationReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new TruncationReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new TruncationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addProduct(new Product()); - new TruncationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - TruncationReaction validReaction = new TruncationReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - TruncationReaction original = new TruncationReaction(); - original.addProduct(new Product()); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - TruncationReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new TruncationReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testGetters() { - try { - Reaction reaction = new TruncationReaction(); - assertNotNull(reaction.getStringType()); - assertNotNull(reaction.getReactionRect()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new TruncationReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new TruncationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addProduct(new Product()); + new TruncationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + TruncationReaction validReaction = new TruncationReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + TruncationReaction original = new TruncationReaction(); + original.addProduct(new Product()); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + TruncationReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new TruncationReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + Reaction reaction = new TruncationReaction(); + assertNotNull(reaction.getStringType()); + assertNotNull(reaction.getReactionRect()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownNegativeInfluenceReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownNegativeInfluenceReactionTest.java index 0ad2061f231702920ca52a538bd2d723c902a546..65b27ab7243746a8b4fd1131472df02de566bfde 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownNegativeInfluenceReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownNegativeInfluenceReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,110 +18,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class UnknownNegativeInfluenceReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new UnknownNegativeInfluenceReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new UnknownNegativeInfluenceReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new UnknownNegativeInfluenceReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - UnknownNegativeInfluenceReaction validReaction = new UnknownNegativeInfluenceReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - UnknownNegativeInfluenceReaction original = new UnknownNegativeInfluenceReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - UnknownNegativeInfluenceReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new UnknownNegativeInfluenceReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - UnknownNegativeInfluenceReaction original = new UnknownNegativeInfluenceReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new UnknownNegativeInfluenceReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new UnknownNegativeInfluenceReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new UnknownNegativeInfluenceReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + UnknownNegativeInfluenceReaction validReaction = new UnknownNegativeInfluenceReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + UnknownNegativeInfluenceReaction original = new UnknownNegativeInfluenceReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + UnknownNegativeInfluenceReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new UnknownNegativeInfluenceReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + UnknownNegativeInfluenceReaction original = new UnknownNegativeInfluenceReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownPositiveInfluenceReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownPositiveInfluenceReactionTest.java index 9901b460182c1b66683bd49bfe635aee0e574287..92ecf983a1eb020b999e30faba64685427a4ef75 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownPositiveInfluenceReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownPositiveInfluenceReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,110 +18,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class UnknownPositiveInfluenceReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new UnknownPositiveInfluenceReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new UnknownPositiveInfluenceReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new UnknownPositiveInfluenceReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - UnknownPositiveInfluenceReaction validReaction = new UnknownPositiveInfluenceReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - UnknownPositiveInfluenceReaction original = new UnknownPositiveInfluenceReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - UnknownPositiveInfluenceReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new UnknownPositiveInfluenceReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - UnknownPositiveInfluenceReaction original = new UnknownPositiveInfluenceReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new UnknownPositiveInfluenceReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new UnknownPositiveInfluenceReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new UnknownPositiveInfluenceReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + UnknownPositiveInfluenceReaction validReaction = new UnknownPositiveInfluenceReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + UnknownPositiveInfluenceReaction original = new UnknownPositiveInfluenceReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + UnknownPositiveInfluenceReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new UnknownPositiveInfluenceReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + UnknownPositiveInfluenceReaction original = new UnknownPositiveInfluenceReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedModulationReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedModulationReactionTest.java index 136833568f14d19a74c93dcfbd2aa1fdd28dbdac..3a02c97aabb5ad917002283a533d4df591366bba 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedModulationReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedModulationReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,110 +18,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class UnknownReducedModulationReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new UnknownReducedModulationReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new UnknownReducedModulationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new UnknownReducedModulationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - UnknownReducedModulationReaction validReaction = new UnknownReducedModulationReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - UnknownReducedModulationReaction original = new UnknownReducedModulationReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - UnknownReducedModulationReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new UnknownReducedModulationReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - UnknownReducedModulationReaction original = new UnknownReducedModulationReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new UnknownReducedModulationReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new UnknownReducedModulationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new UnknownReducedModulationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + UnknownReducedModulationReaction validReaction = new UnknownReducedModulationReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + UnknownReducedModulationReaction original = new UnknownReducedModulationReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + UnknownReducedModulationReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new UnknownReducedModulationReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + UnknownReducedModulationReaction original = new UnknownReducedModulationReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedPhysicalStimulationReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedPhysicalStimulationReactionTest.java index f011daf484b3477fdb2673103800f2472586252e..7ec12810fd446bc8cabd5285a36246b5ac5cd72a 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedPhysicalStimulationReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedPhysicalStimulationReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,110 +18,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class UnknownReducedPhysicalStimulationReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new UnknownReducedPhysicalStimulationReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new UnknownReducedPhysicalStimulationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new UnknownReducedPhysicalStimulationReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - UnknownReducedPhysicalStimulationReaction validReaction = new UnknownReducedPhysicalStimulationReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - UnknownReducedPhysicalStimulationReaction original = new UnknownReducedPhysicalStimulationReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - UnknownReducedPhysicalStimulationReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new UnknownReducedPhysicalStimulationReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - UnknownReducedPhysicalStimulationReaction original = new UnknownReducedPhysicalStimulationReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new UnknownReducedPhysicalStimulationReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new UnknownReducedPhysicalStimulationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new UnknownReducedPhysicalStimulationReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + UnknownReducedPhysicalStimulationReaction validReaction = new UnknownReducedPhysicalStimulationReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + UnknownReducedPhysicalStimulationReaction original = new UnknownReducedPhysicalStimulationReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + UnknownReducedPhysicalStimulationReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new UnknownReducedPhysicalStimulationReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + UnknownReducedPhysicalStimulationReaction original = new UnknownReducedPhysicalStimulationReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedTriggerReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedTriggerReactionTest.java index 92877a42b434d9a61a35669882edb24c2c1e1a4b..4292d82dce4e7de83c3764dffab05e7019eb7a0c 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedTriggerReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownReducedTriggerReactionTest.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -17,110 +18,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class UnknownReducedTriggerReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new UnknownReducedTriggerReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new UnknownReducedTriggerReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new UnknownReducedTriggerReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - UnknownReducedTriggerReaction validReaction = new UnknownReducedTriggerReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testCopy() { - try { - UnknownReducedTriggerReaction original = new UnknownReducedTriggerReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - UnknownReducedTriggerReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new UnknownReducedTriggerReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testGetters() { - try { - UnknownReducedTriggerReaction original = new UnknownReducedTriggerReaction(); - assertNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new UnknownReducedTriggerReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new UnknownReducedTriggerReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new UnknownReducedTriggerReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + UnknownReducedTriggerReaction validReaction = new UnknownReducedTriggerReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + UnknownReducedTriggerReaction original = new UnknownReducedTriggerReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + UnknownReducedTriggerReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new UnknownReducedTriggerReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + UnknownReducedTriggerReaction original = new UnknownReducedTriggerReaction(); + assertNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } } diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownTransitionReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownTransitionReactionTest.java index 278e02ce73d5515457694eb6711e93ca6d719dff..cfe2c20ec8e2ebd2a2c844bf2e77b3dcb58e1023 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownTransitionReactionTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/type/UnknownTransitionReactionTest.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.NotImplementedException; @@ -16,111 +17,104 @@ import lcsb.mapviewer.model.map.reaction.Reaction; public class UnknownTransitionReactionTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSerialization() { - try { - SerializationUtils.serialize(new UnknownTransitionReaction()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg() { - try { - Reaction reaction = new Reaction(); - new UnknownTransitionReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructorWithInvalidArg2() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - new UnknownTransitionReaction(reaction); - fail("Exception expected"); - } catch (InvalidArgumentException e) { - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testConstructor() { - try { - Reaction reaction = new Reaction(); - reaction.addProduct(new Product()); - reaction.addReactant(new Reactant()); - UnknownTransitionReaction validReaction = new UnknownTransitionReaction(reaction); - assertNotNull(validReaction); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - - @Test - public void testCopy() { - try { - UnknownTransitionReaction original = new UnknownTransitionReaction(); - original.addProduct(new Product()); - original.addReactant(new Reactant()); - original.addReactant(new Reactant()); - UnknownTransitionReaction product = original.copy(); - assertNotNull(product); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testInvalidCopy() { - try { - new UnknownTransitionReaction() { - - /** - * - */ - private static final long serialVersionUID = 1L; - }.copy(); - fail("Exception expected"); - } catch (NotImplementedException e) { - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testGetters() { - try { - UnknownTransitionReaction original = new UnknownTransitionReaction(); - assertNotNull(original.getReactionRect()); - assertNotNull(original.getStringType()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSerialization() { + try { + SerializationUtils.serialize(new UnknownTransitionReaction()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg() { + try { + Reaction reaction = new Reaction(); + new UnknownTransitionReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructorWithInvalidArg2() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + new UnknownTransitionReaction(reaction); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testConstructor() { + try { + Reaction reaction = new Reaction(); + reaction.addProduct(new Product()); + reaction.addReactant(new Reactant()); + UnknownTransitionReaction validReaction = new UnknownTransitionReaction(reaction); + assertNotNull(validReaction); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCopy() { + try { + UnknownTransitionReaction original = new UnknownTransitionReaction(); + original.addProduct(new Product()); + original.addReactant(new Reactant()); + original.addReactant(new Reactant()); + UnknownTransitionReaction product = original.copy(); + assertNotNull(product); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidCopy() { + try { + Mockito.spy(new UnknownTransitionReaction()).copy(); + fail("Exception expected"); + } catch (NotImplementedException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testGetters() { + try { + UnknownTransitionReaction original = new UnknownTransitionReaction(); + assertNotNull(original.getReactionRect()); + assertNotNull(original.getStringType()); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } }