001: package org.objectweb.salome_tmf.api.sql;
002:
003: import java.rmi.Remote;
004:
005: import org.objectweb.salome_tmf.api.data.AttachementWrapper;
006: import org.objectweb.salome_tmf.api.data.FileAttachementWrapper;
007: import org.objectweb.salome_tmf.api.data.ParameterWrapper;
008: import org.objectweb.salome_tmf.api.data.SalomeFileWrapper;
009: import org.objectweb.salome_tmf.api.data.TestWrapper;
010: import org.objectweb.salome_tmf.api.data.UrlAttachementWrapper;
011:
012: public interface ISQLTest extends Remote {
013: /**
014: * Add in database the reference of use paramter paramId for test idTest in table CAS_PARAM_TEST
015: * @param idTest : id of the test
016: * @param paramId : id of the parameter
017: * @throws Exception
018: * need permission canUpdateTest
019: */
020: public void addUseParam(int idTest, int paramId) throws Exception;
021:
022: /**
023: * Attach a file attach to a test in table ATTACHEMENT and reference in table CAS_ATTACHEMENT
024: * @param idTest : id of the test
025: * @param f : the file
026: * @param description of the file
027: * @return the id of the attachment in the table ATTACHEMENT
028: * @throws Exception
029: * @See ISQLFileAttachment.insert(File, String);
030: * no permission needed
031: */
032: public int addAttachFile(int idTest, SalomeFileWrapper f,
033: String description) throws Exception;
034:
035: /**
036: * Attach a url to a test in table ATTACHEMENT and reference in table CAS_ATTACHEMENT
037: * @param idTest : id of the test
038: * @param url
039: * @param description of the url
040: * @return the id of the attachment in the table ATTACHEMENT
041: * @see ISQLUrlAttachment.insert(String, String);
042: * @throws Exception
043: */
044: public int addAttachUrl(int idTest, String url, String description)
045: throws Exception;
046:
047: /**
048: * Update the test with new name and description
049: * @param idTest : id of the test
050: * @param newName : the new name
051: * @param newDesc : the new description
052: * @throws Exception
053: * need permission canUpdateTest
054: */
055: public void update(int idTest, String newName, String newDesc)
056: throws Exception;
057:
058: /**
059: * Update order of the test by incrementation if increment = true or decrementation
060: * @param idTest : id of the test
061: * @param increment
062: * @return the new order of the test in database
063: * @throws Exception
064: */
065: public int updateOrder(int idTest, boolean increment)
066: throws Exception;
067:
068: /**
069: * replace all reference of user oldIdUser by newIdUser in the table (CAS_TEST) where suite = idSuite
070: * @param oldIdUser
071: * @param newIdUser
072: * @throws Exception
073: * no permission needed
074: */
075: public void updateUserRef(int idSuite, int oldIdUser, int newIdUser)
076: throws Exception;
077:
078: /**
079: * Delete the test in table CAS_TEST and all reference (Parameter, Campaign) and the test attachments
080: * delete test actions (if manual test), delete test script (if automatic test)
081: * @param idTest : id of the test
082: * @throws Exception
083: * @see deleteAllUseParam(int)
084: * @see deleteAllAttach(int)
085: * @see ISQLCampaign.deleteTestInAllCampaign(int)
086: * need permission canDeleteTest
087: */
088: public void delete(int idTest) throws Exception;
089:
090: /**
091: * Delete the test in table CAS_TEST and all reference (Parameter, Campaign) and the test attachments
092: * delete test actions (if manual test), delete test script (if automatic test)
093: * Update order of test in the suite if reorder = true
094: * @param idTest : id of the test
095: * @param reorder reorder the test in the suite
096: * @throws Exception
097: * @see deleteAllUseParam(int)
098: * @see deleteAllAttach(int)
099: * @see ISQLCampaign.deleteTestInAllCampaign(int)
100: * need permission canDeleteTest
101: * @TODO SOAP
102: */
103: public void delete(int idTest, boolean reorder) throws Exception;
104:
105: /**
106: * Delete all attachment in table (CAS_ATTACHEMENT and ATTACHEMENT) for the test
107: * @param idTest : id of the test
108: * @throws Exception
109: * @see deleteAttach(int, int)
110: * no permission needed
111: */
112: public void deleteAllAttach(int idTest) throws Exception;
113:
114: /**
115: * Delete all reference about using parameter (table CAS_PARAM_TEST) for the test
116: * if the test is manual, parameters are deleted in action
117: * @param idTest : id of the test
118: * @throws Exception
119: * need permission canUpdateTest
120: */
121: public void deleteAllUseParam(int idTest) throws Exception;
122:
123: /**
124: * Delete reference about using parameter paramId (table CAS_PARAM_TEST) for the test
125: * if the test is manual, parameters are deleted in action
126: * @param idTest : id of the test
127: * @param paramId : id of the parameter
128: * @throws Exception
129: * @see ISQLAction.deleteParamUse(int, int)
130: * need permission canUpdateTest
131: */
132: public void deleteUseParam(int idTest, int paramId)
133: throws Exception;
134:
135: /**
136: * Delete attachement for the test and the attachement (tables CAS_ATTACHEMENT, ATTACHEMENT)
137: * @param idTest : id of the test
138: * @param attachId : id of the attachment
139: * @throws Exception
140: * @see ISQLAttachment.delete(int)
141: * no permission needed
142: */
143: public void deleteAttach(int idTest, int attachId) throws Exception;
144:
145: /**
146: * Get a TestWrapper for the test identified by testId
147: * @param testId : id of the test
148: * @return
149: * @throws Exception
150: * @see TestWrapper
151: */
152: public TestWrapper getTest(int testId) throws Exception;
153:
154: /**
155: * Get the id of the test identified by name in the testlist identified by idTestList
156: * @param idTestList : id of the testlist
157: * @param name : the test name
158: * @return a test id
159: * @throws Exception
160: */
161: public int getID(int idTestList, String name) throws Exception;
162:
163: /**
164: * Get an Array of AttachementWrapper (FileAttachementWrapper, UrlAttachementWrapper)
165: * for the test identified by testId
166: * @param testId : id of the test
167: * @return
168: * @throws Exception
169: */
170: public AttachementWrapper[] getAllAttachemnt(int testId)
171: throws Exception;
172:
173: /**
174: * Get an Array of FileAttachementWrapper for the test identified by testId
175: * @param testId : id of the test
176: * @return
177: * @throws Exception
178: */
179: public FileAttachementWrapper[] getAllAttachFiles(int testId)
180: throws Exception;
181:
182: /**
183: * Get an Array of UrlAttachementWrapper for the test identified by testId
184: * @param testId : id of the test
185: * @return
186: * @throws Exception
187: */
188: public UrlAttachementWrapper[] getAllAttachUrls(int testId)
189: throws Exception;
190:
191: /**
192: * Get an Array of ParameterWrapper (only id is set) using by the test identifed by testId
193: * @param testId : id of the test
194: * @return
195: * @throws Exception
196: */
197: public ParameterWrapper[] getAllUseParams(int testId)
198: throws Exception;
199: }
|