Project

General

Profile

« Previous | Next » 

Revision 2275

Added by sgarg over 19 years ago

Test added to insert eml 2.0.0 document and update it with eml 2.0.1 document.

View differences:

test/edu/ucsb/nceas/metacattest/AccessControlTest.java
73 73
     * this function might have to modified
74 74
     */
75 75

  
76
    private String testEmlHeader =
76
    private String testEml_201_Header =
77 77
        "<?xml version=\"1.0\"?><eml:eml" +
78 78
        " xmlns:eml=\"eml://ecoinformatics.org/eml-2.0.1\"" +
79 79
        " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" +
......
81 81
        " xsi:schemaLocation=\"eml://ecoinformatics.org/eml-2.0.1 eml.xsd\"" +
82 82
        " scope=\"system\">";
83 83

  
84
    private String testEml_200_Header =
85
    "<?xml version=\"1.0\"?><eml:eml" +
86
    " xmlns:eml=\"eml://ecoinformatics.org/eml-2.0.0\"" +
87
    " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" +
88
    " packageId=\"eml.1.1\" system=\"knb\"" +
89
    " xsi:schemaLocation=\"eml://ecoinformatics.org/eml-2.0.0 eml.xsd\"" +
90
    " scope=\"system\">";
91

  
84 92
    private String testEmlCreatorBlock =
85 93
        "<creator scope=\"document\">                                       " +
86 94
        " <individualName>                                                  " +
......
174 182
                                 String onlineAccessBlock2) {
175 183

  
176 184
        String testDocument = "";
177
        testDocument = testDocument + testEmlHeader +
185
        testDocument = testDocument + testEml_201_Header +
178 186
            "<dataset scope=\"document\"><title>" + title + "</title>" +
179 187
            testEmlCreatorBlock;
180 188

  
......
306 314
     */
307 315
    public void documentTest() {
308 316
        try {
317

  
309 318
            newdocid = generateDocid();
310 319

  
311 320
            // login
312 321
            m.login(username, password);
313 322

  
323
            // insert a 2.0.0 document
324
            testdocument = testEml_200_Header +
325
                "<dataset scope=\"document\"><title>submitting eml2000</title>" +
326
            testEmlCreatorBlock + testEmlContactBlock + "</dataset></eml:eml>";
327

  
328
            insertDocid(newdocid + ".1", testdocument, SUCCESS, false);
329

  
330
            // read the document
331
            readDocidWhichEqualsDoc(newdocid, testdocument, SUCCESS, false);
332

  
333
            // update it with 2.0.1 document
334
            testdocument = getTestEmlDoc("Updating eml200 with eml201",
335
                                         null, null, null, null,
336
                                         null, null, null, null, null);
337
            updateDocid(newdocid + ".2", testdocument, SUCCESS, false);
338
            readDocidWhichEqualsDoc(newdocid, testdocument, SUCCESS, false);
339
            m.logout();
340

  
341

  
342
            newdocid = generateDocid();
343

  
344
            // login
345
            m.login(username, password);
346

  
314 347
            // insert a document
315 348
            testdocument = getTestEmlDoc("Testing insert", null,
316 349
                                         null, null,

Also available in: Unified diff