mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1144 & RM-1145 - changes to file to action - post review changes
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@61188 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,6 +25,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date parameter processor.
|
* Date parameter processor.
|
||||||
@@ -41,26 +42,18 @@ public class DateParameterProcessor extends ParameterProcessor implements Parame
|
|||||||
private static final String SHORT = "short";
|
private static final String SHORT = "short";
|
||||||
private static final String LONG = "long";
|
private static final String LONG = "long";
|
||||||
private static final String NUMBER = "number";
|
private static final String NUMBER = "number";
|
||||||
|
|
||||||
private static final String SEP = ".";
|
private static final String SEP = ".";
|
||||||
|
|
||||||
private static final String[] ALL_FIELDS_FOR_SUBSTITUTION_QUERY = {
|
private static final String[] ALL_FIELDS_FOR_SUBSTITUTION_QUERY = {
|
||||||
DAY,
|
DAY + SEP + SHORT,
|
||||||
DAY + SEP + SHORT,
|
DAY + SEP + LONG,
|
||||||
DAY + SEP + LONG,
|
DAY + SEP + NUMBER,
|
||||||
DAY + SEP + NUMBER,
|
MONTH + SEP + SHORT,
|
||||||
WEEK,
|
MONTH + SEP + LONG,
|
||||||
WEEK + SEP + SHORT,
|
MONTH + SEP + NUMBER,
|
||||||
WEEK + SEP + LONG,
|
YEAR + SEP + SHORT,
|
||||||
WEEK + SEP + NUMBER,
|
YEAR + SEP + LONG
|
||||||
MONTH,
|
|
||||||
MONTH + SEP + SHORT,
|
|
||||||
MONTH + SEP + LONG,
|
|
||||||
MONTH + SEP + NUMBER,
|
|
||||||
YEAR,
|
|
||||||
YEAR + SEP + SHORT,
|
|
||||||
YEAR + SEP + LONG,
|
|
||||||
YEAR + SEP + NUMBER
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,7 +194,7 @@ public class DateParameterProcessor extends ParameterProcessor implements Parame
|
|||||||
{
|
{
|
||||||
List<String> suggestions = new ArrayList<String>();
|
List<String> suggestions = new ArrayList<String>();
|
||||||
String namePrefix = this.getName() + ".";
|
String namePrefix = this.getName() + ".";
|
||||||
if(this.getName().toLowerCase().contains(substitutionFragment.toLowerCase()))
|
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);
|
suggestions.add(namePrefix + field);
|
||||||
|
@@ -30,11 +30,10 @@ import org.alfresco.error.AlfrescoRuntimeException;
|
|||||||
import org.alfresco.service.cmr.action.ParameterizedItem;
|
import org.alfresco.service.cmr.action.ParameterizedItem;
|
||||||
import org.alfresco.service.cmr.action.ParameterizedItemDefinition;
|
import org.alfresco.service.cmr.action.ParameterizedItemDefinition;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parameter processor component
|
* Parameter processor component
|
||||||
*
|
*
|
||||||
* @author Roy Wetherall
|
* @author Roy Wetherall
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
@@ -43,27 +42,27 @@ public class ParameterProcessorComponent implements ParameterSubstitutionSuggest
|
|||||||
/** regex used to parse parameters */
|
/** regex used to parse parameters */
|
||||||
private static final String REG_EX_OLD = "\\$\\{([^\\$\\{]+)\\}";
|
private static final String REG_EX_OLD = "\\$\\{([^\\$\\{]+)\\}";
|
||||||
private static final String REG_EX = "\\{([^\\{]+)\\}";
|
private static final String REG_EX = "\\{([^\\{]+)\\}";
|
||||||
|
|
||||||
/** registry of parameter processors */
|
/** registry of parameter processors */
|
||||||
private Map<String, ParameterProcessor> processors = new HashMap<String, ParameterProcessor>(5);
|
private Map<String, ParameterProcessor> processors = new HashMap<String, ParameterProcessor>(5);
|
||||||
private List<ParameterSubstitutionSuggester> subtitutionSuggesterProcessors = new ArrayList<ParameterSubstitutionSuggester>(5);
|
private List<ParameterSubstitutionSuggester> subtitutionSuggesterProcessors = new ArrayList<ParameterSubstitutionSuggester>(5);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register parameter processor
|
* Register parameter processor
|
||||||
*
|
*
|
||||||
* @param processor
|
* @param processor
|
||||||
*/
|
*/
|
||||||
public void register(ParameterProcessor processor)
|
public void register(ParameterProcessor processor)
|
||||||
{
|
{
|
||||||
this.processors.put(processor.getName(), processor);
|
this.processors.put(processor.getName(), processor);
|
||||||
if(processor instanceof ParameterSubstitutionSuggester)
|
if(processor instanceof ParameterSubstitutionSuggester)
|
||||||
{
|
{
|
||||||
this.subtitutionSuggesterProcessors.add((ParameterSubstitutionSuggester)processor);
|
this.subtitutionSuggesterProcessors.add((ParameterSubstitutionSuggester)processor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param ruleItem
|
* @param ruleItem
|
||||||
* @param ruleItemDefinition
|
* @param ruleItemDefinition
|
||||||
* @param actionedUponNodeRef
|
* @param actionedUponNodeRef
|
||||||
@@ -72,21 +71,21 @@ public class ParameterProcessorComponent implements ParameterSubstitutionSuggest
|
|||||||
{
|
{
|
||||||
for (Map.Entry<String, Serializable> entry : ruleItem.getParameterValues().entrySet())
|
for (Map.Entry<String, Serializable> entry : ruleItem.getParameterValues().entrySet())
|
||||||
{
|
{
|
||||||
String parameterName = entry.getKey();
|
String parameterName = entry.getKey();
|
||||||
Object parameterValue = entry.getValue();
|
Object parameterValue = entry.getValue();
|
||||||
|
|
||||||
// only sub string property values
|
// only sub string property values
|
||||||
if (parameterValue != null && parameterValue instanceof String)
|
if (parameterValue != null && parameterValue instanceof String)
|
||||||
{
|
{
|
||||||
// set the updated parameter value
|
// set the updated parameter value
|
||||||
ruleItem.setParameterValue(parameterName, process((String)parameterValue, actionedUponNodeRef));
|
ruleItem.setParameterValue(parameterName, process((String)parameterValue, actionedUponNodeRef));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the value for substitution within the context of the provided node.
|
* Process the value for substitution within the context of the provided node.
|
||||||
*
|
*
|
||||||
* @param value value
|
* @param value value
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
* @return String resulting value
|
* @return String resulting value
|
||||||
@@ -95,18 +94,18 @@ public class ParameterProcessorComponent implements ParameterSubstitutionSuggest
|
|||||||
{
|
{
|
||||||
return process(process(value, nodeRef, REG_EX_OLD), nodeRef, REG_EX);
|
return process(process(value, nodeRef, REG_EX_OLD), nodeRef, REG_EX);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String process(String value, NodeRef nodeRef, String regExp)
|
public String process(String value, NodeRef nodeRef, String regExp)
|
||||||
{
|
{
|
||||||
// match the substitution pattern
|
// match the substitution pattern
|
||||||
Pattern patt = Pattern.compile(regExp);
|
Pattern patt = Pattern.compile(regExp);
|
||||||
Matcher m = patt.matcher(value);
|
Matcher m = patt.matcher(value);
|
||||||
StringBuffer sb = new StringBuffer(value.length());
|
StringBuffer sb = new StringBuffer(value.length());
|
||||||
|
|
||||||
while (m.find())
|
while (m.find())
|
||||||
{
|
{
|
||||||
String text = m.group(1);
|
String text = m.group(1);
|
||||||
|
|
||||||
// lookup parameter processor to use
|
// lookup parameter processor to use
|
||||||
ParameterProcessor processor = lookupProcessor(text);
|
ParameterProcessor processor = lookupProcessor(text);
|
||||||
if (processor == null)
|
if (processor == null)
|
||||||
@@ -114,47 +113,44 @@ public class ParameterProcessorComponent implements ParameterSubstitutionSuggest
|
|||||||
throw new AlfrescoRuntimeException("A parameter processor has not been found for the substitution string " + text);
|
throw new AlfrescoRuntimeException("A parameter processor has not been found for the substitution string " + text);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// process each substitution value
|
// process each substitution value
|
||||||
text = processor.process(text, nodeRef);
|
text = processor.process(text, nodeRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
// append new value
|
// append new value
|
||||||
m.appendReplacement(sb, Matcher.quoteReplacement(text));
|
m.appendReplacement(sb, Matcher.quoteReplacement(text));
|
||||||
}
|
}
|
||||||
m.appendTail(sb);
|
m.appendTail(sb);
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of substitution suggestions for the passed string fragment.
|
* Return a list of substitution suggestions for the passed string fragment.
|
||||||
*
|
*
|
||||||
* @param subtitutionFragment Text fragment to search on.
|
* @param subtitutionFragment Text fragment to search on.
|
||||||
* @return A list of substitutions that match the substitution fragment.
|
* @return A list of substitutions that match the substitution fragment.
|
||||||
*/
|
*/
|
||||||
public List<String> getSubstitutionSuggestions(final String substitutionFragment)
|
public List<String> getSubstitutionSuggestions(final String substitutionFragment)
|
||||||
{
|
{
|
||||||
List<String> suggestions = new ArrayList<String>();
|
List<String> suggestions = new ArrayList<String>();
|
||||||
if (StringUtils.isNotBlank(substitutionFragment))
|
for (ParameterSubstitutionSuggester suggestor : this.subtitutionSuggesterProcessors)
|
||||||
{
|
{
|
||||||
for (ParameterSubstitutionSuggester suggestor : this.subtitutionSuggesterProcessors)
|
suggestions.addAll(suggestor.getSubstitutionSuggestions(substitutionFragment.toLowerCase()));
|
||||||
{
|
|
||||||
suggestions.addAll(suggestor.getSubstitutionSuggestions(substitutionFragment.toLowerCase()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return suggestions;
|
return suggestions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Look up parameter processor
|
* Look up parameter processor
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private ParameterProcessor lookupProcessor(String value)
|
private ParameterProcessor lookupProcessor(String value)
|
||||||
{
|
{
|
||||||
ParameterProcessor result = null;
|
ParameterProcessor result = null;
|
||||||
|
|
||||||
if (value != null && value.isEmpty() == false)
|
if (value != null && value.isEmpty() == false)
|
||||||
{
|
{
|
||||||
String[] values = value.split("\\.", 2);
|
String[] values = value.split("\\.", 2);
|
||||||
@@ -164,7 +160,7 @@ public class ParameterProcessorComponent implements ParameterSubstitutionSuggest
|
|||||||
result = processors.get(values[0]);
|
result = processors.get(values[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.web.scripts.substitutionsuggestions;
|
package org.alfresco.repo.web.scripts.substitutionsuggestions;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -31,13 +32,14 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
/**
|
/**
|
||||||
* Implementation for Java backed webscript to get substitution suggestions
|
* Implementation for Java backed webscript to get substitution suggestions
|
||||||
* given a text fragment (e.g. date.month for 'mon').
|
* given a text fragment (e.g. date.month for 'mon').
|
||||||
*
|
*
|
||||||
* @author Mark Hibbins
|
* @author Mark Hibbins
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
*/
|
*/
|
||||||
public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
|
public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
|
||||||
{
|
{
|
||||||
private final static String FRAGMENT_PARAMETER = "fragment";
|
private final static String FRAGMENT_PARAMETER = "fragment";
|
||||||
|
private final static String PATH_PARAMETER = "path";
|
||||||
|
|
||||||
private final static String SUBSTITUTIONS_MODEL_KEY = "substitutions";
|
private final static String SUBSTITUTIONS_MODEL_KEY = "substitutions";
|
||||||
|
|
||||||
@@ -57,11 +59,25 @@ public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
|
|||||||
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||||
{
|
{
|
||||||
String fragment = req.getParameter(FRAGMENT_PARAMETER);
|
String fragment = req.getParameter(FRAGMENT_PARAMETER);
|
||||||
List<String> substitutionSuggestions = this.parameterProcessorComponent.getSubstitutionSuggestions(fragment);
|
String path = req.getParameter(PATH_PARAMETER);
|
||||||
|
|
||||||
|
List<String> substitutionSuggestions = new ArrayList<String>();
|
||||||
|
|
||||||
|
substitutionSuggestions.addAll(getSubPathSuggestions(path, fragment));
|
||||||
|
substitutionSuggestions.addAll(this.parameterProcessorComponent.getSubstitutionSuggestions(fragment));
|
||||||
|
|
||||||
Map<String, Object> model = new HashMap<String, Object>();
|
Map<String, Object> model = new HashMap<String, Object>();
|
||||||
model.put(SUBSTITUTIONS_MODEL_KEY, substitutionSuggestions);
|
model.put(SUBSTITUTIONS_MODEL_KEY, substitutionSuggestions);
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<String> getSubPathSuggestions(final String path, final String fragment) {
|
||||||
|
List<String> pathSuggestions = new ArrayList<String>();
|
||||||
|
if(path != null)
|
||||||
|
{
|
||||||
|
// TODO - populate path suggestions
|
||||||
|
}
|
||||||
|
return pathSuggestions;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -34,7 +34,7 @@ public class DateParameterProcessorTest
|
|||||||
{
|
{
|
||||||
|
|
||||||
private DateParameterProcessor dateParameterProcessor;
|
private DateParameterProcessor dateParameterProcessor;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception
|
public void setUp() throws Exception
|
||||||
{
|
{
|
||||||
@@ -46,80 +46,55 @@ public class DateParameterProcessorTest
|
|||||||
public void testGetSubstitutionSuggestions_All_01()
|
public void testGetSubstitutionSuggestions_All_01()
|
||||||
{
|
{
|
||||||
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("date");
|
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("date");
|
||||||
assertTrue(suggestions.contains("date.day"));
|
|
||||||
assertTrue(suggestions.contains("date.day.short"));
|
assertTrue(suggestions.contains("date.day.short"));
|
||||||
assertTrue(suggestions.contains("date.day.long"));
|
assertTrue(suggestions.contains("date.day.long"));
|
||||||
assertTrue(suggestions.contains("date.day.number"));
|
assertTrue(suggestions.contains("date.day.number"));
|
||||||
assertTrue(suggestions.contains("date.week"));
|
|
||||||
assertTrue(suggestions.contains("date.week.short"));
|
|
||||||
assertTrue(suggestions.contains("date.week.long"));
|
|
||||||
assertTrue(suggestions.contains("date.week.number"));
|
|
||||||
assertTrue(suggestions.contains("date.month"));
|
|
||||||
assertTrue(suggestions.contains("date.month.short"));
|
assertTrue(suggestions.contains("date.month.short"));
|
||||||
assertTrue(suggestions.contains("date.month.long"));
|
assertTrue(suggestions.contains("date.month.long"));
|
||||||
assertTrue(suggestions.contains("date.month.number"));
|
assertTrue(suggestions.contains("date.month.number"));
|
||||||
assertTrue(suggestions.contains("date.year"));
|
|
||||||
assertTrue(suggestions.contains("date.year.short"));
|
assertTrue(suggestions.contains("date.year.short"));
|
||||||
assertTrue(suggestions.contains("date.year.long"));
|
assertTrue(suggestions.contains("date.year.long"));
|
||||||
assertTrue(suggestions.contains("date.year.number"));
|
assertEquals(8, suggestions.size());
|
||||||
assertEquals(16, suggestions.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetSubstitutionSuggestions_All_02()
|
public void testGetSubstitutionSuggestions_All_02()
|
||||||
{
|
{
|
||||||
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("dat");
|
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("dat");
|
||||||
assertTrue(suggestions.contains("date.day"));
|
|
||||||
assertTrue(suggestions.contains("date.day.short"));
|
assertTrue(suggestions.contains("date.day.short"));
|
||||||
assertTrue(suggestions.contains("date.day.long"));
|
assertTrue(suggestions.contains("date.day.long"));
|
||||||
assertTrue(suggestions.contains("date.day.number"));
|
assertTrue(suggestions.contains("date.day.number"));
|
||||||
assertTrue(suggestions.contains("date.week"));
|
|
||||||
assertTrue(suggestions.contains("date.week.short"));
|
|
||||||
assertTrue(suggestions.contains("date.week.long"));
|
|
||||||
assertTrue(suggestions.contains("date.week.number"));
|
|
||||||
assertTrue(suggestions.contains("date.month"));
|
|
||||||
assertTrue(suggestions.contains("date.month.short"));
|
assertTrue(suggestions.contains("date.month.short"));
|
||||||
assertTrue(suggestions.contains("date.month.long"));
|
assertTrue(suggestions.contains("date.month.long"));
|
||||||
assertTrue(suggestions.contains("date.month.number"));
|
assertTrue(suggestions.contains("date.month.number"));
|
||||||
assertTrue(suggestions.contains("date.year"));
|
|
||||||
assertTrue(suggestions.contains("date.year.short"));
|
assertTrue(suggestions.contains("date.year.short"));
|
||||||
assertTrue(suggestions.contains("date.year.long"));
|
assertTrue(suggestions.contains("date.year.long"));
|
||||||
assertTrue(suggestions.contains("date.year.number"));
|
assertEquals(8, suggestions.size());
|
||||||
assertEquals(16, suggestions.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetSubstitutionSuggestions_All_03()
|
public void testGetSubstitutionSuggestions_All_03()
|
||||||
{
|
{
|
||||||
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("at");
|
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("at");
|
||||||
assertTrue(suggestions.contains("date.day"));
|
|
||||||
assertTrue(suggestions.contains("date.day.short"));
|
assertTrue(suggestions.contains("date.day.short"));
|
||||||
assertTrue(suggestions.contains("date.day.long"));
|
assertTrue(suggestions.contains("date.day.long"));
|
||||||
assertTrue(suggestions.contains("date.day.number"));
|
assertTrue(suggestions.contains("date.day.number"));
|
||||||
assertTrue(suggestions.contains("date.week"));
|
|
||||||
assertTrue(suggestions.contains("date.week.short"));
|
|
||||||
assertTrue(suggestions.contains("date.week.long"));
|
|
||||||
assertTrue(suggestions.contains("date.week.number"));
|
|
||||||
assertTrue(suggestions.contains("date.month"));
|
|
||||||
assertTrue(suggestions.contains("date.month.short"));
|
assertTrue(suggestions.contains("date.month.short"));
|
||||||
assertTrue(suggestions.contains("date.month.long"));
|
assertTrue(suggestions.contains("date.month.long"));
|
||||||
assertTrue(suggestions.contains("date.month.number"));
|
assertTrue(suggestions.contains("date.month.number"));
|
||||||
assertTrue(suggestions.contains("date.year"));
|
|
||||||
assertTrue(suggestions.contains("date.year.short"));
|
assertTrue(suggestions.contains("date.year.short"));
|
||||||
assertTrue(suggestions.contains("date.year.long"));
|
assertTrue(suggestions.contains("date.year.long"));
|
||||||
assertTrue(suggestions.contains("date.year.number"));
|
assertEquals(8, suggestions.size());
|
||||||
assertEquals(16, suggestions.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetSubstitutionSuggestions_Partial_01()
|
public void testGetSubstitutionSuggestions_Partial_01()
|
||||||
{
|
{
|
||||||
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("ay");
|
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("ay");
|
||||||
assertTrue(suggestions.contains("date.day"));
|
|
||||||
assertTrue(suggestions.contains("date.day.short"));
|
assertTrue(suggestions.contains("date.day.short"));
|
||||||
assertTrue(suggestions.contains("date.day.long"));
|
assertTrue(suggestions.contains("date.day.long"));
|
||||||
assertTrue(suggestions.contains("date.day.number"));
|
assertTrue(suggestions.contains("date.day.number"));
|
||||||
assertEquals(4, suggestions.size());
|
assertEquals(3, suggestions.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -127,13 +102,11 @@ public class DateParameterProcessorTest
|
|||||||
{
|
{
|
||||||
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("on");
|
List<String> suggestions = this.dateParameterProcessor.getSubstitutionSuggestions("on");
|
||||||
assertTrue(suggestions.contains("date.day.long"));
|
assertTrue(suggestions.contains("date.day.long"));
|
||||||
assertTrue(suggestions.contains("date.week.long"));
|
|
||||||
assertTrue(suggestions.contains("date.month"));
|
|
||||||
assertTrue(suggestions.contains("date.month.short"));
|
assertTrue(suggestions.contains("date.month.short"));
|
||||||
assertTrue(suggestions.contains("date.month.long"));
|
assertTrue(suggestions.contains("date.month.long"));
|
||||||
assertTrue(suggestions.contains("date.month.number"));
|
assertTrue(suggestions.contains("date.month.number"));
|
||||||
assertTrue(suggestions.contains("date.year.long"));
|
assertTrue(suggestions.contains("date.year.long"));
|
||||||
assertEquals(7, suggestions.size());
|
assertEquals(5, suggestions.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -84,7 +84,6 @@ public class SubstitutionSuggestionsRestApiTest extends BaseRMWebScriptTestCase
|
|||||||
{
|
{
|
||||||
return Arrays.asList(new String[]
|
return Arrays.asList(new String[]
|
||||||
{
|
{
|
||||||
"date.month",
|
|
||||||
"date.month.number",
|
"date.month.number",
|
||||||
"date.month.long",
|
"date.month.long",
|
||||||
"date.month.short"
|
"date.month.short"
|
||||||
|
Reference in New Issue
Block a user