Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions test/TestUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,20 @@
return map.putAll(entries);
};

exports.isEnterprise = function() {
return !!process.env.HAZELCAST_ENTERPRISE_KEY;
}

Check warning on line 164 in test/TestUtil.js

View workflow job for this annotation

GitHub Actions / Check code quality

Missing semicolon

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();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Loading