Search in sources :

Example 1 with Delete

use of org.apache.cxf.ws.transfer.Delete in project cxf by apache.

the class ResourceTest method deleteRequestTest.

@Test
public void deleteRequestTest() {
    ResourceManager manager = EasyMock.createMock(ResourceManager.class);
    manager.delete(EasyMock.isA(ReferenceParametersType.class));
    EasyMock.expectLastCall().once();
    EasyMock.replay(manager);
    ReferenceParametersType refParams = new ReferenceParametersType();
    Element uuid = document.createElementNS(MemoryResourceManager.REF_NAMESPACE, MemoryResourceManager.REF_LOCAL_NAME);
    uuid.setTextContent(UUID_VALUE);
    refParams.getAny().add(uuid);
    Server server = createLocalResource(manager);
    Resource client = createClient(refParams);
    client.delete(new Delete());
    EasyMock.verify(manager);
    server.destroy();
}
Also used : Delete(org.apache.cxf.ws.transfer.Delete) Server(org.apache.cxf.endpoint.Server) Element(org.w3c.dom.Element) Resource(org.apache.cxf.ws.transfer.resource.Resource) ReferenceParametersType(org.apache.cxf.ws.addressing.ReferenceParametersType) MemoryResourceManager(org.apache.cxf.ws.transfer.manager.MemoryResourceManager) ResourceManager(org.apache.cxf.ws.transfer.manager.ResourceManager) Test(org.junit.Test)

Example 2 with Delete

use of org.apache.cxf.ws.transfer.Delete in project cxf by apache.

the class DeleteTest method deleteTeacher.

@Test
public void deleteTeacher() throws XMLStreamException {
    CreateResponse response = createTeacher();
    Resource client = TestUtils.createResourceClient(response.getResourceCreated());
    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 3 with Delete

use of org.apache.cxf.ws.transfer.Delete in project cxf by apache.

the class DeleteTest method deleteStudent.

@Test
public void deleteStudent() throws XMLStreamException {
    CreateResponse response = createStudent();
    Resource client = TestUtils.createResourceClient(response.getResourceCreated());
    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 4 with Delete

use of org.apache.cxf.ws.transfer.Delete 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 5 with Delete

use of org.apache.cxf.ws.transfer.Delete 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)

Aggregations

Delete (org.apache.cxf.ws.transfer.Delete)7 Resource (org.apache.cxf.ws.transfer.resource.Resource)7 Test (org.junit.Test)7 CreateResponse (org.apache.cxf.ws.transfer.CreateResponse)6 Get (org.apache.cxf.ws.transfer.Get)2 Server (org.apache.cxf.endpoint.Server)1 ReferenceParametersType (org.apache.cxf.ws.addressing.ReferenceParametersType)1 MemoryResourceManager (org.apache.cxf.ws.transfer.manager.MemoryResourceManager)1 ResourceManager (org.apache.cxf.ws.transfer.manager.ResourceManager)1 Element (org.w3c.dom.Element)1