Liferay 6.1.2-ce-ga3

com.liferay.portal.tools.seleniumbuilder
Class SeleniumBuilderFileUtil

java.lang.Object
  extended by com.liferay.portal.tools.seleniumbuilder.SeleniumBuilderFileUtil

public class SeleniumBuilderFileUtil
extends Object


Constructor Summary
SeleniumBuilderFileUtil(String baseDir)
           
 
Method Summary
 List<Element> getAllChildElements(Element element, String elementName)
           
 String getBaseDir()
           
 Set<String> getChildElementAttributeValues(Element element, String attributeName)
           
 String getClassName(String fileName)
           
 String getClassName(String fileName, String classSuffix)
           
 String getClassSimpleClassName(String className)
           
 String getClassSuffix(String fileName)
           
 String getHTMLFileName(String fileName)
           
 String getJavaFileName(String fileName)
           
 String getJavaFileName(String fileName, String classSuffix)
           
 int getLocatorCount(Element rootElement)
           
 String getName(String fileName)
           
 String getNormalizedContent(String fileName)
           
 String getObjectName(String name)
           
 String getPackageName(String fileName)
           
 String getPackagePath(String fileName)
           
 String getReturnType(String name)
           
 Element getRootElement(String fileName)
           
 String getSimpleClassName(String fileName)
           
 String getSimpleClassName(String fileName, String classSuffix)
           
 String getVariableName(String name)
           
 String normalizeFileName(String fileName)
           
protected  String processTemplate(String name, Map<String,Object> context)
           
 String readFile(String fileName)
           
protected  void throwValidationException(int errorCode, String fileName)
           
protected  void throwValidationException(int errorCode, String fileName, Element element)
           
protected  void throwValidationException(int errorCode, String fileName, Element element, String string1)
           
protected  void throwValidationException(int errorCode, String fileName, Element element, String[] array)
           
protected  void throwValidationException(int errorCode, String fileName, Element element, String[] array, String string1, String string2, Exception e)
           
protected  void throwValidationException(int errorCode, String fileName, Element element, String string1, String string2)
           
protected  void throwValidationException(int errorCode, String fileName, Exception e)
           
protected  void throwValidationException(int errorCode, String fileName, String string1)
           
protected  void validate(String fileName, Element rootElement)
           
protected  void validateActionCommandElement(String fileName, Element commandElement, String[] allowedBlockChildElementNames, String[] allowedExecuteAttributeNames, String[] allowedExecuteChildElementNames)
           
protected  void validateActionDocument(String fileName, Element rootElement)
           
protected  void validateBlockElement(String fileName, Element commandElement, String[] allowedBlockChildElementNames, String[] allowedExecuteAttributeNames, String[] allowedExecuteChildElementNames, String[] allowedIfConditionElementNames)
           
protected  void validateExecuteElement(String fileName, Element executeElement, String[] allowedExecuteAttributeNames, String allowedExecuteAttributeValuesRegex, String[] allowedExecuteChildElementNames)
           
protected  void validateFunctionDocument(String fileName, Element rootElement)
           
protected  void validateIfElement(String fileName, Element ifElement, String[] allowedBlockChildElementNames, String[] allowedExecuteAttributeNames, String[] allowedExecuteChildElementNames, String[] allowedIfConditionElementNames)
           
protected  void validateMacroDocument(String fileName, Element rootElement)
           
protected  void validatePathDocument(String fileName, Element rootElement)
           
protected  void validatePathTrElement(String fileName, Element trElement)
           
protected  void validateSimpleElement(String fileName, Element element, String[] neededAttributes)
           
protected  void validateTestCaseDocument(String fileName, Element rootElement)
           
protected  void validateTestSuiteDocument(String fileName, Element rootElement)
           
protected  void validateVarElement(String fileName, Element element)
           
protected  void validateWhileElement(String fileName, Element whileElement, String[] allowedBlockChildElementNames, String[] allowedExecuteAttributeNames, String[] allowedExecuteChildElementNames, String[] allowedIfConditionElementNames)
           
 void writeFile(String fileName, String content, boolean format)
           
 void writeFile(String baseDir, String fileName, String content, boolean format)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeleniumBuilderFileUtil

public SeleniumBuilderFileUtil(String baseDir)
Method Detail

getAllChildElements

public List<Element> getAllChildElements(Element element,
                                         String elementName)

getBaseDir

public String getBaseDir()

getChildElementAttributeValues

public Set<String> getChildElementAttributeValues(Element element,
                                                  String attributeName)

getClassName

public String getClassName(String fileName)

getClassName

public String getClassName(String fileName,
                           String classSuffix)

getClassSimpleClassName

public String getClassSimpleClassName(String className)

getClassSuffix

public String getClassSuffix(String fileName)

getHTMLFileName

public String getHTMLFileName(String fileName)

getJavaFileName

public String getJavaFileName(String fileName)

getJavaFileName

public String getJavaFileName(String fileName,
                              String classSuffix)

getLocatorCount

public int getLocatorCount(Element rootElement)

getName

public String getName(String fileName)

getNormalizedContent

public String getNormalizedContent(String fileName)
                            throws Exception
Throws:
Exception

getObjectName

public String getObjectName(String name)

getPackageName

public String getPackageName(String fileName)

getPackagePath

public String getPackagePath(String fileName)

getReturnType

public String getReturnType(String name)

getRootElement

public Element getRootElement(String fileName)
                       throws Exception
Throws:
Exception

getSimpleClassName

public String getSimpleClassName(String fileName)

getSimpleClassName

public String getSimpleClassName(String fileName,
                                 String classSuffix)

getVariableName

public String getVariableName(String name)

normalizeFileName

public String normalizeFileName(String fileName)

readFile

public String readFile(String fileName)
                throws Exception
Throws:
Exception

writeFile

public void writeFile(String fileName,
                      String content,
                      boolean format)
               throws Exception
Throws:
Exception

writeFile

public void writeFile(String baseDir,
                      String fileName,
                      String content,
                      boolean format)
               throws Exception
Throws:
Exception

processTemplate

protected String processTemplate(String name,
                                 Map<String,Object> context)
                          throws Exception
Throws:
Exception

throwValidationException

protected void throwValidationException(int errorCode,
                                        String fileName)

throwValidationException

protected void throwValidationException(int errorCode,
                                        String fileName,
                                        Element element)

throwValidationException

protected void throwValidationException(int errorCode,
                                        String fileName,
                                        Element element,
                                        String string1)

throwValidationException

protected void throwValidationException(int errorCode,
                                        String fileName,
                                        Element element,
                                        String string1,
                                        String string2)

throwValidationException

protected void throwValidationException(int errorCode,
                                        String fileName,
                                        Element element,
                                        String[] array)

throwValidationException

protected void throwValidationException(int errorCode,
                                        String fileName,
                                        Element element,
                                        String[] array,
                                        String string1,
                                        String string2,
                                        Exception e)

throwValidationException

protected void throwValidationException(int errorCode,
                                        String fileName,
                                        Exception e)

throwValidationException

protected void throwValidationException(int errorCode,
                                        String fileName,
                                        String string1)

validate

protected void validate(String fileName,
                        Element rootElement)
                 throws Exception
Throws:
Exception

validateActionCommandElement

protected void validateActionCommandElement(String fileName,
                                            Element commandElement,
                                            String[] allowedBlockChildElementNames,
                                            String[] allowedExecuteAttributeNames,
                                            String[] allowedExecuteChildElementNames)

validateActionDocument

protected void validateActionDocument(String fileName,
                                      Element rootElement)

validateBlockElement

protected void validateBlockElement(String fileName,
                                    Element commandElement,
                                    String[] allowedBlockChildElementNames,
                                    String[] allowedExecuteAttributeNames,
                                    String[] allowedExecuteChildElementNames,
                                    String[] allowedIfConditionElementNames)

validateExecuteElement

protected void validateExecuteElement(String fileName,
                                      Element executeElement,
                                      String[] allowedExecuteAttributeNames,
                                      String allowedExecuteAttributeValuesRegex,
                                      String[] allowedExecuteChildElementNames)

validateFunctionDocument

protected void validateFunctionDocument(String fileName,
                                        Element rootElement)

validateIfElement

protected void validateIfElement(String fileName,
                                 Element ifElement,
                                 String[] allowedBlockChildElementNames,
                                 String[] allowedExecuteAttributeNames,
                                 String[] allowedExecuteChildElementNames,
                                 String[] allowedIfConditionElementNames)

validateMacroDocument

protected void validateMacroDocument(String fileName,
                                     Element rootElement)

validatePathDocument

protected void validatePathDocument(String fileName,
                                    Element rootElement)

validatePathTrElement

protected void validatePathTrElement(String fileName,
                                     Element trElement)

validateSimpleElement

protected void validateSimpleElement(String fileName,
                                     Element element,
                                     String[] neededAttributes)

validateTestCaseDocument

protected void validateTestCaseDocument(String fileName,
                                        Element rootElement)

validateTestSuiteDocument

protected void validateTestSuiteDocument(String fileName,
                                         Element rootElement)

validateVarElement

protected void validateVarElement(String fileName,
                                  Element element)

validateWhileElement

protected void validateWhileElement(String fileName,
                                    Element whileElement,
                                    String[] allowedBlockChildElementNames,
                                    String[] allowedExecuteAttributeNames,
                                    String[] allowedExecuteChildElementNames,
                                    String[] allowedIfConditionElementNames)

Liferay 6.1.2-ce-ga3