EmailBean.lifecycle.clear();
AppModule app = new AppModule(this.getClass().getClassLoader(), "testapp");
Connector connector = new Connector("email-ra");
ResourceAdapter adapter = connector.setResourceAdapter(new ResourceAdapter(EmailResourceAdapter.class));
InboundResource inbound = adapter.setInboundResourceAdapter(new InboundResource());
MessageAdapter messageAdapter = inbound.setMessageAdapter(new MessageAdapter());
MessageListener listener = messageAdapter.addMessageListener(new MessageListener(EmailConsumer.class, EmailAccountInfo.class));
listener.getActivationSpec().addRequiredConfigProperty("address");
app.getResourceModules().add(new ConnectorModule(connector));