Skip to content
Permalink
Browse files
JUDDI-908 adding test case
  • Loading branch information
spyhunter99 committed Jan 8, 2015
1 parent d719527 commit 9be9a865dea400aa4647b5b336bc6f2799dc8b13
Showing 2 changed files with 39 additions and 4 deletions.
@@ -24,6 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.juddi.Registry;
import org.apache.juddi.jaxb.EntityCreator;
import org.apache.juddi.v3.tck.TckBusiness;
import org.apache.juddi.v3.tck.TckFindEntity;
import org.apache.juddi.v3.tck.TckPublisher;
@@ -34,6 +35,9 @@
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.uddi.api_v3.DeletePublisherAssertions;
import org.uddi.api_v3.PublisherAssertion;
import org.uddi.v3_service.DispositionReportFaultMessage;
import org.uddi.v3_service.UDDISecurityPortType;

public class API_060_PublisherAssertionTest {
@@ -152,4 +156,35 @@ public void testFindAssertions() {
tckTModel.deleteMaryPublisherTmodel(authInfoMary);
}
}

/**
* covers <a href="https://issues.apache.org/jira/browse/JUDDI-908">JUDDI-908</a>
* @throws Exception
*/
@Test(expected = DispositionReportFaultMessage.class)
public void deleteAssertionNonowner() throws Exception{
try {
tckTModel.saveJoePublisherTmodel(authInfoJoe);
tckTModel.saveSamSyndicatorTmodel(authInfoSam);
tckBusiness.saveJoePublisherBusiness(authInfoJoe);
tckBusiness.saveSamSyndicatorBusiness(authInfoSam);
tckAssertion.saveJoePublisherPublisherAssertion(authInfoJoe);

DeletePublisherAssertions dp = new DeletePublisherAssertions();
dp.setAuthInfo(authInfoMary);

PublisherAssertion paIn = (PublisherAssertion)EntityCreator.buildFromDoc(TckPublisherAssertion.JOE_ASSERT_XML, "org.uddi.api_v3");
dp.getPublisherAssertion().add(paIn);

new UDDIPublicationImpl().deletePublisherAssertions(dp);
//
} finally {
tckAssertion.deleteJoePublisherPublisherAssertion(authInfoJoe);
tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
tckBusiness.deleteSamSyndicatorBusiness(authInfoSam);
tckTModel.deleteJoePublisherTmodel(authInfoJoe);
tckTModel.deleteSamSyndicatorTmodel(authInfoSam);
}
}
}
@@ -33,10 +33,10 @@
*/
public class TckPublisherAssertion
{
final static String JOE_ASSERT_XML = "uddi_data/joepublisher/publisherAssertion.xml";
final static String MARY_ASSERT_XML = "uddi_data/marypublisher/publisherAssertion.xml";
final static String JOE_ASSERT2_XML = "uddi_data/joepublisher/publisherAssertion2.xml";
final static String SAM_ASSERT_XML = "uddi_data/samsyndicator/publisherAssertion.xml";
public final static String JOE_ASSERT_XML = "uddi_data/joepublisher/publisherAssertion.xml";
public final static String MARY_ASSERT_XML = "uddi_data/marypublisher/publisherAssertion.xml";
public final static String JOE_ASSERT2_XML = "uddi_data/joepublisher/publisherAssertion2.xml";
public final static String SAM_ASSERT_XML = "uddi_data/samsyndicator/publisherAssertion.xml";

private Log logger = LogFactory.getLog(this.getClass());
private UDDIPublicationPortType publication = null;

0 comments on commit 9be9a86

Please sign in to comment.