mil.dod.th.ose.test/src/mil/dod/th/ose/test/AttributeDefinitionMocker.java
public static AttributeDefinition mockIt(final String id, final String name, 
            final String desc, final int type, final String defaults)
    {
        AttributeDefinition definition = mock(AttributeDefinition.class);
        
        when(definition.getID()).thenReturn(id);
        when(definition.getName()).thenReturn(name);
        when(definition.getDescription()).thenReturn(desc);
        when(definition.getType()).thenReturn(type);
        when(definition.getDefaultValue()).thenReturn(new String[] {defaults});
        when(definition.getCardinality()).thenReturn(0);
        
        return definition;
    }
/**
     * Method used to produce a mock attribute definition. Note cardinality of attribute definition is always assumed
     * to be 0.
     * @param id
     *  the id of the attribute definition
     * @param name
     *  the name of the attribute definition
     * @param desc
     *  the description of the attribute definition
     * @param type
     *  the type that this attribute definition represents
     * @param defaults
     *  a string outlining the possible default values of the definition
     * @return
     *  the mocked attribute definition
     */
Method used to produce a mock attribute definition. Note cardinality of attribute definition is always assumed
to be 0.
Method used to produce a mock attribute definition . Note cardinality of attribute definition is always assumed to be 0 .
public static AttributeDefinition mockIt(final String id, final String name, 
            final String desc, final int type, final String defaults)
    {
        AttributeDefinition definition = mock(AttributeDefinition.class);
        when(definition.getID()).thenReturn(id);
        when(definition.getName()).thenReturn(name);
        when(definition.getDescription()).thenReturn(desc);
        when(definition.getType()).thenReturn(type);
        when(definition.getDefaultValue()).thenReturn(new String[] {defaults});
        when(definition.getCardinality()).thenReturn(0);
        return definition;
    }
public static AttributeDefinition mockIt ( final String id , final String name , final String desc , final int type , final String defaults ) { AttributeDefinition definition = mock ( AttributeDefinition . class ) ; when ( definition . getID ( ) ) . thenReturn ( id ) ; when ( definition . getName ( ) ) . thenReturn ( name ) ; when ( definition . getDescription ( ) ) . thenReturn ( desc ) ; when ( definition . getType ( ) ) . thenReturn ( type ) ; when ( definition . getDefaultValue ( ) ) . thenReturn ( new String [ ] { defaults } ) ; when ( definition . getCardinality ( ) ) . thenReturn ( 0 ) ; return definition ; }
Method used to produce a mock attribute definition.
Method used to produce a mock attribute definition .