Project

General

Profile

« Previous | Next » 

Revision 9132

Added by Jing Tao almost 10 years ago

It is tricky to determine if the type works since v2.SystemMetadata extends from v1.SystemMetadata.
We have to set true that the return object is v1.SystemMetadata, also set false that the return object is not v2.SystemMetadata.

View differences:

test/edu/ucsb/nceas/metacat/dataone/v1/CNodeV1ServiceTest.java
136 136
			// check it
137 137
			assertEquals(sysmeta.getIdentifier().getValue(), retSysmeta.getIdentifier().getValue());
138 138
			assertTrue( retSysmeta instanceof org.dataone.service.types.v1.SystemMetadata);
139
			//System.out.println("=== the class name is "+retSysmeta.getClass().getName());
139
			assertFalse( retSysmeta instanceof org.dataone.service.types.v2.SystemMetadata);
140
			System.out.println("=== the class name is "+retSysmeta.getClass().getName());
140 141
        } catch(Exception e) {
141 142
            fail("Unexpected error: " + e.getMessage());
142 143
        }

Also available in: Unified diff