RED-4510: Generated Redaction Log and Generating will not run with profile
This commit is contained in:
parent
4236ba868f
commit
2237ae3910
@ -245,7 +245,7 @@ public class RulesTest {
|
||||
* Analyses all files and compares its RedactionLog with saved one from here: REDACTION_LOG_PATH.
|
||||
* If RedactionLog Json for one file does not exist, whole test will fail.
|
||||
*/
|
||||
@IfProfileValue(name = "test-groups", value = "rules-test")
|
||||
@IfProfileValue(name = "test-groups", value = "rules-test") //TODO PSC
|
||||
@Test
|
||||
public void analyseAllFilesAndCompareRedactionLogs() {
|
||||
|
||||
@ -415,6 +415,9 @@ public class RulesTest {
|
||||
|
||||
}
|
||||
|
||||
private String cleanPath(String path) {
|
||||
return StringUtils.replace(path, "\\", "/");
|
||||
}
|
||||
|
||||
private boolean doesRedactionLogExist(String pdfFileName) {
|
||||
|
||||
@ -463,9 +466,12 @@ public class RulesTest {
|
||||
System.out.println("XXXXXXXXX pdfFileName: " + pdfFileName);
|
||||
|
||||
File pdfFile = new File(pdfFileName);
|
||||
String directory = pdfFile.getParentFile().getPath();
|
||||
if (StringUtils.contains(directory, RESOURCES_PATH) || StringUtils.contains(directory, StringUtils.replace(RESOURCES_PATH, "/", "\\"))) {
|
||||
directory = directory + "/" + REDACTION_LOG_PATH;
|
||||
String directory = cleanPath(pdfFile.getParentFile().getPath());
|
||||
if (StringUtils.contains(directory, RESOURCES_PATH)) {// || StringUtils.contains(directory, StringUtils.replace(RESOURCES_PATH, "/", "\\"))
|
||||
if (!StringUtils.endsWith(directory, "/")) {
|
||||
directory = directory + "/";
|
||||
}
|
||||
directory = directory + REDACTION_LOG_PATH;
|
||||
} else {
|
||||
if (StringUtils.startsWith(directory, "/")) {
|
||||
directory = StringUtils.substring(directory, 1);
|
||||
@ -630,14 +636,14 @@ public class RulesTest {
|
||||
if (path.toFile().isDirectory()) {
|
||||
getFileNames(fileNames, path);
|
||||
} else if (StringUtils.endsWith(path.toAbsolutePath().toString(), ".pdf")) {
|
||||
String absolutePath = path.toAbsolutePath().toString();
|
||||
String absolutePath = cleanPath(path.toAbsolutePath().toString());
|
||||
System.out.println("absolutePath: " + absolutePath);
|
||||
|
||||
int pos = StringUtils.indexOf(absolutePath, RESOURCES_PATH);
|
||||
if (pos < 0) {
|
||||
pos = StringUtils.indexOf(absolutePath, StringUtils.replace(RESOURCES_PATH, "/", "\\"));
|
||||
}
|
||||
pos += 18;
|
||||
int pos = StringUtils.indexOf(absolutePath, RESOURCES_PATH) + RESOURCES_PATH.length();
|
||||
// if (pos < 0) {
|
||||
// pos = StringUtils.indexOf(absolutePath, StringUtils.replace(RESOURCES_PATH, "/", "\\"));
|
||||
// }
|
||||
// pos += 18;
|
||||
|
||||
System.out.println("pos: " + pos);
|
||||
fileNames.add(StringUtils.substring(absolutePath, pos));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user