peter-lawrey / HugeCollections-OLD

Huge Collections for Java using efficient off heap storage
273 stars 51 forks source link

how to get exactly 1 OpenHFT test to run #26

Closed Cotton-Ben closed 10 years ago

Cotton-Ben commented 10 years ago

Sorry I am abusing you guys with mvn questions but stackOverflow gave me no remedy. Here is what I try

cd /apps/OpenHFT/
mvn -pl HugeCollections  \
       -Dtest=net.openhft.collections.fromdocs.OpenJDKAndHashMapExampleTest#bondExample \
      test

but after hacking at this, I can't get past the message /"[ERROR] failed to execute goal: maven-surefire-plugin .... (default-test) on project: No tests were executed!"/

any ideas? and again sorry to be a bother. I am doing lots of OpenHFT demos and this demo requires I demo the capability from a KornShell cmd line (not IntelliJ)

Thanks.

RobAustin commented 10 years ago

Maybe check the directory that you are running from :

this works for me :

/Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections

Robs-iMac:collections robaustin$ mvn -Dtest=TCPSocketReplication4WayMapTest#test test [INFO] Scanning for projects... [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building OpenHFT/HugeCollections/collections 3.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ collections --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ collections --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-bundle-plugin:2.4.0:manifest (default) @ collections --- [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ collections --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ collections --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.16:test (default-test) @ collections --- [INFO] Surefire report directory: /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/target/surefire-reports


T E S T S

Running net.openhft.collections.TCPSocketReplication4WayMapTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.568 sec - in net.openhft.collections.TCPSocketReplication4WayMapTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.565 s [INFO] Finished at: 2014-05-29T22:22:05+00:00 [INFO] Final Memory: 13M/97M [INFO] ------------------------------------------------------------------------ Robs-iMac:collections robaustin$

Sorry I am abusing you guys with mvn questions but stackOverflow gave me no remedy. Here is what I try

cd /apps/OpenHFT/ mvn -pl HugeCollections \ -Dtest=net.openhft.collections.fromdocs.OpenJDKAndHashMapExampleTest#bondExample \ test but after hacking at this, I can't get past the message /"[ERROR] failed to execute goal: maven-surefire-plugin .... (default-test) on project: No tests were executed!"/

any ideas? and again sorry to be a bother. I am doing lots of OpenHFT demos and this demo requires I demo the capability from a KornShell cmd line (not IntelliJ)

Thanks,

— Reply to this email directly or view it on GitHub.

Cotton-Ben commented 10 years ago

Hmmm. Weird. Not working for me. Still getting "No test executed"

Would you mind trying this, Rob?

cd /Users/robaustin/IdeaProjects/OpenHFT/
mvn -pl HugeCollections/collections -Dtest=TCPSocketReplication4WayMapTest#test  test
mvn -pl HugeCollections/collections  -Dtest=OpenJDKAndHashMapExampleTest#bondExample  test

did both those 1x test via mvn invokes work perfectly for you?

P.S. Thanks for the help!

Cotton-Ben commented 10 years ago

what's really weird ... if I run all tests from /apps/OpenHFT root ... they all pass. Only when I try to isolate a single test from the KornShell with the mvn cmd line do run do I get "No test executed". Isolating this same single test in IntelliJ (of course) works perfectly.

RobAustin commented 10 years ago

/Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections Robs-iMac:collections robaustin$ mvn -Dtest=TCPSocketReplication4WayMapTest#test test [INFO] Scanning for projects... [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building OpenHFT/HugeCollections/collections 3.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ collections --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ collections --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-bundle-plugin:2.4.0:manifest (default) @ collections --- [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ collections --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ collections --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.16:test (default-test) @ collections --- [INFO] Surefire report directory: /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/target/surefire-reports


T E S T S

Running net.openhft.collections.TCPSocketReplication4WayMapTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.56 sec - in net.openhft.collections.TCPSocketReplication4WayMapTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.328 s [INFO] Finished at: 2014-05-29T23:03:46+00:00 [INFO] Final Memory: 13M/97M [INFO] ------------------------------------------------------------------------ On 29 May 2014, at 22:50, Ben Cotton notifications@github.com wrote:

mvn -pl HugeCollections/collections -Dtest=TCPSocketReplication4WayMapTest#test test

RobAustin commented 10 years ago

yes, if I run this

mvn -Dtest=TCPSocketReplication4WayMapTest#test test

from the shell outside of idea, I get this

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project affinity: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]

On 29 May 2014, at 22:55, Ben Cotton notifications@github.com wrote:

what's really weird ... if I run all tests from /apps/OpenHFT root ... they all pass. Only when I try to isolate a single test from the KornShell with the mvn cmd line do run do I get "No test executed". Isolating this same single test in IntelliJ (of course) works perfectly.

— Reply to this email directly or view it on GitHub.

RobAustin commented 10 years ago

if you do this, it won’t fail

mvn -Dtest=TCPSocketReplication4WayMapTest#test -DfailIfNoTests=false test

alternatively, run the test from the root PROJECT directory ( then its fine ),

Robs-iMac:collections robaustin$ pwd /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections Robs-iMac:collections robaustin$ mvn -Dtest=TCPSocketReplication4WayMapTest#test test [INFO] Scanning for projects... [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building OpenHFT/HugeCollections/collections 3.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ collections --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ collections --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-bundle-plugin:2.4.0:manifest (default) @ collections --- [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ collections --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ collections --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.16:test (default-test) @ collections --- [INFO] Surefire report directory: /Users/robaustin/IdeaProjects/OpenHFT/HugeCollections/collections/target/surefire-reports


T E S T S

Running net.openhft.collections.TCPSocketReplication4WayMapTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.446 sec - in net.openhft.collections.TCPSocketReplication4WayMapTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.198 s [INFO] Finished at: 2014-05-29T23:12:15+00:00 [INFO] Final Memory: 13M/97M [INFO] ————————————————————————————————————

On 29 May 2014, at 23:08, rob_austin@icloud.com wrote:

yes, if I run this

mvn -Dtest=TCPSocketReplication4WayMapTest#test test

from the shell outside of idea, I get this

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project affinity: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]

On 29 May 2014, at 22:55, Ben Cotton notifications@github.com wrote:

what's really weird ... if I run all tests from /apps/OpenHFT root ... they all pass. Only when I try to isolate a single test from the KornShell with the mvn cmd line do run do I get "No test executed". Isolating this same single test in IntelliJ (of course) works perfectly.

— Reply to this email directly or view it on GitHub.

Cotton-Ben commented 10 years ago

Ah, the glory! :)

But, what a bizarre remedy ...

Thanks Rob.

RobAustin commented 10 years ago

No Problem, pleased I could help.

Rob

On 29 May 2014, at 23:21, Ben Cotton notifications@github.com wrote:

Ah, the glory! :)

But, what a bizarre remedy ...

Thanks Rob.

— Reply to this email directly or view it on GitHub.

peter-lawrey commented 10 years ago

You can do this from maven, or in IntelliJ you can right click on the code for the test and select Run test. This will run one test, and you can debug/profile that test from your IDE as well.

On 29 May 2014 23:21, Ben Cotton notifications@github.com wrote:

Closed #26 https://github.com/OpenHFT/HugeCollections/issues/26.

— Reply to this email directly or view it on GitHub https://github.com/OpenHFT/HugeCollections/issues/26#event-126207219.

Cotton-Ben commented 10 years ago

Yes. intelliJ was never a problem (as you say ... it is a right-click does what you want dream tool). The challenge was from the KornShell ... which is what we have to be able to demo from .... to pacify some peoples' jaded outlooks (i.e." I don't trust it unless I see it done from the Korn shell" types) ... you know the kind.

We're good now! THANKS!