Author: kwilliams
Date: Thu May 22 10:45:36 2008
New Revision: 659175
URL: http://svn.apache.org/viewvc?rev=659175&view=rev
Log:
Some test case comment clean up. Plus first cut at script to process comments
Added:
incubator/tuscany/java/sca/vtest/java-api/processcomments.rb
Modified:
incubator/tuscany/java/sca/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java
incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
incubator/tuscany/java/sca/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java
incubator/tuscany/java/sca/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java
incubator/tuscany/java/sca/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java
incubator/tuscany/java/sca/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java
Modified:
incubator/tuscany/java/sca/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java?rev=659175&r1=659174&r2=659175&view=diff
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java
(original)
+++
incubator/tuscany/java/sca/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java
Thu May 22 10:45:36 2008
@@ -54,7 +54,7 @@
}
/**
- * L884 <br>
+ * Lines 884 <br>
* getService() - Returns a type-safe reference to the target of this
* reference. The instance returned is guaranteed to implement the business
* interface for this reference. The value returned is a proxy to the
target
@@ -68,7 +68,7 @@
}
/**
- * L885 <br>
+ * Lines 885 <br>
* getBusinessInterface() Returns the Java class for the business
* interface associated with this reference.
*
@@ -80,7 +80,7 @@
}
/**
- * L886 <br>
+ * Lines 886 <br>
* isConversational() Returns true if this reference is conversational.
*
* @throws Exception
@@ -91,7 +91,7 @@
}
/**
- * L887 <br>
+ * Lines 887 <br>
* getConversation() Returns the conversation associated with this
* reference. Returns null if no conversation is currently active.
*
@@ -104,7 +104,7 @@
}
/**
- * L888 <br>
+ * Lines 888 <br>
* getCallbackID() Returns the callback ID.
*
* @throws Exception
Modified:
incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java?rev=659175&r1=659174&r2=659175&view=diff
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
(original)
+++
incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
Thu May 22 10:45:36 2008
@@ -56,7 +56,7 @@
}
/**
- * L776 <br>
+ * Lines 776 <br>
* getURI() - Returns the absolute URI of the component within the SCA
* domain.
*
@@ -68,7 +68,7 @@
}
/**
- * L778 <br>
+ * Lines 778 <br>
* getService(Class<B> businessInterface, String referenceName) ?
* Returns a proxy for the reference defined by the current component.
*
@@ -80,7 +80,7 @@
}
/**
- * L780 <br>
+ * Lines 780 <br>
* getServiceReference(Class<B> businessInterface, String
* referenceName) ? Returns a ServiceReference defined by the current
* component.
@@ -93,7 +93,7 @@
}
/**
- * L783 <br>
+ * Lines 783 <br>
* createSelfReference(Class<B> businessInterface) ? Returns a
* ServiceReference that can be used to invoke this component over the
* designated service.
@@ -106,7 +106,7 @@
}
/**
- * L785 <br>
+ * Lines 785 <br>
* getSelfReference(Class<B> businessInterface, String serviceName) -
* Returns a ServiceReference that can be used to invoke this component
over
* the designated service. Service name explicitly declares the service
name
@@ -120,7 +120,7 @@
}
/**
- * L788 <br>
+ * Lines 788 <br>
* getProperty (Class<B> type, String propertyName) - Returns the
* value of an SCA property defined by this component.
*
@@ -132,7 +132,7 @@
}
/**
- * L793 <br>
+ * Lines 793 <br>
* getRequestContext() - Returns the context for the current SCA service
* request, or null if there is no current request or if the context is
* unavailable.
@@ -148,7 +148,7 @@
}
/**
- * L790, L794 <br>
+ * Lines 790,794 <br>
* cast(B target) - Casts a type-safe reference to a CallableReference.
*
* @throws Exception
@@ -168,7 +168,7 @@
}
/**
- * L342-344 <br>
+ * Lines 342-344 <br>
* When a component implementation needs access to a service where the
* reference to the service is not known at compile time, the reference can
* be located using the component?s ComponentContext.
Modified:
incubator/tuscany/java/sca/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java?rev=659175&r1=659174&r2=659175&view=diff
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java
(original)
+++
incubator/tuscany/java/sca/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java
Thu May 22 10:45:36 2008
@@ -53,7 +53,7 @@
}
/**
- * L941, L942 <br>
+ * Lines 941, 942 <br>
* getConversationID() Returns the identifier for this conversation. If a
* user-defined identity had been supplied for this reference then its
value
* will be returned; otherwise the identity generated by the system when
the
Modified:
incubator/tuscany/java/sca/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java?rev=659175&r1=659174&r2=659175&view=diff
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java
(original)
+++
incubator/tuscany/java/sca/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java
Thu May 22 10:45:36 2008
@@ -58,7 +58,7 @@
}
/**
- * L951 <br>
+ * Lines 951 <br>
* NoRegisteredCallbackException.
*
* @throws Exception
@@ -69,7 +69,7 @@
}
/**
- * L960 <br>
+ * Lines 960 <br>
* ServiceRuntimeException - This exception signals problems in the
management of SCA component execution.
*
* @throws Exception
@@ -80,7 +80,7 @@
}
/**
- * L970 <br>
+ * Lines 970 <br>
* ServiceUnavailableException This exception signals problems in the
interaction with remote services.
*
* @throws Exception
@@ -106,7 +106,7 @@
}
/**
- * L983 <br>
+ * Lines 983 <br>
* ConversationEndedException.
*
* @throws Exception
@@ -117,7 +117,7 @@
}
/**
- * L360-361 <br>
+ * Lines 360-361 <br>
* Business exceptions are thrown by the implementation of the called
service method,
* and are defined as checked exceptions on the interface that types the
service.
*
Modified:
incubator/tuscany/java/sca/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java?rev=659175&r1=659174&r2=659175&view=diff
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java
(original)
+++
incubator/tuscany/java/sca/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java
Thu May 22 10:45:36 2008
@@ -55,7 +55,7 @@
}
/**
- * L858 <br>
+ * Lines 858 <br>
* getSecuritySubject() Returns the JAAS Subject of the current request.
*
* @throws Exception
@@ -66,7 +66,7 @@
}
/**
- * L860 <br>
+ * Lines 860 <br>
* getServiceName() Returns the name of the service on the Java
* implementation the request came in on.
*
@@ -78,7 +78,7 @@
}
/**
- * L861, L862 <br>
+ * Lines 861, 862 <br>
* getCallbackReference() Returns a callable reference to the callback as
* specified by the caller. getCallback() Returns a proxy for the
callback
* as specified by the caller.
@@ -91,7 +91,7 @@
}
/**
- * L863 <br>
+ * Lines 863 <br>
* getServiceReference() When invoked during the execution of a service
* operation, this API MUST return a CallableReference that represents the
* service. When invoked during the execution of a callback operation, this
Modified:
incubator/tuscany/java/sca/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java?rev=659175&r1=659174&r2=659175&view=diff
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java
(original)
+++
incubator/tuscany/java/sca/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java
Thu May 22 10:45:36 2008
@@ -54,7 +54,7 @@
}
/**
- * L915, L916 <br>
+ * Lines 915-916 <br>
* getConversationID() - Returns the id supplied by the user that will be
* associated with conversations initiated through this reference. <br>
* setConversationID(Object conversationId) Set the id to associate with
@@ -71,7 +71,7 @@
}
/**
- * L917 <br>
+ * Lines 917 <br>
* setCallbackID(Object callbackID) Sets the callback ID.
*
* @throws Exception
@@ -82,7 +82,7 @@
}
/**
- * L918 <br>
+ * Lines 918 <br>
* getCallback() Returns the callback object.
*
* @throws Exception
@@ -93,7 +93,7 @@
}
/**
- * L919 <br>
+ * Lines 919 <br>
* setCallback(Object callback) Sets the callback object.
*
* @throws Exception
Added: incubator/tuscany/java/sca/vtest/java-api/processcomments.rb
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/processcomments.rb?rev=659175&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/processcomments.rb (added)
+++ incubator/tuscany/java/sca/vtest/java-api/processcomments.rb Thu May 22
10:45:36 2008
@@ -0,0 +1,91 @@
+
+# Scans files - with a given extension - recursively from the current
+# directory replacing the old copyright/license header statement with a
+# new version
+#
+# Example command line usage
+# >ruby replaceheaders.rb java oldheader.txt newheader.txt
+
+class TestMethod
+ attr_accessor :text, :parent
+
+ def initialize(text, parent)
+ @text = text
+ @parent = parent
+ end
+
+ def name
+ #puts @text
+ regex = /\S*\(\) /
+ @text[regex]
+ end
+
+ def package_name
+ @parent.package_name
+ end
+
+ def long_name
+ #puts "Here's the package name =>" + self.package_name
+ #puts "Here's the self name =>" + self.name
+ self.package_name + "." + self.name
+ end
+end
+
+class TestCase
+ attr_accessor :text, :test_methods
+
+ def initialize(text)
+ @text = text
+ @test_methods = Array.new
+ create_test_methods
+ end
+
+ def package_name
+ line = @text[/pack.*$/]
+ line.sub!(/package /, '')
+ line.sub(/;/, '')
+ end
+
+ def testcase_name
+ text[/\S*TestCase/]
+ end
+
+ def create_test_methods
+ #/**
+ #regex = /Line.*?\{/m
+ regex = /\/\*\*.*?$\W*?Line.*?\{/m
+
+ test_method_text_array = text.scan(regex)
+ test_method_text_array.each {|t| @test_methods<<TestMethod.new(t, self)}
+ end
+
+end
+
+
+ def process_file(fn)
+ text = String.new
+ File.open(fn) { |f| text = f.read }
+ $testcases << TestCase.new(text)
+ end
+
+$num_files_processed = 0
+$testcases = Array.new
+
+puts "Scanning files with .java extension"
+
+Dir["**/*TestCase.java"].each do |filename|
+ process_file(filename)
+ $num_files_processed += 1
+end
+
+puts "Total files processed = #{$num_files_processed}"
+puts "Number of test cases = #{$testcases.length}"
+$testcases.each do |tc|
+ puts "Next Test Class =>" + tc.package_name + tc.testcase_name
+ tc.test_methods.each {|m| puts " " + m.long_name}
+end
+
+
+
+
+