001/* 002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * dmetzler 018 */ 019package org.nuxeo.ecm.automation.test.helpers; 020 021import org.nuxeo.ecm.automation.core.Constants; 022import org.nuxeo.ecm.automation.core.annotations.Operation; 023import org.nuxeo.ecm.automation.core.annotations.OperationMethod; 024import org.nuxeo.ecm.automation.core.annotations.Param; 025import org.nuxeo.ecm.core.api.Blob; 026import org.nuxeo.ecm.core.api.DocumentModel; 027import org.nuxeo.ecm.core.api.DocumentModelList; 028 029/** 030 * Basic operation that just record the documents on which it was called and the parameters used 031 * 032 * @since 5.7.2 033 */ 034@Operation(id = TestOperation.ID, category = Constants.CAT_SERVICES, label = "log call params", description = "Test operation that log call in a static map") 035public class TestOperation { 036 037 public static final String ID = "testOp"; 038 039 @Param(name = "one") 040 String one; 041 042 @Param(name = "two") 043 Integer two; 044 045 @OperationMethod 046 public DocumentModel run(DocumentModel doc) { 047 return doc; 048 } 049 050 @OperationMethod 051 public DocumentModelList run(DocumentModelList docs) { 052 return docs; 053 } 054 055 @OperationMethod 056 public Blob run(Blob blob) throws Exception { 057 return blob; 058 } 059 060}