Changeset 3190
- Timestamp:
- 07/25/13 09:19:47 (11 years ago)
- Location:
- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/NotebookResource.java
r3189 r3190 135 135 @DefaultValue("0") @QueryParam(value = "orderingMode") final int orderingMode) { 136 136 List<AnnotationIdentifier> annotationIds = notebookDao.getAnnotationExternalIDs(new NotebookIdentifier(notebookId)); 137 137 138 return annotationIds; 138 139 // TODO implement optional parameters!! -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationsTest.java
r3186 r3190 25 25 import eu.dasish.annotation.backend.identifiers.AnnotationIdentifier; 26 26 import eu.dasish.annotation.schema.Annotation; 27 import eu.dasish.annotation.schema.Annotation;28 27 import eu.dasish.annotation.schema.ObjectFactory; 29 28 import java.sql.SQLException; 30 29 import javax.ws.rs.core.GenericEntity; 31 30 import javax.ws.rs.core.MediaType; 32 import javax.xml.bind.JAXBElement;33 31 import org.jmock.Expectations; 34 32 import org.junit.Test; -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/NotebookResourceTest.java
r3189 r3190 54 54 @Autowired 55 55 private NotebookDao notebookDao; 56 @Autowired57 private AnnotationDao annotationDao;58 56 @Autowired 59 57 private NotebookResource notebookResource; … … 167 165 168 166 @Test 169 public void test AllAnnotations() {167 public void testGetAllAnnotations() { 170 168 System.out.println("test getAllAnnotations"); 171 169 final String notebookIdentifier= TestBackendConstants._TEST_NOTEBOOK_1_EXT; -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/NotebooksTest.java
r3189 r3190 26 26 import eu.dasish.annotation.backend.identifiers.NotebookIdentifier; 27 27 import eu.dasish.annotation.backend.identifiers.UserIdentifier; 28 import eu.dasish.annotation.schema.Annotation;29 28 import eu.dasish.annotation.schema.Notebook; 30 29 import eu.dasish.annotation.schema.NotebookInfo; … … 36 35 import java.util.List; 37 36 import java.util.UUID; 37 import javax.ws.rs.core.EntityTag; 38 38 import javax.ws.rs.core.MediaType; 39 39 import javax.xml.bind.JAXBElement; … … 175 175 */ 176 176 @Test 177 @Ignore178 177 public void testGetAllAnnotations() { 179 System.out.println("test GetAllAnnotations");180 181 System.out.println("test GetMetadata");182 183 final String notebookIdentifier= TestBackendConstants._TEST_NOTEBOOK_1_EXT;184 /*final int notebookID = TestBackendConstants._TEST_NOTEBOOK_1_INT;185 final NotebookInfo testInfo = new ObjectFactory().createNotebookInfo();186 187 mockery.checking(new Expectations() { 188 { 189 oneOf(notebookDao).get NotebookID(new NotebookIdentifier(notebookIdentifier));190 will(returnValue( notebookID));178 System.out.println("test GetMetadata"); 179 final String notebookIdentifier= TestBackendConstants._TEST_NOTEBOOK_1_EXT; 180 final AnnotationIdentifier aIdOne= new AnnotationIdentifier(TestBackendConstants._TEST_ANNOT_1_EXT); 181 final AnnotationIdentifier aIdTwo= new AnnotationIdentifier(TestBackendConstants._TEST_ANNOT_2_EXT); 182 final List<AnnotationIdentifier> annotationIds = new ArrayList<AnnotationIdentifier>(); 183 annotationIds.add(aIdOne); 184 annotationIds.add(aIdTwo); 185 186 mockery.checking(new Expectations() { 187 { 188 oneOf(notebookDao).getAnnotationExternalIDs(new NotebookIdentifier(notebookIdentifier)); 189 will(returnValue(annotationIds)); 191 190 192 oneOf(notebookDao).getNotebookInfo(notebookID); 193 will(returnValue(testInfo)); 194 } 195 });*/ 191 } 192 }); 196 193 197 194 final String requestUrl = "notebooks/"+notebookIdentifier; 198 199 200 195 ClientResponse response = resource().path(requestUrl) 201 196 .queryParam("maximumAnnotations", "123") … … 205 200 .get(ClientResponse.class); 206 201 System.out.println("requestUrl: " + requestUrl); 207 208 209 assertEquals( 200, response.getStatus());210 202 assertEquals(200, response.getStatus()); 203 List<AnnotationIdentifier> result = response.getEntity(new GenericType<List<AnnotationIdentifier>>() {}); 204 assertEquals(aIdOne, result.get(0)); 205 assertEquals(aIdTwo, result.get(1)); 211 206 } 212 207
Note: See TracChangeset
for help on using the changeset viewer.