From 3c7c4a749baafcf375f4785a7668d3a25c9063e3 Mon Sep 17 00:00:00 2001 From: lresende Date: Fri, 13 Nov 2009 01:42:27 +0000 Subject: Moving 1.x trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835700 13f79535-47bb-0310-9956-ffa450edef68 --- branches/sca-java-1.x/vtest/processcomments.rb | 198 ------------------------- 1 file changed, 198 deletions(-) delete mode 100644 branches/sca-java-1.x/vtest/processcomments.rb (limited to 'branches/sca-java-1.x/vtest/processcomments.rb') diff --git a/branches/sca-java-1.x/vtest/processcomments.rb b/branches/sca-java-1.x/vtest/processcomments.rb deleted file mode 100644 index b7a7fc1cc3..0000000000 --- a/branches/sca-java-1.x/vtest/processcomments.rb +++ /dev/null @@ -1,198 +0,0 @@ -=begin - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -Scans java test source files, recursively from the current directory, -and produces a list of test metods sorted by specification line number. - -The implementation makes heavy use of my scant knowledge of regex. I'll -comeback and clean this up as time allows. - -Assumes a test comment convention like this: - - /** - * Lines 410,411,412,413: - *

- * A method of a conversational interface may be marked with an - * "@EndsConversation" annotation. Once a method marked with - * "@EndsConversation" has been called, the conversation between client and - * service provider is at an end, which implies no further methods may be - * called on that service within the *same* conversation. - */ - @Test - public void atEndsConversation1() throws Exception { - -Example command line usage ->ruby processcomments.rb > comment_scan.txt - -Current output is formatted for a cwiki page and can be directly pasted to a blank page - -Some TODO's: - Add logic to process number ranges such as "Lines 523-556" or "Lines 523 to 556" -=end -class TestMethod - - attr_accessor :lines_tested, :first_line_tested - - def initialize(text, parent) - @text = text - @parent = parent - @lines_tested = init_lines_tested - @first_line_tested = @lines_tested.first - end - - #Define sort criteria - def <=>(test_method) - @first_line_tested.<=>(test_method.first_line_tested) - end - - def name - regex = /void\s*\S*\(\) / - str = @text[regex] - str.sub(/void\s*/, '') - end - - def init_lines_tested - lines_regex = /Line.*?$/ - lines_array = @text.scan(lines_regex) - nums_regex = /\d{1,4}/ - line_numbers = Array.new - lines_array.each do |line_text| - number_strings =line_text.scan(nums_regex) - number_strings.each {|num_string| line_numbers<