Repository: incubator-rya Updated Branches: refs/heads/master 59570b4f7 -> dd22a7d0f
RYA-183; created ExamplesTest.java, RyaDirectExample.java fixed a catch that could hide defects. Closes #98 Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/dd22a7d0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/dd22a7d0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/dd22a7d0 Branch: refs/heads/master Commit: dd22a7d0fde1eefc930effd0f894b587755b3b1f Parents: 59570b4 Author: David W. Lotts <david.lo...@parsons.com> Authored: Fri Sep 30 12:47:46 2016 -0400 Committer: Aaron Mihalik <miha...@alum.mit.edu> Committed: Wed Oct 12 16:47:02 2016 -0400 ---------------------------------------------------------------------- .../src/main/java/RyaDirectExample.java | 2 +- .../src/test/java/ExamplesTest.java | 61 ++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/dd22a7d0/extras/indexingExample/src/main/java/RyaDirectExample.java ---------------------------------------------------------------------- diff --git a/extras/indexingExample/src/main/java/RyaDirectExample.java b/extras/indexingExample/src/main/java/RyaDirectExample.java index 8c609b4..522f840 100644 --- a/extras/indexingExample/src/main/java/RyaDirectExample.java +++ b/extras/indexingExample/src/main/java/RyaDirectExample.java @@ -786,7 +786,7 @@ public class RyaDirectExample { queryString2, new String[] { "e", "c", "l", "o" }, Optional.<PcjVarOrderFactory> absent()); } catch (final RyaDAOException e) { - e.printStackTrace(); + throw new Error("While creating PCJ tables.",e); } finally { closeQuietly(conn); closeQuietly(repository); http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/dd22a7d0/extras/indexingExample/src/test/java/ExamplesTest.java ---------------------------------------------------------------------- diff --git a/extras/indexingExample/src/test/java/ExamplesTest.java b/extras/indexingExample/src/test/java/ExamplesTest.java new file mode 100644 index 0000000..2d0aa53 --- /dev/null +++ b/extras/indexingExample/src/test/java/ExamplesTest.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + + +import org.junit.Test; + +/** + * Solves the problem of examples getting bugs when tests are passing. + * Fixers generally don't run the examples or don't know they are affecting the examples. + * Examples generally create and destroy a mock instance of Accumulo, or a test instance of MongoDB. + */ +public class ExamplesTest { + /** + * Calls main. Fails if errors are thrown and not caught. parameters are not used. + * @throws Exception + */ + @Test + public void RyaDirectExampleTest() throws Exception { + RyaDirectExample.main(new String[] {}); + } + /** + * Calls main. Fails if errors are thrown and not caught. parameters are not used. + * @throws Exception + */ + @Test + public void RyaClientExampleTest() throws Exception { + RyaClientExample.main(new String[] {}); + } + /** + * Calls main. Fails if errors are thrown and not caught. parameters are not used. + * @throws Exception + */ + @Test + public void MongoRyaDirectExampleTest() throws Exception { + MongoRyaDirectExample.main(new String[] {}); + } + /** + * Calls main. Fails if errors are thrown and not caught. parameters are not used. + * @throws Exception + */ + @Test + public void EntityDirectExampleTest() throws Exception { + EntityDirectExample.main(new String[] {}); + } +}