huuanh1987 / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

JUnit testing framework that can test methods which require a session #141

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please find a patch enclosed which supports JUnit testing of required
session methods and works under Java 5. Instead of using the Java 6 Desktop
API to open a browser, I've imported a 3rd party library to do it with Java 5.

Please note that if any of the tests don't work for you, you don't need to
comment it out... you can just use:
-Dmaven.test.skip=true

Thanks,
Dave

Original issue reported on code.google.com by david.j....@googlemail.com on 16 Nov 2008 at 7:35

Attachments:

GoogleCodeExporter commented 8 years ago
nice thank you.  I applied the patch, but with tests disabled still.. I'll 
start to
play with it and see how it goes.

I set the maven.test.skip property to default to true ( top level pom.xml )

So for now, if you want to run the tests.. -Dmaven.test.skip=false

:) :)

Original comment by fern...@gmail.com on 18 Nov 2008 at 2:27

GoogleCodeExporter commented 8 years ago
actually I modified a few things.

I wasn't sure how you setup your System Properties, if there was a short cut or
something, but I did it on the command line.  For that I had to change the
maven.test.skip to be test.skip ( so it can default to off ), and I changed 
API_KEY
to just APIKEY, just be a punk. :)

maven -Dtest.skip=false -DAPIKEY=.... -DSECRET=..... clean install

Original comment by fern...@gmail.com on 18 Nov 2008 at 2:49

GoogleCodeExporter commented 8 years ago
This works well for me. Thanks! This issue can be marked as verified / closed.

Original comment by david.j....@googlemail.com on 18 Nov 2008 at 9:30

GoogleCodeExporter commented 8 years ago
You can do follow
1. Edit your maven2 setting.xml (~/.m2/setting.xml)
2. Add tags: 
<profiles>
      <profile>
        <id>default</id>
        <properties>
          <APIKEY>APIKEY HERE</APIKEY>
          <SECRET>SECRET HERE</SECRET>
          <test.skip>false</test.skip>
        </properties>
      </profile>
    </profiles>
   <activeProfiles>
      <activeProfile>default</activeProfile>
   </activeProfiles>
3. run mvn clean install without any properties

Original comment by rdmytre...@gmail.com on 18 Nov 2008 at 10:34

GoogleCodeExporter commented 8 years ago
thank you erka. that's a good idea.  Also I guess we can setup different 
profiles,
and activate them on the command line with "-P".  Thank you for the example! :)

david.j.boden: hey, I sent you a private email, since I assumed you had a gmail
account.. if that is not the case, can you send me an email.. mine should be 
fernman
at gmail

Original comment by fern...@gmail.com on 18 Nov 2008 at 4:28