use of org.apache.cxf.ws.transfer.CreateResponse in project cxf by apache.
the class DeleteTest method getDeletedTeacher.
@Test(expected = SOAPFaultException.class)
public void getDeletedTeacher() throws XMLStreamException {
CreateResponse response = createTeacher();
Resource client = TestUtils.createResourceClient(response.getResourceCreated());
client.delete(new Delete());
client.get(new Get());
}
use of org.apache.cxf.ws.transfer.CreateResponse in project cxf by apache.
the class DeleteTest method deleteDeletedTeacher.
@Test(expected = SOAPFaultException.class)
public void deleteDeletedTeacher() throws XMLStreamException {
CreateResponse response = createTeacher();
Resource client = TestUtils.createResourceClient(response.getResourceCreated());
client.delete(new Delete());
client.delete(new Delete());
}
use of org.apache.cxf.ws.transfer.CreateResponse in project cxf by apache.
the class DeleteTest method getDeletedStudent.
@Test(expected = SOAPFaultException.class)
public void getDeletedStudent() throws XMLStreamException {
CreateResponse response = createStudent();
Resource client = TestUtils.createResourceClient(response.getResourceCreated());
client.delete(new Delete());
client.get(new Get());
}
use of org.apache.cxf.ws.transfer.CreateResponse in project cxf by apache.
the class PutTest method wrongStudentPutTest.
@Test(expected = SOAPFaultException.class)
public void wrongStudentPutTest() throws XMLStreamException {
createStudent();
CreateResponse createResponse = createStudent();
Document putStudentXML = StaxUtils.read(getClass().getResourceAsStream("/xml/putStudent.xml"));
Put request = new Put();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(putStudentXML.getDocumentElement());
Resource client = TestUtils.createResourceClient(createResponse.getResourceCreated());
client.put(request);
}
use of org.apache.cxf.ws.transfer.CreateResponse in project cxf by apache.
the class CreateStudentTest method createStudentTest.
@Test
public void createStudentTest() throws XMLStreamException {
Document createStudentXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createStudent.xml"));
Create request = new Create();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createStudentXML.getDocumentElement());
ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
CreateResponse response = rf.create(request);
Assert.assertEquals(RESOURCE_STUDENTS_URL, response.getResourceCreated().getAddress().getValue());
}
Aggregations