static void addAndRemoveFileType() { FileType foo = new FakeFileType() { @Override public boolean isMyFileType(@NotNull VirtualFile file) { return true; } @NotNull @Override public String getName() { return "foo"; } @NotNull @Override public String getDescription() { return ""; } }; FileTypeIndex index = new FileTypeIndex(FileTypeManager.getInstance()); int version = index.getVersion(); try { FileTypeManagerEx.getInstanceEx().registerFileType(foo); assertNotSame(version, index.getVersion()); } finally { FileTypeManagerEx.getInstanceEx().unregisterFileType(foo); } }
static void addAndRemoveFileType() { FileType foo = new FakeFileType() { @Override public boolean isMyFileType(VirtualFile file) { return true; } @NotNull @Override public String getName() { return "foo"; } @NotNull @Override public String getDescription() { return ""; } }; FileTypeIndex index = new FileTypeIndex(FileTypeManager.getInstance()); int version = index.getVersion(); try { FileTypeManagerEx.getInstanceEx().registerFileType(foo); assertNotSame(version, index.getVersion()); } finally { FileTypeManagerEx.getInstanceEx().unregisterFileType(foo); } }
public void testAddFileType() throws Exception { FileType foo = new FakeFileType() { @Override public boolean isMyFileType(VirtualFile file) { return true; } @Nonnull @Override public String getName() { return "foo"; } @Nonnull @Override public String getDescription() { return ""; } }; FileTypeIndex index = new FileTypeIndex(FileTypeManager.getInstance()); int version = index.getVersion(); try { FileTypeManagerEx.getInstanceEx().registerFileType(foo); assertNotSame(version, index.getVersion()); } finally { FileTypeManagerEx.getInstanceEx().unregisterFileType(foo); } }