net.sourceforge.pmd.properties

## Class MethodPropertyTest

- java.lang.Object
- - net.sourceforge.pmd.properties.AbstractPropertyDescriptorTester
  - - net.sourceforge.pmd.properties.MethodPropertyTest

    public class MethodPropertyTest
    extends AbstractPropertyDescriptorTester

Evaluates the functionality of the MethodProperty descriptor by testing its ability to catch creation errors (illegal args), flag invalid methods per the allowable packages, and serialize/deserialize groups of methods onto/from a string buffer. We're using methods from java.lang classes for 'normal' constructors and applying ones from java.util types as ones we expect to fail.

Author:
  Brian Remedios

### Field Summary

### Fields inherited from class net.sourceforge.pmd.properties.AbstractPropertyDescriptorTester

`allChars, alphaChars, alphaNumericChars, digitChars, punctuationChars, whitespaceChars`

### Constructor Summary

Constructors
Constructor and Description
`MethodPropertyTest()`

### Method Summary

Methods
`protected PropertyDescriptor` `createBadProperty(boolean multiValue)` Attempt to create a property with faulty configuration values.
`protected Object` `createBadValue(int count)` Return a value(s) that is known to be faulty per the general scope of the descriptor.
`protected PropertyDescriptor` `createProperty(boolean multiValue)` Creates and returns a properly configured property descriptor.
`protected Object` `createValue(int count)` Return a legal value(s) per the general scope of the descriptor.
`static junit.framework.Test` `suite()`
`void` `testAsMethodOn()`
`void` `testAsStringOn()`

### Methods inherited from class net.sourceforge.pmd.properties.AbstractPropertyDescriptorTester

`filter, randomBool, randomChar, randomChoice, randomDouble, randomFloat, randomInt, randomInt, randomString, testAsDelimitedString, testConstructors, testErrorFor, testErrorForBad, testType, testValueFrom`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MethodPropertyTest

    public MethodPropertyTest()

### Method Detail

#### testAsStringOn

    public void testAsStringOn()

#### testAsMethodOn

    public void testAsMethodOn()

#### createBadProperty

    protected PropertyDescriptor createBadProperty(boolean multiValue)

Description copied from class: `AbstractPropertyDescriptorTester`
Attempt to create a property with faulty configuration values. This method should throw an IllegalArgumentException if done correctly.

Specified by:
  `createBadProperty` in class `AbstractPropertyDescriptorTester`
Parameters:
  `multiValue` - boolean
Returns:
  PropertyDescriptor

#### createBadValue

    protected Object createBadValue(int count)

Description copied from class: `AbstractPropertyDescriptorTester`
Return a value(s) that is known to be faulty per the general scope of the descriptor.

Specified by:
  `createBadValue` in class `AbstractPropertyDescriptorTester`
Parameters:
  `count` - int
Returns:
  Object

#### createProperty

    protected PropertyDescriptor createProperty(boolean multiValue)

Description copied from class: `AbstractPropertyDescriptorTester`
Creates and returns a properly configured property descriptor.

Specified by:
  `createProperty` in class `AbstractPropertyDescriptorTester`
Parameters:
  `multiValue` - boolean
Returns:
  PropertyDescriptor

#### createValue

    protected Object createValue(int count)

Description copied from class: `AbstractPropertyDescriptorTester`
Return a legal value(s) per the general scope of the descriptor.

Specified by:
  `createValue` in class `AbstractPropertyDescriptorTester`
Parameters:
  `count` - int
Returns:
  Object

#### suite

    public static junit.framework.Test suite()