asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject [03/19] incubator-asterixdb git commit: Support Change Feeds and Ingestion of Records with MetaData
Date Tue, 15 Mar 2016 23:36:19 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/d3338f66/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java
----------------------------------------------------------------------
diff --git a/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java
b/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java
index 5df074b..a6d544e 100644
--- a/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java
+++ b/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java
@@ -17,6 +17,7 @@ package org.apache.asterix.installer.test;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -25,6 +26,8 @@ import org.apache.asterix.external.util.IdentitiyResolverFactory;
 import org.apache.asterix.test.aql.TestExecutor;
 import org.apache.asterix.test.runtime.HDFSCluster;
 import org.apache.asterix.testframework.context.TestCaseContext;
+import org.apache.asterix.testframework.context.TestFileContext;
+import org.apache.asterix.testframework.xml.TestCase.CompilationUnit;
 import org.apache.commons.lang3.StringUtils;
 import org.codehaus.plexus.util.FileUtils;
 import org.junit.AfterClass;
@@ -50,6 +53,8 @@ public abstract class AbstractExecutionIT {
 
     protected final static TestExecutor testExecutor = new TestExecutor();
 
+    private static final String EXTERNAL_LIBRARY_TEST_GROUP = "lib";
+
     @BeforeClass
     public static void setUp() throws Exception {
         System.out.println("Starting setup");
@@ -85,7 +90,7 @@ public abstract class AbstractExecutionIT {
     public static void tearDown() throws Exception {
         File outdir = new File(PATH_ACTUAL);
         File[] files = outdir.listFiles();
-        if (files == null || files.length == 0) {
+        if ((files == null) || (files.length == 0)) {
             outdir.delete();
         }
         AsterixLifecycleIT.tearDown();
@@ -111,6 +116,23 @@ public abstract class AbstractExecutionIT {
 
     @Test
     public void test() throws Exception {
+        if (skip()) {
+            return;
+        }
         testExecutor.executeTest(PATH_ACTUAL, tcCtx, null, false);
     }
+
+    protected boolean skip() {
+        // If the test case contains library commands, we skip them
+        List<CompilationUnit> cUnits = tcCtx.getTestCase().getCompilationUnit();
+        for (CompilationUnit cUnit : cUnits) {
+            List<TestFileContext> testFileCtxs = tcCtx.getTestFiles(cUnit);
+            for (TestFileContext ctx : testFileCtxs) {
+                if (ctx.getType().equals(EXTERNAL_LIBRARY_TEST_GROUP)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/d3338f66/asterix-installer/src/test/java/org/apache/asterix/installer/test/ClusterExecutionIT.java
----------------------------------------------------------------------
diff --git a/asterix-installer/src/test/java/org/apache/asterix/installer/test/ClusterExecutionIT.java
b/asterix-installer/src/test/java/org/apache/asterix/installer/test/ClusterExecutionIT.java
index 97709cb..8db985d 100644
--- a/asterix-installer/src/test/java/org/apache/asterix/installer/test/ClusterExecutionIT.java
+++ b/asterix-installer/src/test/java/org/apache/asterix/installer/test/ClusterExecutionIT.java
@@ -73,7 +73,7 @@ public class ClusterExecutionIT extends AbstractExecutionIT {
     public static void tearDown() throws Exception {
         File outdir = new File(PATH_ACTUAL);
         File[] files = outdir.listFiles();
-        if (files == null || files.length == 0) {
+        if ((files == null) || (files.length == 0)) {
             outdir.delete();
         }
 
@@ -102,6 +102,9 @@ public class ClusterExecutionIT extends AbstractExecutionIT {
     @Override
     @Test
     public void test() throws Exception {
+        if (skip()) {
+            return;
+        }
         testExecutor.executeTest(PATH_ACTUAL, tcCtx, null, false);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/d3338f66/asterix-installer/src/test/resources/integrationts/library/queries/library-adapters/typed_adapter/typed_adapter.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-installer/src/test/resources/integrationts/library/queries/library-adapters/typed_adapter/typed_adapter.1.ddl.aql
b/asterix-installer/src/test/resources/integrationts/library/queries/library-adapters/typed_adapter/typed_adapter.1.ddl.aql
index 0789cf8..f188629 100644
--- a/asterix-installer/src/test/resources/integrationts/library/queries/library-adapters/typed_adapter/typed_adapter.1.ddl.aql
+++ b/asterix-installer/src/test/resources/integrationts/library/queries/library-adapters/typed_adapter/typed_adapter.1.ddl.aql
@@ -36,4 +36,6 @@ create dataset TweetsTestAdapter(TestTypedAdapterOutputType)
 primary key tweetid;
 
 create feed TestTypedAdapterFeed
-using "testlib#test_typed_adapter" (("num_output_records"="5"),("type-name"="TestTypedAdapterOutputType"));
+using "testlib#test_typed_adapter" (
+("num_output_records"="5"),
+("type-name"="TestTypedAdapterOutputType"));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/d3338f66/asterix-installer/src/test/resources/integrationts/library/queries/library-feeds/feed_ingest/feed_ingest.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-installer/src/test/resources/integrationts/library/queries/library-feeds/feed_ingest/feed_ingest.1.ddl.aql
b/asterix-installer/src/test/resources/integrationts/library/queries/library-feeds/feed_ingest/feed_ingest.1.ddl.aql
index ebbc65e..f9a6eda 100644
--- a/asterix-installer/src/test/resources/integrationts/library/queries/library-feeds/feed_ingest/feed_ingest.1.ddl.aql
+++ b/asterix-installer/src/test/resources/integrationts/library/queries/library-feeds/feed_ingest/feed_ingest.1.ddl.aql
@@ -45,9 +45,12 @@ create type TweetOutputType as closed {
 }
 
 create feed TweetFeed
-using file_feed
-(("type-name"="TweetInputType"),("fs"="localfs"),("path"="asterix_nc1://../../../../../../asterix-app/data/twitter/obamatweets.adm"),("format"="adm"),("tuple-interval"="10"))
+using localfs
+(("type-name"="TweetInputType"),
+("path"="asterix_nc1://../../../../../../asterix-app/data/twitter/obamatweets.adm"),
+("format"="adm"),
+("tuple-interval"="10"))
 apply function testlib#parseTweet;
 
-create dataset TweetsFeedIngest(TweetOutputType) 
+create dataset TweetsFeedIngest(TweetOutputType)
 primary key id;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/d3338f66/asterix-installer/src/test/resources/integrationts/library/queries/library-parsers/record-parser/record-parser.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-installer/src/test/resources/integrationts/library/queries/library-parsers/record-parser/record-parser.1.ddl.aql
b/asterix-installer/src/test/resources/integrationts/library/queries/library-parsers/record-parser/record-parser.1.ddl.aql
index 0f40b07..d523247 100644
--- a/asterix-installer/src/test/resources/integrationts/library/queries/library-parsers/record-parser/record-parser.1.ddl.aql
+++ b/asterix-installer/src/test/resources/integrationts/library/queries/library-parsers/record-parser/record-parser.1.ddl.aql
@@ -29,6 +29,5 @@ create type Classad as open {
 
 create external dataset Condor(Classad) using localfs(
 ("path"="asterix_nc1://data/external-parser/jobads.new"),
-("reader"="adm"),
-("parser"="testlib#org.apache.asterix.external.library.ClassAdParserFactory"),
-("reader-stream"="localfs"));
+("format"="adm"),
+("parser"="testlib#org.apache.asterix.external.library.ClassAdParserFactory"));


Mime
View raw message