com.atlassian.bamboo.plugins.builder.php
Class AbstractPhpUnitBuilder

java.lang.Object
  extended by com.atlassian.bamboo.command.Command
      extended by com.atlassian.bamboo.builder.AbstractBuilder
          extended by com.atlassian.bamboo.plugins.builder.php.AbstractPhpUnitBuilder
All Implemented Interfaces:
Builder, EnvironmentVariablesAwareBuilder, MutableEnvironmentVariablesAwareBuilder, InitablePluginModule, BambooPluginModule, BuildConfigurationAwarePlugin, BuilderV2, ConfigurablePlugin, RenderableBuildConfiguration, java.io.Serializable
Direct Known Subclasses:
PhpUnit33XBuilder, PhpUnitBuilder

Deprecated. Since 3.1. Use tasks TaskType

@Deprecated
public abstract class AbstractPhpUnitBuilder
extends AbstractBuilder

This class provides a PHPUnit version of Builder.

See Also:
Serialized Form

Field Summary
protected  java.lang.String arguments
          Deprecated.  
protected  java.lang.String coverageHtmlDirectory
          Deprecated.  
protected  boolean coverageHtmlEnabled
          Deprecated.  
protected  boolean logXmlEnabled
          Deprecated.  
protected  java.lang.String logXmlFile
          Deprecated.  
protected  java.lang.String options
          Deprecated.  
static java.lang.String PATHHELP
          Deprecated.  
protected static java.lang.String PHP_UNIT_BUILD_SUCCESSFUL_MARKER
          Deprecated.  
 
Fields inherited from class com.atlassian.bamboo.builder.AbstractBuilder
BUILD_FAILED_MARKER, BUILD_SUCCESSFUL_MARKER, buildDirectoryManager, DEFAULT_TEST_REPORTS_XML, errorUpdateHandler, FIND_FAILURE_MESSAGE_IN_LAST, FIND_SUCCESS_MESSAGE_IN_LAST, PARAM_BUILD_LABEL, PARAM_BUILDJDK, PARAM_ENV_VAR, PARAM_HASTESTS, PARAM_HOME, PARAM_PROJECT_FILE, PARAM_TEST_RESULTS_DIRECTORY, PARAM_WORKING_SUB_DIR, SEARCH_BUILD_SUCCESS_FAIL_MESSAGE_EVERYWHERE, templateRenderer
 
Fields inherited from class com.atlassian.bamboo.command.Command
buildLoggerManager, customVariableContext
 
Fields inherited from interface com.atlassian.bamboo.builder.Builder
CAPABILITY_BUILDER_PREFIX, CAPABILITY_BUILDER_TYPE
 
Constructor Summary
AbstractPhpUnitBuilder()
          Deprecated.  
 
Method Summary
 void addDefaultValues(BuildConfiguration configuration)
          Deprecated. Extension point for adding default values to the form for RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
 void executeBuild(BuildContext buildContext, ReadOnlyCapabilitySet capabilitySet)
          Deprecated. Runs the build, and updates the build results in the build context.
 int executeCommand(BuildContext buildContext, CommandExecuteStreamHandler commandExecuteStreamHandler, java.lang.String extraEnvironmentVariables, java.lang.String javaHome, ReadOnlyCapabilitySet capabilitySet)
          Deprecated. Check if output directories for PHPUnit are created.
 java.io.File findPhpUnitExecutable()
          Deprecated. Find PHPUnit executable in system paths
 java.lang.String getArguments()
          Deprecated.  
 java.lang.String[] getCommandArguments(ReadOnlyCapabilitySet capabilitySet)
          Deprecated. What are the arguments for the command line to execute
 java.lang.String getCommandExecutable(ReadOnlyCapabilitySet capabilitySet)
          Deprecated. What is the executable for the command line to execute
 java.lang.String getCoverageHtmlDirectory()
          Deprecated.  
protected  java.lang.String[] getCustomEnvironmentVars(ReadOnlyCapabilitySet capabilitySet)
          Deprecated.  
 java.util.Map<java.lang.String,java.lang.String> getFullParams()
          Deprecated. Gets the full params that's used to persist.
 java.lang.String getLogXmlFile()
          Deprecated.  
protected abstract  java.lang.String getLogXmlOption()
          Deprecated.  
 java.lang.String getPathHelp()
          Deprecated. Return text that will appear as a description under a chosen builder in the "Add Capability" screen
 java.lang.String getPhpUnitVersion(java.lang.String phpUnitPath)
          Deprecated. Parse output of "phpunit --version"
 java.lang.String getTestResultsDirectory()
          Deprecated. What are the build's junit test results stored? Can be a comma separated list
 boolean hasPassed(int returnCode, int buildNumber, java.lang.String planKey)
          Deprecated. Determines based on the return code and/or logs whether the build has passed.
 boolean hasTests()
          Deprecated. Does the build have any tests to be included in the build results web pages?
 boolean isCoverageHtmlEnabled()
          Deprecated.  
 boolean isLogXmlEnabled()
          Deprecated.  
 boolean isPathValid(java.lang.String path)
          Deprecated. Check for a full path to phpunit script
 void setArguments(java.lang.String arguments)
          Deprecated.  
 void setCoverageHtmlDirectory(java.lang.String coverageHtmlDirectory)
          Deprecated.  
 void setCoverageHtmlEnabled(boolean coverageHtmlEnabled)
          Deprecated.  
 void setLogXmlEnabled(boolean logXmlEnabled)
          Deprecated.  
 void setLogXmlFile(java.lang.String logXmlFile)
          Deprecated.  
 void setParams(FilteredMap filteredBuilderParams)
          Deprecated. Updates the current builder object with
 ErrorCollection validate(BuildConfiguration buildConfiguration)
          Deprecated. Validates the properties in the BuildConfiguration object.
 ErrorCollection validate(FilteredMap filteredParams)
          Deprecated. Validate that the goal has been defined
 
Methods inherited from class com.atlassian.bamboo.builder.AbstractBuilder
collateTestResults, customiseLabelTypeMap, customizeBuildRequirements, getBuildDir, getBuildDirectoryManager, getBuildJdk, getCapabilityPrefix, getCompleteKey, getEditHtml, getEnvironmentVariables, getFilteredParams, getKey, getKeyPrefix, getLabel, getPath, getProjectFile, getSubstitutedEnvironmentVariables, getTemplateContext, getTestChecked, getViewHtml, getWorkingDirectory, getWorkingSubDirectory, init, isJdkValid, isLabelPathMapConfigurable, outputEndsWith, populateBuildErrors, prepareConfigObject, removeAllSystemJdkRequirements, removeBuildRequirements, runBuild, setAdministrationConfiguration, setBuildDir, setBuildDirectoryManager, setBuildJdk, setBuildLogFileAccessorFactory, setEnvironmentVariables, setErrorUpdateHandler, setHasTests, setJdkManager, setKey, setLabel, setProjectFile, setTemplateRenderer, setTestChecked, setTestResultsDirectory, setWorkingSubDirectory, toString, validate
 
Methods inherited from class com.atlassian.bamboo.command.Command
decorateCommandLine, getBuildLoggerManager, getCommandLine, getEnvironmentSetting, getSubstitutedCommandLine, isWindowsPlatform, setBuildLoggerManager, setCustomVariableContext, setPluginAccessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.builder.Builder
addDefaultLabelPathMaps, getName
 

Field Detail

PATHHELP

public static final java.lang.String PATHHELP
Deprecated. 
See Also:
Constant Field Values

PHP_UNIT_BUILD_SUCCESSFUL_MARKER

protected static final java.lang.String PHP_UNIT_BUILD_SUCCESSFUL_MARKER
Deprecated. 
See Also:
Constant Field Values

arguments

protected java.lang.String arguments
Deprecated. 

logXmlEnabled

protected boolean logXmlEnabled
Deprecated. 

logXmlFile

protected java.lang.String logXmlFile
Deprecated. 

coverageHtmlEnabled

protected boolean coverageHtmlEnabled
Deprecated. 

coverageHtmlDirectory

protected java.lang.String coverageHtmlDirectory
Deprecated. 

options

protected java.lang.String options
Deprecated. 
Constructor Detail

AbstractPhpUnitBuilder

public AbstractPhpUnitBuilder()
Deprecated. 
Method Detail

getLogXmlOption

@NotNull
protected abstract java.lang.String getLogXmlOption()
Deprecated. 

executeBuild

public void executeBuild(@NotNull
                         BuildContext buildContext,
                         ReadOnlyCapabilitySet capabilitySet)
                  throws java.lang.InterruptedException,
                         RepositoryException
Deprecated. 
Description copied from interface: BuilderV2
Runs the build, and updates the build results in the build context. This method is also responsible for collating the test results in a build

Specified by:
executeBuild in interface BuilderV2
Overrides:
executeBuild in class AbstractBuilder
Throws:
java.lang.InterruptedException
RepositoryException

getCommandExecutable

@NotNull
public java.lang.String getCommandExecutable(ReadOnlyCapabilitySet capabilitySet)
Deprecated. 
What is the executable for the command line to execute

Overrides:
getCommandExecutable in class Command
Parameters:
capabilitySet - - for the current context
Returns:
the executable as a string

getCommandArguments

@NotNull
public java.lang.String[] getCommandArguments(ReadOnlyCapabilitySet capabilitySet)
Deprecated. 
What are the arguments for the command line to execute

Overrides:
getCommandArguments in class Command
Parameters:
capabilitySet - - for the current context
Returns:
the executable as a string[]. Spaces/division of strings in the array should not matter

validate

public ErrorCollection validate(FilteredMap filteredParams)
Deprecated. 
Validate that the goal has been defined

Specified by:
validate in class AbstractBuilder
Returns:
The collection of validation errors. An empty list if there are no errors

validate

@NotNull
public ErrorCollection validate(@NotNull
                                        BuildConfiguration buildConfiguration)
Deprecated. 
Description copied from interface: BuildConfigurationAwarePlugin
Validates the properties in the BuildConfiguration object. The name of the properties match those passed in through the form fragments in RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) template.

Parameters:
buildConfiguration - - @NotNull
Returns:
ErrorCollection keyed by the field name. @NotNull

addDefaultValues

public void addDefaultValues(@NotNull
                             BuildConfiguration configuration)
Deprecated. 
Description copied from interface: BuildConfigurationAwarePlugin
Extension point for adding default values to the form for RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)

Parameters:
configuration - - @NotNull

findPhpUnitExecutable

@Nullable
public java.io.File findPhpUnitExecutable()
Deprecated. 
Find PHPUnit executable in system paths

Returns:
PHPUnit executable file or null if not found

getPhpUnitVersion

@Nullable
public java.lang.String getPhpUnitVersion(@NotNull
                                                   java.lang.String phpUnitPath)
Deprecated. 
Parse output of "phpunit --version"

Parameters:
phpUnitPath - path to phpunit script
Returns:
text representation of PHPUnit version number or null if not possible to obtain version number

hasPassed

public boolean hasPassed(int returnCode,
                         int buildNumber,
                         java.lang.String planKey)
Deprecated. 
Description copied from interface: BuilderV2
Determines based on the return code and/or logs whether the build has passed. Implementors should log how they came up with their conclusions -

Specified by:
hasPassed in interface BuilderV2
Overrides:
hasPassed in class AbstractBuilder
Parameters:
returnCode - return code from build execution command
planKey - @return true if build has passed

setParams

public void setParams(@NotNull
                      FilteredMap filteredBuilderParams)
Deprecated. 
Description copied from interface: Builder
Updates the current builder object with

Specified by:
setParams in interface Builder
Overrides:
setParams in class AbstractBuilder
Parameters:
filteredBuilderParams - - Filtered Map with the prefix builder key stripped out

getFullParams

@NotNull
public java.util.Map<java.lang.String,java.lang.String> getFullParams()
Deprecated. 
Description copied from interface: Builder
Gets the full params that's used to persist.

Specified by:
getFullParams in interface Builder
Overrides:
getFullParams in class AbstractBuilder
Returns:
Map key by the full param key (e.g. builder.ant.label). Never null

executeCommand

public int executeCommand(@NotNull
                          BuildContext buildContext,
                          @NotNull
                          CommandExecuteStreamHandler commandExecuteStreamHandler,
                          java.lang.String extraEnvironmentVariables,
                          java.lang.String javaHome,
                          ReadOnlyCapabilitySet capabilitySet)
                   throws CommandException
Deprecated. 
Check if output directories for PHPUnit are created.

Overrides:
executeCommand in class Command
Parameters:
buildContext - The BuildContext for the current build
commandExecuteStreamHandler - Stream Handler for the output of the execute command
extraEnvironmentVariables - environment variable additional to those already in the env (e.g provided by the user via UI)
javaHome - The java home value for this command
capabilitySet - Capability set
Returns:
-1 if the command failed
Throws:
CommandException

hasTests

public boolean hasTests()
Deprecated. 
Description copied from class: AbstractBuilder
Does the build have any tests to be included in the build results web pages?

Specified by:
hasTests in interface Builder
Overrides:
hasTests in class AbstractBuilder
Returns:
true if the build should have tests.

getTestResultsDirectory

public java.lang.String getTestResultsDirectory()
Deprecated. 
Description copied from class: AbstractBuilder
What are the build's junit test results stored? Can be a comma separated list

Overrides:
getTestResultsDirectory in class AbstractBuilder
Returns:
Directory containing the Junit xml test files

isPathValid

public boolean isPathValid(java.lang.String path)
Deprecated. 
Check for a full path to phpunit script

Returns:
true if valid

getCustomEnvironmentVars

protected java.lang.String[] getCustomEnvironmentVars(ReadOnlyCapabilitySet capabilitySet)
Deprecated. 
Overrides:
getCustomEnvironmentVars in class Command

getPathHelp

@NotNull
public java.lang.String getPathHelp()
Deprecated. 
Description copied from class: AbstractBuilder
Return text that will appear as a description under a chosen builder in the "Add Capability" screen

Specified by:
getPathHelp in interface Builder
Overrides:
getPathHelp in class AbstractBuilder
Returns:
text to display

setArguments

public void setArguments(java.lang.String arguments)
Deprecated. 

getArguments

public java.lang.String getArguments()
Deprecated. 

isLogXmlEnabled

public boolean isLogXmlEnabled()
Deprecated. 

setLogXmlEnabled

public void setLogXmlEnabled(boolean logXmlEnabled)
Deprecated. 

getLogXmlFile

public java.lang.String getLogXmlFile()
Deprecated. 

setLogXmlFile

public void setLogXmlFile(java.lang.String logXmlFile)
Deprecated. 

isCoverageHtmlEnabled

public boolean isCoverageHtmlEnabled()
Deprecated. 

setCoverageHtmlEnabled

public void setCoverageHtmlEnabled(boolean coverageHtmlEnabled)
Deprecated. 

getCoverageHtmlDirectory

public java.lang.String getCoverageHtmlDirectory()
Deprecated. 

setCoverageHtmlDirectory

public void setCoverageHtmlDirectory(java.lang.String coverageHtmlDirectory)
Deprecated. 


Copyright © 2011 Atlassian. All Rights Reserved.