Search in sources :

Example 1 with IgniteIgnore

use of org.apache.ignite.testsuites.IgniteIgnore in project ignite by apache.

the class GridPartitionedCacheJtaLookupClassNameSelfTest method testUncompatibleTmLookup.

/**
     *
     */
@IgniteIgnore(value = "https://issues.apache.org/jira/browse/IGNITE-1094", forceFailure = true)
public void testUncompatibleTmLookup() {
    final IgniteEx ignite = grid(0);
    final CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    cacheCfg.setName("Foo");
    cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    cacheCfg.setTransactionManagerLookupClassName(TestTmLookup2.class.getName());
    GridTestUtils.assertThrows(log, new Callable<Object>() {

        @Override
        public Object call() throws IgniteException {
            ignite.createCache(cacheCfg);
            return null;
        }
    }, IgniteException.class, null);
}
Also used : IgniteException(org.apache.ignite.IgniteException) IgniteEx(org.apache.ignite.internal.IgniteEx) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) IgniteIgnore(org.apache.ignite.testsuites.IgniteIgnore)

Example 2 with IgniteIgnore

use of org.apache.ignite.testsuites.IgniteIgnore in project ignite by apache.

the class S3CheckpointSpiSelfTest method testSaveWithExpire.

/**
 * @throws Exception Thrown in case of any errors.
 */
@IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
public void testSaveWithExpire() throws Exception {
    // Save states.
    for (int i = 0; i < CHECK_POINT_COUNT; i++) {
        GridCheckpointTestState state = new GridCheckpointTestState("Test check point data " + i + '.');
        getSpi().saveCheckpoint(KEY_PREFIX + i, GridTestIoUtils.serializeJdk(state), 1, true);
    }
    // For small expiration intervals no warranty that state will be removed.
    Thread.sleep(100);
    // Check that states was removed.
    for (int i = 0; i < CHECK_POINT_COUNT; i++) {
        final String key = KEY_PREFIX + i;
        assertWithRetries(new GridAbsClosureX() {

            @Override
            public void applyx() throws IgniteCheckedException {
                assertNull("Checkpoint state should not be loaded with key: " + key, getSpi().loadCheckpoint(key));
            }
        });
    }
}
Also used : GridCheckpointTestState(org.apache.ignite.spi.checkpoint.GridCheckpointTestState) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) GridAbsClosureX(org.apache.ignite.internal.util.lang.GridAbsClosureX) IgniteIgnore(org.apache.ignite.testsuites.IgniteIgnore)

Example 3 with IgniteIgnore

use of org.apache.ignite.testsuites.IgniteIgnore in project ignite by apache.

the class S3SessionCheckpointSelfTest method testS3Checkpoint.

/**
 * @throws Exception If failed.
 */
@IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
public void testS3Checkpoint() throws Exception {
    IgniteConfiguration cfg = getConfiguration();
    S3CheckpointSpi spi = new S3CheckpointSpi();
    AWSCredentials cred = new BasicAWSCredentials(IgniteS3TestSuite.getAccessKey(), IgniteS3TestSuite.getSecretKey());
    spi.setAwsCredentials(cred);
    spi.setBucketNameSuffix(S3CheckpointSpiSelfTest.getBucketNameSuffix());
    cfg.setCheckpointSpi(spi);
    GridSessionCheckpointSelfTest.spi = spi;
    checkCheckpoints(cfg);
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) AWSCredentials(com.amazonaws.auth.AWSCredentials) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) IgniteIgnore(org.apache.ignite.testsuites.IgniteIgnore)

Example 4 with IgniteIgnore

use of org.apache.ignite.testsuites.IgniteIgnore in project ignite by apache.

the class S3CheckpointSpiSelfTest method testSaveLoadRemoveWithoutExpire.

/**
 * @throws Exception Thrown in case of any errors.
 */
@IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
public void testSaveLoadRemoveWithoutExpire() throws Exception {
    String dataPrefix = "Test check point data ";
    // Save states.
    for (int i = 0; i < CHECK_POINT_COUNT; i++) {
        GridCheckpointTestState state = new GridCheckpointTestState(dataPrefix + i);
        getSpi().saveCheckpoint(KEY_PREFIX + i, GridTestIoUtils.serializeJdk(state), 0, true);
    }
    // Load and check states.
    for (int i = 0; i < CHECK_POINT_COUNT; i++) {
        final String key = KEY_PREFIX + i;
        assertWithRetries(new GridAbsClosureX() {

            @Override
            public void applyx() throws IgniteCheckedException {
                assertNotNull("Missing checkpoint: " + key, getSpi().loadCheckpoint(key));
            }
        });
        // Doing it again as pulling value from repeated assertion is tricky,
        // and all assertions below shouldn't be retried in case of failure.
        byte[] serState = getSpi().loadCheckpoint(key);
        GridCheckpointTestState state = GridTestIoUtils.deserializeJdk(serState);
        assertNotNull("Can't load checkpoint state for key: " + key, state);
        assertEquals("Invalid state loaded [expected='" + dataPrefix + i + "', received='" + state.getData() + "']", dataPrefix + i, state.getData());
    }
    // Remove states.
    for (int i = 0; i < CHECK_POINT_COUNT; i++) {
        final String key = KEY_PREFIX + i;
        assertWithRetries(new GridAbsClosureX() {

            @Override
            public void applyx() throws IgniteCheckedException {
                assertTrue(getSpi().removeCheckpoint(key));
            }
        });
    }
    // Check that states was removed.
    for (int i = 0; i < CHECK_POINT_COUNT; i++) {
        final String key = KEY_PREFIX + i;
        assertWithRetries(new GridAbsClosureX() {

            @Override
            public void applyx() throws IgniteCheckedException {
                assertNull(getSpi().loadCheckpoint(key));
            }
        });
    }
}
Also used : GridCheckpointTestState(org.apache.ignite.spi.checkpoint.GridCheckpointTestState) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) GridAbsClosureX(org.apache.ignite.internal.util.lang.GridAbsClosureX) IgniteIgnore(org.apache.ignite.testsuites.IgniteIgnore)

Example 5 with IgniteIgnore

use of org.apache.ignite.testsuites.IgniteIgnore in project ignite by apache.

the class S3CheckpointSpiSelfTest method testDuplicates.

/**
 * @throws Exception Thrown in case of any errors.
 */
@IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
public void testDuplicates() throws Exception {
    int idx1 = 1;
    int idx2 = 2;
    GridCheckpointTestState state1 = new GridCheckpointTestState(Integer.toString(idx1));
    GridCheckpointTestState state2 = new GridCheckpointTestState(Integer.toString(idx2));
    getSpi().saveCheckpoint(KEY_PREFIX, GridTestIoUtils.serializeJdk(state1), 0, true);
    getSpi().saveCheckpoint(KEY_PREFIX, GridTestIoUtils.serializeJdk(state2), 0, true);
    assertWithRetries(new GridAbsClosureX() {

        @Override
        public void applyx() throws IgniteCheckedException {
            assertNotNull(getSpi().loadCheckpoint(KEY_PREFIX));
        }
    });
    byte[] serState = getSpi().loadCheckpoint(KEY_PREFIX);
    GridCheckpointTestState state = GridTestIoUtils.deserializeJdk(serState);
    assertNotNull(state);
    assertEquals(state2, state);
    // Remove.
    getSpi().removeCheckpoint(KEY_PREFIX);
    assertWithRetries(new GridAbsClosureX() {

        @Override
        public void applyx() throws IgniteCheckedException {
            assertNull(getSpi().loadCheckpoint(KEY_PREFIX));
        }
    });
}
Also used : GridCheckpointTestState(org.apache.ignite.spi.checkpoint.GridCheckpointTestState) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) GridAbsClosureX(org.apache.ignite.internal.util.lang.GridAbsClosureX) IgniteIgnore(org.apache.ignite.testsuites.IgniteIgnore)

Aggregations

IgniteIgnore (org.apache.ignite.testsuites.IgniteIgnore)5 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)3 GridAbsClosureX (org.apache.ignite.internal.util.lang.GridAbsClosureX)3 GridCheckpointTestState (org.apache.ignite.spi.checkpoint.GridCheckpointTestState)3 AWSCredentials (com.amazonaws.auth.AWSCredentials)1 BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)1 IgniteException (org.apache.ignite.IgniteException)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1 IgniteEx (org.apache.ignite.internal.IgniteEx)1