Skip to content

Commit

Permalink
test: Fix DatabaseMetadataTest to perform mview tests only on 9.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
sehrope committed Nov 14, 2021
1 parent 7d2a21e commit b24cb16
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -18,6 +18,7 @@

import org.junit.After;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -82,7 +83,6 @@ public void setUp() throws Exception {
TestUtil.createTable(con, "arraytable", "a numeric(5,2)[], b varchar(100)[]");
TestUtil.createTable(con, "intarraytable", "a int4[], b int4[][]");
TestUtil.createView(con, "viewtest", "SELECT id, quest FROM metadatatest");
TestUtil.createMaterializedView(con, "matviewtest", "SELECT id, quest FROM metadatatest");
TestUtil.dropType(con, "custom");
TestUtil.dropType(con, "_custom");
TestUtil.createCompositeType(con, "custom", "i int", false);
Expand Down Expand Up @@ -145,7 +145,6 @@ public void tearDown() throws Exception {
TestUtil.dropTable(con, "duplicate");

TestUtil.dropView(con, "viewtest");
TestUtil.dropMaterializedView(con, "matviewtest");
TestUtil.dropTable(con, "metadatatest");
TestUtil.dropTable(con, "sercoltest");
TestUtil.dropSequence(con, "sercoltest_b_seq");
Expand Down Expand Up @@ -670,7 +669,13 @@ public void testViewPrivileges() throws SQLException {

@Test
public void testMaterializedViewPrivileges() throws SQLException {
relationPrivilegesHelper("matviewtest");
Assume.assumeTrue(TestUtil.haveMinimumServerVersion(con, ServerVersion.v9_3));
TestUtil.createMaterializedView(con, "matviewtest", "SELECT id, quest FROM metadatatest");
try {
relationPrivilegesHelper("matviewtest");
} finally {
TestUtil.dropMaterializedView(con, "matviewtest");
}
}

@Test
Expand Down

0 comments on commit b24cb16

Please sign in to comment.