Merge branch 'master' into 'feature/RM-6302_EditDispositionSchedule'

Syncing with master

See merge request records-management/records-management!985
This commit is contained in:
Jelena Cule
2018-05-10 10:23:13 +01:00
7 changed files with 53 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-rm</artifactId> <artifactId>alfresco-rm</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.7-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>
<name>Alfresco Records Management</name> <name>Alfresco Records Management</name>
<parent> <parent>

View File

@@ -8,7 +8,7 @@
<parent> <parent>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-rm</artifactId> <artifactId>alfresco-rm</artifactId>
<version>2.7-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>
</parent> </parent>
<licenses> <licenses>

View File

@@ -8,7 +8,7 @@
<parent> <parent>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-rm-automation</artifactId> <artifactId>alfresco-rm-automation</artifactId>
<version>2.7-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>

View File

@@ -77,6 +77,7 @@ import org.alfresco.rest.search.RestRequestQueryModel;
import org.alfresco.rest.search.SearchNodeModel; import org.alfresco.rest.search.SearchNodeModel;
import org.alfresco.rest.search.SearchRequest; import org.alfresco.rest.search.SearchRequest;
import org.alfresco.rest.v0.RMRolesAndActionsAPI; import org.alfresco.rest.v0.RMRolesAndActionsAPI;
import org.alfresco.rest.v0.SearchAPI;
import org.alfresco.utility.data.DataUser; import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.model.ContentModel; import org.alfresco.utility.model.ContentModel;
import org.alfresco.utility.model.FolderModel; import org.alfresco.utility.model.FolderModel;
@@ -114,6 +115,10 @@ public class BaseRMRestTest extends RestTest
@Getter(value = PROTECTED) @Getter(value = PROTECTED)
private RMRolesAndActionsAPI rmRolesAndActionsAPI; private RMRolesAndActionsAPI rmRolesAndActionsAPI;
@Autowired
@Getter(value = PROTECTED)
private SearchAPI searchApi;
/** /**
* Asserts the given status code * Asserts the given status code
* *
@@ -663,6 +668,46 @@ public class BaseRMRestTest extends RestTest
return names; return names;
} }
/**
* Returns records search results for the given search term
*
* @param user
* @param term
* @return
* @throws Exception
*/
public List<String> searchForRMContentAsUser(UserModel user, String term, String expectedResult) throws Exception
{
List<String> results = new ArrayList<>();
// wait for solr indexing
int counter = 0;
int waitInMilliSeconds = 6000;
while (counter < 3)
{
results = searchApi.searchForRecordsAsUser(user.getUsername(), user.getPassword(), term);
if ((results != null && !results.isEmpty() && results.contains(expectedResult)))
{
break;
} else
{
counter++;
}
// double wait time to not overdo solr search
waitInMilliSeconds = (waitInMilliSeconds * 2);
synchronized (this)
{
try
{
this.wait(waitInMilliSeconds);
} catch (InterruptedException e)
{
}
}
}
return results;
}
/** /**
* Helper method to return site document library content model * Helper method to return site document library content model
* *

View File

@@ -8,7 +8,7 @@
<parent> <parent>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-rm</artifactId> <artifactId>alfresco-rm</artifactId>
<version>2.7-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>
</parent> </parent>
<licenses> <licenses>

View File

@@ -9,7 +9,7 @@
<parent> <parent>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-rm-community</artifactId> <artifactId>alfresco-rm-community</artifactId>
<version>2.7-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>

View File

@@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-rm-community</artifactId> <artifactId>alfresco-rm-community</artifactId>
<version>2.7-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>