From 4a74ae93b6fb66fca44fe1746563d61d7071a990 Mon Sep 17 00:00:00 2001 From: Andrei Rebegea Date: Mon, 7 Aug 2017 15:18:07 +0300 Subject: [PATCH] REPO-2774: further split on test suite AppContextExtra02 because of the max_connection limit on bamboo --- .../alfresco/AllRepositoryTestsCatalogue.java | 12 ++--- .../alfresco/AppContextExtra02TestSuite.java | 15 +++--- .../alfresco/AppContextExtra03TestSuite.java | 47 +++++++++++++++++++ .../org/alfresco/MinContextTestSuite.java | 2 +- .../org/alfresco/MiscContextTestSuite.java | 2 +- .../org/alfresco/TransformerTestSuite.java | 2 +- 6 files changed, 64 insertions(+), 16 deletions(-) create mode 100644 src/test/java/org/alfresco/AppContextExtra03TestSuite.java diff --git a/src/test/java/org/alfresco/AllRepositoryTestsCatalogue.java b/src/test/java/org/alfresco/AllRepositoryTestsCatalogue.java index 8d0cbe11bd..876c014dd2 100644 --- a/src/test/java/org/alfresco/AllRepositoryTestsCatalogue.java +++ b/src/test/java/org/alfresco/AllRepositoryTestsCatalogue.java @@ -851,7 +851,7 @@ public class AllRepositoryTestsCatalogue } // [classpath:alfresco/application-context.xml, classpath:tenant/mt-*context.xml] - static void applicationContext_mtAllContext_56(TestSuite suite) + static void applicationContext_mtAllContext(TestSuite suite) { // pass - slow 182s - // not sure what to say about the context files mt-*-context.xml @@ -873,7 +873,7 @@ public class AllRepositoryTestsCatalogue } // [classpath:alfresco/application-context.xml, classpath:opencmis/opencmistest-context.xml] - static void applicationContext_openCmisContext_07(TestSuite suite) + static void applicationContext_openCmisContext(TestSuite suite) { // this does not want to play nice with the ones above // pass - 8 s - fast - no DB - @@ -885,7 +885,7 @@ public class AllRepositoryTestsCatalogue // TODO can we remove this? Was it EOLed? // [classpath:alfresco/application-context.xml, classpath:test/alfresco/test-subscriptions-context.xml] - static void applicationContext_testSubscriptionsContext_52(TestSuite suite) + static void applicationContext_testSubscriptionsContext(TestSuite suite) { // pass - fast 3s - no DB // test-subscriptions-context.xml overrides extension.dictionaryBootstrap - with custom models @@ -908,7 +908,7 @@ public class AllRepositoryTestsCatalogue * * various tests that do use context files but do not fit into other main context files patterns */ - static void miscContext_999(TestSuite suite) + static void miscContext(TestSuite suite) { // context files: [classpath:alfresco/node-locator-context.xml, classpath:test-nodeLocatorServiceImpl-context.xml] suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.nodelocator.NodeLocatorServiceImplTest.class)); @@ -991,7 +991,7 @@ public class AllRepositoryTestsCatalogue } // [classpath:alfresco/minimal-context.xml] - static void minimalContext_16(TestSuite suite) + static void minimalContext(TestSuite suite) { // This has a few failures - not sure what I can do about that. 513 tests in total ~ 100s // was 16 (part) @@ -1002,7 +1002,7 @@ public class AllRepositoryTestsCatalogue } // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/thumbnail/test-thumbnail-context.xml] - static void applicationContext_testThumnailContext_57(TestSuite suite) + static void applicationContext_testThumnailContext(TestSuite suite) { // fails- 68s // test-thumbnail-context.xml - should be fine to merge - only defines some extra test beans diff --git a/src/test/java/org/alfresco/AppContextExtra02TestSuite.java b/src/test/java/org/alfresco/AppContextExtra02TestSuite.java index 3ce44d983b..3eef3e9ef2 100644 --- a/src/test/java/org/alfresco/AppContextExtra02TestSuite.java +++ b/src/test/java/org/alfresco/AppContextExtra02TestSuite.java @@ -33,14 +33,15 @@ public class AppContextExtra02TestSuite extends TestSuite public static Test suite() { TestSuite suite = new TestSuite(); - - //any other order may lead to failing tests + + // any other order may lead to failing tests AllRepositoryTestsCatalogue.virtualizationTestContext_applicationContext(suite); - AllRepositoryTestsCatalogue.applicationContext_testSubscriptionsContext_52(suite); - AllRepositoryTestsCatalogue.applicationContext_openCmisContext_07(suite); - AllRepositoryTestsCatalogue.applicationContext_cacheTestContext(suite); - AllRepositoryTestsCatalogue.applicationContext_mtAllContext_56(suite); - + AllRepositoryTestsCatalogue.applicationContext_testSubscriptionsContext(suite); + AllRepositoryTestsCatalogue.applicationContext_openCmisContext(suite); + // TODO Uncomment the following 2 lines after REPO-2790 is implemented + // AllRepositoryTestsCatalogue.applicationContext_cacheTestContext(suite); + // AllRepositoryTestsCatalogue.applicationContext_mtAllContext(suite); + return suite; } } diff --git a/src/test/java/org/alfresco/AppContextExtra03TestSuite.java b/src/test/java/org/alfresco/AppContextExtra03TestSuite.java new file mode 100644 index 0000000000..44cce97ea2 --- /dev/null +++ b/src/test/java/org/alfresco/AppContextExtra03TestSuite.java @@ -0,0 +1,47 @@ +/* + * #%L + * Alfresco Repository + * %% + * Copyright (C) 2005 - 2017 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * Temporary class. Please read the comments on {@link AppContextExtra02TestSuite} + * + * Tests were split just because the limitation on the bamboo agents DB config see REPO-2790 + */ +public class AppContextExtra03TestSuite extends TestSuite +{ + public static Test suite() + { + TestSuite suite = new TestSuite(); + + AllRepositoryTestsCatalogue.applicationContext_cacheTestContext(suite); + AllRepositoryTestsCatalogue.applicationContext_mtAllContext(suite); + + return suite; + } +} diff --git a/src/test/java/org/alfresco/MinContextTestSuite.java b/src/test/java/org/alfresco/MinContextTestSuite.java index 76dfb848a4..5516964aac 100644 --- a/src/test/java/org/alfresco/MinContextTestSuite.java +++ b/src/test/java/org/alfresco/MinContextTestSuite.java @@ -33,7 +33,7 @@ public class MinContextTestSuite extends TestSuite public static Test suite() { TestSuite suite = new TestSuite(); - AllRepositoryTestsCatalogue.minimalContext_16(suite); + AllRepositoryTestsCatalogue.minimalContext(suite); return suite; } } diff --git a/src/test/java/org/alfresco/MiscContextTestSuite.java b/src/test/java/org/alfresco/MiscContextTestSuite.java index 762c14c4a5..e02d00e2d4 100644 --- a/src/test/java/org/alfresco/MiscContextTestSuite.java +++ b/src/test/java/org/alfresco/MiscContextTestSuite.java @@ -33,7 +33,7 @@ public class MiscContextTestSuite public static Test suite() { TestSuite suite = new TestSuite(); - AllRepositoryTestsCatalogue.miscContext_999(suite); + AllRepositoryTestsCatalogue.miscContext(suite); return suite; } } diff --git a/src/test/java/org/alfresco/TransformerTestSuite.java b/src/test/java/org/alfresco/TransformerTestSuite.java index f6e6dd26c5..d854b9adc0 100644 --- a/src/test/java/org/alfresco/TransformerTestSuite.java +++ b/src/test/java/org/alfresco/TransformerTestSuite.java @@ -33,7 +33,7 @@ public class TransformerTestSuite public static Test suite() { TestSuite suite = new TestSuite(); - AllRepositoryTestsCatalogue.applicationContext_testThumnailContext_57(suite); + AllRepositoryTestsCatalogue.applicationContext_testThumnailContext(suite); return suite; } }