Skip to content

Commit

Permalink
ignite-sql-tests - tests
Browse files Browse the repository at this point in the history
  • Loading branch information
S.Vladykin committed Feb 26, 2015
1 parent 566287a commit 8310845
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 25 deletions.
Expand Up @@ -17,10 +17,8 @@

package org.apache.ignite.jdbc;

import org.apache.ignite.IgniteCache;
import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.query.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
Expand Down Expand Up @@ -54,13 +52,17 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);

CacheConfiguration cache = defaultCacheConfiguration();
CacheConfiguration<?,?> cache = defaultCacheConfiguration();

cache.setCacheMode(PARTITIONED);
cache.setBackups(1);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setDistributionMode(NEAR_PARTITIONED);
cache.setAtomicityMode(TRANSACTIONAL);
cache.setIndexedTypes(
String.class, Organization.class,
CacheAffinityKey.class, Person.class
);

cfg.setCacheConfiguration(cache);

Expand Down
Expand Up @@ -119,7 +119,7 @@ public void testSelectNumber() throws Exception {
/**
* @throws Exception If failed.
*/
public void _testSelectString() throws Exception {
public void testSelectString() throws Exception {
ResultSet rs = stmt.executeQuery("select 'str'");

int cnt = 0;
Expand Down
Expand Up @@ -53,6 +53,9 @@ public class JdbcLocalCachesSelfTest extends GridCommonAbstractTest {
cache.setName(CACHE_NAME);
cache.setCacheMode(LOCAL);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setIndexedTypes(
String.class, Integer.class
);

cfg.setCacheConfiguration(cache);

Expand Down
Expand Up @@ -19,8 +19,6 @@

import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.query.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
Expand Down Expand Up @@ -51,11 +49,15 @@ public class JdbcMetadataSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);

CacheConfiguration cache = defaultCacheConfiguration();
CacheConfiguration<?,?> cache = defaultCacheConfiguration();

cache.setCacheMode(PARTITIONED);
cache.setBackups(1);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setIndexedTypes(
String.class, Organization.class,
CacheAffinityKey.class, Person.class
);

cfg.setCacheConfiguration(cache);

Expand Down
Expand Up @@ -18,8 +18,6 @@
package org.apache.ignite.jdbc;

import org.apache.ignite.*;
import org.apache.ignite.cache.query.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.spi.discovery.tcp.*;
Expand Down Expand Up @@ -57,11 +55,14 @@ public class JdbcPreparedStatementSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);

CacheConfiguration cache = defaultCacheConfiguration();
CacheConfiguration<?,?> cache = defaultCacheConfiguration();

cache.setCacheMode(PARTITIONED);
cache.setBackups(1);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setIndexedTypes(
Integer.class, TestObject.class
);

cfg.setCacheConfiguration(cache);

Expand Down
Expand Up @@ -17,9 +17,7 @@

package org.apache.ignite.jdbc;

import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.query.*;
import org.apache.ignite.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.internal.*;
Expand Down Expand Up @@ -64,11 +62,14 @@ public class JdbcResultSetSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);

CacheConfiguration cache = defaultCacheConfiguration();
CacheConfiguration<?,?> cache = defaultCacheConfiguration();

cache.setCacheMode(PARTITIONED);
cache.setBackups(1);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setIndexedTypes(
Integer.class, TestObject.class
);

cfg.setCacheConfiguration(cache);

Expand Down
Expand Up @@ -17,9 +17,7 @@

package org.apache.ignite.jdbc;

import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.query.*;
import org.apache.ignite.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
Expand Down Expand Up @@ -57,11 +55,14 @@ public class JdbcStatementSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);

CacheConfiguration cache = defaultCacheConfiguration();
CacheConfiguration<?,?> cache = defaultCacheConfiguration();

cache.setCacheMode(PARTITIONED);
cache.setBackups(1);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setIndexedTypes(
String.class, Person.class
);

cfg.setCacheConfiguration(cache);

Expand Down
Expand Up @@ -19,8 +19,6 @@

import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.query.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
Expand Down Expand Up @@ -79,12 +77,15 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest {

cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());

CacheConfiguration cacheCfg = defaultCacheConfiguration();
CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();

cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cacheCfg.setSwapEnabled(false);
cacheCfg.setCacheMode(REPLICATED);
cacheCfg.setOffHeapMaxMemory(1024L * 1024L * 1024L);
cacheCfg.setIndexedTypes(
Integer.class, CacheValue.class
);

cfg.setCacheConfiguration(cacheCfg);

Expand Down
Expand Up @@ -120,7 +120,7 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest {

cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());

CacheConfiguration cacheCfg = defaultCacheConfiguration();
CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();

cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setSwapEnabled(true);
Expand All @@ -132,6 +132,9 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest {
cacheCfg.setEvictSynchronizedKeyBufferSize(1);
cacheCfg.setAtomicityMode(TRANSACTIONAL);
cacheCfg.setDistributionMode(NEAR_PARTITIONED);
cacheCfg.setIndexedTypes(
Long.class, Long.class
);

cacheCfg.setEvictionPolicy(null);

Expand Down
Expand Up @@ -58,7 +58,7 @@ public class GridIndexingWithNoopSwapSelfTest extends GridCommonAbstractTest {

c.setSwapSpaceSpi(new NoopSwapSpaceSpi());

CacheConfiguration cc = defaultCacheConfiguration();
CacheConfiguration<?,?> cc = defaultCacheConfiguration();

cc.setCacheMode(PARTITIONED);
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
Expand All @@ -69,6 +69,9 @@ public class GridIndexingWithNoopSwapSelfTest extends GridCommonAbstractTest {
cc.setEvictionPolicy(new CacheFifoEvictionPolicy(1000));
cc.setBackups(1);
cc.setAtomicityMode(TRANSACTIONAL);
cc.setIndexedTypes(
Integer.class, ObjectValue.class
);

c.setCacheConfiguration(cc);

Expand Down
Expand Up @@ -75,6 +75,8 @@ public void testWithStoreLoad() throws Exception {

IgniteCache<Integer, CacheValue> cache0 = grid(0).jcache(null);

cache0.loadCache(null);

checkCache(cache0);
checkQuery(cache0);
}
Expand Down
Expand Up @@ -25,7 +25,6 @@
import org.apache.ignite.internal.processors.cache.query.*;
import org.apache.ignite.internal.processors.query.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.testframework.*;
import org.jetbrains.annotations.*;

Expand Down Expand Up @@ -142,6 +141,14 @@ private static class TestValue2 {
/** */
private static final int ENTRY_CNT = 10000;

/** {@inheritDoc} */
@Override protected Class<?>[] indexedTypes() {
return new Class<?>[] {
Integer.class, TestValue1.class,
Integer.class, TestValue2.class
};
}

/**
* @throws Exception if failed.
*/
Expand Down
6 changes: 6 additions & 0 deletions modules/scalar/src/test/resources/spring-cache.xml
Expand Up @@ -30,6 +30,12 @@
<property name="distributionMode" value="NEAR_PARTITIONED"/>
<property name="writeSynchronizationMode" value="FULL_SYNC"/>
<property name="queryIndexEnabled" value="true"/>
<property name="indexedTypes">
<list>
<value>java.lang.Integer</value>
<value>org.apache.ignite.scalar.tests.ObjectValue</value>
</list>
</property>

<property name="backups" value="1"/>
</bean>
Expand Down

0 comments on commit 8310845

Please sign in to comment.