RE: Adding TestCase?
Ignacion, There method to be run is prefixed test, the class extends junit.framework.TestCase and the parent pom is right too. Here you have the pom: project modelVersion4.0.0/modelVersion parent groupIdorg.apache.tuscany.sca/groupId artifactIdtuscany-tutorial/artifactId version1.1-incubating-SNAPSHOT/version relativePath../pom.xml/relativePath /parent artifactIdamazon-cart/artifactId nameApache Tuscany SCA Tutorial Amazon Cart/name dependencies dependency groupIdorg.apache.tuscany.sca/groupId artifactIdtuscany-core/artifactId version1.1-incubating-SNAPSHOT/version /dependency dependency groupIdorg.apache.tuscany.sca/groupId artifactIdtuscany-host-jetty/artifactId version1.1-incubating-SNAPSHOT/version scopetest/scope /dependency dependency groupIdorg.apache.tuscany.sca/groupId artifactIdtuscany-host-embedded/artifactId version1.1-incubating-SNAPSHOT/version /dependency dependency groupIdorg.apache.tuscany.sca/groupId artifactIdtuscany-implementation-java-runtime/artifactId version1.1-incubating-SNAPSHOT/version scopetest/scope /dependency dependency groupId${pom.groupId}/groupId artifactIdamazon-cart-api/artifactId version${pom.version}/version /dependency dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.2/version scopecompile/scope /dependency /dependencies build finalName${artifactId}/finalName sourceDirectory${basedir}/sourceDirectory resources resource directory${basedir}/directory excludes exclude**/*.java/exclude !--exclude**/.*/**/exclude -- excludepom.xml/exclude excludebuild.xml/exclude /excludes /resource /resources plugins plugin groupIdorg.apache.tuscany.sca/groupId artifactIdtuscany-maven-ant-generator/artifactId version1.1-incubating-SNAPSHOT/version executions execution configuration mainClasslaunch.LaunchAmazonCart/mainClass /configuration goals goalgenerate/goal /goals /execution /executions /plugin plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-antrun-plugin/artifactId dependencies dependency groupIdant/groupId artifactIdant-trax/artifactId version1.6.5/version /dependency /dependencies /plugin /plugins /build /project An here is the test case: package amazon.cart; import org.apache.tuscany.sca.host.embedded.SCADomain; import org.apache.tuscany.sca.host.embedded.SCATestCaseRunner; import junit.framework.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test; import commonj.sdo.DataObject; import amazon.cart.AmazonCart; /** * Test case for helloworld web service client */ public class AmazonCartTestCase extends junit.framework.TestCase{ private SCADomain scaDomain; private AmazonCart amazonCart; private SCATestCaseRunner server; @Before public void startClient() throws Exception { try { scaDomain = SCADomain.newInstance(amazoncart.composite); amazonCart = scaDomain.getService(AmazonCart.class, AmazonCartServiceComponent/AmazonCartService); server = new SCATestCaseRunner(AmazonCartTestCase.class); server.before(); } catch (Throwable e) { e.printStackTrace(); } } @Test public void testCartCreate() throws Exception { System.out.println(Entering test...); DataObject root = amazonCart.CartCreate(null); //Assert.assertEquals(Hello Smith, msg); System.out.println(Exiting test...); } @After public void stopClient() throws Exception { server.after(); scaDomain.close(); } } I will really appreciate if you can take a look at them. Thanks in advance!, Mario -Original Message- From: Ignacio Silva-Lepe [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 14, 2007 12:12 PM To: tuscany-dev@ws.apache.org Subject: Re: Adding TestCase? Oh, and do you have any method with a name starting with the 'test
Re: Adding TestCase?
Just to verify: 1- Does your test case class extend junit.framework.TestCase? 2- Does your pom include the proper parent, eg: parent groupIdorg.apache.tuscany.sca/groupId artifactIdtuscany-sca/artifactId version1.0.1-incubating/version relativePath../../pom.xml/relativePath /parent AFAICT, you don't need to include maven-surefire-plugin in your pom unless you need to configure it, and you only need the test scoped junit dependency. On Nov 14, 2007 9:50 AM, Antollini, Mario [EMAIL PROTECTED] wrote: Hello, I am trying to add a test case for the tutorial. What are the steps I need to follow? I have looked at other test cases and I have copied many things (none of them worked though): 1 - create a test case whose class name ends in ***TestCase.java (it cantains the required classes: org.apache.tuscany.sca.host.embedded.SCATestCaseRunner, junit.framework.Assert, org.junit.After, org.junit.Before, org.junit.Test) 2 - Added this to the pom: dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.2/version scopecompile/scope /dependency 3 - Added this to the pom: dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.2/version scopetest/scope /dependency 4 - Added this to the pom: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId configuration argLine /argLine /configuration /plugin No matter what I try, I always get the no test to run response when running maven. Can somebody give me a tip? Regards, Mario E. Antollini Intel Software ASDC +54 351 414 5594 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Adding TestCase?
Oh, and do you have any method with a name starting with the 'test' prefix? On Nov 14, 2007 9:50 AM, Antollini, Mario [EMAIL PROTECTED] wrote: Hello, I am trying to add a test case for the tutorial. What are the steps I need to follow? I have looked at other test cases and I have copied many things (none of them worked though): 1 - create a test case whose class name ends in ***TestCase.java (it cantains the required classes: org.apache.tuscany.sca.host.embedded.SCATestCaseRunner, junit.framework.Assert, org.junit.After, org.junit.Before, org.junit.Test) 2 - Added this to the pom: dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.2/version scopecompile/scope /dependency 3 - Added this to the pom: dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.2/version scopetest/scope /dependency 4 - Added this to the pom: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId configuration argLine /argLine /configuration /plugin No matter what I try, I always get the no test to run response when running maven. Can somebody give me a tip? Regards, Mario E. Antollini Intel Software ASDC +54 351 414 5594 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Adding TestCase?
(); } } I will really appreciate if you can take a look at them. Thanks in advance!, Mario -Original Message- From: Ignacio Silva-Lepe [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 14, 2007 12:12 PM To: tuscany-dev@ws.apache.org Subject: Re: Adding TestCase? Oh, and do you have any method with a name starting with the 'test' prefix? On Nov 14, 2007 9:50 AM, Antollini, Mario [EMAIL PROTECTED] wrote: Hello, I am trying to add a test case for the tutorial. What are the steps I need to follow? I have looked at other test cases and I have copied many things (none of them worked though): 1 - create a test case whose class name ends in ***TestCase.java (it cantains the required classes: org.apache.tuscany.sca.host.embedded.SCATestCaseRunner, junit.framework.Assert, org.junit.After, org.junit.Before, org.junit.Test) 2 - Added this to the pom: dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.2/version scopecompile/scope /dependency 3 - Added this to the pom: dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.2/version scopetest/scope /dependency 4 - Added this to the pom: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId configuration argLine /argLine /configuration /plugin No matter what I try, I always get the no test to run response when running maven. Can somebody give me a tip? Regards, Mario E. Antollini Intel Software ASDC +54 351 414 5594 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]