You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@heron.apache.org by GitBox <gi...@apache.org> on 2018/05/08 06:09:20 UTC

[GitHub] kramasamy closed pull request #2894: fixing test

kramasamy closed pull request #2894: fixing test
URL: https://github.com/apache/incubator-heron/pull/2894
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/eco/tests/java/org/apache/heron/eco/parser/EcoParserTest.java b/eco/tests/java/org/apache/heron/eco/parser/EcoParserTest.java
index 9e665b77b8..30c41e1b2b 100644
--- a/eco/tests/java/org/apache/heron/eco/parser/EcoParserTest.java
+++ b/eco/tests/java/org/apache/heron/eco/parser/EcoParserTest.java
@@ -16,7 +16,94 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-\n"
+package org.apache.heron.eco.parser;
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.powermock.api.mockito.PowerMockito;
+
+import org.apache.heron.eco.definition.BeanDefinition;
+import org.apache.heron.eco.definition.BeanReference;
+import org.apache.heron.eco.definition.BoltDefinition;
+import org.apache.heron.eco.definition.EcoTopologyDefinition;
+import org.apache.heron.eco.definition.GroupingDefinition;
+import org.apache.heron.eco.definition.PropertyDefinition;
+import org.apache.heron.eco.definition.StreamDefinition;
+
+import static junit.framework.TestCase.assertNotNull;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.*;
+
+
+/**
+ * Unit tests for {@link EcoParser}
+ */
+public class EcoParserTest {
+
+  private static final String BOLT_1 = "bolt-1";
+  private static final String BOLT_2 = "bolt-2";
+  private static final String YAML_NO_CONFIG_STR = "# topology definition\n"
+      + "# name to be used when submitting\n"
+      + "name: \"yaml-topology\"\n"
+      + "\n"
+      + "# topology configuration\n"
+      + "# this will be passed to the submitter as a map of config options\n"
+      + "#\n"
+      + "# spout definitions\n"
+      + "spouts:\n"
+      + "  - id: \"spout-1\"\n"
+      + "    className: \"org.apache.heron.sample.TestWordSpout\"\n"
+      + "    parallelism: 1\n"
+      + "\n"
+      + "# bolt definitions\n"
+      + "bolts:\n"
+      + "  - id: \"bolt-1\"\n"
+      + "    className: \"org.apache.heron.sample.TestWordCounter\"\n"
+      + "    parallelism: 2\n"
+      + "\n"
+      + "  - id: \"bolt-2\"\n"
+      + "    className: \"org.apache.heron.sample.LogInfoBolt\"\n"
+      + "    parallelism: 1\n"
+      + "\n"
+      + "#stream definitions\n"
+      + "# stream definitions define connections between spouts and bolts.\n"
+      + "# note that such connections can be cyclical\n"
+      + "streams:\n"
+      + "  - name: \"spout-1 --> bolt-1\" # name isn't used (placeholder for logging, UI, etc.)\n"
+      + "    id: \"connection-1\"\n"
+      + "    from: \"spout-1\"\n"
+      + "    to: \"bolt-1\"\n"
+      + "    grouping:\n"
+      + "      type: FIELDS\n"
+      + "      args: [\"word\"]\n"
+      + "\n"
+      + "  - name: \"bolt-1 --> bolt2\"\n"
+      + "    id: \"connection-2\"\n"
+      + "    from: \"bolt-1\"\n"
+      + "    to: \"bolt-2\"\n"
+      + "    grouping:\n"
+      + "      type: SHUFFLE";
+  private static final String YAML_STR = "# Licensed to the Apache Software Foundation"
+      + " (ASF) under one\n"
+      + "# or more contributor license agreements.  See the NOTICE file\n"
+      + "# distributed with this work for additional information\n"
+      + "# regarding copyright ownership.  The ASF licenses this file\n"
+      + "# to you under the Apache License, Version 2.0 (the\n"
+      + "# \"License\"); you may not use this file except in compliance\n"
+      + "# with the License.  You may obtain a copy of the License at\n"
+      + "#\n"
+      + "# http://www.apache.org/licenses/LICENSE-2.0\n"
+      + "#\n"
+      + "# Unless required by applicable law or agreed to in writing, software\n"
+      + "# distributed under the License is distributed on an \"AS IS\" BASIS,\n"
+      + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
+      + "# See the License for the specific language governing permissions and\n"
+      + "# limitations under the License.\n"
       + "\n"
       + "---\n"
       + "\n"


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services