test_class.declarator: validator
test_class.modifier: private
test_class.original_string: private SpaceControllerHostIdValidator validator;
test_class.type: SpaceControllerHostIdValidator
test_class.var_name: validator
test_class.file: interactivespaces-domain/src/test/java/interactivespaces/domain/support/SpaceControllerHostIdValidatorTest.java
test_class.identifier: SpaceControllerHostIdValidatorTest
test_case.body: @Test
    public void testCleanStartup() {
      assertEquals(DomainValidationResult.DomainValidationResultType.OK, validator.validate("_123435").getResultType());
      assertEquals(DomainValidationResult.DomainValidationResultType.OK, validator.validate("a_35").getResultType());
  
      assertEquals(DomainValidationResult.DomainValidationResultType.ERRORS, validator.validate("12asd").getResultType());
      assertEquals(DomainValidationResult.DomainValidationResultType.ERRORS, validator.validate("a-sd").getResultType());
  
      assertEquals(DomainValidationResult.DomainValidationResultType.OK, validator.validate("asd/a12").getResultType());
      assertEquals(DomainValidationResult.DomainValidationResultType.OK, validator.validate("asd/_a12/foo123").getResultType());
      assertEquals(DomainValidationResult.DomainValidationResultType.ERRORS, validator.validate("/aaa/bbb")
          .getResultType());
    }
test_case.class_method_signature: SpaceControllerHostIdValidatorTest.testCleanStartup()
test_case.full_signature: @Test public void testCleanStartup()
test_case.identifier: testCleanStartup
test_case.invocations: assertEquals getResultType validate assertEquals getResultType validate assertEquals getResultType validate assertEquals getResultType validate assertEquals getResultType validate assertEquals getResultType validate assertEquals getResultType validate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCleanStartup()
focal_class.declarator: HOST_ID_SEGMENT_VALIDATION_REGEX = "[a-zA-Z_][a-zA-Z_0-9]*"
focal_class.modifier: public static final
focal_class.original_string: public static final String HOST_ID_SEGMENT_VALIDATION_REGEX = "[a-zA-Z_][a-zA-Z_0-9]*";
focal_class.type: String
focal_class.var_name: HOST_ID_SEGMENT_VALIDATION_REGEX
focal_class.declarator: HOST_ID_VALIDATION_PATTERN = Pattern.compile("^(" + HOST_ID_SEGMENT_VALIDATION_REGEX
        + ")(/" + HOST_ID_SEGMENT_VALIDATION_REGEX + ")*$")
focal_class.modifier: public static final
focal_class.original_string: public static final Pattern HOST_ID_VALIDATION_PATTERN = Pattern.compile("^(" + HOST_ID_SEGMENT_VALIDATION_REGEX
        + ")(/" + HOST_ID_SEGMENT_VALIDATION_REGEX + ")*$");
focal_class.type: Pattern
focal_class.var_name: HOST_ID_VALIDATION_PATTERN
focal_class.declarator: HOST_ID_FORMAT_DESCRIPTION = "A host must be of the form segment1/segment2/segment3...\n"
        + "where each segment starts with a letter or underscore, and\n"
        + "is followed by letters, digits, -, or underscores."
focal_class.modifier: public static final
focal_class.original_string: public static final String HOST_ID_FORMAT_DESCRIPTION = "A host must be of the form segment1/segment2/segment3...\n"
        + "where each segment starts with a letter or underscore, and\n"
        + "is followed by letters, digits, -, or underscores.";
focal_class.type: String
focal_class.var_name: HOST_ID_FORMAT_DESCRIPTION
focal_class.file: interactivespaces-domain/src/main/java/interactivespaces/domain/support/SpaceControllerHostIdValidator.java
focal_class.identifier: SpaceControllerHostIdValidator
focal_class.interfaces: implements Validator
focal_class.class_method_signature: SpaceControllerHostIdValidator.validate(String hostId)
focal_class.full_signature: @Override public DomainValidationResult validate(String hostId)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (String hostId)
focal_class.return: DomainValidationResult
focal_class.signature: DomainValidationResult validate(String hostId)
focal_method.body: @Override
    public DomainValidationResult validate(String hostId) {
      hostId = hostId.trim();
      if (hostId.isEmpty()) {
        return new DomainValidationResult(DomainValidationResultType.ERRORS, "A host ID is required.");
      }
  
      if (!HOST_ID_VALIDATION_PATTERN.matcher(hostId).matches()) {
        return new DomainValidationResult(DomainValidationResultType.ERRORS, HOST_ID_FORMAT_DESCRIPTION);
      }
  
      return new DomainValidationResult(DomainValidationResultType.OK, null);
    }
focal_method.class_method_signature: SpaceControllerHostIdValidator.validate(String hostId)
focal_method.full_signature: @Override public DomainValidationResult validate(String hostId)
focal_method.identifier: validate
focal_method.invocations: trim isEmpty matches matcher
focal_method.modifiers: @Override public
focal_method.parameters: (String hostId)
focal_method.return: DomainValidationResult
focal_method.signature: DomainValidationResult validate(String hostId)