diff --git a/test/TestUtil.js b/test/TestUtil.js index d589c948d..a5e90c988 100644 --- a/test/TestUtil.js +++ b/test/TestUtil.js @@ -159,24 +159,20 @@ exports.fillMap = function (map, size = 10, keyPrefix = 'key', valuePrefix = 'va return map.putAll(entries); }; +exports.isEnterprise = function() { + return !!process.env.HAZELCAST_ENTERPRISE_KEY; +} + exports.markCommunity = function (_this) { // the following two env vars are set in compat test suite - if (process.env.SERVER_TYPE === 'enterprise' || process.env.HZ_TYPE === 'enterprise') { - _this.skip(); - } - - if (process.env.HAZELCAST_ENTERPRISE_KEY) { + if (exports.isEnterprise()) { _this.skip(); } }; exports.markEnterprise = function (_this) { // the following two env vars are set in compat test suite - if (process.env.SERVER_TYPE === 'oss' || process.env.HZ_TYPE === 'oss') { - _this.skip(); - } - - if (!process.env.HAZELCAST_ENTERPRISE_KEY) { + if (!exports.isEnterprise()) { _this.skip(); } }; diff --git a/test/integration/backward_compatible/parallel/cpsubsystem/AtomicLongTest.js b/test/integration/backward_compatible/parallel/cpsubsystem/AtomicLongTest.js index 6c792b6ff..e904a54ee 100644 --- a/test/integration/backward_compatible/parallel/cpsubsystem/AtomicLongTest.js +++ b/test/integration/backward_compatible/parallel/cpsubsystem/AtomicLongTest.js @@ -37,6 +37,10 @@ describe('AtomicLongTest', function () { } before(async function () { + TestUtil.markEnterprise(this); + if (!TestUtil.isEnterprise()) { + return; + } cluster = await testFactory.createClusterForParallelTests(null, fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8')); const members = await Promise.all([ diff --git a/test/integration/backward_compatible/parallel/cpsubsystem/AtomicReferenceTest.js b/test/integration/backward_compatible/parallel/cpsubsystem/AtomicReferenceTest.js index 57be6a6b9..1c8f4675a 100644 --- a/test/integration/backward_compatible/parallel/cpsubsystem/AtomicReferenceTest.js +++ b/test/integration/backward_compatible/parallel/cpsubsystem/AtomicReferenceTest.js @@ -31,6 +31,10 @@ describe('AtomicReferenceTest', function () { const testFactory = new TestUtil.TestFactory(); before(async function () { + TestUtil.markEnterprise(this); + if (!TestUtil.isEnterprise()) { + return; + } cluster = await testFactory.createClusterForParallelTests(null, fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8')); const members = await Promise.all([ diff --git a/test/integration/backward_compatible/parallel/cpsubsystem/CountDownLatchTest.js b/test/integration/backward_compatible/parallel/cpsubsystem/CountDownLatchTest.js index cb5c48833..c0b3fc5af 100644 --- a/test/integration/backward_compatible/parallel/cpsubsystem/CountDownLatchTest.js +++ b/test/integration/backward_compatible/parallel/cpsubsystem/CountDownLatchTest.js @@ -41,6 +41,10 @@ describe('CountDownLatchTest', function () { } before(async function () { + TestUtil.markEnterprise(this); + if (!TestUtil.isEnterprise()) { + return; + } cluster = await testFactory.createClusterForParallelTests(null, fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8')); const members = await Promise.all([ diff --git a/test/integration/backward_compatible/parallel/cpsubsystem/FencedLockTest.js b/test/integration/backward_compatible/parallel/cpsubsystem/FencedLockTest.js index 2c26c7f89..f8fbcdab8 100644 --- a/test/integration/backward_compatible/parallel/cpsubsystem/FencedLockTest.js +++ b/test/integration/backward_compatible/parallel/cpsubsystem/FencedLockTest.js @@ -68,6 +68,10 @@ describe('FencedLockTest', function () { } before(async function () { + TestUtil.markEnterprise(this); + if (!TestUtil.isEnterprise()) { + return; + } cluster = await testFactory.createClusterForParallelTests(null, fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8')); members = await Promise.all([ diff --git a/test/integration/backward_compatible/parallel/cpsubsystem/SemaphoreCommonTest.js b/test/integration/backward_compatible/parallel/cpsubsystem/SemaphoreCommonTest.js index f4cd1d5fb..2c02582dd 100644 --- a/test/integration/backward_compatible/parallel/cpsubsystem/SemaphoreCommonTest.js +++ b/test/integration/backward_compatible/parallel/cpsubsystem/SemaphoreCommonTest.js @@ -41,6 +41,10 @@ describe('SemaphoreCommonTest', function () { } before(async function () { + TestUtil.markEnterprise(this); + if (!TestUtil.isEnterprise()) { + return; + } cluster = await testFactory.createClusterForParallelTests(null, fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8')); const members = await Promise.all([ diff --git a/test/integration/backward_compatible/parallel/cpsubsystem/SessionAwareSemaphoreTest.js b/test/integration/backward_compatible/parallel/cpsubsystem/SessionAwareSemaphoreTest.js index 0c0a67e64..ab5b124f2 100644 --- a/test/integration/backward_compatible/parallel/cpsubsystem/SessionAwareSemaphoreTest.js +++ b/test/integration/backward_compatible/parallel/cpsubsystem/SessionAwareSemaphoreTest.js @@ -40,6 +40,10 @@ describe('SessionAwareSemaphoreTest', function () { } before(async function () { + TestUtil.markEnterprise(this); + if (!TestUtil.isEnterprise()) { + return; + } cluster = await testFactory.createClusterForParallelTests(null, fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8')); const members = await Promise.all([ diff --git a/test/integration/backward_compatible/parallel/cpsubsystem/SessionlessSemaphoreTest.js b/test/integration/backward_compatible/parallel/cpsubsystem/SessionlessSemaphoreTest.js index a2561f525..fa98b8a7b 100644 --- a/test/integration/backward_compatible/parallel/cpsubsystem/SessionlessSemaphoreTest.js +++ b/test/integration/backward_compatible/parallel/cpsubsystem/SessionlessSemaphoreTest.js @@ -40,6 +40,10 @@ describe('SessionlessSemaphoreTest', function () { } before(async function () { + TestUtil.markEnterprise(this); + if (!TestUtil.isEnterprise()) { + return; + } cluster = await testFactory.createClusterForParallelTests(null, fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8')); members = await Promise.all([ diff --git a/test/integration/backward_compatible/parallel/serialization/compact/CompactPublicAPIsTest.js b/test/integration/backward_compatible/parallel/serialization/compact/CompactPublicAPIsTest.js index e7f77a47e..cf113b3ca 100644 --- a/test/integration/backward_compatible/parallel/serialization/compact/CompactPublicAPIsTest.js +++ b/test/integration/backward_compatible/parallel/serialization/compact/CompactPublicAPIsTest.js @@ -255,7 +255,9 @@ describe('CompactPublicAPIsTest', function () { multimap = await client.getMultiMap(name); replicatedMap = await client.getReplicatedMap(name); list = await client.getList(name); - atomicReference = await client.getCPSubsystem().getAtomicReference(name); + if (TestUtil.isEnterprise()) { + atomicReference = await client.getCPSubsystem().getAtomicReference(name); + } queue = await client.getQueue(name); set = await client.getSet(name); topic = await client.getReliableTopic(name); @@ -274,7 +276,9 @@ describe('CompactPublicAPIsTest', function () { await multimap.destroy(); await replicatedMap.destroy(); await list.destroy(); - await atomicReference.destroy(); + if (TestUtil.isEnterprise()) { + await atomicReference.destroy(); + } await queue.destroy(); await set.destroy(); await topic.destroy(); @@ -933,6 +937,10 @@ describe('CompactPublicAPIsTest', function () { }); describe('AtomicReference', function () { + before(function() { + TestUtil.markEnterprise(this); + }); + it('compareAndSet', async function () { const fn = atomicReference.compareAndSet.bind(atomicReference, OUTER_INSTANCE, employee); await fn();