Package org.jboss.arquillian.spi

Examples of org.jboss.arquillian.spi.TestResult


        
         Class<?> testClass = SecurityActions.getThreadContextClassLoader().loadClass(className);
        
         TestRunner runner = TestRunners.getTestRunner();
        
         TestResult testResult = runner.execute(testClass, methodName);

         if(OUTPUT_MODE_SERIALIZED.equalsIgnoreCase(outputMode))
         {
            writeObject(testResult, response);
         }
View Full Code Here


      }
   }
  
   private TestResult createFailedResult(Throwable throwable)
   {
      return new TestResult(Status.FAILED, throwable);
   }
View Full Code Here

      Result result = runner.run(
            Request.method(
                  testClass,
                  methodName));
     
      TestResult testResult = convertToTestResult(result);
     
      resetExecutionMode();
     
      return testResult;
   }
View Full Code Here

      return new Statement()
      {
         @Override
         public void evaluate() throws Throwable
         {
            TestResult result = methodExecutor.invoke(new TestMethodExecutor()
            {
               public void invoke() throws Throwable
               {
                  method.invokeExplosively(test);
               }
              
               public Method getMethod()
               {
                  return method.getMethod();
               }
              
               public Object getInstance()
               {
                  return test;
               }
            });
            if(result.getThrowable() != null)
            {
               throw result.getThrowable();
            }
         }
      };
   }
View Full Code Here

        
         Class<?> testClass = SecurityActions.getThreadContextClassLoader().loadClass(className);
        
         TestRunner runner = TestRunners.getTestRunner();
        
         TestResult testResult = runner.execute(testClass, methodName);

         if(OUTPUT_MODE_SERIALIZED.equalsIgnoreCase(outputMode))
         {
            writeObject(testResult, response);
         }
View Full Code Here

      }
   }
  
   private TestResult createFailedResult(Throwable throwable)
   {
      return new TestResult(Status.FAILED, throwable);
   }
View Full Code Here

      /* (non-Javadoc)
       * @see org.jboss.arquillian.spi.ContainerMethodExecutor#invoke(org.jboss.arquillian.spi.TestMethodExecutor)
       */
      public TestResult invoke(TestMethodExecutor testMethodExecutor)
      {
         TestResult result = new TestResult();
         try
         {
            testMethodExecutor.invoke();
            result.setStatus(Status.PASSED);
         }
         catch (final Throwable e)
         {
            result.setStatus(Status.FAILED);
            result.setThrowable(e);
         }
         return result;
      }
View Full Code Here

   /* (non-Javadoc)
    * @see org.jboss.arquillian.spi.event.suite.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
    */
   public void callback(Context context, Test event) throws Exception
   {
      TestResult result = new TestResult();
      try
      {
         event.getTestMethodExecutor().invoke();
         result.setStatus(Status.PASSED);
      }
      catch (Throwable e)
      {
         result.setStatus(Status.FAILED);
         result.setThrowable(e);
      }
      result.setEnd(System.currentTimeMillis());
      context.add(TestResult.class, result);
   }
View Full Code Here

      }
      if (result.getIgnoreCount() > 0)
      {
         status = Status.SKIPPED;
      }
      return new TestResult(status, throwable);
   }
View Full Code Here

      return new Statement()
      {
         @Override
         public void evaluate() throws Throwable
         {
            TestResult result = deployableTest.get().test(new TestMethodExecutor()
            {
               public void invoke() throws Throwable
               {
                  try
                  {
                     Object parameterValues = TestEnrichers.enrich(deployableTest.get().getActiveContext(), getMethod());
                     method.invokeExplosively(test, (Object[])parameterValues);
                  }
                  catch (Throwable e)
                  {
                     // Force a way to return the thrown Exception from the Container the client.
                     caughtTestException.set(e);
                     throw e;
                  }
               }

               public Method getMethod()
               {
                  return method.getMethod();
               }

               public Object getInstance()
               {
                  return test;
               }
            });
            if(result.getThrowable() != null)
            {
               throw result.getThrowable();
            }
         }
      };
   }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.spi.TestResult

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.