Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 167600

Summary: WSDM Tooling: No validation, When Creating Duplicate Capability,MRT and DD files (when it is Case-insensitive)
Product: z_Archived Reporter: Andrew Eberbach <aeberbac>
Component: TPTP.monitoringAssignee: Andrew Eberbach <aeberbac>
Status: CLOSED FIXED QA Contact: Bhanu Prathap V <bhanu.prathap>
Severity: normal    
Priority: P1 CC: bsubram, sadravid
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for this issue
none
Patch for this issue none

Description Andrew Eberbach CLA 2006-12-12 06:52:53 EST
1. Create a new Manageability EndPoint Project
2. Create a new default Capability i,e new_file.cap
3. Now try to create a duplicate Capability i,e New_File.cap, No validation done.
4. Any way Duplicate file is not getting created but still validation has to be done.
(Same problem exists for MRT and DD files also)
Comment 1 Saurabh Dravid CLA 2006-12-20 04:26:38 EST
Created attachment 55945 [details]
Patch for this issue

Please apply this patch.
This patch will give error message when user tries to create new capability having the namespace that already exists. So user can't have two capabilities having same namespace. I feel capability could be equivalent if they have the same namespace or same capability uri.
This patch didn't deal with duplicate MRT.
Comment 2 Balan Subramanian CLA 2007-01-16 00:07:36 EST
Assigned to QA for verification
Comment 3 Bhanu Prathap V CLA 2007-01-31 01:42:34 EST
For Capability and DD files no validation done.

Build ID: TPTP-4.4.0-200701290100
Comment 4 Balan Subramanian CLA 2007-02-01 08:43:26 EST
Verification Failed
Comment 5 Saurabh Dravid CLA 2007-02-08 10:07:29 EST
The patch has been applied.
Please verify the defect.
Comment 6 Bhanu Prathap V CLA 2007-02-09 00:42:08 EST
I cannot check for Capability because unable to create Capability. For MRT Validation has done but for DD no validation.

Candidate Build: TPTP-4.4.0-200702050100
WTP: wtp-I-I200702011746-200702011746
Comment 7 Saurabh Dravid CLA 2007-02-09 04:19:38 EST
Created attachment 58638 [details]
Patch for this issue

This patch will make sure that user can't create two files with same name in same project.
Comment 8 Balan Subramanian CLA 2007-02-09 08:08:08 EST
Applied patch submitted 02/09
Comment 9 Balan Subramanian CLA 2007-02-16 01:15:34 EST
Patch applied into tptp cvs
Comment 10 Bhanu Prathap V CLA 2007-02-16 07:41:19 EST
1. Created new default Capability i,e new_file.cap
2. Again when creating New Capability, "New Custom Capability" window comes up, now change the Capability name to "New_file.cap" and change the filename to "New_file1.mcap" and click Finish button
3. Only New_file1.mcap file is created and red mark shows on New_file1.mcap file and couple of error throws up in the error log. check below error log

Build: TPTP-4.4.0-200702160321

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.core.internal.resources.ResourceException: Resource '/Test1/New_file.rmd' does not exist.
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:316)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:275)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:398)
	at org.eclipse.tptp.wsdm.tooling.editor.capability.util.internal.MetaDataUtils.getDocumentRoot(MetaDataUtils.java:327)
	at org.eclipse.tptp.wsdm.tooling.util.internal.Definition2Capability.populateMetadata(Definition2Capability.java:365)
	at org.eclipse.tptp.wsdm.tooling.util.internal.Definition2Capability.startConversion(Definition2Capability.java:232)
	at org.eclipse.tptp.wsdm.tooling.util.internal.Definition2Capability.getCapability(Definition2Capability.java:178)
	at org.eclipse.tptp.wsdm.tooling.util.internal.IFile2Capability.getCapability(IFile2Capability.java:46)
	at org.eclipse.tptp.wsdm.tooling.validation.capability.internal.CapabilityValidatorController.validate(CapabilityValidatorController.java:53)
	at org.eclipse.tptp.wsdm.tooling.validation.builders.internal.WsdmIncrementalProjectBuilder.validateCapability(WsdmIncrementalProjectBuilder.java:213)
	at org.eclipse.tptp.wsdm.tooling.validation.builders.internal.WsdmIncrementalProjectBuilder.access$0(WsdmIncrementalProjectBuilder.java:210)
	at org.eclipse.tptp.wsdm.tooling.validation.builders.internal.WsdmIncrementalProjectBuilder$1.visit(WsdmIncrementalProjectBuilder.java:192)
	at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:57)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:81)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
	at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:126)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:67)
	at org.eclipse.tptp.wsdm.tooling.validation.builders.internal.WsdmIncrementalProjectBuilder.fullBuild(WsdmIncrementalProjectBuilder.java:183)
	at org.eclipse.tptp.wsdm.tooling.validation.builders.internal.WsdmIncrementalProjectBuilder.build(WsdmIncrementalProjectBuilder.java:174)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:621)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:163)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:194)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:243)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:299)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:331)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:158)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:224)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/Test1/New_file.rmd' does not exist.
	at java.lang.Throwable.<init>(Throwable.java:57)
	at java.lang.Throwable.<init>(Throwable.java:68)
	at org.eclipse.core.runtime.CoreException.<init>(CoreException.java:43)
	at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:35)
	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:310)
	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:193)
	at org.eclipse.core.internal.resources.File.getContents(File.java:285)
	at org.eclipse.core.internal.resources.File.getContents(File.java:276)
	at org.eclipse.emf.ecore.resource.impl.URIConverterImpl$WorkbenchHelper.createPlatformResourceInputStream(URIConverterImpl.java:197)
	at org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createPlatformResourceInputStream(URIConverterImpl.java:533)
	at org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createInputStream(URIConverterImpl.java:438)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:962)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:256)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:271)
	... 29 more




org.eclipse.emf.ecore.resource.Resource$IOWrappedException: A resource exists with a different case: '/Test1/new_file.xsd'.
	at org.eclipse.emf.ecore.resource.impl.URIConverterImpl$PlatformResourceOutputStream.flush(URIConverterImpl.java:151)
	at org.eclipse.emf.ecore.resource.impl.URIConverterImpl$PlatformResourceOutputStream.close(URIConverterImpl.java:103)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:950)
	at org.eclipse.tptp.wsdm.tooling.util.internal.XsdUtils.saveXSDSchema(XsdUtils.java:170)
	at org.eclipse.tptp.wsdm.tooling.wizard.capability.internal.NewCapabilityWizard.createXSDFile(NewCapabilityWizard.java:342)
	at org.eclipse.tptp.wsdm.tooling.wizard.capability.internal.NewCapabilityWizard.doFinishXSD(NewCapabilityWizard.java:290)
	at org.eclipse.tptp.wsdm.tooling.wizard.capability.internal.NewCapabilityWizard.doFinish(NewCapabilityWizard.java:249)
	at org.eclipse.tptp.wsdm.tooling.wizard.capability.internal.NewCapabilityWizard.access$0(NewCapabilityWizard.java:245)
	at org.eclipse.tptp.wsdm.tooling.wizard.capability.internal.NewCapabilityWizard$1.run(NewCapabilityWizard.java:202)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: org.eclipse.core.internal.resources.ResourceException: A resource exists with a different case: '/Test1/new_file.xsd'.
	at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:298)
	at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:276)
	at org.eclipse.core.internal.resources.File.create(File.java:106)
	at org.eclipse.core.internal.resources.File.create(File.java:176)
	at org.eclipse.emf.ecore.resource.impl.URIConverterImpl$PlatformResourceOutputStream.flush(URIConverterImpl.java:135)
	... 9 more


Comment 11 Bhanu Prathap V CLA 2007-03-12 06:22:45 EDT
1.Create Project1
2.Create a default Capability file i,e new_file.mcap under project Project1
3.Create Project2
4.Able to create Capability i,e New_file.mcap under project Project2

Build: tptpaide-2007-03-09-05-00-00
Comment 12 Balan Subramanian CLA 2007-03-13 12:01:14 EDT
Is this still an issue? It looks to me like being able to create capability of same name under two different projects is not an issue.
Comment 13 Balan Subramanian CLA 2007-03-13 12:01:52 EDT
Is this still an issue? It looks to me like being able to create capability of same name under two different projects is not an issue.

QA please confirm if this is still an issue.
Comment 14 Bhanu Prathap V CLA 2007-03-14 01:54:51 EDT
if we take the case sensitive in to consideration
1.I created new_file.mcap in Test1 project 
2.when creating new_file.mcap file in Test2 project validation is done and unable to create. But if i try to create New_file.mcap its allowed to create in Test2 project, so validation should be done when it is case sensitive also.

Build: tptpaide-2007-03-09-05-00-00
Comment 15 Valentina Popescu CLA 2007-03-14 23:05:11 EDT
Please update target; i1 is already closed
Comment 16 Balan Subramanian CLA 2007-04-24 23:00:33 EDT
fixed
Comment 17 Bhanu Prathap V CLA 2007-05-03 03:26:35 EDT
Verified - fixed
Build: TPTP-4.4.0-200705021157
Comment 18 Bhanu Prathap V CLA 2007-05-03 03:26:51 EDT
Verified - fixed
Build: TPTP-4.4.0-200705021157