Skip to content

Commit 0e0b52c

Browse files
georgeajitgeorgeajit
authored andcommitted
No Task - Added JUnit assume so that tests run on multiple hosts only.
1 parent 2ef8411 commit 0e0b52c

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/QBFailover.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.junit.After;
3737
import org.junit.AfterClass;
3838
import org.junit.Assert;
39+
import org.junit.Assume;
3940
import org.junit.Before;
4041
import org.junit.BeforeClass;
4142
import org.junit.Test;
@@ -282,6 +283,8 @@ public void tearDown() throws Exception {
282283

283284
@Test(timeout = 450000)
284285
public void testStopOneNode() throws Exception {
286+
Assume.assumeTrue(hostNames.length > 1);
287+
285288
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
286289
AtomicInteger success = new AtomicInteger(0);
287290
AtomicInteger failure = new AtomicInteger(0);
@@ -317,6 +320,8 @@ public void testStopOneNode() throws Exception {
317320

318321
@Test(timeout = 450000)
319322
public void testRestart() throws Exception {
323+
Assume.assumeTrue(hostNames.length > 1);
324+
320325
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
321326
AtomicInteger success = new AtomicInteger(0);
322327
AtomicInteger failure = new AtomicInteger(0);
@@ -354,6 +359,8 @@ public void testRestart() throws Exception {
354359

355360
@Test(timeout = 450000)
356361
public void testRepeatedStopOneNode() throws Exception {
362+
Assume.assumeTrue(hostNames.length > 1);
363+
357364
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
358365
AtomicInteger success = new AtomicInteger(0);
359366
AtomicInteger failure = new AtomicInteger(0);
@@ -398,6 +405,8 @@ public void testRepeatedStopOneNode() throws Exception {
398405

399406
@Test(timeout = 450000)
400407
public void testMinNodes() throws Exception {
408+
Assume.assumeTrue(hostNames.length > 1);
409+
401410
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
402411
AtomicInteger success = new AtomicInteger(0);
403412
AtomicInteger failure = new AtomicInteger(0);
@@ -442,6 +451,8 @@ public void testMinNodes() throws Exception {
442451

443452
@Test(timeout = 450000)
444453
public void testStopTwoNodes() throws Exception {
454+
Assume.assumeTrue(hostNames.length > 1);
455+
445456
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
446457
try {
447458
final AtomicInteger success = new AtomicInteger(0);
@@ -485,6 +496,8 @@ public void testStopTwoNodes() throws Exception {
485496

486497
@Test(timeout = 450000)
487498
public void xQueryMasstransformReplace() throws Exception {
499+
Assume.assumeTrue(hostNames.length > 1);
500+
488501
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
489502
ServerTransform transform = new ServerTransform("add-attr-xquery-transform");
490503
transform.put("name", "Lang");
@@ -555,6 +568,8 @@ public void xQueryMasstransformReplace() throws Exception {
555568

556569
@Test(timeout = 450000)
557570
public void xQueryMasstransformReplaceTwoNodes() throws Exception {
571+
Assume.assumeTrue(hostNames.length > 1);
572+
558573
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
559574
ServerTransform transform = new ServerTransform("add-attr-xquery-transform");
560575
transform.put("name", "Lang");
@@ -627,6 +642,8 @@ public void xQueryMasstransformReplaceTwoNodes() throws Exception {
627642

628643
@Test(timeout = 450000)
629644
public void xQueryMasstransformReplaceRepeated() throws Exception {
645+
Assume.assumeTrue(hostNames.length > 1);
646+
630647
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
631648
ServerTransform transform = new ServerTransform("add-attr-xquery-transform");
632649
transform.put("name", "Lang");
@@ -705,6 +722,8 @@ public void xQueryMasstransformReplaceRepeated() throws Exception {
705722

706723
@Test(timeout = 450000)
707724
public void massDeleteConsistentSnapShot() throws Exception {
725+
Assume.assumeTrue(hostNames.length > 1);
726+
708727
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
709728
AtomicBoolean isRunning = new AtomicBoolean(true);
710729
Map<String, String> props = new HashMap<String, String>();

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/WBFailover.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.junit.After;
3333
import org.junit.AfterClass;
3434
import org.junit.Assert;
35+
import org.junit.Assume;
3536
import org.junit.Before;
3637
import org.junit.BeforeClass;
3738
import org.junit.Test;
@@ -242,6 +243,8 @@ public void tearDown() throws Exception {
242243

243244
@Test(timeout = 350000)
244245
public void testBlackListHost() throws Exception {
246+
Assume.assumeTrue(hostNames.length > 1);
247+
245248
try {
246249
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
247250
final AtomicInteger successCount = new AtomicInteger(0);
@@ -287,6 +290,8 @@ public void testBlackListHost() throws Exception {
287290

288291
@Test(timeout = 350000)
289292
public void testStopOneNode() throws Exception {
293+
Assume.assumeTrue(hostNames.length > 1);
294+
290295
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
291296
Assert.assertTrue(evalClient.newServerEval().xquery(query1).eval().next().getNumber().intValue() == 0);
292297
final AtomicInteger successCount = new AtomicInteger(0);
@@ -332,6 +337,8 @@ public void testStopOneNode() throws Exception {
332337

333338
@Test(timeout = 350000)
334339
public void testRestart() throws Exception {
340+
Assume.assumeTrue(hostNames.length > 1);
341+
335342
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
336343
Assert.assertTrue(evalClient.newServerEval().xquery(query1).eval().next().getNumber().intValue() == 0);
337344
final AtomicInteger successCount = new AtomicInteger(0);
@@ -380,6 +387,8 @@ public void testRestart() throws Exception {
380387

381388
@Test(timeout = 350000)
382389
public void testRepeatedStopOneNode() throws Exception {
390+
Assume.assumeTrue(hostNames.length > 1);
391+
383392
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
384393
try {
385394
final AtomicInteger successCount = new AtomicInteger(0);
@@ -437,6 +446,8 @@ public void testRepeatedStopOneNode() throws Exception {
437446

438447
@Test(timeout = 350000)
439448
public void testStopTwoNodes() throws Exception {
449+
Assume.assumeTrue(hostNames.length > 1);
450+
440451
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
441452
try {
442453
final AtomicInteger successCount = new AtomicInteger(0);
@@ -496,6 +507,8 @@ public void testStopTwoNodes() throws Exception {
496507

497508
@Test(timeout = 350000)
498509
public void testMinHosts() throws Exception {
510+
Assume.assumeTrue(hostNames.length > 1);
511+
499512
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
500513
final AtomicInteger successCount = new AtomicInteger(0);
501514
final AtomicInteger failCount = new AtomicInteger(0);
@@ -539,6 +552,8 @@ public void testMinHosts() throws Exception {
539552

540553
@Test(timeout = 350000)
541554
public void testWhiteBlackListNPE() throws Exception {
555+
Assume.assumeTrue(hostNames.length > 1);
556+
542557
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
543558
try {
544559
FilteredForestConfiguration forestConfig = new FilteredForestConfiguration(dmManager.readForestConfig())

0 commit comments

Comments
 (0)