Introduce Mockito unit tests into Share AMP project

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@91731 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2014-12-04 00:19:46 +00:00
parent cf7945caa4
commit 9c679b9b54
5 changed files with 14 additions and 11 deletions

View File

@@ -335,7 +335,8 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
{
NodeRef child = null;
List<ChildAssociationRef> children = getNodeService().getChildAssocs(parent);
for (ChildAssociationRef childAssoc : children) {
for (ChildAssociationRef childAssoc : children)
{
NodeRef childNodeRef = childAssoc.getChildRef();
String existingChildName = (String)getNodeService().getProperty(childNodeRef, ContentModel.PROP_NAME);
if(existingChildName.equals(childName))

View File

@@ -831,7 +831,8 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
M2Property targetProperty = findProperty(propQName, deserializedModel);
// Need to count backwards to remove constraints
for (int i = targetProperty.getConstraints().size() - 1; i >= 0; i--) {
for (int i = targetProperty.getConstraints().size() - 1; i >= 0; i--)
{
String ref = targetProperty.getConstraints().get(i).getRef();
targetProperty.removeConstraintRef(ref);
}

View File

@@ -221,7 +221,8 @@ public class DateParameterProcessor extends ParameterProcessor implements Parame
String namePrefix = this.getName() + ".";
if(StringUtils.isBlank(substitutionFragment) || this.getName().toLowerCase().contains(substitutionFragment.toLowerCase()))
{
for(String field: ALL_FIELDS_FOR_SUBSTITUTION_QUERY) {
for(String field: ALL_FIELDS_FOR_SUBSTITUTION_QUERY)
{
suggestions.add(namePrefix + field);
if(suggestions.size() >= maximumNumberSuggestions)
{
@@ -231,7 +232,8 @@ public class DateParameterProcessor extends ParameterProcessor implements Parame
}
else
{
for(String field: ALL_FIELDS_FOR_SUBSTITUTION_QUERY) {
for(String field: ALL_FIELDS_FOR_SUBSTITUTION_QUERY)
{
String prefixFieldName = namePrefix + field;
if(prefixFieldName.toLowerCase().contains(substitutionFragment.toLowerCase()))
{

View File

@@ -163,7 +163,8 @@ public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
* @param fragment
* @return
*/
private List<String> getSubPathSuggestions(WebScriptRequest req, final String path, final String fragment, boolean unfiled) {
private List<String> getSubPathSuggestions(WebScriptRequest req, final String path, final String fragment, boolean unfiled)
{
List<String> pathSuggestions = new ArrayList<String>();
if((path != null) && path.startsWith("/") && (fragment != null))
{
@@ -177,7 +178,8 @@ public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
{
boolean foundThisPathFragment = false;
List<ChildAssociationRef> children = nodeService.getChildAssocs(currentNode);
for (ChildAssociationRef childAssoc : children) {
for (ChildAssociationRef childAssoc : children)
{
NodeRef childNodeRef = childAssoc.getChildRef();
String fileName = (String) nodeService.getProperty(childNodeRef, ContentModel.PROP_NAME);
if(fileName.equals(pathFragment) && isNodeRefAppropriateForPathSuggestion(childNodeRef, unfiled))
@@ -199,7 +201,8 @@ public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
{
String lowerCaseFragment = fragment.toLowerCase();
List<ChildAssociationRef> children = nodeService.getChildAssocs(currentNode);
for (ChildAssociationRef childAssoc : children) {
for (ChildAssociationRef childAssoc : children)
{
NodeRef childNodeRef = childAssoc.getChildRef();
String fileName = (String) nodeService.getProperty(childNodeRef, ContentModel.PROP_NAME);
if((fragment.isEmpty() || fileName.toLowerCase().startsWith(lowerCaseFragment)) && isNodeRefAppropriateForPathSuggestion(childNodeRef, unfiled))