]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
c98c10d3954b60a04f356ccb917d750317b1805c
[tmp/jakarta-migration.git] /
1 /**
2  * This document is a part of the source code and related artifacts
3  * for CollectionSpace, an open source collections management system
4  * for museums and related institutions:
5  *
6  * http://www.collectionspace.org
7  * http://wiki.collectionspace.org
8  *
9  * Copyright © 2009 Regents of the University of California
10  *
11  * Licensed under the Educational Community License (ECL), Version 2.0.
12  * You may not use this file except in compliance with this License.
13  *
14  * You may obtain a copy of the ECL 2.0 License at
15  * https://source.collectionspace.org/collection-space/LICENSE.txt
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 package org.collectionspace.services.client.test;
24
25 import java.util.List;
26 import javax.ws.rs.core.MediaType;
27 import javax.ws.rs.core.Response;
28
29 import org.collectionspace.services.client.AbstractCommonListUtils;
30 import org.collectionspace.services.client.CollectionSpaceClient;
31 import org.collectionspace.services.client.ContactClient;
32 import org.collectionspace.services.client.ContactClientUtils;
33 import org.collectionspace.services.client.PayloadOutputPart;
34 import org.collectionspace.services.client.PoxPayloadIn;
35 import org.collectionspace.services.client.PoxPayloadOut;
36 import org.collectionspace.services.contact.AddressGroup;
37 import org.collectionspace.services.contact.AddressGroupList;
38 import org.collectionspace.services.contact.ContactsCommon;
39 import org.collectionspace.services.contact.EmailGroup;
40 import org.collectionspace.services.contact.EmailGroupList;
41 import org.collectionspace.services.jaxb.AbstractCommonList;
42
43 import org.jboss.resteasy.client.ClientResponse;
44
45 import org.testng.Assert;
46
47 import org.slf4j.Logger;
48 import org.slf4j.LoggerFactory;
49
50 /**
51  * ContactServiceTest, carries out tests against a
52  * deployed and running Contact Service.
53  *
54  * $LastChangedRevision: 917 $
55  * $LastChangedDate: 2009-11-06 12:20:28 -0800 (Fri, 06 Nov 2009) $
56  */
57 public class ContactServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonList, ContactsCommon> {
58
59     private final String CLASS_NAME = ContactServiceTest.class.getName();
60     private final Logger logger = LoggerFactory.getLogger(ContactServiceTest.class);
61     // Instance variables specific to this test.
62 //    final String SERVICE_PATH_COMPONENT = "contacts";
63
64     @Override
65     public String getServicePathComponent() {
66         return ContactClient.SERVICE_PATH_COMPONENT;
67     }
68
69     @Override
70     protected String getServiceName() {
71         return ContactClient.SERVICE_NAME;
72     }
73
74     /* (non-Javadoc)
75      * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
76      */
77     @Override
78     protected CollectionSpaceClient getClientInstance() {
79         return new ContactClient();
80     }
81
82     /* (non-Javadoc)
83      * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
84      */
85     @Override
86     protected AbstractCommonList getCommonList(
87             ClientResponse<AbstractCommonList> response) {
88         return response.getEntity(AbstractCommonList.class);
89     }
90
91 //    @Override
92 //    protected PoxPayloadOut createInstance(String identifier) {
93 //      ContactClient client = new ContactClient();
94 //        PoxPayloadOut multipart =
95 //            ContactClientUtils.createContactInstance(identifier, client.getCommonPartName());
96 //        return multipart;
97 //    }
98     // ---------------------------------------------------------------
99     // CRUD tests : CREATE tests
100     // ---------------------------------------------------------------
101     // Success outcomes
102     
103     @Override
104 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
105     public void create(String testName) throws Exception {
106         // Perform setup, such as initializing the type of service request
107         // (e.g. CREATE, DELETE), its valid and expected status codes, and
108         // its associated HTTP method name (e.g. POST, DELETE).
109         setupCreate();
110
111         // Submit the request to the service and store the response.
112         ContactClient client = new ContactClient();
113         String identifier = createIdentifier();
114         PoxPayloadOut multipart =
115                 ContactClientUtils.createContactInstance(identifier, client.getCommonPartName());
116         Response res = client.create(multipart);
117         String newId = null;
118         try {
119                 int statusCode = res.getStatus();
120         
121                 // Check the status code of the response: does it match
122                 // the expected response(s)?
123                 //
124                 // Specifically:
125                 // Does it fall within the set of valid status codes?
126                 // Does it exactly match the expected status code?
127                 if (logger.isDebugEnabled()) {
128                     logger.debug(testName + ": status = " + statusCode);
129                 }
130                 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
131                         invalidStatusCodeMessage(testRequestType, statusCode));
132                 Assert.assertEquals(statusCode, testExpectedStatusCode);
133                 newId = extractId(res);
134         } finally {
135                 res.close();
136         }
137
138         // Store the ID returned from the first resource created
139         // for additional tests below.
140         if (knownResourceId == null) {
141             knownResourceId = newId;
142             if (logger.isDebugEnabled()) {
143                 logger.debug(testName + ": knownResourceId=" + knownResourceId);
144             }
145         }
146
147         // Store the IDs from every resource created by tests,
148         // so they can be deleted after tests have been run.
149         allResourceIdsCreated.add(newId);
150     }
151
152     @Override
153 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
154 //    dependsOnMethods = {"create"})
155     public void createList(String testName) throws Exception {
156         for (int i = 0; i < 3; i++) {
157             create(testName);
158         }
159     }
160
161     // Failure outcomes
162     // Placeholders until the three tests below can be uncommented.
163     // See Issue CSPACE-401.
164     @Override
165     public void createWithEmptyEntityBody(String testName) throws Exception {
166         //Should this really be empty?
167     }
168
169     @Override
170     public void createWithMalformedXml(String testName) throws Exception {
171         //Should this really be empty??
172     }
173
174     @Override
175     public void createWithWrongXmlSchema(String testName) throws Exception {
176         //Should this really be empty??
177     }
178
179     /*
180     @Override
181     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
182     dependsOnMethods = {"create", "testSubmitRequest"})
183     public void createWithEmptyEntityBody(String testName) throws Exception {
184     
185     if (logger.isDebugEnabled()) {
186     logger.debug(testBanner(testName, CLASS_NAME));
187     }
188     // Perform setup.
189     setupCreateWithEmptyEntityBody(testName, logger);
190     
191     // Submit the request to the service and store the response.
192     String method = REQUEST_TYPE.httpMethodName();
193     String url = getServiceRootURL();
194     String mediaType = MediaType.APPLICATION_XML;
195     final String entity = "";
196     int statusCode = submitRequest(method, url, mediaType, entity);
197     
198     // Check the status code of the response: does it match
199     // the expected response(s)?
200     if(logger.isDebugEnabled()){
201     logger.debug("createWithEmptyEntityBody url=" + url +
202     " status=" + statusCode);
203     }
204     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
205     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
206     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
207     }
208     
209     @Override
210     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
211     dependsOnMethods = {"create", "testSubmitRequest"})
212     public void createWithMalformedXml(String testName) throws Exception {
213     
214     if (logger.isDebugEnabled()) {
215     logger.debug(testBanner(testName, CLASS_NAME));
216     }
217     // Perform setup.
218     setupCreateWithMalformedXml();
219     
220     // Submit the request to the service and store the response.
221     String method = REQUEST_TYPE.httpMethodName();
222     String url = getServiceRootURL();
223     String mediaType = MediaType.APPLICATION_XML;
224     final String entity = MALFORMED_XML_DATA; // Constant from base class.
225     int statusCode = submitRequest(method, url, mediaType, entity);
226     
227     // Check the status code of the response: does it match
228     // the expected response(s)?
229     if(logger.isDebugEnabled()){
230     logger.debug(testName + ": url=" + url +
231     " status=" + statusCode);
232     }
233     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
234     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
235     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
236     }
237     
238     @Override
239     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
240     dependsOnMethods = {"create", "testSubmitRequest"})
241     public void createWithWrongXmlSchema(String testName) throws Exception {
242     
243     if (logger.isDebugEnabled()) {
244     logger.debug(testBanner(testName, CLASS_NAME));
245     }
246     // Perform setup.
247     setupCreateWithWrongXmlSchema(testName, logger);
248     
249     // Submit the request to the service and store the response.
250     String method = REQUEST_TYPE.httpMethodName();
251     String url = getServiceRootURL();
252     String mediaType = MediaType.APPLICATION_XML;
253     final String entity = WRONG_XML_SCHEMA_DATA;
254     int statusCode = submitRequest(method, url, mediaType, entity);
255     
256     // Check the status code of the response: does it match
257     // the expected response(s)?
258     if(logger.isDebugEnabled()){
259     logger.debug(testName + ": url=" + url +
260     " status=" + statusCode);
261     }
262     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
263     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
264     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
265     }
266      */
267     // ---------------------------------------------------------------
268     // CRUD tests : READ tests
269     // ---------------------------------------------------------------
270     // Success outcomes
271     @Override
272 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
273 //    dependsOnMethods = {"create"})
274     public void read(String testName) throws Exception {
275         // Perform setup.
276         setupRead();
277
278         // Submit the request to the service and store the response.
279         ContactClient client = new ContactClient();
280         ClientResponse<String> res = client.read(knownResourceId);
281         try {
282                 assertStatusCode(res, testName);
283                 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
284                 ContactsCommon contact = (ContactsCommon) extractPart(input,
285                         client.getCommonPartName(), ContactsCommon.class);
286                 Assert.assertNotNull(contact);
287         } finally {
288                 if (res != null) {
289                 res.releaseConnection();
290             }
291         }
292     }
293
294     // ---------------------------------------------------------------
295     // CRUD tests : READ_LIST tests
296     // ---------------------------------------------------------------
297     // Success outcomes
298     @Override
299 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
300 //    dependsOnMethods = {"read"})
301     public void readList(String testName) throws Exception {
302         // Perform setup.
303         setupReadList();
304
305         // Submit the request to the service and store the response.
306         ContactClient client = new ContactClient();
307         ClientResponse<AbstractCommonList> res = client.readList();
308         try {
309                 assertStatusCode(res, testName);
310                 AbstractCommonList list = res.getEntity();
311         
312                 // Optionally output additional data about list members for debugging.
313                 boolean iterateThroughList = false;
314                 if (iterateThroughList && logger.isDebugEnabled()) {
315                     AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
316                 }
317         } finally {
318                 if (res != null) {
319                 res.releaseConnection();
320             }
321         }
322     }
323
324     // Failure outcomes
325     // None at present.
326     // ---------------------------------------------------------------
327     // CRUD tests : UPDATE tests
328     // ---------------------------------------------------------------
329     // Success outcomes
330     @Override
331 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
332 //    dependsOnMethods = {"read"})
333     public void update(String testName) throws Exception {
334         // Perform setup.
335         setupUpdate();
336         //
337         // First read the object that will be updated
338         //
339         ContactClient client = new ContactClient();
340         ClientResponse<String> res = client.read(knownResourceId);
341         ContactsCommon contact = null;
342         try {
343                 assertStatusCode(res, testName);
344                 
345                 if (logger.isDebugEnabled()) {
346                     logger.debug("got object to update with ID: " + knownResourceId);
347                 }
348                 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
349                 contact = (ContactsCommon) extractPart(input,
350                         client.getCommonPartName(), ContactsCommon.class);
351                 Assert.assertNotNull(contact);
352         } finally {
353                 if (res != null) {
354                 res.releaseConnection();
355             }
356         }
357         
358         if(logger.isDebugEnabled()){
359             logger.debug("contact common before updating");
360             logger.debug(BaseServiceTest.objectAsXmlString(contact, ContactsCommon.class));
361         }
362
363         // Verify the contents of this resource
364         EmailGroupList emailGroupList = contact.getEmailGroupList();
365         Assert.assertNotNull(emailGroupList);
366         List<EmailGroup> emailGroups = emailGroupList.getEmailGroup();
367         Assert.assertNotNull(emailGroups);
368         Assert.assertTrue(emailGroups.size() > 0);
369         String email = emailGroups.get(0).getEmail();
370         Assert.assertNotNull(email);
371
372         AddressGroupList addressGroupList = contact.getAddressGroupList();
373         Assert.assertNotNull(addressGroupList);
374         List<AddressGroup> addressGroups = addressGroupList.getAddressGroup();
375         Assert.assertNotNull(addressGroups);
376         Assert.assertTrue(addressGroups.size() > 0);
377         String addressType = addressGroups.get(0).getAddressType();
378         String addressPlace1 = addressGroups.get(0).getAddressPlace1();
379         Assert.assertNotNull(addressType);
380         Assert.assertNotNull(addressPlace1);
381
382         // Update the contents of this resource.
383         emailGroups.get(0).setEmail("updated-" + email);
384         contact.setEmailGroupList(emailGroupList);
385
386         addressGroups.get(0).setAddressType("updated-" + addressType);
387         addressGroups.get(0).setAddressPlace1("updated-" + addressPlace1);
388         contact.setAddressGroupList(addressGroupList);
389
390         if (logger.isDebugEnabled()) {
391             logger.debug("to be updated object");
392             logger.debug(BaseServiceTest.objectAsXmlString(contact, ContactsCommon.class));
393         }
394         //
395         // Next, send the update to the server
396         //
397         PoxPayloadOut output = new PoxPayloadOut(ContactClient.SERVICE_PAYLOAD_NAME);
398         PayloadOutputPart commonPart = output.addPart(client.getCommonPartName(), contact);
399
400         res = client.update(knownResourceId, output);
401         ContactsCommon updatedContact = null;
402         try {
403                 assertStatusCode(res, testName);
404                 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
405                 updatedContact = (ContactsCommon) extractPart(input,
406                         client.getCommonPartName(), ContactsCommon.class);
407                 Assert.assertNotNull(updatedContact);
408         } finally {
409                 if (res != null) {
410                 res.releaseConnection();
411             }
412         }
413         
414         if (logger.isDebugEnabled()) {
415             logger.debug("object after update");
416             logger.debug(objectAsXmlString(updatedContact, ContactsCommon.class));
417         }
418                 
419         Assert.assertNotNull(updatedContact.getEmailGroupList().getEmailGroup().get(0));
420         Assert.assertEquals(updatedContact.getEmailGroupList().getEmailGroup().get(0).getEmail(),
421                 contact.getEmailGroupList().getEmailGroup().get(0).getEmail(),
422                 "Data in updated object did not match submitted data.");
423
424     }
425
426     // Failure outcomes
427     // Placeholders until the three tests below can be uncommented.
428     // See Issue CSPACE-401.
429     @Override
430     public void updateWithEmptyEntityBody(String testName) throws Exception {
431         //Should this really be empty??
432     }
433
434     /* (non-Javadoc)
435      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
436      */
437     @Override
438     public void updateWithMalformedXml(String testName) throws Exception {
439         //Should this really be empty??
440     }
441
442     @Override
443     public void updateWithWrongXmlSchema(String testName) throws Exception {
444         //Should this really be empty??
445     }
446
447     /*
448     @Override
449     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
450     dependsOnMethods = {"create", "update", "testSubmitRequest"})
451     public void updateWithEmptyEntityBody(String testName) throws Exception {
452     
453     if (logger.isDebugEnabled()) {
454     logger.debug(testBanner(testName, CLASS_NAME));
455     }
456     // Perform setup.
457     setupUpdateWithEmptyEntityBody();
458     
459     // Submit the request to the service and store the response.
460     String method = REQUEST_TYPE.httpMethodName();
461     String url = getResourceURL(knownResourceId);
462     String mediaType = MediaType.APPLICATION_XML;
463     final String entity = "";
464     int statusCode = submitRequest(method, url, mediaType, entity);
465     
466     // Check the status code of the response: does it match
467     // the expected response(s)?
468     if(logger.isDebugEnabled()){
469     logger.debug(testName + ": url=" + url +
470     " status=" + statusCode);
471     }
472     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
473     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
474     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
475     }
476     
477     @Override
478     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
479     dependsOnMethods = {"create", "update", "testSubmitRequest"})
480     public void updateWithMalformedXml(String testName) throws Exception {
481     
482     if (logger.isDebugEnabled()) {
483     logger.debug(testBanner(testName, CLASS_NAME));
484     }
485     // Perform setup.
486     setupUpdateWithMalformedXml();
487     
488     // Submit the request to the service and store the response.
489     String method = REQUEST_TYPE.httpMethodName();
490     String url = getResourceURL(knownResourceId);
491     String mediaType = MediaType.APPLICATION_XML;
492     final String entity = MALFORMED_XML_DATA;
493     int statusCode = submitRequest(method, url, mediaType, entity);
494     
495     // Check the status code of the response: does it match
496     // the expected response(s)?
497     if(logger.isDebugEnabled()){
498     logger.debug(testName + ": url=" + url +
499     " status=" + statusCode);
500     }
501     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
502     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
503     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
504     }
505     
506     @Override
507     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
508     dependsOnMethods = {"create", "update", "testSubmitRequest"})
509     public void updateWithWrongXmlSchema(String testName) throws Exception {
510     
511     if (logger.isDebugEnabled()) {
512     logger.debug(testBanner(testName, CLASS_NAME));
513     }
514     // Perform setup.
515     setupUpdateWithWrongXmlSchema(testName, logger);
516     
517     // Submit the request to the service and store the response.
518     String method = REQUEST_TYPE.httpMethodName();
519     String url = getResourceURL(knownResourceId);
520     String mediaType = MediaType.APPLICATION_XML;
521     final String entity = WRONG_XML_SCHEMA_DATA;
522     int statusCode = submitRequest(method, url, mediaType, entity);
523     
524     // Check the status code of the response: does it match
525     // the expected response(s)?
526     if(logger.isDebugEnabled()){
527     logger.debug(testName + ": url=" + url +
528     " status=" + statusCode);
529     }
530     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
531     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
532     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
533     }
534      */
535     @Override
536 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
537 //    dependsOnMethods = {"update", "testSubmitRequest"})
538     public void updateNonExistent(String testName) throws Exception {
539         // Perform setup.
540         setupUpdateNonExistent();
541
542         // Submit the request to the service and store the response.
543         // Note: The ID used in this 'create' call may be arbitrary.
544         // The only relevant ID may be the one used in update(), below.
545         ContactClient client = new ContactClient();
546         PoxPayloadOut multipart =
547                 ContactClientUtils.createContactInstance(NON_EXISTENT_ID, client.getCommonPartName());
548         ClientResponse<String> res =
549                 client.update(NON_EXISTENT_ID, multipart);
550         int statusCode = res.getStatus();
551
552         // Check the status code of the response: does it match
553         // the expected response(s)?
554         if (logger.isDebugEnabled()) {
555             logger.debug(testName + ": status = " + statusCode);
556         }
557         Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
558                 invalidStatusCodeMessage(testRequestType, statusCode));
559         Assert.assertEquals(statusCode, testExpectedStatusCode);
560     }
561
562     // ---------------------------------------------------------------
563     // CRUD tests : DELETE tests
564     // ---------------------------------------------------------------
565     // Success outcomes
566     @Override
567 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
568 //    dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
569     public void delete(String testName) throws Exception {
570         // Perform setup.
571         setupDelete();
572
573         // Submit the request to the service and store the response.
574         ContactClient client = new ContactClient();
575         ClientResponse<Response> res = client.delete(knownResourceId);
576         int statusCode = res.getStatus();
577
578         // Check the status code of the response: does it match
579         // the expected response(s)?
580         if (logger.isDebugEnabled()) {
581             logger.debug(testName + ": status = " + statusCode);
582         }
583         Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
584                 invalidStatusCodeMessage(testRequestType, statusCode));
585         Assert.assertEquals(statusCode, testExpectedStatusCode);
586     }
587
588     // Failure outcomes
589     @Override
590 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
591 //    dependsOnMethods = {"delete"})
592     public void deleteNonExistent(String testName) throws Exception {
593         // Perform setup.
594         setupDeleteNonExistent();
595
596         // Submit the request to the service and store the response.
597         ContactClient client = new ContactClient();
598         ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
599         int statusCode = res.getStatus();
600
601         // Check the status code of the response: does it match
602         // the expected response(s)?
603         if (logger.isDebugEnabled()) {
604             logger.debug(testName + ": status = " + statusCode);
605         }
606         Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
607                 invalidStatusCodeMessage(testRequestType, statusCode));
608         Assert.assertEquals(statusCode, testExpectedStatusCode);
609     }
610
611     // ---------------------------------------------------------------
612     // Utility tests : tests of code used in tests above
613     // ---------------------------------------------------------------
614     /**
615      * Tests the code for manually submitting data that is used by several
616      * of the methods above.
617      */
618 //    @Test(dependsOnMethods = {"create", "read"})
619     public void testSubmitRequest() {
620
621         // Expected status code: 200 OK
622         final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
623
624         // Submit the request to the service and store the response.
625         String method = ServiceRequestType.READ.httpMethodName();
626         String url = getResourceURL(knownResourceId);
627         int statusCode = submitRequest(method, url);
628
629         // Check the status code of the response: does it match
630         // the expected response(s)?
631         if (logger.isDebugEnabled()) {
632             logger.debug("testSubmitRequest: url=" + url
633                     + " status=" + statusCode);
634         }
635         Assert.assertEquals(statusCode, EXPECTED_STATUS);
636     }
637     
638     @Override
639     public void readWorkflow(String testName) throws Exception {
640         // Not applicable for the Contact service
641     }
642     
643     @Override
644     public void searchWorkflowDeleted(String testName) throws Exception {
645         // Not applicable for the Contact service
646     }
647
648         @Override
649         protected PoxPayloadOut createInstance(String commonPartName,
650                         String identifier) {
651                 return ContactClientUtils.createContactInstance(identifier, commonPartName);
652         }
653
654         @Override
655         protected ContactsCommon updateInstance(ContactsCommon commonPartObject) {
656                 // TODO Auto-generated method stub
657                 return null;
658         }
659
660         @Override
661         protected void compareUpdatedInstances(ContactsCommon original,
662                         ContactsCommon updated) throws Exception {
663                 // TODO Auto-generated method stub
664                 
665         }
666         
667         @Override
668         public void CRUDTests(String testName) {
669                 // TODO Auto-generated method stub              
670         }
671 }