Search in sources :

Example 6 with GridStringLogger

use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.

the class JdbcThinConnectionMvccEnabledSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings({ "deprecation", "unchecked" })
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME).setNearConfiguration(null));
    cfg.setMarshaller(new BinaryMarshaller());
    cfg.setGridLogger(new GridStringLogger());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) GridStringLogger(org.apache.ignite.testframework.GridStringLogger)

Example 7 with GridStringLogger

use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.

the class JdbcThinConnectionSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("deprecation")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME));
    cfg.setMarshaller(new BinaryMarshaller());
    cfg.setGridLogger(new GridStringLogger());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) GridStringLogger(org.apache.ignite.testframework.GridStringLogger)

Example 8 with GridStringLogger

use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.

the class JdbcThinTransactionsWithMvccEnabledSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings({ "deprecation", "unchecked" })
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME).setNearConfiguration(null));
    cfg.setMarshaller(new BinaryMarshaller());
    cfg.setGridLogger(log = new GridStringLogger());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) GridStringLogger(org.apache.ignite.testframework.GridStringLogger)

Example 9 with GridStringLogger

use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.

the class ClientConfigurationTest method testRebalanceThreadPoolSize.

/**
 * Test check the case when {@link IgniteConfiguration#getRebalanceThreadPoolSize()} is equal to {@link
 * IgniteConfiguration#getSystemThreadPoolSize()}
 */
@Test
public void testRebalanceThreadPoolSize() {
    GridStringLogger gridStrLog = new GridStringLogger();
    gridStrLog.logLength(1024 * 100);
    IgniteConfiguration cci = Config.getServerConfiguration().setClientMode(true);
    cci.setRebalanceThreadPoolSize(cci.getSystemThreadPoolSize());
    cci.setGridLogger(gridStrLog);
    try (Ignite si = Ignition.start(Config.getServerConfiguration());
        Ignite ci = Ignition.start(cci)) {
        Set<ClusterNode> collect = si.cluster().nodes().stream().filter(new Predicate<ClusterNode>() {

            @Override
            public boolean test(ClusterNode clusterNode) {
                return clusterNode.isClient();
            }
        }).collect(Collectors.toSet());
        String log = gridStrLog.toString();
        boolean containsMsg = log.contains("Setting the rebalance pool size has no effect on the client mode");
        Assert.assertTrue(containsMsg);
        Assert.assertEquals(1, collect.size());
    }
}
Also used : ClusterNode(org.apache.ignite.cluster.ClusterNode) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) GridStringLogger(org.apache.ignite.testframework.GridStringLogger) Ignite(org.apache.ignite.Ignite) Predicate(java.util.function.Predicate) Test(org.junit.Test)

Example 10 with GridStringLogger

use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.

the class GridNoopManagerSelfTest method testEnabledManager.

/**
 */
@Test
public void testEnabledManager() throws IgniteCheckedException {
    GridTestKernalContext ctx = new GridTestKernalContext(new GridStringLogger());
    assertTrue(new Manager(ctx, new Spi()).enabled());
    assertFalse(new Manager(ctx, new NoopSpi()).enabled());
    assertTrue(new Manager(ctx, new Spi(), new NoopSpi()).enabled());
    assertTrue(new Manager(ctx, new NoopSpi(), new Spi()).enabled());
}
Also used : GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) GridStringLogger(org.apache.ignite.testframework.GridStringLogger) IgniteSpi(org.apache.ignite.spi.IgniteSpi) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

GridStringLogger (org.apache.ignite.testframework.GridStringLogger)37 Ignite (org.apache.ignite.Ignite)22 Test (org.junit.Test)16 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)14 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)9 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)9 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)9 UUID (java.util.UUID)7 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)7 Transaction (org.apache.ignite.transactions.Transaction)5 URLClassLoader (java.net.URLClassLoader)4 IgniteCache (org.apache.ignite.IgniteCache)4 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)4 ClusterNode (org.apache.ignite.cluster.ClusterNode)2 IgniteEx (org.apache.ignite.internal.IgniteEx)2 IgniteInternalFuture (org.apache.ignite.internal.IgniteInternalFuture)2 IgniteClusterEx (org.apache.ignite.internal.cluster.IgniteClusterEx)2 GridTestLog4jLogger (org.apache.ignite.testframework.junits.logger.GridTestLog4jLogger)2 File (java.io.File)1 Callable (java.util.concurrent.Callable)1