BioLockJ-Dev-Team / sheepdog_testing_suite

Test suite for BioLockJ development team.
3 stars 8 forks source link

figure out the deal with required properties #321

Open IvoryC opened 3 years ago

IvoryC commented 3 years ago

The Properties class has a "required" prefix for a type to indicate that the property is required... but this does not seem to be fully implemented. Either create a way to describe properties as required or not... embrace this prefix and make sure that anything that uses "type" knows to potentially remove the "required_" prefix.

From class biolockj.Properties:

/**
*  Prefix for property types whose values cannot be null.
*/
public static final String REQUIRED = "required ";

It also looks like one of the only times that it would matter, it is accounted for (same file):

public static Boolean isValidProp(String property) throws API_Exception {
        String type = getPropertyType( property );
        if (type == null) return null;

        boolean isgood = true;

        try {
            if ( type.startsWith( REQUIRED ) ) {
                type = type.replaceAll( REQUIRED, "" );
                if (Config.getString( null, property ) == null) return false;
            }

            switch (type) {
                case STRING_TYPE:
                    Config.getString( null, property );
                    break;

But I don't think the term is ever described for the user (related to issue #320 ) and the shinyBioLockJ app currently would not recognize "required_filepath" as "filepath".