Package org.agoncal.book.javaee7.chapter02.ex23

Source Code of org.agoncal.book.javaee7.chapter02.ex23.CustomerService23IT

package org.agoncal.book.javaee7.chapter02.ex23;

import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

/**
* @author Antonio Goncalves
*         APress Book - Beginning Java EE 7 with Glassfish 4
*         http://www.apress.com/
*         http://www.antoniogoncalves.org
*         --
*/
public class CustomerService23IT {

  // ======================================
  // =             Attributes             =
  // ======================================

  protected static Weld weld;
  protected static WeldContainer container;

  // ======================================
  // =          Lifecycle Methods         =
  // ======================================

  @BeforeClass
  public static void init() {
    weld = new Weld();
    container = weld.initialize();
  }

  @AfterClass
  public static void close() {
    weld.shutdown();
  }

  // ======================================
  // =              Methods               =
  // ======================================

  @Test
  public void shouldSeeInterceptor() throws Exception {
    CustomerService23 customerService = container.instance().select(CustomerService23.class).get();
    customerService.createCustomer(new Customer23());
  }
}
TOP

Related Classes of org.agoncal.book.javaee7.chapter02.ex23.CustomerService23IT

TOP
Copyright © 2018 www.massapi.com. 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.