001: /*
002: * SalomeTMF is a Test Management Framework
003: * Copyright (C) 2005 France Telecom R&D
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * @author Marche Mikael
020: *
021: * Contact: mikael.marche@rd.francetelecom.com
022: */
023:
024: package org.objectweb.salome_tmf.api.sql;
025:
026: import java.rmi.Remote;
027:
028: import org.objectweb.salome_tmf.api.data.AttachementWrapper;
029: import org.objectweb.salome_tmf.api.data.ExecutionResultTestWrapper;
030: import org.objectweb.salome_tmf.api.data.ExecutionResultWrapper;
031: import org.objectweb.salome_tmf.api.data.FileAttachementWrapper;
032: import org.objectweb.salome_tmf.api.data.SalomeFileWrapper;
033: import org.objectweb.salome_tmf.api.data.TestAttachmentWrapper;
034: import org.objectweb.salome_tmf.api.data.UrlAttachementWrapper;
035:
036: public interface ISQLExecutionResult extends Remote {
037:
038: /**
039: * Insert an Execution Result in the database (table RES_EXEC_CAMP)
040: * @param idExec : id of the related execution
041: * @param name of the Execution Result
042: * @param description of the Execution Result
043: * @param status (FAIT, A_FAIRE)
044: * @param result (INCOMPLETE, STOPPEE, TERMINEE)
045: * @param idUser
046: * @return the id of the Execution Result in the table RES_EXEC_CAMP
047: * @throws Exception canExecutCamp
048: * need permission
049: */
050: public int insert(int idExec, String name, String description,
051: String status, String result, int idUser) throws Exception;
052:
053: /**
054: * Attach an Url to the Execution Result : idExecRes (table ENV_ATTACHEMENT)
055: * @param idExecRes
056: * @param url
057: * @param description of the url
058: * @return the Id of the attachment in the table ATTACHEMENT
059: * @throws Exception
060: * @see ISQLUrlAttachment.insert(String, String)
061: * no permission needed
062: */
063: public int addAttachUrl(int idExecRes, String url,
064: String description) throws Exception;
065:
066: /**
067: * Attach a file to the Execution Result : idExecRes (table ENV_ATTACHEMENT)
068: * @param idExecRes
069: * @param file
070: * @param description of the file
071: * @return the Id of the attachment in the table ATTACHEMENT
072: * @throws Exception
073: * @see ISQLFileAttachment.insert(File, String)
074: * no permission needed
075: */
076: public int addAttachFile(int idExecRes, SalomeFileWrapper file,
077: String description) throws Exception;
078:
079: /**
080: * Update the data of the Execution Result identified by idExecRes
081: * @param idResExec
082: * @param description
083: * @param status (FAIT, A_FAIRE)
084: * @param result (INCOMPLETE, STOPPEE, TERMINEE)
085: * @param idUser
086: * @throws Exception
087: * need permission canExecutCamp
088: */
089: public void update(int idResExec, String description,
090: String status, String result, int idUser) throws Exception;
091:
092: /**
093: * replace all reference of user oldIdUser by newIdUser in the table (RES_EXEC_CAMP) where execution is idExec
094: * @param oldIdUser
095: * @param newIdUser
096: * @throws Exception
097: * no permission needed
098: */
099: public void updateUserRef(int idExec, int oldIdUser, int newIdUser)
100: throws Exception;
101:
102: /**
103: * Delete the Execution Result identified by idExecRes in table RES_EXEC_CAMP
104: * Then delete all attachements, and related Test and Action execution result
105: * @param idResExec
106: * @throws Exception
107: * @see ISQLExecutionTestResult.deleteAllFrom(int)
108: * need permission canExecutCamp
109: */
110: public void delete(int idResExec) throws Exception;
111:
112: /**
113: * Delete all attchements of the Execution Result identified by idExecRes
114: * @param idResExec
115: * @throws Exception
116: * no permission needed
117: */
118: public void deleteAllAttach(int idResExec) throws Exception;
119:
120: /**
121: * Delete an attchement idAttach of the Execution Result identified by idExecRes
122: * @param idResExec
123: * @param idAttach
124: * @throws Exception
125: * @see ISQLAttachment.delete(int)
126: * no permission needed
127: */
128: public void deleteAttach(int idResExec, int idAttach)
129: throws Exception;
130:
131: /**
132: * Get an Array of FileAttachementWrapper representing the files attachment of the
133: * Execution Result identified by idExecRes
134: * @param idResExec
135: * @return
136: * @throws Exception
137: */
138: public FileAttachementWrapper[] getAttachFiles(int idResExec)
139: throws Exception;
140:
141: /**
142: * Get an Array of UrlAttachementWrapper representing the Urls attachment of the
143: * Execution Result identified by idExecRes
144: * @param idResExec
145: * @return
146: * @throws Exception
147: */
148: public UrlAttachementWrapper[] getAttachUrls(int idResExec)
149: throws Exception;
150:
151: /**
152: * Get an Array of all attachments (AttachementWrapper, File or Url) of the
153: * Execution Result identified by idExecRes
154: * @param idResExec
155: * @return
156: * @throws Exception
157: */
158: public AttachementWrapper[] getAttachs(int idResExec)
159: throws Exception;
160:
161: /**
162: * Get the id of the Execution Result identified by name in the Excecution idExec
163: * @param idExec
164: * @param name
165: * @return
166: * @throws Exception
167: */
168: public int getID(int idExec, String name) throws Exception;
169:
170: /**
171: * @param idResExec
172: * @return The number of test FAIL (ApiConstants.FAIL, and FAILED in the databse) in the execution result
173: */
174: public int getNumberOfFail(int idResExec) throws Exception;
175:
176: /**
177: * @param idResExec
178: * @return The number of test FAIL (ApiConstants.SUCCESS, and PASSED in the databse) in the execution result
179: */
180: public int getNumberOfPass(int idResExec) throws Exception;
181:
182: /**
183: * @param idResExec
184: * @return The number of test FAIL (ApiConstants.UNKNOWN, and INCONCLUSIF in the databse) in the execution result
185: */
186: public int getNumberOfInc(int idResExec) throws Exception;
187:
188: /**
189: * Get an ExecutionResultWrapper representing the ExecutionResult identifed by idResExec
190: * @param idResExec
191: * @return
192: * @throws Exception
193: */
194: public ExecutionResultWrapper getWrapper(int idResExec)
195: throws Exception;
196:
197: /**
198: * Get an Array of ExcutionResultTestWrapper included in the ExecutionResult identifed by idResExec
199: * @param idResExec
200: * @return
201: * @throws Exception
202: */
203: public ExecutionResultTestWrapper[] getExecutionResultTestWrapper(
204: int idResExec) throws Exception;
205:
206: /**
207: * Get the status of the execution of the tests idTest in the execution result idResExec
208: * @param idResExec
209: * @param idTest
210: * @return
211: * @throws Exception
212: */
213: public String getTestResultInExecution(int idResExec, int idTest)
214: throws Exception;
215:
216: /**
217: * Get an Array of TestAttachementWrapper
218: * @param idResExec
219: * @return
220: * @throws Exception
221: */
222: public TestAttachmentWrapper[] getAllAttachTestInExecutionResult(
223: int idResExec) throws Exception;
224:
225: }
|