You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2007/02/28 18:37:14 UTC
Running Java SCA Calculators sample?
After talking a few weeks ago about how best to build Java I got distracted
doing PHP SCA things. Anyhow I have actually got back to trying it out.
* I checked out head and the integration branch with the aim of running up
the calculator sample.
* I built Head using Raymond's splendid script [1] (maybe that should be in
svn somewhere ;-) and most of it seemed OK. I get the following error.
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running
org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestAssemblyCon
tent
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.14 sec
Running
org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 11.657 sec
<<< F
AILURE!
testLauncherUsage(
org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestL
auncher) Time elapsed: 0.812 sec <<< FAILURE!
junit.framework.ComparisonFailure: expected:<......> but was:<...
...>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals (Assert.java:87)
at
org.apache.tuscany.sca.runtime.standalone.smoketest.CommandTestCase.c
ompareOutput(CommandTestCase.java:37)
at
org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
.testLauncherUsage(SmokeTestLauncher.java:40)
Not sure if this is significant.
I'm now not sure how to try the calculator sample. I cd to sca/core-samples
(from the mail list this seems to be the correct version of the calculator
sample [2]) and run
"mvn install" but it doesn't seem to do anything. Playing with building
various modules this is what seemed to work for me.
cd sca/runtime/itest; mvn install
cd sca/core-samples/common; mvn install
cd sca/core-samples/standalone/calculator; mvn install
Seems to run the test successfully but I can't tell now how to run this test
from the command line. The instructions in the readme suggest using "mvn
dependency:unpack" but I don't see any dependency plugin configuration in
the pom files here abouts so I guess this isn't going to work.
Can someone confirm whether standalone operation works in the calculator
sample in head and if so how to do it?
By way of light relief I thought I would try the same on the integration
branch.
* I was able to build and run the sample in the integration branch in mvn
but the standalone runtime doesn't seem to be supported here either. Is that
correct?
* Anyhow I took the next step and pulled the project into eclipse and it was
happy to let me debug the test as a JUnit test so I'm set for a bit of
experimentation.
I'm assuming that this mode of debugging will also work for Head but I
haven't tried it yet. I'd be interested to know if there is a general mode
of operation for debugging samples that people have adopted, e.g. debug from
standalone runtime
JUnit tests
With some clever mvn settings(?) and attach remotely
System.out :-)
Something else...
Regards
Simon
[1] http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg14659.html
[2] http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg14530.html
Re: Running Java SCA Calculators sample?
Posted by Jim Marino <jm...@myromatours.com>.
>
I should proof-read before sending out...typo corrections inline..
>
> If you want to remove debug, do (adjusting for your IDE, this works
> with IDEA):
>
/remote debug/
> java -Xdebug -Xnoagent -Djava.compiler=NONE -
> Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -
> jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/loan-application.jar target/loan-application.jar
>
> And start up remote debugging in your IDE. You can also run the
> launcher directly in the IDE. If you need to run integration tests,
> we have a JUnit component type that is part of the iTest pluging.
> This makes righting tests easy as you just create a TestCase and
> configure it as an SCA component.
/writing tests/
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Running Java SCA Calculators sample?
Posted by Jim Marino <jm...@myromatours.com>.
> do it (with all your info) it hangs together. It's just that first
> time when
> you've not seen it before it's a little confusing :-)
>
Yeah, agree. Hopefully the release makes this easier...Let me know
how how things go.
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Federating between Java and C++, was: Running Java SCA Calculators sample?
Posted by Simon Laws <si...@googlemail.com>.
On 2/28/07, Jim Marino <jm...@myromatours.com> wrote:
>
> > do it (with all your info) it hangs together. It's just that first
> > time when
> > you've not seen it before it's a little confusing :-)
> >
> > Regards
> >
> > Simon
>
> I'm wondering if it would be a good time to start discussing
> federation between the Java and C++ runtimes. On the Java side we
> have been using an implementation based on JXTA which also has a C++
> implementation. Would people be interested in starting to see how
> some of the pieces might fit together?
>
> Jim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
> Hi Jim
Yes we should get back to that at some point. I'm taking some vacation at
the moment so won't be that active until next week.When we discussed this
last time I was going to concentrate on the C++ side. In hindsight though
it's probably better to get a grounding generally in Java SCA (and it's
interesting :-) hence I'm taking some time out to get up to speed.
Regards
Simon
Federating between Java and C++, was: Running Java SCA Calculators sample?
Posted by Jim Marino <jm...@myromatours.com>.
> do it (with all your info) it hangs together. It's just that first
> time when
> you've not seen it before it's a little confusing :-)
>
> Regards
>
> Simon
I'm wondering if it would be a good time to start discussing
federation between the Java and C++ runtimes. On the Java side we
have been using an implementation based on JXTA which also has a C++
implementation. Would people be interested in starting to see how
some of the pieces might fit together?
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Running Java SCA Calculators sample?
Posted by Simon Laws <si...@googlemail.com>.
On 2/28/07, Jim Marino <jm...@myromatours.com> wrote:
>
>
> On Feb 28, 2007, at 9:37 AM, Simon Laws wrote:
>
> > After talking a few weeks ago about how best to build Java I got
> > distracted
> > doing PHP SCA things. Anyhow I have actually got back to trying it
> > out.
> >
> > * I checked out head and the integration branch with the aim of
> > running up
> > the calculator sample.
> > * I built Head using Raymond's splendid script [1] (maybe that
> > should be in
> > svn somewhere ;-) and most of it seemed OK. I get the following error.
> >
> > -------------------------------------------------------
> > T E S T S
> > -------------------------------------------------------
> > Running
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestAssemblyC
> > on
> > tent
> > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
> > 0.14 sec
> > Running
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> > Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
> > 11.657 sec
> > <<< F
> > AILURE!
> > testLauncherUsage(
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestL
> > auncher) Time elapsed: 0.812 sec <<< FAILURE!
> > junit.framework.ComparisonFailure: expected:<......> but was:<...
> > ...>
> > at junit.framework.Assert.assertEquals(Assert.java:81)
> > at junit.framework.Assert.assertEquals (Assert.java:87)
> > at
> > org.apache.tuscany.sca.runtime.standalone.smoketest.CommandTestCase.c
> > ompareOutput(CommandTestCase.java:37)
> > at
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> > .testLauncherUsage(SmokeTestLauncher.java:40)
> >
> > Not sure if this is significant.
> This would be significant but I think this may be caused by the
> script you are running as the trunk build system is significantly
> different than the one in branch. The trunk has been stable for me.
>
> To run the samples, as we have not cut a release yet, you will need
> to manually create a distribution. This should be pretty
> straightforward:
>
> 1. In /kernel do 'mvn'
> 2. In /runtime/standalone run 'mvn'
> 3. In /core-samples/common run 'mvn install'
> 4. In /core-samples/ run 'mvn install'
> 5. Run the calculator:
>
> java -jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/calc.jar add 2 5
>
> You should see 'result = 7.0'
>
> The launcher syntax is java -jar <path to distribution> <path to
> application>
>
> The two parameters '2' and '5' are for the application.
>
> You can also do the same with the loan application statefull
> conversational sample except you will not need to build the common
> module (Step 3) and instead build /core-samples/loanapplication. Then
> run:
>
> java -jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/loan-application.jar
>
> If you want to remove debug, do (adjusting for your IDE, this works
> with IDEA):
>
> java -Xdebug -Xnoagent -Djava.compiler=NONE -
> Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -
> jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/loan-application.jar target/loan-application.jar
>
> And start up remote debugging in your IDE. You can also run the
> launcher directly in the IDE. If you need to run integration tests,
> we have a JUnit component type that is part of the iTest pluging.
> This makes righting tests easy as you just create a TestCase and
> configure it as an SCA component.
>
> Sorry for having to manually create the distro but once we have the
> release set, things should be as simple as just using java -jar <path
> to launcher> <sample app>.
>
> Let me know how you get along.
>
> Jim
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
> Great, thanks Jim. Not a problem doing the manual steps. Now I know how to
do it (with all your info) it hangs together. It's just that first time when
you've not seen it before it's a little confusing :-)
Regards
Simon
Re: Running Java SCA Calculators sample?
Posted by Jeremy Boynes <jb...@apache.org>.
On Feb 28, 2007, at 10:35 AM, Luciano Resende wrote:
> My suggestion was to use a maven profile to have all pieces
> necessary to run
> a sample built, and I think this is the purpose of maven.
>
> Note that I didn't suggest having maven performing the following
> command
> (that would actually run the sample) :
>
> java -jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/calc.jar add 2 5
OK, guess it's different interpretations of "run" :-)
I'd suggested earlier in this thread of adding a pom in core-samples
that would build/itest all the common modules. That should be all the
prep a user needs before working with an individual sample. We
wouldn't need a profile for that as it would be the default goal.
This would make the typical user experience:
* download a released distribution
* install
* download the sample source
* build the common modules
* play with a sample
More experimental users could get the distribution in other ways -
either downloading an (unstable) SNAPSHOT version, or building it
themselves (really unstable). The rest of the process though would
remain the same.
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Running Java SCA Calculators sample?
Posted by Luciano Resende <lu...@gmail.com>.
My suggestion was to use a maven profile to have all pieces necessary to run
a sample built, and I think this is the purpose of maven.
Note that I didn't suggest having maven performing the following command
(that would actually run the sample) :
java -jar ../../../runtime/standalone/smoketest/target/assembly/bin/
launcher.jar target/calc.jar add 2 5
On 2/28/07, Jeremy Boynes <jb...@apache.org> wrote:
>
> On Feb 28, 2007, at 10:25 AM, Luciano Resende wrote:
>
> >> To run the samples, as we have not cut a release yet, you will need
> >> to manually create a distribution. This should be pretty
> >> straightforward:
> >
> >> 1. In /kernel do 'mvn'
> >> 2. In /runtime/standalone run 'mvn'
> >> 3. In /core-samples/common run 'mvn install'
> >> 4. In /core-samples/ run 'mvn install'
> >> 5. Run the calculator:
> >
> > Just a suggestion, isn't much simpler to have a profile defined
> > where it
> > would run necessary modules for specific scenarios (e.g running
> > standalone
> > samples) ? The we can redirect the users to something like mvn -P
> > <standalone samples> or a more appropriated profile name.
>
> It isn't - it's just confusing.
>
> Maven is a build tool, not a run tool. Running samples using Maven is
> an aberration.
> --
> Jeremy
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
--
Luciano Resende
http://people.apache.org/~lresende
Re: Running Java SCA Calculators sample?
Posted by Jeremy Boynes <jb...@apache.org>.
On Feb 28, 2007, at 10:25 AM, Luciano Resende wrote:
>> To run the samples, as we have not cut a release yet, you will need
>> to manually create a distribution. This should be pretty
>> straightforward:
>
>> 1. In /kernel do 'mvn'
>> 2. In /runtime/standalone run 'mvn'
>> 3. In /core-samples/common run 'mvn install'
>> 4. In /core-samples/ run 'mvn install'
>> 5. Run the calculator:
>
> Just a suggestion, isn't much simpler to have a profile defined
> where it
> would run necessary modules for specific scenarios (e.g running
> standalone
> samples) ? The we can redirect the users to something like mvn -P
> <standalone samples> or a more appropriated profile name.
It isn't - it's just confusing.
Maven is a build tool, not a run tool. Running samples using Maven is
an aberration.
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Running Java SCA Calculators sample?
Posted by Jim Marino <jm...@myromatours.com>.
On Feb 28, 2007, at 10:25 AM, Luciano Resende wrote:
>> To run the samples, as we have not cut a release yet, you will need
>> to manually create a distribution. This should be pretty
>> straightforward:
>
>> 1. In /kernel do 'mvn'
>> 2. In /runtime/standalone run 'mvn'
>> 3. In /core-samples/common run 'mvn install'
>> 4. In /core-samples/ run 'mvn install'
>> 5. Run the calculator:
>
> Just a suggestion, isn't much simpler to have a profile defined
> where it
> would run necessary modules for specific scenarios (e.g running
> standalone
> samples) ? The we can redirect the users to something like mvn -P
> <standalone samples> or a more appropriated profile name.
>
I would hope users should never have to checkout code - they would
just download the distribution, build the sample they are interested
in and java -jar <launcher jar> <app jar>. If they need runtime
source they would just download the source distro.
Tuscany samples developers should use the distribution as well in
order to verify the sample works with the distribution image.
There will be cases where someone needs to build multiple independent
modules, e.g. Simon's. In that case, profiles are not really Maven's
way to do it. I also don't think this use scales or addresses the
problem of build stability. For example, the combinations of
independent modules are numerous and having profiles for everyone
will quickly become unwieldy. Also, profiles will become unstable
when a module breaks and will involve constant shuffling of the build
script.
The way I think this is best addressed is by grouping related modules
together. This is how Maven was intended to work. In the specific
case here, perhaps we should move core under runtime?
I've found the modular build has greatly increased my productivity
and made checkins more accurate as I am not hampered by orthogonal
issues in unrelated modules.
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Running Java SCA Calculators sample?
Posted by Luciano Resende <lu...@gmail.com>.
>To run the samples, as we have not cut a release yet, you will need
>to manually create a distribution. This should be pretty
>straightforward:
>1. In /kernel do 'mvn'
>2. In /runtime/standalone run 'mvn'
>3. In /core-samples/common run 'mvn install'
>4. In /core-samples/ run 'mvn install'
>5. Run the calculator:
Just a suggestion, isn't much simpler to have a profile defined where it
would run necessary modules for specific scenarios (e.g running standalone
samples) ? The we can redirect the users to something like mvn -P
<standalone samples> or a more appropriated profile name.
--
Luciano Resende
http://people.apache.org/~lresende
On 2/28/07, Jim Marino <jm...@myromatours.com> wrote:
>
>
> On Feb 28, 2007, at 9:37 AM, Simon Laws wrote:
>
> > After talking a few weeks ago about how best to build Java I got
> > distracted
> > doing PHP SCA things. Anyhow I have actually got back to trying it
> > out.
> >
> > * I checked out head and the integration branch with the aim of
> > running up
> > the calculator sample.
> > * I built Head using Raymond's splendid script [1] (maybe that
> > should be in
> > svn somewhere ;-) and most of it seemed OK. I get the following error.
> >
> > -------------------------------------------------------
> > T E S T S
> > -------------------------------------------------------
> > Running
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestAssemblyC
> > on
> > tent
> > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
> > 0.14 sec
> > Running
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> > Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
> > 11.657 sec
> > <<< F
> > AILURE!
> > testLauncherUsage(
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestL
> > auncher) Time elapsed: 0.812 sec <<< FAILURE!
> > junit.framework.ComparisonFailure: expected:<......> but was:<...
> > ...>
> > at junit.framework.Assert.assertEquals(Assert.java:81)
> > at junit.framework.Assert.assertEquals (Assert.java:87)
> > at
> > org.apache.tuscany.sca.runtime.standalone.smoketest.CommandTestCase.c
> > ompareOutput(CommandTestCase.java:37)
> > at
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> > .testLauncherUsage(SmokeTestLauncher.java:40)
> >
> > Not sure if this is significant.
> This would be significant but I think this may be caused by the
> script you are running as the trunk build system is significantly
> different than the one in branch. The trunk has been stable for me.
>
> To run the samples, as we have not cut a release yet, you will need
> to manually create a distribution. This should be pretty
> straightforward:
>
> 1. In /kernel do 'mvn'
> 2. In /runtime/standalone run 'mvn'
> 3. In /core-samples/common run 'mvn install'
> 4. In /core-samples/ run 'mvn install'
> 5. Run the calculator:
>
> java -jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/calc.jar add 2 5
>
> You should see 'result = 7.0'
>
> The launcher syntax is java -jar <path to distribution> <path to
> application>
>
> The two parameters '2' and '5' are for the application.
>
> You can also do the same with the loan application statefull
> conversational sample except you will not need to build the common
> module (Step 3) and instead build /core-samples/loanapplication. Then
> run:
>
> java -jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/loan-application.jar
>
> If you want to remove debug, do (adjusting for your IDE, this works
> with IDEA):
>
> java -Xdebug -Xnoagent -Djava.compiler=NONE -
> Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -
> jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/loan-application.jar target/loan-application.jar
>
> And start up remote debugging in your IDE. You can also run the
> launcher directly in the IDE. If you need to run integration tests,
> we have a JUnit component type that is part of the iTest pluging.
> This makes righting tests easy as you just create a TestCase and
> configure it as an SCA component.
>
> Sorry for having to manually create the distro but once we have the
> release set, things should be as simple as just using java -jar <path
> to launcher> <sample app>.
>
> Let me know how you get along.
>
> Jim
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
Re: Running Java SCA Calculators sample?
Posted by Jeremy Boynes <jb...@apache.org>.
On Feb 28, 2007, at 10:15 AM, Jim Marino wrote:
...
>
> If you want to remove debug, do (adjusting for your IDE, this works
> with IDEA):
>
> java -Xdebug -Xnoagent -Djava.compiler=NONE -
> Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -
> jar ../../../runtime/standalone/smoketest/target/assembly/bin/
> launcher.jar target/loan-application.jar target/loan-application.jar
>
> And start up remote debugging in your IDE. You can also run the
> launcher directly in the IDE. If you need to run integration tests,
> we have a JUnit component type that is part of the iTest pluging.
> This makes righting tests easy as you just create a TestCase and
> configure it as an SCA component.
>
> Sorry for having to manually create the distro but once we have the
> release set, things should be as simple as just using java -jar
> <path to launcher> <sample app>.
>
> Let me know how you get along.
I also sent info recently on setting up IDEA for debugging:
---
You can also run/debug as an application (assuming you get the IDE
set up right). In IDEA I have:
* classpath from the launcher module
* main class = org.apache.tuscany.launcher.Main
* JVM parameters = -ea -Dtuscany.installDir=${SCA}/runtime/standalone/
smoketest/target/assembly
* Program parameters = calc.jar add 2 3
* Working directory = ${SAMPLES}/standalone/calculator/target
That probably translates to Eclipse somehow.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Running Java SCA Calculators sample?
Posted by Jim Marino <jm...@myromatours.com>.
On Feb 28, 2007, at 9:37 AM, Simon Laws wrote:
> After talking a few weeks ago about how best to build Java I got
> distracted
> doing PHP SCA things. Anyhow I have actually got back to trying it
> out.
>
> * I checked out head and the integration branch with the aim of
> running up
> the calculator sample.
> * I built Head using Raymond's splendid script [1] (maybe that
> should be in
> svn somewhere ;-) and most of it seemed OK. I get the following error.
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running
> org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestAssemblyC
> on
> tent
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
> 0.14 sec
> Running
> org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
> 11.657 sec
> <<< F
> AILURE!
> testLauncherUsage(
> org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestL
> auncher) Time elapsed: 0.812 sec <<< FAILURE!
> junit.framework.ComparisonFailure: expected:<......> but was:<...
> ...>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at junit.framework.Assert.assertEquals (Assert.java:87)
> at
> org.apache.tuscany.sca.runtime.standalone.smoketest.CommandTestCase.c
> ompareOutput(CommandTestCase.java:37)
> at
> org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> .testLauncherUsage(SmokeTestLauncher.java:40)
>
> Not sure if this is significant.
This would be significant but I think this may be caused by the
script you are running as the trunk build system is significantly
different than the one in branch. The trunk has been stable for me.
To run the samples, as we have not cut a release yet, you will need
to manually create a distribution. This should be pretty
straightforward:
1. In /kernel do 'mvn'
2. In /runtime/standalone run 'mvn'
3. In /core-samples/common run 'mvn install'
4. In /core-samples/ run 'mvn install'
5. Run the calculator:
java -jar ../../../runtime/standalone/smoketest/target/assembly/bin/
launcher.jar target/calc.jar add 2 5
You should see 'result = 7.0'
The launcher syntax is java -jar <path to distribution> <path to
application>
The two parameters '2' and '5' are for the application.
You can also do the same with the loan application statefull
conversational sample except you will not need to build the common
module (Step 3) and instead build /core-samples/loanapplication. Then
run:
java -jar ../../../runtime/standalone/smoketest/target/assembly/bin/
launcher.jar target/loan-application.jar
If you want to remove debug, do (adjusting for your IDE, this works
with IDEA):
java -Xdebug -Xnoagent -Djava.compiler=NONE -
Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -
jar ../../../runtime/standalone/smoketest/target/assembly/bin/
launcher.jar target/loan-application.jar target/loan-application.jar
And start up remote debugging in your IDE. You can also run the
launcher directly in the IDE. If you need to run integration tests,
we have a JUnit component type that is part of the iTest pluging.
This makes righting tests easy as you just create a TestCase and
configure it as an SCA component.
Sorry for having to manually create the distro but once we have the
release set, things should be as simple as just using java -jar <path
to launcher> <sample app>.
Let me know how you get along.
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: LauncherUsage.txt, was: Running Java SCA Calculators sample?
Posted by Simon Laws <si...@googlemail.com>.
On 3/1/07, Jeremy Boynes <jb...@apache.org> wrote:
>
> On Mar 1, 2007, at 1:00 AM, Simon Laws wrote:
> >> Apologies Jeremy. This is entirely my fault. I'm running with the svn
> > client native settings here (
> > http://svn.apache.org/repos/asf/incubator/tuscany/cpp/etc/svn-
> > config) rather
> > than the java setting here (
> > http://svn.apache.org/repos/asf/incubator/tuscany/java/). I'll look
> > to see
> > if we can consolidate, or at least make them the same, as this gets
> > confusing for anyone who has the desire to look at both projects.
>
> We should probably consolidate the two but I'm not sure that this is
> the problem here. Once the property is set then it should be
> respected regardless of the auto-props setting.
>
> For this file, I have:
> $ svn propget svn:eol-style src/test/resources/org/apache/tuscany/sca/
> runtime/standalone/smoketest/LauncherUsage.txt
> native
>
> which AIUI would mean \n on OSX for me and \r\n on Windows for you.
>
> Two things I can think might mess this up:
> * Cygwin's mount options which can give everything Unix still line
> endings
> * Some 'smart' tooling which is somehow overriding the property
>
> Can you try removing this file and checking out again using command-
> line svn client from a genuine Command box and see what you get?
> --
> Jeremy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
> Jeremy
You are correct. It was just cygwin messing things up. Checked out under
Tortoise and all is well.
Thanks for your help.
Simon
Re: LauncherUsage.txt, was: Running Java SCA Calculators sample?
Posted by Jeremy Boynes <jb...@apache.org>.
On Mar 1, 2007, at 1:00 AM, Simon Laws wrote:
>> Apologies Jeremy. This is entirely my fault. I'm running with the svn
> client native settings here (
> http://svn.apache.org/repos/asf/incubator/tuscany/cpp/etc/svn-
> config) rather
> than the java setting here (
> http://svn.apache.org/repos/asf/incubator/tuscany/java/). I'll look
> to see
> if we can consolidate, or at least make them the same, as this gets
> confusing for anyone who has the desire to look at both projects.
We should probably consolidate the two but I'm not sure that this is
the problem here. Once the property is set then it should be
respected regardless of the auto-props setting.
For this file, I have:
$ svn propget svn:eol-style src/test/resources/org/apache/tuscany/sca/
runtime/standalone/smoketest/LauncherUsage.txt
native
which AIUI would mean \n on OSX for me and \r\n on Windows for you.
Two things I can think might mess this up:
* Cygwin's mount options which can give everything Unix still line
endings
* Some 'smart' tooling which is somehow overriding the property
Can you try removing this file and checking out again using command-
line svn client from a genuine Command box and see what you get?
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: LauncherUsage.txt, was: Running Java SCA Calculators sample?
Posted by Simon Laws <si...@googlemail.com>.
On 2/28/07, Jeremy Boynes <jb...@apache.org> wrote:
>
> On Feb 28, 2007, at 1:02 PM, Simon Laws wrote:
>
> > On 2/28/07, Jeremy Boynes <jb...@apache.org> wrote:
> >>
> >> This might be a CRLF issue with the master copy for the test output
> >> as it works for me on OSX (\n type line separators). If so, then
> >> except for aborting the build, it's not significant. Is anyone else
> >> on Windows seeing this as an issue?
> >>
> > Hi Jeremy. As you say the LauncherUsage.txt file has \n alone. I'll
> > give it
> > a spin tommorrow and see what it is checking against. Thanks for
> > "how to
> > run" info, now I've done it that first time it's all a bit clearer.
>
> If you are on Windows and that just has \n then we'll have problems.
> The test code expects the file to have the same line endings as the
> output from the command i.e. \n on Linux/OSX and \r\n on Windows. To
> do that it sets svn:eol-style to "native" which should me \r\n on
> checkout.
>
> Are you using Cygwin? That might have an impact.
> --
> Jeremy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
> Apologies Jeremy. This is entirely my fault. I'm running with the svn
client native settings here (
http://svn.apache.org/repos/asf/incubator/tuscany/cpp/etc/svn-config) rather
than the java setting here (
http://svn.apache.org/repos/asf/incubator/tuscany/java/). I'll look to see
if we can consolidate, or at least make them the same, as this gets
confusing for anyone who has the desire to look at both projects.
Regards
Simon
LauncherUsage.txt, was: Running Java SCA Calculators sample?
Posted by Jeremy Boynes <jb...@apache.org>.
On Feb 28, 2007, at 1:02 PM, Simon Laws wrote:
> On 2/28/07, Jeremy Boynes <jb...@apache.org> wrote:
>>
>> This might be a CRLF issue with the master copy for the test output
>> as it works for me on OSX (\n type line separators). If so, then
>> except for aborting the build, it's not significant. Is anyone else
>> on Windows seeing this as an issue?
>>
> Hi Jeremy. As you say the LauncherUsage.txt file has \n alone. I'll
> give it
> a spin tommorrow and see what it is checking against. Thanks for
> "how to
> run" info, now I've done it that first time it's all a bit clearer.
If you are on Windows and that just has \n then we'll have problems.
The test code expects the file to have the same line endings as the
output from the command i.e. \n on Linux/OSX and \r\n on Windows. To
do that it sets svn:eol-style to "native" which should me \r\n on
checkout.
Are you using Cygwin? That might have an impact.
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Running Java SCA Calculators sample?
Posted by Simon Laws <si...@googlemail.com>.
On 2/28/07, Jeremy Boynes <jb...@apache.org> wrote:
>
> On Feb 28, 2007, at 9:37 AM, Simon Laws wrote:
> > Running
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> > Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
> > 11.657 sec
> > <<< F
> > AILURE!
> > testLauncherUsage(
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestL
> > auncher) Time elapsed: 0.812 sec <<< FAILURE!
> > junit.framework.ComparisonFailure: expected:<......> but was:<...
> > ...>
> > at junit.framework.Assert.assertEquals(Assert.java:81)
> > at junit.framework.Assert.assertEquals (Assert.java:87)
> > at
> > org.apache.tuscany.sca.runtime.standalone.smoketest.CommandTestCase.c
> > ompareOutput(CommandTestCase.java:37)
> > at
> > org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> > .testLauncherUsage(SmokeTestLauncher.java:40)
> >
> > Not sure if this is significant.
>
> Generally, yes - in this case it means that the rest of the build for
> the "runtime" module failed (which would include the webapp and itest
> plugins).
>
> This might be a CRLF issue with the master copy for the test output
> as it works for me on OSX (\n type line separators). If so, then
> except for aborting the build, it's not significant. Is anyone else
> on Windows seeing this as an issue?
>
> > I'm now not sure how to try the calculator sample. I cd to sca/core-
> > samples
> > (from the mail list this seems to be the correct version of the
> > calculator
> > sample [2]) and run
> > "mvn install" but it doesn't seem to do anything. Playing with
> > building
> > various modules this is what seemed to work for me.
> >
> > cd sca/runtime/itest; mvn install
> > cd sca/core-samples/common; mvn install
> > cd sca/core-samples/standalone/calculator; mvn install
>
> We need some updated doco there I think.
>
> I don't think there's any point in building all the samples in one go
> - that's not very useful for users :-) What we might do perhaps at
> the root though is build the common modules, which is what you did
> manually.
>
> For the standlone sample, you don't need to install it, just "mvn
> package" is OK - we should make that the default goal for that
> module. This generates a simple jar that can be run with the launcher:
>
> $ java -jar ${tuscany.installDir}/bin/launcher.jar target/calc.jar
> add 2 5
> result = 7.0
>
> where tuscany.installDir points to the location where you installed
> our distribution (remember, users generally won't be building from
> source, they will be using a release). Given you did build the distro
> from source, you can find versions in your maven repo
> ~/.m2/repository/org/apache/tuscany/sca/runtime/standalone/assembly/
> 1.0-alpha-incubating-SNAPSHOT/
> or in the build tree
> sca/runtime/standalone/assembly/target
>
> Hope that helps
> --
> Jeremy
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
Hi Jeremy. As you say the LauncherUsage.txt file has \n alone. I'll give it
a spin tommorrow and see what it is checking against. Thanks for "how to
run" info, now I've done it that first time it's all a bit clearer.
Simon
Re: Running Java SCA Calculators sample?
Posted by Jeremy Boynes <jb...@apache.org>.
On Feb 28, 2007, at 9:37 AM, Simon Laws wrote:
> Running
> org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
> 11.657 sec
> <<< F
> AILURE!
> testLauncherUsage(
> org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestL
> auncher) Time elapsed: 0.812 sec <<< FAILURE!
> junit.framework.ComparisonFailure: expected:<......> but was:<...
> ...>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at junit.framework.Assert.assertEquals (Assert.java:87)
> at
> org.apache.tuscany.sca.runtime.standalone.smoketest.CommandTestCase.c
> ompareOutput(CommandTestCase.java:37)
> at
> org.apache.tuscany.sca.runtime.standalone.smoketest.SmokeTestLauncher
> .testLauncherUsage(SmokeTestLauncher.java:40)
>
> Not sure if this is significant.
Generally, yes - in this case it means that the rest of the build for
the "runtime" module failed (which would include the webapp and itest
plugins).
This might be a CRLF issue with the master copy for the test output
as it works for me on OSX (\n type line separators). If so, then
except for aborting the build, it's not significant. Is anyone else
on Windows seeing this as an issue?
> I'm now not sure how to try the calculator sample. I cd to sca/core-
> samples
> (from the mail list this seems to be the correct version of the
> calculator
> sample [2]) and run
> "mvn install" but it doesn't seem to do anything. Playing with
> building
> various modules this is what seemed to work for me.
>
> cd sca/runtime/itest; mvn install
> cd sca/core-samples/common; mvn install
> cd sca/core-samples/standalone/calculator; mvn install
We need some updated doco there I think.
I don't think there's any point in building all the samples in one go
- that's not very useful for users :-) What we might do perhaps at
the root though is build the common modules, which is what you did
manually.
For the standlone sample, you don't need to install it, just "mvn
package" is OK - we should make that the default goal for that
module. This generates a simple jar that can be run with the launcher:
$ java -jar ${tuscany.installDir}/bin/launcher.jar target/calc.jar
add 2 5
result = 7.0
where tuscany.installDir points to the location where you installed
our distribution (remember, users generally won't be building from
source, they will be using a release). Given you did build the distro
from source, you can find versions in your maven repo
~/.m2/repository/org/apache/tuscany/sca/runtime/standalone/assembly/
1.0-alpha-incubating-SNAPSHOT/
or in the build tree
sca/runtime/standalone/assembly/target
Hope that helps
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Running Java SCA Calculators sample?
Posted by Jean-Sebastien Delfino <js...@apache.org>.
[snip]
Simon Laws wrote:
> By way of light relief I thought I would try the same on the integration
> branch.
>
> * I was able to build and run the sample in the integration branch in mvn
> but the standalone runtime doesn't seem to be supported here either.
> Is that
> correct?
Correct. You can do the following.
To build the branch:
cd branches/sca-java-integration
mvn
Then cd branches/sca-java-integration/samples/sca/calculator
mvn dependency:copy-dependencies <-- this is temporary until we get a
good Tuscany distribution, it copies all the required jars to a single
./target/dependencies folder so that you don't have to point to them in
your Maven repos.
java -Djava.ext.dirs=target/dependency -jar
target/tuscany-sample-calculator-0.1-integration-incubating-SNAPSHOT.jar
You should see:
3 + 2=5.0
3 - 2=1.0
3 * 2=6.0
3 / 2=1.5
> * Anyhow I took the next step and pulled the project into eclipse and
> it was
> happy to let me debug the test as a JUnit test so I'm set for a bit of
> experimentation.
>
Cool, if others are interested here are the complete steps for an
Eclipse user:
cd branches/sca-java-integration
mvn -Peclipse eclipse:eclipse
In your Eclipse Workbench configure an M2_REPO variable pointing to your
Maven2 repository directory
From the Eclipse Workbench menu bar select File / Import / Existing
Projects into Workspace
Click Next
Select root directory: .../branches/sca-java-integration
Projects for all the modules in the branch will be selected, press Finish
You now have an Eclipse Workspace loaded with all the source code in the
branch, including the samples.
Then it's very simple, you run the calculator sample like any other
normal Java application.
From the Package Explorer view, right click on Project
tuscany-sample-calculator - class src/main/java/calculator.CalculatorClient
Select Run As / Java Application
You should see:
3 + 2=5.0
3 - 2=1.0
3 * 2=6.0
3 / 2=1.5
To run the calculator test case:
From the Package Explorer view, right click on Project
tuscany-sample-calculator - class src/test/java/calculator.CalculatorClient
Select Run As / JUnit Test (or Debug As / JUnit Test)
> I'm assuming that this mode of debugging will also work for Head but I
> haven't tried it yet. I'd be interested to know if there is a general
> mode
> of operation for debugging samples that people have adopted, e.g.
> debug from
>
> standalone runtime
> JUnit tests
> With some clever mvn settings(?) and attach remotely
> System.out :-)
> Something else...
>
I'm usually following the steps I described above to debug in Eclipse.
> Regards
>
> Simon
>
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org