use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.
the class CreateStudentTest method createStudentWrongTest.
@Test(expected = SOAPFaultException.class)
public void createStudentWrongTest() throws XMLStreamException {
Document createStudentWrongXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createStudentWrong.xml"));
Create request = new Create();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createStudentWrongXML.getDocumentElement());
ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
rf.create(request);
}
use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.
the class CreateStudentTest method createRandomTest.
@Test(expected = SOAPFaultException.class)
public void createRandomTest() throws XMLStreamException {
Document randomXML = StaxUtils.read(getClass().getResourceAsStream("/xml/random.xml"));
Create request = new Create();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(randomXML.getDocumentElement());
ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
rf.create(request);
}
use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.
the class CreateStudentTest method createStudentPartialTest.
@Test
public void createStudentPartialTest() throws XMLStreamException {
Document createStudentPartialXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createStudentPartial.xml"));
Create request = new Create();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createStudentPartialXML.getDocumentElement());
ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
CreateResponse response = rf.create(request);
Assert.assertEquals(RESOURCE_STUDENTS_URL, response.getResourceCreated().getAddress().getValue());
}
use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.
the class CreateTeacherTest method createTeacherWrongTest.
@Test(expected = SOAPFaultException.class)
public void createTeacherWrongTest() throws XMLStreamException {
Document createTeacherWrongXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createTeacherWrong.xml"));
Create request = new Create();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createTeacherWrongXML.getDocumentElement());
ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
rf.create(request);
}
use of org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory in project cxf by apache.
the class CreateTeacherTest method createTeacherPartialTest.
@Test
public void createTeacherPartialTest() throws XMLStreamException {
Document createTeacherPartialXML = StaxUtils.read(getClass().getResourceAsStream("/xml/createTeacherPartial.xml"));
Create request = new Create();
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createTeacherPartialXML.getDocumentElement());
ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
CreateResponse response = rf.create(request);
Assert.assertEquals(RESOURCE_TEACHERS_URL, response.getResourceCreated().getAddress().getValue());
}
Aggregations