mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
REPO-2774: add the final tests to test suites
This commit is contained in:
@@ -350,8 +350,8 @@ public class AllRepositoryTestsCatalogue
|
|||||||
// [classpath:alfresco/application-context.xml] - part 2
|
// [classpath:alfresco/application-context.xml] - part 2
|
||||||
static void applicationContext_02(TestSuite suite)
|
static void applicationContext_02(TestSuite suite)
|
||||||
{
|
{
|
||||||
suite.addTestSuite(org.alfresco.repo.attributes.AttributeServiceTest.class); // there is a test that runs for 40s and one
|
// there is a test that runs for 40s and one for 184s
|
||||||
// 184s
|
suite.addTestSuite(org.alfresco.repo.attributes.AttributeServiceTest.class);
|
||||||
|
|
||||||
// was 11 (part)
|
// was 11 (part)
|
||||||
suite.addTestSuite(AuditableAspectTest.class);
|
suite.addTestSuite(AuditableAspectTest.class);
|
||||||
@@ -377,13 +377,11 @@ public class AllRepositoryTestsCatalogue
|
|||||||
|
|
||||||
// was 15 (part)
|
// was 15 (part)
|
||||||
suite.addTestSuite(GuessMimetypeTest.class);
|
suite.addTestSuite(GuessMimetypeTest.class);
|
||||||
// suite.addTestSuite(CharsetFinderTest.class);
|
|
||||||
suite.addTest(new JUnit4TestAdapter(FileContentStoreTest.class));
|
suite.addTest(new JUnit4TestAdapter(FileContentStoreTest.class));
|
||||||
suite.addTest(new JUnit4TestAdapter(NoRandomAccessFileContentStoreTest.class));
|
suite.addTest(new JUnit4TestAdapter(NoRandomAccessFileContentStoreTest.class));
|
||||||
suite.addTest(new JUnit4TestAdapter(ReadOnlyFileContentStoreTest.class));
|
suite.addTest(new JUnit4TestAdapter(ReadOnlyFileContentStoreTest.class));
|
||||||
// suite.addTestSuite(MimetypeMapTest.class);
|
|
||||||
suite.addTest(new JUnit4TestAdapter(RoutingContentStoreTest.class));
|
suite.addTest(new JUnit4TestAdapter(RoutingContentStoreTest.class));
|
||||||
|
// TODO see if we can move this
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@@ -394,7 +392,6 @@ public class AllRepositoryTestsCatalogue
|
|||||||
{
|
{
|
||||||
// Ignore
|
// Ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// [classpath:alfresco/application-context.xml] - part 3
|
// [classpath:alfresco/application-context.xml] - part 3
|
||||||
@@ -697,11 +694,9 @@ public class AllRepositoryTestsCatalogue
|
|||||||
suite.addTestSuite(org.alfresco.repo.rendition.RenditionServiceIntegrationTest.class);
|
suite.addTestSuite(org.alfresco.repo.rendition.RenditionServiceIntegrationTest.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void applicationContext_globalIntegrationTestContext_01(TestSuite suite)
|
|
||||||
{
|
|
||||||
{
|
|
||||||
// [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml]
|
// [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml]
|
||||||
|
static void applicationContext_globalIntegrationTestContext(TestSuite suite)
|
||||||
|
{
|
||||||
// was 09 (part)
|
// was 09 (part)
|
||||||
suite.addTest(new JUnit4TestAdapter(MailActionExecuterTest.class));
|
suite.addTest(new JUnit4TestAdapter(MailActionExecuterTest.class));
|
||||||
suite.addTest(new JUnit4TestAdapter(ActionServiceImpl2Test.class));
|
suite.addTest(new JUnit4TestAdapter(ActionServiceImpl2Test.class));
|
||||||
@@ -722,9 +717,8 @@ public class AllRepositoryTestsCatalogue
|
|||||||
// was 42 (part)
|
// was 42 (part)
|
||||||
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rule.MiscellaneousRulesTest.class));
|
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rule.MiscellaneousRulesTest.class));
|
||||||
// was 44
|
// was 44
|
||||||
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rule.RuleServiceIntegrationTest.class)); // fails locally even
|
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rule.RuleServiceIntegrationTest.class));
|
||||||
// on
|
|
||||||
// its own
|
|
||||||
// was 47 (part)
|
// was 47 (part)
|
||||||
suite.addTest(new JUnit4TestAdapter(ResetPasswordServiceImplTest.class));
|
suite.addTest(new JUnit4TestAdapter(ResetPasswordServiceImplTest.class));
|
||||||
// was 51
|
// was 51
|
||||||
@@ -735,8 +729,7 @@ public class AllRepositoryTestsCatalogue
|
|||||||
suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporaryNodesTest.class));
|
suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporaryNodesTest.class));
|
||||||
|
|
||||||
// was 66 (part)
|
// was 66 (part)
|
||||||
suite.addTest(
|
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.SolrFacetQueriesDisplayHandlersTest.class));
|
||||||
new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.SolrFacetQueriesDisplayHandlersTest.class));
|
|
||||||
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.SolrFacetServiceImplTest.class));
|
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.SolrFacetServiceImplTest.class));
|
||||||
|
|
||||||
// was 28 (part)
|
// was 28 (part)
|
||||||
@@ -746,6 +739,8 @@ public class AllRepositoryTestsCatalogue
|
|||||||
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.remotecredentials.RemoteCredentialsServicesTest.class));
|
suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.remotecredentials.RemoteCredentialsServicesTest.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void applicationContext_Combinations1(TestSuite suite)
|
||||||
|
{
|
||||||
// [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/site/site-custom-context.xml]
|
// [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/site/site-custom-context.xml]
|
||||||
{
|
{
|
||||||
// pass - slow 54s - site-custom-context.xml overrides siteService_permissionBootstrap -
|
// pass - slow 54s - site-custom-context.xml overrides siteService_permissionBootstrap -
|
||||||
@@ -853,7 +848,20 @@ public class AllRepositoryTestsCatalogue
|
|||||||
suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporarySitesTest.class));
|
suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporarySitesTest.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO
|
|
||||||
|
// [classpath:alfresco/application-context.xml, classpath:tenant/mt-*context.xml]
|
||||||
|
static void applicationContext_mtAllContext_56(TestSuite suite)
|
||||||
|
{
|
||||||
|
// pass - slow 182s -
|
||||||
|
// not sure what to say about the context files mt-*-context.xml
|
||||||
|
// it may be safe - at the end of
|
||||||
|
// was 56 (part)
|
||||||
|
suite.addTestSuite(org.alfresco.repo.tenant.MultiTDemoTest.class);
|
||||||
|
|
||||||
|
// was 61 (part)
|
||||||
|
suite.addTestSuite(ActivitiMultitenantWorkflowTest.class);
|
||||||
|
}
|
||||||
|
|
||||||
// [classpath:alfresco/application-context.xml, classpath:cache-test/cache-test-context.xml]
|
// [classpath:alfresco/application-context.xml, classpath:cache-test/cache-test-context.xml]
|
||||||
static void applicationContext_cacheTestContext_14(TestSuite suite)
|
static void applicationContext_cacheTestContext_14(TestSuite suite)
|
||||||
{
|
{
|
||||||
@@ -885,27 +893,16 @@ public class AllRepositoryTestsCatalogue
|
|||||||
suite.addTestSuite(org.alfresco.repo.subscriptions.SubscriptionServiceImplTest.class);
|
suite.addTestSuite(org.alfresco.repo.subscriptions.SubscriptionServiceImplTest.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [classpath:alfresco/application-context.xml, classpath:tenant/mt-*context.xml]
|
|
||||||
static void applicationContext_mtAllContext_56(TestSuite suite)
|
|
||||||
{
|
|
||||||
// pass - slow 182s -
|
|
||||||
// not sure what to say about the context files mt-*-context.xml
|
|
||||||
// it may be safe - at the end of
|
|
||||||
// was 56 (part)
|
|
||||||
suite.addTestSuite(org.alfresco.repo.tenant.MultiTDemoTest.class);
|
|
||||||
|
|
||||||
// was 61 (part)
|
|
||||||
suite.addTestSuite(ActivitiMultitenantWorkflowTest.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// [classpath:**/virtualization-test-context.xml, classpath:alfresco/application-context.xml]
|
// [classpath:**/virtualization-test-context.xml, classpath:alfresco/application-context.xml]
|
||||||
static void virtualizationTestContext_applicationContext_70(TestSuite suite)
|
static void virtualizationTestContext_applicationContext_70(TestSuite suite)
|
||||||
{
|
{
|
||||||
|
|
||||||
// pass - 16s - safe for merge
|
// pass - 16s - safe for merge
|
||||||
// virtualization-test-context.xml two beans defined that only seem to be used in tests
|
// virtualization-test-context.xml two beans defined that only seem to be used in tests
|
||||||
suite.addTest(org.alfresco.repo.virtual.VirtualizationIntegrationTestSuite.suite());
|
suite.addTest(org.alfresco.repo.virtual.VirtualizationIntegrationTestSuite.suite());
|
||||||
|
|
||||||
}
|
}
|
||||||
// TODO until here
|
// TODO until here
|
||||||
// ------------------------------------application context until here -------------------
|
// ------------------------------------application context until here -------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -28,12 +28,13 @@ package org.alfresco;
|
|||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
public class Repository100TestSuite_ApplicationContext_GlobalIntegrationTestContext extends TestSuite
|
public class Repository100TestSuite_ApplicationContext_Combinations1 extends TestSuite
|
||||||
{
|
{
|
||||||
public static Test suite()
|
public static Test suite()
|
||||||
{
|
{
|
||||||
TestSuite suite = new TestSuite();
|
TestSuite suite = new TestSuite();
|
||||||
AllRepositoryTestsCatalogue.applicationContext_globalIntegrationTestContext_01(suite);
|
AllRepositoryTestsCatalogue.applicationContext_globalIntegrationTestContext(suite);
|
||||||
|
AllRepositoryTestsCatalogue.applicationContext_Combinations1(suite);
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* #%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 <http://www.gnu.org/licenses/>.
|
||||||
|
* #L%
|
||||||
|
*/
|
||||||
|
package org.alfresco;
|
||||||
|
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
public class Repository101TestSuite_ApplicationContext_Combinations2 extends TestSuite
|
||||||
|
{
|
||||||
|
public static Test suite()
|
||||||
|
{
|
||||||
|
TestSuite suite = new TestSuite();
|
||||||
|
|
||||||
|
//any other order may lead to failing tests
|
||||||
|
AllRepositoryTestsCatalogue.virtualizationTestContext_applicationContext_70(suite);
|
||||||
|
AllRepositoryTestsCatalogue.applicationContext_testSubscriptionsContext_52(suite);
|
||||||
|
AllRepositoryTestsCatalogue.applicationContext_openCmisContext_07(suite);
|
||||||
|
AllRepositoryTestsCatalogue.applicationContext_cacheTestContext_14(suite);
|
||||||
|
AllRepositoryTestsCatalogue.applicationContext_mtAllContext_56(suite);
|
||||||
|
|
||||||
|
return suite;
|
||||||
|
}
|
||||||
|
}
|
@@ -99,7 +99,7 @@ public class OpenCmisLocalTest extends TestCase
|
|||||||
public static final String[] CONFIG_LOCATIONS = new String[] { "classpath:alfresco/application-context.xml",
|
public static final String[] CONFIG_LOCATIONS = new String[] { "classpath:alfresco/application-context.xml",
|
||||||
"classpath:opencmis/opencmistest-context.xml"
|
"classpath:opencmis/opencmistest-context.xml"
|
||||||
};
|
};
|
||||||
private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext(CONFIG_LOCATIONS);
|
private static ApplicationContext ctx;
|
||||||
private static final String BEAN_NAME_AUTHENTICATION_COMPONENT = "authenticationComponent";
|
private static final String BEAN_NAME_AUTHENTICATION_COMPONENT = "authenticationComponent";
|
||||||
private static final String MIME_PLAIN_TEXT = "text/plain";
|
private static final String MIME_PLAIN_TEXT = "text/plain";
|
||||||
private TempStoreOutputStreamFactory streamFactory;
|
private TempStoreOutputStreamFactory streamFactory;
|
||||||
@@ -113,10 +113,11 @@ public class OpenCmisLocalTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public static class TestCmisServiceFactory extends AbstractServiceFactory
|
public static class TestCmisServiceFactory extends AbstractServiceFactory
|
||||||
{
|
{
|
||||||
private static AlfrescoCmisServiceFactory serviceFactory = (AlfrescoCmisServiceFactory) ctx.getBean("CMISServiceFactory");
|
private static AlfrescoCmisServiceFactory serviceFactory;
|
||||||
@Override
|
@Override
|
||||||
public void init(Map<String, String> parameters)
|
public void init(Map<String, String> parameters)
|
||||||
{
|
{
|
||||||
|
serviceFactory = (AlfrescoCmisServiceFactory) ctx.getBean("CMISServiceFactory");
|
||||||
serviceFactory.init(parameters);
|
serviceFactory.init(parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,6 +155,7 @@ public class OpenCmisLocalTest extends TestCase
|
|||||||
|
|
||||||
public void setUp() throws Exception
|
public void setUp() throws Exception
|
||||||
{
|
{
|
||||||
|
ctx = ApplicationContextHelper.getApplicationContext(CONFIG_LOCATIONS);
|
||||||
File tempDir = new File(TempFileProvider.getTempDir(), GUID.generate());
|
File tempDir = new File(TempFileProvider.getTempDir(), GUID.generate());
|
||||||
this.streamFactory = TempStoreOutputStreamFactory.newInstance(tempDir, 1024, 1024, false);
|
this.streamFactory = TempStoreOutputStreamFactory.newInstance(tempDir, 1024, 1024, false);
|
||||||
this.eventPublisher = (EventPublisherForTestingOnly) ctx.getBean("eventPublisher");
|
this.eventPublisher = (EventPublisherForTestingOnly) ctx.getBean("eventPublisher");
|
||||||
|
@@ -56,10 +56,7 @@ import org.springframework.context.ApplicationContext;
|
|||||||
@Category(OwnJVMTestsCategory.class)
|
@Category(OwnJVMTestsCategory.class)
|
||||||
public class CacheTest extends TestCase
|
public class CacheTest extends TestCase
|
||||||
{
|
{
|
||||||
private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext(
|
private ApplicationContext ctx;
|
||||||
new String[] {
|
|
||||||
"classpath:cache-test/cache-test-context.xml",
|
|
||||||
ApplicationContextHelper.CONFIG_LOCATIONS[0]});
|
|
||||||
|
|
||||||
private ServiceRegistry serviceRegistry;
|
private ServiceRegistry serviceRegistry;
|
||||||
private SimpleCache<String, Object> objectCache;
|
private SimpleCache<String, Object> objectCache;
|
||||||
@@ -73,6 +70,8 @@ public class CacheTest extends TestCase
|
|||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception
|
public void setUp() throws Exception
|
||||||
{
|
{
|
||||||
|
ctx = ApplicationContextHelper.getApplicationContext(
|
||||||
|
new String[] { "classpath:cache-test/cache-test-context.xml", ApplicationContextHelper.CONFIG_LOCATIONS[0] });
|
||||||
if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
|
if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
|
||||||
{
|
{
|
||||||
fail("A transaction is still running");
|
fail("A transaction is still running");
|
||||||
|
@@ -69,7 +69,7 @@ public class SubscriptionServiceImplTest extends TestCase
|
|||||||
|
|
||||||
private UserTransaction txn;
|
private UserTransaction txn;
|
||||||
|
|
||||||
protected ApplicationContext ctx = ApplicationContextHelper.getApplicationContext(CONTEXTS);
|
protected ApplicationContext ctx;
|
||||||
protected TransactionService transactionService;
|
protected TransactionService transactionService;
|
||||||
protected SubscriptionService subscriptionService;
|
protected SubscriptionService subscriptionService;
|
||||||
protected PersonService personService;
|
protected PersonService personService;
|
||||||
@@ -79,6 +79,7 @@ public class SubscriptionServiceImplTest extends TestCase
|
|||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception
|
public void setUp() throws Exception
|
||||||
{
|
{
|
||||||
|
ctx = ApplicationContextHelper.getApplicationContext(CONTEXTS);
|
||||||
// Get the required services
|
// Get the required services
|
||||||
transactionService = (TransactionService) ctx.getBean("TransactionService");
|
transactionService = (TransactionService) ctx.getBean("TransactionService");
|
||||||
subscriptionService = (SubscriptionService) ctx.getBean("SubscriptionService");
|
subscriptionService = (SubscriptionService) ctx.getBean("SubscriptionService");
|
||||||
|
@@ -107,9 +107,7 @@ public class MultiTDemoTest extends TestCase
|
|||||||
{
|
{
|
||||||
private static Log logger = LogFactory.getLog(MultiTDemoTest.class);
|
private static Log logger = LogFactory.getLog(MultiTDemoTest.class);
|
||||||
|
|
||||||
private static ApplicationContext ctx = new ClassPathXmlApplicationContext(
|
private ApplicationContext ctx;
|
||||||
new String[] {ApplicationContextHelper.CONFIG_LOCATIONS[0], "classpath:tenant/mt-*context.xml"}
|
|
||||||
);
|
|
||||||
|
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
private NodeArchiveService nodeArchiveService;
|
private NodeArchiveService nodeArchiveService;
|
||||||
@@ -184,6 +182,8 @@ public class MultiTDemoTest extends TestCase
|
|||||||
protected void setUp() throws Exception
|
protected void setUp() throws Exception
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
ctx = new ClassPathXmlApplicationContext(
|
||||||
|
new String[] { ApplicationContextHelper.CONFIG_LOCATIONS[0], "classpath:tenant/mt-*context.xml" });
|
||||||
|
|
||||||
nodeService = (NodeService) ctx.getBean("NodeService");
|
nodeService = (NodeService) ctx.getBean("NodeService");
|
||||||
nodeArchiveService = (NodeArchiveService) ctx.getBean("nodeArchiveService");
|
nodeArchiveService = (NodeArchiveService) ctx.getBean("nodeArchiveService");
|
||||||
|
Reference in New Issue
Block a user