Examples of TestClass


Examples of org.junit.runners.model.TestClass

    }

    @Test
    public void rejectsNonPublicClass() {
        TestClass testClass = new TestClass(NonPublicClass.class);
        List<Exception> validationErrors = validator
                .validateTestClass(testClass);
        assertThat("Wrong number of errors.", validationErrors.size(),
                is(equalTo(1)));
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

    private void assertClassHasFailureMessage(Class<?> klass,
            String expectedFailure) {
        AnnotationsValidator validator= new AnnotationsValidator();
        Collection<Exception> errors= validator
                .validateTestClass(new TestClass(klass));
        assertThat(errors.size(), is(1));
        assertThat(errors.iterator().next().getMessage(),
                is(expectedFailure));
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

    }

    @Test
    public void isEqualToTestWithSameNameAndTestClassAndParameters() {
        TestWithParameters firstTest = new TestWithParameters(DUMMY_NAME,
                new TestClass(DummyClass.class), Arrays.<Object> asList("a",
                        "b"));
        TestWithParameters secondTest = new TestWithParameters(DUMMY_NAME,
                new TestClass(DummyClass.class), Arrays.<Object> asList("a",
                        "b"));
        assertEquals(firstTest, secondTest);
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

    }

    @Test
    public void isNotEqualToTestWithDifferentTestClass() {
        TestWithParameters firstTest = new TestWithParameters(DUMMY_NAME,
                new TestClass(DummyClass.class), DUMMY_PARAMETERS);
        TestWithParameters secondTest = new TestWithParameters(DUMMY_NAME,
                new TestClass(AnotherDummyClass.class), DUMMY_PARAMETERS);
        assertNotEquals(firstTest, secondTest);
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        assertEquals(firstTest.hashCode(), secondTest.hashCode());
    }

    @Test
    public void hasMeaningfulToString() {
        TestWithParameters test = new TestWithParameters("name", new TestClass(
                DummyClass.class), Arrays.<Object> asList("first parameter",
                "second parameter"));
        assertEquals(
                "Wrong toString().",
                "org.junit.runners.parameterized.TestWithParametersTest$DummyClass 'name' with parameters [first parameter, second parameter]",
View Full Code Here

Examples of org.junit.runners.model.TestClass

    public static final String OPENEJB_APPLICATION_COMPOSER_CONTEXT = "openejb.application.composer.context";
    private final TestClass testClass;

    public ApplicationComposer(Class<?> klass) throws InitializationError {
        super(klass);
        testClass = new TestClass(klass);
        validate();
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

    public void boot()
    {
        final ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();

        this.mockedMyFacesTestContainer = new MyFacesContainer(new TestClass(this.testClass))
        {
            @Override
            protected String getWebappResourcePath()
            {
                TestConfig testConfig = testClass.getJavaClass().getAnnotation(TestConfig.class);
View Full Code Here

Examples of org.mvel2.tests.core.res.TestClass

    }
  }

  public void testSetterViaDotNotation() {

    TestClass tc = new TestClass();
    tc.getExtra().put("test", "value");

    ParserContext ctx = new ParserContext();
    ctx.setStrongTyping(true);
    String expression = "extra.test";
    Serializable compiled = MVEL.compileSetExpression(expression, ctx);
    MVEL.executeSetExpression(compiled, tc, "value2");
    assertEquals("value2", tc.getExtra().get("test"));
  }
View Full Code Here

Examples of uk.co.brunella.osgi.bdt.junit.runner.model.TestClass

    if (testClassAnnotation == null) {
      throw new InitializationError("OSGiBDTTest annotation is missing");
    }
    testClassName = testClass.getName();
    this.testClassAnnotation = testClassAnnotation;
    this.testClass = new TestClass(testClass);
    repositories = loadRepositories(testClassAnnotation.repositories());
    testClassDescription = createDescription(this.testClass, repositories);
   
    frameworkStarters = createFrameworkStarter(repositories, testClassAnnotation.framework());
    if (testBundleFile == null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.