<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <font face="sans-serif">Hi,<br>
      recently during CDI TCK arquillian migration (</font><font
      face="sans-serif">1.1 branch</font><font face="sans-serif">) we
      had to replace test harness @ExpectedDeploymentException in tests
      expecting deployment failure.<br>
      <br>
      So currently in TCK we use @ShouldThrowException(Exception.class)
      on arquillian deployment method. Indeed testing generic Exception
      is not the best solution but in fact right now we cannot test </font><font
      face="sans-serif">exact deployment cause</font><font
      face="sans-serif"> while there are no standardized CDI </font><font
      face="sans-serif">deployment-related</font><font face="sans-serif">
      exceptions (in CDI 1.1 there will be - see </font><font
      face="sans-serif">CDI-118 Standardize deployment-related exception
      classes</font><font face="sans-serif">). </font><span
      class="entity-name" title="org.jboss.msc.service.StartException"></span><font
      face="sans-serif">Also note that "Adding this annotation will
      force @{@link Deployment} to be testable = false which will force
      @{@link RunAsClient}".</font><br>
    <font face="sans-serif"><br>
      The other possibility is to use something like
      Assert.fail("Deployment should have failed...") or assert false in
      test method. Seam Compatibility and Weld use this approach.<br>
      <br>
      The question is whether to standardize this  among all
      cdi/weld/seam tests. I think we should use the arquillian way (</font><font
      face="sans-serif">@ShouldThrowException</font><font
      face="sans-serif">) while its more obvious that we expect
      deployment failure </font><font face="sans-serif">and use
      relevant expected exceptions as soon as CDI 1.1 arrives.<br>
      <br>
      WDYT?<br>
      <br>
      M<br>
    </font>
    <pre class="moz-signature" cols="72">-- 
Martin Kouba
JBoss Quality Assurance Engineer 
E-mail: <a class="moz-txt-link-abbreviated" href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>
Web: <a class="moz-txt-link-abbreviated" href="http://www.cz.redhat.com">www.cz.redhat.com</a>
Red Hat Czech s.r.o., Purkyòova 99/71, 612 45, Brno, Czech Republic</pre>
  </body>
</html>