application test : junit5 - 커스텀 태그
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
package com.example.apptest;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Tag;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Test
|
||||||
|
@Tag("fast")
|
||||||
|
public @interface FastTest {
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.example.apptest;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Tag;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Test
|
||||||
|
@Tag("slow")
|
||||||
|
public @interface SlowTest {
|
||||||
|
}
|
||||||
@@ -10,24 +10,40 @@ import static org.junit.jupiter.api.Assertions.*;
|
|||||||
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
|
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
|
||||||
class StudyTest {
|
class StudyTest {
|
||||||
|
|
||||||
@Test
|
@FastTest
|
||||||
@DisplayName("tag test")
|
@DisplayName("custom tag test")
|
||||||
@Tag("fast")
|
void test_16() {
|
||||||
void test_14() {
|
|
||||||
System.out.println("fast");
|
System.out.println("fast");
|
||||||
Study study = new Study(10);
|
Study study = new Study(10);
|
||||||
assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
|
assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@SlowTest
|
||||||
@DisplayName("tag test")
|
@DisplayName("custom tag test")
|
||||||
@Tag("slow")
|
void test_15() {
|
||||||
void test_13() {
|
|
||||||
System.out.println("slow");
|
System.out.println("slow");
|
||||||
Study study = new Study(10);
|
Study study = new Study(10);
|
||||||
assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
|
assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Test
|
||||||
|
// @DisplayName("tag test")
|
||||||
|
// @Tag("fast")
|
||||||
|
// void test_14() {
|
||||||
|
// System.out.println("fast");
|
||||||
|
// Study study = new Study(10);
|
||||||
|
// assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Test
|
||||||
|
// @DisplayName("tag test")
|
||||||
|
// @Tag("slow")
|
||||||
|
// void test_13() {
|
||||||
|
// System.out.println("slow");
|
||||||
|
// Study study = new Study(10);
|
||||||
|
// assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
|
||||||
|
// }
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
// @DisplayName("DisabledIfEnvironmentVariable test")
|
// @DisplayName("DisabledIfEnvironmentVariable test")
|
||||||
// @DisabledIfEnvironmentVariable(named = "TEST_ENV", matches = "KIM")
|
// @DisabledIfEnvironmentVariable(named = "TEST_ENV", matches = "KIM")
|
||||||
|
|||||||
Reference in New Issue
Block a user