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 2018/01/10 09:45:00 UTC

[jira] [Updated] (IGNITE-7370) Drop test tables in each test case in H2DynamicTableSelfTest

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

Kirill Shirokov updated IGNITE-7370:
------------------------------------
    Description: 
Failing test cases are leaving tables they've created which in turn causes subsequent test cases to report false failures, e.g. when the latter test case tries to create a table with the same name.

It would be great for such tables tables to run down curtain and join the choir invisible in finally clause; an example:

{noformat}
    public void testInternalCreateExistingTable() throws Exception {
+               try {
                    execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
                        " \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) " +
                        "template=\"cache\"");

                    GridTestUtils.assertThrows(null, new Callable<Object>() {
                        @Override public Object call() throws Exception {
                            execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar" +
                                ", \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) " +
                                "template=\"cache\"");

                            return null;
                        }
                    }, IgniteSQLException.class, "Table already exists: Person");
+               }
+               finally {
+                   execute("DROP TABLE \"Person\"");
+               }
...
{noformat}

  was:
Failing test cases are leaving tables they've created which in turn causes subsequent test cases to report false failures, e.g. when latter test tries to create a table with the same name.

It would be great for such tables tables to run down curtain and join the choir invisible in finally clause; an example:

{noformat}
    public void testInternalCreateExistingTable() throws Exception {
+               try {
                    execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
                        " \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) " +
                        "template=\"cache\"");

                    GridTestUtils.assertThrows(null, new Callable<Object>() {
                        @Override public Object call() throws Exception {
                            execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar" +
                                ", \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) " +
                                "template=\"cache\"");

                            return null;
                        }
                    }, IgniteSQLException.class, "Table already exists: Person");
+               }
+               finally {
+                   execute("DROP TABLE \"Person\"");
+               }
...
{noformat}


> Drop test tables in each test case in H2DynamicTableSelfTest
> ------------------------------------------------------------
>
>                 Key: IGNITE-7370
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7370
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Kirill Shirokov
>            Priority: Minor
>
> Failing test cases are leaving tables they've created which in turn causes subsequent test cases to report false failures, e.g. when the latter test case tries to create a table with the same name.
> It would be great for such tables tables to run down curtain and join the choir invisible in finally clause; an example:
> {noformat}
>     public void testInternalCreateExistingTable() throws Exception {
> +               try {
>                     execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
>                         " \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) " +
>                         "template=\"cache\"");
>                     GridTestUtils.assertThrows(null, new Callable<Object>() {
>                         @Override public Object call() throws Exception {
>                             execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar" +
>                                 ", \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) " +
>                                 "template=\"cache\"");
>                             return null;
>                         }
>                     }, IgniteSQLException.class, "Table already exists: Person");
> +               }
> +               finally {
> +                   execute("DROP TABLE \"Person\"");
> +               }
> ...
> {noformat}



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