diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ServerInterfaceRegressionTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ServerInterfaceRegressionTest.java index d4ad2bfc6a40c21b8e25b4af8c2a02b522ce7730..11147bf442966456b554d0aafec77355e339ddfb 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ServerInterfaceRegressionTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ServerInterfaceRegressionTest.java @@ -18,15 +18,15 @@ package ch.systemsx.cisd.openbis.generic.server; import org.testng.annotations.Test; +import ch.systemsx.cisd.openbis.generic.server.util.AnnotationAppliedTestCase; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; import ch.systemsx.cisd.openbis.generic.shared.IETLLIMSService; import ch.systemsx.cisd.openbis.generic.shared.ITrackingServer; -import ch.systemsx.cisd.openbis.generic.shared.RegressionTestCase; /** * @author Franz-Josef Elmer */ -public class ServerInterfaceRegressionTest extends RegressionTestCase +public class ServerInterfaceRegressionTest extends AnnotationAppliedTestCase { @Test diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/RegressionTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/AnnotationAppliedTestCase.java similarity index 73% rename from openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/RegressionTestCase.java rename to openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/AnnotationAppliedTestCase.java index 51000f75616f73deb7505cc4e3052a0ddc0a8e1f..8bcdc3488d32f07c1848b4c3404c2eaeff35a626 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/RegressionTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/AnnotationAppliedTestCase.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.shared; +package ch.systemsx.cisd.openbis.generic.server.util; import java.lang.annotation.Annotation; import java.lang.reflect.Method; @@ -28,21 +28,39 @@ import org.testng.AssertJUnit; import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed; /** + * Test case for test classes testing whether an interface and/or its implementation have all + * mandatory annotations. + * * @author Franz-Josef Elmer */ -public class RegressionTestCase extends AssertJUnit +public class AnnotationAppliedTestCase extends AssertJUnit { - protected void assertMandatoryMethodAnnotations(Class<?> clazz) + /** + * Asserts that the specified class is an interface and all its methods have the annotations + * {@link RolesAllowed} and {@link Transactional}. + */ + protected void assertMandatoryMethodAnnotations(Class<?> interfaceClass) { - assertMandatoryMethodAnnotations(clazz, clazz); + assertMandatoryMethodAnnotations(interfaceClass, interfaceClass); } + /** + * Asserts that the specified interface class is an interface, the implementing class really + * implements that interface, and all interface methods or their implementations have the + * annotations {@link RolesAllowed} and {@link Transactional}. + */ protected void assertMandatoryMethodAnnotations(Class<?> interfaceClass, Class<?> implementingClass) { assertMandatoryMethodAnnotations(interfaceClass, implementingClass, ""); } + /** + * Asserts that the specified interface class is an interface, the implementing class really + * implements that interface, and all interface methods or their implementations have the + * annotations {@link RolesAllowed} and {@link Transactional}. The specified exceptions are + * allowed. + */ protected void assertMandatoryMethodAnnotations(Class<?> interfaceClass, Class<?> implementingClass, String exceptions) { @@ -55,6 +73,11 @@ public class RegressionTestCase extends AssertJUnit exceptions); } + /** + * Asserts that the specified interface class is an interface, the implementing class really + * implements that interface, and all interface methods or their implementations have the + * specified annotations. The specified exceptions are allowed. + */ protected void assertMandatoryMethodAnnotations( List<Class<? extends Annotation>> mandatoryAnnotations, Class<?> interfaceClass, Class<?> implementingClass, String exceptions) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/demo/server/ServerInterfaceRegressionTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/demo/server/ServerInterfaceRegressionTest.java index 0d63ba312c310f549280733685222a0d4900a5e9..876c1b40381c51ba970288a7185cc0059c3f4072 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/demo/server/ServerInterfaceRegressionTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/demo/server/ServerInterfaceRegressionTest.java @@ -18,13 +18,13 @@ package ch.systemsx.cisd.openbis.plugin.demo.server; import org.testng.annotations.Test; -import ch.systemsx.cisd.openbis.generic.shared.RegressionTestCase; +import ch.systemsx.cisd.openbis.generic.server.util.AnnotationAppliedTestCase; import ch.systemsx.cisd.openbis.plugin.demo.shared.IDemoServer; /** * @author Franz-Josef Elmer */ -public class ServerInterfaceRegressionTest extends RegressionTestCase +public class ServerInterfaceRegressionTest extends AnnotationAppliedTestCase { @Test public void testIGenericServer() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/server/ServerInterfaceRegressionTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/server/ServerInterfaceRegressionTest.java index 57bc3d06688f9286ae81a9a09ed0bda417e4c83a..a6351b50ff335d59d9731794500147eac9ad322f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/server/ServerInterfaceRegressionTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/server/ServerInterfaceRegressionTest.java @@ -18,13 +18,13 @@ package ch.systemsx.cisd.openbis.plugin.generic.server; import org.testng.annotations.Test; -import ch.systemsx.cisd.openbis.generic.shared.RegressionTestCase; +import ch.systemsx.cisd.openbis.generic.server.util.AnnotationAppliedTestCase; import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; /** * @author Franz-Josef Elmer */ -public class ServerInterfaceRegressionTest extends RegressionTestCase +public class ServerInterfaceRegressionTest extends AnnotationAppliedTestCase { @Test public void testIGenericServer() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/query/server/ServerInterfaceRegressionTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/query/server/ServerInterfaceRegressionTest.java index e248cfd7e76194af5449cc59fd850a3c17920a25..3f8d65007b98b5e0c06d74bfc374192c3c56d42e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/query/server/ServerInterfaceRegressionTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/query/server/ServerInterfaceRegressionTest.java @@ -18,13 +18,13 @@ package ch.systemsx.cisd.openbis.plugin.query.server; import org.testng.annotations.Test; -import ch.systemsx.cisd.openbis.generic.shared.RegressionTestCase; +import ch.systemsx.cisd.openbis.generic.server.util.AnnotationAppliedTestCase; import ch.systemsx.cisd.openbis.plugin.query.shared.IQueryServer; /** * @author Piotr Buczek */ -public class ServerInterfaceRegressionTest extends RegressionTestCase +public class ServerInterfaceRegressionTest extends AnnotationAppliedTestCase { @Test public void testIQueryServer() diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/ServerInterfaceRegressionTest.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/ServerInterfaceRegressionTest.java index b644caadb0ea7a985fdc9a69ebeb08086d259ca5..7b93e43edcf80fd888aab318adee93c2edb1a316 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/ServerInterfaceRegressionTest.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/ServerInterfaceRegressionTest.java @@ -18,7 +18,7 @@ package ch.systemsx.cisd.openbis.plugin.proteomics.server; import org.testng.annotations.Test; -import ch.systemsx.cisd.openbis.generic.shared.RegressionTestCase; +import ch.systemsx.cisd.openbis.generic.server.util.AnnotationAppliedTestCase; import ch.systemsx.cisd.openbis.plugin.proteomics.shared.IPhosphoNetXServer; import ch.systemsx.cisd.openbis.plugin.proteomics.shared.IProteomicsDataServiceInternal; @@ -27,7 +27,7 @@ import ch.systemsx.cisd.openbis.plugin.proteomics.shared.IProteomicsDataServiceI * * @author Franz-Josef Elmer */ -public class ServerInterfaceRegressionTest extends RegressionTestCase +public class ServerInterfaceRegressionTest extends AnnotationAppliedTestCase { @Test public void testServerAnnotations() diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/api/v1/ServerInterfaceRegressionTest.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/api/v1/ServerInterfaceRegressionTest.java index 97ffb0dda1f950a66f210ccad5272015349c0fc6..8e784d4babf335253e5547a68ed27aae2764b38b 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/api/v1/ServerInterfaceRegressionTest.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/api/v1/ServerInterfaceRegressionTest.java @@ -18,7 +18,7 @@ package ch.systemsx.cisd.openbis.plugin.proteomics.server.api.v1; import org.testng.annotations.Test; -import ch.systemsx.cisd.openbis.generic.shared.RegressionTestCase; +import ch.systemsx.cisd.openbis.generic.server.util.AnnotationAppliedTestCase; import ch.systemsx.cisd.openbis.plugin.proteomics.shared.api.v1.IProteomicsDataService; /** @@ -26,7 +26,7 @@ import ch.systemsx.cisd.openbis.plugin.proteomics.shared.api.v1.IProteomicsDataS * * @author Franz-Josef Elmer */ -public class ServerInterfaceRegressionTest extends RegressionTestCase +public class ServerInterfaceRegressionTest extends AnnotationAppliedTestCase { @Test public void testServerAnnotations() diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/server/ServerInterfaceRegressionTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/server/ServerInterfaceRegressionTest.java index 3673400dba0cfd01b16a697a518c913f24a354c2..903aa2335904f1fc8ea909b30a960c1535395197 100644 --- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/server/ServerInterfaceRegressionTest.java +++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/server/ServerInterfaceRegressionTest.java @@ -18,14 +18,14 @@ package ch.systemsx.cisd.openbis.plugin.screening.server; import org.testng.annotations.Test; -import ch.systemsx.cisd.openbis.generic.shared.RegressionTestCase; +import ch.systemsx.cisd.openbis.generic.server.util.AnnotationAppliedTestCase; import ch.systemsx.cisd.openbis.plugin.screening.shared.IScreeningServer; import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.IScreeningApiServer; /** * @author Tomasz Pylak */ -public class ServerInterfaceRegressionTest extends RegressionTestCase +public class ServerInterfaceRegressionTest extends AnnotationAppliedTestCase { @Test public void testServerAnnotations()