This is an automated email from the ASF dual-hosted git repository. awasum pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/fineract-cn-reporting.git
commit 2304cdbf9277b433ba30fd8510f0e2b27d467b88 Author: Isaac Kamga <[email protected]> AuthorDate: Mon Oct 15 22:17:25 2018 +0100 Add test suite to reporting service's component-test --- .../AbstractReportingSpecificationTest.java | 26 +------------------ .../cn/reporting/SuiteTestEnvironment.java | 18 ++++++++------ .../apache/fineract/cn/reporting/TestSuite.java | 29 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 32 deletions(-) diff --git a/component-test/src/main/java/org/apache/fineract/cn/reporting/AbstractReportingSpecificationTest.java b/component-test/src/main/java/org/apache/fineract/cn/reporting/AbstractReportingSpecificationTest.java index ed375b7..cd9a56c 100644 --- a/component-test/src/main/java/org/apache/fineract/cn/reporting/AbstractReportingSpecificationTest.java +++ b/component-test/src/main/java/org/apache/fineract/cn/reporting/AbstractReportingSpecificationTest.java @@ -23,17 +23,10 @@ import org.apache.fineract.cn.reporting.service.ReportingConfiguration; import java.security.interfaces.RSAPrivateKey; import org.apache.fineract.cn.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule; import org.apache.fineract.cn.api.context.AutoUserContext; -import org.apache.fineract.cn.lang.ApplicationName; -import org.apache.fineract.cn.test.env.TestEnvironment; -import org.apache.fineract.cn.test.fixture.TenantDataStoreContextTestRule; -import org.apache.fineract.cn.test.fixture.cassandra.CassandraInitializer; -import org.apache.fineract.cn.test.fixture.mariadb.MariaDBInitializer; import org.junit.After; import org.junit.Before; -import org.junit.ClassRule; + import org.junit.Rule; -import org.junit.rules.RuleChain; -import org.junit.rules.TestRule; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,20 +64,6 @@ public class AbstractReportingSpecificationTest extends SuiteTestEnvironment { } } - static final String TEST_USER = "homer"; - - private final static TestEnvironment testEnvironment = new TestEnvironment(APP_NAME); - private final static CassandraInitializer cassandraInitializer = new CassandraInitializer(); - private final static MariaDBInitializer mariaDBInitializer = new MariaDBInitializer(); - final static TenantDataStoreContextTestRule tenantDataStoreContext = TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer, mariaDBInitializer); - - @ClassRule - public static TestRule orderClassRules = RuleChain - .outerRule(testEnvironment) - .around(cassandraInitializer) - .around(mariaDBInitializer) - .around(tenantDataStoreContext); - @Rule public final TenantApplicationSecurityEnvironmentTestRule tenantApplicationSecurityEnvironment = new TenantApplicationSecurityEnvironmentTestRule(testEnvironment, this::waitForInitialize); @@ -95,9 +74,6 @@ public class AbstractReportingSpecificationTest extends SuiteTestEnvironment { ReportManager testSubject; @Autowired - private ApplicationName applicationName; - - @Autowired @Qualifier(LOGGER_NAME) Logger logger; diff --git a/component-test/src/main/java/org/apache/fineract/cn/reporting/SuiteTestEnvironment.java b/component-test/src/main/java/org/apache/fineract/cn/reporting/SuiteTestEnvironment.java index 9a65c5f..e3be870 100644 --- a/component-test/src/main/java/org/apache/fineract/cn/reporting/SuiteTestEnvironment.java +++ b/component-test/src/main/java/org/apache/fineract/cn/reporting/SuiteTestEnvironment.java @@ -19,22 +19,26 @@ package org.apache.fineract.cn.reporting; import org.apache.fineract.cn.test.env.TestEnvironment; +import org.apache.fineract.cn.test.fixture.TenantDataStoreContextTestRule; import org.apache.fineract.cn.test.fixture.cassandra.CassandraInitializer; import org.apache.fineract.cn.test.fixture.mariadb.MariaDBInitializer; import org.junit.ClassRule; import org.junit.rules.RuleChain; -import org.junit.rules.RunExternalResourceOnce; import org.junit.rules.TestRule; public class SuiteTestEnvironment { static final String APP_NAME = "reporting-v1"; - static final TestEnvironment testEnvironment = new TestEnvironment(APP_NAME); - static final CassandraInitializer cassandraInitializer = new CassandraInitializer(); - static final MariaDBInitializer mariaDBInitializer = new MariaDBInitializer(); + static final String TEST_USER = "shu"; + + public final static TestEnvironment testEnvironment = new TestEnvironment(APP_NAME); + private final static CassandraInitializer cassandraInitializer = new CassandraInitializer(); + private final static MariaDBInitializer mariaDBInitializer = new MariaDBInitializer(); + final static TenantDataStoreContextTestRule tenantDataStoreContext = TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer, mariaDBInitializer); @ClassRule public static TestRule orderClassRules = RuleChain - .outerRule(new RunExternalResourceOnce(testEnvironment)) - .around(new RunExternalResourceOnce(cassandraInitializer)) - .around(new RunExternalResourceOnce(mariaDBInitializer)); + .outerRule(testEnvironment) + .around(cassandraInitializer) + .around(mariaDBInitializer) + .around(tenantDataStoreContext); } diff --git a/component-test/src/main/java/org/apache/fineract/cn/reporting/TestSuite.java b/component-test/src/main/java/org/apache/fineract/cn/reporting/TestSuite.java new file mode 100644 index 0000000..17782b4 --- /dev/null +++ b/component-test/src/main/java/org/apache/fineract/cn/reporting/TestSuite.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.cn.reporting; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) [email protected]({ + TestReportingSpecifications.class +}) +public class TestSuite { +}
