This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 179972 - AppClient project is improperly generated
Summary: AppClient project is improperly generated
Status: CLOSED WORKSFORME
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Raj Mandayam CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-29 07:44 EDT by Kaloyan Raev CLA
Modified: 2007-04-11 10:40 EDT (History)
0 users

See Also:


Attachments
junit test (9.93 KB, application/octet-stream)
2007-03-29 09:33 EDT, Kaloyan Raev CLA
no flags Details
patch fixes app client creation (1.66 KB, patch)
2007-03-29 12:01 EDT, Raj Mandayam CLA
no flags Details | Diff
patch fixes the junits for the module creation (8.08 KB, patch)
2007-03-29 13:47 EDT, Raj Mandayam CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kaloyan Raev CLA 2007-03-29 07:44:20 EDT
When creating Application Client 1.4 project the following problems are observed: 
1. /META-INF/application-client.xml is missing. 
2. /.settings/org.eclipse.wst.common.component is missing
3. Deployment Descriptor tree is not shown
4. API ComponentCore.createComponent(IProject).getRootFolder().getUnderlyingFolder() does not return the appClientModule folder, but the project's root folder. This issue is also valid for Application Client 5 projects. 

In WTP 1.5 creation of Application Client project is OK. The described problem is observed only in WTP 2.0.
Comment 1 Kaloyan Raev CLA 2007-03-29 09:33:06 EDT
Created attachment 62382 [details]
junit test

I attach a junit test that tests issue no.4: the ComponentCore.createComponent(IProject).getRootFolder().getUnderlyingFolder() API. The failing tests are "testAppCln14" and "testAppCln50" in the ProjectCreationTest test case. Fixing the problem should make the tests run OK.
Comment 2 Chuck Bridgham CLA 2007-03-29 11:29:24 EDT
Please take a look
Comment 3 Raj Mandayam CLA 2007-03-29 12:01:17 EDT
Created attachment 62398 [details]
patch fixes app client creation
Comment 4 Raj Mandayam CLA 2007-03-29 13:47:46 EDT
Created attachment 62409 [details]
patch fixes the junits for the module creation

patch fixes the junits for the module creation, they were not checking correctly for the existence of the deployment descriptor.
Comment 5 Jason Sholl CLA 2007-03-29 14:22:27 EDT
checked in patches dated 2007-03-29 12:01 and 2007-03-29 13:47
Comment 6 Chuck Bridgham CLA 2007-03-30 16:25:32 EDT
This made it into the build yesterday
Comment 7 Kaloyan Raev CLA 2007-04-03 09:43:38 EDT
I have checked the fix with the I200703301651 build. 

The described issues are fixed for AppClient 1.4 projects. 

There is still one problem available for AppClient 5 projects: 
  4. API
ComponentCore.createComponent(IProject).getRootFolder().getUnderlyingFolder()
does not return the appClientModule folder, but the project's root folder.

If you run the junit test that I have already attached, you should see that the testAppCln50() test case is still failing. 
Comment 8 Raj Mandayam CLA 2007-04-05 11:37:50 EDT
Hi Kaloyan,

   We also have Junit tests for the same stuff if you see the class AppClientProjectCreationOperationTest.java in plugin org.eclipse.jst.j2ee.tests (at dev.eclipse.org cvs) and it does not fail..

I looked at your junit test and it looks like you are setting the properties on the top level datamodel, which is incorrect (according to the implementation)

In our junit AppClientProjectCreationOperationTest.java we do the following, 

	private void addAppProjectProperties(IDataModel dataModel, String projName, IProjectFacetVersion appFacetVersion){

...
		FacetDataModelMap map = (FacetDataModelMap) dataModel
				.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
		IDataModel appmodel = (IDataModel) map.get(IAppClientFacetInstallDataModelProperties.APPLICATION_CLIENT);
		appmodel.setProperty(IFacetInstallDataModelProperties.FACET_VERSION, appFacetVersion);
		appmodel.setStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER,"appcc333"); //$NON-NLS-1$



Your code in ProjectCreationOperation

does try to set the CONFIG_FOLDER on the top level datamodel provider which is ignored

private IFacetedProject.Action setupAppClientInstallAction50(
			String contentFolder) {

		IDataModel clientFacetInstallDataModel = DataModelFactory
				.createDataModel(new AppClientFacetInstallDataModelProvider());
		clientFacetInstallDataModel.setProperty(
				IAppClientFacetInstallDataModelProperties.CONFIG_FOLDER,
				contentFolder);


The right fix is to correct the junit so that you set the config folder on the facet's datamodel.
Comment 9 Kaloyan Raev CLA 2007-04-06 03:37:10 EDT
Raj, I see. Thank you for the clarification. 
Comment 10 John Lanuti CLA 2007-04-11 10:40:59 EDT
Closing as already verified.