|
From: David C. <dc...@us...> - 2005-12-24 01:43:16
|
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-serv29292/src/org/rubypeople/rdt/internal/core/builder Modified Files: TC_RubyCodeAnalyzer.java TC_IndexUpdater.java Log Message: Incorporate current JRuby head. Fixed bug in RubySourceFileCollectionVisitor.java that caused NullPointerException. Fixed bug where UT Failures open up class not method. 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.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TC_IndexUpdater.java 13 Nov 2005 13:05:07 -0000 1.7 --- TC_IndexUpdater.java 24 Dec 2005 01:43:07 -0000 1.8 *************** *** 20,25 **** import org.jruby.ast.Node; import org.jruby.ast.TrueNode; import org.rubypeople.eclipse.shams.resources.ShamFile; - import org.rubypeople.rdt.internal.core.parser.RdtPosition; import org.rubypeople.rdt.internal.core.parser.RubyParser; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; --- 20,26 ---- import org.jruby.ast.Node; import org.jruby.ast.TrueNode; + import org.jruby.lexer.yacc.ISourcePosition; + import org.jruby.lexer.yacc.SourcePosition; import org.rubypeople.eclipse.shams.resources.ShamFile; import org.rubypeople.rdt.internal.core.parser.RubyParser; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; *************** *** 27,31 **** public class TC_IndexUpdater extends TestCase { ! private static final RdtPosition POSITION_1 = new RdtPosition(1,2,3); private static final String TEST_CLASS_NAME = "TestClassName"; --- 28,32 ---- public class TC_IndexUpdater extends TestCase { ! private static final ISourcePosition POSITION_1 = createPosition(1,1,2,3); private static final String TEST_CLASS_NAME = "TestClassName"; *************** *** 73,77 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo"), file, new RdtPosition(1, 2, 14, 15)); } --- 74,78 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo"), file, createPosition(1, 1, 11, 14)); } *************** *** 82,86 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar"), file, new RdtPosition(1, 2, 16, 20)); } --- 83,87 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar"), file, createPosition(1, 1, 11, 19)); } *************** *** 91,95 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("X::Foo::Bar"), file, new RdtPosition(1, 2, 19, 23)); } --- 92,96 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("X::Foo::Bar"), file, createPosition(1, 1, 11, 21)); } *************** *** 100,104 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar"), file, new RdtPosition(2, 3, 25, 26)); } --- 101,105 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar"), file, createPosition(2, 2, 22, 25)); } *************** *** 109,113 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar::InnerBar"), file, new RdtPosition(2, 3, 35, 36)); } --- 110,114 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar::InnerBar"), file, createPosition(2, 2, 27, 35)); } *************** *** 117,121 **** updater.update(file,node, false); ! symbolIndex.assertAdded(new MethodSymbol("method"), file, new RdtPosition(0, 1, 3, 12)); } --- 118,122 ---- updater.update(file,node, false); ! symbolIndex.assertAdded(new MethodSymbol("method"), file, createPosition(0, 1, 0, 14)); } *************** *** 125,129 **** updater.update(file,node, false); ! symbolIndex.assertAdded(new MethodSymbol("Foo::method"), file, new RdtPosition(1, 2, 13, 24)); } --- 126,130 ---- updater.update(file,node, false); ! symbolIndex.assertAdded(new MethodSymbol("Foo::method"), file, createPosition(1, 2, 10, 24)); } *************** *** 134,136 **** --- 135,143 ---- return new RubyParser().parse(file, reader); } + + private static ISourcePosition createPosition(int startLine, int endLine, int startOffset, int endOffset) { + return new SourcePosition("TestFile.rb", startLine, endLine, startOffset, endOffset); + } + + } \ No newline at end of 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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TC_RubyCodeAnalyzer.java 13 Nov 2005 13:05:07 -0000 1.2 --- TC_RubyCodeAnalyzer.java 24 Dec 2005 01:43:07 -0000 1.3 *************** *** 18,21 **** --- 18,22 ---- import org.jruby.ast.Node; import org.jruby.ast.visitor.NodeVisitor; + import org.jruby.evaluator.Instruction; import org.jruby.lexer.yacc.SyntaxException; import org.rubypeople.eclipse.shams.resources.ShamFile; *************** *** 37,41 **** rootNode = new Node(null) { ! public void accept(NodeVisitor visitor) { } --- 38,43 ---- rootNode = new Node(null) { ! public Instruction accept(NodeVisitor visitor) { ! return null; } |