aslak

Arquillian + SeamForge + AutoDiscovery of created types

Oct 23rd, 2010
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.09 KB | None | 0 0
  1.    ____                          _____                    
  2.   / ___|  ___  __ _ _ __ ___    |  ___|__  _ __ __ _  ___
  3.   \___ \ / _ \/ _` | '_ ` _ \   | |_ / _ \| '__/ _` |/ _ \  \\
  4.    ___) |  __/ (_| | | | | | |  |  _| (_) | | | (_| |  __/  //
  5.   |____/ \___|\__,_|_| |_| |_|  |_|  \___/|_|  \__, |\___|
  6.                                                 |___/      
  7.  
  8. [forge-parent] seam-forge/ $
  9. [forge-parent] seam-forge/ $ new-project --named test --topLevelPackage com.test
  10. Use [/home/aslak/dev/source/seam/seam-forge/test] as project directory? [Y/n]
  11. Wrote /home/aslak/dev/source/seam/seam-forge/test/pom.xml
  12. Wrote /home/aslak/dev/source/seam/seam-forge/test/src/main/java/com/test/HelloWorld.java
  13. Wrote /home/aslak/dev/source/seam/seam-forge/test/src/main/resources/META-INF/forge.xml
  14. ***SUCCESS*** Created project [test] in new working directory [/home/aslak/dev/source/seam/seam-forge/test]
  15. [test] test/ $ install arquillian
  16. Which version of Arquillian would you like to install?
  17.  
  18.   1 - [1.0.0.Alpha1]
  19.   2 - [1.0.0.Alpha2]
  20.   3 - [1.0.0.Alpha3]
  21.   4 - [1.0.0.Alpha4]
  22.  
  23. Choose an option by typing the number of the selection: 4
  24. Which test framework would you like to use?
  25.  
  26.   1 - [JUnit]
  27.   2 - [TestNG]
  28.  
  29. Choose an option by typing the number of the selection: 1
  30. Installation completed successfully.
  31. [test] test/ $ new-ejb --named ResourceService
  32. What type of Enterprise Java Bean would you like to create?
  33.  
  34.   1 - [Stateless]
  35.   2 - [Stateful]
  36.   3 - [MessageDriven]
  37.  
  38. Choose an option by typing the number of the selection: 1
  39. In which package you'd like to create the @Stateless bean, or enter for default: [com.test.service]
  40. Wrote /home/aslak/dev/source/seam/seam-forge/test/src/main/java/com/test/service/ResourceService.java
  41. Created [Stateless] Enterprise Java Bean [ResourceService]
  42. A Enterprise Java Bean was just created. Would you like to create a test for [ResourceService] [Y/n]
  43. What would you like to call the test case? [ResourceServiceTestCase]
  44. Wrote /home/aslak/dev/source/seam/seam-forge/test/src/test/java/com/test/service/ResourceServiceTestCase.java
  45. [test] test/ $ exit
  46. $ cat /home/aslak/dev/source/seam/seam-forge/test/src/main/java/com/test/service/ResourceService.java
  47. package com.test.service;
  48.  
  49. import javax.ejb.Stateless;
  50.  
  51. @Stateless
  52. public class ResourceService
  53. {
  54. }
  55.  
  56. $ cat /home/aslak/dev/source/seam/seam-forge/test/src/test/java/com/test/service/ResourceServiceTestCase.java
  57. package com.test.service;
  58.  
  59. import org.junit.runner.RunWith;
  60. import org.jboss.arquillian.junit.Arquillian;
  61. import org.jboss.shrinkwrap.api.ShrinkWrap;
  62. import org.jboss.shrinkwrap.api.spec.JavaArchive;
  63. import com.test.service.ResourceService;
  64. import org.jboss.arquillian.api.Deployment;
  65. import javax.ejb.EJB;
  66. import org.junit.Test;
  67.  
  68. @RunWith(Arquillian.class)
  69. public class ResourceServiceTestCase
  70. {
  71.   @Deployment
  72.   public Archive createDeployment()
  73.   {
  74.      return ShrinkWrap.create(JavaArchive.class, "test.jar").addClass(ResourceService.class);
  75.   }
  76.  
  77.   @EJB
  78.   private ResourceService resourceservice;
  79.  
  80.   @Test
  81.   public void shouldBeAbleToInvokeResourceService()
  82.   {
  83.   }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment