Search in sources :

Example 11 with Applications

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);
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) TransactionFailure(org.jvnet.hk2.config.TransactionFailure) Applications(com.sun.enterprise.config.serverbeans.Applications) List(java.util.List) Application(com.sun.enterprise.config.serverbeans.Application) Test(org.junit.Test)

Example 12 with Applications

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);
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) TransactionFailure(org.jvnet.hk2.config.TransactionFailure) Applications(com.sun.enterprise.config.serverbeans.Applications) List(java.util.List) Application(com.sun.enterprise.config.serverbeans.Application) Test(org.junit.Test)

Example 13 with Applications

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);
}
Also used : Applications(com.sun.enterprise.config.serverbeans.Applications) Before(org.junit.Before)

Aggregations

Applications (com.sun.enterprise.config.serverbeans.Applications)13 Application (com.sun.enterprise.config.serverbeans.Application)6 ApplicationInfo (org.glassfish.internal.data.ApplicationInfo)4 Test (org.junit.Test)4 ApplicationRef (com.sun.enterprise.config.serverbeans.ApplicationRef)3 Application (com.sun.enterprise.deployment.Application)3 ConfigBeansUtilities (com.sun.enterprise.config.serverbeans.ConfigBeansUtilities)2 PropertyVetoException (java.beans.PropertyVetoException)2 File (java.io.File)2 List (java.util.List)2 ApplicationRegistry (org.glassfish.internal.data.ApplicationRegistry)2 WebappClassLoader (org.glassfish.web.loader.WebappClassLoader)2 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)2 Cluster (com.sun.enterprise.config.serverbeans.Cluster)1 Domain (com.sun.enterprise.config.serverbeans.Domain)1 Module (com.sun.enterprise.config.serverbeans.Module)1 Server (com.sun.enterprise.config.serverbeans.Server)1 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)1 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)1 JMSDestinationDefinitionDescriptor (com.sun.enterprise.deployment.JMSDestinationDefinitionDescriptor)1