1 Reply Latest reply on Sep 8, 2015 7:32 AM by manarh

    Seam unit test

    vata2999

      Hi manarh,

       

      I want to create a seam unit test for my project without starting Arquillian container as follow

       

      public class UnitTest extends JUnitSeamTest
      {
      
          
          @Test
          public void testReadEntityClassFromTypeParameter()
          {
              try
              {
                 new ComponentTest() {
                  
                  @Override
                  protected void testComponents() throws Exception
                  {
                      
                       Manager.instance().isLongRunningConversation(); // this is ok
                       ProjectProgressCalculator ppc = (ProjectProgressCalculator) getInstance("projectProgressCalculator"); // resolves to null
                       setValue("#{projectProgressCalculator.projectId}", 551L); 
                       System.out.println(getValue("#{projectProgressCalculator.projectId}")); // returns null
                  }
              }.run();
              }
              catch (Exception e)
              {
                  e.printStackTrace();
              }
          }
          
      }
      

       

      is there any way to do so ?