Hi Dave,

Though I don't remember who, I recall someone reported the same issue few
days back. Kishan, was that you? If so, can you please link the
corresponding JIRA issue to this e-mail.

Thanks,
Senaka.

On Sat, Nov 5, 2011 at 3:10 AM, David Carver <[email protected]> wrote:

> After adding a WSDL, and then retrieving it for update, the resetting an
> attribute does not.  Test code similar to the following can be used to
> reproduce the issue.  We are using a RemoteRegistry implementation talking
> to WSO2 Gov Reg 4.1.0.
>
>   @Test
>   public void testCreateUpdateWSDL() throws Exception {
>
>      WsdlManager wm = new WsdlManager(registry);
>      Wsdl wsdl = wm.newWsdl(
>               loadFile("src/main/resources/**META-INF/soa/services/wsdl/**
> CreateServiceTest/**CreateServiceTest.wsdl"),
>               "Example.wsdl");
>      wsdl.setAttribute(**AssetConstants.TURMERIC_NAME, "Wsdl Name");
>      assertNotNull(wsdl);
>      wm.addWsdl(wsdl);
>      String id = wsdl.getId();
>
>      GovernanceArtifact artifact = GovernanceUtils.**
> retrieveGovernanceArtifactById**(registry, id);
>      assertNotNull("Unable to find wsdl", artifact);
>
>      wsdl = wm.getWsdl(id);
>      wsdl.setAttribute(**AssetConstants.TURMERIC_NAME, "Wsdl New Name");
>      wm.addWsdl(wsdl);
>
>      artifact = GovernanceUtils.**retrieveGovernanceArtifactById**(registry,
> id);
>      assertNotNull("Unable to find wsdl after update", artifact);
>      assertEquals("oops..did not update wsdl", "Wsdl New Name",
> artifact.getAttribute(**AssetConstants.TURMERIC_NAME))**;
>
>   }
>
> The expected value should be "Wsdl New Name".   It seems to be retreiving
> the old name.   A service test as follows works correctly:
>
>   @Test
>   public void testCreateUpdateService() throws Exception {
>
>      ServiceManager sm = new ServiceManager(RSProviderUtil.**
> getRegistry());
>      Service service = sm.newService(new QName("http://www.example.org"**,
> "Example"));
>
>      service.setAttribute(**AssetConstants.TURMERIC_NAME, "Example
> Service");
>      sm.addService(service);
>      String assetId = service.getId();
>
>      GovernanceArtifact artifact = GovernanceUtils.**
> retrieveGovernanceArtifactById**(registry, service.getId());
>      assertNotNull(artifact);
>      assertEquals("Example Service", artifact.getAttribute(**
> AssetConstants.TURMERIC_NAME))**;
>
>      service = sm.getService(assetId);
>      assertNotNull("Missing service.", service);
>      service.setAttribute(**AssetConstants.TURMERIC_NAME, "New Name");
>      sm.addService(service);
>
>      service = sm.getService(assetId);
>      assertEquals("Service Name attribute did not update.", "New Name",
>               service.getAttribute(**AssetConstants.TURMERIC_NAME))**;
>   }
>
> Dave
>
>


-- 
*Senaka Fernando*
Product Manager - WSO2 Governance Registry;
Associate Technical Lead; WSO2 Inc.; http://wso2.com*
Member; Apache Software Foundation; http://apache.org

E-mail: senaka AT wso2.com
**P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818
Linked-In: http://linkedin.com/in/senakafernando

*Lean . Enterprise . Middleware
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to