Search in sources :

Example 1 with ConfigVariationsTestSuiteBuilder

use of org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder in project ignite by apache.

the class IgniteComputeBasicConfigVariationsFullApiTestSuite method suite.

/**
     * @return Compute API test suite.
     * @throws Exception If failed.
     */
public static TestSuite suite() throws Exception {
    TestSuite suite = new TestSuite("Compute New Full API Test Suite");
    suite.addTest(new ConfigVariationsTestSuiteBuilder("Single server", IgniteComputeConfigVariationsFullApiTest.class).igniteParams(BASIC_COMPUTE_SET).gridsCount(1).build());
    // Tests run on server (node#0) & client(node#1).
    suite.addTest(new ConfigVariationsTestSuiteBuilder("3 servers, 1 client", IgniteComputeConfigVariationsFullApiTest.class).igniteParams(BASIC_COMPUTE_SET).gridsCount(4).testedNodesCount(2).withClients().build());
    return suite;
}
Also used : ConfigVariationsTestSuiteBuilder(org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder) TestSuite(junit.framework.TestSuite)

Example 2 with ConfigVariationsTestSuiteBuilder

use of org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder 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 3 with ConfigVariationsTestSuiteBuilder

use of org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder in project ignite by apache.

the class ConfigVariationsTestSuiteBuilderTest method testCacheConfigFilter.

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

        @Override
        public boolean apply(CacheConfiguration 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) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IgnitePredicate(org.apache.ignite.lang.IgnitePredicate) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 4 with ConfigVariationsTestSuiteBuilder

use of org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder in project ignite by apache.

the class IgniteMessagingConfigVariationFullApiTestSuite method suite.

/**
     * @return Messaging test suite.
     * @throws Exception If failed.
     */
public static TestSuite suite() throws Exception {
    TestSuite suite = new TestSuite("Compute New Full API Test Suite");
    suite.addTest(new ConfigVariationsTestSuiteBuilder("Single server", IgniteMessagingConfigVariationFullApiTest.class).gridsCount(1).igniteParams(GRID_PARAMETER_VARIATION).build());
    suite.addTest(new ConfigVariationsTestSuiteBuilder("Multiple servers and client", IgniteMessagingConfigVariationFullApiTest.class).testedNodesCount(2).gridsCount(6).withClients().igniteParams(GRID_PARAMETER_VARIATION).build());
    return suite;
}
Also used : ConfigVariationsTestSuiteBuilder(org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder) TestSuite(junit.framework.TestSuite)

Example 5 with ConfigVariationsTestSuiteBuilder

use of org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder in project ignite by apache.

the class IgniteServiceConfigVariationsFullApiTestSuite method suite.

/**
     * @return Compute API test suite.
     * @throws Exception If failed.
     */
public static TestSuite suite() throws Exception {
    TestSuite suite = new TestSuite("Service Deployment New Full API Test Suite");
    suite.addTest(new ConfigVariationsTestSuiteBuilder("Single server", IgniteServiceConfigVariationsFullApiTest.class).igniteParams(PARAMS).gridsCount(1).build());
    // Tests run on server (node#0) & client(node#1).
    suite.addTest(new ConfigVariationsTestSuiteBuilder("1 server, 1 client", IgniteServiceConfigVariationsFullApiTest.class).igniteParams(PARAMS).gridsCount(2).testedNodesCount(2).withClients().build());
    // Tests run on servers (node#0,node#2,node#3) & client(node#1).
    suite.addTest(new ConfigVariationsTestSuiteBuilder("3 servers, 1 client", IgniteServiceConfigVariationsFullApiTest.class).igniteParams(PARAMS).gridsCount(4).testedNodesCount(2).withClients().build());
    // Tests run on servers (node#0,node#2,node#3) & client(node#1,node#4).
    suite.addTest(new ConfigVariationsTestSuiteBuilder("3 servers, 2 clients", IgniteServiceConfigVariationsFullApiTest.class).igniteParams(PARAMS).gridsCount(5).testedNodesCount(2).withClients().build());
    return suite;
}
Also used : ConfigVariationsTestSuiteBuilder(org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder) TestSuite(junit.framework.TestSuite)

Aggregations

TestSuite (junit.framework.TestSuite)8 ConfigVariationsTestSuiteBuilder (org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder)8 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)2 IgnitePredicate (org.apache.ignite.lang.IgnitePredicate)2 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)1 CacheContinuousQueryVariationsTest (org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryVariationsTest)1