@@ -0,0 +1,3190 @@
+/**%0A * PODD is an OWL ontology database used for scientific project management%0A * %0A * Copyright (C) 2009-2013 The University Of Queensland%0A * %0A * This program is free software: you can redistribute it and/or modify it under the terms of the%0A * GNU Affero General Public License as published by the Free Software Foundation, either version 3%0A * of the License, or (at your option) any later version.%0A * %0A * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without%0A * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU%0A * Affero General Public License for more details.%0A * %0A * You should have received a copy of the GNU Affero General Public License along with this program.%0A * If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0Apackage com.github.podd.resources.test;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.restlet.data.MediaType;%0Aimport org.restlet.data.Method;%0Aimport org.restlet.data.Status;%0Aimport org.restlet.resource.ClientResource;%0Aimport org.restlet.resource.ResourceException;%0A%0Aimport com.github.ansell.restletutils.test.RestletTestUtils;%0Aimport com.github.podd.api.test.TestConstants;%0Aimport com.github.podd.utils.InferredOWLOntologyID;%0Aimport com.github.podd.utils.PoddWebConstants;%0A%0A/**%0A * @author kutila%0A * %0A */%0Apublic class DeleteArtifactResourceImplTest extends AbstractResourceImplTest%0A%7B%0A    @Test%0A    public void testDeleteArtifactBasicRdf() throws Exception%0A    %7B%0A        // prepare: add an artifact%0A        final InferredOWLOntologyID artifactID =%0A                this.loadTestArtifact(TestConstants.TEST_ARTIFACT_20130206, MediaType.APPLICATION_RDF_TURTLE);%0A        %0A        %0A        final ClientResource deleteArtifactClientResource =%0A                new ClientResource(this.getUrl(PoddWebConstants.PATH_ARTIFACT_DELETE));%0A        %0A        deleteArtifactClientResource.addQueryParameter(PoddWebConstants.KEY_ARTIFACT_IDENTIFIER, artifactID%0A                .getOntologyIRI().toString());%0A        deleteArtifactClientResource.addQueryParameter(PoddWebConstants.KEY_ARTIFACT_VERSION_IDENTIFIER, artifactID%0A                .getVersionIRI().toString());%0A        %0A        %0A        RestletTestUtils.doTestAuthenticatedRequest(deleteArtifactClientResource, Method.DELETE, null,%0A                MediaType.APPLICATION_RDF_XML, Status.SUCCESS_NO_CONTENT, this.testWithAdminPrivileges);        %0A        %0A        // verify: try to retrieve deleted artifact%0A        final ClientResource getArtifactClientResource =%0A                new ClientResource(this.getUrl(PoddWebConstants.PATH_ARTIFACT_GET_BASE));%0A        getArtifactClientResource.addQueryParameter(PoddWebConstants.KEY_ARTIFACT_IDENTIFIER, artifactID%0A                .getOntologyIRI().toString());%0A        try%0A        %7B%0A            RestletTestUtils.doTestAuthenticatedRequest(getArtifactClientResource, Method.GET, null,%0A                    MediaType.APPLICATION_RDF_XML, Status.CLIENT_ERROR_NOT_FOUND, this.testWithAdminPrivileges);%0A            Assert.fail(%22Should have failed with a NOT_FOUND error%22);%0A        %7D%0A        catch(ResourceException e)%0A        %7B%0A            Assert.assertNotNull(e);%0A        %7D%0A    %7D    %0A    %0A%7D%0A

add restlet resource test for delete artifact