Project

General

Profile

« Previous | Next » 

Revision 7264

Added by Jing Tao over 12 years ago

Use a final static string to replace the hard code.
Search document title rather than id in testReplicateEML_AtoB method.

View differences:

test/edu/ucsb/nceas/metacat/replication/ReplicationTest.java
54 54
    private static final long forceReplicationSleep = 1 * 60 * 1000;
55 55
	private String targetReplicationServer = null;
56 56
	private Metacat targetMetacat = null;
57
	private final static String TITLE = "Test replication";
57 58
    
58 59
	/**
59 60
     * Constructor to build the test
......
115 116
    
116 117
    public void testCertificate() {
117 118
    	try {
119
    	  //System.out.println("test certificate ============");
118 120
    		URL u = new URL("https://" + targetReplicationServer  + "/servlet/replication?server=" + MetacatUtil.getLocalReplicationServerName() + "&action=test");
119 121
			String test = ReplicationService.getURLContent(u);
122
			//System.out.println("the result is "+test);
120 123
			assertTrue(test.contains("Test successfully"));
121 124
			
122 125
    	} catch (Exception e) {
......
216 219
    		// the test data, no public access
217 220
    		String emlContent = null;
218 221
			emlContent = getTestEmlDoc(
219
    				"Test replication", //title, 
222
    				TITLE, //title, 
220 223
    				EML2_1_0, //emlVersion, 
221 224
    				null, //inlineData1, 
222 225
    				null, //inlineData2, 
......
249 252
    		docid = baseDocid + "." + 2;
250 253
    		//emlContent = getTestEmlDoc("Test replication2", EML2_1_0);
251 254
    		emlContent = getTestEmlDoc(
252
    				"Test replication", //title, 
255
    				TITLE, //title, 
253 256
    				EML2_1_0, //emlVersion, 
254 257
    				null, //inlineData1, 
255 258
    				null, //inlineData2, 
......
298 301
    		Thread.sleep(forceReplicationSleep);
299 302
    		
300 303
			// query for the docid -- should not be returned since it is archived
301
			String queryString = getTestEmlQuery(docid, EML2_1_0);
304
			String queryString = getTestEmlQuery(TITLE, EML2_1_0);
302 305
			System.out.println("queryString: " + queryString);
303 306
			Reader xmlQuery = new StringReader(queryString);
304 307
			Reader resultReader = targetMetacat.query(xmlQuery);

Also available in: Unified diff