Project

General

Profile

Revision 5343

Added by berkley over 10 years ago

adding test for getSystemMetadata. a bit of refactoring.

View differences:

test/edu/ucsb/nceas/metacat/dataone/CrudServiceTest.java
127 127
	{
128 128
	    try
129 129
	    {
130
	        String testDoc = getTestDoc();
131 130
	        CrudService cs = CrudService.getInstance();
132 131
	        AuthToken token = getToken();
133 132
	        //run create
134
	        Identifier id = createDoc(token);
133
	        Identifier id = createDoc(token, getTestDoc());
134
	        //run get
135 135
            String gotDoc = getDoc(token, id);
136 136
            System.out.println("got doc: " + gotDoc);
137
            assertTrue(gotDoc.trim().equals(testDoc.trim()));
137
            //compare the docs
138
            assertTrue(gotDoc.trim().equals(getTestDoc().trim()));
138 139
        }
139 140
        catch(Exception e)
140 141
        {
......
216 217
	/**
217 218
	 * create a doc using CrudService.create() and return its id
218 219
	 */
219
	private Identifier createDoc(AuthToken token) throws Exception
220
	private Identifier createDoc(AuthToken token, String testDoc) throws Exception
220 221
	{
221 222
	    Identifier id;
222 223
        CrudService cs = CrudService.getInstance();
223
        String testDoc = getTestDoc();
224 224
        
225 225
        id = new Identifier();
226 226
        String docid = generateDocumentId();

Also available in: Unified diff