ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [8/9] ignite git commit: Fix for C++ tests.
Date Wed, 31 Aug 2016 03:40:12 GMT
Fix for C++ tests.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/31dbc5d6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/31dbc5d6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/31dbc5d6

Branch: refs/heads/master
Commit: 31dbc5d65f8ea51010d2129e7c6e9a27acbf8528
Parents: 4a259da
Author: isapego <isapego@gridgain.com>
Authored: Tue Aug 30 17:28:34 2016 +0300
Committer: isapego <isapego@gridgain.com>
Committed: Tue Aug 30 17:28:34 2016 +0300

----------------------------------------------------------------------
 .../odbc-test/config/queries-test-noodbc.xml    | 48 +++++++--------
 .../cpp/odbc-test/config/queries-test.xml       | 50 +++++++--------
 .../cpp/odbc-test/project/vs/odbc-test.vcxproj  |  1 +
 .../project/vs/odbc-test.vcxproj.filters        |  3 +
 .../cpp/odbc-test/src/queries_test.cpp          | 64 +++-----------------
 .../odbc-test/src/sql_test_suite_fixture.cpp    | 14 ++---
 6 files changed, 68 insertions(+), 112 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/31dbc5d6/modules/platforms/cpp/odbc-test/config/queries-test-noodbc.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/config/queries-test-noodbc.xml b/modules/platforms/cpp/odbc-test/config/queries-test-noodbc.xml
index 18447c2..db19669 100644
--- a/modules/platforms/cpp/odbc-test/config/queries-test-noodbc.xml
+++ b/modules/platforms/cpp/odbc-test/config/queries-test-noodbc.xml
@@ -28,6 +28,7 @@
     <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
         <property name="localHost" value="127.0.0.1"/>
         <property name="connectorConfiguration"><null/></property>
+        <property name="odbcConfiguration"><null/></property>
 
         <property name="cacheConfiguration">
             <list>
@@ -38,14 +39,14 @@
                     <property name="writeSynchronizationMode" value="FULL_SYNC"/>
 
                     <!-- Configure type metadata to enable queries. -->
-					<property name="queryEntities">
-						<list>
-							<bean class="org.apache.ignite.cache.QueryEntity">
-								<property name="keyType" value="java.lang.Long"/>
-								<property name="valueType" value="TestType"/>
+                    <property name="queryEntities">
+                        <list>
+                            <bean class="org.apache.ignite.cache.QueryEntity">
+                                <property name="keyType" value="java.lang.Long"/>
+                                <property name="valueType" value="TestType"/>
 
-								<property name="fields">
-									<map>
+                                <property name="fields">
+                                    <map>
                                         <entry key="i8Field" value="java.lang.Byte"/>
                                         <entry key="i16Field" value="java.lang.Short"/>
                                         <entry key="i32Field" value="java.lang.Integer"/>
@@ -57,22 +58,22 @@
                                         <entry key="guidField" value="java.util.UUID"/>
                                         <entry key="dateField" value="java.util.Date"/>
                                         <entry key="timestampField" value="java.sql.Timestamp"/>
-									</map>
-								</property>
+                                    </map>
+                                </property>
 
-								<property name="indexes">
-									<list>
-										<bean class="org.apache.ignite.cache.QueryIndex">
-											<constructor-arg value="i32Field"/>
-										</bean>
-										<bean class="org.apache.ignite.cache.QueryIndex">
-											<constructor-arg value="i64Field"/>
-										</bean>
-									</list>
-								</property>
-							</bean>
-						</list>
-					</property>
+                                <property name="indexes">
+                                    <list>
+                                        <bean class="org.apache.ignite.cache.QueryIndex">
+                                            <constructor-arg value="i32Field"/>
+                                        </bean>
+                                        <bean class="org.apache.ignite.cache.QueryIndex">
+                                            <constructor-arg value="i64Field"/>
+                                        </bean>
+                                    </list>
+                                </property>
+                            </bean>
+                        </list>
+                    </property>
                 </bean>
             </list>
         </property>
@@ -86,8 +87,7 @@
                         instead os static IP based discovery.
                     -->
                     <!-- Uncomment static IP finder to enable static-based discovery of
initial nodes. -->
-                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                         <property name="addresses">
                             <list>
                                 <!-- In distributed environment, replace with actual host
IP address. -->

http://git-wip-us.apache.org/repos/asf/ignite/blob/31dbc5d6/modules/platforms/cpp/odbc-test/config/queries-test.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/config/queries-test.xml b/modules/platforms/cpp/odbc-test/config/queries-test.xml
index 54cb9be..26e6341 100644
--- a/modules/platforms/cpp/odbc-test/config/queries-test.xml
+++ b/modules/platforms/cpp/odbc-test/config/queries-test.xml
@@ -32,8 +32,8 @@
         <!-- Enabling ODBC. -->
         <property name="odbcConfiguration">
             <bean class="org.apache.ignite.configuration.OdbcConfiguration">
-				<property name="endpointAddress" value="127.0.0.1:11110"/>
-			</bean>
+                <property name="endpointAddress" value="127.0.0.1:11110"/>
+            </bean>
         </property>
 
         <property name="cacheConfiguration">
@@ -43,16 +43,16 @@
                     <property name="cacheMode" value="PARTITIONED"/>
                     <property name="atomicityMode" value="TRANSACTIONAL"/>
                     <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-            
+
                     <!-- Configure type metadata to enable queries. -->
-					<property name="queryEntities">
-						<list>
-							<bean class="org.apache.ignite.cache.QueryEntity">
-								<property name="keyType" value="java.lang.Long"/>
-								<property name="valueType" value="TestType"/>
+                    <property name="queryEntities">
+                        <list>
+                            <bean class="org.apache.ignite.cache.QueryEntity">
+                                <property name="keyType" value="java.lang.Long"/>
+                                <property name="valueType" value="TestType"/>
 
-								<property name="fields">
-									<map>
+                                <property name="fields">
+                                    <map>
                                         <entry key="i8Field" value="java.lang.Byte"/>
                                         <entry key="i16Field" value="java.lang.Short"/>
                                         <entry key="i32Field" value="java.lang.Integer"/>
@@ -64,22 +64,22 @@
                                         <entry key="guidField" value="java.util.UUID"/>
                                         <entry key="dateField" value="java.util.Date"/>
                                         <entry key="timestampField" value="java.sql.Timestamp"/>
-									</map>
-								</property>
+                                    </map>
+                                </property>
 
-								<property name="indexes">
-									<list>
-										<bean class="org.apache.ignite.cache.QueryIndex">
-											<constructor-arg value="i32Field"/>
-										</bean>
-										<bean class="org.apache.ignite.cache.QueryIndex">
-											<constructor-arg value="i64Field"/>
-										</bean>
-									</list>
-								</property>
-							</bean>
-						</list>
-					</property>
+                                <property name="indexes">
+                                    <list>
+                                        <bean class="org.apache.ignite.cache.QueryIndex">
+                                            <constructor-arg value="i32Field"/>
+                                        </bean>
+                                        <bean class="org.apache.ignite.cache.QueryIndex">
+                                            <constructor-arg value="i64Field"/>
+                                        </bean>
+                                    </list>
+                                </property>
+                            </bean>
+                        </list>
+                    </property>
                 </bean>
             </list>
         </property>

http://git-wip-us.apache.org/repos/asf/ignite/blob/31dbc5d6/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj b/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj
index 0702047..cb5735f 100644
--- a/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj
+++ b/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj
@@ -203,6 +203,7 @@
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
+    <None Include="..\..\config\queries-test-noodbc.xml" />
     <None Include="..\..\config\queries-test.xml" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/31dbc5d6/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters b/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters
index 0a72640..270bdd6 100644
--- a/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters
+++ b/modules/platforms/cpp/odbc-test/project/vs/odbc-test.vcxproj.filters
@@ -125,5 +125,8 @@
     <None Include="..\..\config\queries-test.xml">
       <Filter>Configs</Filter>
     </None>
+    <None Include="..\..\config\queries-test-noodbc.xml">
+      <Filter>Configs</Filter>
+    </None>
   </ItemGroup>
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/31dbc5d6/modules/platforms/cpp/odbc-test/src/queries_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/queries_test.cpp b/modules/platforms/cpp/odbc-test/src/queries_test.cpp
index ab59952..c907772 100644
--- a/modules/platforms/cpp/odbc-test/src/queries_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/queries_test.cpp
@@ -60,35 +60,6 @@ struct QueriesTestSuiteFixture
      */
     void Connect(const std::string& connectStr)
     {
-        IgniteConfiguration cfg;
-
-        cfg.jvmOpts.push_back("-Xdebug");
-        cfg.jvmOpts.push_back("-Xnoagent");
-        cfg.jvmOpts.push_back("-Djava.compiler=NONE");
-        cfg.jvmOpts.push_back("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
-        cfg.jvmOpts.push_back("-XX:+HeapDumpOnOutOfMemoryError");
-
-#ifdef IGNITE_TESTS_32
-        cfg.jvmInitMem = 256;
-        cfg.jvmMaxMem = 768;
-#else
-        cfg.jvmInitMem = 1024;
-        cfg.jvmMaxMem = 4096;
-#endif
-
-        char* cfgPath = getenv("IGNITE_NATIVE_TEST_ODBC_CONFIG_PATH");
-
-        cfg.springCfgPath = std::string(cfgPath).append("/").append("queries-test.xml");
-
-        IgniteError err;
-
-        grid = Ignition::Start(cfg, &err);
-
-        if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
-            BOOST_FAIL(err.GetText());
-
-        testCache = grid.GetCache<int64_t, TestType>("cache");
-
         // Allocate an environment handle
         SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
 
@@ -141,7 +112,7 @@ struct QueriesTestSuiteFixture
         SQLFreeHandle(SQL_HANDLE_ENV, env);
     }
 
-    static Ignite StartAdditionalNode(const char* name)
+    static Ignite StartNode(const char* name, const char* config)
     {
         IgniteConfiguration cfg;
 
@@ -163,43 +134,24 @@ struct QueriesTestSuiteFixture
 
         BOOST_REQUIRE(cfgPath != 0);
 
-        cfg.springCfgPath.assign(cfgPath).append("/queries-test.xml");
+        cfg.springCfgPath.assign(cfgPath).append("/").append(config);
 
         IgniteError err;
 
         return Ignition::Start(cfg, name);
     }
 
+    static Ignite StartAdditionalNode(const char* name)
+    {
+        return StartNode(name, "queries-test-noodbc.xml");
+    }
+
     /**
      * Constructor.
      */
     QueriesTestSuiteFixture() : testCache(0), env(NULL), dbc(NULL), stmt(NULL)
     {
-        IgniteConfiguration cfg;
-
-        cfg.jvmOpts.push_back("-Xdebug");
-        cfg.jvmOpts.push_back("-Xnoagent");
-        cfg.jvmOpts.push_back("-Djava.compiler=NONE");
-        cfg.jvmOpts.push_back("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
-        cfg.jvmOpts.push_back("-XX:+HeapDumpOnOutOfMemoryError");
-
-#ifdef IGNITE_TESTS_32
-        cfg.jvmInitMem = 256;
-        cfg.jvmMaxMem = 768;
-#else
-        cfg.jvmInitMem = 1024;
-        cfg.jvmMaxMem = 4096;
-#endif
-
-        char* cfgPath = getenv("IGNITE_NATIVE_TEST_ODBC_CONFIG_PATH");
-
-        BOOST_REQUIRE(cfgPath != 0);
-
-        cfg.springCfgPath.assign(cfgPath).append("/queries-test.xml");
-
-        IgniteError err;
-
-        grid = Ignition::Start(cfg, "NodeMain");
+        grid = StartNode("NodeMain", "queries-test.xml");
 
         testCache = grid.GetCache<int64_t, TestType>("cache");
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/31dbc5d6/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp b/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
index 16e5ea0..69b4bfa 100644
--- a/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
+++ b/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
@@ -45,7 +45,7 @@ namespace ignite
 
         char* cfgPath = getenv("IGNITE_NATIVE_TEST_ODBC_CONFIG_PATH");
 
-        BOOST_REQUIRE(cfgPath != 0) ;
+        BOOST_REQUIRE(cfgPath != 0);
 
         cfg.springCfgPath.assign(cfgPath).append("/queries-test.xml");
 
@@ -54,14 +54,14 @@ namespace ignite
         grid = Ignition::Start(cfg, &err);
 
         if (err.GetCode() != IgniteError::IGNITE_SUCCESS)
-        BOOST_FAIL(err.GetText()) ;
+            BOOST_FAIL(err.GetText()) ;
 
         testCache = grid.GetCache<int64_t, TestType>("cache");
 
         // Allocate an environment handle
         SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
 
-        BOOST_REQUIRE(env != NULL) ;
+        BOOST_REQUIRE(env != NULL);
 
         // We want ODBC 3 support
         SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, reinterpret_cast<void*>(SQL_OV_ODBC3),
0);
@@ -69,10 +69,10 @@ namespace ignite
         // Allocate a connection handle
         SQLAllocHandle(SQL_HANDLE_DBC, env, &dbc);
 
-        BOOST_REQUIRE(dbc != NULL) ;
+        BOOST_REQUIRE(dbc != NULL);
 
         // Connect string
-        SQLCHAR connectStr[] = "DRIVER={Apache Ignite};SERVER=localhost;PORT=10800;CACHE=cache";
+        SQLCHAR connectStr[] = "DRIVER={Apache Ignite};ADDRESS=127.0.0.1:11110;CACHE=cache";
 
         SQLCHAR outstr[ODBC_BUFFER_SIZE];
         SQLSMALLINT outstrlen;
@@ -85,13 +85,13 @@ namespace ignite
         {
             Ignition::Stop(grid.GetName(), true);
 
-            BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_DBC, dbc)) ;
+            BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_DBC, dbc));
         }
 
         // Allocate a statement handle
         SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt);
 
-        BOOST_REQUIRE(stmt != NULL) ;
+        BOOST_REQUIRE(stmt != NULL);
     }
 
     SqlTestSuiteFixture::~SqlTestSuiteFixture()


Mime
View raw message