Project

General

Profile

« Previous | Next » 

Revision 9302

Added by Jing Tao over 9 years ago

Clone a system metadata object in order to pass a test - updateSystemMetadata.

View differences:

test/edu/ucsb/nceas/metacat/dataone/CNodeServiceTest.java
37 37
import junit.framework.Test;
38 38
import junit.framework.TestSuite;
39 39

  
40
import org.apache.commons.beanutils.BeanUtils;
40 41
import org.apache.commons.io.IOUtils;
41 42
import org.dataone.client.v2.CNode;
42 43
import org.dataone.client.v2.itk.D1Client;
......
1229 1230
         
1230 1231
          
1231 1232
          //update system metadata sucessfully
1232
          sysmeta1.setArchived(true);
1233
          CNodeService.getInstance(request).updateSystemMetadata(session, guid, sysmeta1);
1233
          SystemMetadata sysmeta1c = new SystemMetadata();
1234
          BeanUtils.copyProperties(sysmeta1c, sysmeta1);
1235
          version = version.add(BigInteger.ONE);
1236
          sysmeta1c.setSerialVersion(version);
1237
          CNodeService.getInstance(request).updateSystemMetadata(session, guid, sysmeta1c);
1234 1238
          SystemMetadata metadata2 = CNodeService.getInstance(request).getSystemMetadata(session, seriesId);
1235 1239
          assertTrue(metadata2.getIdentifier().equals(guid));
1236 1240
          assertTrue(metadata2.getSeriesId().equals(seriesId));

Also available in: Unified diff