Repository: incubator-streams Updated Branches: refs/heads/master 80207a0db -> 7662e2733
switch back to IT b/c the test poms arenât part of the reactor, need snapshots published Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/7662e273 Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/7662e273 Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/7662e273 Branch: refs/heads/master Commit: 7662e2733488bfcbe75d763dc192cd4bd043f7dd Parents: 80207a0 Author: Steve Blackmon @steveblackmon <[email protected]> Authored: Thu Oct 20 10:53:06 2016 -0500 Committer: Steve Blackmon @steveblackmon <[email protected]> Committed: Thu Oct 20 10:53:06 2016 -0500 ---------------------------------------------------------------------- ...StreamsCassandraResourceGeneratorMojoIT.java | 96 ++++++++++++++++++++ ...reamsCassandraResourceGeneratorMojoTest.java | 96 -------------------- .../resources/streams-plugin-cassandra/pom.xml | 36 ++++++++ ...amsElasticsearchResourceGeneratorMojoIT.java | 68 ++++++++++++++ ...sElasticsearchResourceGeneratorMojoTest.java | 68 -------------- .../streams-plugin-elasticsearch/pom.xml | 36 ++++++++ .../StreamsHbaseResourceGeneratorMojoIT.java | 83 +++++++++++++++++ .../StreamsHbaseResourceGeneratorMojoTest.java | 83 ----------------- .../test/resources/streams-plugin-hbase/pom.xml | 36 ++++++++ .../StreamsHiveResourceGeneratorMojoIT.java | 83 +++++++++++++++++ .../StreamsHiveResourceGeneratorMojoTest.java | 83 ----------------- .../test/resources/streams-plugin-hive/pom.xml | 36 ++++++++ .../test/StreamsPigResourceGeneratorMojoIT.java | 83 +++++++++++++++++ .../StreamsPigResourceGeneratorMojoTest.java | 83 ----------------- .../test/resources/streams-plugin-pig/pom.xml | 36 ++++++++ .../test/StreamsPojoSourceGeneratorMojoIT.java | 86 ++++++++++++++++++ .../StreamsPojoSourceGeneratorMojoTest.java | 86 ------------------ .../test/resources/streams-plugin-pojo/pom.xml | 36 ++++++++ .../test/StreamsScalaSourceGeneratorMojoIT.java | 83 +++++++++++++++++ .../StreamsScalaSourceGeneratorMojoTest.java | 83 ----------------- .../test/resources/streams-plugin-scala/pom.xml | 59 ++++++++++-- 21 files changed, 849 insertions(+), 590 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-cassandra/src/test/java/org/apache/streams/plugins/cassandra/test/StreamsCassandraResourceGeneratorMojoIT.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-cassandra/src/test/java/org/apache/streams/plugins/cassandra/test/StreamsCassandraResourceGeneratorMojoIT.java b/streams-plugins/streams-plugin-cassandra/src/test/java/org/apache/streams/plugins/cassandra/test/StreamsCassandraResourceGeneratorMojoIT.java new file mode 100644 index 0000000..fc7765e --- /dev/null +++ b/streams-plugins/streams-plugin-cassandra/src/test/java/org/apache/streams/plugins/cassandra/test/StreamsCassandraResourceGeneratorMojoIT.java @@ -0,0 +1,96 @@ +/* + * 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 may not 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 applicable law 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.streams.plugins.cassandra.test; + +import com.google.common.collect.Lists; +import com.google.common.io.Files; +import junit.framework.TestCase; +import org.apache.commons.lang3.StringUtils; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.apache.streams.plugins.cassandra.test.StreamsCassandraResourceGeneratorTest.cqlFilter; + +/** + * Tests that streams-plugin-hive running via maven generates hql resources + */ +public class StreamsCassandraResourceGeneratorMojoIT extends TestCase { + + private final static Logger LOGGER = LoggerFactory.getLogger(StreamsCassandraResourceGeneratorMojoIT.class); + + protected void setUp() throws Exception + { + // required for mojo lookups to work + super.setUp(); + } + + @Test + public void testStreamsCassandraResourceGeneratorMojo() throws Exception { + + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-cassandra" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-N" ); + verifier.executeGoals( Lists.<String>newArrayList( + "clean", + "dependency:unpack-dependencies", + "generate-resources")); + + verifier.verifyErrorFreeLog(); + + verifier.resetStreams(); + + Path testOutputPath = Paths.get(testDir.getAbsolutePath()).resolve("target/generated-resources/test-mojo"); + + File testOutput = testOutputPath.toFile(); + + assert( testOutput != null ); + assert( testOutput.exists() == true ); + assert( testOutput.isDirectory() == true ); + + Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) + .filter(cqlFilter); + Collection<File> outputCollection = Lists.newArrayList(outputIterator); + assert( outputCollection.size() == 1 ); + + Path path = testOutputPath.resolve("types.cql"); + + assert( path.toFile().exists() ); + + String typesCqlBytes = new String( + java.nio.file.Files.readAllBytes(path)); + + assert( StringUtils.countMatches(typesCqlBytes, "CREATE TYPE") == 133 ); + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-cassandra/src/test/java/org/apache/streams/plugins/cassandra/test/StreamsCassandraResourceGeneratorMojoTest.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-cassandra/src/test/java/org/apache/streams/plugins/cassandra/test/StreamsCassandraResourceGeneratorMojoTest.java b/streams-plugins/streams-plugin-cassandra/src/test/java/org/apache/streams/plugins/cassandra/test/StreamsCassandraResourceGeneratorMojoTest.java deleted file mode 100644 index 7f5aa39..0000000 --- a/streams-plugins/streams-plugin-cassandra/src/test/java/org/apache/streams/plugins/cassandra/test/StreamsCassandraResourceGeneratorMojoTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 may not 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 applicable law 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.streams.plugins.cassandra.test; - -import com.google.common.collect.Lists; -import com.google.common.io.Files; -import junit.framework.TestCase; -import org.apache.commons.lang3.StringUtils; -import org.apache.maven.it.Verifier; -import org.apache.maven.it.util.ResourceExtractor; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static org.apache.streams.plugins.cassandra.test.StreamsCassandraResourceGeneratorTest.cqlFilter; - -/** - * Tests that streams-plugin-hive running via maven generates hql resources - */ -public class StreamsCassandraResourceGeneratorMojoTest extends TestCase { - - private final static Logger LOGGER = LoggerFactory.getLogger(StreamsCassandraResourceGeneratorMojoTest.class); - - protected void setUp() throws Exception - { - // required for mojo lookups to work - super.setUp(); - } - - @Test - public void testStreamsCassandraResourceGeneratorMojo() throws Exception { - - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-cassandra" ); - - Verifier verifier; - - verifier = new Verifier( testDir.getAbsolutePath() ); - - List cliOptions = new ArrayList(); - cliOptions.add( "-N" ); - verifier.executeGoals( Lists.<String>newArrayList( - "clean", - "dependency:unpack-dependencies", - "generate-resources")); - - verifier.verifyErrorFreeLog(); - - verifier.resetStreams(); - - Path testOutputPath = Paths.get(testDir.getAbsolutePath()).resolve("target/generated-resources/test-mojo"); - - File testOutput = testOutputPath.toFile(); - - assert( testOutput != null ); - assert( testOutput.exists() == true ); - assert( testOutput.isDirectory() == true ); - - Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) - .filter(cqlFilter); - Collection<File> outputCollection = Lists.newArrayList(outputIterator); - assert( outputCollection.size() == 1 ); - - Path path = testOutputPath.resolve("types.cql"); - - assert( path.toFile().exists() ); - - String typesCqlBytes = new String( - java.nio.file.Files.readAllBytes(path)); - - assert( StringUtils.countMatches(typesCqlBytes, "CREATE TYPE") == 133 ); - - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-cassandra/src/test/resources/streams-plugin-cassandra/pom.xml ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-cassandra/src/test/resources/streams-plugin-cassandra/pom.xml b/streams-plugins/streams-plugin-cassandra/src/test/resources/streams-plugin-cassandra/pom.xml index 34ae257..113af9b 100644 --- a/streams-plugins/streams-plugin-cassandra/src/test/resources/streams-plugin-cassandra/pom.xml +++ b/streams-plugins/streams-plugin-cassandra/src/test/resources/streams-plugin-cassandra/pom.xml @@ -27,10 +27,46 @@ <packaging>jar</packaging> <name>Test StreamsCassandraResourceGeneratorMojo</name> + <repositories> + <repository> + <id>apache-repo</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> <pluginRepository> <id>apache-repo</id> <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>apache-snapshots</id> + <name>Apache Repository</name> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-elasticsearch/src/test/java/org/apache/streams/plugins/elasticsearch/test/StreamsElasticsearchResourceGeneratorMojoIT.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-elasticsearch/src/test/java/org/apache/streams/plugins/elasticsearch/test/StreamsElasticsearchResourceGeneratorMojoIT.java b/streams-plugins/streams-plugin-elasticsearch/src/test/java/org/apache/streams/plugins/elasticsearch/test/StreamsElasticsearchResourceGeneratorMojoIT.java new file mode 100644 index 0000000..2a24846 --- /dev/null +++ b/streams-plugins/streams-plugin-elasticsearch/src/test/java/org/apache/streams/plugins/elasticsearch/test/StreamsElasticsearchResourceGeneratorMojoIT.java @@ -0,0 +1,68 @@ +/* + * 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 may not 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 applicable law 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.streams.plugins.elasticsearch.test; + +import com.google.common.collect.Lists; +import junit.framework.TestCase; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * Tests that streams-plugin-hive running via maven generates hql resources + */ +public class StreamsElasticsearchResourceGeneratorMojoIT extends TestCase { + + private final static Logger LOGGER = LoggerFactory.getLogger(StreamsElasticsearchResourceGeneratorMojoIT.class); + + protected void setUp() throws Exception + { + // required for mojo lookups to work + super.setUp(); + } + + + @Test + public void testStreamsElasticsearchResourceGeneratorMojo() throws Exception { + + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-elasticsearch" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-N" ); + verifier.executeGoals( Lists.<String>newArrayList( + "clean", + "dependency:unpack-dependencies", + "generate-resources")); + + verifier.verifyErrorFreeLog(); + + verifier.resetStreams(); + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-elasticsearch/src/test/java/org/apache/streams/plugins/elasticsearch/test/StreamsElasticsearchResourceGeneratorMojoTest.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-elasticsearch/src/test/java/org/apache/streams/plugins/elasticsearch/test/StreamsElasticsearchResourceGeneratorMojoTest.java b/streams-plugins/streams-plugin-elasticsearch/src/test/java/org/apache/streams/plugins/elasticsearch/test/StreamsElasticsearchResourceGeneratorMojoTest.java deleted file mode 100644 index 60f3002..0000000 --- a/streams-plugins/streams-plugin-elasticsearch/src/test/java/org/apache/streams/plugins/elasticsearch/test/StreamsElasticsearchResourceGeneratorMojoTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 may not 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 applicable law 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.streams.plugins.elasticsearch.test; - -import com.google.common.collect.Lists; -import junit.framework.TestCase; -import org.apache.maven.it.Verifier; -import org.apache.maven.it.util.ResourceExtractor; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -/** - * Tests that streams-plugin-hive running via maven generates hql resources - */ -public class StreamsElasticsearchResourceGeneratorMojoTest extends TestCase { - - private final static Logger LOGGER = LoggerFactory.getLogger(StreamsElasticsearchResourceGeneratorMojoTest.class); - - protected void setUp() throws Exception - { - // required for mojo lookups to work - super.setUp(); - } - - - @Test - public void testStreamsElasticsearchResourceGeneratorMojo() throws Exception { - - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-elasticsearch" ); - - Verifier verifier; - - verifier = new Verifier( testDir.getAbsolutePath() ); - - List cliOptions = new ArrayList(); - cliOptions.add( "-N" ); - verifier.executeGoals( Lists.<String>newArrayList( - "clean", - "dependency:unpack-dependencies", - "generate-resources")); - - verifier.verifyErrorFreeLog(); - - verifier.resetStreams(); - - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-elasticsearch/src/test/resources/streams-plugin-elasticsearch/pom.xml ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-elasticsearch/src/test/resources/streams-plugin-elasticsearch/pom.xml b/streams-plugins/streams-plugin-elasticsearch/src/test/resources/streams-plugin-elasticsearch/pom.xml index 54a57a9..521fbfb 100644 --- a/streams-plugins/streams-plugin-elasticsearch/src/test/resources/streams-plugin-elasticsearch/pom.xml +++ b/streams-plugins/streams-plugin-elasticsearch/src/test/resources/streams-plugin-elasticsearch/pom.xml @@ -27,10 +27,46 @@ <packaging>jar</packaging> <name>Test StreamsElasticsearchResourceGeneratorMojo</name> + <repositories> + <repository> + <id>apache-repo</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> <pluginRepository> <id>apache-repo</id> <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>apache-snapshots</id> + <name>Apache Repository</name> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-hbase/src/test/java/org/apache/streams/plugins/test/StreamsHbaseResourceGeneratorMojoIT.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-hbase/src/test/java/org/apache/streams/plugins/test/StreamsHbaseResourceGeneratorMojoIT.java b/streams-plugins/streams-plugin-hbase/src/test/java/org/apache/streams/plugins/test/StreamsHbaseResourceGeneratorMojoIT.java new file mode 100644 index 0000000..1495bc1 --- /dev/null +++ b/streams-plugins/streams-plugin-hbase/src/test/java/org/apache/streams/plugins/test/StreamsHbaseResourceGeneratorMojoIT.java @@ -0,0 +1,83 @@ +/* + * 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 may not 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 applicable law 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.streams.plugins.test; + +import com.google.common.collect.Lists; +import com.google.common.io.Files; +import junit.framework.TestCase; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.apache.streams.plugins.test.StreamsHbaseResourceGeneratorTest.txtFilter; + +/** + * Tests that streams-plugin-hive running via maven generates hql resources + */ +public class StreamsHbaseResourceGeneratorMojoIT extends TestCase { + + private final static Logger LOGGER = LoggerFactory.getLogger(StreamsHbaseResourceGeneratorMojoIT.class); + + protected void setUp() throws Exception + { + // required for mojo lookups to work + super.setUp(); + } + + + @Test + public void testStreamsHbaseResourceGeneratorMojo() throws Exception { + + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-hbase" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-N" ); + verifier.executeGoals( Lists.<String>newArrayList( + "clean", + "dependency:unpack-dependencies", + "generate-resources")); + + verifier.verifyErrorFreeLog(); + + verifier.resetStreams(); + + File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-resources/hbase-mojo"); + + assert( testOutput != null ); + assert( testOutput.exists() == true ); + assert( testOutput.isDirectory() == true ); + + Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) + .filter(txtFilter); + Collection<File> outputCollection = Lists.newArrayList(outputIterator); + assert( outputCollection.size() == 133 ); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-hbase/src/test/java/org/apache/streams/plugins/test/StreamsHbaseResourceGeneratorMojoTest.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-hbase/src/test/java/org/apache/streams/plugins/test/StreamsHbaseResourceGeneratorMojoTest.java b/streams-plugins/streams-plugin-hbase/src/test/java/org/apache/streams/plugins/test/StreamsHbaseResourceGeneratorMojoTest.java deleted file mode 100644 index f14a1b4..0000000 --- a/streams-plugins/streams-plugin-hbase/src/test/java/org/apache/streams/plugins/test/StreamsHbaseResourceGeneratorMojoTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 may not 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 applicable law 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.streams.plugins.test; - -import com.google.common.collect.Lists; -import com.google.common.io.Files; -import junit.framework.TestCase; -import org.apache.maven.it.Verifier; -import org.apache.maven.it.util.ResourceExtractor; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static org.apache.streams.plugins.test.StreamsHbaseResourceGeneratorTest.txtFilter; - -/** - * Tests that streams-plugin-hive running via maven generates hql resources - */ -public class StreamsHbaseResourceGeneratorMojoTest extends TestCase { - - private final static Logger LOGGER = LoggerFactory.getLogger(StreamsHbaseResourceGeneratorMojoTest.class); - - protected void setUp() throws Exception - { - // required for mojo lookups to work - super.setUp(); - } - - - @Test - public void testStreamsHbaseResourceGeneratorMojo() throws Exception { - - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-hbase" ); - - Verifier verifier; - - verifier = new Verifier( testDir.getAbsolutePath() ); - - List cliOptions = new ArrayList(); - cliOptions.add( "-N" ); - verifier.executeGoals( Lists.<String>newArrayList( - "clean", - "dependency:unpack-dependencies", - "generate-resources")); - - verifier.verifyErrorFreeLog(); - - verifier.resetStreams(); - - File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-resources/hbase-mojo"); - - assert( testOutput != null ); - assert( testOutput.exists() == true ); - assert( testOutput.isDirectory() == true ); - - Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) - .filter(txtFilter); - Collection<File> outputCollection = Lists.newArrayList(outputIterator); - assert( outputCollection.size() == 133 ); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-hbase/src/test/resources/streams-plugin-hbase/pom.xml ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-hbase/src/test/resources/streams-plugin-hbase/pom.xml b/streams-plugins/streams-plugin-hbase/src/test/resources/streams-plugin-hbase/pom.xml index e3a93fc..7306545 100644 --- a/streams-plugins/streams-plugin-hbase/src/test/resources/streams-plugin-hbase/pom.xml +++ b/streams-plugins/streams-plugin-hbase/src/test/resources/streams-plugin-hbase/pom.xml @@ -28,10 +28,46 @@ <packaging>jar</packaging> <name>Test StreamsHbaseResourceGeneratorMojo</name> + <repositories> + <repository> + <id>apache-repo</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> <pluginRepository> <id>apache-repo</id> <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>apache-snapshots</id> + <name>Apache Repository</name> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-hive/src/test/java/org/apache/streams/plugins/test/StreamsHiveResourceGeneratorMojoIT.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-hive/src/test/java/org/apache/streams/plugins/test/StreamsHiveResourceGeneratorMojoIT.java b/streams-plugins/streams-plugin-hive/src/test/java/org/apache/streams/plugins/test/StreamsHiveResourceGeneratorMojoIT.java new file mode 100644 index 0000000..e78a175 --- /dev/null +++ b/streams-plugins/streams-plugin-hive/src/test/java/org/apache/streams/plugins/test/StreamsHiveResourceGeneratorMojoIT.java @@ -0,0 +1,83 @@ +/* + * 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 may not 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 applicable law 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.streams.plugins.test; + +import com.google.common.collect.Lists; +import com.google.common.io.Files; +import junit.framework.TestCase; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.apache.streams.plugins.test.StreamsHiveResourceGeneratorTest.hqlFilter; + +/** + * Tests that streams-plugin-hive running via maven generates hql resources + */ +public class StreamsHiveResourceGeneratorMojoIT extends TestCase { + + private final static Logger LOGGER = LoggerFactory.getLogger(StreamsHiveResourceGeneratorMojoIT.class); + + protected void setUp() throws Exception + { + // required for mojo lookups to work + super.setUp(); + } + + + @Test + public void testStreamsHiveResourceGeneratorMojo() throws Exception { + + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-hive" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-N" ); + verifier.executeGoals( Lists.<String>newArrayList( + "clean", + "dependency:unpack-dependencies", + "generate-resources")); + + verifier.verifyErrorFreeLog(); + + verifier.resetStreams(); + + File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-resources/hive-mojo"); + + assert( testOutput != null ); + assert( testOutput.exists() == true ); + assert( testOutput.isDirectory() == true ); + + Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) + .filter(hqlFilter); + Collection<File> outputCollection = Lists.newArrayList(outputIterator); + assert( outputCollection.size() == 133 ); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-hive/src/test/java/org/apache/streams/plugins/test/StreamsHiveResourceGeneratorMojoTest.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-hive/src/test/java/org/apache/streams/plugins/test/StreamsHiveResourceGeneratorMojoTest.java b/streams-plugins/streams-plugin-hive/src/test/java/org/apache/streams/plugins/test/StreamsHiveResourceGeneratorMojoTest.java deleted file mode 100644 index 8594e11..0000000 --- a/streams-plugins/streams-plugin-hive/src/test/java/org/apache/streams/plugins/test/StreamsHiveResourceGeneratorMojoTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 may not 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 applicable law 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.streams.plugins.test; - -import com.google.common.collect.Lists; -import com.google.common.io.Files; -import junit.framework.TestCase; -import org.apache.maven.it.Verifier; -import org.apache.maven.it.util.ResourceExtractor; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static org.apache.streams.plugins.test.StreamsHiveResourceGeneratorTest.hqlFilter; - -/** - * Tests that streams-plugin-hive running via maven generates hql resources - */ -public class StreamsHiveResourceGeneratorMojoTest extends TestCase { - - private final static Logger LOGGER = LoggerFactory.getLogger(StreamsHiveResourceGeneratorMojoTest.class); - - protected void setUp() throws Exception - { - // required for mojo lookups to work - super.setUp(); - } - - - @Test - public void testStreamsHiveResourceGeneratorMojo() throws Exception { - - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-hive" ); - - Verifier verifier; - - verifier = new Verifier( testDir.getAbsolutePath() ); - - List cliOptions = new ArrayList(); - cliOptions.add( "-N" ); - verifier.executeGoals( Lists.<String>newArrayList( - "clean", - "dependency:unpack-dependencies", - "generate-resources")); - - verifier.verifyErrorFreeLog(); - - verifier.resetStreams(); - - File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-resources/hive-mojo"); - - assert( testOutput != null ); - assert( testOutput.exists() == true ); - assert( testOutput.isDirectory() == true ); - - Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) - .filter(hqlFilter); - Collection<File> outputCollection = Lists.newArrayList(outputIterator); - assert( outputCollection.size() == 133 ); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-hive/src/test/resources/streams-plugin-hive/pom.xml ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-hive/src/test/resources/streams-plugin-hive/pom.xml b/streams-plugins/streams-plugin-hive/src/test/resources/streams-plugin-hive/pom.xml index 8429b61..7d21d76 100644 --- a/streams-plugins/streams-plugin-hive/src/test/resources/streams-plugin-hive/pom.xml +++ b/streams-plugins/streams-plugin-hive/src/test/resources/streams-plugin-hive/pom.xml @@ -28,10 +28,46 @@ <packaging>jar</packaging> <name>Test StreamsPojoHiveMojo</name> + <repositories> + <repository> + <id>apache-repo</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> <pluginRepository> <id>apache-repo</id> <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>apache-snapshots</id> + <name>Apache Repository</name> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-pig/src/test/java/org/apache/streams/plugins/pig/test/StreamsPigResourceGeneratorMojoIT.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-pig/src/test/java/org/apache/streams/plugins/pig/test/StreamsPigResourceGeneratorMojoIT.java b/streams-plugins/streams-plugin-pig/src/test/java/org/apache/streams/plugins/pig/test/StreamsPigResourceGeneratorMojoIT.java new file mode 100644 index 0000000..a584774 --- /dev/null +++ b/streams-plugins/streams-plugin-pig/src/test/java/org/apache/streams/plugins/pig/test/StreamsPigResourceGeneratorMojoIT.java @@ -0,0 +1,83 @@ +/* + * 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 may not 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 applicable law 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.streams.plugins.pig.test; + +import com.google.common.collect.Lists; +import com.google.common.io.Files; +import junit.framework.TestCase; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.apache.streams.plugins.pig.test.StreamsPigResourceGeneratorTest.pigFilter; + +/** + * Tests that streams-plugin-hive running via maven generates hql resources + */ +public class StreamsPigResourceGeneratorMojoIT extends TestCase { + + private final static Logger LOGGER = LoggerFactory.getLogger(StreamsPigResourceGeneratorMojoIT.class); + + protected void setUp() throws Exception + { + // required for mojo lookups to work + super.setUp(); + } + + + @Test + public void testStreamsPigResourceGeneratorMojo() throws Exception { + + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-pig" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-N" ); + verifier.executeGoals( Lists.<String>newArrayList( + "clean", + "dependency:unpack-dependencies", + "generate-resources")); + + verifier.verifyErrorFreeLog(); + + verifier.resetStreams(); + + File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-resources/pig-mojo"); + + assert( testOutput != null ); + assert( testOutput.exists() == true ); + assert( testOutput.isDirectory() == true ); + + Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) + .filter(pigFilter); + Collection<File> outputCollection = Lists.newArrayList(outputIterator); + assert( outputCollection.size() == 133 ); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-pig/src/test/java/org/apache/streams/plugins/pig/test/StreamsPigResourceGeneratorMojoTest.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-pig/src/test/java/org/apache/streams/plugins/pig/test/StreamsPigResourceGeneratorMojoTest.java b/streams-plugins/streams-plugin-pig/src/test/java/org/apache/streams/plugins/pig/test/StreamsPigResourceGeneratorMojoTest.java deleted file mode 100644 index 686f6e2..0000000 --- a/streams-plugins/streams-plugin-pig/src/test/java/org/apache/streams/plugins/pig/test/StreamsPigResourceGeneratorMojoTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 may not 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 applicable law 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.streams.plugins.pig.test; - -import com.google.common.collect.Lists; -import com.google.common.io.Files; -import junit.framework.TestCase; -import org.apache.maven.it.Verifier; -import org.apache.maven.it.util.ResourceExtractor; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static org.apache.streams.plugins.pig.test.StreamsPigResourceGeneratorTest.pigFilter; - -/** - * Tests that streams-plugin-hive running via maven generates hql resources - */ -public class StreamsPigResourceGeneratorMojoTest extends TestCase { - - private final static Logger LOGGER = LoggerFactory.getLogger(StreamsPigResourceGeneratorMojoTest.class); - - protected void setUp() throws Exception - { - // required for mojo lookups to work - super.setUp(); - } - - - @Test - public void testStreamsPigResourceGeneratorMojo() throws Exception { - - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-pig" ); - - Verifier verifier; - - verifier = new Verifier( testDir.getAbsolutePath() ); - - List cliOptions = new ArrayList(); - cliOptions.add( "-N" ); - verifier.executeGoals( Lists.<String>newArrayList( - "clean", - "dependency:unpack-dependencies", - "generate-resources")); - - verifier.verifyErrorFreeLog(); - - verifier.resetStreams(); - - File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-resources/pig-mojo"); - - assert( testOutput != null ); - assert( testOutput.exists() == true ); - assert( testOutput.isDirectory() == true ); - - Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) - .filter(pigFilter); - Collection<File> outputCollection = Lists.newArrayList(outputIterator); - assert( outputCollection.size() == 133 ); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-pig/src/test/resources/streams-plugin-pig/pom.xml ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-pig/src/test/resources/streams-plugin-pig/pom.xml b/streams-plugins/streams-plugin-pig/src/test/resources/streams-plugin-pig/pom.xml index ad41778..38c7ba2 100644 --- a/streams-plugins/streams-plugin-pig/src/test/resources/streams-plugin-pig/pom.xml +++ b/streams-plugins/streams-plugin-pig/src/test/resources/streams-plugin-pig/pom.xml @@ -28,10 +28,46 @@ <packaging>jar</packaging> <name>Test StreamsPigResourceGeneratorMojo</name> + <repositories> + <repository> + <id>apache-repo</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> <pluginRepository> <id>apache-repo</id> <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>apache-snapshots</id> + <name>Apache Repository</name> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-pojo/src/test/java/org/apache/streams/plugins/test/StreamsPojoSourceGeneratorMojoIT.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-pojo/src/test/java/org/apache/streams/plugins/test/StreamsPojoSourceGeneratorMojoIT.java b/streams-plugins/streams-plugin-pojo/src/test/java/org/apache/streams/plugins/test/StreamsPojoSourceGeneratorMojoIT.java new file mode 100644 index 0000000..f2ccd2a --- /dev/null +++ b/streams-plugins/streams-plugin-pojo/src/test/java/org/apache/streams/plugins/test/StreamsPojoSourceGeneratorMojoIT.java @@ -0,0 +1,86 @@ +/* + * 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 may not 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 applicable law 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.streams.plugins.test; + +import com.google.common.collect.Lists; +import com.google.common.io.Files; +import junit.framework.TestCase; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.apache.streams.plugins.test.StreamsPojoSourceGeneratorTest.javaFilter; + +/** + * Tests that streams-plugin-pojo running via maven can convert activity schemas into pojos + * which then compile. + */ +public class StreamsPojoSourceGeneratorMojoIT extends TestCase { + + private final static Logger LOGGER = LoggerFactory.getLogger(StreamsPojoSourceGeneratorMojoIT.class); + + protected void setUp() throws Exception + { + // required for mojo lookups to work + super.setUp(); + } + + + @Test + public void testStreamsPojoSourceGeneratorMojo() throws Exception { + + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-pojo" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-N" ); + verifier.executeGoals( Lists.<String>newArrayList( + "clean", + "dependency:unpack-dependencies", + "generate-sources", + "compile")); + + verifier.verifyErrorFreeLog(); + + verifier.resetStreams(); + + File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-sources/pojo-mojo"); + + assert( testOutput != null ); + assert( testOutput.exists() == true ); + assert( testOutput.isDirectory() == true ); + + Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) + .filter(javaFilter); + Collection<File> outputCollection = Lists.newArrayList(outputIterator); + assert( outputCollection.size() > 133 ); + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-pojo/src/test/java/org/apache/streams/plugins/test/StreamsPojoSourceGeneratorMojoTest.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-pojo/src/test/java/org/apache/streams/plugins/test/StreamsPojoSourceGeneratorMojoTest.java b/streams-plugins/streams-plugin-pojo/src/test/java/org/apache/streams/plugins/test/StreamsPojoSourceGeneratorMojoTest.java deleted file mode 100644 index 94db69f..0000000 --- a/streams-plugins/streams-plugin-pojo/src/test/java/org/apache/streams/plugins/test/StreamsPojoSourceGeneratorMojoTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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 may not 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 applicable law 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.streams.plugins.test; - -import com.google.common.collect.Lists; -import com.google.common.io.Files; -import junit.framework.TestCase; -import org.apache.maven.it.Verifier; -import org.apache.maven.it.util.ResourceExtractor; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static org.apache.streams.plugins.test.StreamsPojoSourceGeneratorTest.javaFilter; - -/** - * Tests that streams-plugin-pojo running via maven can convert activity schemas into pojos - * which then compile. - */ -public class StreamsPojoSourceGeneratorMojoTest extends TestCase { - - private final static Logger LOGGER = LoggerFactory.getLogger(StreamsPojoSourceGeneratorMojoTest.class); - - protected void setUp() throws Exception - { - // required for mojo lookups to work - super.setUp(); - } - - - @Test - public void testStreamsPojoSourceGeneratorMojo() throws Exception { - - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-pojo" ); - - Verifier verifier; - - verifier = new Verifier( testDir.getAbsolutePath() ); - - List cliOptions = new ArrayList(); - cliOptions.add( "-N" ); - verifier.executeGoals( Lists.<String>newArrayList( - "clean", - "dependency:unpack-dependencies", - "generate-sources", - "compile")); - - verifier.verifyErrorFreeLog(); - - verifier.resetStreams(); - - File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-sources/pojo-mojo"); - - assert( testOutput != null ); - assert( testOutput.exists() == true ); - assert( testOutput.isDirectory() == true ); - - Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) - .filter(javaFilter); - Collection<File> outputCollection = Lists.newArrayList(outputIterator); - assert( outputCollection.size() > 133 ); - - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-pojo/src/test/resources/streams-plugin-pojo/pom.xml ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-pojo/src/test/resources/streams-plugin-pojo/pom.xml b/streams-plugins/streams-plugin-pojo/src/test/resources/streams-plugin-pojo/pom.xml index 8d1ec11..77b705b 100644 --- a/streams-plugins/streams-plugin-pojo/src/test/resources/streams-plugin-pojo/pom.xml +++ b/streams-plugins/streams-plugin-pojo/src/test/resources/streams-plugin-pojo/pom.xml @@ -33,10 +33,46 @@ <commons-lang.version>2.6</commons-lang.version> </properties> + <repositories> + <repository> + <id>apache-repo</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> <pluginRepository> <id>apache-repo</id> <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>apache-snapshots</id> + <name>Apache Repository</name> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-scala/src/test/java/org/apache/streams/plugins/test/StreamsScalaSourceGeneratorMojoIT.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-scala/src/test/java/org/apache/streams/plugins/test/StreamsScalaSourceGeneratorMojoIT.java b/streams-plugins/streams-plugin-scala/src/test/java/org/apache/streams/plugins/test/StreamsScalaSourceGeneratorMojoIT.java new file mode 100644 index 0000000..bcd988f --- /dev/null +++ b/streams-plugins/streams-plugin-scala/src/test/java/org/apache/streams/plugins/test/StreamsScalaSourceGeneratorMojoIT.java @@ -0,0 +1,83 @@ +/* + * 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 may not 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 applicable law 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.streams.plugins.test; + +import com.google.common.collect.Lists; +import com.google.common.io.Files; +import junit.framework.TestCase; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.apache.streams.plugins.test.StreamsScalaSourceGeneratorTest.scalaFilter; + +/** + * Tests that streams-plugin-pojo running via maven can convert activity schemas into pojos + * which then compile. + */ +public class StreamsScalaSourceGeneratorMojoIT extends TestCase { + + private final static Logger LOGGER = LoggerFactory.getLogger(StreamsScalaSourceGeneratorMojoIT.class); + + protected void setUp() throws Exception + { + // required for mojo lookups to work + super.setUp(); + } + + + @Test + public void testStreamsScalaSourceGeneratorMojo() throws Exception { + + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-scala" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-N" ); + verifier.executeGoals( Lists.<String>newArrayList( + "compile")); + + verifier.verifyErrorFreeLog(); + + verifier.resetStreams(); + + File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-sources/scala-mojo"); + + assert( testOutput != null ); + assert( testOutput.exists() == true ); + assert( testOutput.isDirectory() == true ); + + Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) + .filter(scalaFilter); + Collection<File> outputCollection = Lists.newArrayList(outputIterator); + assert( outputCollection.size() > 133 ); + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-scala/src/test/java/org/apache/streams/plugins/test/StreamsScalaSourceGeneratorMojoTest.java ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-scala/src/test/java/org/apache/streams/plugins/test/StreamsScalaSourceGeneratorMojoTest.java b/streams-plugins/streams-plugin-scala/src/test/java/org/apache/streams/plugins/test/StreamsScalaSourceGeneratorMojoTest.java deleted file mode 100644 index 5393889..0000000 --- a/streams-plugins/streams-plugin-scala/src/test/java/org/apache/streams/plugins/test/StreamsScalaSourceGeneratorMojoTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 may not 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 applicable law 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.streams.plugins.test; - -import com.google.common.collect.Lists; -import com.google.common.io.Files; -import junit.framework.TestCase; -import org.apache.maven.it.Verifier; -import org.apache.maven.it.util.ResourceExtractor; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static org.apache.streams.plugins.test.StreamsScalaSourceGeneratorTest.scalaFilter; - -/** - * Tests that streams-plugin-pojo running via maven can convert activity schemas into pojos - * which then compile. - */ -public class StreamsScalaSourceGeneratorMojoTest extends TestCase { - - private final static Logger LOGGER = LoggerFactory.getLogger(StreamsScalaSourceGeneratorMojoTest.class); - - protected void setUp() throws Exception - { - // required for mojo lookups to work - super.setUp(); - } - - - @Test - public void testStreamsScalaSourceGeneratorMojo() throws Exception { - - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/streams-plugin-scala" ); - - Verifier verifier; - - verifier = new Verifier( testDir.getAbsolutePath() ); - - List cliOptions = new ArrayList(); - cliOptions.add( "-N" ); - verifier.executeGoals( Lists.<String>newArrayList( - "compile")); - - verifier.verifyErrorFreeLog(); - - verifier.resetStreams(); - - File testOutput = new File(testDir.getAbsolutePath() + "/target/generated-sources/scala-mojo"); - - assert( testOutput != null ); - assert( testOutput.exists() == true ); - assert( testOutput.isDirectory() == true ); - - Iterable<File> outputIterator = Files.fileTreeTraverser().breadthFirstTraversal(testOutput) - .filter(scalaFilter); - Collection<File> outputCollection = Lists.newArrayList(outputIterator); - assert( outputCollection.size() > 133 ); - - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/7662e273/streams-plugins/streams-plugin-scala/src/test/resources/streams-plugin-scala/pom.xml ---------------------------------------------------------------------- diff --git a/streams-plugins/streams-plugin-scala/src/test/resources/streams-plugin-scala/pom.xml b/streams-plugins/streams-plugin-scala/src/test/resources/streams-plugin-scala/pom.xml index 88b3648..9cf2378 100644 --- a/streams-plugins/streams-plugin-scala/src/test/resources/streams-plugin-scala/pom.xml +++ b/streams-plugins/streams-plugin-scala/src/test/resources/streams-plugin-scala/pom.xml @@ -28,19 +28,46 @@ <packaging>jar</packaging> <name>Test StreamsPojoScalaMojo</name> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> - <scope>test</scope> - </dependency> - </dependencies> + <repositories> + <repository> + <id>apache-repo</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> <pluginRepositories> <pluginRepository> <id>apache-repo</id> <name>Apache Repository</name> + <url>https://repository.apache.org/content/repositories/releases</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>apache-snapshots</id> + <name>Apache Repository</name> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> @@ -51,6 +78,22 @@ </pluginRepository> </pluginRepositories> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.streams</groupId> + <artifactId>streams-pojo</artifactId> + <version>${project.version}</version> + <scope>test</scope> + <type>jar</type> + </dependency> + </dependencies> + <build> <plugins> <plugin>
