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:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright © 2009 Regents of the University of California
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
15 * https://source.collectionspace.org/collection-space/LICENSE.txt
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.
23 package org.collectionspace.services.client.test;
25 //import java.util.ArrayList;
26 import java.util.List;
27 import javax.ws.rs.core.Response;
29 import org.collectionspace.services.client.AbstractCommonListUtils;
30 import org.collectionspace.services.client.CollectionSpaceClient;
31 import org.collectionspace.services.client.ConditioncheckClient;
32 import org.collectionspace.services.client.PayloadInputPart;
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.common.api.GregorianCalendarDateTimeUtils;
37 import org.collectionspace.services.jaxb.AbstractCommonList;
38 import org.collectionspace.services.conditioncheck.ConditionchecksCommon;
39 import org.collectionspace.services.conditioncheck.HazardGroupList;
40 import org.collectionspace.services.conditioncheck.HazardGroup;
42 import org.jboss.resteasy.client.ClientResponse;
43 import org.testng.Assert;
45 import org.slf4j.Logger;
46 import org.slf4j.LoggerFactory;
49 * ConditioncheckServiceTest, carries out tests against a
50 * deployed and running Conditioncheck (aka Condition Checks) Service.
52 public class ConditioncheckServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonList, ConditionchecksCommon> {
55 private final String CLASS_NAME = ConditioncheckServiceTest.class.getName();
56 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
57 // Instance variables specific to this test.
58 /** The service path component. */
59 final String SERVICE_NAME = "conditionchecks";
60 final String SERVICE_PATH_COMPONENT = "conditionchecks";
61 private String CONDITIONCHECKER_REF_NAME =
62 "urn:cspace:org.collectionspace.demo:personauthorities:name(TestPersonAuth):item:name(HarryLender)'Harry Lender'";
63 private String CONDITIONCHECK_HAZARD =
64 "urn:cspace:core.collectionspace.org:vocabularies:name(TestTermList):item:name(hazard1)'multi-dimensional'";
65 private String CONDITIONCHECK_HAZARD_NOTE = "Object needs to be extinguished occasionally.";
66 private final static String CURRENT_DATE_UTC =
67 GregorianCalendarDateTimeUtils.timestampUTC();
70 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
73 protected CollectionSpaceClient getClientInstance() {
74 return new ConditioncheckClient();
78 * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
81 protected AbstractCommonList getCommonList(
82 ClientResponse<AbstractCommonList> response) {
83 return response.getEntity(AbstractCommonList.class);
86 // ---------------------------------------------------------------
87 // CRUD tests : CREATE tests
88 // ---------------------------------------------------------------
93 * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
96 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
97 public void create(String testName) throws Exception {
98 // Perform setup, such as initializing the type of service request
99 // (e.g. CREATE, DELETE), its valid and expected status codes, and
100 // its associated HTTP method name (e.g. POST, DELETE).
103 // Submit the request to the service and store the response.
104 ConditioncheckClient client = new ConditioncheckClient();
105 String identifier = createIdentifier();
106 PoxPayloadOut multipart = createConditioncheckInstance(identifier);
108 Response res = client.create(multipart);
110 int statusCode = res.getStatus();
112 // Check the status code of the response: does it match
113 // the expected response(s)?
116 // Does it fall within the set of valid status codes?
117 // Does it exactly match the expected status code?
118 if (logger.isDebugEnabled()) {
119 logger.debug(testName + ": status = " + statusCode);
121 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
122 invalidStatusCodeMessage(testRequestType, statusCode));
123 Assert.assertEquals(statusCode, testExpectedStatusCode);
125 newID = extractId(res);
132 // Store the ID returned from the first resource created
133 // for additional tests below.
134 if (knownResourceId == null) {
135 knownResourceId = newID;
136 if (logger.isDebugEnabled()) {
137 logger.debug(testName + ": knownResourceId=" + knownResourceId);
141 // Store the IDs from every resource created by tests,
142 // so they can be deleted after tests have been run.
143 allResourceIdsCreated.add(newID);
147 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
150 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
151 // dependsOnMethods = {"create"})
152 public void createList(String testName) throws Exception {
153 for (int i = 0; i < 3; i++) {
161 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
162 dependsOnMethods = {"create", "testSubmitRequest"})
163 public void createWithEmptyEntityBody(String testName) throws Exception {
165 if (logger.isDebugEnabled()) {
166 logger.debug(testBanner(testName, CLASS_NAME));
169 setupCreateWithEmptyEntityBody();
171 // Submit the request to the service and store the response.
172 String method = REQUEST_TYPE.httpMethodName();
173 String url = getServiceRootURL();
174 String mediaType = MediaType.APPLICATION_XML;
175 final String entity = "";
176 int statusCode = submitRequest(method, url, mediaType, entity);
178 // Check the status code of the response: does it match
179 // the expected response(s)?
180 if(logger.isDebugEnabled()){
181 logger.debug("createWithEmptyEntityBody url=" + url +
182 " status=" + statusCode);
184 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
185 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
186 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
190 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
191 dependsOnMethods = {"create", "testSubmitRequest"})
192 public void createWithMalformedXml(String testName) throws Exception {
194 if (logger.isDebugEnabled()) {
195 logger.debug(testBanner(testName, CLASS_NAME));
198 setupCreateWithMalformedXml(testName, logger);
200 // Submit the request to the service and store the response.
201 String method = REQUEST_TYPE.httpMethodName();
202 String url = getServiceRootURL();
203 String mediaType = MediaType.APPLICATION_XML;
204 final String entity = MALFORMED_XML_DATA; // Constant from base class.
205 int statusCode = submitRequest(method, url, mediaType, entity);
207 // Check the status code of the response: does it match
208 // the expected response(s)?
209 if(logger.isDebugEnabled()){
210 logger.debug(testName + ": url=" + url +
211 " status=" + statusCode);
213 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
214 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
215 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
219 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
220 dependsOnMethods = {"create", "testSubmitRequest"})
221 public void createWithWrongXmlSchema(String testName) throws Exception {
223 if (logger.isDebugEnabled()) {
224 logger.debug(testBanner(testName, CLASS_NAME));
227 setupCreateWithWrongXmlSchema(testName, logger);
229 // Submit the request to the service and store the response.
230 String method = REQUEST_TYPE.httpMethodName();
231 String url = getServiceRootURL();
232 String mediaType = MediaType.APPLICATION_XML;
233 final String entity = WRONG_XML_SCHEMA_DATA;
234 int statusCode = submitRequest(method, url, mediaType, entity);
236 // Check the status code of the response: does it match
237 // the expected response(s)?
238 if(logger.isDebugEnabled()){
239 logger.debug(testName + ": url=" + url +
240 " status=" + statusCode);
242 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
243 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
244 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
248 // ---------------------------------------------------------------
249 // CRUD tests : READ tests
250 // ---------------------------------------------------------------
255 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
258 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
259 // dependsOnMethods = {"create"})
260 public void read(String testName) throws Exception {
264 // Submit the request to the service and store the response.
265 ConditioncheckClient client = new ConditioncheckClient();
266 ClientResponse<String> res = client.read(knownResourceId);
267 PoxPayloadIn input = null;
269 assertStatusCode(res, testName);
270 input = new PoxPayloadIn(res.getEntity());
273 res.releaseConnection();
277 // Get the common part of the response and verify that it is not null.
278 PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
279 ConditionchecksCommon conditioncheckCommon = null;
280 if (payloadInputPart != null) {
281 conditioncheckCommon = (ConditionchecksCommon) payloadInputPart.getBody();
283 Assert.assertNotNull(conditioncheckCommon);
285 // Check selected fields.
286 HazardGroupList hazardGroupList = conditioncheckCommon.getHazardGroupList();
287 Assert.assertNotNull(hazardGroupList);
288 List<HazardGroup> hazardGroups = hazardGroupList.getHazardGroup();
289 Assert.assertNotNull(hazardGroups);
290 String hazard = hazardGroups.get(0).getHazard();
291 Assert.assertEquals(hazard, CONDITIONCHECK_HAZARD);
292 String hazardNote = hazardGroups.get(0).getHazardNote();
293 Assert.assertEquals(hazardNote, CONDITIONCHECK_HAZARD_NOTE);
294 String hazardDate = hazardGroups.get(0).getHazardDate();
295 Assert.assertEquals(hazardDate, CURRENT_DATE_UTC);
296 String conditionChecker = conditioncheckCommon.getConditionChecker();
297 Assert.assertEquals(conditionChecker, CONDITIONCHECKER_REF_NAME);
299 // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
300 String conditionCheckNote = conditioncheckCommon.getConditionCheckNote();
302 if (logger.isDebugEnabled()) {
303 logger.debug("UTF-8 data sent=" + getUTF8DataFragment() + "\n"
304 + "UTF-8 data received=" + conditionCheckNote);
307 Assert.assertEquals(conditionCheckNote, getUTF8DataFragment(),
308 "UTF-8 data retrieved '" + conditionCheckNote
309 + "' does not match expected data '" + getUTF8DataFragment());
315 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
318 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
319 // dependsOnMethods = {"read"})
320 public void readNonExistent(String testName) throws Exception {
322 setupReadNonExistent();
324 // Submit the request to the service and store the response.
325 ConditioncheckClient client = new ConditioncheckClient();
326 ClientResponse<String> res = client.read(NON_EXISTENT_ID);
328 int statusCode = res.getStatus();
330 // Check the status code of the response: does it match
331 // the expected response(s)?
332 if (logger.isDebugEnabled()) {
333 logger.debug(testName + ": status = " + statusCode);
335 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
336 invalidStatusCodeMessage(testRequestType, statusCode));
337 Assert.assertEquals(statusCode, testExpectedStatusCode);
340 res.releaseConnection();
345 // ---------------------------------------------------------------
346 // CRUD tests : READ_LIST tests
347 // ---------------------------------------------------------------
352 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
355 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
356 // dependsOnMethods = {"createList", "read"})
357 public void readList(String testName) throws Exception {
361 // Submit the request to the service and store the response.
362 AbstractCommonList list = null;
363 ConditioncheckClient client = new ConditioncheckClient();
364 ClientResponse<AbstractCommonList> res = client.readList();
365 assertStatusCode(res, testName);
367 int statusCode = res.getStatus();
369 // Check the status code of the response: does it match
370 // the expected response(s)?
371 if (logger.isDebugEnabled()) {
372 logger.debug(testName + ": status = " + statusCode);
374 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
375 invalidStatusCodeMessage(testRequestType, statusCode));
376 Assert.assertEquals(statusCode, testExpectedStatusCode);
378 list = res.getEntity();
381 res.releaseConnection();
385 // Optionally output additional data about list members for debugging.
386 boolean iterateThroughList = true;
387 if(iterateThroughList && logger.isDebugEnabled()){
388 AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
396 // ---------------------------------------------------------------
397 // CRUD tests : UPDATE tests
398 // ---------------------------------------------------------------
403 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
406 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
407 // dependsOnMethods = {"read"})
408 public void update(String testName) throws Exception {
412 // Retrieve the contents of a resource to update.
413 ConditioncheckClient client = new ConditioncheckClient();
414 ClientResponse<String> res = client.read(knownResourceId);
415 PoxPayloadIn input = null;
417 assertStatusCode(res, testName);
418 input = new PoxPayloadIn(res.getEntity());
419 if (logger.isDebugEnabled()) {
420 logger.debug("got object to update with ID: " + knownResourceId);
424 res.releaseConnection();
428 // Extract the common part from the response.
429 PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
430 ConditionchecksCommon conditioncheckCommon = null;
431 if (payloadInputPart != null) {
432 conditioncheckCommon = (ConditionchecksCommon) payloadInputPart.getBody();
434 Assert.assertNotNull(conditioncheckCommon);
436 // Update the content of this resource.
437 conditioncheckCommon.setConditionCheckRefNumber("updated-" + conditioncheckCommon.getConditionCheckRefNumber());
439 String conditionCheckNote = conditioncheckCommon.getConditionCheckNote();
440 conditioncheckCommon.setConditionCheckNote("updated-conditionCheckNote-" + conditionCheckNote);
442 if (logger.isDebugEnabled()) {
443 logger.debug("to be updated object");
444 logger.debug(objectAsXmlString(conditioncheckCommon, ConditionchecksCommon.class));
449 // Submit the updated common part in an update request to the service
450 // and store the response.
451 PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
452 PayloadOutputPart commonPart = output.addPart(client.getCommonPartName(), conditioncheckCommon);
453 res = client.update(knownResourceId, output);
455 assertStatusCode(res, testName);
456 int statusCode = res.getStatus();
457 // Check the status code of the response: does it match the expected response(s)?
458 if (logger.isDebugEnabled()) {
459 logger.debug(testName + ": status = " + statusCode);
461 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
462 invalidStatusCodeMessage(testRequestType, statusCode));
463 Assert.assertEquals(statusCode, testExpectedStatusCode);
464 input = new PoxPayloadIn(res.getEntity());
467 res.releaseConnection();
471 // Extract the updated common part from the response.
472 payloadInputPart = input.getPart(client.getCommonPartName());
473 ConditionchecksCommon updatedConditioncheckCommon = null;
474 if (payloadInputPart != null) {
475 updatedConditioncheckCommon = (ConditionchecksCommon) payloadInputPart.getBody();
477 Assert.assertNotNull(updatedConditioncheckCommon);
479 // Check selected fields in the updated common part.
480 Assert.assertEquals(updatedConditioncheckCommon.getConditionCheckRefNumber(),
481 conditioncheckCommon.getConditionCheckRefNumber(),
482 "Data in updated object did not match submitted data.");
484 // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
485 String originalConditionCheckNote = conditioncheckCommon.getConditionCheckNote();
486 String updatedConditionCheckNote = updatedConditioncheckCommon.getConditionCheckNote();
488 Assert.assertEquals(updatedConditionCheckNote, originalConditionCheckNote,
489 "Data in updated object did not match submitted data.");
491 if(logger.isDebugEnabled()){
492 logger.debug("UTF-8 data sent=" + originalConditionCheckNote + "\n"
493 + "UTF-8 data received=" + updatedConditionCheckNote);
495 Assert.assertTrue(updatedConditionCheckNote.contains(getUTF8DataFragment()),
496 "UTF-8 data retrieved '" + updatedConditionCheckNote
497 + "' does not match expected data '" + getUTF8DataFragment());
501 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
502 // dependsOnMethods = {"update", "testSubmitRequest"})
503 public void updateNonExistent(String testName) throws Exception {
505 setupUpdateNonExistent();
507 // Submit the request to the service and store the response.
508 // Note: The ID used in this 'create' call may be arbitrary.
509 // The only relevant ID may be the one used in update(), below.
510 ConditioncheckClient client = new ConditioncheckClient();
511 PoxPayloadOut multipart = createConditioncheckInstance(NON_EXISTENT_ID);
512 ClientResponse<String> res = client.update(NON_EXISTENT_ID, multipart);
514 int statusCode = res.getStatus();
516 // Check the status code of the response: does it match
517 // the expected response(s)?
518 if (logger.isDebugEnabled()) {
519 logger.debug(testName + ": status = " + statusCode);
521 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
522 invalidStatusCodeMessage(testRequestType, statusCode));
523 Assert.assertEquals(statusCode, testExpectedStatusCode);
526 res.releaseConnection();
531 // ---------------------------------------------------------------
532 // CRUD tests : DELETE tests
533 // ---------------------------------------------------------------
538 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
541 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
542 // dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
543 public void delete(String testName) throws Exception {
547 // Submit the request to the service and store the response.
548 ConditioncheckClient client = new ConditioncheckClient();
549 Response res = client.delete(knownResourceId);
551 int statusCode = res.getStatus();
553 // Check the status code of the response: does it match
554 // the expected response(s)?
555 if (logger.isDebugEnabled()) {
556 logger.debug(testName + ": status = " + statusCode);
558 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
559 invalidStatusCodeMessage(testRequestType, statusCode));
560 Assert.assertEquals(statusCode, testExpectedStatusCode);
571 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
574 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
575 // dependsOnMethods = {"delete"})
576 public void deleteNonExistent(String testName) throws Exception {
578 setupDeleteNonExistent();
580 // Submit the request to the service and store the response.
581 ConditioncheckClient client = new ConditioncheckClient();
582 Response res = client.delete(NON_EXISTENT_ID);
584 int statusCode = res.getStatus();
586 // Check the status code of the response: does it match
587 // the expected response(s)?
588 if (logger.isDebugEnabled()) {
589 logger.debug(testName + ": status = " + statusCode);
591 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
592 invalidStatusCodeMessage(testRequestType, statusCode));
593 Assert.assertEquals(statusCode, testExpectedStatusCode);
601 // ---------------------------------------------------------------
602 // Utility tests : tests of code used in tests above
603 // ---------------------------------------------------------------
606 * Tests the code for manually submitting data that is used by several
607 * of the methods above.
609 // @Test(dependsOnMethods = {"create", "read"})
610 public void testSubmitRequest() {
612 // Expected status code: 200 OK
613 final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
615 // Submit the request to the service and store the response.
616 String method = ServiceRequestType.READ.httpMethodName();
617 String url = getResourceURL(knownResourceId);
618 int statusCode = submitRequest(method, url);
620 // Check the status code of the response: does it match
621 // the expected response(s)?
622 if (logger.isDebugEnabled()) {
623 logger.debug("testSubmitRequest: url=" + url
624 + " status=" + statusCode);
626 Assert.assertEquals(statusCode, EXPECTED_STATUS);
630 // ---------------------------------------------------------------
631 // Utility methods used by tests above
632 // ---------------------------------------------------------------
635 public String getServiceName() {
640 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
643 public String getServicePathComponent() {
644 return SERVICE_PATH_COMPONENT;
648 protected PoxPayloadOut createInstance(String identifier) {
649 return createConditioncheckInstance(identifier);
653 * Creates the conditioncheck instance.
655 * @param identifier the identifier
656 * @return the multipart output
658 //private PoxPayloadOut createConditioncheckInstance(String identifier) {
659 // return createConditioncheckInstance("conditionCheckRefNumber-" + identifier);
663 * Creates the conditioncheck instance.
665 * @param conditioncheckRefNumber the conditioncheck number
666 * @return the multipart output
668 private PoxPayloadOut createConditioncheckInstance(String conditionCheckRefNumber) {
670 ConditionchecksCommon conditioncheckCommon = new ConditionchecksCommon();
671 conditioncheckCommon.setConditionCheckRefNumber(conditionCheckRefNumber);
672 conditioncheckCommon.setConditionChecker(CONDITIONCHECKER_REF_NAME);
673 conditioncheckCommon.setConditionCheckNote(getUTF8DataFragment());
675 HazardGroupList hazardGroupList = new HazardGroupList();
676 List<HazardGroup> hazardGroups = hazardGroupList.getHazardGroup();
677 HazardGroup hazardGroup = new HazardGroup();
678 hazardGroup.setHazard(CONDITIONCHECK_HAZARD);
679 hazardGroup.setHazardDate(CURRENT_DATE_UTC);
680 hazardGroup.setHazardNote(CONDITIONCHECK_HAZARD_NOTE);
681 hazardGroups.add(hazardGroup);
682 conditioncheckCommon.setHazardGroupList(hazardGroupList);
684 PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
685 PayloadOutputPart commonPart =
686 multipart.addPart(new ConditioncheckClient().getCommonPartName(), conditioncheckCommon);
688 if (logger.isDebugEnabled()) {
689 logger.debug("to be created, conditioncheck common");
690 logger.debug(objectAsXmlString(conditioncheckCommon, ConditionchecksCommon.class));
697 public void CRUDTests(String testName) {
698 // TODO Auto-generated method stub
703 protected PoxPayloadOut createInstance(String commonPartName,
705 PoxPayloadOut result = createConditioncheckInstance(identifier);
710 protected ConditionchecksCommon updateInstance(ConditionchecksCommon commonPartObject) {
711 // TODO Auto-generated method stub
716 protected void compareUpdatedInstances(ConditionchecksCommon original,
717 ConditionchecksCommon updated) throws Exception {
718 // TODO Auto-generated method stub