http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopUserLibsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopUserLibsSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopUserLibsSelfTest.java index 0e4a0ef..cf4ef5e 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopUserLibsSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopUserLibsSelfTest.java @@ -25,10 +25,14 @@ import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for user libs parsing. */ +@RunWith(JUnit4.class) public class HadoopUserLibsSelfTest extends GridCommonAbstractTest { /** Directory 1. */ private static final File DIR_1 = HadoopTestUtils.testDir("dir1"); @@ -89,6 +93,7 @@ public class HadoopUserLibsSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testNullOrEmptyUserLibs() throws Exception { assert parse(null).isEmpty(); assert parse("").isEmpty(); @@ -99,6 +104,7 @@ public class HadoopUserLibsSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testSingle() throws Exception { Collection<File> res = parse(single(FILE_1_1)); @@ -115,6 +121,7 @@ public class HadoopUserLibsSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testMultiple() throws Exception { Collection<File> res = parse(merge(single(FILE_1_1), single(FILE_1_2), single(FILE_2_1), single(FILE_2_2), single(MISSING_FILE))); @@ -131,6 +138,7 @@ public class HadoopUserLibsSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testSingleWildcard() throws Exception { Collection<File> res = parse(wildcard(DIR_1)); @@ -148,6 +156,7 @@ public class HadoopUserLibsSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testMultipleWildcards() throws Exception { Collection<File> res = parse(merge(wildcard(DIR_1), wildcard(DIR_2), wildcard(MISSING_DIR))); @@ -163,6 +172,7 @@ public class HadoopUserLibsSelfTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testMixed() throws Exception { String str = merge( single(FILE_1_1),
http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java index 041f0bc..5eefdf9 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java @@ -40,12 +40,16 @@ import org.apache.ignite.internal.processors.hadoop.HadoopTaskType; import org.apache.ignite.internal.processors.hadoop.HadoopHelperImpl; import org.apache.ignite.internal.processors.hadoop.impl.v2.HadoopSerializationWrapper; import org.apache.ignite.internal.processors.hadoop.impl.v2.HadoopV2Job; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.internal.processors.hadoop.impl.HadoopUtils.createJobInfo; /** * Self test of {@link org.apache.ignite.internal.processors.hadoop.impl.v2.HadoopV2Job}. */ +@RunWith(JUnit4.class) public class HadoopV2JobSelfTest extends HadoopAbstractSelfTest { /** */ private static final String TEST_SERIALIZED_VALUE = "Test serialized value"; @@ -73,6 +77,7 @@ public class HadoopV2JobSelfTest extends HadoopAbstractSelfTest { * * @throws IgniteCheckedException If fails. */ + @Test public void testCustomSerializationApplying() throws IgniteCheckedException { JobConf cfg = new JobConf(); @@ -105,4 +110,4 @@ public class HadoopV2JobSelfTest extends HadoopAbstractSelfTest { assertEquals(TEST_SERIALIZED_VALUE, ser.read(in, null).toString()); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopValidationSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopValidationSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopValidationSelfTest.java index ef16762..58f7f5e 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopValidationSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopValidationSelfTest.java @@ -18,10 +18,14 @@ package org.apache.ignite.internal.processors.hadoop.impl; import org.apache.ignite.configuration.IgniteConfiguration; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Configuration validation tests. */ +@RunWith(JUnit4.class) public class HadoopValidationSelfTest extends HadoopAbstractSelfTest { /** Peer class loading enabled flag. */ public boolean peerClassLoading; @@ -47,7 +51,8 @@ public class HadoopValidationSelfTest extends HadoopAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testValid() throws Exception { startGrids(1); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java index 6dcd998..c55940a 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java @@ -45,10 +45,14 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; import java.util.UUID; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for weighted map-reduce planned. */ +@RunWith(JUnit4.class) public class HadoopWeightedMapReducePlannerTest extends GridCommonAbstractTest { /** ID 1. */ private static final UUID ID_1 = new UUID(0, 1); @@ -111,6 +115,7 @@ public class HadoopWeightedMapReducePlannerTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testOneIgfsSplitAffinity() throws Exception { IgfsMock igfs = LocationsBuilder.create().add(0, NODE_1).add(50, NODE_2).add(100, NODE_3).buildIgfs(); @@ -139,6 +144,7 @@ public class HadoopWeightedMapReducePlannerTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testHdfsSplitsAffinity() throws Exception { IgfsMock igfs = LocationsBuilder.create().add(0, NODE_1).add(50, NODE_2).add(100, NODE_3).buildIgfs(); @@ -171,6 +177,7 @@ public class HadoopWeightedMapReducePlannerTest extends GridCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testHdfsSplitsReplication() throws Exception { IgfsMock igfs = LocationsBuilder.create().add(0, NODE_1).add(50, NODE_2).add(100, NODE_3).buildIgfs(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java index 77d5e8a..dfebd3f 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolMultipleServersSelfTest.java @@ -50,10 +50,14 @@ import org.apache.ignite.internal.processors.hadoop.impl.HadoopUtils; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Hadoop client protocol configured with multiple ignite servers tests. */ +@RunWith(JUnit4.class) public class HadoopClientProtocolMultipleServersSelfTest extends HadoopAbstractSelfTest { /** Input path. */ private static final String PATH_INPUT = "/input"; @@ -146,6 +150,7 @@ public class HadoopClientProtocolMultipleServersSelfTest extends HadoopAbstractS /** * @throws Exception If failed. */ + @Test public void testMultipleAddresses() throws Exception { restPort = REST_PORT; @@ -161,6 +166,7 @@ public class HadoopClientProtocolMultipleServersSelfTest extends HadoopAbstractS /** * @throws Exception If failed. */ + @Test public void testSingleAddress() throws Exception { try { // Don't use REST_PORT to test connection fails if the only this port is configured @@ -186,6 +192,7 @@ public class HadoopClientProtocolMultipleServersSelfTest extends HadoopAbstractS /** * @throws Exception If failed. */ + @Test public void testMixedAddrs() throws Exception { restPort = REST_PORT; @@ -308,4 +315,4 @@ public class HadoopClientProtocolMultipleServersSelfTest extends HadoopAbstractS return null; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java index 83269e3..59b3ee9 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java @@ -56,11 +56,15 @@ import org.apache.ignite.internal.util.lang.GridAbsPredicate; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Hadoop client protocol tests in external process mode. */ @SuppressWarnings("ResultOfMethodCallIgnored") +@RunWith(JUnit4.class) public class HadoopClientProtocolSelfTest extends HadoopAbstractSelfTest { /** Input path. */ private static final String PATH_INPUT = "/input"; @@ -159,6 +163,7 @@ public class HadoopClientProtocolSelfTest extends HadoopAbstractSelfTest { * * @throws Exception If failed. */ + @Test public void testJobCounters() throws Exception { IgniteFileSystem igfs = grid(0).fileSystem(HadoopAbstractSelfTest.igfsName); @@ -661,4 +666,4 @@ public class HadoopClientProtocolSelfTest extends HadoopAbstractSelfTest { ctx.write(key, totalWordCnt); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/fs/KerberosHadoopFileSystemFactorySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/fs/KerberosHadoopFileSystemFactorySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/fs/KerberosHadoopFileSystemFactorySelfTest.java index 6554d8e..ebcd49b 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/fs/KerberosHadoopFileSystemFactorySelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/fs/KerberosHadoopFileSystemFactorySelfTest.java @@ -31,16 +31,21 @@ import org.apache.ignite.internal.processors.hadoop.delegate.HadoopFileSystemFac import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests KerberosHadoopFileSystemFactory. */ +@RunWith(JUnit4.class) public class KerberosHadoopFileSystemFactorySelfTest extends GridCommonAbstractTest { /** * Test parameters validation. * * @throws Exception If failed. */ + @Test public void testParameters() throws Exception { checkParameters(null, null, -1); @@ -84,6 +89,7 @@ public class KerberosHadoopFileSystemFactorySelfTest extends GridCommonAbstractT * * @throws Exception If failed. */ + @Test public void testSerialization() throws Exception { KerberosHadoopFileSystemFactory fac = new KerberosHadoopFileSystemFactory(); @@ -123,4 +129,4 @@ public class KerberosHadoopFileSystemFactorySelfTest extends GridCommonAbstractT assertEquals(fac.getKeyTabPrincipal(), fac2.getKeyTabPrincipal()); assertEquals(fac.getReloginInterval(), fac2.getReloginInterval()); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java index 73dadcd..8a74ac7 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java @@ -23,10 +23,14 @@ import org.apache.ignite.igfs.IgfsBlockLocation; import org.apache.ignite.igfs.IgfsMode; import org.apache.ignite.igfs.IgfsPath; import org.apache.ignite.internal.util.typedef.F; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * DUAL_ASYNC mode test. */ +@RunWith(JUnit4.class) public class Hadoop1OverIgfsProxyTest extends Hadoop1DualAbstractTest { /** * Constructor. @@ -38,6 +42,7 @@ public class Hadoop1OverIgfsProxyTest extends Hadoop1DualAbstractTest { /** * @throws Exception If failed. */ + @Test public void testAffinity() throws Exception { long fileSize = 32L * 1024 * 1024; @@ -64,4 +69,4 @@ public class Hadoop1OverIgfsProxyTest extends Hadoop1DualAbstractTest { } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java index 9dcc9c3..0398a35 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java @@ -53,6 +53,9 @@ import java.io.FileOutputStream; import java.io.IOException; import java.net.URI; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -61,6 +64,7 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED; /** * Tests for Hadoop file system factory. */ +@RunWith(JUnit4.class) public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest { /** Amount of "start" invocations */ private static final AtomicInteger START_CNT = new AtomicInteger(); @@ -115,6 +119,7 @@ public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest { * * @throws Exception If failed. */ + @Test public void testCustomFactory() throws Exception { assert START_CNT.get() == 1; assert STOP_CNT.get() == 0; http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java index 70434e3..259c927 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java @@ -80,6 +80,9 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridTestUtils; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -93,6 +96,7 @@ import static org.apache.ignite.igfs.IgfsMode.PROXY; /** * Hadoop 2.x compliant file system. */ +@RunWith(JUnit4.class) public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonAbstractTest { /** Group size. */ public static final int GRP_SIZE = 128; @@ -378,6 +382,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testStatus() throws Exception { Path file1 = new Path("/file1"); @@ -408,6 +413,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testTimes() throws Exception { Path file = new Path("/file1"); @@ -451,6 +457,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testCreateCheckParameters() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -461,6 +468,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testCreateBase() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -487,6 +495,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testCreateCheckOverwrite() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -517,6 +526,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteIfNoSuchPath() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -527,6 +537,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteSuccessfulIfPathIsOpenedToRead() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "myFile"); @@ -560,6 +571,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteIfFilePathExists() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "myFile"); @@ -575,6 +587,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteIfDirectoryPathExists() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -590,6 +603,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteFailsIfNonRecursive() throws Exception { Path fsHome = new Path(primaryFsUri); Path someDir3 = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -614,6 +628,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteRecursively() throws Exception { Path fsHome = new Path(primaryFsUri); Path someDir3 = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -632,6 +647,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteRecursivelyFromRoot() throws Exception { Path fsHome = new Path(primaryFsUri); Path someDir3 = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -654,6 +670,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetPermissionCheckDefaultPermission() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "/tmp/my"); @@ -670,6 +687,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetPermissionCheckNonRecursiveness() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "/tmp/my"); @@ -691,6 +709,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("OctalInteger") + @Test public void testSetPermission() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "/tmp/my"); @@ -710,6 +729,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetPermissionIfOutputStreamIsNotClosed() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "myFile"); @@ -727,6 +747,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerCheckParametersPathIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/tmp/my"); @@ -746,6 +767,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerCheckParametersUserIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/tmp/my"); @@ -765,6 +787,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerCheckParametersGroupIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/tmp/my"); @@ -784,6 +807,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwner() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/tmp/my"); @@ -802,6 +826,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerIfOutputStreamIsNotClosed() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "myFile"); @@ -818,6 +843,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerCheckNonRecursiveness() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "/tmp/my"); @@ -840,6 +866,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testOpenCheckParametersPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -849,6 +876,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testOpenNoSuchPath() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); @@ -861,6 +889,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testOpenIfPathIsAlreadyOpened() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "someFile"); @@ -878,6 +907,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testOpen() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "someFile"); @@ -901,6 +931,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testAppendIfPathPointsToDirectory() throws Exception { final Path fsHome = new Path(primaryFsUri); final Path dir = new Path(fsHome, "/tmp"); @@ -920,6 +951,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testAppendIfFileIsAlreadyBeingOpenedToWrite() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); @@ -943,6 +975,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testAppend() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "someFile"); @@ -974,6 +1007,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameCheckParametersSrcPathIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); @@ -988,6 +1022,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameCheckParametersDstPathIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); @@ -1006,6 +1041,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameIfSrcPathDoesNotExist() throws Exception { Path fsHome = new Path(primaryFsUri); final Path srcFile = new Path(fsHome, "srcFile"); @@ -1025,6 +1061,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameIfSrcPathIsAlreadyBeingOpenedToWrite() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcFile = new Path(fsHome, "srcFile"); @@ -1061,6 +1098,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameFileIfDstPathExists() throws Exception { Path fsHome = new Path(primaryFsUri); final Path srcFile = new Path(fsHome, "srcFile"); @@ -1089,6 +1127,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameFile() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcFile = new Path(fsHome, "/tmp/srcFile"); @@ -1106,6 +1145,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameIfSrcPathIsAlreadyBeingOpenedToRead() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcFile = new Path(fsHome, "srcFile"); @@ -1141,6 +1181,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA /** * @throws Exception If failed. */ + @Test public void testRenameDirectoryIfDstPathExists() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcDir = new Path(fsHome, "/tmp/"); @@ -1174,6 +1215,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameDirectory() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/tmp/"); @@ -1191,6 +1233,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testListStatusIfPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1200,6 +1243,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testListStatusIfPathDoesNotExist() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1213,6 +1257,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testListStatus() throws Exception { Path igfsHome = new Path(primaryFsUri); @@ -1256,6 +1301,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testMkdirsIfPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1267,6 +1313,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testMkdirsIfPermissionIsNull() throws Exception { Path dir = new Path("/tmp"); @@ -1277,6 +1324,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("OctalInteger") + @Test public void testMkdirs() throws Exception { Path fsHome = new Path(primaryFileSystemUriPath()); Path dir = new Path(fsHome, "/tmp/staging"); @@ -1296,6 +1344,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileStatusIfPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1305,6 +1354,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileStatusIfPathDoesNotExist() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1314,6 +1364,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileBlockLocationsIfFileStatusIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1324,6 +1375,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileBlockLocationsIfFileStatusReferenceNotExistingPath() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1333,6 +1385,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileBlockLocations() throws Exception { Path igfsHome = new Path(primaryFsUri); @@ -1371,6 +1424,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testZeroReplicationFactor() throws Exception { // This test doesn't make sense for any mode except of PRIMARY. if (mode == PRIMARY) { @@ -1404,6 +1458,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testMultithreadedCreate() throws Exception { Path dir = new Path(new Path(primaryFsUri), "/dir"); @@ -1479,6 +1534,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testMultithreadedAppend() throws Exception { Path dir = new Path(new Path(primaryFsUri), "/dir"); @@ -1555,6 +1611,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testMultithreadedOpen() throws Exception { final byte[] dataChunk = new byte[256]; @@ -1627,6 +1684,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testMultithreadedMkdirs() throws Exception { final Path dir = new Path(new Path("igfs:///"), "/dir"); @@ -1707,6 +1765,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA * @throws Exception If failed. */ @SuppressWarnings("TooBroadScope") + @Test public void testMultithreadedDelete() throws Exception { final Path dir = new Path(new Path(primaryFsUri), "/dir"); @@ -1780,6 +1839,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testConsistency() throws Exception { // Default buffers values checkConsistency(-1, 1, -1, -1, 1, -1); @@ -1805,6 +1865,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If error occurs. */ + @Test public void testClientReconnect() throws Exception { final Path igfsHome = new Path(primaryFsUri); @@ -1850,6 +1911,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If error occurs. */ + @Test public void testClientReconnectMultithreaded() throws Exception { final ConcurrentLinkedQueue<FileSystem> q = new ConcurrentLinkedQueue<>(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java index 3ffdf23..1c450f3 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java @@ -51,6 +51,9 @@ import org.jetbrains.annotations.Nullable; import java.io.IOException; import java.net.URI; import java.util.concurrent.Callable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -66,6 +69,7 @@ import static org.apache.ignite.internal.processors.igfs.IgfsAbstractSelfTest.cr /** * Tests for IGFS working in mode when remote file system exists: DUAL_SYNC, DUAL_ASYNC. */ +@RunWith(JUnit4.class) public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractTest { /** IGFS block size. */ protected static final int IGFS_BLOCK_SIZE = 512 * 1024; @@ -240,6 +244,7 @@ public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractT * * @throws Exception IF failed. */ + @Test public void testOpenPrefetchOverride() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR), paths(FILE)); @@ -324,4 +329,4 @@ public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractT }, IOException.class, "Failed to read data due to secondary file system exception: /dir/subdir/file"); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java index 7cc5212..040071e 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java @@ -53,6 +53,9 @@ import java.io.FileOutputStream; import java.io.IOException; import java.net.URI; import java.util.concurrent.Callable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -67,6 +70,7 @@ import static org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEnd /** * Tests secondary file system configuration. */ +@RunWith(JUnit4.class) public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstractTest { /** IGFS scheme */ static final String IGFS_SCHEME = "igfs"; @@ -420,6 +424,7 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra * * @throws Exception On failure. */ + @Test public void testFsConfigurationOnly() throws Exception { primaryCfgScheme = IGFS_SCHEME; primaryCfgAuthority = PRIMARY_AUTHORITY; @@ -441,6 +446,7 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra * * @throws Exception On failure. */ + @Test public void testFsUriOverridesUriInConfiguration() throws Exception { // wrong primary URI in the configuration: primaryCfgScheme = "foo"; @@ -598,4 +604,4 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra static String mkUri(String scheme, String authority, String path) { return scheme + "://" + authority + "/" + path; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java index e3dac86..1b61d69 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.hadoop.impl.igfs; +import junit.framework.JUnit4TestAdapter; import junit.framework.TestSuite; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; @@ -50,13 +51,13 @@ public class IgfsEventsTestSuite extends TestSuite { TestSuite suite = new TestSuite("Ignite FS Events Test Suite"); - suite.addTest(new TestSuite(ldr.loadClass(ShmemPrimary.class.getName()))); - suite.addTest(new TestSuite(ldr.loadClass(ShmemDualSync.class.getName()))); - suite.addTest(new TestSuite(ldr.loadClass(ShmemDualAsync.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(ShmemPrimary.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(ShmemDualSync.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(ShmemDualAsync.class.getName()))); - suite.addTest(new TestSuite(ldr.loadClass(LoopbackPrimary.class.getName()))); - suite.addTest(new TestSuite(ldr.loadClass(LoopbackDualSync.class.getName()))); - suite.addTest(new TestSuite(ldr.loadClass(LoopbackDualAsync.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(LoopbackPrimary.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(LoopbackDualSync.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(LoopbackDualAsync.class.getName()))); return suite; } @@ -70,9 +71,9 @@ public class IgfsEventsTestSuite extends TestSuite { TestSuite suite = new TestSuite("Ignite IGFS Events Test Suite Noarch Only"); - suite.addTest(new TestSuite(ldr.loadClass(LoopbackPrimary.class.getName()))); - suite.addTest(new TestSuite(ldr.loadClass(LoopbackDualSync.class.getName()))); - suite.addTest(new TestSuite(ldr.loadClass(LoopbackDualAsync.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(LoopbackPrimary.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(LoopbackDualSync.class.getName()))); + suite.addTest(new JUnit4TestAdapter(ldr.loadClass(LoopbackDualAsync.class.getName()))); return suite; } @@ -284,4 +285,4 @@ public class IgfsEventsTestSuite extends TestSuite { return igfsCfg; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java index 20699f1..6a07b75 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java @@ -43,6 +43,9 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -53,6 +56,7 @@ import static org.apache.ignite.events.EventType.EVT_TASK_FINISHED; /** * Test hadoop file system implementation. */ +@RunWith(JUnit4.class) public class IgfsNearOnlyMultiNodeSelfTest extends GridCommonAbstractTest { /** Path to the default hadoop configuration. */ public static final String HADOOP_FS_CFG = "examples/config/filesystem/core-site.xml"; @@ -164,6 +168,7 @@ public class IgfsNearOnlyMultiNodeSelfTest extends GridCommonAbstractTest { } /** @throws Exception If failed. */ + @Test public void testContentsConsistency() throws Exception { try (FileSystem fs = FileSystem.get(getFileSystemURI(0), getFileSystemConfig())) { Collection<IgniteBiTuple<String, Long>> files = F.asList( http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java index a73367a..bd1cf3c 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java @@ -86,6 +86,9 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridTestUtils; import org.jetbrains.annotations.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -100,6 +103,7 @@ import static org.apache.ignite.igfs.IgfsMode.PROXY; * Test hadoop file system implementation. */ @SuppressWarnings("all") +@RunWith(JUnit4.class) public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonAbstractTest { /** Primary file system authority. */ private static final String PRIMARY_AUTHORITY = "igfs@"; @@ -445,6 +449,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetUriIfFSIsNotInitialized() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -456,6 +461,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("NullableProblems") + @Test public void testInitializeCheckParametersNameIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -468,6 +474,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("NullableProblems") + @Test public void testInitializeCheckParametersCfgIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -479,6 +486,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testInitialize() throws Exception { final IgniteHadoopFileSystem fs = new IgniteHadoopFileSystem(); @@ -506,6 +514,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testIpcCache() throws Exception { HadoopIgfsEx hadoop = GridTestUtils.getFieldValue(fs, "rmtClient", "delegateRef", "value", "hadoop"); @@ -570,6 +579,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testCloseIfNotInitialized() throws Exception { final FileSystem fs = new IgniteHadoopFileSystem(); @@ -578,6 +588,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testClose() throws Exception { final Path path = new Path("dir"); @@ -666,6 +677,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testCreateCheckParameters() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -676,6 +688,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("deprecation") + @Test public void testCreateBase() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -702,6 +715,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("deprecation") + @Test public void testCreateCheckOverwrite() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -730,6 +744,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteIfNoSuchPath() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -740,6 +755,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteSuccessfulIfPathIsOpenedToRead() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "myFile"); @@ -766,6 +782,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteIfFilePathExists() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "myFile"); @@ -780,6 +797,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteIfDirectoryPathExists() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -794,6 +812,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteFailsIfNonRecursive() throws Exception { Path fsHome = new Path(primaryFsUri); Path someDir3 = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -809,6 +828,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteRecursively() throws Exception { Path fsHome = new Path(primaryFsUri); Path someDir3 = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -826,6 +846,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testDeleteRecursivelyFromRoot() throws Exception { Path fsHome = new Path(primaryFsUri); Path someDir3 = new Path(fsHome, "/someDir1/someDir2/someDir3"); @@ -847,6 +868,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("deprecation") + @Test public void testSetPermissionCheckDefaultPermission() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "/tmp/my"); @@ -864,6 +886,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("deprecation") + @Test public void testSetPermissionCheckNonRecursiveness() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "/tmp/my"); @@ -885,6 +908,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("OctalInteger") + @Test public void testSetPermission() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "/tmp/my"); @@ -903,6 +927,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetPermissionIfOutputStreamIsNotClosed() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "myFile"); @@ -919,6 +944,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerCheckParametersPathIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/tmp/my"); @@ -937,6 +963,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerCheckParametersUserIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/tmp/my"); @@ -955,6 +982,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerCheckParametersGroupIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/tmp/my"); @@ -973,6 +1001,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwner() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/tmp/my"); @@ -992,6 +1021,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** * @throws Exception If failed. */ + @Test public void testSetTimes() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "/heartbeatTs"); @@ -1035,6 +1065,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** * @throws Exception If failed. */ + @Test public void testSetOwnerIfOutputStreamIsNotClosed() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "myFile"); @@ -1050,6 +1081,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetOwnerCheckNonRecursiveness() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "/tmp/my"); @@ -1071,6 +1103,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testOpenCheckParametersPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1080,6 +1113,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testOpenNoSuchPath() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); @@ -1092,6 +1126,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testOpenIfPathIsAlreadyOpened() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "someFile"); @@ -1108,6 +1143,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testOpen() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "someFile"); @@ -1130,6 +1166,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testAppendCheckParametersPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1139,6 +1176,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testAppendIfPathPointsToDirectory() throws Exception { final Path fsHome = new Path(primaryFsUri); final Path dir = new Path(fsHome, "/tmp"); @@ -1156,6 +1194,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testAppendIfFileIsAlreadyBeingOpenedToWrite() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); @@ -1176,6 +1215,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testAppend() throws Exception { Path fsHome = new Path(primaryFsUri); Path file = new Path(fsHome, "someFile"); @@ -1205,6 +1245,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameCheckParametersSrcPathIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); @@ -1217,6 +1258,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameCheckParametersDstPathIsNull() throws Exception { Path fsHome = new Path(primaryFsUri); final Path file = new Path(fsHome, "someFile"); @@ -1230,6 +1272,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameIfSrcPathDoesNotExist() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcFile = new Path(fsHome, "srcFile"); @@ -1243,6 +1286,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameIfSrcPathIsAlreadyBeingOpenedToWrite() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcFile = new Path(fsHome, "srcFile"); @@ -1277,6 +1321,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameFileIfDstPathExists() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcFile = new Path(fsHome, "srcFile"); @@ -1297,6 +1342,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameFile() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcFile = new Path(fsHome, "/tmp/srcFile"); @@ -1313,6 +1359,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameIfSrcPathIsAlreadyBeingOpenedToRead() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcFile = new Path(fsHome, "srcFile"); @@ -1345,6 +1392,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameDirectoryIfDstPathExists() throws Exception { Path fsHome = new Path(primaryFsUri); Path srcDir = new Path(fsHome, "/tmp/"); @@ -1366,6 +1414,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testRenameDirectory() throws Exception { Path fsHome = new Path(primaryFsUri); Path dir = new Path(fsHome, "/tmp/"); @@ -1382,6 +1431,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testListStatusIfPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1391,6 +1441,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testListStatusIfPathDoesNotExist() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1404,6 +1455,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testListStatus() throws Exception { Path igfsHome = new Path(PRIMARY_URI); @@ -1446,6 +1498,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetWorkingDirectoryIfPathIsNull() throws Exception { fs.setWorkingDirectory(null); @@ -1460,12 +1513,14 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testSetWorkingDirectoryIfPathDoesNotExist() throws Exception { // Should not throw any exceptions. fs.setWorkingDirectory(new Path("/someDir")); } /** @throws Exception If failed. */ + @Test public void testSetWorkingDirectory() throws Exception { Path dir = new Path("/tmp/nested/dir"); Path file = new Path("file"); @@ -1483,6 +1538,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetWorkingDirectoryIfDefault() throws Exception { String path = fs.getWorkingDirectory().toString(); @@ -1490,6 +1546,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetWorkingDirectory() throws Exception { Path dir = new Path("/tmp/some/dir"); @@ -1503,6 +1560,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testMkdirsIfPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1512,6 +1570,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testMkdirsIfPermissionIsNull() throws Exception { Path dir = new Path("/tmp"); @@ -1522,6 +1581,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("OctalInteger") + @Test public void testMkdirs() throws Exception { Path fsHome = new Path(PRIMARY_URI); final Path dir = new Path(fsHome, "/tmp/staging"); @@ -1541,6 +1601,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileStatusIfPathIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1550,6 +1611,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileStatusIfPathDoesNotExist() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1559,6 +1621,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileBlockLocationsIfFileStatusIsNull() throws Exception { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { @@ -1569,6 +1632,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileBlockLocationsIfFileStatusReferenceNotExistingPath() throws Exception { Path path = new Path("someFile"); @@ -1584,6 +1648,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testGetFileBlockLocations() throws Exception { Path igfsHome = new Path(PRIMARY_URI); @@ -1622,11 +1687,13 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** @throws Exception If failed. */ @SuppressWarnings("deprecation") + @Test public void testGetDefaultBlockSize() throws Exception { assertEquals(1L << 26, fs.getDefaultBlockSize()); } /** @throws Exception If failed. */ + @Test public void testZeroReplicationFactor() throws Exception { // This test doesn't make sense for any mode except of PRIMARY. if (mode == PRIMARY) { @@ -1661,6 +1728,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testMultithreadedCreate() throws Exception { Path dir = new Path(new Path(PRIMARY_URI), "/dir"); @@ -1745,6 +1813,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testMultithreadedAppend() throws Exception { Path dir = new Path(new Path(PRIMARY_URI), "/dir"); @@ -1829,6 +1898,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testMultithreadedOpen() throws Exception { final byte[] dataChunk = new byte[256]; @@ -1900,6 +1970,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If failed. */ + @Test public void testMultithreadedMkdirs() throws Exception { final Path dir = new Path(new Path(PRIMARY_URI), "/dir"); @@ -1979,6 +2050,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * @throws Exception If failed. */ @SuppressWarnings("TooBroadScope") + @Test public void testMultithreadedDelete() throws Exception { final Path dir = new Path(new Path(PRIMARY_URI), "/dir"); @@ -2052,6 +2124,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA } /** @throws Exception If failed. */ + @Test public void testConsistency() throws Exception { // Default buffers values checkConsistency(-1, 1, -1, -1, 1, -1); @@ -2077,6 +2150,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If error occurs. */ + @Test public void testClientReconnect() throws Exception { Path filePath = new Path(PRIMARY_URI, "file1"); @@ -2111,6 +2185,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA /** * @throws Exception If failed. */ + @Test public void testModeResolver() throws Exception { IgfsModeResolver mr = ((IgniteHadoopFileSystem)fs).getModeResolver(); @@ -2122,6 +2197,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA * * @throws Exception If error occurs. */ + @Test public void testClientReconnectMultithreaded() throws Exception { final ConcurrentLinkedQueue<FileSystem> q = new ConcurrentLinkedQueue<>(); @@ -2500,4 +2576,4 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA return cfg; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedAbstractSelfTest.java index 8198cd3..eb74347 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedAbstractSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedAbstractSelfTest.java @@ -31,10 +31,14 @@ import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration; import org.apache.ignite.igfs.IgfsMode; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * IGFS Hadoop file system Ignite client -based self test. */ +@RunWith(JUnit4.class) public abstract class IgniteHadoopFileSystemClientBasedAbstractSelfTest extends IgniteHadoopFileSystemAbstractSelfTest { /** Alive node index. */ private static final int ALIVE_NODE_IDX = GRID_COUNT - 1; @@ -88,6 +92,7 @@ public abstract class IgniteHadoopFileSystemClientBasedAbstractSelfTest extends } /** {@inheritDoc} */ + @Test @Override public void testClientReconnect() throws Exception { Path filePath = new Path(PRIMARY_URI, "file1"); @@ -115,6 +120,7 @@ public abstract class IgniteHadoopFileSystemClientBasedAbstractSelfTest extends * * @throws Exception If error occurs. */ + @Test @Override public void testClientReconnectMultithreaded() throws Exception { final ConcurrentLinkedQueue<FileSystem> q = new ConcurrentLinkedQueue<>(); @@ -190,4 +196,4 @@ public abstract class IgniteHadoopFileSystemClientBasedAbstractSelfTest extends if (i != nodeIdx) startGrid(i); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java index 700cc64..d141d8e 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java @@ -32,10 +32,14 @@ import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * IGFS Hadoop file system Ignite client -based self test for PROXY mode. */ +@RunWith(JUnit4.class) public class IgniteHadoopFileSystemClientBasedOpenTest extends GridCommonAbstractTest { /** Config root path. */ private static final String [] CONFIGS = { @@ -164,6 +168,7 @@ public class IgniteHadoopFileSystemClientBasedOpenTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testFsOpenMultithreaded() throws Exception { skipInProc = false; @@ -193,6 +198,7 @@ public class IgniteHadoopFileSystemClientBasedOpenTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testFsOpenMultithreadedSkipInProc() throws Exception { skipInProc = true; @@ -202,6 +208,7 @@ public class IgniteHadoopFileSystemClientBasedOpenTest extends GridCommonAbstrac /** * @throws Exception If failed. */ + @Test public void testIgniteClientWithIgfsMisconfigure() throws Exception { startNodes(new NodeType[] {NodeType.REMOTE, NodeType.REMOTE, NodeType.REMOTE}); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java index 96ef6bb..5ee95b0 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java @@ -45,6 +45,9 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -55,6 +58,7 @@ import static org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEnd /** * Test interaction between a IGFS client and a IGFS server. */ +@RunWith(JUnit4.class) public class IgniteHadoopFileSystemClientSelfTest extends IgfsCommonAbstractTest { /** Logger. */ private static final Log LOG = LogFactory.getLog(IgniteHadoopFileSystemClientSelfTest.class); @@ -139,6 +143,7 @@ public class IgniteHadoopFileSystemClientSelfTest extends IgfsCommonAbstractTest * * @throws Exception If failed. */ + @Test public void testOutputStreamDeferredException() throws Exception { final byte[] data = "test".getBytes(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java index cab318c..7acc3592 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java @@ -40,6 +40,9 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridTestUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -54,6 +57,7 @@ import static org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEnd /** * Tests for IGFS file system handshake. */ +@RunWith(JUnit4.class) public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -83,6 +87,7 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT * * @throws Exception If failed. */ + @Test public void testHandshake() throws Exception { startUp(false, false); @@ -111,6 +116,7 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT * * @throws Exception If failed. */ + @Test public void testHandshakeDefaultGrid() throws Exception { startUp(true, false); @@ -279,4 +285,4 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT return cfg; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java index e9de332..397e687 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java @@ -38,6 +38,9 @@ import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -49,6 +52,7 @@ import static org.apache.ignite.events.EventType.EVT_TASK_FINISHED; /** * IPC cache test. */ +@RunWith(JUnit4.class) public class IgniteHadoopFileSystemIpcCacheSelfTest extends IgfsCommonAbstractTest { /** IP finder. */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); @@ -155,6 +159,7 @@ public class IgniteHadoopFileSystemIpcCacheSelfTest extends IgfsCommonAbstractTe * @throws Exception If failed. */ @SuppressWarnings("unchecked") + @Test public void testIpcCache() throws Exception { Field cacheField = HadoopIgfsIpcIo.class.getDeclaredField("ipcCache"); @@ -221,4 +226,4 @@ public class IgniteHadoopFileSystemIpcCacheSelfTest extends IgfsCommonAbstractTe assert (Boolean)stopField.get(io); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c5197e0a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerSelfTest.java index 6de033f..22c66b1 100644 --- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerSelfTest.java +++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerSelfTest.java @@ -30,6 +30,9 @@ import java.io.FilenameFilter; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import static org.apache.ignite.internal.igfs.common.IgfsLogger.DELIM_FIELD; import static org.apache.ignite.internal.igfs.common.IgfsLogger.DELIM_FIELD_VAL; @@ -51,6 +54,7 @@ import static org.apache.ignite.internal.igfs.common.IgfsLogger.TYPE_SKIP; /** * Grid IGFS client logger test. */ +@RunWith(JUnit4.class) public class IgniteHadoopFileSystemLoggerSelfTest extends IgfsCommonAbstractTest { /** Path string. */ private static final String PATH_STR = "/dir1/dir2/file;test"; @@ -107,6 +111,7 @@ public class IgniteHadoopFileSystemLoggerSelfTest extends IgfsCommonAbstractTest * * @throws Exception If failed. */ + @Test public void testCreateDelete() throws Exception { IgfsLogger log = IgfsLogger.logger(ENDPOINT, IGFS_NAME, LOG_DIR, 10); @@ -162,6 +167,7 @@ public class IgniteHadoopFileSystemLoggerSelfTest extends IgfsCommonAbstractTest * * @throws Exception If failed. */ + @Test public void testLogRead() throws Exception { IgfsLogger log = IgfsLogger.logger(ENDPOINT, IGFS_NAME, LOG_DIR, 10); @@ -192,6 +198,7 @@ public class IgniteHadoopFileSystemLoggerSelfTest extends IgfsCommonAbstractTest * * @throws Exception If failed. */ + @Test public void testLogWrite() throws Exception { IgfsLogger log = IgfsLogger.logger(ENDPOINT, IGFS_NAME, LOG_DIR, 10); @@ -217,6 +224,7 @@ public class IgniteHadoopFileSystemLoggerSelfTest extends IgfsCommonAbstractTest * @throws Exception If failed. */ @SuppressWarnings("TooBroadScope") + @Test public void testLogMisc() throws Exception { IgfsLogger log = IgfsLogger.logger(ENDPOINT, IGFS_NAME, LOG_DIR, 10); @@ -296,4 +304,4 @@ public class IgniteHadoopFileSystemLoggerSelfTest extends IgfsCommonAbstractTest return buf.toString(); } -} \ No newline at end of file +}
