Java 类com.amazonaws.mturk.service.exception.ValidationException 实例源码

项目:java-aws-mturk    文件:TestRequesterService.java   
public void testValidateInvalidExternalQuestion() throws Exception {
  HITQuestion htmlQuestion = new HITQuestion(defaultInvalidExternalQuestionFileName);

  try {
    service.previewHIT(defaultHITInput, defaultHITProperties, htmlQuestion);

    fail("Expected ValidationException when previewing HIT with invalid external question." );
  }
  catch (ValidationException e) {
    // Expected exception
  }
}
项目:java-aws-mturk    文件:TestRequesterService.java   
public void testValidateInvalidHTMLQuestion() throws Exception {
  // HTMLQuestion has invalid FrameHeight
  try {
    QAPValidator.validateFile(defaultInvalidHTMLQuestionFileName);
    fail("Expected ValidationException when previewing a HIT with an invalid HTMLQuestion");
  } catch (ValidationException e) {
    // Expected exception
    assertContains("ValidationFailure was not caused by an invalid frame height.",
        "'I am not a number; I am a free man!' is not a valid value for 'integer'",
        e.getMessage());
  }
}
项目:java-aws-mturk    文件:TestRequesterService.java   
public void testCreateInvalidFormattedContentHIT() throws Exception {
  HITQuestion htmlQuestion = new HITQuestion(defaultInvalidFormattedContentQuestionFileName);

  try {
    service.previewHIT(defaultHITInput, defaultHITProperties, htmlQuestion);

    fail("Expected ValidationException when creating HIT with invalid formatted content." );
  }
  catch (ValidationException e) {
    // Expected exception
  }
}
项目:java-aws-mturk    文件:TestRequesterService.java   
public void testCreateScriptFormattedContentHIT() throws Exception {
  HITQuestion htmlQuestion = new HITQuestion(defaultScriptFormattedContentQuestionFileName);

  try {
    service.previewHIT(defaultHITInput, defaultHITProperties, htmlQuestion);

    fail("Expected ValidationException when creating HIT with script in formatted content." );
  }
  catch (ValidationException e) {
    // Expected exception
  }
}
项目:mturksdk-java-code-maven    文件:TestRequesterService.java   
public void testValidateInvalidExternalQuestion() throws Exception {
  HITQuestion htmlQuestion = new HITQuestion(defaultInvalidExternalQuestionFileName);

  try {
    service.previewHIT(defaultHITInput, defaultHITProperties, htmlQuestion);

    fail("Expected ValidationException when previewing HIT with invalid external question." );
  }
  catch (ValidationException e) {
    // Expected exception
  }
}
项目:mturksdk-java-code-maven    文件:TestRequesterService.java   
public void testValidateInvalidHTMLQuestion() throws Exception {
  // HTMLQuestion has invalid FrameHeight
  try {
    QAPValidator.validateFile(defaultInvalidHTMLQuestionFileName);
    fail("Expected ValidationException when previewing a HIT with an invalid HTMLQuestion");
  } catch (ValidationException e) {
    // Expected exception
    assertContains("ValidationFailure was not caused by an invalid frame height.",
        "'I am not a number; I am a free man!' is not a valid value for 'integer'",
        e.getMessage());
  }
}
项目:mturksdk-java-code-maven    文件:TestRequesterService.java   
public void testCreateInvalidFormattedContentHIT() throws Exception {
  HITQuestion htmlQuestion = new HITQuestion(defaultInvalidFormattedContentQuestionFileName);

  try {
    service.previewHIT(defaultHITInput, defaultHITProperties, htmlQuestion);

    fail("Expected ValidationException when creating HIT with invalid formatted content." );
  }
  catch (ValidationException e) {
    // Expected exception
  }
}
项目:mturksdk-java-code-maven    文件:TestRequesterService.java   
public void testCreateScriptFormattedContentHIT() throws Exception {
  HITQuestion htmlQuestion = new HITQuestion(defaultScriptFormattedContentQuestionFileName);

  try {
    service.previewHIT(defaultHITInput, defaultHITProperties, htmlQuestion);

    fail("Expected ValidationException when creating HIT with script in formatted content." );
  }
  catch (ValidationException e) {
    // Expected exception
  }
}
项目:java-aws-mturk    文件:QAPValidator.java   
public static void validate(String question) throws ValidationException, IOException {
  validate(question, false, QUESTION_FORM_XSD, false);
}
项目:java-aws-mturk    文件:QAPValidator.java   
public static void validateFile(String fileName)
  throws ValidationException, IOException {
  validate(fileName, true, QUESTION_FORM_XSD, false);
}
项目:mturksdk-java-code-maven    文件:QAPValidator.java   
public static void validate(String question) throws ValidationException, IOException {
  validate(question, false, QUESTION_FORM_XSD, false);
}
项目:mturksdk-java-code-maven    文件:QAPValidator.java   
public static void validateFile(String fileName)
  throws ValidationException, IOException {
  validate(fileName, true, QUESTION_FORM_XSD, false);
}