我很高兴宣布JBoss JCA项目的第7个开发者快照。
完整的发布说明在此:这里。
ShrinkWrap支持
本版本增加了通过嵌入式配置部署ShrinkWrap存档的支持。这将允许您快速为测试用例构建资源适配器,而无需在磁盘上有物理表示。
ShrinkWrap非常易于使用
import org.jboss.shrinkwrap.api.Archives;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
/**
* Basic ShrinkWrap ResourceAdapterArchive test case
* @exception Throwable Thrown if case of an error
*/
@Test
public void testBasic() throws Throwable
{
ResourceAdapterArchive raa =
Archives.create(UUID.randomUUID().toString() + ".rar", ResourceAdapterArchive.class);
JavaArchive ja = Archives.create(UUID.randomUUID().toString() + ".jar", JavaArchive.class);
ja.addClasses(MessageListener.class, TestActivationSpec.class, TestConnection.class,
TestConnectionFactory.class, TestConnectionManager.class,
TestConnectionInterface.class, TestManagedConnection.class,
TestManagedConnectionFactory.class, TestResourceAdapter.class);
raa.addLibrary(ja);
raa.addManifestResource("simple.rar/META-INF/ra.xml", "ra.xml");
try
{
embedded.deploy(raa);
}
catch (Throwable t)
{
log.error(t.getMessage(), t);
fail(t.getMessage());
}
finally
{
embedded.undeploy(raa);
}
}
您可以在我们的测试用例中看到一个使用ShrinkWrap的完整示例: org.jboss.jca.test.embedded.unit.ShrinkWrapTestCase
。
部署验证器
本版本还增加了一个部署验证器,用于验证资源适配器类的规范要求。
验证器将输出哪些要求尚未实现,例如
Severity: ERROR Section: 19.4.2 Description: A ResourceAdapter must implement a "public int hashCode()" method. Code: com.mycompany.myproject.ResourceAdapterImpl Severity: ERROR Section: 19.4.2 Description: A ResourceAdapter must implement a "public boolean equals(Object)" method. Code: com.mycompany.myproject.ResourceAdapterImpl
这将给资源适配器开发者一个机会,将其实施与规范进行更高程度的验证。验证器当然可以根据您的需求进行配置。
我们将继续在未来版本中添加新规则,并提供报告的XML表示形式以供工具处理。请随时在我们的论坛上帮助我们完成这些任务。
未来之路
由于本月的EE6已经发布,我们将专注于接近完整的实现。
向即将摇滚的人致敬!