You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by sa...@apache.org on 2016/04/12 21:20:42 UTC
phoenix git commit: PHOENIX-2822 Addendum to fix failing tests (Rahul
Gidwani)
Repository: phoenix
Updated Branches:
refs/heads/master bbcdd2a34 -> 0490484b0
PHOENIX-2822 Addendum to fix failing tests (Rahul Gidwani)
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/0490484b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/0490484b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/0490484b
Branch: refs/heads/master
Commit: 0490484b022fd8218e52d6d72858192ef3c59441
Parents: bbcdd2a
Author: Samarth <sa...@salesforce.com>
Authored: Tue Apr 12 12:20:34 2016 -0700
Committer: Samarth <sa...@salesforce.com>
Committed: Tue Apr 12 12:20:34 2016 -0700
----------------------------------------------------------------------
.../BaseHBaseManagedTimeTableReuseIT.java | 4 +-
.../end2end/HBaseManagedTimeTableReuseTest.java | 49 ++++++++++++++++++++
.../phoenix/end2end/HBaseManagedTimeTest.java | 4 +-
.../phoenix/end2end/LikeExpressionIT.java | 14 +++---
pom.xml | 18 +++++++
5 files changed, 80 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/0490484b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeTableReuseIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeTableReuseIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeTableReuseIT.java
index 8d9fff9..26c2f3c 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeTableReuseIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeTableReuseIT.java
@@ -30,7 +30,7 @@ import java.util.concurrent.locks.ReentrantLock;
* @since 0.1
*/
@NotThreadSafe
-@Category(HBaseManagedTimeTest.class)
+@Category(HBaseManagedTimeTableReuseTest.class)
public class BaseHBaseManagedTimeTableReuseIT extends BaseTest {
protected static Configuration getTestClusterConfig() {
@@ -46,6 +46,8 @@ public class BaseHBaseManagedTimeTableReuseIT extends BaseTest {
@AfterClass
public static void doTeardown() throws Exception {
// no teardown since we are creating unique table names
+ // just destroy our test driver
+ destroyDriver();
}
@After
http://git-wip-us.apache.org/repos/asf/phoenix/blob/0490484b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTableReuseTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTableReuseTest.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTableReuseTest.java
new file mode 100644
index 0000000..c36a8f4
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTableReuseTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ *distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you maynot use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicablelaw or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.phoenix.query.BaseTest;
+
+/**
+ *
+ * Annotation to denote that the test lets HBase manage timestamp
+ * itself. Tests in these category do not drop HBase tables at
+ * the end of every test class. To prevent table name collisions that could happen otherwise,
+ * these tests use random table names generated by {@link BaseTest#generateRandomString}.
+ *
+ * Tests using a mini cluster need to be classified either
+ * as {@link HBaseManagedTimeTableReuseTest} or {@link ClientManagedTimeTest}
+ * or {@link NeedsOwnMiniClusterTest} or {@link HBaseManagedTimeTest} otherwise they won't be run
+ * when one runs mvn verify or mvn install.
+ *
+ * @since 4.1
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Inherited
+public @interface HBaseManagedTimeTableReuseTest {
+
+}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/0490484b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTest.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTest.java
index 31cc00b..8ffb8d3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTest.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HBaseManagedTimeTest.java
@@ -32,8 +32,8 @@ import java.lang.annotation.Target;
*
* Tests using a mini cluster need to be classified either
* as {@link HBaseManagedTimeTest} or {@link ClientManagedTimeTest}
- * or {@link NeedsOwnMiniClusterTest} otherwise they won't be run
- * when one runs mvn verify or mvn install.
+ * or {@link NeedsOwnMiniClusterTest} or {@link HBaseManagedTimeTableReuseTest}
+ * otherwise they won't be run when one runs mvn verify or mvn install.
*
* @since 4.1
*/
http://git-wip-us.apache.org/repos/asf/phoenix/blob/0490484b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LikeExpressionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LikeExpressionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LikeExpressionIT.java
index 00a6a64..6f056a7 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LikeExpressionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LikeExpressionIT.java
@@ -33,7 +33,7 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-public class LikeExpressionIT extends BaseHBaseManagedTimeIT {
+public class LikeExpressionIT extends BaseHBaseManagedTimeTableReuseIT {
private static final String TEST_TABLE = generateRandomString();
@@ -135,14 +135,16 @@ public class LikeExpressionIT extends BaseHBaseManagedTimeIT {
@Test
public void testLikeWithEscapenLParen() throws Exception {
Connection conn = DriverManager.getConnection(getUrl());
- String ddl = "CREATE TABLE t (k VARCHAR, v VARCHAR, CONSTRAINT pk PRIMARY KEY (k))";
+ String t = generateRandomString();
+ String ddl = "CREATE TABLE " + t + " (k VARCHAR, v VARCHAR, CONSTRAINT pk PRIMARY KEY (k))";
conn.createStatement().execute(ddl);
- conn.createStatement().execute("UPSERT INTO t VALUES('aa','bb')");
- conn.createStatement().execute("UPSERT INTO t VALUES('a\\(d','xx')");
- conn.createStatement().execute("UPSERT INTO t VALUES('dd',null)");
+ conn.createStatement().execute("UPSERT INTO " + t + " VALUES('aa','bb')");
+ conn.createStatement().execute("UPSERT INTO " + t + " VALUES('a\\(d','xx')");
+ conn.createStatement().execute("UPSERT INTO " + t + " VALUES('dd',null)");
conn.commit();
- ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t WHERE k not like '%\\(%'");
+ ResultSet rs = conn.createStatement().executeQuery(
+ "SELECT * FROM " + t + " WHERE k not like '%\\(%'");
assertTrue(rs.next());
assertEquals("aa", rs.getString(1));
assertEquals("bb", rs.getString(2));
http://git-wip-us.apache.org/repos/asf/phoenix/blob/0490484b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 389dcc0..469e279 100644
--- a/pom.xml
+++ b/pom.xml
@@ -283,6 +283,24 @@
<goal>verify</goal>
</goals>
</execution>
+ <execution>
+ <id>HBaseManagedTimeTableReuseTest</id>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <forkCount>${numForkedIT}</forkCount>
+ <runOrder>alphabetical</runOrder>
+ <reuseForks>true</reuseForks>
+ <argLine>-enableassertions -Xmx2000m -XX:MaxPermSize=128m -Djava.security.egd=file:/dev/./urandom "-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"</argLine>
+ <redirectTestOutputToFile>${test.output.tofile}</redirectTestOutputToFile>
+ <testSourceDirectory>${basedir}/src/it/java</testSourceDirectory>
+ <groups>org.apache.phoenix.end2end.HBaseManagedTimeTest</groups>
+ <shutdown>kill</shutdown>
+ </configuration>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
<execution>
<id>NeedTheirOwnClusterTests</id>
<configuration>