Project

General

Profile

« Previous | Next » 

Revision 6329

include test for replicate() method -- still fails as not implemented

View differences:

test/edu/ucsb/nceas/metacat/dataone/MNodeServiceTest.java
56 56
import org.dataone.service.types.Log;
57 57
import org.dataone.service.types.MonitorList;
58 58
import org.dataone.service.types.Node;
59
import org.dataone.service.types.NodeReference;
59 60
import org.dataone.service.types.ObjectFormat;
60 61
import org.dataone.service.types.ObjectList;
61 62
import org.dataone.service.types.Permission;
......
116 117
    suite.addTest(new MNodeServiceTest("testGetLogRecords"));
117 118
    suite.addTest(new MNodeServiceTest("testGetOperationStatistics"));
118 119
    suite.addTest(new MNodeServiceTest("testGetCapabilities"));
120
    // include these when they are part of the MN interface definitions
119 121
    // suite.addTest(new MNodeServiceTest("testGetObjectStatistics"));
120 122
    // suite.addTest(new MNodeServiceTest("testGetStatus"));
121 123
    // MNAuthorization tests
122 124
    suite.addTest(new MNodeServiceTest("testIsAuthorized"));
123 125
    suite.addTest(new MNodeServiceTest("testSetAccessPolicy"));
124 126
    // MNreplication tests
125
    // suite.addTest(new MNodeServiceTest("testReplicate"));
127
    suite.addTest(new MNodeServiceTest("testReplicate"));
126 128
    
127 129
		
128 130
		return suite;
......
447 449
	}
448 450

  
449 451
	public void testReplicate() {
450
		fail("Not yet implemented");
452
	    printTestHeader("testReplicate");
453
	    try {
454
		    Session session = getTestSession();
455
		    Identifier guid = new Identifier();
456
		    guid.setValue("testReplicate." + System.currentTimeMillis());
457
		    SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null);
458
			NodeReference sourceNode = new NodeReference();
459
			sourceNode.setValue("SOMETHING!!!");
460
			boolean result = MNodeService.getInstance().replicate(session, sysmeta, sourceNode );
461
			assertTrue(result);
462
	    } catch (Exception e) {
463
	    	e.printStackTrace();
464
			fail("Probably not yet implemented: " + e.getMessage());
465
		}
451 466
	}
452 467

  
453 468
	/**
......
622 637
	}
623 638

  
624 639
	public void testGetCapabilities() {
640
	    printTestHeader("testGetCapabilities");
625 641
		try {
626 642
			Node node = MNodeService.getInstance().getCapabilities();
627 643
			assertNotNull(node);
......
634 650
	}
635 651

  
636 652
	public void testGetOperationStatistics() {
653
	    printTestHeader("testGetOperationStatistics");
637 654
		try {
638 655
			Session session = getTestSession();
639 656
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

Also available in: Unified diff