protected void setUp() throws Exception {
super.setUp();
ModifiableRootModel rootModel = null;
final ModuleRootManager rootManager = ModuleRootManager.getInstance(getModule());
if (isConfigureSourceFolder()) {
rootModel = ModuleRootManager.getInstance(getModule()).getModifiableModel();
final String testDir = getTestFolderPath();
// Configure source folder
final File dir = new File(testDir);
assertTrue(dir.exists());
VirtualFile vDir = LocalFileSystem.getInstance().
refreshAndFindFileByPath(dir.getCanonicalPath().replace(File.separatorChar, '/'));
assertNotNull(vDir);
ContentEntry contentEntry = rootModel.addContentEntry(vDir);
contentEntry.addSourceFolder(vDir, false);
}
// Add Clojure Library
OrderEnumerator libs = rootManager.orderEntries().librariesOnly();
final List<Library.ModifiableModel> libModels = new ArrayList<Library.ModifiableModel>();
rootModel = TestUtils.addLibrary(rootModel, rootManager, libs, libModels, "clojureLib", TestUtils.getMockClojureLib(), null);
rootModel = TestUtils.addLibrary(rootModel, rootManager, libs, libModels, "clojureContrib", TestUtils.getMockClojureContribLib(), null);