Repository: incubator-rya
Updated Branches:
  refs/heads/master 4666d92e6 -> 6a18d7ad6


RYA-371, Closes #230.   Added a .sh script for RyaDirectExample to match the 
.bat file in the indexingExample distribution.  Added similar scripts to run 
MongoRyaDirectExample.


Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/6a18d7ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/6a18d7ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/6a18d7ad

Branch: refs/heads/master
Commit: 6a18d7ad66eaf13c99efab8cef63632aea5b494b
Parents: 4666d92
Author: eric.white <eric.wh...@parsons.com>
Authored: Thu Sep 21 11:11:02 2017 -0400
Committer: pujav65 <puja...@gmail.com>
Committed: Tue Oct 3 15:11:14 2017 -0400

----------------------------------------------------------------------
 .../src/main/assembly/assembly.xml              | 16 +++++++
 .../src/main/java/MongoRyaDirectExample.java    |  8 ++--
 .../main/scripts/RunMongoRyaDirectExample.bat   | 48 ++++++++++++++++++++
 .../main/scripts/RunMongoRyaDirectExample.sh    | 39 ++++++++++++++++
 .../src/main/scripts/RunRyaDirectExample.bat    |  7 +++
 .../src/main/scripts/RunRyaDirectExample.sh     | 39 ++++++++++++++++
 6 files changed, 154 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6a18d7ad/extras/indexingExample/src/main/assembly/assembly.xml
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/assembly/assembly.xml 
b/extras/indexingExample/src/main/assembly/assembly.xml
index 4534f41..af3fff9 100644
--- a/extras/indexingExample/src/main/assembly/assembly.xml
+++ b/extras/indexingExample/src/main/assembly/assembly.xml
@@ -62,9 +62,25 @@ under the License.
             <outputDirectory>dist</outputDirectory>
         </file>
         <file>
+            <source>src/main/scripts/RunRyaDirectExample.sh</source>
+            <outputDirectory>dist</outputDirectory>
+        </file>
+        <file>
             <source>src/main/java/RyaDirectExample.java</source>
             <outputDirectory>dist</outputDirectory>
         </file>
+        <file>
+            <source>src/main/scripts/RunMongoRyaDirectExample.bat</source>
+            <outputDirectory>dist</outputDirectory>
+        </file>
+        <file>
+            <source>src/main/scripts/RunMongoRyaDirectExample.sh</source>
+            <outputDirectory>dist</outputDirectory>
+        </file>
+        <file>
+            <source>src/main/java/MongoRyaDirectExample.java</source>
+            <outputDirectory>dist</outputDirectory>
+        </file>
     </files>
     <fileSets>
         <!-- Add Apache licenses to the distribution zip -->

http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6a18d7ad/extras/indexingExample/src/main/java/MongoRyaDirectExample.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/MongoRyaDirectExample.java 
b/extras/indexingExample/src/main/java/MongoRyaDirectExample.java
index a7cf2e5..4883427 100644
--- a/extras/indexingExample/src/main/java/MongoRyaDirectExample.java
+++ b/extras/indexingExample/src/main/java/MongoRyaDirectExample.java
@@ -78,6 +78,8 @@ public class MongoRyaDirectExample {
     private static final String MONGO_COLL_PREFIX = "rya_";
     private static final boolean USE_MOCK = true;
     private static final boolean USE_INFER = true;
+    private static final String MONGO_USER = null;
+    private static final String MONGO_PASSWORD = null;
     private static final String MONGO_INSTANCE_URL = "localhost";
     private static final String MONGO_INSTANCE_PORT = "27017";
 
@@ -303,8 +305,8 @@ public class MongoRyaDirectExample {
             builder.setMongoHost(url).setMongoPort(port);
         } else {
             // User name and password must be filled in:
-            builder = builder.setMongoUser("fill this in")
-                             .setMongoPassword("fill this in")
+            builder = builder.setMongoUser(MONGO_USER)
+                             .setMongoPassword(MONGO_PASSWORD)
                              .setMongoHost(MONGO_INSTANCE_URL)
                              .setMongoPort(MONGO_INSTANCE_PORT);
         }
@@ -763,7 +765,7 @@ public class MongoRyaDirectExample {
         for (final Namespace space : Iterations.asList(results)){
             System.out.println(space.getName() + ", " + space.getPrefix());
         }
-      }
+    }
 
     public static void testAddAndDeleteNoContext(final 
SailRepositoryConnection conn) throws MalformedQueryException, 
RepositoryException,
     UpdateExecutionException, QueryEvaluationException, 
TupleQueryResultHandlerException {

http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6a18d7ad/extras/indexingExample/src/main/scripts/RunMongoRyaDirectExample.bat
----------------------------------------------------------------------
diff --git 
a/extras/indexingExample/src/main/scripts/RunMongoRyaDirectExample.bat 
b/extras/indexingExample/src/main/scripts/RunMongoRyaDirectExample.bat
new file mode 100644
index 0000000..36b0fbd
--- /dev/null
+++ b/extras/indexingExample/src/main/scripts/RunMongoRyaDirectExample.bat
@@ -0,0 +1,48 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements.  See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership.  The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License.  You may obtain a copy of the License at
+rem 
+rem   http://www.apache.org/licenses/LICENSE-2.0
+rem 
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied.  See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
+
+SET name="Mongo Rya Direct Example"
+echo "Starting %name%"
+
+SET CP=
+
+REM Check to see if javac is on the path
+where /Q javac
+IF %ERRORLEVEL% NEQ 0 goto :NO_JAVAC
+
+
+for /f %%f in ('DIR /b .\lib\*.jar') do call :append .\lib\%%f
+
+echo "Compiling %name%"
+javac -cp "%CP%" MongoRyaDirectExample.java
+echo "Running %name%"
+java -cp "%CP%" MongoRyaDirectExample
+
+echo "Finished %name%"
+goto :end
+
+:append
+@echo off
+SET CP=%CP%%1;
+goto :end
+
+:NO_JAVAC
+echo ERROR: Could not find javac
+goto :end
+
+:end

http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6a18d7ad/extras/indexingExample/src/main/scripts/RunMongoRyaDirectExample.sh
----------------------------------------------------------------------
diff --git 
a/extras/indexingExample/src/main/scripts/RunMongoRyaDirectExample.sh 
b/extras/indexingExample/src/main/scripts/RunMongoRyaDirectExample.sh
new file mode 100644
index 0000000..840d03d
--- /dev/null
+++ b/extras/indexingExample/src/main/scripts/RunMongoRyaDirectExample.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# 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.
+
+name="Mongo Rya Direct Example"
+echo "Starting $name"
+
+CP=""
+
+# Check to see if javac is on the path
+if which javac >/dev/null; then
+    for f in ./lib/*.jar; do
+        CP+="$f:"
+    done
+
+    echo "Compiling $name"
+    javac -cp "$CP" MongoRyaDirectExample.java
+    echo "Running $name"
+    java -cp "$CP" MongoRyaDirectExample
+
+    echo "Finished $name"
+else
+    echo "ERROR: Could not find javac"
+fi

http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6a18d7ad/extras/indexingExample/src/main/scripts/RunRyaDirectExample.bat
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/scripts/RunRyaDirectExample.bat 
b/extras/indexingExample/src/main/scripts/RunRyaDirectExample.bat
index a89e3d1..9d723f8 100644
--- a/extras/indexingExample/src/main/scripts/RunRyaDirectExample.bat
+++ b/extras/indexingExample/src/main/scripts/RunRyaDirectExample.bat
@@ -15,6 +15,10 @@ rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 rem KIND, either express or implied.  See the License for the
 rem specific language governing permissions and limitations
 rem under the License.
+
+SET name="Rya Direct Example"
+echo "Starting %name%"
+
 SET CP=
 
 REM Check to see if javac is on the path
@@ -24,9 +28,12 @@ IF %ERRORLEVEL% NEQ 0 goto :NO_JAVAC
 
 for /f %%f in ('DIR /b .\lib\*.jar') do call :append .\lib\%%f
 
+echo "Compiling %name%"
 javac -cp "%CP%" RyaDirectExample.java
+echo "Running %name%"
 java -cp "%CP%" RyaDirectExample
 
+echo "Finished %name%"
 goto :end
 
 :append

http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6a18d7ad/extras/indexingExample/src/main/scripts/RunRyaDirectExample.sh
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/scripts/RunRyaDirectExample.sh 
b/extras/indexingExample/src/main/scripts/RunRyaDirectExample.sh
new file mode 100644
index 0000000..f6cfdaa
--- /dev/null
+++ b/extras/indexingExample/src/main/scripts/RunRyaDirectExample.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# 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.
+
+name="Rya Direct Example"
+echo "Starting $name"
+
+CP=""
+
+# Check to see if javac is on the path
+if which javac >/dev/null; then
+    for f in ./lib/*.jar; do
+        CP+="$f:"
+    done
+
+    echo "Compiling $name"
+    javac -cp "$CP" RyaDirectExample.java
+    echo "Running $name"
+    java -cp "$CP" RyaDirectExample
+
+    echo "Finished $name"
+else
+    echo "ERROR: Could not find javac"
+fi

Reply via email to