IGNITE-5732 Provide API to test compatibility with old releases
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c6571448 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c6571448 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c6571448 Branch: refs/heads/ignite-3478 Commit: c6571448c5d75af3093436323f9f339602a5c083 Parents: 1f2f872 Author: Vyacheslav Daradur <[email protected]> Authored: Fri Sep 22 14:10:37 2017 +0300 Committer: Anton Vinogradov <[email protected]> Committed: Fri Sep 22 14:10:37 2017 +0300 ---------------------------------------------------------------------- modules/compatibility/README.txt | 5 + modules/compatibility/licenses/apache-2.0.txt | 202 +++++++++++++ modules/compatibility/pom.xml | 94 +++++++ .../ignite/compatibility/package-info.java | 22 ++ .../DummyPersistenceCompatibilityTest.java | 108 +++++++ ...itePersistenceCompatibilityAbstractTest.java | 89 ++++++ .../compatibility/persistence/package-info.java | 22 ++ .../junits/CompatibilityTestsFacade.java | 46 +++ .../junits/IgniteCompatibilityAbstractTest.java | 280 +++++++++++++++++++ .../junits/IgniteCompatibilityNodeRunner.java | 157 +++++++++++ .../logger/ListenedGridTestLog4jLogger.java | 91 ++++++ .../junits/logger/package-info.java | 22 ++ .../testframework/junits/package-info.java | 22 ++ .../testframework/package-info.java | 22 ++ .../plugins/DisabledValidationProcessor.java | 42 +++ .../TestCompatibilityPluginProvider.java | 119 ++++++++ .../testframework/plugins/package-info.java | 22 ++ .../testframework/util/MavenUtils.java | 208 ++++++++++++++ .../testframework/util/package-info.java | 22 ++ .../IgniteCompatibilityBasicTestSuite.java | 38 +++ .../compatibility/testsuites/package-info.java | 22 ++ .../org.apache.ignite.plugin.PluginProvider | 1 + .../org.apache.ignite.plugin.PluginProvider | 2 +- .../junits/multijvm/IgniteNodeRunner.java | 2 +- .../junits/multijvm/IgniteProcessProxy.java | 90 ++++-- pom.xml | 8 + 26 files changed, 1734 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/README.txt ---------------------------------------------------------------------- diff --git a/modules/compatibility/README.txt b/modules/compatibility/README.txt new file mode 100644 index 0000000..f2743ec --- /dev/null +++ b/modules/compatibility/README.txt @@ -0,0 +1,5 @@ +Apache Ignite Compatibility Tests +------------------------ + +Special module contains testing framework which provides methods for testing backward compatibility. +It allows to start Ignite-cluster in multiversion mode. It means that nodes with different build version is allowed to join topology. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/licenses/apache-2.0.txt ---------------------------------------------------------------------- diff --git a/modules/compatibility/licenses/apache-2.0.txt b/modules/compatibility/licenses/apache-2.0.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/modules/compatibility/licenses/apache-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/pom.xml ---------------------------------------------------------------------- diff --git a/modules/compatibility/pom.xml b/modules/compatibility/pom.xml new file mode 100644 index 0000000..166848d --- /dev/null +++ b/modules/compatibility/pom.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + 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. +--> + +<!-- + POM file. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-parent</artifactId> + <version>1</version> + <relativePath>../../parent</relativePath> + </parent> + + <artifactId>ignite-compatibility</artifactId> + <version>2.3.0-SNAPSHOT</version> + <url>http://ignite.apache.org</url> + + <dependencies> + <dependency> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-core</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>${guava.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-core</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>com.thoughtworks.xstream</groupId> + <artifactId>xstream</artifactId> + <version>1.4.8</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/package-info.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/package-info.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/package-info.java new file mode 100644 index 0000000..73d9423 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/package-info.java @@ -0,0 +1,22 @@ +/* + * 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 description. --> + * Contains compatibility tests or compatibility test related classes and interfaces. + */ +package org.apache.ignite.compatibility; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/DummyPersistenceCompatibilityTest.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/DummyPersistenceCompatibilityTest.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/DummyPersistenceCompatibilityTest.java new file mode 100644 index 0000000..f548939 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/DummyPersistenceCompatibilityTest.java @@ -0,0 +1,108 @@ +/* + * 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.ignite.compatibility.persistence; + +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.configuration.PersistentStoreConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.processors.cache.GridCacheAbstractFullApiSelfTest; +import org.apache.ignite.lang.IgniteInClosure; +import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; + +/** */ +public class DummyPersistenceCompatibilityTest extends IgnitePersistenceCompatibilityAbstractTest { + /** */ + private static final String TEST_CACHE_NAME = DummyPersistenceCompatibilityTest.class.getSimpleName(); + + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); + + cfg.setPeerClassLoadingEnabled(false); + + cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration()); + + return cfg; + } + + /** + * @throws Exception If failed. + */ + public void testNodeStartByOldVersionPersistenceData() throws Exception { + try { + startGrid(1, "2.2.0", new ConfigurationClosure(), new PostStartupClosure()); + + stopAllGrids(); + + IgniteEx ignite = startGrid(0); + + assertEquals(1, ignite.context().discovery().topologyVersion()); + + ignite.active(true); + + IgniteCache<Integer, String> cache = ignite.getOrCreateCache(TEST_CACHE_NAME); + + for (int i = 0; i < 10; i++) + assertEquals("data" + i, cache.get(i)); + } + finally { + stopAllGrids(); + } + } + + /** */ + private static class PostStartupClosure implements IgniteInClosure<Ignite> { + /** {@inheritDoc} */ + @Override public void apply(Ignite ignite) { + ignite.active(true); + + CacheConfiguration<Integer, String> cacheCfg = new CacheConfiguration<>(); + cacheCfg.setName(TEST_CACHE_NAME); + cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); + cacheCfg.setBackups(1); + cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); + + IgniteCache<Integer, String> cache = ignite.createCache(cacheCfg); + + for (int i = 0; i < 10; i++) + cache.put(i, "data" + i); + } + } + + /** */ + private static class ConfigurationClosure implements IgniteInClosure<IgniteConfiguration> { + /** {@inheritDoc} */ + @Override public void apply(IgniteConfiguration cfg) { + cfg.setLocalHost("127.0.0.1"); + + TcpDiscoverySpi disco = new TcpDiscoverySpi(); + disco.setIpFinder(GridCacheAbstractFullApiSelfTest.LOCAL_IP_FINDER); + + cfg.setDiscoverySpi(disco); + + cfg.setPeerClassLoadingEnabled(false); + + cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration()); + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePersistenceCompatibilityAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePersistenceCompatibilityAbstractTest.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePersistenceCompatibilityAbstractTest.java new file mode 100644 index 0000000..6eb49e4 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePersistenceCompatibilityAbstractTest.java @@ -0,0 +1,89 @@ +/* + * 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.ignite.compatibility.persistence; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.compatibility.testframework.junits.IgniteCompatibilityAbstractTest; +import org.apache.ignite.internal.util.typedef.internal.U; + +/** + * Super class for all persistence compatibility tests. + */ +public class IgnitePersistenceCompatibilityAbstractTest extends IgniteCompatibilityAbstractTest { + /** {@inheritDoc} */ + @Override protected void beforeTest() throws Exception { + super.beforeTest(); + + if (!isDefaultDBWorkDirectoryEmpty()) + deleteDefaultDBWorkDirectory(); + + assert isDefaultDBWorkDirectoryEmpty() : "DB work directory is not empty."; + } + + /** {@inheritDoc} */ + @Override protected void afterTest() throws Exception { + super.afterTest(); + + assert deleteDefaultDBWorkDirectory() : "Couldn't delete DB work directory."; + } + + /** + * Gets a path to the default DB working directory. + * + * @return Path to the default DB working directory. + * @throws IgniteCheckedException In case of an error. + * @see #deleteDefaultDBWorkDirectory() + * @see #isDefaultDBWorkDirectoryEmpty() + */ + protected Path getDefaultDbWorkPath() throws IgniteCheckedException { + return Paths.get(U.defaultWorkDirectory() + File.separator + "db"); + } + + /** + * Deletes the default DB working directory with all sub-directories and files. + * + * @return {@code true} if and only if the file or directory is successfully deleted, otherwise {@code false}. + * @throws IgniteCheckedException In case of an error. + * @see #getDefaultDbWorkPath() + * @see #deleteDefaultDBWorkDirectory() + */ + protected boolean deleteDefaultDBWorkDirectory() throws IgniteCheckedException { + Path dir = getDefaultDbWorkPath(); + + return Files.notExists(dir) || U.delete(dir.toFile()); + } + + /** + * Checks if the default DB working directory is empty. + * + * @return {@code true} if the default DB working directory is empty or doesn't exist, otherwise {@code false}. + * @throws IgniteCheckedException In case of an error. + * @see #getDefaultDbWorkPath() + * @see #deleteDefaultDBWorkDirectory() + */ + @SuppressWarnings("ConstantConditions") + protected boolean isDefaultDBWorkDirectoryEmpty() throws IgniteCheckedException { + File dir = getDefaultDbWorkPath().toFile(); + + return !dir.exists() || (dir.isDirectory() && dir.list().length == 0); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/package-info.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/package-info.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/package-info.java new file mode 100644 index 0000000..027919f --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/package-info.java @@ -0,0 +1,22 @@ +/* + * 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 description. --> + * Contains compatibility test framework related classes and interfaces. + */ +package org.apache.ignite.compatibility.persistence; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/CompatibilityTestsFacade.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/CompatibilityTestsFacade.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/CompatibilityTestsFacade.java new file mode 100644 index 0000000..6049314 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/CompatibilityTestsFacade.java @@ -0,0 +1,46 @@ +/* + * 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.ignite.compatibility.testframework.junits; + +import org.apache.ignite.configuration.IgniteConfiguration; + +/** + * Provides useful methods for compatibility tests. + */ +public class CompatibilityTestsFacade { + /** */ + private static final TestsMethodsFacade DELEGATE = new TestsMethodsFacade(); + + /** + * Gets default tests configuration. + * + * @return Default tests Ignite configuration. + * @throws Exception In case of an error. + */ + public static IgniteConfiguration getConfiguration() throws Exception { + return DELEGATE.getConfiguration(); + } + + /** */ + private static class TestsMethodsFacade extends IgniteCompatibilityAbstractTest { + /** {@inheritDoc} */ + @Override public IgniteConfiguration getConfiguration() throws Exception { + return super.getConfiguration(); + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java new file mode 100644 index 0000000..728227a --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java @@ -0,0 +1,280 @@ +/* + * 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.ignite.compatibility.testframework.junits; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.UUID; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteLogger; +import org.apache.ignite.compatibility.testframework.junits.logger.ListenedGridTestLog4jLogger; +import org.apache.ignite.compatibility.testframework.util.MavenUtils; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.processors.resource.GridSpringResourceContext; +import org.apache.ignite.internal.util.lang.GridAbsPredicate; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.lang.IgniteInClosure; +import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.apache.ignite.testframework.junits.multijvm.IgniteProcessProxy; +import org.jetbrains.annotations.Nullable; + +/** + * Super class for all compatibility tests. + */ +public abstract class IgniteCompatibilityAbstractTest extends GridCommonAbstractTest { + /** Using for synchronization of nodes startup in case of starting remote nodes first. */ + public static final String SYNCHRONIZATION_LOG_MESSAGE_PREPARED = "[Compatibility] Node has been started, id="; + + /** Waiting milliseconds of the join of a node to topology. */ + protected static final int NODE_JOIN_TIMEOUT = 30_000; + + /** Local JVM Ignite node. */ + protected Ignite locJvmInstance = null; + + /** Remote JVM Ignite instance. */ + protected Ignite rmJvmInstance = null; + + /** {@inheritDoc} */ + @Override protected boolean isMultiJvm() { + return true; + } + + /** + * Starts new Ignite instance of given version and index <b>in separate JVM</b>. + * + * Uses an ignite-core artifact in the Maven local repository, if it isn't exists there, it will be downloaded and + * stored via Maven. + * + * @param idx Index of the grid to start. + * @param ver Ignite version. + * @param cfgClo IgniteInClosure for post-configuration. + * @return Started grid. + * @throws Exception If failed. + */ + protected IgniteEx startGrid(int idx, String ver, IgniteInClosure<IgniteConfiguration> cfgClo) throws Exception { + return startGrid(getTestIgniteInstanceName(idx), ver, cfgClo, null); + } + + /** + * Starts new Ignite instance of given version and name <b>in separate JVM</b>. + * + * Uses an ignite-core artifact in the Maven local repository, if it isn't exists there, it will be downloaded and + * stored via Maven. + * + * @param igniteInstanceName Instance name. + * @param ver Ignite version. + * @param cfgClo IgniteInClosure for post-configuration. + * @return Started grid. + * @throws Exception If failed. + */ + protected IgniteEx startGrid(String igniteInstanceName, String ver, + IgniteInClosure<IgniteConfiguration> cfgClo) throws Exception { + return startGrid(igniteInstanceName, ver, cfgClo, null); + } + + /** + * Starts new Ignite instance of given version and index <b>in separate JVM</b>. + * + * Uses an ignite-core artifact in the Maven local repository, if it isn't exists there, it will be downloaded and + * stored via Maven. + * + * @param idx Index of the grid to start. + * @param ver Ignite version. + * @param cfgClo IgniteInClosure for post-configuration. + * @param clo IgniteInClosure for actions on started Ignite. + * @return Started grid. + * @throws Exception In case of an error. + */ + protected IgniteEx startGrid(int idx, final String ver, + IgniteInClosure<IgniteConfiguration> cfgClo, IgniteInClosure<Ignite> clo) throws Exception { + return startGrid(getTestIgniteInstanceName(idx), ver, cfgClo, clo); + } + + /** + * Starts new Ignite instance of given version and name <b>in separate JVM</b>. + * + * Uses an ignite-core artifact in the Maven local repository, if it isn't exists there, it will be downloaded and + * stored via Maven. + * + * @param igniteInstanceName Instance name. + * @param ver Ignite version. + * @param cfgClo IgniteInClosure for post-configuration. + * @param clo IgniteInClosure for actions on started Ignite. + * @return Started grid. + * @throws Exception In case of an error. + */ + protected IgniteEx startGrid(final String igniteInstanceName, final String ver, + IgniteInClosure<IgniteConfiguration> cfgClo, IgniteInClosure<Ignite> clo) throws Exception { + assert isMultiJvm() : "MultiJvm mode must be switched on for the node stop properly."; + + assert !igniteInstanceName.equals(getTestIgniteInstanceName(0)) : "Use default instance name for local nodes only."; + + final String cfgCloPath = IgniteCompatibilityNodeRunner.storeToFile(cfgClo); + final String cloPath = IgniteCompatibilityNodeRunner.storeToFile(clo); + + final IgniteConfiguration cfg = getConfiguration(igniteInstanceName); // stub - won't be used at node startup + + IgniteProcessProxy ignite = new IgniteProcessProxy(cfg, log, locJvmInstance, true) { + @Override protected IgniteLogger logger(IgniteLogger log, Object ctgr) { + return ListenedGridTestLog4jLogger.createLogger(ctgr); + } + + @Override protected String igniteNodeRunnerClassName() throws Exception { + return IgniteCompatibilityNodeRunner.class.getCanonicalName(); + } + + @Override protected String params(IgniteConfiguration cfg, boolean resetDiscovery) throws Exception { + return cfgCloPath + " " + igniteInstanceName + " " + + getId() + " " + + (rmJvmInstance == null ? getId() : ((IgniteProcessProxy)rmJvmInstance).getId()) + + (cloPath == null ? "" : " " + cloPath); + } + + @Override protected Collection<String> filteredJvmArgs() throws Exception { + Collection<String> filteredJvmArgs = new ArrayList<>(); + + filteredJvmArgs.add("-ea"); + + for (String arg : U.jvmArgs()) { + if (arg.startsWith("-Xmx") || arg.startsWith("-Xms")) + filteredJvmArgs.add(arg); + } + + String classPath = System.getProperty("java.class.path"); + + String[] paths = classPath.split(File.pathSeparator); + + StringBuilder pathBuilder = new StringBuilder(); + + String corePathTemplate = "ignite.modules.core.target.classes".replace(".", File.separator); + String coreTestsPathTemplate = "ignite.modules.core.target.test-classes".replace(".", File.separator); + + for (String path : paths) { + if (!path.contains(corePathTemplate) && !path.contains(coreTestsPathTemplate)) + pathBuilder.append(path).append(File.pathSeparator); + } + + String pathToArtifact = MavenUtils.getPathToIgniteCoreArtifact(ver); + + pathBuilder.append(pathToArtifact).append(File.pathSeparator); + + String pathToTestsArtifact = MavenUtils.getPathToIgniteCoreArtifact(ver, "tests"); + + pathBuilder.append(pathToTestsArtifact).append(File.pathSeparator); + + filteredJvmArgs.add("-cp"); + filteredJvmArgs.add(pathBuilder.toString()); + + return filteredJvmArgs; + } + }; + + if (locJvmInstance == null) { + CountDownLatch nodeJoinedLatch = new CountDownLatch(1); + + UUID nodeId = ignite.getId(); + + ListenedGridTestLog4jLogger log = (ListenedGridTestLog4jLogger)ignite.log(); + + log.addListener(nodeId, new LoggedJoinNodeClosure(nodeJoinedLatch, nodeId)); + + assert nodeJoinedLatch.await(NODE_JOIN_TIMEOUT, TimeUnit.MILLISECONDS) : "Node has not joined [id=" + nodeId + "]"; + + log.removeListener(nodeId); + } + + if (rmJvmInstance == null) + rmJvmInstance = ignite; + + return ignite; + } + + /** {@inheritDoc} */ + @Override protected Ignite startGrid(String igniteInstanceName, IgniteConfiguration cfg, + GridSpringResourceContext ctx) throws Exception { + final Ignite ignite; + + // if started node isn't first node in the local JVM then it was checked earlier for join to topology + // in IgniteProcessProxy constructor. + if (locJvmInstance == null && rmJvmInstance != null) { + final UUID nodeId = cfg.getNodeId(); + final UUID syncNodeId = ((IgniteProcessProxy)rmJvmInstance).getId(); + + ignite = super.startGrid(igniteInstanceName, cfg, ctx); + + assert ignite.configuration().getNodeId() == nodeId : "Started node has unexpected node id."; + + assert ignite.cluster().node(syncNodeId) != null : "Node has not joined [id=" + nodeId + "]"; + } + else + ignite = super.startGrid(igniteInstanceName, cfg, ctx); + + if (locJvmInstance == null && !isRemoteJvm(igniteInstanceName)) + locJvmInstance = ignite; + + return ignite; + } + + /** {@inheritDoc} */ + @Override protected void stopGrid(@Nullable String igniteInstanceName, boolean cancel, boolean awaitTop) { + if (isRemoteJvm(igniteInstanceName)) + throw new UnsupportedOperationException("Operation isn't supported yet for remotes nodes, use stopAllGrids() instead."); + else { + super.stopGrid(igniteInstanceName, cancel, awaitTop); + + locJvmInstance = null; + } + } + + /** {@inheritDoc} */ + @Override protected void stopAllGrids(boolean cancel) { + locJvmInstance = null; + rmJvmInstance = null; + + super.stopAllGrids(cancel); + } + + /** */ + protected static class LoggedJoinNodeClosure implements IgniteInClosure<String> { + /** Node joined latch. */ + private CountDownLatch nodeJoinedLatch; + + /** Pattern for comparing. */ + private String pattern; + + /** + * @param nodeJoinedLatch Nodes startup synchronization latch. + * @param nodeId Expected node id. + */ + LoggedJoinNodeClosure(CountDownLatch nodeJoinedLatch, UUID nodeId) { + this.nodeJoinedLatch = nodeJoinedLatch; + this.pattern = SYNCHRONIZATION_LOG_MESSAGE_PREPARED + nodeId; + } + + /** {@inheritDoc} */ + @Override public void apply(String s) { + if (nodeJoinedLatch.getCount() > 0 && s.contains(pattern)) + nodeJoinedLatch.countDown(); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java new file mode 100644 index 0000000..3256d06 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java @@ -0,0 +1,157 @@ +/* + * 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.ignite.compatibility.testframework.junits; + +import com.thoughtworks.xstream.XStream; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.UUID; +import org.apache.ignite.Ignite; +import org.apache.ignite.Ignition; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.util.GridJavaProcess; +import org.apache.ignite.internal.util.typedef.X; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.lang.IgniteInClosure; +import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.multijvm.IgniteNodeRunner; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Runs Ignite node. + */ +public class IgniteCompatibilityNodeRunner extends IgniteNodeRunner { + /** */ + private static final String IGNITE_COMPATIBILITY_CLOSURE_FILE = System.getProperty("java.io.tmpdir") + + File.separator + "igniteCompatibilityClosure.tmp_"; + + /** + * Starts {@link Ignite} with test's default configuration. + * + * Command-line arguments specification: + * <pre> + * args[0] - required - path to closure for tuning IgniteConfiguration before node startup; + * args[1] - required - name of the starting node; + * args[2] - required - id of the starting node; + * args[3] - required - sync-id of a node for synchronization of startup. Must be equals + * to arg[2] in case of starting the first node in the Ignite cluster; + * args[4] - optional - path to closure for actions after node startup. + * </pre> + * + * @param args Command-line arguments. + * @throws Exception In case of an error. + */ + public static void main(String[] args) throws Exception { + X.println(GridJavaProcess.PID_MSG_PREFIX + U.jvmPid()); + + X.println("Starting Ignite Node... Args=" + Arrays.toString(args)); + + if (args.length < 3) { + throw new IllegalArgumentException("At least four arguments expected:" + + " [path/to/closure/file] [ignite-instance-name] [node-id] [sync-node-id] [optional/path/to/closure/file]"); + } + + IgniteConfiguration cfg = CompatibilityTestsFacade.getConfiguration(); + + IgniteInClosure<IgniteConfiguration> cfgClo = readClosureFromFileAndDelete(args[0]); + + cfgClo.apply(cfg); + + final UUID nodeId = UUID.fromString(args[2]); + final UUID syncNodeId = UUID.fromString(args[3]); + + // Ignite instance name and id must be set according to arguments + // it's used for nodes managing: start, stop etc. + cfg.setIgniteInstanceName(args[1]); + cfg.setNodeId(nodeId); + + final Ignite ignite = Ignition.start(cfg); + + assert ignite.cluster().node(syncNodeId) != null : "Node has not joined [id=" + nodeId + "]"; + + // It needs to set private static field 'ignite' of the IgniteNodeRunner class via reflection + GridTestUtils.setFieldValue(new IgniteNodeRunner(), "ignite", ignite); + + if (args.length == 5) { + IgniteInClosure<Ignite> clo = readClosureFromFileAndDelete(args[4]); + + clo.apply(ignite); + } + + X.println(IgniteCompatibilityAbstractTest.SYNCHRONIZATION_LOG_MESSAGE_PREPARED + nodeId); + } + + /** + * Stores {@link IgniteInClosure} to file as xml. + * + * @param clo IgniteInClosure. + * @return A name of file where the closure was stored. + * @throws IOException In case of an error. + * @see #readClosureFromFileAndDelete(String) + */ + @Nullable public static String storeToFile(@Nullable IgniteInClosure clo) throws IOException { + if (clo == null) + return null; + + String fileName = IGNITE_COMPATIBILITY_CLOSURE_FILE + clo.hashCode(); + + storeToFile(clo, fileName); + + return fileName; + } + + /** + * Stores {@link IgniteInClosure} to file as xml. + * + * @param clo IgniteInClosure. + * @param fileName A name of file where the closure was stored. + * @throws IOException In case of an error. + * @see #readClosureFromFileAndDelete(String) + */ + public static void storeToFile(@NotNull IgniteInClosure clo, @NotNull String fileName) throws IOException { + try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(fileName), StandardCharsets.UTF_8)) { + new XStream().toXML(clo, writer); + } + } + + /** + * Reads closure from given file name and delete the file after. + * + * @param fileName Closure file name. + * @param <T> Type of closure argument. + * @return IgniteInClosure for post-configuration. + * @throws IOException In case of an error. + * @see #storeToFile(IgniteInClosure, String) + */ + @SuppressWarnings("unchecked") + public static <T> IgniteInClosure<T> readClosureFromFileAndDelete(String fileName) throws IOException { + try (BufferedReader reader = Files.newBufferedReader(Paths.get(fileName), StandardCharsets.UTF_8)) { + return (IgniteInClosure<T>)new XStream().fromXML(reader); + } + finally { + U.delete(new File(fileName)); + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/ListenedGridTestLog4jLogger.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/ListenedGridTestLog4jLogger.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/ListenedGridTestLog4jLogger.java new file mode 100644 index 0000000..f95e174 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/ListenedGridTestLog4jLogger.java @@ -0,0 +1,91 @@ +/* + * 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.ignite.compatibility.testframework.junits.logger; + +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import org.apache.ignite.lang.IgniteInClosure; +import org.apache.ignite.testframework.junits.logger.GridTestLog4jLogger; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Listened version of {@link GridTestLog4jLogger} logger. Provides methods of registering and notifying listeners. + */ +public class ListenedGridTestLog4jLogger extends GridTestLog4jLogger { + /** Listeners. */ + private final ConcurrentMap<UUID, IgniteInClosure<String>> lsnrs = new ConcurrentHashMap<>(); + + /** {@inheritDoc} */ + public ListenedGridTestLog4jLogger(Logger impl) { + super(impl); + } + + /** + * Creates new logger instance with given category. + * + * @param ctgr Category. + * @return Initiated logger. + */ + public static GridTestLog4jLogger createLogger(Object ctgr) { + return new ListenedGridTestLog4jLogger(ctgr == null ? Logger.getRootLogger() : + ctgr instanceof Class ? Logger.getLogger(((Class<?>)ctgr).getName()) : + Logger.getLogger(ctgr.toString())); + } + + /** {@inheritDoc} */ + @Override public void info(String msg) { + notifyListeners(msg); + + super.info(msg); + } + + /** + * Notifies registered listeners. + * + * @param msg Message. + */ + protected void notifyListeners(String msg) { + for (IgniteInClosure<String> lsnr : lsnrs.values()) + lsnr.apply(msg); + } + + /** + * Adds listener. + * + * @param key Key. + * @param lsnr Listener. + * @return The previous value associated with the specified key, or {@code null} if there was no mapping for the key. + */ + @Nullable public IgniteInClosure<String> addListener(@NotNull UUID key, @NotNull IgniteInClosure<String> lsnr) { + return lsnrs.putIfAbsent(key, lsnr); + } + + /** + * Removes listeners. + * + * @param key Key. + * @return Returns the value to which this map previously associated the key, or {@code null} if the map contained no + * mapping for the key. + */ + @Nullable public IgniteInClosure<String> removeListener(@NotNull UUID key) { + return lsnrs.remove(key); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/package-info.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/package-info.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/package-info.java new file mode 100644 index 0000000..64892d8 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/package-info.java @@ -0,0 +1,22 @@ +/* + * 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 description. --> + * Contains compatibility test framework related classes and interfaces. + */ +package org.apache.ignite.compatibility.testframework.junits.logger; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/package-info.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/package-info.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/package-info.java new file mode 100644 index 0000000..996729f --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/package-info.java @@ -0,0 +1,22 @@ +/* + * 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 description. --> + * Contains compatibility test framework related classes and interfaces. + */ +package org.apache.ignite.compatibility.testframework.junits; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/package-info.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/package-info.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/package-info.java new file mode 100644 index 0000000..81ec1b6 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/package-info.java @@ -0,0 +1,22 @@ +/* + * 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 description. --> + * Contains compatibility test framework related classes and interfaces. + */ +package org.apache.ignite.compatibility.testframework; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/DisabledValidationProcessor.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/DisabledValidationProcessor.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/DisabledValidationProcessor.java new file mode 100644 index 0000000..8c88f4f --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/DisabledValidationProcessor.java @@ -0,0 +1,42 @@ +/* + * 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.ignite.compatibility.testframework.plugins; + +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.internal.GridKernalContext; +import org.apache.ignite.internal.processors.GridProcessorAdapter; +import org.apache.ignite.internal.processors.nodevalidation.DiscoveryNodeValidationProcessor; +import org.apache.ignite.spi.IgniteNodeValidationResult; +import org.jetbrains.annotations.Nullable; + +/** + * Disabled node validation. + */ +public class DisabledValidationProcessor extends GridProcessorAdapter implements DiscoveryNodeValidationProcessor { + /** + * @param ctx Kernal context. + */ + public DisabledValidationProcessor(GridKernalContext ctx) { + super(ctx); + } + + /** {@inheritDoc} */ + @Nullable @Override public IgniteNodeValidationResult validateNode(ClusterNode node) { + return null; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/TestCompatibilityPluginProvider.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/TestCompatibilityPluginProvider.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/TestCompatibilityPluginProvider.java new file mode 100644 index 0000000..3a42811 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/TestCompatibilityPluginProvider.java @@ -0,0 +1,119 @@ +/* + * 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.ignite.compatibility.testframework.plugins; + +import java.io.Serializable; +import java.util.UUID; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.internal.GridKernalContext; +import org.apache.ignite.internal.IgniteKernal; +import org.apache.ignite.internal.IgniteNodeAttributes; +import org.apache.ignite.internal.processors.nodevalidation.DiscoveryNodeValidationProcessor; +import org.apache.ignite.plugin.CachePluginContext; +import org.apache.ignite.plugin.CachePluginProvider; +import org.apache.ignite.plugin.ExtensionRegistry; +import org.apache.ignite.plugin.IgnitePlugin; +import org.apache.ignite.plugin.PluginContext; +import org.apache.ignite.plugin.PluginProvider; +import org.apache.ignite.plugin.PluginValidationException; +import org.jetbrains.annotations.Nullable; + +/** + * Creates {@link DisabledValidationProcessor} to allow for nodes with different + * versions {@link IgniteNodeAttributes#ATTR_BUILD_VER} join to topology. + */ +public class TestCompatibilityPluginProvider implements PluginProvider { + /** */ + private GridKernalContext kCtx; + + /** {@inheritDoc} */ + @Override public String name() { + return "TestCompatibilityPlugin"; + } + + /** {@inheritDoc} */ + @Override public String version() { + return "1.0"; + } + + /** {@inheritDoc} */ + @Override public String copyright() { + return ""; + } + + /** {@inheritDoc} */ + @Override public void initExtensions(PluginContext ctx, ExtensionRegistry registry) throws IgniteCheckedException { + kCtx = ((IgniteKernal)ctx.grid()).context(); + } + + /** {@inheritDoc} */ + @Override public CachePluginProvider createCacheProvider(CachePluginContext ctx) { + return null; + } + + /** {@inheritDoc} */ + @Override public void start(PluginContext ctx) throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void stop(boolean cancel) throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void onIgniteStart() throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void onIgniteStop(boolean cancel) { + // No-op. + } + + /** {@inheritDoc} */ + @Nullable @Override public Serializable provideDiscoveryData(UUID nodeId) { + return null; + } + + /** {@inheritDoc} */ + @Override public void receiveDiscoveryData(UUID nodeId, Serializable data) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void validateNewNode(ClusterNode node) throws PluginValidationException { + // No-op. + } + + /** {@inheritDoc} */ + @Nullable @Override public Object createComponent(PluginContext ctx, Class cls) { + if (DiscoveryNodeValidationProcessor.class == cls) + return new DisabledValidationProcessor(kCtx); + + return null; + } + + /** {@inheritDoc} */ + @Override public IgnitePlugin plugin() { + return new IgnitePlugin() { + // No-op. + }; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/package-info.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/package-info.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/package-info.java new file mode 100644 index 0000000..05ba5c2 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/plugins/package-info.java @@ -0,0 +1,22 @@ +/* + * 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 description. --> + * Contains compatibility test framework related classes and interfaces. + */ +package org.apache.ignite.compatibility.testframework.plugins; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/MavenUtils.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/MavenUtils.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/MavenUtils.java new file mode 100644 index 0000000..fe73e48 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/MavenUtils.java @@ -0,0 +1,208 @@ +/* + * 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.ignite.compatibility.testframework.util; + +import com.google.common.base.Charsets; +import com.google.common.io.CharStreams; +import java.io.File; +import java.io.InputStreamReader; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.concurrent.Callable; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import org.apache.ignite.internal.util.typedef.X; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Provides some useful methods to work with Maven. + */ +public class MavenUtils { + /** Path to Maven local repository. For caching. */ + private static String locRepPath = null; + + /** + * Gets a path to an artifact with given version and groupId=org.apache.ignite and artifactId=ignite-core. + * + * At first, artifact is looked for in the Maven local repository, if it isn't exists there, it will be downloaded + * and stored via Maven. + * + * @param ver Version of ignite-core artifact. + * @return Path to the artifact. + * @throws Exception In case of an error. + * @see #getPathToArtifact(String) + */ + public static String getPathToIgniteCoreArtifact(@NotNull String ver) throws Exception { + return getPathToIgniteCoreArtifact(ver, null); + } + + /** + * Gets a path to an artifact with given version and groupId=org.apache.ignite and artifactId=ignite-core. + * + * At first, artifact is looked for in the Maven local repository, if it isn't exists there, it will be downloaded + * and stored via Maven. + * + * @param ver Version of ignite-core artifact. + * @param classifier Artifact classifier. + * @return Path to the artifact. + * @throws Exception In case of an error. + * @see #getPathToArtifact(String) + */ + public static String getPathToIgniteCoreArtifact(@NotNull String ver, + @Nullable String classifier) throws Exception { + String artifact = "org.apache.ignite:ignite-core:" + ver; + + if (classifier != null) + artifact += ":jar:" + classifier; + + return getPathToArtifact(artifact); + } + + /** + * Gets a path to an artifact with given identifier. + * + * At first, artifact is looked for in the Maven local repository, if it isn't exists there, it will be downloaded + * and stored via Maven. + * + * @param artifact Artifact identifier, must match pattern [groupId:artifactId:version[:packaging[:classifier]]]. + * @return Path to the artifact. + * @throws Exception In case of an error. + */ + public static String getPathToArtifact(@NotNull String artifact) throws Exception { + String[] names = artifact.split(":"); + + assert names.length >= 3; + + String groupId = names[0]; + String artifactId = names[1]; + String version = names[2]; + String packaging = names.length > 3 ? names[3] : null; + String classifier = names.length > 4 ? names[4] : null; + + String jarFileName = String.format("%s-%s%s.%s", + artifactId, + version, + (classifier == null ? "" : "-" + classifier), + (packaging == null ? "jar" : packaging) + ); + + String pathToArtifact = getMavenLocalRepositoryPath() + File.separator + + groupId.replace(".", File.separator) + File.separator + + artifactId.replace(".", File.separator) + File.separator + + version + File.separator + jarFileName; + + if (Files.notExists(Paths.get(pathToArtifact))) + downloadArtifact(artifact); + + return pathToArtifact; + } + + /** + * Gets a path to the Maven local repository. + * + * @return Path to the Maven local repository. + * @throws Exception In case of an error. + */ + public static String getMavenLocalRepositoryPath() throws Exception { + if (locRepPath == null) + locRepPath = defineMavenLocalRepositoryPath(); + + return locRepPath; + } + + /** + * Defines a path to the Maven local repository. + * + * @return Path to the Maven local repository. + * @throws Exception In case of an error. + */ + private static String defineMavenLocalRepositoryPath() throws Exception { + String output = exec("mvn help:effective-settings"); + + int endTagPos = output.indexOf("</localRepository>"); + + assert endTagPos >= 0 : "Couldn't define path to Maven local repository"; + + return output.substring(output.lastIndexOf(">", endTagPos) + 1, endTagPos); + } + + /** + * Downloads and stores in local repository an artifact with given identifier. + * + * @param artifact Artifact identifier, must match pattern [groupId:artifactId:version]. + * @throws Exception In case of an error. + */ + private static void downloadArtifact(String artifact) throws Exception { + X.println("Downloading artifact... Identifier: " + artifact); + + exec("mvn dependency:get -Dartifact=" + artifact); + + X.println("Download is finished"); + } + + /** + * Executes given command in operation system. + * + * @param cmd Command to execute. + * @return Output of result of executed command. + * @throws Exception In case of an error. + */ + private static String exec(String cmd) throws Exception { + ProcessBuilder pb = new ProcessBuilder(); + pb.redirectErrorStream(true); + + pb.command(U.isWindows() ? + new String[] {"cmd", "/c", cmd} : + new String[] {"/bin/bash", "-c", cmd}); + + final Process p = pb.start(); + + Future<String> fut = Executors.newSingleThreadExecutor().submit(new Callable<String>() { + @Override public String call() throws Exception { + String output = CharStreams.toString(new InputStreamReader(p.getInputStream(), Charsets.UTF_8)); + + p.waitFor(); + + return output; + } + }); + + String output = null; + + try { + output = fut.get(5, TimeUnit.MINUTES); + + int exitVal = p.exitValue(); + + if (exitVal != 0) + throw new Exception(String.format("Abnormal exit value of %s for pid %s", exitVal, U.jvmPid())); + + return output; + } + catch (Exception e) { + p.destroy(); + + X.printerrln("Command='" + cmd + "' couldn't be executed: " + output, Charsets.UTF_8, e); + + throw e; + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/package-info.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/package-info.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/package-info.java new file mode 100644 index 0000000..d3bee94 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/package-info.java @@ -0,0 +1,22 @@ +/* + * 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 description. --> + * Contains compatibility test framework related classes and interfaces. + */ +package org.apache.ignite.compatibility.testframework.util; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testsuites/IgniteCompatibilityBasicTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testsuites/IgniteCompatibilityBasicTestSuite.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testsuites/IgniteCompatibilityBasicTestSuite.java new file mode 100644 index 0000000..b54b396 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testsuites/IgniteCompatibilityBasicTestSuite.java @@ -0,0 +1,38 @@ +/* + * 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.ignite.compatibility.testsuites; + +import junit.framework.TestSuite; +import org.apache.ignite.compatibility.persistence.DummyPersistenceCompatibilityTest; + +/** + * Compatibility tests basic test suite. + */ +public class IgniteCompatibilityBasicTestSuite { + /** + * @return Test suite. + * @throws Exception In case of an error. + */ + public static TestSuite suite() throws Exception { + TestSuite suite = new TestSuite("Ignite Compatibility Basic Test Suite"); + + suite.addTestSuite(DummyPersistenceCompatibilityTest.class); + + return suite; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testsuites/package-info.java ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testsuites/package-info.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testsuites/package-info.java new file mode 100644 index 0000000..5c4efc9 --- /dev/null +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testsuites/package-info.java @@ -0,0 +1,22 @@ +/* + * 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 description. --> + * Contains test-suites which contains compatibility tests. + */ +package org.apache.ignite.compatibility.testsuites; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/compatibility/src/test/resources/META-INF/services/org.apache.ignite.plugin.PluginProvider ---------------------------------------------------------------------- diff --git a/modules/compatibility/src/test/resources/META-INF/services/org.apache.ignite.plugin.PluginProvider b/modules/compatibility/src/test/resources/META-INF/services/org.apache.ignite.plugin.PluginProvider new file mode 100644 index 0000000..d1a8786 --- /dev/null +++ b/modules/compatibility/src/test/resources/META-INF/services/org.apache.ignite.plugin.PluginProvider @@ -0,0 +1 @@ +org.apache.ignite.compatibility.testframework.plugins.TestCompatibilityPluginProvider http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/core/src/test/java/META-INF/services/org.apache.ignite.plugin.PluginProvider ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/META-INF/services/org.apache.ignite.plugin.PluginProvider b/modules/core/src/test/java/META-INF/services/org.apache.ignite.plugin.PluginProvider index 8437ef0..959d444 100644 --- a/modules/core/src/test/java/META-INF/services/org.apache.ignite.plugin.PluginProvider +++ b/modules/core/src/test/java/META-INF/services/org.apache.ignite.plugin.PluginProvider @@ -1,2 +1,2 @@ org.apache.ignite.spi.discovery.tcp.TestReconnectPluginProvider -org.apache.ignite.internal.processors.cache.persistence.standbycluster.IgniteStandByClusterTest$StanByClusterTestProvider +org.apache.ignite.internal.processors.cache.persistence.standbycluster.IgniteStandByClusterTest$StanByClusterTestProvider \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c6571448/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java index 7d73737..d7be576 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java @@ -56,7 +56,7 @@ public class IgniteNodeRunner { File.separator + "igniteConfiguration.tmp_"; /** */ - private static volatile Ignite ignite; + protected static volatile Ignite ignite; /** * Starts {@link Ignite} instance accorging to given arguments.
