AAFC-BICoE/android-mock-ws

Name: android-mock-ws

Owner: Biological Informatics CoE @ Agriculture and Agri-Food Canada

Owner: Biological Informatics CoE @ Agriculture and Agri-Food Canada

Description: Mock json web services for seqdb Android project

Created: 2013-11-25 12:02:49.0

Updated: 2014-01-23 18:55:18.0

Pushed: 2014-01-23 18:55:17.0

Homepage: null

Size: 176

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

What

Build

-DskipTests clean compile assembly:single

Run

rt CLASSPATH=target/android-mock-ws-1.0-SNAPSHOT-jar-with-dependencies.jar
 ca.gc.agr.mbb.androidmockws.AndroidMockWS

Starts web server on port 4567

Note: needs java 1.7.x

URLs to try

List all available URLs (including explicit failure URLs)

URL: http://localhost:4567/v1



{
    "description": "container",
    "path": "/v1/container",
    "url": "http://localhost:4567/v1/container"
},
{
    "description": "container count",
    "path": "/v1/container/count/",
    "url": "http://localhost:4567/v1/container/count/"
},
{
    "description": "location",
    "path": "/v1/location",
    "url": "http://localhost:4567/v1/location"
},


ontent removed]


{
    "description": "storage count",
    "url": "http://localhost:4567/v1/storage/count/?FORCE_TEST_HTTP_RESPONSE=400"
},
{
    "description": "storage count",
    "url": "http://localhost:4567/v1/storage/count/?FORCE_TEST_HTTP_RESPONSE=404"
},
{
    "description": "storage count",
    "url": "http://localhost:4567/v1/storage/count/?FORCE_TEST_HTTP_RESPONSE=405"
}


Get count of specimen replicates

URL: http://localhost:4567/v1/specimenReplicate/count/ (Note trailing slash)

Should result in something like:


"type": "specimenReplicates",
"count": 9992

Get all specimen replicate GET URIs

URL: http://localhost:4567/v1/specimenReplicate/

This should result in something like:



"total": 9992,
"limit": 100,
"offset": 0,
"type": "specimenReplicate",
"nextPageUrl": "http://localhost:4567/v1/specimenReplicate?offset=100&limit=100",
"uris": [
    "http://localhost:4567/v1/specimenReplicate/941756",
    "http://localhost:4567/v1/specimenReplicate/922332",
    "http://localhost:4567/v1/specimenReplicate/287714",
    "http://localhost:4567/v1/specimenReplicate/131839",
    "http://localhost:4567/v1/specimenReplicate/710279",
"http://localhost:4567/v1/specimenReplicate/555856",


ontent removed]


    "http://localhost:4567/v1/specimenReplicate/271727",
    "http://localhost:4567/v1/specimenReplicate/645653"
]


Get a single specimen replicate record by primary key

Now, use one of the above to get the full record: URL: (http://localhost:4567/v1/specimenReplicate/941756)[http://localhost:4567/v1/specimenReplicate/941756]

Should result in something like:


"primaryKey": 941756,
"name": "mbyfolp",
"state": "xmbjptcnkuhv",
"specimenIdentifier": 77596,
"version": "zsi",
"contents": "iliqhjyqorcn",
"notes": "qrkhfmyqyemch tltg z",
"storageMedium": "minm sg t owioggbbuf",
"startDate": "2010-01-05 10:02:12",
"revivalDate": "2014-08-01 01:54:12",
"dateDestroyed": "2010-07-18 04:46:12",
"parent": "http://localhost:4567/v1/specimenReplicate/764673",
"location": {
    "containerNumber": 7,
    "storageUnit": 1,
    "compartment": 2,
    "shelf": 3,
    "rack": 1,
    "dateMoved": "2010-05-12 22:26:12",
    "wellColumn": 1,
    "wellRow": "f"
}

TODO

  1. Move to Jersey from Spark
  2. Command line set port number
  3. POST/PUT for specimen replicate
  4. Add version to json returned
  5. implement one or two other seqdb objects

What

Build

-DskipTests clean compile assembly:single

Run

rt CLASSPATH=target/android-mock-ws-1.0-SNAPSHOT-jar-with-dependencies.jar
 ca.gc.agr.mbb.androidmockws.AndroidMockWS

Starts web server on port 4567

Note: needs java 1.7.x

URLs to try

List all available URLs (including explicit failure URLs)

URL: http://localhost:4567/v1



{
    "description": "container",
    "path": "/v1/container",
    "url": "http://localhost:4567/v1/container"
},
{
    "description": "container count",
    "path": "/v1/container/count/",
    "url": "http://localhost:4567/v1/container/count/"
},
{
    "description": "location",
    "path": "/v1/location",
    "url": "http://localhost:4567/v1/location"
},


ontent removed]


{
    "description": "storage count",
    "url": "http://localhost:4567/v1/storage/count/?FORCE_TEST_HTTP_RESPONSE=400"
},
{
    "description": "storage count",
    "url": "http://localhost:4567/v1/storage/count/?FORCE_TEST_HTTP_RESPONSE=404"
},
{
    "description": "storage count",
    "url": "http://localhost:4567/v1/storage/count/?FORCE_TEST_HTTP_RESPONSE=405"
}


Get count of specimen replicates

URL: http://localhost:4567/v1/specimenReplicate/count/ (Note trailing slash)

Should result in something like:


"type": "specimenReplicates",
"count": 9992

Get all specimen replicate GET URIs

URL: http://localhost:4567/v1/specimenReplicate/

This should result in something like:



"total": 9992,
"limit": 100,
"offset": 0,
"type": "specimenReplicate",
"nextPageUrl": "http://localhost:4567/v1/specimenReplicate?offset=100&limit=100",
"uris": [
    "http://localhost:4567/v1/specimenReplicate/941756",
    "http://localhost:4567/v1/specimenReplicate/922332",
    "http://localhost:4567/v1/specimenReplicate/287714",
    "http://localhost:4567/v1/specimenReplicate/131839",
    "http://localhost:4567/v1/specimenReplicate/710279",
"http://localhost:4567/v1/specimenReplicate/555856",


ontent removed]


    "http://localhost:4567/v1/specimenReplicate/271727",
    "http://localhost:4567/v1/specimenReplicate/645653"
]


Get a single specimen replicate record by primary key

Now, use one of the above to get the full record: URL: (http://localhost:4567/v1/specimenReplicate/941756)[http://localhost:4567/v1/specimenReplicate/941756]

Should result in something like:


"primaryKey": 941756,
"name": "mbyfolp",
"state": "xmbjptcnkuhv",
"specimenIdentifier": 77596,
"version": "zsi",
"contents": "iliqhjyqorcn",
"notes": "qrkhfmyqyemch tltg z",
"storageMedium": "minm sg t owioggbbuf",
"startDate": "2010-01-05 10:02:12",
"revivalDate": "2014-08-01 01:54:12",
"dateDestroyed": "2010-07-18 04:46:12",
"parent": "http://localhost:4567/v1/specimenReplicate/764673",
"location": {
    "containerNumber": 7,
    "storageUnit": 1,
    "compartment": 2,
    "shelf": 3,
    "rack": 1,
    "dateMoved": "2010-05-12 22:26:12",
    "wellColumn": 1,
    "wellRow": "f"
}

TODO

  1. Move to Jersey from Spark
  2. Command line set port number
  3. POST/PUT for specimen replicate
  4. Add version to json returned
  5. implement one or two other seqdb objects

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.