}
public static TestRunnerAdaptor build(ContainerProfile profileType)
{
ServiceLoader serviceLoader = new DynamicServiceLoader();
ManagerBuilder builder = ManagerBuilder.from()
.context(SuiteContextImpl.class)
.context(ClassContextImpl.class)
.context(TestContextImpl.class)
.context(ContainerContextImpl.class)
.context(DeploymentContextImpl.class);
List<Profile> profiles = new ArrayList<Profile>();
profiles.add(new ArquillianProfile());
profiles.addAll(serviceLoader.all(Profile.class));
//Profile profile = serviceLoader.onlyOne(Profile.class, ArquillianProfile.class);
for(Profile profile : profiles)
{
switch (profileType)
{
case CLIENT :
builder.extensions(profile.getClientProfile().toArray(new Class<?>[0]));
break;
case CONTAINER :
builder.extensions(profile.getContainerProfile().toArray(new Class<?>[0]));
break;
}
}
return new EventTestRunnerAdaptor(builder.create());
}