Flickr4Java uses Gradle.
Run gradle tasks from the directory that contains the build.gradle
file.
The following tasks are available:
- Clean up:
gradle clean
- Compile (inc examples):
gradle compileJava
- Compile & test:
gradle build
- Create docs:
gradle javadoc
- Create docs jar:
gradle javadocJar
- Create src jar:
gradle sourcesJar
- Generate Eclipse project files:
gradle cleanEclipse eclipse
- Generate Idea project files:
gradle cleanIdea idea
- Show dependencies (libs etc):
gradle dependencies
To test:
- Copy
src/test/resources/setup.properties.example
tosrc/test/resources/setup.properties
- Run
gradle compiletestjava -q
— compile all sources - Run
gradle setuptests -q
— this will prompt for authorisation and update thesetup.properties
file with the test user's details - Run
gradle test
— can be run asgradle -Dtest.single=NameOfTest test
to run only one test (because the full suite can take quite a while)
(The -q
above just hides some of the more verbose output; it can be left out.)
Most of the tests are integration tests and require hitting the actual Flickr API service with DELETE permissions. The safest and easiest way to do this is to set up a test user account with the following:
- At least one photo with a location set, in at least one album, with exactly 3 tags.
Add this photo's ID as
photoid
andgeo.write.photoid
insetup.properties
. - At least one collection with title and description, containing at least one album
(the ID of the collection should be retrieved manually via the
API explorer
and be added as
collectionid
insetup.properties
). - At least one comment on another user's photo.
- Following at least one other user.
- At least one favorite.
- Allows 'anyone' "to see your stuff on a map".
- A member of at least one group, whose ID is saved as
testgroupid
. - A gallery, containing at least one photo.
- An "own Flickr address" set to
username
(see below). - [List is incomplete]
The last few keys in the setup.properties
need to be as follows:
- Set the following keys in
setup.properties
to match your test user:nsid
,username
,displayname
, andemail
. - Point
imagefile
to a test image that will be uploaded (and then deleted).