@Test
public void testAddBadModulesDir() throws Exception {

    File jbossHome = createTempDir("testValidate.jbossHome");
    File modulesDir = new File(jbossHome, "modules");
    Modules modules = new Modules(modulesDir);
    AddModuleRequest minimal = createMinimal();
    /* modulesDir does not exist yet */
    Assert.assertFalse(modulesDir.exists());
    try {
        modules.add(minimal);
        Assert.fail("Exception expected");
    } catch (IllegalArgumentException expected) {
    }
}