Changeset 3452
- Timestamp:
- 08/21/13 09:47:33 (11 years ago)
- Location:
- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend
- Files:
-
- 2 added
- 6 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/nb-configuration.xml
r3450 r3452 24 24 <config-file>src/test/resources/spring-test-config/mockVersionDao.xml</config-file> 25 25 <config-file>src/test/resources/spring-test-config/mockDaoDispatcher.xml</config-file> 26 <config-file>src/main/resources/spring-config/daoDispatcher.xml</config-file> 26 27 </config-files> 27 28 <config-file-groups/> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/DaoDispatcherImpl.java
r3448 r3452 16 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 17 */ 18 package eu.dasish.annotation.backend. rest;18 package eu.dasish.annotation.backend.dao.impl; 19 19 20 20 import eu.dasish.annotation.backend.Helpers; 21 21 import eu.dasish.annotation.backend.dao.AnnotationDao; 22 22 import eu.dasish.annotation.backend.dao.CachedRepresentationDao; 23 import eu.dasish.annotation.backend.dao.DaoDispatcher; 23 24 import eu.dasish.annotation.backend.dao.NotebookDao; 24 25 import eu.dasish.annotation.backend.dao.SourceDao; … … 45 46 import java.util.Map; 46 47 import org.springframework.beans.factory.annotation.Autowired; 47 import org.springframework.stereotype.Component;48 48 49 49 /** … … 51 51 * @author olhsha 52 52 */ 53 @Component 54 public class DaoDispatcher{53 public class DaoDispatcherImpl implements DaoDispatcher 54 { 55 55 56 56 @Autowired … … 69 69 ///////////// GETTERS ////////////////////////// 70 70 71 @Override 71 72 public Number getAnnotationInternalIdentifier(AnnotationIdentifier annotationIdentifier) { 72 73 return annotationDao.getInternalID(annotationIdentifier); 73 74 } 74 75 76 @Override 75 77 public AnnotationIdentifier getAnnotationExternalIdentifier(Number annotationID) { 76 78 return annotationDao.getExternalID(annotationID); 77 79 } 78 80 81 @Override 79 82 public Number getUserInternalIdentifier(UserIdentifier userIdentifier) { 80 83 return userDao.getInternalID(userIdentifier); 81 84 } 82 85 86 @Override 83 87 public UserIdentifier getUserExternalIdentifier(Number userID) { 84 88 return userDao.getExternalID(userID); 85 89 } 86 90 91 @Override 87 92 public Annotation getAnnotation(Number annotationID) throws SQLException { 88 93 Annotation result = annotationDao.getAnnotationWithoutSources(annotationID); … … 104 109 105 110 //////////////////////////////////////////////////////////////////////// 111 @Override 106 112 public List<Number> getFilteredAnnotationIDs(String link, String text, String access, String namespace, UserIdentifier owner, Timestamp after, Timestamp before) { 107 113 … … 127 133 128 134 135 @Override 129 136 public Number[] addCachedForVersion(Number versionID, CachedRepresentationInfo cached) { 130 137 Number[] result = new Number[2]; … … 139 146 140 147 148 @Override 141 149 public Number[] addSiblingVersionForSource(Number sourceID, Version version) throws SQLException { 142 150 Number[] result = new Number[2]; … … 150 158 151 159 160 @Override 152 161 public Map<String, String> addSourcesForAnnotation(Number annotationID, List<NewOrExistingSourceInfo> sources) throws SQLException { 153 162 Map<String, String> result = new HashMap<String, String>(); … … 170 179 171 180 181 @Override 172 182 public Number addUsersAnnotation(Annotation annotation, Number userID) throws SQLException { 173 183 … … 190 200 ////////////// DELETERS ////////////////// 191 201 202 @Override 192 203 public int[] deleteCachedOfVersion(Number versionID, Number cachedID) { 193 204 int[] result = new int[2]; … … 202 213 } 203 214 215 @Override 204 216 public int[] deleteAllCachedOfVersion(Number versionID) { 205 217 int[] result = new int[3]; … … 223 235 224 236 237 @Override 225 238 public int[] deleteAllVersionsOfSource(Number sourceID) throws SQLException { 226 239 int[] result = new int[3]; … … 244 257 245 258 259 @Override 246 260 public int[] deleteAnnotation(Number annotationID) throws SQLException { 247 261 int[] result = new int[4]; -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java
r3448 r3452 19 19 20 20 import eu.dasish.annotation.backend.BackendConstants; 21 import eu.dasish.annotation.backend.dao.DaoDispatcher; 21 22 import eu.dasish.annotation.backend.identifiers.AnnotationIdentifier; 22 23 import eu.dasish.annotation.backend.identifiers.UserIdentifier; … … 35 36 import javax.ws.rs.core.MediaType; 36 37 import javax.xml.bind.JAXBElement; 38 import org.springframework.beans.factory.annotation.Autowired; 37 39 import org.springframework.stereotype.Component; 38 40 … … 44 46 @Path("/annotations") 45 47 public class AnnotationResource { 46 48 49 @Autowired 47 50 private DaoDispatcher daoDispatcher; 48 51 @Context -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/MockObjectsFactory.java
r3450 r3452 24 24 import eu.dasish.annotation.backend.dao.UserDao; 25 25 import eu.dasish.annotation.backend.dao.VersionDao; 26 import eu.dasish.annotation.backend. rest.DaoDispatcher;26 import eu.dasish.annotation.backend.dao.DaoDispatcher; 27 27 import org.jmock.Mockery; 28 28 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/DaoDispatcherTest.java
r3448 r3452 16 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 17 */ 18 package eu.dasish.annotation.backend. rest;18 package eu.dasish.annotation.backend.dao.impl; 19 19 20 20 import eu.dasish.annotation.backend.Helpers; … … 45 45 import java.sql.Timestamp; 46 46 import java.util.ArrayList; 47 import java.util.HashMap;48 47 import java.util.List; 49 48 import java.util.Map; … … 65 64 @ContextConfiguration({"/spring-test-config/dataSource.xml", "/spring-test-config/mockery.xml", "/spring-test-config/mockAnnotationDao.xml", 66 65 "/spring-test-config/mockUserDao.xml", "/spring-test-config/mockNotebookDao.xml", 67 "/spring-test-config/mockSourceDao.xml", "/spring-test-config/mockVersionDao.xml", "/spring-test-config/mockCachedRepresentationDao.xml"}) 66 "/spring-test-config/mockSourceDao.xml", "/spring-test-config/mockVersionDao.xml", "/spring-test-config/mockCachedRepresentationDao.xml", 67 "/spring-config/daoDispatcher.xml"}) 68 68 public class DaoDispatcherTest { 69 69 70 70 @Autowired 71 private DaoDispatcher daoDispatcher;71 private DaoDispatcherImpl daoDispatcher; 72 72 @Autowired 73 73 private Mockery mockery; … … 91 91 ///////// GETTERS ///////////// 92 92 /** 93 * Test of getAnnotationInternalIdentifier method, of class DaoDispatcher .93 * Test of getAnnotationInternalIdentifier method, of class DaoDispatcherImpl. 94 94 */ 95 95 @Test … … 108 108 109 109 /** 110 * Test of getAnnotationExternalIdentifier method, of class DaoDispatcher .110 * Test of getAnnotationExternalIdentifier method, of class DaoDispatcherImpl. 111 111 */ 112 112 @Test … … 125 125 126 126 /** 127 * Test of getUserInternalIdentifier method, of class DaoDispatcher .127 * Test of getUserInternalIdentifier method, of class DaoDispatcherImpl. 128 128 */ 129 129 @Test … … 143 143 144 144 /** 145 * Test of getUserExternalIdentifier method, of class DaoDispatcher .145 * Test of getUserExternalIdentifier method, of class DaoDispatcherImpl. 146 146 */ 147 147 @Test … … 160 160 161 161 /** 162 * Test of getAnnotation method, of class DaoDispatcher .162 * Test of getAnnotation method, of class DaoDispatcherImpl. 163 163 */ 164 164 @Test … … 229 229 230 230 /** 231 * Test of getFilteredAnnotationIDs method, of class DaoDispatcher .231 * Test of getFilteredAnnotationIDs method, of class DaoDispatcherImpl. 232 232 */ 233 233 @Test … … 280 280 ////////////// ADDERS ///////////////////////// 281 281 /** 282 * Test of addCachedForVersion method, of class DaoDispatcher .282 * Test of addCachedForVersion method, of class DaoDispatcherImpl. 283 283 */ 284 284 @Test … … 316 316 317 317 /** 318 * Test of addSiblingVersionForSource method, of class DaoDispatcher .318 * Test of addSiblingVersionForSource method, of class DaoDispatcherImpl. 319 319 */ 320 320 @Test … … 369 369 370 370 /** 371 * Test of addSourcesForAnnotation method, of class DaoDispatcher .371 * Test of addSourcesForAnnotation method, of class DaoDispatcherImpl. 372 372 */ 373 373 @Test … … 443 443 444 444 /** 445 * Test of addUsersAnnotation method, of class DaoDispatcher .445 * Test of addUsersAnnotation method, of class DaoDispatcherImpl. 446 446 */ 447 447 @Test … … 480 480 //////////////////// DELETERS //////////////// 481 481 /** 482 * Test of deleteCachedForVersion method, of class DaoDispatcher .482 * Test of deleteCachedForVersion method, of class DaoDispatcherImpl. 483 483 */ 484 484 @Test … … 604 604 605 605 /** 606 * Test of deleteAnnotationWithSources method, of class DaoDispatcher .606 * Test of deleteAnnotationWithSources method, of class DaoDispatcherImpl. 607 607 */ 608 608 @Test -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcNotebookDaoTest.java
r3413 r3452 54 54 "/spring-test-config/mockSourceDao.xml", "/spring-test-config/mockUserDao.xml", 55 55 "/spring-test-config/mockCachedRepresentationDao.xml", "/spring-test-config/mockVersionDao.xml", 56 "/spring-test-config/dataSource.xml", "/spring- config/notebookDao.xml"})56 "/spring-test-config/dataSource.xml", "/spring-test-config/mockDaoDispatcher.xml","/spring-config/notebookDao.xml"}) 57 57 public class JdbcNotebookDaoTest extends JdbcResourceDaoTest{ 58 58 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationResourceTest.java
r3450 r3452 18 18 package eu.dasish.annotation.backend.rest; 19 19 20 import eu.dasish.annotation.backend.dao.DaoDispatcher; 20 21 import com.sun.jersey.api.client.GenericType; 22 import eu.dasish.annotation.backend.Helpers; 21 23 import eu.dasish.annotation.backend.TestBackendConstants; 22 24 import eu.dasish.annotation.backend.TestInstances; … … 24 26 import eu.dasish.annotation.backend.identifiers.UserIdentifier; 25 27 import eu.dasish.annotation.schema.Annotation; 28 import eu.dasish.annotation.schema.ResourceREF; 26 29 import java.sql.SQLException; 27 30 import javax.xml.bind.JAXBElement; … … 35 38 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 36 39 import java.lang.InstantiationException; 40 import java.sql.Timestamp; 37 41 import javax.servlet.ServletException; 42 import javax.xml.datatype.DatatypeConfigurationException; 43 import org.junit.Ignore; 38 44 import org.springframework.mock.web.MockHttpServletRequest; 39 45 /** … … 43 49 44 50 @RunWith(value = SpringJUnit4ClassRunner.class) 45 @ContextConfiguration(locations = {"/spring-test-config/dataSource.xml", "/spring-test-config/mockDaoDispatcher.xml", 46 "/spring-test-config/mockery.xml", }) 51 @ContextConfiguration(locations = { "/spring-test-config/mockery.xml", "/spring-test-config/mockDaoDispatcher.xml", 52 "/spring-test-config/mockAnnotationDao.xml","/spring-test-config/mockUserDao.xml", "/spring-test-config/mockNotebookDao.xml", 53 "/spring-test-config/mockSourceDao.xml", "/spring-test-config/mockVersionDao.xml", "/spring-test-config/mockCachedRepresentationDao.xml"}) 47 54 public class AnnotationResourceTest { 48 55 … … 93 100 //int[] resultDelete = daoDispatcher.deleteAnnotation(annotationID); 94 101 102 final int[] mockDelete = new int[4]; 103 mockDelete[0]=1; // # deleted annotations 104 mockDelete[3]=1; // # deleted annotation_prinipal_permissions 105 mockDelete[2]=2; // # deleted annotations_target_sources, (5,3), (5,4) 106 mockDelete[3]=1; // # deletd sources, 4 95 107 mockery.checking(new Expectations() { 96 108 { … … 99 111 100 112 oneOf(daoDispatcher).deleteAnnotation(5); 101 will(returnValue( 1));113 will(returnValue(mockDelete)); 102 114 } 103 115 }); … … 111 123 */ 112 124 @Test 113 public void testCreateAnnotation() throws SQLException, InstantiationException, IllegalAccessException, ServletException {125 public void testCreateAnnotation() throws SQLException, InstantiationException, IllegalAccessException, ServletException, DatatypeConfigurationException { 114 126 System.out.println("test createAnnotation"); 115 127 final Annotation annotationToAdd = new GenericType<Annotation>(){}.getRawClass().newInstance(); … … 121 133 // Number newAnnotationID = daoDispatcher.addUsersAnnotation(annotation, userID); 122 134 // Annotation newAnnotation = daoDispatcher.getAnnotation(newAnnotationID); 135 final String ownerString = "5"; 136 final Number ownerID = 5; 137 final Number newAnnotationID = 6; 138 final Annotation addedAnnotation = annotationToAdd; 139 ResourceREF owner = new ResourceREF(); 140 owner.setRef(ownerString); 141 addedAnnotation.setOwner(owner); 142 addedAnnotation.setURI((new AnnotationIdentifier()).toString()); 123 143 144 addedAnnotation.setTimeStamp(Helpers.setXMLGregorianCalendar(Timestamp.valueOf("2013-08-12 11:25:00.383000"))); 124 145 mockery.checking(new Expectations() { 125 146 { 126 147 oneOf(daoDispatcher).getUserInternalIdentifier(with(aNonNull(UserIdentifier.class))); 127 will(returnValue( 5));148 will(returnValue(ownerID)); 128 149 129 oneOf(daoDispatcher).addUsersAnnotation(annotationToAdd, 5); 130 will(returnValue(1)); 150 oneOf(daoDispatcher).addUsersAnnotation(annotationToAdd, ownerID); 151 will(returnValue(newAnnotationID)); 152 153 oneOf(daoDispatcher).getAnnotation(newAnnotationID); 154 will(returnValue(addedAnnotation)); 131 155 } 132 156 }); … … 139 163 140 164 JAXBElement<Annotation> result = annotationResource.createAnnotation(annotationToAdd); 141 assertEquals(String.valueOf(5), result.getValue().getOwner().getRef()); 142 assertFalse(null == result.getValue().getURI()); 165 assertEquals(addedAnnotation.getOwner().getRef(), result.getValue().getOwner().getRef()); 166 assertEquals(addedAnnotation.getURI(), result.getValue().getURI()); 167 assertEquals(addedAnnotation.getHeadline(), result.getValue().getHeadline()); 168 assertEquals(addedAnnotation.getPermissions(), result.getValue().getPermissions()); 169 assertEquals(addedAnnotation.getTargetSources(), result.getValue().getTargetSources()); 170 assertEquals(addedAnnotation.getTimeStamp(), result.getValue().getTimeStamp()); 171 assertEquals(addedAnnotation.getBody(), result.getValue().getBody()); 143 172 144 173 } -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationsTest.java
r3408 r3452 18 18 package eu.dasish.annotation.backend.rest; 19 19 20 import eu.dasish.annotation.backend.dao.DaoDispatcher; 20 21 import com.sun.jersey.api.client.ClientResponse; 21 import com.sun.jersey.api.client.GenericType;22 import eu.dasish.annotation.backend.Helpers; 22 23 import eu.dasish.annotation.backend.TestBackendConstants; 23 import eu.dasish.annotation.backend.dao.AnnotationDao; 24 import eu.dasish.annotation.backend.dao.NotebookDao; 24 import eu.dasish.annotation.backend.TestInstances; 25 25 import eu.dasish.annotation.backend.identifiers.AnnotationIdentifier; 26 26 import eu.dasish.annotation.backend.identifiers.UserIdentifier; 27 27 import eu.dasish.annotation.schema.Annotation; 28 28 import eu.dasish.annotation.schema.ObjectFactory; 29 import eu.dasish.annotation.schema.ResourceREF; 29 30 import java.sql.SQLException; 31 import java.sql.Timestamp; 30 32 import javax.ws.rs.core.MediaType; 31 33 import javax.xml.bind.JAXBElement; 34 import javax.xml.datatype.DatatypeConfigurationException; 32 35 import javax.xml.namespace.QName; 33 36 import org.jmock.Expectations; 34 37 import org.junit.Test; 35 38 import static org.junit.Assert.*; 36 import org.junit.Ignore;37 39 /** 38 40 * … … 41 43 public class AnnotationsTest extends ResourcesTest{ 42 44 43 private AnnotationDao annotationDao; 44 private NotebookDao notebookDao; 45 private DaoDispatcher daoDispatcher; 45 46 46 47 public AnnotationsTest() { 47 48 super(AnnotationResource.class.getPackage().getName()); 48 annotationDao = webAppContext.getBean(AnnotationDao.class); 49 notebookDao = webAppContext.getBean(NotebookDao.class); 49 daoDispatcher = webAppContext.getBean(DaoDispatcher.class); 50 50 } 51 51 … … 61 61 final int annotationID = 2; 62 62 final Annotation testAnnotation = new ObjectFactory().createAnnotation(); 63 final Annotation expectedAnnotation = (new TestInstances()).getAnnotationOne(); 63 64 64 // mockery.checking(new Expectations() { 65 // { 66 // oneOf(annotationDao).getInternalID(new AnnotationIdentifier(annotationIdentifier)); 67 // will(returnValue(annotationID)); 68 // 69 // oneOf(annotationDao).getAnnotation(annotationID); 70 // will(returnValue(testAnnotation)); 71 // } 72 // }); 65 //final Number annotationID = daoDispatcher.getAnnotationInternalIdentifier(new AnnotationIdentifier(annotationIdentifier)); 66 //final Annotation annotation = daoDispatcher.getAnnotation(annotationID); 67 mockery.checking(new Expectations() { 68 { 69 oneOf(daoDispatcher).getAnnotationInternalIdentifier(with(aNonNull(AnnotationIdentifier.class))); 70 will(returnValue(annotationID)); 71 72 oneOf(daoDispatcher).getAnnotation(annotationID); 73 will(returnValue(expectedAnnotation)); 74 } 75 }); 73 76 74 77 final String requestUrl = "annotations/" + annotationIdentifier; … … 93 96 public void testDeleteAnnotation() throws SQLException{ 94 97 System.out.println("testDeleteAnnotation"); 95 98 //final Number annotationID = daoDispatcher.getAnnotationInternalIdentifier(new AnnotationIdentifier(annotationIdentifier)); 99 //int[] resultDelete = daoDispatcher.deleteAnnotation(annotationID); 100 101 final int[] mockDelete = new int[4]; 102 mockDelete[0]=1; // # deleted annotations 103 mockDelete[3]=1; // # deleted annotation_prinipal_permissions 104 mockDelete[2]=2; // # deleted annotations_target_sources, (5,3), (5,4) 105 mockDelete[3]=1; // # deletd sources, 4 96 106 mockery.checking(new Expectations() { 97 { 98 oneOf( annotationDao).getInternalID(new AnnotationIdentifier(TestBackendConstants._TEST_ANNOT_5_EXT));99 will(returnValue(5)); 107 { 108 oneOf(daoDispatcher).getAnnotationInternalIdentifier(with(aNonNull(AnnotationIdentifier.class))); 109 will(returnValue(5)); 100 110 101 oneOf( annotationDao).deleteAnnotation(5);102 will(returnValue( 1));111 oneOf(daoDispatcher).deleteAnnotation(5); 112 will(returnValue(mockDelete)); 103 113 } 104 114 }); 105 106 115 final String requestUrl = "annotations/" + TestBackendConstants._TEST_ANNOT_5_EXT; 107 116 System.out.println("requestUrl: " + requestUrl); … … 110 119 assertEquals("1", response.getEntity(String.class)); 111 120 112 // now, try to delete the same annotation one more time 113 // if it has been already deleted then the method under testing should return 0 114 115 mockery.checking(new Expectations() { 116 { 117 oneOf(annotationDao).getInternalID(new AnnotationIdentifier(TestBackendConstants._TEST_ANNOT_5_EXT)); 118 will(returnValue(5)); 119 120 oneOf(annotationDao).deleteAnnotation(5); 121 will(returnValue(0)); 122 } 123 }); 124 125 response = resource().path(requestUrl).delete(ClientResponse.class); 126 assertEquals(200, response.getStatus()); 127 assertEquals("0", response.getEntity(String.class)); 121 128 122 } 129 123 /** … … 132 126 */ 133 127 @Test 134 @Ignore 135 public void testCreateAnnotation() throws SQLException, InstantiationException, IllegalAccessException{ 128 public void testCreateAnnotation() throws SQLException, InstantiationException, IllegalAccessException, DatatypeConfigurationException{ 136 129 System.out.println("test createAnnotation"); 137 130 final Annotation annotationToAdd = new ObjectFactory().createAnnotation(); 131 132 // Number userID = null; 133 // if (remoteUser != null) { 134 // userID = daoDispatcher.getUserInternalIdentifier(new UserIdentifier(remoteUser)); 135 // } 136 // Number newAnnotationID = daoDispatcher.addUsersAnnotation(annotation, userID); 137 // Annotation newAnnotation = daoDispatcher.getAnnotation(newAnnotationID); 138 final String ownerString = "5"; 139 final Number ownerID = 5; 140 final Number newAnnotationID = 6; 141 final Annotation addedAnnotation = annotationToAdd; 142 ResourceREF owner = new ResourceREF(); 143 owner.setRef(ownerString); 144 addedAnnotation.setOwner(owner); 145 addedAnnotation.setURI((new AnnotationIdentifier()).toString()); 146 147 addedAnnotation.setTimeStamp(Helpers.setXMLGregorianCalendar(Timestamp.valueOf("2013-08-12 11:25:00.383000"))); 148 mockery.checking(new Expectations() { 149 { 150 oneOf(daoDispatcher).getUserInternalIdentifier(with(aNonNull(UserIdentifier.class))); 151 will(returnValue(ownerID)); 152 153 oneOf(daoDispatcher).addUsersAnnotation(annotationToAdd, ownerID); 154 will(returnValue(newAnnotationID)); 155 156 oneOf(daoDispatcher).getAnnotation(newAnnotationID); 157 will(returnValue(addedAnnotation)); 158 } 159 }); 138 160 139 161 // Peter's workaround on absence of "ObjectFactory.create... for annotations 140 162 final JAXBElement<Annotation> jaxbElement = new JAXBElement<Annotation>(new QName("http://www.dasish.eu/ns/addit", "annotation"), Annotation.class, null, annotationToAdd); 141 163 142 143 final Annotation addedAnnotation = annotationToAdd;144 final AnnotationIdentifier annotationIdentifier = new GenericType<AnnotationIdentifier>(){}.getRawClass().newInstance();145 addedAnnotation.setURI(annotationIdentifier.toString());146 final UserIdentifier owner = new UserIdentifier(TestBackendConstants._TEST_USER_5_EXT_ID);147 // mockery.checking(new Expectations() {148 // {149 //150 // // TODO sould be mpre strict demands on inputs when the user handling mechanism is settled151 // oneOf(annotationDao).addAnnotation(with(aNonNull(Annotation.class)), with(any(Number.class)));152 // will(returnValue(addedAnnotation));153 //154 // oneOf(permissionsDao).addAnnotationPrincipalPermission(with(aNonNull(AnnotationIdentifier.class)), with(aNonNull(UserIdentifier.class)), with(aNonNull(Permission.class)));155 // will(returnValue(1));156 // }157 // });158 159 160 161 164 final String requestUrl = "annotations"; 162 165 System.out.println("requestUrl: " + requestUrl); 163 164 // Peter's workaround on absence of "ObjectFactory.create... for annotations165 166 166 ClientResponse response = resource().path(requestUrl).accept(MediaType.APPLICATION_XML).type(MediaType.APPLICATION_XML).post(ClientResponse.class, jaxbElement); 167 167 assertEquals(200, response.getStatus());
Note: See TracChangeset
for help on using the changeset viewer.