use of com.sun.enterprise.config.serverbeans.Applications in project Payara by payara.
the class CollectionsAccessTest method semiProtectedTest.
@Test(expected = TransactionFailure.class)
public void semiProtectedTest() throws TransactionFailure {
final Applications apps = getHabitat().getService(Applications.class);
assertTrue(apps != null);
ConfigSupport.apply(new SingleConfigCode<Applications>() {
public Object run(Applications param) throws PropertyVetoException, TransactionFailure {
// this is the bug, we should not get the list from apps but from param.
List<ApplicationName> modules = apps.getModules();
Application m = param.createChild(Application.class);
// should throw an exception
modules.add(m);
return m;
}
}, apps);
}
use of com.sun.enterprise.config.serverbeans.Applications in project Payara by payara.
the class CollectionsAccessTest method protectedTest.
@Test
public void protectedTest() throws TransactionFailure {
final Applications apps = getHabitat().getService(Applications.class);
assertTrue(apps != null);
ConfigSupport.apply(new SingleConfigCode<Applications>() {
public Object run(Applications param) throws PropertyVetoException, TransactionFailure {
List<ApplicationName> modules = param.getModules();
Application m = param.createChild(Application.class);
m.setName("ejb-test");
m.setLocation("test-location");
m.setObjectType("ejb");
modules.add(m);
modules.remove(m);
return m;
}
}, apps);
}
use of com.sun.enterprise.config.serverbeans.Applications in project Payara by payara.
the class ModulesTest method setup.
@Before
public void setup() {
Applications apps = getHabitat().getService(Applications.class);
assertTrue(apps != null);
modules = apps.getModules();
assertTrue(modules != null);
}
Aggregations