use of org.apache.cxf.ws.transfer.Representation in project cxf by apache.
the class DeleteTest method createStudent.
private CreateResponse createStudent() 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);
return rf.create(request);
}
use of org.apache.cxf.ws.transfer.Representation in project cxf by apache.
the class PutTest method rightTeacherPutTest.
@Test
public void rightTeacherPutTest() throws XMLStreamException {
CreateResponse createResponse = createTeacher();
Document putStudentXML = StaxUtils.read(getClass().getResourceAsStream("/xml/putTeacher.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.Representation in project cxf by apache.
the class PutTest method createTeacher.
private CreateResponse createTeacher() throws XMLStreamException {
Document createTeacherXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createTeacher.xml"));
Create request = new Create();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createTeacherXML.getDocumentElement());
ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
return rf.create(request);
}
use of org.apache.cxf.ws.transfer.Representation in project cxf by apache.
the class PutTest method createStudent.
private CreateResponse createStudent() 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);
return rf.create(request);
}
use of org.apache.cxf.ws.transfer.Representation in project cxf by apache.
the class PutTest method wrongTeacherPutTest.
@Test(expected = SOAPFaultException.class)
public void wrongTeacherPutTest() throws XMLStreamException {
createStudent();
CreateResponse createResponse = createTeacher();
Document putStudentXML = StaxUtils.read(getClass().getResourceAsStream("/xml/putTeacher.xml"));
Put request = new Put();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(putStudentXML.getDocumentElement());
Resource client = TestUtils.createResourceClient(createResponse.getResourceCreated());
client.put(request);
}
Aggregations