Package org.jboss.arquillian.test.spi

Examples of org.jboss.arquillian.test.spi.TestClass


    }

    @Test
    public void nonNullStageTest() throws Exception {
        FakeResourceMetaData fmd = new FakeResourceMetaData();
        fmd.setTestClass(new TestClass(FakeTestClass.class)).setTestMethod(FakeTestClass.class.getMethod("fakeTestMethod"));

        Assert.assertEquals("fakeTestMethod_after", fileNameBuilder.withMetaData(fmd).withStage(When.AFTER).build());
    }
View Full Code Here


    @Test
    public void nonNullTypeTest() throws Exception {
        FakeResourceMetaData fmd = new FakeResourceMetaData();
        fmd
            .setTestClass(new TestClass(FakeTestClass.class))
            .setTestMethod(FakeTestClass.class.getMethod("fakeTestMethod"))
            .setResourceType(FakeResourceType.SOMETYPE);

        Assert.assertEquals("fakeTestMethod_after.type", fileNameBuilder
            .withMetaData(fmd)
View Full Code Here

    }

    @Test
    public void builderIsClearedAfterBuildTest() throws NoSuchMethodException, SecurityException {
        FakeResourceMetaData fmd = new FakeResourceMetaData();
        fmd.setTestClass(new TestClass(FakeTestClass.class)).setTestMethod(FakeTestClass.class.getMethod("fakeTestMethod"));
        fileNameBuilder.withStage(When.AFTER).withMetaData(fmd);

        Assert.assertEquals("fakeTestMethod_after", fileNameBuilder.build());

        // subsequent built is done on cleaned builder so it will produce just UUID
View Full Code Here

        ManagerStarted event, ArquillianDescriptor descriptor) {
            deploymentClass = getDeploymentClass(descriptor);

            executeInClassScope(new Callable<Void>() {
                public Void call() throws Exception {
                    generateDeploymentEvent.fire(new GenerateDeployment(new TestClass(deploymentClass)));
                    suiteDeploymentScenario = classDeploymentScenario.get();
                    return null;
                }
            });
        }
View Full Code Here

        }
    }

    private void doProcess(TestEvent event) {
        Object testCase = event.getTestInstance();
        TestClass testClass = event.getTestClass();
        String testMethodName = event.getTestMethod().getName();

        for (Method m : filterAndOrderMethods(testMethodName, testClass.getMethods(annotationClass))) {
            try {
                m.invoke(testCase, (Object[]) null);
            } catch (Exception e) {
                throw new IllegalStateException("Failed to execute @" + annotationClass.getSimpleName()
                        + " method [" + m + "] - cause: " + e, e);
View Full Code Here

        ManagerStarted event, ArquillianDescriptor descriptor) {
            deploymentClass = getDeploymentClass(descriptor);

            executeInClassScope(new Callable<Void>() {
                public Void call() throws Exception {
                    generateDeploymentEvent.fire(new GenerateDeployment(new TestClass(deploymentClass)));
                    suiteDeploymentScenario = classDeploymentScenario.get();
                    return null;
                }
            });
        }
View Full Code Here

   // Private

   private String createFileName(TestEvent testEvent, String phaseSuffix)
   {
      TestClass testClass = testEvent.getTestClass();
      Method testMethod = testEvent.getTestMethod();
      return String.format(FILENAME_PATTERN, System.currentTimeMillis(), testClass.getName(), testMethod.getName(), phaseSuffix);
   }
View Full Code Here

    /**
     * Adds Warp archive to the protocol archive to make it available for WARs and EARs.
     */
    @Override
    public void process(TestDeployment testDeployment, Archive<?> protocolArchive) {
        final TestClass testClass = this.testClass.get();
        final Archive<?> applicationArchive = testDeployment.getApplicationArchive();

        if (WarpCommons.isWarpTest(testClass.getJavaClass())) {
            if (!Validate.isArchiveOfType(WebArchive.class, protocolArchive)) {
                throw new IllegalArgumentException("Protocol archives of type " + protocolArchive.getClass()
                        + " not supported by Warp. Please use the Servlet 3.0 protocol.");
            }

View Full Code Here

   @Test(expected = IllegalArgumentException.class)
   public void shouldThrowExceptionOnDeploymentNotStatic() throws Exception
   {
      new AnnotationDeploymentScenarioGenerator().generate(
            new TestClass(DeploymentNotStatic.class));
   }
View Full Code Here

   @Test(expected = IllegalArgumentException.class)
   public void shouldThrowExceptionOnDeploymentWrongReturnType() throws Exception
   {
      new AnnotationDeploymentScenarioGenerator().generate(
            new TestClass(DeploymentWrongReturnType.class));
   }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.test.spi.TestClass

Copyright © 2018 www.massapicom. 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.