Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [wtp-dev] File locking on web.xml

Yes, I hit that same issue in some unit tests I was writing last week; I
disabled validation to workaround the issue; I still need to track down
the specific validator and file a bug...

-Rob

-----Original Message-----
From: wtp-dev-bounces@xxxxxxxxxxx [mailto:wtp-dev-bounces@xxxxxxxxxxx]
On Behalf Of Cameron Bateman
Sent: Monday, July 24, 2006 1:14 PM
To: Wtp-dev
Subject: [wtp-dev] File locking on web.xml


Greetings,

I am running into a problem while trying to construct a dynamic web 
project for use in my JUnit testing.  The issue appears to be a file 
lock on the web.xml file.  Using code I've found in other JUnit tests, I

am attempting to construct my test dynamic web project as follows:

            IDataModel dataModel = DataModelFactory.createDataModel(new 
WebFacetProjectCreationDataModelProvider());
            
dataModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PRO
JECT_NAME, 
projectName);
            dataModel.getDefaultOperation().execute(new 
NullProgressMonitor(), null);

This works fine inasmuch as everything appears to be created correctly 
and I am able to run tests in this project.  However, I am running this 
code from my setUp() method.  When I have multiple tests in the same 
suite, the project is deleted and recreated on each test.  But I get an 
error on the workspace delete of the project which appears to be caused 
by the web.xml being locked after the above call.   This creates 
problems in each subsequent test because the web root cannot be 
correctly reconstructed (unless I change the name of the project or some

other workaround).

There appears to possibly be a threading issue here, since if I wait 
long enough while tracing in the debugger, the lock eventually goes 
away.  Has anyone encountered this or does anyone have ideas as to how 
to resolve or workaround this problem?  Obviously changing the name the 
project on each iteration is a possible workaround.


Regards,

Cameron
_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/wtp-dev
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.


Back to the top