Project

General

Profile

« Previous | Next » 

Revision 8810

add support for v2 DataONE API.

View differences:

SyncAccessPolicyTest.java
34 34
import junit.framework.Test;
35 35
import junit.framework.TestSuite;
36 36

  
37
import org.dataone.client.CNode;
38
import org.dataone.client.D1Client;
37
import org.dataone.client.v2.CNode;
38
import org.dataone.client.v2.itk.D1Client;
39 39
import org.dataone.service.exceptions.ServiceFailure;
40 40
import org.dataone.service.types.v1.AccessPolicy;
41 41
import org.dataone.service.types.v1.AccessRule;
......
43 43
import org.dataone.service.types.v1.Permission;
44 44
import org.dataone.service.types.v1.Session;
45 45
import org.dataone.service.types.v1.Subject;
46
import org.dataone.service.types.v1.SystemMetadata;
46
import org.dataone.service.types.v2.SystemMetadata;
47 47
import org.junit.Before;
48 48

  
49 49
import edu.ucsb.nceas.metacat.IdentifierManager;
......
199 199
				// Get sm, access policy for requested pid from the CN
200 200
				// Get sm, access policy for requested pid from the CN
201 201
				try {
202
					cnSysMeta = cn.getSystemMetadata(pid);
202
					cnSysMeta = cn.getSystemMetadata(null, pid);
203 203
					debug("Got SM from CN");
204 204

  
205 205
				} catch (Exception e) {
......
222 222
			/* Read SM from MN */
223 223
			try {
224 224
				mnSysMeta = MNodeService.getInstance(request)
225
						.getSystemMetadata(pid);
225
						.getSystemMetadata(null, pid);
226 226
				debug("Got SM from MN");
227 227
			} catch (Exception e) {
228 228
				fail("Error getting system metadata for new pid: "
......
268 268
			/* Reread SM from MN after updating access */
269 269
			try {
270 270
				mnSysMeta = MNodeService.getInstance(request)
271
						.getSystemMetadata(pid);
271
						.getSystemMetadata(null, pid);
272 272
				debug("Got SM from MN");
273 273
			} catch (Exception e) {
274 274
				fail("Error getting system metadata for new pid: "
......
309 309

  
310 310
			/* Reread SM from CN */
311 311
			try {
312
				cnSysMeta = cn.getSystemMetadata(pid);
312
				cnSysMeta = cn.getSystemMetadata(null, pid);
313 313
				debug("Got SM from CN");
314 314
			} catch (Exception e) {
315 315
				fail("Error getting system metadata for pid: " + pid.getValue()
......
448 448
				Thread.sleep(1000 * 60);
449 449
				// Get sm for data object pid from the CN
450 450
				try {
451
					cnSysMeta = cn.getSystemMetadata(pid);
451
					cnSysMeta = cn.getSystemMetadata(null, pid);
452 452
				} catch (Exception e) {
453 453
					debug("Error getting system metadata for pid: "
454 454
							+ pid.getValue() + " from cn: " + e.getMessage());
......
501 501
			}
502 502
			/* Get CN access policy for data object */
503 503
			try {
504
				cnSysMeta = cn.getSystemMetadata(pid);
504
				cnSysMeta = cn.getSystemMetadata(null, pid);
505 505
			} catch (Exception e) {
506 506
				debug("Error getting system metadata for pid: "
507 507
						+ pid.getValue() + " from cn: " + e.getMessage());

Also available in: Unified diff