Search in sources :

Example 1 with JBossEJBProperties

use of org.jboss.ejb.client.legacy.JBossEJBProperties in project wildfly by wildfly.

the class CommandDispatcherTestCase method test.

@Test
public void test() throws Exception {
    JBossEJBProperties properties = JBossEJBProperties.fromClassPath(CommandDispatcherTestCase.class.getClassLoader(), CLIENT_PROPERTIES);
    properties.runCallable(() -> {
        try (EJBDirectory directory = new RemoteEJBDirectory(MODULE_NAME)) {
            ClusterTopologyRetriever bean = directory.lookupStateless(ClusterTopologyRetrieverBean.class, ClusterTopologyRetriever.class);
            ClusterTopology topology = bean.getClusterTopology();
            assertEquals(1, topology.getNodes().size());
            assertTrue(topology.getNodes().toString(), topology.getNodes().contains(NODE_1));
            assertTrue(topology.getRemoteNodes().toString() + " should be empty", topology.getRemoteNodes().isEmpty());
        }
        return null;
    });
}
Also used : JBossEJBProperties(org.jboss.ejb.client.legacy.JBossEJBProperties) ClusterTopologyRetriever(org.jboss.as.test.clustering.cluster.dispatcher.bean.ClusterTopologyRetriever) RemoteEJBDirectory(org.jboss.as.test.clustering.ejb.RemoteEJBDirectory) ClusterTopology(org.jboss.as.test.clustering.cluster.dispatcher.bean.ClusterTopology) EJBDirectory(org.jboss.as.test.clustering.ejb.EJBDirectory) RemoteEJBDirectory(org.jboss.as.test.clustering.ejb.RemoteEJBDirectory) Test(org.junit.Test)

Example 2 with JBossEJBProperties

use of org.jboss.ejb.client.legacy.JBossEJBProperties in project wildfly by wildfly.

the class ServiceProviderRegistrationTestCase method test.

@Test
public void test() throws Exception {
    JBossEJBProperties properties = JBossEJBProperties.fromClassPath(ServiceProviderRegistrationTestCase.class.getClassLoader(), CLIENT_PROPERTIES);
    properties.runCallable(() -> {
        try (EJBDirectory directory = new RemoteEJBDirectory(MODULE_NAME)) {
            ServiceProviderRetriever bean = directory.lookupStateless(ServiceProviderRetrieverBean.class, ServiceProviderRetriever.class);
            Collection<String> names = bean.getProviders();
            assertEquals(1, names.size());
            assertTrue(names.toString(), names.contains(NODE_1));
        }
        return null;
    });
}
Also used : JBossEJBProperties(org.jboss.ejb.client.legacy.JBossEJBProperties) ServiceProviderRetriever(org.jboss.as.test.clustering.cluster.provider.bean.ServiceProviderRetriever) RemoteEJBDirectory(org.jboss.as.test.clustering.ejb.RemoteEJBDirectory) EJBDirectory(org.jboss.as.test.clustering.ejb.EJBDirectory) RemoteEJBDirectory(org.jboss.as.test.clustering.ejb.RemoteEJBDirectory) Test(org.junit.Test)

Example 3 with JBossEJBProperties

use of org.jboss.ejb.client.legacy.JBossEJBProperties in project wildfly by wildfly.

the class RegistryTestCase method test.

@Test
public void test() throws Exception {
    JBossEJBProperties properties = JBossEJBProperties.fromClassPath(RegistryTestCase.class.getClassLoader(), CLIENT_PROPERTIES);
    properties.runCallable(() -> {
        try (EJBDirectory context = new RemoteEJBDirectory(MODULE_NAME)) {
            RegistryRetriever bean = context.lookupStateless(RegistryRetrieverBean.class, RegistryRetriever.class);
            Collection<String> names = bean.getNodes();
            assertEquals(1, names.size());
            assertTrue(names.toString(), names.contains(NODE_1));
        }
        return null;
    });
}
Also used : JBossEJBProperties(org.jboss.ejb.client.legacy.JBossEJBProperties) RemoteEJBDirectory(org.jboss.as.test.clustering.ejb.RemoteEJBDirectory) RegistryRetriever(org.jboss.as.test.clustering.cluster.registry.bean.RegistryRetriever) EJBDirectory(org.jboss.as.test.clustering.ejb.EJBDirectory) RemoteEJBDirectory(org.jboss.as.test.clustering.ejb.RemoteEJBDirectory) Test(org.junit.Test)

Aggregations

EJBDirectory (org.jboss.as.test.clustering.ejb.EJBDirectory)3 RemoteEJBDirectory (org.jboss.as.test.clustering.ejb.RemoteEJBDirectory)3 JBossEJBProperties (org.jboss.ejb.client.legacy.JBossEJBProperties)3 Test (org.junit.Test)3 ClusterTopology (org.jboss.as.test.clustering.cluster.dispatcher.bean.ClusterTopology)1 ClusterTopologyRetriever (org.jboss.as.test.clustering.cluster.dispatcher.bean.ClusterTopologyRetriever)1 ServiceProviderRetriever (org.jboss.as.test.clustering.cluster.provider.bean.ServiceProviderRetriever)1 RegistryRetriever (org.jboss.as.test.clustering.cluster.registry.bean.RegistryRetriever)1