Skip to content

Commit

Permalink
BAEL-1861 Replaced real tests with demo test "placeholders" (eugenp#4887
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pedja4 authored Aug 3, 2018
1 parent f4de016 commit cc3b355
Show file tree
Hide file tree
Showing 17 changed files with 98 additions and 333 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.baeldung.junit4.runfromjava;

import org.junit.Test;

import static org.junit.Assert.assertTrue;


public class FirstUnitTest {

@Test
public void whenThis_thenThat() {
assertTrue(true);
}

@Test
public void whenSomething_thenSomething() {
assertTrue(true);
}

@Test
public void whenSomethingElse_thenSomethingElse() {
assertTrue(true);
}

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({ ListNodeUnitTest.class, MergeListsUnitTest.class })
@Suite.SuiteClasses({ FirstUnitTest.class, SecondUnitTest.class })
public class MyTestSuite {

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ public class RunJUnit4Tests {
public static void runOne() {
JUnitCore junit = new JUnitCore();
junit.addListener(new TextListener(System.out));
junit.run(MergeListsUnitTest.class);
junit.run(FirstUnitTest.class);
}

public static void runAllClasses() {
JUnitCore junit = new JUnitCore();
junit.addListener(new TextListener(System.out));

Result result = junit.run(ListNodeUnitTest.class, MergeListsUnitTest.class, RemovedNthElementUnitTest.class, RotateListUnitTest.class, SwapNodesUnitTest.class);
Result result = junit.run(FirstUnitTest.class, SecondUnitTest.class);

for (Failure failure : result.getFailures()) {
System.out.println(failure.toString());
Expand All @@ -44,7 +44,7 @@ public static void runSuiteOfClasses() {
}

public static void runRepeated() {
Test test = new JUnit4TestAdapter(MergeListsUnitTest.class);
Test test = new JUnit4TestAdapter(SecondUnitTest.class);
RepeatedTest repeatedTest = new RepeatedTest(test, 5);

JUnitCore junit = new JUnitCore();
Expand All @@ -59,8 +59,8 @@ public static void runRepeatedSuite() {
JUnitCore junit = new JUnitCore();
junit.addListener(new TextListener(System.out));

mySuite.addTest(new RepeatedTest(new JUnit4TestAdapter(MergeListsUnitTest.class), 5));
mySuite.addTest(new RepeatedTest(new JUnit4TestAdapter(RemovedNthElementUnitTest.class), 3));
mySuite.addTest(new RepeatedTest(new JUnit4TestAdapter(FirstUnitTest.class), 5));
mySuite.addTest(new RepeatedTest(new JUnit4TestAdapter(SecondUnitTest.class), 3));

junit.run(mySuite);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baeldung.junit4.runfromjava;

import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class SecondUnitTest {

@Test
public void whenSomething_thenSomething() {
assertTrue(true);
}

@Test
public void whensomethingElse_thenSomethingElse() {
assertTrue(true);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.baeldung.junit5.runfromjava;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertTrue;

class FirstUnitTest {

@Test
void whenThis_thenThat() {
assertTrue(true);
}

@Test
void whenSomething_thenSomething() {
assertTrue(true);
}

@Test
void whenSomethingElse_thenSomethingElse() {
assertTrue(true);
}

}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit cc3b355

Please sign in to comment.