asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Remove Test Classes From Production Binaries
Date Wed, 01 Jun 2016 20:02:40 GMT
Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/901

Change subject: Remove Test Classes From Production Binaries
......................................................................

Remove Test Classes From Production Binaries

Change-Id: I1da72566e7d140a1fb965c893dcea6881b99ca26
---
M asterixdb/asterix-app/pom.xml
M asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta/change-feed-with-meta-pk-in-meta.1.ddl.aql
M asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed/change-feed.1.ddl.aql
R asterixdb/asterix-common/src/test/java/org/apache/asterix/test/base/AsterixTestHelper.java
M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/ParserFactoryProvider.java
M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
R asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/RecordWithPKTestReaderFactory.java
R asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/TestAsterixMembersReader.java
R asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/kv/KVTestReader.java
R asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/kv/KVTestReaderFactory.java
R asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
R asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java
M asterixdb/asterix-installer/src/test/resources/transactionts/queries/query_after_restart/dataset-with-meta-record/dataset-with-meta-record.2.ddl.aql
M asterixdb/asterix-tools/pom.xml
M asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/test/AdmDataGenTest.java
R asterixdb/asterix-transactions/src/test/java/org/apache/asterix/transaction/management/service/locking/TestRuntimeContextProvider.java
17 files changed, 25 insertions(+), 19 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/01/901/1

diff --git a/asterixdb/asterix-app/pom.xml b/asterixdb/asterix-app/pom.xml
index 3b5025b..9b71a7b 100644
--- a/asterixdb/asterix-app/pom.xml
+++ b/asterixdb/asterix-app/pom.xml
@@ -229,6 +229,13 @@
     </dependency>
     <dependency>
       <groupId>org.apache.asterix</groupId>
+      <artifactId>asterix-external-data</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.asterix</groupId>
       <artifactId>asterix-transactions</artifactId>
       <version>${project.version}</version>
       <scope>compile</scope>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta/change-feed-with-meta-pk-in-meta.1.ddl.aql
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta/change-feed-with-meta-pk-in-meta.1.ddl.aql
index d3317e4..31d6ea8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta/change-feed-with-meta-pk-in-meta.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta/change-feed-with-meta-pk-in-meta.1.ddl.aql
@@ -47,7 +47,7 @@
 create feed KVChangeStream using adapter(
     ("type-name"="DocumentType"),
     ("meta-type-name"="KVMetaType"),
-    ("reader"="kv_test"),
+    ("reader"="org.apache.asterix.external.input.record.reader.kv.KVTestReaderFactory"),
     ("parser"="record-with-metadata"),
     ("format"="dcp"),
     ("record-format"="json"),
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed/change-feed.1.ddl.aql
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed/change-feed.1.ddl.aql
index 2dad901..e78327a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed/change-feed.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed/change-feed.1.ddl.aql
@@ -37,7 +37,7 @@
     ("format"="test-csv"),
     ("delimiter"=","),
     ("key-indexes"="0"),
-    ("reader"="test-record-with-pk"),
-    ("parser"="test-record-with-pk"),
+    ("reader"="org.apache.asterix.external.input.record.reader.RecordWithPKTestReaderFactory"),
+    ("parser"="org.apache.asterix.external.parser.factory.TestRecordWithPKParserFactory"),
     ("change-feed"="true")
 );
\ No newline at end of file
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/test/base/AsterixTestHelper.java
b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/base/AsterixTestHelper.java
similarity index 100%
rename from asterixdb/asterix-common/src/main/java/org/apache/asterix/test/base/AsterixTestHelper.java
rename to asterixdb/asterix-common/src/test/java/org/apache/asterix/test/base/AsterixTestHelper.java
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
index f71e9a0..ae0aafa 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
@@ -26,8 +26,6 @@
 import org.apache.asterix.external.api.IInputStreamFactory;
 import org.apache.asterix.external.api.IRecordReaderFactory;
 import org.apache.asterix.external.input.HDFSDataSourceFactory;
-import org.apache.asterix.external.input.record.reader.RecordWithPKTestReaderFactory;
-import org.apache.asterix.external.input.record.reader.kv.KVTestReaderFactory;
 import org.apache.asterix.external.input.record.reader.rss.RSSRecordReaderFactory;
 import org.apache.asterix.external.input.record.reader.stream.StreamRecordReaderFactory;
 import org.apache.asterix.external.input.record.reader.twitter.TwitterRecordReaderFactory;
@@ -90,8 +88,6 @@
             return ExternalDataUtils.createExternalRecordReaderFactory(configuration);
         }
         switch (reader) {
-            case ExternalDataConstants.READER_KV_TEST:
-                return new KVTestReaderFactory();
             case ExternalDataConstants.READER_HDFS:
                 return new HDFSDataSourceFactory();
             case ExternalDataConstants.ALIAS_LOCALFS_ADAPTER:
@@ -101,8 +97,6 @@
             case ExternalDataConstants.READER_PUSH_TWITTER:
             case ExternalDataConstants.READER_PULL_TWITTER:
                 return new TwitterRecordReaderFactory();
-            case ExternalDataConstants.TEST_RECORD_WITH_PK:
-                return new RecordWithPKTestReaderFactory();
             case ExternalDataConstants.ALIAS_TWITTER_FIREHOSE_ADAPTER:
                 return new StreamRecordReaderFactory(new TwitterFirehoseStreamFactory());
             case ExternalDataConstants.ALIAS_SOCKET_ADAPTER:
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/ParserFactoryProvider.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/ParserFactoryProvider.java
index 682fb89..af4e4c4 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/ParserFactoryProvider.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/ParserFactoryProvider.java
@@ -29,7 +29,6 @@
 import org.apache.asterix.external.parser.factory.HiveDataParserFactory;
 import org.apache.asterix.external.parser.factory.RSSParserFactory;
 import org.apache.asterix.external.parser.factory.RecordWithMetadataParserFactory;
-import org.apache.asterix.external.parser.factory.TestRecordWithPKParserFactory;
 import org.apache.asterix.external.parser.factory.TweetParserFactory;
 import org.apache.asterix.external.util.ExternalDataConstants;
 import org.apache.asterix.external.util.ExternalDataUtils;
@@ -67,10 +66,12 @@
                 return new RSSParserFactory();
             case ExternalDataConstants.FORMAT_RECORD_WITH_METADATA:
                 return new RecordWithMetadataParserFactory();
-            case ExternalDataConstants.TEST_RECORD_WITH_PK:
-                return new TestRecordWithPKParserFactory();
             default:
-                throw new AsterixException("Unknown format: " + parser);
+                try {
+                    return (IDataParserFactory) Class.forName(parser).newInstance();
+                } catch (Exception e) {
+                    throw new AsterixException("Unknown format: " + parser);
+                }
         }
     }
 }
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
index 81f8377..c992723 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataConstants.java
@@ -221,10 +221,8 @@
     public static final String KEY_STREAM_SOURCE = "stream-source";
     public static final String EXTERNAL = "external";
     public static final String KEY_READER_FACTORY = "reader-factory";
-    public static final String READER_KV_TEST = "kv_test";
     public static final String READER_RSS = "rss";
     public static final String FORMAT_CSV = "csv";
-    public static final String TEST_RECORD_WITH_PK = "test-record-with-pk";
 
     public static final String ERROR_PARSE_RECORD = "Parser failed to parse record";
 }
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/RecordWithPKTestReaderFactory.java
b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/RecordWithPKTestReaderFactory.java
similarity index 100%
rename from asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/RecordWithPKTestReaderFactory.java
rename to asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/RecordWithPKTestReaderFactory.java
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/TestAsterixMembersReader.java
b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/TestAsterixMembersReader.java
similarity index 100%
rename from asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/TestAsterixMembersReader.java
rename to asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/TestAsterixMembersReader.java
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/kv/KVTestReader.java
b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/kv/KVTestReader.java
similarity index 100%
rename from asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/kv/KVTestReader.java
rename to asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/kv/KVTestReader.java
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/kv/KVTestReaderFactory.java
b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/kv/KVTestReaderFactory.java
similarity index 100%
rename from asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/kv/KVTestReaderFactory.java
rename to asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/input/record/reader/kv/KVTestReaderFactory.java
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
similarity index 100%
rename from asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
rename to asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java
b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java
similarity index 100%
rename from asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java
rename to asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java
diff --git a/asterixdb/asterix-installer/src/test/resources/transactionts/queries/query_after_restart/dataset-with-meta-record/dataset-with-meta-record.2.ddl.aql
b/asterixdb/asterix-installer/src/test/resources/transactionts/queries/query_after_restart/dataset-with-meta-record/dataset-with-meta-record.2.ddl.aql
index d3317e4..31d6ea8 100644
--- a/asterixdb/asterix-installer/src/test/resources/transactionts/queries/query_after_restart/dataset-with-meta-record/dataset-with-meta-record.2.ddl.aql
+++ b/asterixdb/asterix-installer/src/test/resources/transactionts/queries/query_after_restart/dataset-with-meta-record/dataset-with-meta-record.2.ddl.aql
@@ -47,7 +47,7 @@
 create feed KVChangeStream using adapter(
     ("type-name"="DocumentType"),
     ("meta-type-name"="KVMetaType"),
-    ("reader"="kv_test"),
+    ("reader"="org.apache.asterix.external.input.record.reader.kv.KVTestReaderFactory"),
     ("parser"="record-with-metadata"),
     ("format"="dcp"),
     ("record-format"="json"),
diff --git a/asterixdb/asterix-tools/pom.xml b/asterixdb/asterix-tools/pom.xml
index fb1f1d9..cb32004 100644
--- a/asterixdb/asterix-tools/pom.xml
+++ b/asterixdb/asterix-tools/pom.xml
@@ -108,6 +108,13 @@
     </dependency>
     <dependency>
       <groupId>org.apache.asterix</groupId>
+      <artifactId>asterix-common</artifactId>
+      <version>0.8.9-SNAPSHOT</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.asterix</groupId>
       <artifactId>asterix-metadata</artifactId>
       <version>0.8.9-SNAPSHOT</version>
       <scope>compile</scope>
diff --git a/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/test/AdmDataGenTest.java
b/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/test/AdmDataGenTest.java
index e20761c..cd800c4 100644
--- a/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/test/AdmDataGenTest.java
+++ b/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/test/AdmDataGenTest.java
@@ -26,6 +26,8 @@
 import java.util.Collection;
 import java.util.logging.Logger;
 
+import org.apache.asterix.test.base.AsterixTestHelper;
+import org.apache.asterix.tools.datagen.AdmDataGen;
 import org.junit.AfterClass;
 import org.junit.Assume;
 import org.junit.BeforeClass;
@@ -33,9 +35,6 @@
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
-
-import org.apache.asterix.test.base.AsterixTestHelper;
-import org.apache.asterix.tools.datagen.AdmDataGen;
 
 @RunWith(Parameterized.class)
 public class AdmDataGenTest {
diff --git a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/locking/TestRuntimeContextProvider.java
b/asterixdb/asterix-transactions/src/test/java/org/apache/asterix/transaction/management/service/locking/TestRuntimeContextProvider.java
similarity index 100%
rename from asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/locking/TestRuntimeContextProvider.java
rename to asterixdb/asterix-transactions/src/test/java/org/apache/asterix/transaction/management/service/locking/TestRuntimeContextProvider.java

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/901
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1da72566e7d140a1fb965c893dcea6881b99ca26
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <michael.blow@couchbase.com>

Mime
View raw message