Search in sources :

Example 1 with Test

use of org.junit.jupiter.api.Test in project intellij-community by JetBrains.

the class JUnit5AcceptanceTest method testFactoryMethods.

@Test
void testFactoryMethods() {
    doTest(() -> {
        PsiClass aClass = myFixture.addClass("class MyTest {@org.junit.jupiter.api.TestFactory java.util.List<org.junit.jupiter.api.DynamicTest> tests() {return null;}}");
        PsiMethod factoryMethod = aClass.getMethods()[0];
        assertNotNull(factoryMethod);
        assertTrue(JUnitUtil.isTestAnnotated(factoryMethod));
    });
}
Also used : PsiMethod(com.intellij.psi.PsiMethod) PsiClass(com.intellij.psi.PsiClass) Test(org.junit.jupiter.api.Test)

Example 2 with Test

use of org.junit.jupiter.api.Test in project intellij-community by JetBrains.

the class JUnit5AcceptanceTest method recognizedInnerClassesWithTestMethods.

@Test
void recognizedInnerClassesWithTestMethods() {
    doTest(() -> {
        PsiClass aClass = myFixture.addClass("import org.junit.jupiter.api.*; class MyTest {@Nested class NTest { @Test void method() {}}}");
        assertTrue(JUnitUtil.isTestClass(aClass, false, false));
        PsiClass innerClass = aClass.getInnerClasses()[0];
        assertTrue(JUnitUtil.isTestClass(innerClass));
        assertTrue(JUnitUtil.isTestMethod(MethodLocation.elementInClass(innerClass.getMethods()[0], innerClass)));
    });
}
Also used : PsiClass(com.intellij.psi.PsiClass) Test(org.junit.jupiter.api.Test)

Example 3 with Test

use of org.junit.jupiter.api.Test in project spring-framework by spring-projects.

the class DisabledIfConditionTestCase method unsupportedStringEvaluationValue.

@Test
void unsupportedStringEvaluationValue() {
    String methodName = "stringExpressionThatIsNeitherTrueNorFalse";
    IllegalStateException exception = assertThrows(IllegalStateException.class, () -> condition.evaluate(buildExtensionContext(methodName)));
    Method method = ReflectionUtils.findMethod(getClass(), methodName);
    assertThat(exception.getMessage(), is(equalTo("@DisabledIf(\"#{'enigma'}\") on " + method + " must evaluate to \"true\" or \"false\", not \"enigma\"")));
}
Also used : Method(java.lang.reflect.Method) Test(org.junit.jupiter.api.Test)

Example 4 with Test

use of org.junit.jupiter.api.Test in project Malai by arnobl.

the class BaseWIMPWidgetTest method testProcessEventGoodDataOnStart.

@Test
void testProcessEventGoodDataOnStart() {
    interaction.getFsm().addHandler(new InteractionHandlerStub() {

        @Override
        public void fsmStarts() {
            assertEquals(wimpWidget, interaction.getWidget());
        }
    });
    interaction.processEvent(new ActionEvent(wimpWidget, null));
    sleep();
}
Also used : ActionEvent(javafx.event.ActionEvent) Test(org.junit.jupiter.api.Test)

Example 5 with Test

use of org.junit.jupiter.api.Test in project Malai by arnobl.

the class TestClick method testClickOnUnregWidget.

@Test
void testClickOnUnregWidget() throws CancelFSMException {
    Pane pane = new Pane();
    interaction.registerToNodes(Collections.singletonList(pane));
    interaction.unregisterFromNodes(Collections.singletonList(pane));
    pane.fireEvent(createMouseClickEvent(11, 23, MouseButton.MIDDLE, pane));
    Mockito.verify(handler, Mockito.never()).fsmStarts();
}
Also used : Pane(javafx.scene.layout.Pane) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)67450 lombok.val (lombok.val)3880 File (java.io.File)2228 HashMap (java.util.HashMap)2180 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2164 ArrayList (java.util.ArrayList)2137 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)2027 SqlSession (org.apache.ibatis.session.SqlSession)1845 List (java.util.List)1799 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)1484 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1184 Map (java.util.Map)1143 IOException (java.io.IOException)1048 Path (java.nio.file.Path)1006 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)935 Date (java.util.Date)914 Method (java.lang.reflect.Method)862 TestBean (org.springframework.beans.testfixture.beans.TestBean)822 Transaction (org.neo4j.graphdb.Transaction)752 BaseDataTest (org.apache.ibatis.BaseDataTest)740