Search in sources :

Example 6 with DummyService

use of org.apache.ignite.internal.processors.service.DummyService in project ignite by apache.

the class SqlViewExporterSpiTest method testServices.

/**
 */
@Test
public void testServices() throws Exception {
    ServiceConfiguration srvcCfg = new ServiceConfiguration();
    srvcCfg.setName("service");
    srvcCfg.setMaxPerNodeCount(1);
    srvcCfg.setService(new DummyService());
    ignite0.services().deploy(srvcCfg);
    List<List<?>> srvs = execute(ignite0, "SELECT " + "  NAME, " + "  SERVICE_ID, " + "  SERVICE_CLASS, " + "  TOTAL_COUNT, " + "  MAX_PER_NODE_COUNT, " + "  CACHE_NAME, " + "  AFFINITY_KEY, " + "  NODE_FILTER, " + "  STATICALLY_CONFIGURED, " + "  ORIGIN_NODE_ID " + "FROM SYS.SERVICES");
    assertEquals(ignite0.context().service().serviceDescriptors().size(), srvs.size());
    List<?> sysView = srvs.iterator().next();
    assertEquals(srvcCfg.getName(), sysView.get(0));
    assertEquals(DummyService.class.getName(), sysView.get(2));
    assertEquals(srvcCfg.getMaxPerNodeCount(), sysView.get(4));
}
Also used : ServiceConfiguration(org.apache.ignite.services.ServiceConfiguration) DummyService(org.apache.ignite.internal.processors.service.DummyService) Arrays.asList(java.util.Arrays.asList) List(java.util.List) ArrayList(java.util.ArrayList) AbstractExporterSpiTest(org.apache.ignite.internal.metric.AbstractExporterSpiTest) Test(org.junit.Test)

Aggregations

DummyService (org.apache.ignite.internal.processors.service.DummyService)6 Test (org.junit.Test)6 Ignite (org.apache.ignite.Ignite)3 ServiceConfiguration (org.apache.ignite.services.ServiceConfiguration)3 ArrayList (java.util.ArrayList)2 Arrays.asList (java.util.Arrays.asList)2 List (java.util.List)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 IgniteServices (org.apache.ignite.IgniteServices)2 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 CompositeData (javax.management.openmbean.CompositeData)1 TabularDataSupport (javax.management.openmbean.TabularDataSupport)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 ClusterGroup (org.apache.ignite.cluster.ClusterGroup)1 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1 CommandList (org.apache.ignite.internal.commandline.CommandList)1 AbstractExporterSpiTest (org.apache.ignite.internal.metric.AbstractExporterSpiTest)1 CAX (org.apache.ignite.internal.util.typedef.CAX)1 CIX1 (org.apache.ignite.internal.util.typedef.CIX1)1