@@ -34,12 +34,11 @@ |
<file>file:/od/projects/csip-all/csip-example/test/service_tests/simpleservice_V1_0/simple-res.json</file> |
<file>file:/od/projects/csip-all/csip-example/test/service_tests/externalexe/simple-res.json</file> |
</group> |
- <group name="csip-nrcs"/> |
<group name="csip-core"> |
- <file>file:/od/projects/csip-all/csip-example/deploy/localhost/csip.sh</file> |
- <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V2_0.json</file> |
<file>file:/od/projects/csip-all/csip-example/nbproject/project.properties</file> |
<file>file:/od/projects/csip-all/csip-example/nbproject/build-impl.xml</file> |
+ <file>file:/od/projects/csip-all/csip-example/src/java/m/example/simpleservice/V2_0.json</file> |
</group> |
+ <group name="csip-nrcs"/> |
</open-files> |
</project-private> |
@@ -24,14 +24,14 @@ |
@Polling(first = 2000, next = 2000) |
@Resources({ |
// resource definition for the mod.exe executable |
- @Resource(file = "/bin/lin-amd64/mod.exe", id = "mod", type = EXECUTABLE), |
+ @Resource(file = "/bin/lin-amd64/mod.exe", id = "mod", type = EXECUTABLE), // arguments in code. |
// list all the files (wildcards alowed) that should be captured as output) |
@Resource(file = "*stdout.txt *stderr.txt", type = OUTPUT) |
}) |
public class V1_0 extends ModelDataService { |
|
@Override |
- protected String process() throws Exception { |
+ protected void doProcess() throws Exception { |
|
// get the resource by its 'id' |
Executable e = getResourceExe("mod"); |
@@ -39,7 +39,9 @@ |
e.setArguments("1", "2", "3"); |
// execute it |
int ret = e.exec(); |
+ |
+ System.out.println("ret " + ret); |
// return thye status. The output |
- return ret == 0 ? EXEC_OK : EXEC_FAILED; |
+ |
} |
} |
@@ -84,7 +84,7 @@ |
while (tFeatures.hasNext()) { |
Feature tFeature = tFeatures.next(); |
this.aoa_geometry = (Geometry) ((SimpleFeature) tFeature).getAttribute("geometry"); |
- LOG.log(INFO, "Feature geometry " + count + " recieved was: {0}", this.aoa_geometry.toText()); |
+ LOG.log(INFO, "Feature geometry " + count + " recieved was:" + this.aoa_geometry.toText()); |
count++; |
// Do something with this particular feature here...OR just grab the first one if only one was specified. |
// This particular code assumes only one was specified, but can easily be altered to send more than one |
@@ -99,11 +99,11 @@ |
this.aoa_geometry = (Geometry) ((SimpleFeature) tFeature).getAttribute("geometry"); |
// Here we could pull out the Feature's properies as well... |
if ( LOG.isLoggable(INFO) ){ |
- LOG.log(INFO, "This Feature''s Id is: {0}", ((SimpleFeature) tFeature).getID()); |
- LOG.log(INFO, "This Feature''s name is: {0}", ((SimpleFeature) tFeature).getAttribute("name")); |
+ LOG.log(INFO, "This Feature''s Id is: " +((SimpleFeature) tFeature).getID()); |
+ LOG.log(INFO, "This Feature''s name is: " + ((SimpleFeature) tFeature).getAttribute("name")); |
|
//NOTE: For some reason, property values that are arrays (as in the example JSON), don't get read, so watch out for this! |
- LOG.log(INFO, "This Feature''s adjustment factor is: {0}", ((SimpleFeature) tFeature).getAttribute("AdjustmentFactor")); |
+ LOG.log(INFO, "This Feature''s adjustment factor is:" + ((SimpleFeature) tFeature).getAttribute("AdjustmentFactor")); |
} |
|
} |
@@ -119,7 +119,7 @@ |
// TODO: Add your code here to do something with the geometry(ies) you read in. |
// For instance: See code lines below: (NOTE: The .toText() funciton of "Geometry" returns WKT..) |
// Log the WKT of the input. |
- LOG.log(INFO, "Last aoa_geometry value recieved was: {0}", this.aoa_geometry.toText()); |
+ LOG.log(INFO, "Last aoa_geometry value recieved was: " + this.aoa_geometry.toText()); |
|
// PostGIS specific SQL statement below to calculate area in acres. |
exampleQuery1 = "SELECT st_area(st_transform(ST_PolygonFromText('" + this.aoa_geometry.toText() + "', 4326),3541))/43560 as areaInAcres; "; |
@@ -18,13 +18,23 @@ |
@Rule |
public TestName name = new TestName(); |
|
+ |
private void run() throws Exception { |
- String testFolder = new File(getClass().getCanonicalName().replace('.', '/')).getParent(); |
- JSONArray r = ServiceTest2.run(new Properties(), "test/" + testFolder + "/" + name.getMethodName() + ".json"); |
- Assert.assertTrue(r.getJSONObject(0).getInt("successful") == 1); |
+ for (int i = 0; i < 5000; i++) { |
+ String testFolder = new File(getClass().getCanonicalName().replace('.', '/')).getParent(); |
+ JSONArray r = ServiceTest2.run(new Properties(), "test/" + testFolder + "/" + name.getMethodName() + ".json"); |
+ Assert.assertTrue(r.getJSONObject(0).getInt("successful") == 1); |
+ System.out.println(i); |
+ Thread.sleep(1000); |
+ System.out.flush(); |
+ } |
} |
|
- @Test public void m_simpleservice_2_0__base() throws Exception { run(); } |
- @Test public void m_simpleservice_2_0__variant() throws Exception { run(); } |
- @Test public void m_simpleservice_2_0__zero() throws Exception { run(); } |
+ |
+ @Test |
+ public void m_simpleservice_2_0__base() throws Exception { |
+ run(); |
+ } |
+// @Test public void m_simpleservice_2_0__variant() throws Exception { run(); } |
+// @Test public void m_simpleservice_2_0__zero() throws Exception { run(); } |
} |
@@ -1,12 +1,11 @@ |
{ |
"csip.session.backend": "mongodb", |
- "csip.session.ttl": "PT300S", |
+ "csip.session.ttl": "PT0S", |
"csip.archive.backend": "none", |
"csip.archive.ttl": "PT20S", |
"csip.logging.backend": "none", |
- "csip.resultstore.backend": "mongodb", |
+ "csip.resultstore.backend": "none", |
"csip.accesslog.backend": "none", |
- "csip.archive.max.filesize": "100MB", |
"connect.url": "jdbc:postgresql://localhost/od?user=od&password=od", |
"od":"test", |
"mssql.db": "jdbc:sqlserver:\/\/129.82.20.241:1433;databaseName=conservation_resources;user=sa;password=csurams#1" |