PHOENIX-2573 Pherf It test fails
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/22d82576 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/22d82576 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/22d82576 Branch: refs/heads/4.x-HBase-0.98 Commit: 22d82576690399694cb7696bfd0e62c5a37119f5 Parents: 8d67908 Author: Cody Marcel <cody.mar...@gmail.com> Authored: Thu Jan 7 12:19:02 2016 -0800 Committer: Cody Marcel <cmar...@salesforce.com> Committed: Thu Jan 7 13:23:09 2016 -0800 ---------------------------------------------------------------------- .../it/java/org/apache/phoenix/pherf/DataIngestIT.java | 2 -- .../java/org/apache/phoenix/pherf/SchemaReaderIT.java | 12 +++++++----- .../java/org/apache/phoenix/pherf/util/PhoenixUtil.java | 8 +------- .../src/test/resources/datamodel/test_schema.sql | 4 ++-- 4 files changed, 10 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/22d82576/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java ---------------------------------------------------------------------- diff --git a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java index fced730..cb137ee 100644 --- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java +++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java @@ -62,7 +62,6 @@ public class DataIngestIT extends ResultBaseTestIT { } @Test - @Ignore("Until PHOENIX-2573 is fixed") public void testColumnRulesApplied() { Scenario scenario = null; @@ -115,7 +114,6 @@ public class DataIngestIT extends ResultBaseTestIT { } @Test - @Ignore("Until PHOENIX-2573 is fixed") public void testRWWorkload() throws Exception { Connection connection = util.getConnection(); http://git-wip-us.apache.org/repos/asf/phoenix/blob/22d82576/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java ---------------------------------------------------------------------- diff --git a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java index 7b4de79..4ff1fb5 100644 --- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java +++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java @@ -26,6 +26,7 @@ import java.net.URL; import java.nio.file.Path; import java.nio.file.Paths; import java.sql.Connection; +import java.sql.SQLException; import java.util.ArrayList; import java.util.List; @@ -36,14 +37,12 @@ import org.apache.phoenix.pherf.configuration.Scenario; import org.apache.phoenix.pherf.configuration.XMLConfigParser; import org.apache.phoenix.pherf.schema.SchemaReader; import org.apache.phoenix.pherf.util.PhoenixUtil; -import org.junit.Ignore; import org.junit.Test; public class SchemaReaderIT extends BaseHBaseManagedTimeIT { protected static PhoenixUtil util = PhoenixUtil.create(true); @Test - @Ignore("Until PHOENIX-2573 is fixed") public void testSchemaReader() { // Test for the unit test version of the schema files. assertApplySchemaTest(); @@ -57,10 +56,13 @@ public class SchemaReaderIT extends BaseHBaseManagedTimeIT { List<Path> resources = new ArrayList<>(reader.getResourceList()); assertTrue("Could not pull list of schema files.", resources.size() > 0); assertNotNull("Could not read schema file.", this.getClass().getResourceAsStream( - PherfConstants.RESOURCE_DATAMODEL + "/" + resources.get(0).getFileName() - .toString())); + PherfConstants.RESOURCE_DATAMODEL + "/" + resources.get(0).getFileName().toString())); assertNotNull("Could not read schema file.", reader.resourceToString(resources.get(0))); - reader.applySchema(); + try { + reader.applySchema(); + } catch (SQLException e) { + fail("Failed to apply schema " + e.getMessage()); + } Connection connection = null; URL resourceUrl = getClass().getResource("/scenario/test_scenario.xml"); http://git-wip-us.apache.org/repos/asf/phoenix/blob/22d82576/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java ---------------------------------------------------------------------- diff --git a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java index b778833..df18544 100644 --- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java +++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java @@ -147,19 +147,13 @@ public class PhoenixUtil { return result; } - public boolean executeStatement(String sql, Connection connection) { + public boolean executeStatement(String sql, Connection connection) throws SQLException{ boolean result = false; PreparedStatement preparedStatement = null; try { preparedStatement = connection.prepareStatement(sql); result = preparedStatement.execute(); connection.commit(); - } catch (SQLException e) { - e.printStackTrace(); - if(preparedStatement != null) { - logger.error("Failed to apply schema. Statement (" + preparedStatement.toString() + ")", - e.getMessage()); - } } finally { try { if (preparedStatement != null) { http://git-wip-us.apache.org/repos/asf/phoenix/blob/22d82576/phoenix-pherf/src/test/resources/datamodel/test_schema.sql ---------------------------------------------------------------------- diff --git a/phoenix-pherf/src/test/resources/datamodel/test_schema.sql b/phoenix-pherf/src/test/resources/datamodel/test_schema.sql index 8e0da1e..21034d9 100644 --- a/phoenix-pherf/src/test/resources/datamodel/test_schema.sql +++ b/phoenix-pherf/src/test/resources/datamodel/test_schema.sql @@ -19,8 +19,8 @@ CREATE TABLE IF NOT EXISTS PHERF.TEST_TABLE ( TENANT_ID CHAR(15) NOT NULL, PARENT_ID CHAR(15) NOT NULL, CREATED_DATE DATE NOT NULL, - NOW_DATE DATE NOT NULL, - PRESENT_DATE NOT NULL, + NOW_DATE DATE, + PRESENT_DATE DATE, OTHER_ID CHAR(15), FIELD VARCHAR, OLDVAL_STRING VARCHAR,