Search in sources :

Example 6 with CreateResponse

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());
}
Also used : Delete(org.apache.cxf.ws.transfer.Delete) CreateResponse(org.apache.cxf.ws.transfer.CreateResponse) Get(org.apache.cxf.ws.transfer.Get) Resource(org.apache.cxf.ws.transfer.resource.Resource) Test(org.junit.Test)

Example 7 with CreateResponse

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());
}
Also used : Delete(org.apache.cxf.ws.transfer.Delete) CreateResponse(org.apache.cxf.ws.transfer.CreateResponse) Resource(org.apache.cxf.ws.transfer.resource.Resource) Test(org.junit.Test)

Example 8 with CreateResponse

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());
}
Also used : Delete(org.apache.cxf.ws.transfer.Delete) CreateResponse(org.apache.cxf.ws.transfer.CreateResponse) Get(org.apache.cxf.ws.transfer.Get) Resource(org.apache.cxf.ws.transfer.resource.Resource) Test(org.junit.Test)

Example 9 with CreateResponse

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);
}
Also used : CreateResponse(org.apache.cxf.ws.transfer.CreateResponse) Resource(org.apache.cxf.ws.transfer.resource.Resource) Representation(org.apache.cxf.ws.transfer.Representation) Document(org.w3c.dom.Document) Put(org.apache.cxf.ws.transfer.Put) Test(org.junit.Test)

Example 10 with CreateResponse

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());
}
Also used : Create(org.apache.cxf.ws.transfer.Create) CreateResponse(org.apache.cxf.ws.transfer.CreateResponse) Representation(org.apache.cxf.ws.transfer.Representation) ResourceFactory(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory) Document(org.w3c.dom.Document) Test(org.junit.Test)

Aggregations

CreateResponse (org.apache.cxf.ws.transfer.CreateResponse)19 Test (org.junit.Test)16 Representation (org.apache.cxf.ws.transfer.Representation)12 Resource (org.apache.cxf.ws.transfer.resource.Resource)10 Document (org.w3c.dom.Document)8 Create (org.apache.cxf.ws.transfer.Create)6 Delete (org.apache.cxf.ws.transfer.Delete)6 ResourceFactory (org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory)6 ReferenceParametersType (org.apache.cxf.ws.addressing.ReferenceParametersType)4 Put (org.apache.cxf.ws.transfer.Put)4 Server (org.apache.cxf.endpoint.Server)2 AttributedURIType (org.apache.cxf.ws.addressing.AttributedURIType)2 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)2 Get (org.apache.cxf.ws.transfer.Get)2 ResourceManager (org.apache.cxf.ws.transfer.manager.ResourceManager)2 Element (org.w3c.dom.Element)2 JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)1