You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Kirill Shirokov (JIRA)" <ji...@apache.org> on 2017/11/28 14:12:00 UTC

[jira] [Updated] (IGNITE-7046) Client queries should throw a correct exception

     [ https://issues.apache.org/jira/browse/IGNITE-7046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kirill Shirokov updated IGNITE-7046:
------------------------------------
    Description: 
The following test being added to org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedQuerySelfTest:

{{    /**
     * Method verifies that in the case of client query index is not used and a correct exception is thrown.
     *
     * @throws Exception If failed.
     */
    public void testClientOnlyNodeIndexException() throws Exception {
        try {
            Ignite g = startGrid("client");

            IgniteCache<Integer, Integer> c = jcache(g, Integer.class, Integer.class);

            try {
                List<List<?>> cres = c.query(new SqlFieldsQuery("select count(*) from Integer")
                    .setLocal(true)).getAll();
            } 
            catch (IgniteException e) {
                throw e; // FIXME: put an exception-checking code here instead of throw
            }
        }
        finally {
            stopGrid("client");
        }
    }}}

...will result in NPE instead of an Ignite exception explaining the appropriate cause.

  was:
The following test being added to org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedQuerySelfTest:

    /**
     * Method verifies that in the case of client query index is not used and a correct exception is thrown.
     *
     * @throws Exception If failed.
     */
    public void testClientOnlyNodeIndexException() throws Exception {
        try {
            Ignite g = startGrid("client");

            IgniteCache<Integer, Integer> c = jcache(g, Integer.class, Integer.class);

            try {
                List<List<?>> cres = c.query(new SqlFieldsQuery("select count(*) from Integer")
                    .setLocal(true)).getAll();
            } 
            catch (IgniteException e) {
                throw e; // FIXME: put an exception-checking code here instead of throw
            }
        }
        finally {
            stopGrid("client");
        }
    }

...will result in NPE instead of an Ignite exception explaining the appropriate cause.


> Client queries should throw a correct exception
> -----------------------------------------------
>
>                 Key: IGNITE-7046
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7046
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.3
>            Reporter: Kirill Shirokov
>
> The following test being added to org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedQuerySelfTest:
> {{    /**
>      * Method verifies that in the case of client query index is not used and a correct exception is thrown.
>      *
>      * @throws Exception If failed.
>      */
>     public void testClientOnlyNodeIndexException() throws Exception {
>         try {
>             Ignite g = startGrid("client");
>             IgniteCache<Integer, Integer> c = jcache(g, Integer.class, Integer.class);
>             try {
>                 List<List<?>> cres = c.query(new SqlFieldsQuery("select count(*) from Integer")
>                     .setLocal(true)).getAll();
>             } 
>             catch (IgniteException e) {
>                 throw e; // FIXME: put an exception-checking code here instead of throw
>             }
>         }
>         finally {
>             stopGrid("client");
>         }
>     }}}
> ...will result in NPE instead of an Ignite exception explaining the appropriate cause.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)