You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: David C. <dc...@us...> - 2005-11-20 02:23:09
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/symbols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4813/src/org/rubypeople/rdt/internal/ui/symbols Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/symbols added to the repository |
|
From: David C. <dc...@us...> - 2005-11-19 20:23:37
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22241/src/org/rubypeople/rdt/testunit/views Modified Files: TestHierarchyTab.java FailureTab.java OpenSymbolAction.java Log Message: Introduce ISymbolFinder, and change SymbolIndex clients accordingly. Index: FailureTab.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views/FailureTab.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FailureTab.java 18 Nov 2005 22:46:09 -0000 1.8 --- FailureTab.java 19 Nov 2005 20:23:30 -0000 1.9 *************** *** 39,43 **** import org.eclipse.swt.widgets.TableItem; import org.rubypeople.rdt.core.RubyCore; ! import org.rubypeople.rdt.internal.core.symbols.SymbolIndex; import org.rubypeople.rdt.testunit.ITestRunListener; --- 39,43 ---- import org.eclipse.swt.widgets.TableItem; import org.rubypeople.rdt.core.RubyCore; ! import org.rubypeople.rdt.internal.core.symbols.ISymbolFinder; import org.rubypeople.rdt.testunit.ITestRunListener; *************** *** 152,156 **** String methodName = getMethodName(); if (className != null) { ! manager.add(OpenSymbolAction.forClass(className, getSymbolIndex(), getShell())); manager.add(new Separator()); manager.add(new RerunAction(fRunnerViewPart, getSelectedTestId(), --- 152,156 ---- String methodName = getMethodName(); if (className != null) { ! manager.add(OpenSymbolAction.forClass(className, getSymbolFinder(), getShell())); manager.add(new Separator()); manager.add(new RerunAction(fRunnerViewPart, getSelectedTestId(), *************** *** 166,171 **** } ! private SymbolIndex getSymbolIndex() { ! return RubyCore.getPlugin().getSymbolIndex(); } --- 166,171 ---- } ! private ISymbolFinder getSymbolFinder() { ! return RubyCore.getPlugin().getSymbolFinder(); } *************** *** 276,280 **** void handleDoubleClick(MouseEvent e) { if (fTable.getSelectionCount() > 0) ! OpenSymbolAction.forClass(getClassName(), getSymbolIndex(), getShell()).run(); } --- 276,280 ---- void handleDoubleClick(MouseEvent e) { if (fTable.getSelectionCount() > 0) ! OpenSymbolAction.forClass(getClassName(), getSymbolFinder(), getShell()).run(); } Index: TestHierarchyTab.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views/TestHierarchyTab.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestHierarchyTab.java 18 Nov 2005 22:46:09 -0000 1.4 --- TestHierarchyTab.java 19 Nov 2005 20:23:30 -0000 1.5 *************** *** 47,51 **** import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; ! import org.rubypeople.rdt.internal.core.symbols.SymbolIndex; import org.rubypeople.rdt.testunit.ITestRunListener; --- 47,51 ---- import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; ! import org.rubypeople.rdt.internal.core.symbols.ISymbolFinder; import org.rubypeople.rdt.testunit.ITestRunListener; *************** *** 416,424 **** Shell shell = fTree.getShell(); ! SymbolIndex index = RubyCore.getPlugin().getSymbolIndex(); if (isSuiteSelected()) ! action= OpenSymbolAction.forClass(getClassName(), index, shell); else ! action= OpenSymbolAction.forMethod(getClassName(), getTestMethod(), index, shell); if (action != null && action.isEnabled()) --- 416,424 ---- Shell shell = fTree.getShell(); ! ISymbolFinder finder = RubyCore.getPlugin().getSymbolFinder(); if (isSuiteSelected()) ! action= OpenSymbolAction.forClass(getClassName(), finder, shell); else ! action= OpenSymbolAction.forMethod(getClassName(), getTestMethod(), finder, shell); if (action != null && action.isEnabled()) *************** *** 432,438 **** String testLabel = testInfo.getTestName(); Shell shell = fTree.getShell(); ! SymbolIndex symbolIndex = RubyCore.getPlugin().getSymbolIndex(); if (isSuiteSelected()) { ! manager.add(OpenSymbolAction.forClass(getClassName(), symbolIndex, shell)); manager.add(new Separator()); if (testClassExists(getClassName()) && !fTestRunnerPart.lastLaunchIsKeptAlive()) { --- 432,438 ---- String testLabel = testInfo.getTestName(); Shell shell = fTree.getShell(); ! ISymbolFinder symbolFinder = RubyCore.getPlugin().getSymbolFinder(); if (isSuiteSelected()) { ! manager.add(OpenSymbolAction.forClass(getClassName(), symbolFinder, shell)); manager.add(new Separator()); if (testClassExists(getClassName()) && !fTestRunnerPart.lastLaunchIsKeptAlive()) { *************** *** 442,446 **** } else { manager.add(OpenSymbolAction.forMethod(getClassName(), ! getTestMethod(), symbolIndex, shell)); manager.add(new Separator()); manager.add(new RerunAction(fTestRunnerPart, getSelectedTestId(), getClassName(), getTestMethod(), ILaunchManager.RUN_MODE)); --- 442,446 ---- } else { manager.add(OpenSymbolAction.forMethod(getClassName(), ! getTestMethod(), symbolFinder, shell)); manager.add(new Separator()); manager.add(new RerunAction(fTestRunnerPart, getSelectedTestId(), getClassName(), getTestMethod(), ILaunchManager.RUN_MODE)); *************** *** 453,457 **** private boolean testClassExists(String className) { ! return RubyCore.getPlugin().getSymbolIndex().find(new ClassSymbol(className)).size() > 0; } --- 453,457 ---- private boolean testClassExists(String className) { ! return RubyCore.getPlugin().getSymbolFinder().find(new ClassSymbol(className)).size() > 0; } Index: OpenSymbolAction.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views/OpenSymbolAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpenSymbolAction.java 18 Nov 2005 22:46:09 -0000 1.1 --- OpenSymbolAction.java 19 Nov 2005 20:23:30 -0000 1.2 *************** *** 12,19 **** import org.eclipse.swt.widgets.Shell; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; import org.rubypeople.rdt.internal.core.symbols.Location; import org.rubypeople.rdt.internal.core.symbols.MethodSymbol; import org.rubypeople.rdt.internal.core.symbols.Symbol; - import org.rubypeople.rdt.internal.core.symbols.SymbolIndex; import org.rubypeople.rdt.internal.ui.RubyPluginImages; import org.rubypeople.rdt.internal.ui.dialogs.ElementListSelectionDialog; --- 12,19 ---- import org.eclipse.swt.widgets.Shell; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; + import org.rubypeople.rdt.internal.core.symbols.ISymbolFinder; import org.rubypeople.rdt.internal.core.symbols.Location; import org.rubypeople.rdt.internal.core.symbols.MethodSymbol; import org.rubypeople.rdt.internal.core.symbols.Symbol; import org.rubypeople.rdt.internal.ui.RubyPluginImages; import org.rubypeople.rdt.internal.ui.dialogs.ElementListSelectionDialog; *************** *** 24,45 **** private final Symbol symbol; ! private final SymbolIndex index; private final Shell shell; private String dialogTitle; ! public static IAction forClass(String className, SymbolIndex index, Shell shell) { ! return new OpenSymbolAction(new ClassSymbol(className), index, shell, "Open Class"); } public static IAction forMethod(String className, String testMethod, ! SymbolIndex index, Shell shell) { ! return new OpenSymbolAction(new MethodSymbol(className, testMethod), index, shell, "Open Method"); } ! public OpenSymbolAction(Symbol symbol, SymbolIndex index, Shell shell, String title) { super(TestUnitMessages.getString("OpenEditor.action.label")); this.shell = shell; this.symbol = symbol; ! this.index = index; this.dialogTitle = title; } --- 24,45 ---- private final Symbol symbol; ! private final ISymbolFinder finder; private final Shell shell; private String dialogTitle; ! public static IAction forClass(String className, ISymbolFinder finder, Shell shell) { ! return new OpenSymbolAction(new ClassSymbol(className), finder, shell, "Open Class"); } public static IAction forMethod(String className, String testMethod, ! ISymbolFinder finder, Shell shell) { ! return new OpenSymbolAction(new MethodSymbol(className, testMethod), finder, shell, "Open Method"); } ! public OpenSymbolAction(Symbol symbol, ISymbolFinder finder, Shell shell, String title) { super(TestUnitMessages.getString("OpenEditor.action.label")); this.shell = shell; this.symbol = symbol; ! this.finder = finder; this.dialogTitle = title; } *************** *** 47,51 **** public void run() { ! Set locations = index.find(symbol); if (locations.size() == 0) return; --- 47,51 ---- public void run() { ! Set locations = finder.find(symbol); if (locations.size() == 0) return; |
|
From: David C. <dc...@us...> - 2005-11-19 20:23:33
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22214/src/org/rubypeople/rdt/internal/core/symbols Modified Files: SymbolIndex.java Added Files: ISymbolFinder.java Log Message: Introduce ISymbolFinder, and change SymbolIndex clients accordingly. --- NEW FILE: ISymbolFinder.java --- package org.rubypeople.rdt.internal.core.symbols; import java.util.Set; import java.util.regex.PatternSyntaxException; public interface ISymbolFinder { public abstract Set find(Symbol symbol); /* * returns a set of SearchResult instances as opposed to find(symbol), which returns locations */ public abstract Set find(String regExp, int symbolType) throws PatternSyntaxException; } Index: SymbolIndex.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols/SymbolIndex.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SymbolIndex.java 13 Nov 2005 13:05:12 -0000 1.10 --- SymbolIndex.java 19 Nov 2005 20:23:25 -0000 1.11 *************** *** 25,31 **** import org.jruby.lexer.yacc.ISourcePosition; ! public class SymbolIndex { ! ! private Map index = Collections.synchronizedMap(new HashMap()); private static boolean verbose; --- 25,29 ---- import org.jruby.lexer.yacc.ISourcePosition; ! public class SymbolIndex implements ISymbolFinder { private Map index = Collections.synchronizedMap(new HashMap()); private static boolean verbose; *************** *** 48,51 **** --- 46,52 ---- } + /* (non-Javadoc) + * @see org.rubypeople.rdt.internal.core.symbols.ISymbolFinder#find(org.rubypeople.rdt.internal.core.symbols.Symbol) + */ public Set find(Symbol symbol) { Set locations = (Set) index.get(symbol); *************** *** 58,61 **** --- 59,65 ---- * returns a set of SearchResult instances as opposed to find(symbol), which returns locations */ + /* (non-Javadoc) + * @see org.rubypeople.rdt.internal.core.symbols.ISymbolFinder#find(java.lang.String, int) + */ public Set find(String regExp, int symbolType) throws PatternSyntaxException { Pattern pattern = Pattern.compile(regExp); |
|
From: David C. <dc...@us...> - 2005-11-19 20:23:33
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22214/src/org/rubypeople/rdt/core Modified Files: RubyCore.java Log Message: Introduce ISymbolFinder, and change SymbolIndex clients accordingly. Index: RubyCore.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** RubyCore.java 13 Nov 2005 15:47:08 -0000 1.25 --- RubyCore.java 19 Nov 2005 20:23:25 -0000 1.26 *************** *** 48,51 **** --- 48,52 ---- import org.rubypeople.rdt.internal.core.builder.RubyBuilder; import org.rubypeople.rdt.internal.core.parser.RubyParser; + import org.rubypeople.rdt.internal.core.symbols.ISymbolFinder; import org.rubypeople.rdt.internal.core.symbols.SymbolIndex; *************** *** 475,478 **** --- 476,483 ---- public SymbolIndex getSymbolIndex() { return symbolIndex; + } + + public ISymbolFinder getSymbolFinder() { + return symbolIndex; } } \ No newline at end of file |
|
From: David C. <dc...@us...> - 2005-11-19 20:23:29
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22199/src/org/rubypeople/rdt/internal/ui/search Modified Files: RubySearchQuery.java Log Message: Introduce ISymbolFinder, and change SymbolIndex clients accordingly. Index: RubySearchQuery.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchQuery.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubySearchQuery.java 24 Oct 2005 22:57:42 -0000 1.3 --- RubySearchQuery.java 19 Nov 2005 20:23:21 -0000 1.4 *************** *** 65,69 **** public IStatus run(IProgressMonitor monitor) throws OperationCanceledException { ! Set entries = RubyCore.getPlugin().getSymbolIndex().find(fSearchString, fSymbolType ); for (Iterator iter = entries.iterator(); iter.hasNext();) { --- 65,69 ---- public IStatus run(IProgressMonitor monitor) throws OperationCanceledException { ! Set entries = RubyCore.getPlugin().getSymbolFinder().find(fSearchString, fSymbolType ); for (Iterator iter = entries.iterator(); iter.hasNext();) { |
|
From: David C. <dc...@us...> - 2005-11-18 22:46:17
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14686/src/org/rubypeople/rdt/testunit/views Modified Files: TestHierarchyTab.java FailureTab.java Added Files: OpenSymbolAction.java Removed Files: OpenClassAction.java Log Message: Fleshed out all the "open" menus and double-clicks for the Test::Unit view. --- OpenClassAction.java DELETED --- Index: FailureTab.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views/FailureTab.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FailureTab.java 18 Nov 2005 21:56:10 -0000 1.7 --- FailureTab.java 18 Nov 2005 22:46:09 -0000 1.8 *************** *** 54,58 **** private final Image fFailureIcon = TestUnitView.createImage("obj16/testfail.gif"); //$NON-NLS-1$ private final Image fFailureTabIcon = TestUnitView.createImage("obj16/failures.gif"); //$NON-NLS-1$ - private Shell shell; public FailureTab() {} --- 54,57 ---- *************** *** 153,157 **** String methodName = getMethodName(); if (className != null) { ! manager.add(new OpenClassAction(getShell(), className, getSymbolIndex())); manager.add(new Separator()); manager.add(new RerunAction(fRunnerViewPart, getSelectedTestId(), --- 152,156 ---- String methodName = getMethodName(); if (className != null) { ! manager.add(OpenSymbolAction.forClass(className, getSymbolIndex(), getShell())); manager.add(new Separator()); manager.add(new RerunAction(fRunnerViewPart, getSelectedTestId(), *************** *** 276,282 **** void handleDoubleClick(MouseEvent e) { - shell = getShell(); if (fTable.getSelectionCount() > 0) ! new OpenClassAction(shell, getClassName(), getSymbolIndex()).run(); } --- 275,280 ---- void handleDoubleClick(MouseEvent e) { if (fTable.getSelectionCount() > 0) ! OpenSymbolAction.forClass(getClassName(), getSymbolIndex(), getShell()).run(); } Index: TestHierarchyTab.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views/TestHierarchyTab.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestHierarchyTab.java 18 Jan 2005 21:56:22 -0000 1.3 --- TestHierarchyTab.java 18 Nov 2005 22:46:09 -0000 1.4 *************** *** 22,25 **** --- 22,26 ---- import org.eclipse.debug.core.ILaunchManager; import org.eclipse.jface.action.Action; + import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; *************** *** 41,46 **** --- 42,51 ---- import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Menu; + import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; + import org.rubypeople.rdt.core.RubyCore; + import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; + import org.rubypeople.rdt.internal.core.symbols.SymbolIndex; import org.rubypeople.rdt.testunit.ITestRunListener; *************** *** 402,422 **** void handleDoubleClick(MouseEvent e) { ! // TODO Fix and enable OpenTestAction ! // TestRunInfo testInfo= getTestInfo(); ! // ! // if (testInfo == null) ! // return; ! // ! // String testLabel= testInfo.getTestName(); ! // OpenTestAction action= null; ! // ! // if (isSuiteSelected()) ! // action= new OpenTestAction(fTestRunnerPart, testLabel); ! // else ! // action= new OpenTestAction(fTestRunnerPart, getClassName(), ! // getTestMethod()); ! // ! // if (action != null && action.isEnabled()) ! // action.run(); } --- 407,427 ---- void handleDoubleClick(MouseEvent e) { ! TestRunInfo testInfo= getTestInfo(); ! ! if (testInfo == null) ! return; ! ! String testLabel= testInfo.getTestName(); ! IAction action = null; ! ! Shell shell = fTree.getShell(); ! SymbolIndex index = RubyCore.getPlugin().getSymbolIndex(); ! if (isSuiteSelected()) ! action= OpenSymbolAction.forClass(getClassName(), index, shell); ! else ! action= OpenSymbolAction.forMethod(getClassName(), getTestMethod(), index, shell); ! ! if (action != null && action.isEnabled()) ! action.run(); } *************** *** 426,432 **** TestRunInfo testInfo = (TestRunInfo) treeItem.getData(); String testLabel = testInfo.getTestName(); if (isSuiteSelected()) { ! // TODO Re-enable OpenTestAction ! //manager.add(new OpenTestAction(fTestRunnerPart, testLabel)); manager.add(new Separator()); if (testClassExists(getClassName()) && !fTestRunnerPart.lastLaunchIsKeptAlive()) { --- 431,438 ---- TestRunInfo testInfo = (TestRunInfo) treeItem.getData(); String testLabel = testInfo.getTestName(); + Shell shell = fTree.getShell(); + SymbolIndex symbolIndex = RubyCore.getPlugin().getSymbolIndex(); if (isSuiteSelected()) { ! manager.add(OpenSymbolAction.forClass(getClassName(), symbolIndex, shell)); manager.add(new Separator()); if (testClassExists(getClassName()) && !fTestRunnerPart.lastLaunchIsKeptAlive()) { *************** *** 435,440 **** } } else { ! //manager.add(new OpenTestAction(fTestRunnerPart, ! // getClassName(), getTestMethod())); manager.add(new Separator()); manager.add(new RerunAction(fTestRunnerPart, getSelectedTestId(), getClassName(), getTestMethod(), ILaunchManager.RUN_MODE)); --- 441,446 ---- } } else { ! manager.add(OpenSymbolAction.forMethod(getClassName(), ! getTestMethod(), symbolIndex, shell)); manager.add(new Separator()); manager.add(new RerunAction(fTestRunnerPart, getSelectedTestId(), getClassName(), getTestMethod(), ILaunchManager.RUN_MODE)); *************** *** 447,460 **** private boolean testClassExists(String className) { ! // TODO Fix / clean up ! // IJavaProject project= fTestRunnerPart.getLaunchedProject(); ! // try { ! // IType type= project.findType(className); ! // return type != null; ! // } catch (JavaModelException e) { ! // // fall through ! // } ! // return false; ! return true; } --- 453,457 ---- private boolean testClassExists(String className) { ! return RubyCore.getPlugin().getSymbolIndex().find(new ClassSymbol(className)).size() > 0; } --- NEW FILE: OpenSymbolAction.java --- package org.rubypeople.rdt.testunit.views; import java.util.Set; import org.eclipse.core.resources.IFile; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; import org.rubypeople.rdt.internal.core.symbols.Location; import org.rubypeople.rdt.internal.core.symbols.MethodSymbol; import org.rubypeople.rdt.internal.core.symbols.Symbol; import org.rubypeople.rdt.internal.core.symbols.SymbolIndex; import org.rubypeople.rdt.internal.ui.RubyPluginImages; import org.rubypeople.rdt.internal.ui.dialogs.ElementListSelectionDialog; import org.rubypeople.rdt.internal.ui.util.PositionBasedEditorOpener; public class OpenSymbolAction extends Action implements IAction { private final Symbol symbol; private final SymbolIndex index; private final Shell shell; private String dialogTitle; public static IAction forClass(String className, SymbolIndex index, Shell shell) { return new OpenSymbolAction(new ClassSymbol(className), index, shell, "Open Class"); } public static IAction forMethod(String className, String testMethod, SymbolIndex index, Shell shell) { return new OpenSymbolAction(new MethodSymbol(className, testMethod), index, shell, "Open Method"); } public OpenSymbolAction(Symbol symbol, SymbolIndex index, Shell shell, String title) { super(TestUnitMessages.getString("OpenEditor.action.label")); this.shell = shell; this.symbol = symbol; this.index = index; this.dialogTitle = title; } public void run() { Set locations = index.find(symbol); if (locations.size() == 0) return; Location location; if (locations.size() == 1) { location = (Location) locations.iterator().next(); } else { ElementListSelectionDialog selectionDialog = new ElementListSelectionDialog(shell, new LocationLabel()); selectionDialog.setElements(locations.toArray()); selectionDialog.setMessage("Select a location"); selectionDialog.setTitle(dialogTitle); selectionDialog.open(); if (selectionDialog.getReturnCode() == SWT.CANCEL) return; location= (Location) selectionDialog.getResult()[0]; } PositionBasedEditorOpener editorOpener = new PositionBasedEditorOpener(location.getFilename(), location.getPosition()); editorOpener.open(); } private final class LocationLabel implements ILabelProvider { public Image getImage(Object element) { return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_PAGE); } public String getText(Object element) { Location location = (Location) element; IFile sourceFile = location.getSourceFile(); return sourceFile.getName() + ":" + location.getPosition().getStartLine() + " - " + sourceFile.getFullPath().removeLastSegments(1); } public void addListener(ILabelProviderListener listener) { } public void dispose() { } public boolean isLabelProperty(Object element, String property) { return false; } public void removeListener(ILabelProviderListener listener) { } } } |
|
From: David C. <dc...@us...> - 2005-11-18 22:46:12
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14656/src/org/rubypeople/rdt/internal/core/symbols Modified Files: MethodSymbol.java Log Message: Fleshed out all the "open" menus and double-clicks for the Test::Unit view. Index: MethodSymbol.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols/MethodSymbol.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodSymbol.java 23 Oct 2005 22:24:27 -0000 1.1 --- MethodSymbol.java 18 Nov 2005 22:46:05 -0000 1.2 *************** *** 8,12 **** } ! public String toString() { return "Method [" + this.getName() + "]"; } --- 8,16 ---- } ! public MethodSymbol(String className, String methodName) { ! this(className + "::" + methodName); ! } ! ! public String toString() { return "Method [" + this.getName() + "]"; } |
|
From: David C. <dc...@us...> - 2005-11-18 21:56:22
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3016/src/org/rubypeople/rdt/testunit/views Modified Files: OpenClassAction.java FailureTab.java Added Files: OpenLocationAction.java Log Message: Handle multiple class definitions when opening Class. Index: OpenClassAction.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views/OpenClassAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpenClassAction.java 13 Oct 2005 01:00:27 -0000 1.1 --- OpenClassAction.java 18 Nov 2005 21:56:10 -0000 1.2 *************** *** 3,11 **** --- 3,19 ---- import java.util.Set; + import org.eclipse.core.resources.IFile; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; + import org.eclipse.jface.viewers.ILabelProvider; + import org.eclipse.jface.viewers.ILabelProviderListener; + import org.eclipse.swt.SWT; + import org.eclipse.swt.graphics.Image; + import org.eclipse.swt.widgets.Shell; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; import org.rubypeople.rdt.internal.core.symbols.Location; import org.rubypeople.rdt.internal.core.symbols.SymbolIndex; + import org.rubypeople.rdt.internal.ui.RubyPluginImages; + import org.rubypeople.rdt.internal.ui.dialogs.ElementListSelectionDialog; import org.rubypeople.rdt.internal.ui.util.PositionBasedEditorOpener; *************** *** 13,21 **** public class OpenClassAction extends Action implements IAction { private final String className; private final SymbolIndex index; ! public OpenClassAction(String className, SymbolIndex index) { super(TestUnitMessages.getString("OpenEditor.action.label")); this.className = className; this.index = index; --- 21,32 ---- public class OpenClassAction extends Action implements IAction { + private final String className; private final SymbolIndex index; + private final Shell shell; ! public OpenClassAction(Shell shell, String className, SymbolIndex index) { super(TestUnitMessages.getString("OpenEditor.action.label")); + this.shell = shell; this.className = className; this.index = index; *************** *** 24,35 **** public void run() { Set locations = index.find(new ClassSymbol(className)); if (locations.size() == 1) { ! Location location = (Location) locations.iterator().next(); ! new PositionBasedEditorOpener(location.getFilename(), location.getPosition()).open(); } else { ! System.out.println("Too many locations"); // DSC temporary } } } --- 35,85 ---- public void run() { Set locations = index.find(new ClassSymbol(className)); + Location location; if (locations.size() == 1) { ! location = (Location) locations.iterator().next(); } else { ! ElementListSelectionDialog selectionDialog ! = new ElementListSelectionDialog(shell, new LocationLabel()); ! selectionDialog.setElements(locations.toArray()); ! selectionDialog.setMessage("Select a location"); ! selectionDialog.setTitle("Open Class"); ! selectionDialog.open(); ! if (selectionDialog.getReturnCode() == SWT.CANCEL) ! return; ! location= (Location) selectionDialog.getResult()[0]; } + PositionBasedEditorOpener editorOpener + = new PositionBasedEditorOpener(location.getFilename(), + location.getPosition()); + editorOpener.open(); } + private final class LocationLabel implements ILabelProvider { + public Image getImage(Object element) { + return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_PAGE); + } + + public String getText(Object element) { + Location location = (Location) element; + IFile sourceFile = location.getSourceFile(); + return sourceFile.getName() + " - " + sourceFile.getFullPath().removeLastSegments(1); + } + + public void addListener(ILabelProviderListener listener) { + } + + public void dispose() { + } + + public boolean isLabelProperty(Object element, String property) { + // TODO Auto-generated method stub + return false; + } + + public void removeListener(ILabelProviderListener listener) { + // TODO Auto-generated method stub + + } + } } --- NEW FILE: OpenLocationAction.java --- package org.rubypeople.rdt.testunit.views; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.rubypeople.rdt.internal.core.symbols.Location; import org.rubypeople.rdt.internal.ui.util.PositionBasedEditorOpener; public class OpenLocationAction extends Action implements IAction { private final Location location; public OpenLocationAction(Location location) { super(location.getFilename()); this.location = location; } public void run() { new PositionBasedEditorOpener(location.getFilename(), location.getPosition()).open(); } } Index: FailureTab.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/views/FailureTab.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FailureTab.java 13 Oct 2005 01:00:27 -0000 1.6 --- FailureTab.java 18 Nov 2005 21:56:10 -0000 1.7 *************** *** 35,38 **** --- 35,39 ---- import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Menu; + import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; *************** *** 53,56 **** --- 54,58 ---- private final Image fFailureIcon = TestUnitView.createImage("obj16/testfail.gif"); //$NON-NLS-1$ private final Image fFailureTabIcon = TestUnitView.createImage("obj16/failures.gif"); //$NON-NLS-1$ + private Shell shell; public FailureTab() {} *************** *** 149,156 **** if (fTable.getSelectionCount() > 0) { String className = getClassName(); - System.out.println(className); String methodName = getMethodName(); if (className != null) { ! manager.add(new OpenClassAction(className, getSymbolIndex())); manager.add(new Separator()); manager.add(new RerunAction(fRunnerViewPart, getSelectedTestId(), --- 151,157 ---- if (fTable.getSelectionCount() > 0) { String className = getClassName(); String methodName = getMethodName(); if (className != null) { ! manager.add(new OpenClassAction(getShell(), className, getSymbolIndex())); manager.add(new Separator()); manager.add(new RerunAction(fRunnerViewPart, getSelectedTestId(), *************** *** 275,282 **** void handleDoubleClick(MouseEvent e) { ! if (fTable.getSelectionCount() > 0) ! new OpenClassAction(getClassName(), getSymbolIndex()).run(); } /* * @see ITestRunView#testStatusChanged(TestRunInfo) --- 276,288 ---- void handleDoubleClick(MouseEvent e) { ! shell = getShell(); ! if (fTable.getSelectionCount() > 0) ! new OpenClassAction(shell, getClassName(), getSymbolIndex()).run(); } + private Shell getShell() { + return fTable.getShell(); + } + /* * @see ITestRunView#testStatusChanged(TestRunInfo) |
|
From: Markus B. <mba...@us...> - 2005-11-13 16:41:15
|
Update of /cvsroot/rubyeclipse/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14105 Modified Files: modules Log Message: added rdt-all module for CruiseControl Index: modules =================================================================== RCS file: /cvsroot/rubyeclipse/CVSROOT/modules,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** modules 1 Apr 2002 21:12:09 -0000 1.1 --- modules 13 Nov 2005 16:41:08 -0000 1.2 *************** *** 25,26 **** --- 25,33 ---- # can be useful for creating a module that consists of many directories # spread out over the entire source repository. + + # rdt-all lists all feature and plug-in modules which are needed to compile rdt + # which are essentially all modules with the exception of org.jruby (not used anymore) + # and org.rubypeople.rdt.webpage + # It is used from CruiseControl: With 'cvs rlog rdt-all' it queries for + # modified files + rdt-all -a org.kxml2 org.rubypeople.eclipse.shams org.rubypeople.eclipse.testutils org.rubypeople.rdt org.rubypeople.rdt.build org.rubypeople.rdt.core org.rubypeople.rdt.core.tests org.rubypeople.rdt.debug.core org.rubypeople.rdt.debug.core.tests org.rubypeople.rdt.debug.ui org.rubypeople.rdt.debug.ui.tests org.rubypeople.rdt.doc.user org.rubypeople.rdt.launching org.rubypeople.rdt.launching.tests org.rubypeople.rdt.tests.all org.rubypeople.rdt.testunit org.rubypeople.rdt.ui org.rubypeople.rdt.ui.tests org.rubypeople.rdt-feature org.rubypeople.updatesite \ No newline at end of file |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:16
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5103/src/org/rubypeople/rdt/internal/core Modified Files: SymbolIndexResourceChangeListener.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. Index: SymbolIndexResourceChangeListener.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SymbolIndexResourceChangeListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SymbolIndexResourceChangeListener.java 23 Oct 2005 00:03:16 -0000 1.2 --- SymbolIndexResourceChangeListener.java 13 Nov 2005 15:47:08 -0000 1.3 *************** *** 23,30 **** --- 23,34 ---- import org.rubypeople.rdt.internal.core.builder.IndexUpdater; import org.rubypeople.rdt.internal.core.builder.MassIndexUpdater; + import org.rubypeople.rdt.internal.core.builder.MassIndexUpdaterJob; import org.rubypeople.rdt.internal.core.symbols.SymbolIndex; + import org.rubypeople.rdt.internal.core.util.EclipseJobScheduler; + import org.rubypeople.rdt.internal.core.util.IJobScheduler; public final class SymbolIndexResourceChangeListener implements IResourceChangeListener { private final MassIndexUpdater updater; + private final IJobScheduler scheduler; public static void register(SymbolIndex symbolIndex) { *************** *** 32,41 **** MassIndexUpdater massIndexUpdater = new MassIndexUpdater(indexUpdater); SymbolIndexResourceChangeListener listener ! = new SymbolIndexResourceChangeListener(massIndexUpdater); ResourcesPlugin.getWorkspace().addResourceChangeListener(listener); } ! public SymbolIndexResourceChangeListener(MassIndexUpdater updater) { this.updater = updater; } --- 36,46 ---- MassIndexUpdater massIndexUpdater = new MassIndexUpdater(indexUpdater); SymbolIndexResourceChangeListener listener ! = new SymbolIndexResourceChangeListener(massIndexUpdater, new EclipseJobScheduler()); ResourcesPlugin.getWorkspace().addResourceChangeListener(listener); } ! public SymbolIndexResourceChangeListener(MassIndexUpdater updater, IJobScheduler scheduler) { this.updater = updater; + this.scheduler = scheduler; } *************** *** 56,61 **** } } ! if (!projects.isEmpty()) ! updater.updateProjects(projects); } --- 61,65 ---- } } ! scheduler.schedule(new MassIndexUpdaterJob(updater, projects)); } |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:16
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5103/src/org/rubypeople/rdt/core Modified Files: RubyCore.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. Index: RubyCore.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** RubyCore.java 12 Nov 2005 19:15:59 -0000 1.24 --- RubyCore.java 13 Nov 2005 15:47:08 -0000 1.25 *************** *** 13,16 **** --- 13,17 ---- import java.io.File; import java.util.ArrayList; + import java.util.Arrays; import java.util.List; *************** *** 44,48 **** import org.rubypeople.rdt.internal.core.SymbolIndexResourceChangeListener; import org.rubypeople.rdt.internal.core.builder.IndexUpdater; ! import org.rubypeople.rdt.internal.core.builder.MassIndexUpdater; import org.rubypeople.rdt.internal.core.builder.RubyBuilder; import org.rubypeople.rdt.internal.core.parser.RubyParser; --- 45,49 ---- import org.rubypeople.rdt.internal.core.SymbolIndexResourceChangeListener; import org.rubypeople.rdt.internal.core.builder.IndexUpdater; ! import org.rubypeople.rdt.internal.core.builder.MassIndexUpdaterJob; import org.rubypeople.rdt.internal.core.builder.RubyBuilder; import org.rubypeople.rdt.internal.core.parser.RubyParser; *************** *** 219,226 **** SymbolIndexResourceChangeListener.register(symbolIndex); IndexUpdater indexUpdater = new IndexUpdater(symbolIndex); ! MassIndexUpdater massUpdater = new MassIndexUpdater(indexUpdater); ! // TODO: move away from start method: long running, syntax errors can occur ! //massUpdater.updateProjects(Arrays.asList(getRubyProjects())); ! } --- 220,226 ---- SymbolIndexResourceChangeListener.register(symbolIndex); IndexUpdater indexUpdater = new IndexUpdater(symbolIndex); ! List rubyProjects = Arrays.asList(getRubyProjects()); ! MassIndexUpdaterJob massUpdater = new MassIndexUpdaterJob(indexUpdater, rubyProjects); ! massUpdater.schedule(); } |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:15
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5103/src/org/rubypeople/rdt/internal/core/util Added Files: EclipseJobScheduler.java IJobScheduler.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. --- NEW FILE: EclipseJobScheduler.java --- /* * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.core.util; import org.eclipse.core.runtime.jobs.Job; public class EclipseJobScheduler implements IJobScheduler { public void schedule(Job job) { job.schedule(); } } --- NEW FILE: IJobScheduler.java --- /* * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.core.util; import org.eclipse.core.runtime.jobs.Job; public interface IJobScheduler { public void schedule(Job job); } |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:15
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5103/src/org/rubypeople/rdt/internal/core/builder Modified Files: MassIndexUpdater.java Added Files: MassIndexUpdaterJob.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. --- NEW FILE: MassIndexUpdaterJob.java --- /* * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.core.builder; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; public class MassIndexUpdaterJob extends Job { private final List rubyProjects; private MassIndexUpdater massIndexUpdater; public MassIndexUpdaterJob(IndexUpdater indexUpdater, List rubyProjects) { this(new MassIndexUpdater(indexUpdater), rubyProjects); } public MassIndexUpdaterJob(MassIndexUpdater massIndexUpdater, List rubyProjects) { super("Mass Index Update"); this.massIndexUpdater = massIndexUpdater; this.rubyProjects = rubyProjects; } protected IStatus run(IProgressMonitor monitor) { massIndexUpdater.updateProjects(rubyProjects); return Status.OK_STATUS; } public boolean equals(Object obj) { if (!(obj instanceof MassIndexUpdaterJob)) return false; MassIndexUpdaterJob that = (MassIndexUpdaterJob) obj; return this.rubyProjects.equals(that.rubyProjects) && massIndexUpdater.equals(massIndexUpdater); } public int hashCode() { return 0; } } Index: MassIndexUpdater.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/MassIndexUpdater.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MassIndexUpdater.java 13 Nov 2005 13:05:12 -0000 1.4 --- MassIndexUpdater.java 13 Nov 2005 15:47:08 -0000 1.5 *************** *** 73,75 **** --- 73,88 ---- return files; } + + public boolean equals(Object obj) { + if (!(obj instanceof MassIndexUpdater)) + return false; + + MassIndexUpdater that = (MassIndexUpdater) obj; + return updater.getClass().equals(that.updater.getClass()) + && parser.getClass().equals(that.parser); + } + + public int hashCode() { + return 0; + } } |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:11
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5059/src/org/rubypeople/rdt/internal/core Modified Files: ShamMassIndexUpdater.java TC_SymbolIndexResourceEventListener.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. Index: TC_SymbolIndexResourceEventListener.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_SymbolIndexResourceEventListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TC_SymbolIndexResourceEventListener.java 12 Nov 2005 19:15:53 -0000 1.4 --- TC_SymbolIndexResourceEventListener.java 13 Nov 2005 15:47:03 -0000 1.5 *************** *** 11,14 **** --- 11,17 ---- package org.rubypeople.rdt.internal.core; + import java.util.ArrayList; + import java.util.List; + import junit.framework.TestCase; *************** *** 19,23 **** --- 22,28 ---- import org.rubypeople.eclipse.shams.resources.ShamProject; import org.rubypeople.eclipse.shams.resources.ShamResource; + import org.rubypeople.rdt.internal.core.builder.MassIndexUpdaterJob; import org.rubypeople.rdt.internal.core.util.ListUtil; + import org.rubypeople.rdt.internal.core.util.ShamJobScheduler; public class TC_SymbolIndexResourceEventListener extends TestCase { *************** *** 27,34 **** private ShamResourceDelta parentDelta; private ShamResource resource; public void setUp() { massIndexUpdater = new ShamMassIndexUpdater(); ! listener = new SymbolIndexResourceChangeListener(massIndexUpdater); project = new ShamProject("test1"); resource = new ShamResource(new Path("test1/file1")); --- 32,41 ---- private ShamResourceDelta parentDelta; private ShamResource resource; + private ShamJobScheduler jobScheduler; public void setUp() { + jobScheduler = new ShamJobScheduler(); massIndexUpdater = new ShamMassIndexUpdater(); ! listener = new SymbolIndexResourceChangeListener(massIndexUpdater, jobScheduler); project = new ShamProject("test1"); resource = new ShamResource(new Path("test1/file1")); *************** *** 44,48 **** listener.resourceChanged(event); ! massIndexUpdater.assertProjectsUpdated(ListUtil.create(project)); } --- 51,56 ---- listener.resourceChanged(event); ! ArrayList rubyProjects = ListUtil.create(project); ! jobScheduler.assertScheduled(new MassIndexUpdaterJob(massIndexUpdater, rubyProjects)); } *************** *** 57,61 **** listener.resourceChanged(event); ! massIndexUpdater.assertProjectsUpdated(ListUtil.create(project, project2)); } --- 65,70 ---- listener.resourceChanged(event); ! List rubyProjects = ListUtil.create(project, project2); ! jobScheduler.assertScheduled(new MassIndexUpdaterJob(massIndexUpdater, rubyProjects)); } Index: ShamMassIndexUpdater.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/ShamMassIndexUpdater.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ShamMassIndexUpdater.java 19 Oct 2005 00:33:05 -0000 1.1 --- ShamMassIndexUpdater.java 13 Nov 2005 15:47:03 -0000 1.2 *************** *** 39,42 **** --- 39,46 ---- } + public boolean equals(Object obj) { + return this == obj; + } + } |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:11
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5059/src/org/rubypeople/rdt/internal/core/builder Modified Files: TS_InternalCoreBuilder.java Added Files: TC_MassIndexUpdaterJob.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. Index: TS_InternalCoreBuilder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TS_InternalCoreBuilder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TS_InternalCoreBuilder.java 12 Nov 2005 19:15:53 -0000 1.2 --- TS_InternalCoreBuilder.java 13 Nov 2005 15:47:03 -0000 1.3 *************** *** 25,28 **** --- 25,29 ---- suite.addTestSuite(TC_CleanRdtCompiler.class); suite.addTestSuite(TC_IncrementalRdtCompiler.class); + suite.addTestSuite(TC_MassIndexUpdaterJob.class); return suite; --- NEW FILE: TC_MassIndexUpdaterJob.java --- /* * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.core.builder; import org.rubypeople.eclipse.shams.resources.ShamProject; import org.rubypeople.rdt.internal.core.ShamMassIndexUpdater; import org.rubypeople.rdt.internal.core.util.ListUtil; import junit.framework.TestCase; public class TC_MassIndexUpdaterJob extends TestCase { public void testJob() throws Exception { ShamMassIndexUpdater massIndexUpdater = new ShamMassIndexUpdater(); ShamProject project = new ShamProject("test1"); MassIndexUpdaterJob job = new MassIndexUpdaterJob(massIndexUpdater, ListUtil.create(project)); job.schedule(); job.join(); massIndexUpdater.assertProjectsUpdated(ListUtil.create(project)); } } |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:11
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/symbols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5059/src/org/rubypeople/rdt/internal/core/symbols Modified Files: TS_CoreSymbols.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. Index: TS_CoreSymbols.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/symbols/TS_CoreSymbols.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TS_CoreSymbols.java 13 Oct 2005 23:56:02 -0000 1.2 --- TS_CoreSymbols.java 13 Nov 2005 15:47:03 -0000 1.3 *************** *** 1,12 **** /* ! ?* Author: David Corbin ! ?* ! ?* Copyright (c) 2005 RubyPeople. ! ?* ! ?* This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. ! ?*/ package org.rubypeople.rdt.internal.core.symbols; --- 1,12 ---- /* ! * Author: David Corbin ! * ! * Copyright (c) 2005 RubyPeople. ! * ! * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. ! */ package org.rubypeople.rdt.internal.core.symbols; |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:11
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5059/src/org/rubypeople/rdt/internal/core/util Added Files: ShamJobScheduler.java TS_Util.java TC_EclipseJobScheduler.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. --- NEW FILE: TS_Util.java --- /* * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.core.util; import junit.framework.Test; import junit.framework.TestSuite; public class TS_Util extends TestSuite { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTestSuite(TC_EclipseJobScheduler.class); return suite; } } --- NEW FILE: TC_EclipseJobScheduler.java --- /* * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.core.util; import junit.framework.Assert; import junit.framework.TestCase; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; public class TC_EclipseJobScheduler extends TestCase { public void testSchedule() throws Exception { TestJob job = new TestJob(); EclipseJobScheduler scheduler = new EclipseJobScheduler(); scheduler.schedule(job); job.join(); job.assertRun(); } private static class TestJob extends Job { public TestJob() { super("test Job"); } private boolean ran; protected IStatus run(IProgressMonitor monitor) { ran = true; return Status.OK_STATUS; } public void assertRun() { Assert.assertTrue("expected to Run", ran); } } } --- NEW FILE: ShamJobScheduler.java --- /* * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.core.util; import java.util.ArrayList; import java.util.List; import junit.framework.Assert; import org.eclipse.core.runtime.jobs.Job; public class ShamJobScheduler implements IJobScheduler { private List scheduledJobs = new ArrayList(); public void assertScheduled(Job expectedJob) { Assert.assertTrue("Expected " + expectedJob + " to be scheduled", scheduledJobs.contains(expectedJob)); } public void schedule(Job job) { scheduledJobs.add(job); } } |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:10
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5059/src/org/rubypeople/rdt/core Modified Files: TS_Core.java Log Message: Scan project SymbolIndex on startup/project open asynchronously. Index: TS_Core.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/TS_Core.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TS_Core.java 16 Oct 2005 23:52:44 -0000 1.1 --- TS_Core.java 13 Nov 2005 15:47:03 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- import org.rubypeople.rdt.internal.core.parser.TS_InternalCoreParser; import org.rubypeople.rdt.internal.core.symbols.TS_CoreSymbols; + import org.rubypeople.rdt.internal.core.util.TS_Util; import org.rubypeople.rdt.internal.formatter.TS_InternalFormatter; *************** *** 30,33 **** --- 31,35 ---- suite.addTest(TS_InternalCore.suite()); suite.addTest(TS_InternalFormatter.suite()); + suite.addTest(TS_Util.suite()); return suite; |
|
From: David C. <dc...@us...> - 2005-11-13 15:47:05
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5040/src/org/rubypeople/rdt/internal/core/util Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/util added to the repository |
|
From: David C. <dc...@us...> - 2005-11-13 13:06:01
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7286/src/org/rubypeople/rdt/internal/core/builder Modified Files: IncrementalRdtCompiler.java Log Message: Optimize complation process so SymbolIndex is not flushed twice for each file. Index: IncrementalRdtCompiler.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IncrementalRdtCompiler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IncrementalRdtCompiler.java 13 Nov 2005 13:05:12 -0000 1.2 --- IncrementalRdtCompiler.java 13 Nov 2005 13:05:52 -0000 1.3 *************** *** 14,18 **** import org.rubypeople.rdt.internal.core.util.Util; - // DSC don't flush index files or don't do it in IndexUpdater public class IncrementalRdtCompiler extends AbstractRdtCompiler { --- 14,17 ---- |
|
From: David C. <dc...@us...> - 2005-11-13 13:05:23
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7083/src/org/rubypeople/rdt/internal/ui/search Modified Files: RubySearchPage.java RubySearchResultPage.java Log Message: Optimize complation process so SymbolIndex is not flushed twice for each file. Index: RubySearchResultPage.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchResultPage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubySearchResultPage.java 12 Nov 2005 19:16:03 -0000 1.3 --- RubySearchResultPage.java 13 Nov 2005 13:05:16 -0000 1.4 *************** *** 15,19 **** import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; - import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.viewers.DecoratingLabelProvider; --- 15,18 ---- Index: RubySearchPage.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubySearchPage.java 24 Oct 2005 22:57:42 -0000 1.3 --- RubySearchPage.java 13 Nov 2005 13:05:16 -0000 1.4 *************** *** 42,49 **** import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; - import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; - import org.eclipse.swt.widgets.Listener; import org.eclipse.ui.IWorkingSet; import org.eclipse.ui.IWorkingSetManager; --- 42,47 ---- |
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7028/src/org/rubypeople/rdt/internal/core/builder Modified Files: IncrementalRdtCompiler.java MassIndexUpdater.java RubyCodeAnalyzer.java IndexUpdater.java Log Message: Optimize complation process so SymbolIndex is not flushed twice for each file. Index: RubyCodeAnalyzer.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubyCodeAnalyzer.java 12 Nov 2005 19:15:58 -0000 1.1 --- RubyCodeAnalyzer.java 13 Nov 2005 13:05:12 -0000 1.2 *************** *** 43,47 **** try { Node rootNode = parser.parse(file, reader); ! indexUpdater.update(file, rootNode); } catch (SyntaxException e) { markerManager.createSyntaxError(file, e); --- 43,47 ---- try { Node rootNode = parser.parse(file, reader); ! indexUpdater.update(file, rootNode, true); } catch (SyntaxException e) { markerManager.createSyntaxError(file, e); Index: IndexUpdater.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IndexUpdater.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IndexUpdater.java 12 Nov 2005 19:15:58 -0000 1.8 --- IndexUpdater.java 13 Nov 2005 13:05:12 -0000 1.9 *************** *** 35,40 **** ! public void update(IFile file, Node rootNode) { ! index.flush(file); processNode(file, rootNode); } --- 35,41 ---- ! public void update(IFile file, Node rootNode, boolean skipFlush) { ! if (!skipFlush) ! index.flush(file); processNode(file, rootNode); } Index: IncrementalRdtCompiler.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IncrementalRdtCompiler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IncrementalRdtCompiler.java 12 Nov 2005 19:15:58 -0000 1.1 --- IncrementalRdtCompiler.java 13 Nov 2005 13:05:12 -0000 1.2 *************** *** 14,17 **** --- 14,18 ---- import org.rubypeople.rdt.internal.core.util.Util; + // DSC don't flush index files or don't do it in IndexUpdater public class IncrementalRdtCompiler extends AbstractRdtCompiler { Index: MassIndexUpdater.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/MassIndexUpdater.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MassIndexUpdater.java 23 Oct 2005 22:24:27 -0000 1.3 --- MassIndexUpdater.java 13 Nov 2005 13:05:12 -0000 1.4 *************** *** 55,59 **** try { Node node = parser.parse(file); ! updater.update(file, node); } catch (CoreException e) { RubyCore.log(e); --- 55,59 ---- try { Node node = parser.parse(file); ! updater.update(file, node, false); } catch (CoreException e) { RubyCore.log(e); |
|
From: David C. <dc...@us...> - 2005-11-13 13:05:19
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7028/src/org/rubypeople/rdt/internal/core/symbols Modified Files: SymbolIndex.java Location.java Log Message: Optimize complation process so SymbolIndex is not flushed twice for each file. Index: Location.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols/Location.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Location.java 12 Nov 2005 19:15:59 -0000 1.5 --- Location.java 13 Nov 2005 13:05:12 -0000 1.6 *************** *** 26,30 **** public String toString() { ! return sourceFile+": " + position; } --- 26,30 ---- public String toString() { ! return sourceFile.getFullPath() + ": " + position; } Index: SymbolIndex.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols/SymbolIndex.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SymbolIndex.java 12 Nov 2005 19:15:59 -0000 1.9 --- SymbolIndex.java 13 Nov 2005 13:05:12 -0000 1.10 *************** *** 82,86 **** public void flush(IFile fileToFlush) { if (verbose) ! log("Flushing all Symbols with path: " + fileToFlush) ; flush(new PathEqualsPredicate(fileToFlush)); --- 82,86 ---- public void flush(IFile fileToFlush) { if (verbose) ! log("Flushing all Symbols with path: " + fileToFlush.getFullPath()) ; flush(new PathEqualsPredicate(fileToFlush)); *************** *** 104,108 **** public void flush(IProject project) { if (verbose) ! log("Flushing all Symbols for project: " + project) ; flush(new ContainedByProject(project)); --- 104,108 ---- public void flush(IProject project) { if (verbose) ! log("Flushing all Symbols for project: " + project.getName()) ; flush(new ContainedByProject(project)); |
|
From: David C. <dc...@us...> - 2005-11-13 13:05:14
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7002/src/org/rubypeople/rdt/internal/core/builder Modified Files: TC_MassIndexUpdater.java TC_IncrementalRdtCompiler.java TC_RubyCodeAnalyzer.java ShamSymbolIndex.java TC_IndexUpdater.java Added Files: ShamIndexUpdater.java Log Message: Optimize complation process so SymbolIndex is not flushed twice for each file. Index: TC_RubyCodeAnalyzer.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyCodeAnalyzer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TC_RubyCodeAnalyzer.java 12 Nov 2005 19:15:53 -0000 1.1 --- TC_RubyCodeAnalyzer.java 13 Nov 2005 13:05:07 -0000 1.2 *************** *** 16,20 **** import junit.framework.TestCase; - import org.eclipse.core.resources.IFile; import org.jruby.ast.Node; import org.jruby.ast.visitor.NodeVisitor; --- 16,19 ---- *************** *** 30,34 **** private ShamRubyParser parser; private RubyCodeAnalyzer compiler; ! private MockIndexUpdater indexUpdater; private Node rootNode; --- 29,33 ---- private ShamRubyParser parser; private RubyCodeAnalyzer compiler; ! private ShamIndexUpdater indexUpdater; private Node rootNode; *************** *** 48,52 **** parser = new ShamRubyParser(); parser.addParseResult(file, rootNode); ! indexUpdater = new MockIndexUpdater(); compiler = new RubyCodeAnalyzer(markerManager, parser, indexUpdater); } --- 47,51 ---- parser = new ShamRubyParser(); parser.addParseResult(file, rootNode); ! indexUpdater = new ShamIndexUpdater(); compiler = new RubyCodeAnalyzer(markerManager, parser, indexUpdater); } *************** *** 57,61 **** parser.assertParsed(file, FILE_CONTENTS); file.assertContentStreamClosed(); ! indexUpdater.assertUpdated(file, rootNode); } --- 56,60 ---- parser.assertParsed(file, FILE_CONTENTS); file.assertContentStreamClosed(); ! indexUpdater.assertUpdated(file, rootNode, true); } *************** *** 70,93 **** markerManager.assertErrorCreated(file, syntaxException); } - - private static final class MockIndexUpdater extends IndexUpdater { - - public MockIndexUpdater() { - super(null); - } - - private Node rootNodeArg; - private IFile fileArg; - - public void update(IFile file, Node rootNode) { - fileArg = file; - rootNodeArg = rootNode; - } - - public void assertUpdated(IFile expectedFile, Node expectedRootNode) { - assertEquals("File", expectedFile, fileArg); - assertEquals("Node", expectedRootNode, rootNodeArg); - } - } - } --- 69,71 ---- Index: TC_MassIndexUpdater.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TC_MassIndexUpdater.java 12 Nov 2005 19:15:53 -0000 1.3 --- TC_MassIndexUpdater.java 13 Nov 2005 13:05:07 -0000 1.4 *************** *** 12,23 **** import java.util.ArrayList; - import java.util.HashMap; import java.util.List; - import java.util.Map; import junit.framework.TestCase; - import org.eclipse.core.resources.IFile; - import org.jruby.ast.Node; import org.rubypeople.eclipse.shams.resources.ShamFile; import org.rubypeople.eclipse.shams.resources.ShamProject; --- 12,19 ---- *************** *** 61,86 **** parser.assertParsed(file3); ! updater.assertUpdated(file1, rootNode1); ! updater.assertUpdated(file2, rootNode2); ! updater.assertUpdated(file3, rootNode3); ! } ! ! private static class ShamIndexUpdater extends IndexUpdater { ! ! private Map updates = new HashMap(); ! ! public ShamIndexUpdater() { ! super(null); ! } ! ! public void assertUpdated(ShamFile expectedFile, ShamNode expectedNode) { ! assertTrue("Should have updated " + expectedFile, ! updates.containsKey(expectedFile)); ! assertEquals(expectedNode, updates.get(expectedFile)); ! } ! ! public void update(IFile file, Node rootNode) { ! updates.put(file, rootNode); ! } } } --- 57,63 ---- parser.assertParsed(file3); ! updater.assertUpdated(file1, rootNode1, false); ! updater.assertUpdated(file2, rootNode2, false); ! updater.assertUpdated(file3, rootNode3, false); } } Index: TC_IncrementalRdtCompiler.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IncrementalRdtCompiler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TC_IncrementalRdtCompiler.java 12 Nov 2005 19:15:53 -0000 1.1 --- TC_IncrementalRdtCompiler.java 13 Nov 2005 13:05:07 -0000 1.2 *************** *** 1,5 **** package org.rubypeople.rdt.internal.core.builder; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; --- 1,4 ---- Index: ShamSymbolIndex.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/ShamSymbolIndex.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ShamSymbolIndex.java 12 Nov 2005 19:15:53 -0000 1.3 --- ShamSymbolIndex.java 13 Nov 2005 13:05:07 -0000 1.4 *************** *** 20,23 **** --- 20,24 ---- import org.eclipse.core.resources.IProject; import org.jruby.lexer.yacc.ISourcePosition; + import org.rubypeople.eclipse.shams.resources.ShamFile; import org.rubypeople.eclipse.shams.resources.ShamProject; import org.rubypeople.rdt.internal.core.symbols.Symbol; *************** *** 70,72 **** --- 71,77 ---- } + public void assertNotFlushed(ShamFile file) { + Assert.assertEquals(false, flushedFiles.contains(file)); + } + } \ No newline at end of file Index: TC_IndexUpdater.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IndexUpdater.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TC_IndexUpdater.java 12 Nov 2005 19:15:53 -0000 1.6 --- TC_IndexUpdater.java 13 Nov 2005 13:05:07 -0000 1.7 *************** *** 43,47 **** public void testIrrelevantNodes() { Node node = new TrueNode(POSITION_1); ! updater.update(file, node); symbolIndex.assertFlushed(file); --- 43,47 ---- public void testIrrelevantNodes() { Node node = new TrueNode(POSITION_1); ! updater.update(file, node, false); symbolIndex.assertFlushed(file); *************** *** 52,56 **** Colon2Node nameNode = new Colon2Node(POSITION_1, null, TEST_CLASS_NAME); Node node = new ClassNode(POSITION_1, nameNode, null, null); ! updater.update(file, node); symbolIndex.assertFlushed(file); --- 52,56 ---- Colon2Node nameNode = new Colon2Node(POSITION_1, null, TEST_CLASS_NAME); Node node = new ClassNode(POSITION_1, nameNode, null, null); ! updater.update(file, node, false); symbolIndex.assertFlushed(file); *************** *** 58,65 **** } public void testWithTree() throws Exception { Node node = parseCode("if x\nclass Foo\nend\n end\n"); ! updater.update(file,node); symbolIndex.assertFlushed(file); --- 58,74 ---- } + public void testSkippingFlush() { + Colon2Node nameNode = new Colon2Node(POSITION_1, null, TEST_CLASS_NAME); + Node node = new ClassNode(POSITION_1, nameNode, null, null); + updater.update(file, node, true); + + symbolIndex.assertNotFlushed(file); + symbolIndex.assertAdded(new ClassSymbol(TEST_CLASS_NAME), file, POSITION_1); + } + public void testWithTree() throws Exception { Node node = parseCode("if x\nclass Foo\nend\n end\n"); ! updater.update(file,node, false); symbolIndex.assertFlushed(file); *************** *** 70,74 **** Node node = parseCode("if x\nclass Foo::Bar\nend\n end\n"); ! updater.update(file,node); symbolIndex.assertFlushed(file); --- 79,83 ---- Node node = parseCode("if x\nclass Foo::Bar\nend\n end\n"); ! updater.update(file,node, false); symbolIndex.assertFlushed(file); *************** *** 79,83 **** Node node = parseCode("if x\nclass X::Foo::Bar\nend\n end\n"); ! updater.update(file,node); symbolIndex.assertFlushed(file); --- 88,92 ---- Node node = parseCode("if x\nclass X::Foo::Bar\nend\n end\n"); ! updater.update(file,node, false); symbolIndex.assertFlushed(file); *************** *** 88,92 **** Node node = parseCode("if x\nmodule Foo\nclass Bar\nend\n end\nend\n"); ! updater.update(file,node); symbolIndex.assertFlushed(file); --- 97,101 ---- Node node = parseCode("if x\nmodule Foo\nclass Bar\nend\n end\nend\n"); ! updater.update(file,node, false); symbolIndex.assertFlushed(file); *************** *** 97,101 **** Node node = parseCode("module Foo\nclass Bar\nclass InnerBar\nend\nend\nend\n"); ! updater.update(file,node); symbolIndex.assertFlushed(file); --- 106,110 ---- Node node = parseCode("module Foo\nclass Bar\nclass InnerBar\nend\nend\nend\n"); ! updater.update(file,node, false); symbolIndex.assertFlushed(file); *************** *** 106,110 **** Node node = parseCode("def method\nend") ; ! updater.update(file,node); symbolIndex.assertAdded(new MethodSymbol("method"), file, new RdtPosition(0, 1, 3, 12)); --- 115,119 ---- Node node = parseCode("def method\nend") ; ! updater.update(file,node, false); symbolIndex.assertAdded(new MethodSymbol("method"), file, new RdtPosition(0, 1, 3, 12)); *************** *** 114,118 **** Node node = parseCode("class Foo\ndef method\nend\nend") ; ! updater.update(file,node); symbolIndex.assertAdded(new MethodSymbol("Foo::method"), file, new RdtPosition(1, 2, 13, 24)); --- 123,127 ---- Node node = parseCode("class Foo\ndef method\nend\nend") ; ! updater.update(file,node, false); symbolIndex.assertAdded(new MethodSymbol("Foo::method"), file, new RdtPosition(1, 2, 13, 24)); --- NEW FILE: ShamIndexUpdater.java --- /** * */ package org.rubypeople.rdt.internal.core.builder; import java.util.HashMap; import java.util.List; import java.util.Map; import junit.framework.Assert; import org.eclipse.core.resources.IFile; import org.jruby.ast.Node; import org.rubypeople.rdt.internal.core.util.ListUtil; final class ShamIndexUpdater extends IndexUpdater { public ShamIndexUpdater() { super(null); } private Map updates = new HashMap(); public void update(IFile file, Node rootNode, boolean skipFlush) { updates.put(file, createArgList(rootNode, skipFlush)); } private List createArgList(Node rootNode, boolean skipFlush) { return ListUtil.create(rootNode, new Boolean(skipFlush)); } public void assertUpdated(IFile expectedFile, Node expectedRootNode, boolean expectedSkipFlush) { Object args = updates.get(expectedFile); Assert.assertNotNull(expectedFile + " should have been updated", args); Assert.assertEquals(createArgList(expectedRootNode, expectedSkipFlush), args); } } |
|
From: David C. <dc...@us...> - 2005-11-12 19:16:22
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25631/src/org/rubypeople/rdt/internal/ui/search Modified Files: TC_GroupByScopeStrategy.java TC_RubySearchTreeContentProvider.java Log Message: 1) refactored RubyBuilder again, this time with better unit tests. 2) refactored Location (and SymbolIndex) to be IFile based, rather than IPath based. 3) general improvement on maintainence of the SymbolIndex. Index: TC_RubySearchTreeContentProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/search/TC_RubySearchTreeContentProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TC_RubySearchTreeContentProvider.java 26 Oct 2005 21:55:03 -0000 1.2 --- TC_RubySearchTreeContentProvider.java 12 Nov 2005 19:16:11 -0000 1.3 *************** *** 13,18 **** ! import org.eclipse.core.runtime.Path; import org.eclipse.search.ui.text.Match; import org.rubypeople.rdt.internal.core.parser.RdtPosition; import org.rubypeople.rdt.internal.core.symbols.Location; --- 13,21 ---- ! import junit.framework.Assert; ! import junit.framework.TestCase; ! import org.eclipse.search.ui.text.Match; + import org.rubypeople.eclipse.shams.resources.ShamFile; import org.rubypeople.rdt.internal.core.parser.RdtPosition; import org.rubypeople.rdt.internal.core.symbols.Location; *************** *** 20,26 **** import org.rubypeople.rdt.internal.core.symbols.SearchResult; - import junit.framework.Assert; - import junit.framework.TestCase; - public class TC_RubySearchTreeContentProvider extends TestCase { --- 23,26 ---- *************** *** 35,39 **** } ! public void testGroupByPath() { // could be a MockSearchResult instead RubySearchResult rubyUISearchResult = new RubySearchResult(null); --- 35,39 ---- } ! public void testGroupByFIle() { // could be a MockSearchResult instead RubySearchResult rubyUISearchResult = new RubySearchResult(null); *************** *** 42,52 **** // initialize does not refresh the viewer, therefore elementsChanges is called here MethodSymbol methodSymbol = new MethodSymbol("myMethod") ; ! Path path = new Path("test") ; ! Location location = new Location(path,new RdtPosition(0,0,0,0)) ; SearchResult searchResult = new SearchResult(methodSymbol, location) ; rubyUISearchResult.addMatch(new Match(searchResult, Match.UNIT_CHARACTER, 0, 0)); rubySearchTreeContentProvider.elementsChanged(new Object[]{searchResult}) ; ! Assert.assertTrue(mockTreeViewer.isParentAdded(path)) ; } --- 42,52 ---- // initialize does not refresh the viewer, therefore elementsChanges is called here MethodSymbol methodSymbol = new MethodSymbol("myMethod") ; ! ShamFile file = new ShamFile("test") ; ! Location location = new Location(file,new RdtPosition(0,0,0,0)) ; SearchResult searchResult = new SearchResult(methodSymbol, location) ; rubyUISearchResult.addMatch(new Match(searchResult, Match.UNIT_CHARACTER, 0, 0)); rubySearchTreeContentProvider.elementsChanged(new Object[]{searchResult}) ; ! Assert.assertTrue(mockTreeViewer.isParentAdded(file)) ; } *************** *** 60,65 **** // initialize does not refresh the viewer, therefore elementsChanges is called here MethodSymbol methodSymbol = new MethodSymbol("myModule::myScope::myMethod") ; ! Path path = new Path("test") ; ! Location location = new Location(path,new RdtPosition(0,0,0,0)) ; SearchResult searchResult = new SearchResult(methodSymbol, location) ; rubyUISearchResult.addMatch(new Match(searchResult, Match.UNIT_CHARACTER, 0, 0)); --- 60,65 ---- // initialize does not refresh the viewer, therefore elementsChanges is called here MethodSymbol methodSymbol = new MethodSymbol("myModule::myScope::myMethod") ; ! ShamFile file = new ShamFile("test") ; ! Location location = new Location(file,new RdtPosition(0,0,0,0)) ; SearchResult searchResult = new SearchResult(methodSymbol, location) ; rubyUISearchResult.addMatch(new Match(searchResult, Match.UNIT_CHARACTER, 0, 0)); Index: TC_GroupByScopeStrategy.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/search/TC_GroupByScopeStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TC_GroupByScopeStrategy.java 26 Oct 2005 21:55:03 -0000 1.1 --- TC_GroupByScopeStrategy.java 12 Nov 2005 19:16:11 -0000 1.2 *************** *** 1,5 **** package org.rubypeople.rdt.internal.ui.search; ! import org.eclipse.core.runtime.Path; import org.rubypeople.rdt.internal.core.parser.RdtPosition; import org.rubypeople.rdt.internal.core.symbols.Location; --- 1,8 ---- package org.rubypeople.rdt.internal.ui.search; ! import junit.framework.Assert; ! import junit.framework.TestCase; ! ! import org.rubypeople.eclipse.shams.resources.ShamFile; import org.rubypeople.rdt.internal.core.parser.RdtPosition; import org.rubypeople.rdt.internal.core.symbols.Location; *************** *** 7,13 **** import org.rubypeople.rdt.internal.core.symbols.SearchResult; - import junit.framework.Assert; - import junit.framework.TestCase; - public class TC_GroupByScopeStrategy extends TestCase { --- 10,13 ---- *************** *** 32,36 **** public void testSearchResult() { MethodSymbol methodSymbol = new MethodSymbol("clazz::myMethod") ; ! SearchResult searchResult = new SearchResult(methodSymbol, new Location(new Path("test"), new RdtPosition(0,0,0,0))) ; Assert.assertEquals(new Scope("clazz"), groupByScopeStrategy.getParent(searchResult)) ; } --- 32,36 ---- public void testSearchResult() { MethodSymbol methodSymbol = new MethodSymbol("clazz::myMethod") ; ! SearchResult searchResult = new SearchResult(methodSymbol, new Location(new ShamFile("test"), new RdtPosition(0,0,0,0))) ; Assert.assertEquals(new Scope("clazz"), groupByScopeStrategy.getParent(searchResult)) ; } |