} else {
processing = "file-download";
}
- docDTO.addFile(tag.value().getFile().getRelativePath(), aState,
- processing, false);
+ File aFile = tag.value().getFile();
+ docDTO.addFile(aFile.getIndex(), aFile.getRelativePath(),
+ aState, processing, false);
// Process all exported files
for (Relation rel : tag.value().getRelations(
ConvertsRelation.class)) {
- File aFile = ((ConvertsRelation) rel).getTo();
+ aFile = ((ConvertsRelation) rel).getTo();
fileFormat = aFile.getFormat();
doImport = getProjectSettings().doImport(docType,
fileFormat);
} else {
processing = "file-download";
}
- docDTO.addFile(aFile.getRelativePath(), aState, processing,
- false);
+ docDTO.addFile(aFile.getIndex(), aFile.getRelativePath(),
+ aState, processing, false);
}
}
}
/**
* Add a new file DTO.
*
+ * @param id
+ * file persistent id
* @param relativePath
* relative file path
* @param state
* true if the file is result
* @return the added file DTO
*/
- public FileDTO addFile(final String relativePath, final char state,
+ public FileDTO addFile(final long id, final String relativePath, final char state,
final String processing, final boolean isResult) {
- FileDTO fileDTO = new FileDTO(relativePath, state, processing, isResult);
+ FileDTO fileDTO = new FileDTO(id, relativePath, state, processing, isResult);
_files.add(fileDTO);
return fileDTO;
}
*/
public class FileDTO {
+ /**
+ * File persistent id.
+ */
+ private Long _id;
/**
* True if the file is a result file for a document.
*/
/**
* Constructor with initialization.
*
+ * @param id
+ * file persistent id
* @param relativePath
* relative file path
* @param state
* @param isResult
* true if the file is result
*/
- public FileDTO(final String relativePath, final char state,
+ public FileDTO(final long id, final String relativePath, final char state,
final String processing, final boolean isResult) {
+ _id = id;
_path = relativePath;
_state = state;
_processing = processing;
_isResult = isResult;
}
-
+
/**
* Constructor with partial initialization.
*
fstate = "file-outdated";
}
buf.append(indent).append(ftype).append(" file: ").append(getPath())
- .append('\n').append(indent).append(
+ .append('\n').append(indent).append(" File ID: ").append(
+ getId()).append('\n').append(indent).append(
" Automatic processing: ").append(getProcessing())
.append('\n').append(indent).append(" State: ").append(
fstate).append('\n');
return buf.toString();
}
+
+ /**
+ * Get the id.
+ *
+ * @return the id
+ */
+ public Long getId() {
+ return _id;
+ }
+
+ /**
+ * Set the id.
+ *
+ * @param id
+ * the id to set
+ */
+ public void setId(final Long id) {
+ _id = id;
+ }
}
* @throws SQLException
* if scenario creation is failed
*/
- @Test
+ @Test(groups = { "checkout", "sevice", "functional", "business" })
public void testGetScenarioInfo() throws InvalidPropertyException,
MissedPropertyException, MultiplyDefinedException, IOException,
SQLException {
--- /dev/null
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="SimanCommonTests" verbose="1">
+ <test name="all">
+ <method-selectors>
+ <method-selector>
+ <script language="beanshell">
+ <![CDATA[
+ (groups.containsKey("checkout")) && method.getName().toUpperCase().startsWith("TEST")
+ ]]>
+ </script>
+ </method-selector>
+ </method-selectors>
+ <groups>
+ <!--
+ <define name="all">
+ <include name="business"/>
+ <include name="functional"/>
+ <include name="service"/>
+ </define>
+ <define name="new">
+ <include name="newservice"/>
+ </define>
+ <run>
+ <include name="all"/>
+ <exclude name="old"/>
+ </run>
+ -->
+
+ </groups>
+ <packages>
+ <package name="test.*" />
+ </packages>
+ </test>
+</suite>