Skip to content
Permalink
Browse files

Remove the property test.contextURL.

  • Loading branch information
taojing2002 committed Feb 16, 2018
1 parent 9f942ad commit d9588e8369bdc5085c3bc9e2611a74515441e5e4
@@ -560,7 +560,7 @@ executionEngine.resultDestinationRepository=sanparksRepository:keplerRepository:

test.printdebug=true
test.metacatUrl=http://localhost:8080/metacat/metacat
test.contextUrl=http://localhost:8080/metacat
#test.contextUrl=http://localhost:8080/metacat
test.workflowSchedulerUrl=http://localhost:8080/workflowscheduler/scheduler
#test.metacatDeployDir=/opt/local/share/java/tomcat7/webapps/metacat
test.mcUser=uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org
@@ -19,6 +19,7 @@
import org.junit.Test;
import edu.ucsb.nceas.MCTestCase;
import edu.ucsb.nceas.metacat.properties.PropertyService;
import edu.ucsb.nceas.metacat.util.SystemUtil;

public class MultiThreadClientIT extends MCTestCase {
//need to configure this.
@@ -30,9 +31,10 @@
private static String mnURL = null;
static {
try {
mnURL = PropertyService.getProperty("test.contextUrl")+"/d1/mn";
mnURL = SystemUtil.getContextURL()+"/d1/mn";
//System.out.println("============================the member node url is "+mnURL);
} catch (Exception e) {
log.error("MultiThreadClientIT - can't find the test.contexturl from the metacat.porperties file.", e);
log.error("MultiThreadClientIT - can't find the contexturl from the metacat.porperties file.", e);
}
}

@@ -46,6 +46,7 @@
import edu.ucsb.nceas.metacat.client.MetacatFactory;
import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
import edu.ucsb.nceas.metacat.properties.PropertyService;
import edu.ucsb.nceas.metacat.util.SystemUtil;
import edu.ucsb.nceas.utilities.FileUtil;
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
import edu.ucsb.nceas.utilities.UtilException;
@@ -768,7 +769,7 @@ public void includedSchemaRegisterTest() {
* @param documentLocation
* the path of the document to read.
* @return a string holding the contents of the document with the contextUrl
* token replaced by the test.contextUrl property
* token replaced by the context url
*/
private String getTestDocument(String documentLocation) throws IOException,
PropertyNotFoundException {
@@ -779,7 +780,8 @@ private String getTestDocument(String documentLocation) throws IOException,
throw new IOException("Error reading file to string: " + ue.getMessage());
}

String contextUrl = PropertyService.getProperty("test.contextUrl");
String contextUrl = SystemUtil.getContextURL();
//System.out.println("The context url is ========================"+contextUrl);
testDocument = testDocument.replaceAll("@contextUrl@", contextUrl);

return testDocument;
@@ -44,6 +44,7 @@
import edu.ucsb.nceas.metacat.client.rest.MetacatRest;
import edu.ucsb.nceas.metacat.client.rest.MetacatRestClient;
import edu.ucsb.nceas.metacat.properties.PropertyService;
import edu.ucsb.nceas.metacat.util.SystemUtil;
import edu.ucsb.nceas.utilities.IOUtil;
import edu.ucsb.nceas.utilities.PropertyNotFoundException;

@@ -57,7 +58,8 @@
protected static String contextUrl;
static {
try {
contextUrl = PropertyService.getProperty("test.contextUrl");
contextUrl = SystemUtil.getContextURL();
//System.out.println("The conext url is =========================="+contextUrl);
username = PropertyService.getProperty("test.mcUser");
password = PropertyService.getProperty("test.mcPassword");
anotheruser = PropertyService.getProperty("test.mcAnotherUser");

0 comments on commit d9588e8

Please sign in to comment.
You can’t perform that action at this time.