You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2013/11/22 20:09:35 UTC
svn commit: r1544644 - in /uima/sandbox/uima-ducc/trunk/uima-ducc-common/src:
main/java/org/apache/uima/ducc/common/uima/UimaUtils.java
test/java/org/apache/uima/ducc/common/test/cmd/UimaUtilsTest.java
Author: degenaro
Date: Fri Nov 22 19:09:34 2013
New Revision: 1544644
URL: http://svn.apache.org/r1544644
Log:
UIMA-3442 DUCC pre-R1.0 has classes that look like tests in the main?
Added:
uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/test/java/org/apache/uima/ducc/common/test/cmd/UimaUtilsTest.java
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/uima/UimaUtils.java
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/uima/UimaUtils.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/uima/UimaUtils.java?rev=1544644&r1=1544643&r2=1544644&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/uima/UimaUtils.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/uima/UimaUtils.java Fri Nov 22 19:09:34 2013
@@ -542,61 +542,4 @@ public class UimaUtils {
}
}
- public static void main(String[] args) {
- try {
-
- System.setProperty(FlowControllerResourceSpecifier, "org.apache.uima.flow.FixedFlowController");
- String fname = "0-uima-ae-descriptor-"+Utils.getPID()+".xml";
- UimaASPrimitiveDeploymentDescriptor d = createUimaASDeploymentDescriptor(
- "test", "testDescr", "tcp://localhost:61616",
- "testEndpoint", 4, "c:/tmp", fname, args);
- System.out.println(d.toXML());
-
- List<String> cmOverrides = new ArrayList<String>();
- List<String> aeOverrides = new ArrayList<String>();
- List<String> ccOverrides = new ArrayList<String>();
- ccOverrides.add("outputDir=/home/ducc");
- // aeOverrides.add("ErrorFrequency=4");
- // aeOverrides.add("ProcessDelay=4000");
-
- List<List<String>> overrides = new ArrayList<List<String>>();
- overrides.add(cmOverrides);
- overrides.add(aeOverrides);
- overrides.add(ccOverrides);
-
- AnalysisEngineDescription aed = UimaUtils
- .createAggregateDescription(true, overrides, args);
- aed.toXML(System.out);
- /*
- * File tempAEDescriptorFile = null; File duccTempDir = new
- * File("c:/tmp"); if ( !duccTempDir.exists()) {
- * duccTempDir.mkdir(); } tempAEDescriptorFile =
- * File.createTempFile( "UimaAEDescriptor", ".xml",duccTempDir);
- * tempAEDescriptorFile.deleteOnExit(); FileOutputStream fos = new
- * FileOutputStream(tempAEDescriptorFile); // Save xml descriptor
- * into a default (OS specific) temp directory aed.toXML(fos);
- * fos.close();
- *
- *
- * ResourceSpecifier rs =
- * UimaClassFactory.produceResourceSpecifier(tempAEDescriptorFile
- * .getAbsolutePath()); UIMAFramework.produceAnalysisEngine(rs);
- *
- * UimaASPrimitiveDeploymentDescriptor dd = UimaUtils
- * .createUimaASDeploymentDescriptor("Test", "Test Description",
- * "tcp://localhost:61616", "TestQueue", 2,
- * Utils.resolvePlaceholderIfExists("${DUCC_HOME}/tmp",
- * System.getProperties()),args); System.out.println(dd.toXML());
- * File tempddDescriptorFile = null; tempddDescriptorFile =
- * File.createTempFile( "UimaASDeploymentDescriptor", ".xml");
- * tempddDescriptorFile.deleteOnExit();
- *
- * BufferedWriter out = new BufferedWriter(new
- * FileWriter(tempddDescriptorFile)); out.write(dd.toXML());
- * out.close();
- */
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
}
Added: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/test/java/org/apache/uima/ducc/common/test/cmd/UimaUtilsTest.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/test/java/org/apache/uima/ducc/common/test/cmd/UimaUtilsTest.java?rev=1544644&view=auto
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/test/java/org/apache/uima/ducc/common/test/cmd/UimaUtilsTest.java (added)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/test/java/org/apache/uima/ducc/common/test/cmd/UimaUtilsTest.java Fri Nov 22 19:09:34 2013
@@ -0,0 +1,88 @@
+/*
+ * 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.uima.ducc.common.test.cmd;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
+import org.apache.uima.ducc.common.uima.UimaUtils;
+import org.apache.uima.ducc.common.utils.Utils;
+import org.apache.uima.resourceSpecifier.factory.UimaASPrimitiveDeploymentDescriptor;
+
+
+public class UimaUtilsTest {
+
+ public static void main(String[] args) {
+ try {
+ System.setProperty(UimaUtils.FlowControllerResourceSpecifier, "org.apache.uima.flow.FixedFlowController");
+ String fname = "0-uima-ae-descriptor-"+Utils.getPID()+".xml";
+ UimaASPrimitiveDeploymentDescriptor d = UimaUtils.createUimaASDeploymentDescriptor(
+ "test", "testDescr", "tcp://localhost:61616",
+ "testEndpoint", 4, "c:/tmp", fname, args);
+ System.out.println(d.toXML());
+
+ List<String> cmOverrides = new ArrayList<String>();
+ List<String> aeOverrides = new ArrayList<String>();
+ List<String> ccOverrides = new ArrayList<String>();
+ ccOverrides.add("outputDir=/home/ducc");
+ // aeOverrides.add("ErrorFrequency=4");
+ // aeOverrides.add("ProcessDelay=4000");
+
+ List<List<String>> overrides = new ArrayList<List<String>>();
+ overrides.add(cmOverrides);
+ overrides.add(aeOverrides);
+ overrides.add(ccOverrides);
+
+ AnalysisEngineDescription aed = UimaUtils
+ .createAggregateDescription(true, overrides, args);
+ aed.toXML(System.out);
+ /*
+ * File tempAEDescriptorFile = null; File duccTempDir = new
+ * File("c:/tmp"); if ( !duccTempDir.exists()) {
+ * duccTempDir.mkdir(); } tempAEDescriptorFile =
+ * File.createTempFile( "UimaAEDescriptor", ".xml",duccTempDir);
+ * tempAEDescriptorFile.deleteOnExit(); FileOutputStream fos = new
+ * FileOutputStream(tempAEDescriptorFile); // Save xml descriptor
+ * into a default (OS specific) temp directory aed.toXML(fos);
+ * fos.close();
+ *
+ *
+ * ResourceSpecifier rs =
+ * UimaClassFactory.produceResourceSpecifier(tempAEDescriptorFile
+ * .getAbsolutePath()); UIMAFramework.produceAnalysisEngine(rs);
+ *
+ * UimaASPrimitiveDeploymentDescriptor dd = UimaUtils
+ * .createUimaASDeploymentDescriptor("Test", "Test Description",
+ * "tcp://localhost:61616", "TestQueue", 2,
+ * Utils.resolvePlaceholderIfExists("${DUCC_HOME}/tmp",
+ * System.getProperties()),args); System.out.println(dd.toXML());
+ * File tempddDescriptorFile = null; tempddDescriptorFile =
+ * File.createTempFile( "UimaASDeploymentDescriptor", ".xml");
+ * tempddDescriptorFile.deleteOnExit();
+ *
+ * BufferedWriter out = new BufferedWriter(new
+ * FileWriter(tempddDescriptorFile)); out.write(dd.toXML());
+ * out.close();
+ */
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}