{
protocolDefinition = protoReg.getProtocol(
containerRegistry.get().getContainer(description.getTarget()).getDeployableContainer().getDefaultProtocol());
}
Protocol<?> protocol = protocolDefinition.getProtocol();
DeploymentPackager packager = protocol.getPackager();
Archive<?> applicationArchive = description.getArchive();
applyApplicationProcessors(description.getArchive(), testCase);
applyAuxiliaryProcessors(auxiliaryArchives);
try
{
// this should be made more reliable, does not work with e.g. a EnterpriseArchive
if(ClassContainer.class.isInstance(applicationArchive))
{
ClassContainer<?> classContainer = ClassContainer.class.cast(applicationArchive);
classContainer.addClass(testCase.getJavaClass());
}
}
catch (UnsupportedOperationException e)
{
/*
* Quick Fix: https://jira.jboss.org/jira/browse/ARQ-118
* Keep in mind when rewriting for https://jira.jboss.org/jira/browse/ARQ-94
* that a ShrinkWrap archive might not support a Container if even tho the
* ContianerBase implements it. Check the Archive Interface..
*/
}
description.setTestableArchive(
packager.generateDeployment(
new TestDeployment(deployment.getDescription(), applicationArchive, auxiliaryArchives),
serviceLoader.get().all(ProtocolArchiveProcessor.class)));
}
}