Java 类org.assertj.core.api.Fail 实例源码

项目:buenojo    文件:TagPoolCSVParserTest.java   
@Test
public void testTagPoolParser () throws BuenOjoCSVParserException {

    TagPoolCSVParser parser = new TagPoolCSVParser(new ByteArrayResource(csvString.getBytes(StandardCharsets.UTF_8)));
    Course course = new Course();
    course.setId(new Long(1000));
    try {
        List<Tag> tags = parser.parse(course);
        assertThat(tags).isNotNull().isNotEmpty();
        assertThat(tags.size()).isNotZero().isEqualTo(7);
        assertThat(tags.get(0).getNumber()).isEqualTo(1);
        assertThat(tags.get(1).getNumber()).isEqualTo(2);
        List<TagPool> tagPool = parser.parseTagPool();
        assertThat(tagPool).isNotNull().isNotEmpty();
        assertThat(tagPool.size()).isNotZero().isEqualTo(11);

    } catch (IOException e) {

        Fail.fail(e.getMessage());
    }



}
项目:XXXX    文件:FeignTest.java   
@Test
public void queryMapKeysMustBeStrings() throws Exception {
  server.enqueue(new MockResponse());

  TestInterface api = new TestInterfaceBuilder().target("http://localhost:" + server.getPort());

  Map<Object, String> queryMap = new LinkedHashMap<Object, String>();
  queryMap.put(Integer.valueOf(42), "alice");

  try {
    api.queryMap((Map) queryMap);
    Fail.failBecauseExceptionWasNotThrown(IllegalStateException.class);
  } catch (IllegalStateException ex) {
    assertThat(ex).hasMessage("QueryMap key must be a String: 42");
  }
}
项目:atf-toolbox-java    文件:ConfigurationManager.java   
private void loadConfiguration() {
    Properties sysProps = System.getProperties();
    String configFileName = sysProps.getProperty("test.config.filename");

    if (StringUtils.isEmpty(configFileName)) {
        configFileName = defaultConfigurationFileName;
    }

    try {
        AllConfiguration = new DefaultConfigurationBuilder(configFileName).getConfiguration();
        ((HierarchicalConfiguration) AllConfiguration).setExpressionEngine(new XPathExpressionEngine());
    } catch (Exception e) {
        Fail.fail("failed to read config file", e);
        log.error("Failed to read config file", e);
    }
}
项目:MIDI-Automator    文件:SikuliXGUIAutomations.java   
/**
 * Checks if the file opened correctly
 * 
 * @param states
 *            the different states of the region
 */
public void checkIfFileOpened(String... states) {

    Region match = null;

    try {

        // check if file opened
        SikuliXAutomation.setSearchRegion(SCREEN);
        match = findMultipleStateRegion(DEFAULT_TIMEOUT, states);

        // close editor
        match.click();
        closeFocusedProgram();

    } catch (FindFailed e) {
        Fail.fail("File did not open.", e);
    }

}
项目:MIDI-Automator    文件:SikuliXGUIAutomations.java   
/**
 * Checks if the file did not open.
 * 
 * @param states
 *            the different states of the region
 */
public void checkIfFileNotOpened(String... states) {

    Region match = null;

    try {

        // check if file opened
        SikuliXAutomation.setSearchRegion(SCREEN);
        match = findMultipleStateRegion(DEFAULT_TIMEOUT, states);

        // close editor
        match.click();
        closeFocusedProgram();
        Fail.fail("File did open.");

    } catch (FindFailed e) {

    }
}
项目:camunda-engine-dmn    文件:DmnDecisionResultTest.java   
protected void assertMultipleOutputValues(DmnDecisionResultEntries result) {
  assertThat(result.size()).isEqualTo(2);

  String value = (String) result.get("firstOutput");
  assertThat(value).isEqualTo("multipleValues1");

  value = (String) result.get("secondOutput");
  assertThat(value).isEqualTo("multipleValues2");

  value = result.getFirstEntry();
  assertThat(value).isEqualTo("multipleValues1");

  try {
    result.getSingleEntry();
    Fail.failBecauseExceptionWasNotThrown(DmnDecisionResultException.class);
  }
  catch (DmnDecisionResultException e) {
    assertThat(e)
      .hasMessageStartingWith("DMN-01010")
      .hasMessageContaining("multipleValues1")
      .hasMessageContaining("multipleValues2");
  }
}
项目:camunda-engine-dmn    文件:DmnDecisionTableResultTest.java   
protected void assertMultipleOutputValues(DmnDecisionRuleResult decisionRuleResult) {
  assertThat(decisionRuleResult.size()).isEqualTo(2);

  String value = (String) decisionRuleResult.get("firstOutput");
  assertThat(value).isEqualTo("multipleValues1");

  value = (String) decisionRuleResult.get("secondOutput");
  assertThat(value).isEqualTo("multipleValues2");

  value = decisionRuleResult.getFirstEntry();
  assertThat(value).isEqualTo("multipleValues1");

  try {
    decisionRuleResult.getSingleEntry();
    Fail.failBecauseExceptionWasNotThrown(DmnDecisionResultException.class);
  }
  catch (DmnDecisionResultException e) {
    assertThat(e)
      .hasMessageStartingWith("DMN-01007")
      .hasMessageContaining("multipleValues1")
      .hasMessageContaining("multipleValues2");
  }
}
项目:s3proxy    文件:AwsSdkTest.java   
@Test
public void testAwsV4SignatureBadIdentity() throws Exception {
    client = AmazonS3ClientBuilder.standard()
            .withCredentials(new AWSStaticCredentialsProvider(
                    new BasicAWSCredentials(
                            "bad-access-key", awsCreds.getAWSSecretKey())))
            .withEndpointConfiguration(s3EndpointConfig)
            .build();

    ObjectMetadata metadata = new ObjectMetadata();
    metadata.setContentLength(BYTE_SOURCE.size());

    try {
        client.putObject(containerName, "foo",
                BYTE_SOURCE.openStream(), metadata);
        Fail.failBecauseExceptionWasNotThrown(AmazonS3Exception.class);
    } catch (AmazonS3Exception e) {
        assertThat(e.getErrorCode()).isEqualTo("InvalidAccessKeyId");
    }
}
项目:s3proxy    文件:AwsSdkTest.java   
@Test
public void testAwsV4SignatureBadCredential() throws Exception {
    client = AmazonS3ClientBuilder.standard()
            .withCredentials(new AWSStaticCredentialsProvider(
                    new BasicAWSCredentials(
                            awsCreds.getAWSAccessKeyId(),
                            "bad-secret-key")))
            .withEndpointConfiguration(s3EndpointConfig)
            .build();

    ObjectMetadata metadata = new ObjectMetadata();
    metadata.setContentLength(BYTE_SOURCE.size());

    try {
        client.putObject(containerName, "foo",
                BYTE_SOURCE.openStream(), metadata);
        Fail.failBecauseExceptionWasNotThrown(AmazonS3Exception.class);
    } catch (AmazonS3Exception e) {
        assertThat(e.getErrorCode()).isEqualTo("SignatureDoesNotMatch");
    }
}
项目:s3proxy    文件:AwsSdkTest.java   
@Test
public void testUpdateBlobXmlAcls() throws Exception {
    assumeTrue(!Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType));
    String blobName = "testUpdateBlobXmlAcls-blob";
    ObjectMetadata metadata = new ObjectMetadata();
    metadata.setContentLength(BYTE_SOURCE.size());
    client.putObject(containerName, blobName, BYTE_SOURCE.openStream(),
            metadata);
    AccessControlList acl = client.getObjectAcl(containerName, blobName);

    acl.grantPermission(GroupGrantee.AllUsers, Permission.Read);
    client.setObjectAcl(containerName, blobName, acl);
    assertThat(client.getObjectAcl(containerName, blobName)).isEqualTo(acl);

    acl.revokeAllPermissions(GroupGrantee.AllUsers);
    client.setObjectAcl(containerName, blobName, acl);
    assertThat(client.getObjectAcl(containerName, blobName)).isEqualTo(acl);

    acl.grantPermission(GroupGrantee.AllUsers, Permission.Write);
    try {
        client.setObjectAcl(containerName, blobName, acl);
        Fail.failBecauseExceptionWasNotThrown(AmazonS3Exception.class);
    } catch (AmazonS3Exception e) {
        assertThat(e.getErrorCode()).isEqualTo("NotImplemented");
    }
}
项目:s3proxy    文件:AwsSdkTest.java   
@Test
public void testPartNumberMarker() throws Exception {
    String blobName = "foo";
    InitiateMultipartUploadResult result = client.initiateMultipartUpload(
            new InitiateMultipartUploadRequest(containerName, blobName));
    ListPartsRequest request = new ListPartsRequest(containerName,
            blobName, result.getUploadId());

    client.listParts(request.withPartNumberMarker(0));

    try {
        client.listParts(request.withPartNumberMarker(1));
        Fail.failBecauseExceptionWasNotThrown(AmazonS3Exception.class);
    } catch (AmazonS3Exception e) {
        assertThat(e.getErrorCode()).isEqualTo("NotImplemented");
    }
}
项目:s3proxy    文件:AwsSdkTest.java   
@Test
public void testBlobRemove() throws Exception {
    String blobName = "blob";
    ObjectMetadata metadata = new ObjectMetadata();
    metadata.setContentLength(BYTE_SOURCE.size());
    client.putObject(containerName, blobName, BYTE_SOURCE.openStream(),
            metadata);
    assertThat(client.getObjectMetadata(containerName, blobName))
            .isNotNull();

    client.deleteObject(containerName, blobName);
    try {
        client.getObjectMetadata(containerName, blobName);
        Fail.failBecauseExceptionWasNotThrown(AmazonS3Exception.class);
    } catch (AmazonS3Exception e) {
        assertThat(e.getErrorCode()).isEqualTo("404 Not Found");
    }

    client.deleteObject(containerName, blobName);
}
项目:RDFUnit    文件:TestCaseWithTargetTest.java   
@Test
public void test() {

    TestCase innerTestCAse = Mockito.mock(TestCase.class);
    when(innerTestCAse.getSparqlWhere()).thenReturn(sparqlQuery);

    TestCase testCaseWithTarget = TestCaseWithTarget.builder()
            .testCase(innerTestCAse)
            .target(target)
            .filterSpqrql(" ?this <http://example.cpm/p> ?value .")
            .build();

    String finalSparql = PrefixNSService.getSparqlPrefixDecl() + testCaseWithTarget.getSparqlWhere();

    assertThat(finalSparql)
            .contains(target.getPattern());

    try {
        QueryFactory.create(finalSparql);
    } catch (Exception e) {
        Fail.fail("Failed sparql query:\n" + finalSparql, e);
    }

}
项目:buenojo    文件:TagCircleCSVParserTest.java   
@Test
public void testTagCircleParse() {

    InputStream in = new ByteArrayInputStream(csvString.getBytes(StandardCharsets.UTF_8));
    TagCircleCSVParser parser = new TagCircleCSVParser(in);
    List<TagCircle> list = null;
    try {
        list = parser.parse();
    }
    catch (Exception e) {
        assertThat(e).isInstanceOf(IOException.class);
        Fail.fail(e.getMessage());
    }
    assertThat(list).isNotEmpty();
    assertThat(list).isNotNull();
    assertThat(list.size()).isEqualTo(2);
    assertThat(list.get(0).getNumber()).isEqualTo(0);
    assertThat(list.get(0).getX()).isEqualTo(431);
    assertThat(list.get(0).getY()).isEqualTo(197);
    assertThat(list.get(0).getRadioPx()).isCloseTo(73.72f, Offset.offset(0.1f));

    assertThat(list.get(1).getNumber()).isEqualTo(1);

    assertThat(list.get(1).getX()).isEqualTo(344);
    assertThat(list.get(1).getY()).isEqualTo(317);
    assertThat(list.get(1).getRadioPx()).isCloseTo(29.49f, Offset.offset(0.1f));


}
项目:yaess    文件:BDDTest.java   
public SELF_TYPE thenThrowNoException() {

        if (exceptionThrownOptional.isPresent()) {
            Exception e = exceptionThrownOptional.get();
            // TODO [bilu] 06.11.17 more detailed stack
            Fail.fail("Expected no exception, found exception of class " + e.getClass() + " with message " + e.getMessage() + ". Caused by " + e.getCause());
        }
        return self();
    }
项目:XXXX    文件:DefaultContractTest.java   
@Test
public void onlyOneQueryMapAnnotationPermitted() throws Exception {
  try {
    parseAndValidateMetadata(QueryMapTestInterface.class, "multipleQueryMap", Map.class, Map.class);
    Fail.failBecauseExceptionWasNotThrown(IllegalStateException.class);
  } catch (IllegalStateException ex) {
    assertThat(ex).hasMessage("QueryMap annotation was present on multiple parameters.");
  }
}
项目:XXXX    文件:DefaultContractTest.java   
@Test
public void queryMapMustBeInstanceOfMap() throws Exception {
  try {
    parseAndValidateMetadata(QueryMapTestInterface.class, "nonMapQueryMap", String.class);
    Fail.failBecauseExceptionWasNotThrown(IllegalStateException.class);
  } catch (IllegalStateException ex) {
    assertThat(ex).hasMessage("QueryMap parameter must be a Map: class java.lang.String");
  }
}
项目:XXXX    文件:DefaultContractTest.java   
@Test
public void onlyOneHeaderMapAnnotationPermitted() throws Exception {
  try {
    parseAndValidateMetadata(HeaderMapInterface.class, "multipleHeaderMap", Map.class, Map.class);
    Fail.failBecauseExceptionWasNotThrown(IllegalStateException.class);
  } catch (IllegalStateException ex) {
    assertThat(ex).hasMessage("HeaderMap annotation was present on multiple parameters.");
  }
}
项目:jug-material    文件:ExceptionHandlingTest.java   
@Test
public void shouldNotWrapRuntimeException() throws Exception {
    final RuntimeException someException = new RuntimeException();
    ExceptionThrower<Exception> et = new ExceptionThrower<Exception>(someException);
    try {
        callUglyCode(et);
        Fail.failBecauseExceptionWasNotThrown(RuntimeException.class);
    } catch (RuntimeException e) {
        assertThat(e).isSameAs(someException);
    }
}
项目:jug-material    文件:ExceptionHandlingTest.java   
@Test
public void shouldNotWrapRuntimeException_guava() throws Exception {
    final RuntimeException someException = new RuntimeException();
    ExceptionThrower<Exception> et = new ExceptionThrower<Exception>(someException);
    try {
        callUglyCode_guava(et);
        Fail.failBecauseExceptionWasNotThrown(RuntimeException.class);
    } catch (RuntimeException e) {
        assertThat(e).isSameAs(someException);
    }
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
public void testDeleteNonExisting() {
    final SimpleTestEntity ent = new SimpleTestEntity();
    ent.setId(Long.MAX_VALUE);
    try {
        dao.delete(ent);
        Fail.fail("Exception should have been thrown!");
    } catch (final Throwable t) {
        final boolean causedBy = Throwables.isCausedByType(t, EmptyResultDataAccessException.class);
        if (!causedBy) {
            throw Err.process(t);
        }
    }
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
@Transactional
public void testWriteAndRead() {
    final SimpleTestEntity ent1 = new SimpleTestEntity();
    ent1.setName("one");

    Assertions.assertThat(dao.isEmpty()).isTrue();
    dao.save(ent1);
    Assertions.assertThat(dao.isEmpty()).isFalse();
    ent1.setName("two");
    dao.save(ent1);

    final SimpleTestEntity ent2 = new SimpleTestEntity();
    ent2.setName("999");
    dao.save(ent2);

    List<SimpleTestEntity> all = dao.findAll();
    Assertions.assertThat(all.size()).isEqualTo(2);
    for (final SimpleTestEntity e : all) {
        if (e.getId().equals(ent1.getId())) {
            Assertions.assertThat(e.getName()).isEqualTo(ent1.getName());
        } else if (e.getId().equals(ent2.getId())) {
            Assertions.assertThat(e.getName()).isEqualTo(ent2.getName());
        } else {
            Fail.fail("Unbekannte Entity: " + e.getId());
        }
    }

    final SimpleTestEntity example = new SimpleTestEntity();
    example.setName("two");
    all = dao.findAll(example);
    Assertions.assertThat(all.size()).isEqualTo(1);
    Assertions.assertThat(all.get(0).getName()).isEqualTo("two");
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
public void testBeanValidation() {
    try {
        final SimpleTestEntity entWithoutName = new SimpleTestEntity();
        dao.save(entWithoutName);
        Fail.fail("Exception expected");
    } catch (final Throwable t) {
        final ConstraintViolationException e = Throwables.getCauseByType(t, ConstraintViolationException.class);
        Assertions.assertThat(e).isNotNull();
        Err.process(e);
    }
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
public void testDeleteNonExisting() {
    final SimpleTestEntity ent = new SimpleTestEntity();
    ent.setId(Long.MAX_VALUE);
    try {
        dao.delete(ent);
        Fail.fail("Exception should have been thrown!");
    } catch (final Throwable t) {
        final boolean causedBy = Throwables.isCausedByType(t, EmptyResultDataAccessException.class);
        if (!causedBy) {
            throw Err.process(t);
        }
    }
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
@Transactional
public void testWriteAndRead() {
    final SimpleTestEntity ent1 = new SimpleTestEntity();
    ent1.setName("one");

    Assertions.assertThat(dao.isEmpty()).isTrue();
    dao.save(ent1);
    Assertions.assertThat(dao.isEmpty()).isFalse();
    ent1.setName("two");
    dao.save(ent1);

    final SimpleTestEntity ent2 = new SimpleTestEntity();
    ent2.setName("999");
    dao.save(ent2);

    List<SimpleTestEntity> all = dao.findAll();
    Assertions.assertThat(all.size()).isEqualTo(2);
    for (final SimpleTestEntity e : all) {
        if (e.getId().equals(ent1.getId())) {
            Assertions.assertThat(e.getName()).isEqualTo(ent1.getName());
        } else if (e.getId().equals(ent2.getId())) {
            Assertions.assertThat(e.getName()).isEqualTo(ent2.getName());
        } else {
            Fail.fail("Unbekannte Entity: " + e.getId());
        }
    }

    final SimpleTestEntity example = new SimpleTestEntity();
    example.setName("two");
    all = dao.findAll(example);
    Assertions.assertThat(all.size()).isEqualTo(1);
    Assertions.assertThat(all.get(0).getName()).isEqualTo("two");
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
public void testBeanValidation() {
    try {
        final SimpleTestEntity entWithoutName = new SimpleTestEntity();
        dao.save(entWithoutName);
        Fail.fail("Exception expected");
    } catch (final Throwable t) {
        final ConstraintViolationException e = Throwables.getCauseByType(t, ConstraintViolationException.class);
        Assertions.assertThat(e).isNotNull();
        Err.process(e);
    }
}
项目:invesdwin-context-persistence    文件:TestDaoTest.java   
public void testDeleteNonExisting() {
    final TestEntity ent = new TestEntity();
    ent.setId(Long.MAX_VALUE);
    try {
        dao.delete(ent);
        Fail.fail("Exception should have been thrown!");
    } catch (final Throwable t) {
        final boolean causedBy = Throwables.isCausedByType(t, EmptyResultDataAccessException.class);
        if (!causedBy) {
            throw Err.process(t);
        }
    }
}
项目:invesdwin-context-persistence    文件:TestDaoTest.java   
@Transactional
public void testWriteAndRead() {
    final TestEntity ent1 = new TestEntity();
    ent1.setName("one");

    Assertions.assertThat(dao.isEmpty()).isTrue();
    dao.save(ent1);
    Assertions.assertThat(dao.isEmpty()).isFalse();
    Assertions.assertThat(ent1.getCreated()).isNotNull();
    Assertions.assertThat(ent1.getUpdated()).isNotNull();
    ent1.setName("two");
    dao.save(ent1);

    final TestEntity ent2 = new TestEntity();
    ent2.setName("999");
    dao.save(ent2);

    List<TestEntity> all = dao.findAll();
    Assertions.assertThat(all.size()).isEqualTo(2);
    for (final TestEntity e : all) {
        if (e.getId().equals(ent1.getId())) {
            Assertions.assertThat(e.getName()).isEqualTo(ent1.getName());
        } else if (e.getId().equals(ent2.getId())) {
            Assertions.assertThat(e.getName()).isEqualTo(ent2.getName());
        } else {
            Fail.fail("Unbekannte Entity: " + e.getId());
        }
    }

    final TestEntity example = new TestEntity();
    example.setName("two");
    all = dao.findAll(example);
    Assertions.assertThat(all.size()).isEqualTo(1);
    Assertions.assertThat(all.get(0).getName()).isEqualTo("two");
}
项目:invesdwin-context-persistence    文件:TestDaoTest.java   
public void testBeanValidation() {
    try {
        final TestEntity entWithoutName = new TestEntity();
        dao.save(entWithoutName);
        Fail.fail("Exception expected");
    } catch (final Throwable t) {
        final ConstraintViolationException e = Throwables.getCauseByType(t, ConstraintViolationException.class);
        Assertions.assertThat(e).isNotNull();
        Err.process(e);
    }
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
public void testDeleteNonExisting() {
    final SimpleTestEntity ent = new SimpleTestEntity();
    ent.setId(Long.MAX_VALUE);
    ent.setName("asdf");
    try {
        dao.delete(ent);
        Fail.fail("Exception should have been thrown!");
    } catch (final Throwable t) {
        final boolean causedBy = Throwables.isCausedByType(t, EmptyResultDataAccessException.class);
        if (!causedBy) {
            throw Err.process(t);
        }
    }
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
@Transactional
public void testWriteAndRead() {
    final SimpleTestEntity ent1 = new SimpleTestEntity();
    ent1.setName("one");

    Assertions.assertThat(dao.isEmpty()).isTrue();
    dao.save(ent1);
    Assertions.assertThat(dao.isEmpty()).isFalse();
    ent1.setName("two");
    dao.save(ent1);

    final SimpleTestEntity ent2 = new SimpleTestEntity();
    ent2.setName("999");
    dao.save(ent2);

    List<SimpleTestEntity> all = dao.findAll();
    Assertions.assertThat(all.size()).isEqualTo(2);
    for (final SimpleTestEntity e : all) {
        if (e.getId().equals(ent1.getId())) {
            Assertions.assertThat(e.getName()).isEqualTo(ent1.getName());
        } else if (e.getId().equals(ent2.getId())) {
            Assertions.assertThat(e.getName()).isEqualTo(ent2.getName());
        } else {
            Fail.fail("Unbekannte Entity: " + e.getId());
        }
    }

    final SimpleTestEntity example = new SimpleTestEntity();
    example.setName("two");
    all = dao.findAll(example);
    Assertions.assertThat(all.size()).isEqualTo(1);
    Assertions.assertThat(all.get(0).getName()).isEqualTo("two");
}
项目:invesdwin-context-persistence    文件:SimpleTestDaoTest.java   
public void testBeanValidation() {
    try {
        final SimpleTestEntity entWithoutName = new SimpleTestEntity();
        dao.save(entWithoutName);
        Fail.fail("Exception expected");
    } catch (final Throwable t) {
        final ValidationException e = Throwables.getCauseByType(t, ValidationException.class);
        Assertions.assertThat(e).as(Throwables.getFullStackTrace(t)).isNotNull();
        Err.process(e);
    }
}
项目:invesdwin-context-persistence    文件:MultiplePersistenceUnitsTest.java   
public void testMultiplePersistenceUnitsWorkWithNestedRollback() {
    final long countBeforeTestDao = testDao.count();
    final long countBeforeAnotherTestDao = anotherTestDao.count();
    final long countBeforeAnotherPuTestDao = anotherPuTestDao.count();
    try {
        testMultiplePersistenceUnitsWorkWithRollback();
        Fail.fail("exception should have been thrown");
    } catch (final RuntimeException e) {
        Assertions.assertThat(e.getMessage()).contains("rollback reason");
    }
    Assertions.assertThat(testDao.count()).isEqualTo(countBeforeTestDao);
    Assertions.assertThat(anotherTestDao.count()).isEqualTo(countBeforeAnotherTestDao);
    Assertions.assertThat(anotherPuTestDao.count()).isEqualTo(countBeforeAnotherPuTestDao);
}
项目:MIDI-Automator    文件:SikuliXGUIAutomations.java   
/**
 * Checks if the program opened
 * 
 * @param states
 *            the different states of the region
 */
public void checkIfProgramOpened(String... states) {

    try {

        // check if file opened
        SikuliXAutomation.setSearchRegion(SCREEN);
        findMultipleStateRegion(DEFAULT_TIMEOUT, states);

    } catch (FindFailed e) {
        Fail.fail("Program did not open.", e);
    }
}