Search in sources :

Example 86 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class ConfigVariationsTestSuiteBuilderTest method testIgniteConfigFilter.

/**
 * @throws Exception If failed.
 */
@SuppressWarnings("serial")
public void testIgniteConfigFilter() throws Exception {
    TestSuite dfltSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class).build();
    final AtomicInteger cnt = new AtomicInteger();
    TestSuite filteredSuite = new ConfigVariationsTestSuiteBuilder("testSuite", NoopTest.class).withIgniteConfigFilters(new IgnitePredicate<IgniteConfiguration>() {

        @Override
        public boolean apply(IgniteConfiguration configuration) {
            return cnt.getAndIncrement() % 2 == 0;
        }
    }).build();
    assertEquals(dfltSuite.countTestCases() / 2, filteredSuite.countTestCases());
}
Also used : ConfigVariationsTestSuiteBuilder(org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder) TestSuite(junit.framework.TestSuite) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IgnitePredicate(org.apache.ignite.lang.IgnitePredicate)

Example 87 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class IgniteCacheThreadLocalTxTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
    cfg.setClientMode(client);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 88 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest method testLoopbackEndpointsRegistration.

/**
 * @throws Exception If failed.
 */
public void testLoopbackEndpointsRegistration() throws Exception {
    IgniteConfiguration cfg = gridConfiguration();
    cfg.setFileSystemConfiguration(igfsConfiguration(IgfsIpcEndpointType.TCP, IgfsIpcEndpointConfiguration.DFLT_PORT, null));
    G.start(cfg);
    T2<Integer, Integer> res = checkRegisteredIpcEndpoints();
    // One regular enpoint + one management endpoint.
    assertEquals(2, res.get1().intValue());
    assertEquals(0, res.get2().intValue());
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 89 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class IgfsServerManagerIpcEndpointRegistrationOnLinuxAndMacSelfTest method testLoopbackAndShmemEndpointsRegistration.

/**
 * @throws Exception If failed.
 */
public void testLoopbackAndShmemEndpointsRegistration() throws Exception {
    IgniteConfiguration cfg = gridConfigurationManyIgfsCaches(3);
    cfg.setFileSystemConfiguration(// Check null IPC endpoint config won't bring any hassles.
    igfsConfiguration(null, null, null, "partitioned0", "replicated0"), igfsConfiguration(IgfsIpcEndpointType.TCP, IgfsIpcEndpointConfiguration.DFLT_PORT + 1, null, "partitioned1", "replicated1"), igfsConfiguration(IgfsIpcEndpointType.SHMEM, IgfsIpcEndpointConfiguration.DFLT_PORT + 2, null, "partitioned2", "replicated2"));
    G.start(cfg);
    T2<Integer, Integer> res = checkRegisteredIpcEndpoints();
    // 1 regular + 3 management TCP endpoins.
    assertEquals(4, res.get1().intValue());
    assertEquals(2, res.get2().intValue());
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 90 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class IgniteCacheQueryH2IndexingLeakTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Aggregations

IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)2118 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)686 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)404 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)385 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)363 Ignite (org.apache.ignite.Ignite)194 Test (org.junit.Test)182 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)161 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)127 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)123 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)105 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)98 IgniteEx (org.apache.ignite.internal.IgniteEx)95 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)89 IgniteException (org.apache.ignite.IgniteException)78 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)75 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)72 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)68 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)65 ArrayList (java.util.ArrayList)55