You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Kevin Jin <kj...@google.com> on 2008/09/24 20:00:19 UTC

Can someone help me investigate a problem in 'mvn test' for java/server?

I recently added a test to java/server sub-project. It works when I
run it in the sub-dir, but fails when I run it in the Shindig root
dir.
Please take a look at
java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTest.java.
My new test is testTemplates. Other tests in the same class works when
started in either dir.
I'm new to Maven. Can someone help me find the reason of different
behaviors based on starting location?
My first guess was the relative paths used in my test. I tried moving
all {js,xml} files into the same dir as files used in other tests
(java/server/src/test/resources/endtoend), but that didn't help. I'm
most interested in this weird thing:
This test starts a Jetty server at port 9003. Interestingly, I don't
see any listener on this port when run in root dir, while it works as
expected when run in java/server.
The command for testing (you need to uncomment testTemplates in the java file):
  mvn test -Dtest=EndToEndTest
The command for checking Jetty server:
  fuser -4 9003/tcp 2>/dev/null
Thanks in advance,

-- 
-Kevin

Re: Can someone help me investigate a problem in 'mvn test' for java/server?

Posted by Ian Boston <ie...@tfd.co.uk>.
try
mvn clean install
mvn -Prun

in the base directory.


if you just do
mvn
mvn -Prun

it doesnt do the clean step so you it will only update modified files.

Also,
any file in a .svn directory or its children it part of the svn  
contol structure and nothing to do with your working source tree. If  
you want svn to continue to work you must not touch these files.

HTH
Ian

On 24 Sep 2008, at 20:58, Kevin Jin wrote:

> I figured out the reason for different results:
> shindig-server depends on shindig-features.
> The test for shindig-server was OK at first, so both shindig-project
> and shindig-servert built successfully.
> Later shindig-features/opensocial-templates/container.js was changed
> that broke the test of shindig-server.
> After I sync'ed the change, I first did 'mvn' in the root dir, to get
> all sub-projects built. This step failed because shindig-server failed
> test. Now comes the tricky part:
> Maven *remembers* the last good build and uses that version of the
> changed file (saved as
> features/opensocial-templates/.svn/text-base/container.js.svn-base),
> so shindig-server passes test when run alone!
> That's confusing, especially to Maven newbies. Is there any option to
> change this behavior?
>
> As to the problem of the changed JS file, I have enough context to
> solve it. Thanks!
>
> On Wed, Sep 24, 2008 at 11:00 AM, Kevin Jin <kj...@google.com> wrote:
>> I recently added a test to java/server sub-project. It works when I
>> run it in the sub-dir, but fails when I run it in the Shindig root
>> dir.
>> Please take a look at
>> java/server/src/test/java/org/apache/shindig/server/endtoend/ 
>> EndToEndTest.java.
>> My new test is testTemplates. Other tests in the same class works  
>> when
>> started in either dir.
>> I'm new to Maven. Can someone help me find the reason of different
>> behaviors based on starting location?
>> My first guess was the relative paths used in my test. I tried moving
>> all {js,xml} files into the same dir as files used in other tests
>> (java/server/src/test/resources/endtoend), but that didn't help. I'm
>> most interested in this weird thing:
>> This test starts a Jetty server at port 9003. Interestingly, I don't
>> see any listener on this port when run in root dir, while it works as
>> expected when run in java/server.
>> The command for testing (you need to uncomment testTemplates in  
>> the java file):
>>  mvn test -Dtest=EndToEndTest
>> The command for checking Jetty server:
>>  fuser -4 9003/tcp 2>/dev/null
>> Thanks in advance,
>>
>> --
>> -Kevin
>>
>
>
>
> -- 
> -Kevin


Re: Can someone help me investigate a problem in 'mvn test' for java/server?

Posted by Adam Winer <aw...@google.com>.
On Wed, Sep 24, 2008 at 5:58 PM, Kevin Jin <kj...@google.com> wrote:
> I figured out the reason for different results:
> shindig-server depends on shindig-features.
> The test for shindig-server was OK at first, so both shindig-project
> and shindig-servert built successfully.
> Later shindig-features/opensocial-templates/container.js was changed
> that broke the test of shindig-server.
> After I sync'ed the change, I first did 'mvn' in the root dir, to get
> all sub-projects built. This step failed because shindig-server failed
> test. Now comes the tricky part:
> Maven *remembers* the last good build and uses that version of the
> changed file (saved as
> features/opensocial-templates/.svn/text-base/container.js.svn-base),

Maven doesn't look in .svn for anything.  It's using your local
repository (typically ~/.m2/repository) to find the existing SNAPSHOT
builds of the dependencies.

-- Adam

> so shindig-server passes test when run alone!
> That's confusing, especially to Maven newbies. Is there any option to
> change this behavior?
>
> As to the problem of the changed JS file, I have enough context to
> solve it. Thanks!
>
> On Wed, Sep 24, 2008 at 11:00 AM, Kevin Jin <kj...@google.com> wrote:
>> I recently added a test to java/server sub-project. It works when I
>> run it in the sub-dir, but fails when I run it in the Shindig root
>> dir.
>> Please take a look at
>> java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTest.java.
>> My new test is testTemplates. Other tests in the same class works when
>> started in either dir.
>> I'm new to Maven. Can someone help me find the reason of different
>> behaviors based on starting location?
>> My first guess was the relative paths used in my test. I tried moving
>> all {js,xml} files into the same dir as files used in other tests
>> (java/server/src/test/resources/endtoend), but that didn't help. I'm
>> most interested in this weird thing:
>> This test starts a Jetty server at port 9003. Interestingly, I don't
>> see any listener on this port when run in root dir, while it works as
>> expected when run in java/server.
>> The command for testing (you need to uncomment testTemplates in the java file):
>>  mvn test -Dtest=EndToEndTest
>> The command for checking Jetty server:
>>  fuser -4 9003/tcp 2>/dev/null
>> Thanks in advance,
>>
>> --
>> -Kevin
>>
>
>
>
> --
> -Kevin
>

Re: Can someone help me investigate a problem in 'mvn test' for java/server?

Posted by Kevin Jin <kj...@google.com>.
I figured out the reason for different results:
shindig-server depends on shindig-features.
The test for shindig-server was OK at first, so both shindig-project
and shindig-servert built successfully.
Later shindig-features/opensocial-templates/container.js was changed
that broke the test of shindig-server.
After I sync'ed the change, I first did 'mvn' in the root dir, to get
all sub-projects built. This step failed because shindig-server failed
test. Now comes the tricky part:
Maven *remembers* the last good build and uses that version of the
changed file (saved as
features/opensocial-templates/.svn/text-base/container.js.svn-base),
so shindig-server passes test when run alone!
That's confusing, especially to Maven newbies. Is there any option to
change this behavior?

As to the problem of the changed JS file, I have enough context to
solve it. Thanks!

On Wed, Sep 24, 2008 at 11:00 AM, Kevin Jin <kj...@google.com> wrote:
> I recently added a test to java/server sub-project. It works when I
> run it in the sub-dir, but fails when I run it in the Shindig root
> dir.
> Please take a look at
> java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndTest.java.
> My new test is testTemplates. Other tests in the same class works when
> started in either dir.
> I'm new to Maven. Can someone help me find the reason of different
> behaviors based on starting location?
> My first guess was the relative paths used in my test. I tried moving
> all {js,xml} files into the same dir as files used in other tests
> (java/server/src/test/resources/endtoend), but that didn't help. I'm
> most interested in this weird thing:
> This test starts a Jetty server at port 9003. Interestingly, I don't
> see any listener on this port when run in root dir, while it works as
> expected when run in java/server.
> The command for testing (you need to uncomment testTemplates in the java file):
>  mvn test -Dtest=EndToEndTest
> The command for checking Jetty server:
>  fuser -4 9003/tcp 2>/dev/null
> Thanks in advance,
>
> --
> -Kevin
>



-- 
-Kevin