@Test
public void testGetAllCryptors() throws Exception {

  /*
   * Call this first to ensure the factory has loaded all the cryptors.
   */
  List<JNCryptor> cryptors = JNCryptorFactory.getCryptors();
  // Find the resource file ourselves
  URL url = JNCryptorFactoryTest.class.getResource("/jncryptor-classes.txt");
  if (url == null) {
    fail("Cannot find cryptor class list.");
  }
  List<String> classList = FileUtils.readLines(new File(url.getPath()));
  // Check each class actually exists
  for (String clazz : classList) {
    try {
      Class.forName(clazz);
    } catch (ClassNotFoundException e) {
      fail(String.format("Could not find class: %s", clazz));
    }
  }
  // Check the returned list contains all the classes listed in the file
  assertEquals(classList.size(), cryptors.size());
  for (JNCryptor cryptor : cryptors) {
    assertTrue(classList.contains(cryptor.getClass().getCanonicalName()));
  }
}