Author: scabanovich
Date: 2011-06-30 19:07:41 -0400 (Thu, 30 Jun 2011)
New Revision: 32513
Added:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.classpath
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.project
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.jdt.core.prefs
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.wst.common.project.facet.core.xml
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/build/
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/build/classes/
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/src/
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/project/facet/WebFragmentFacetOnExistingProjectTest.java
Modified:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
Log:
JBIDE-9280
https://issues.jboss.org/browse/JBIDE-9280
Added:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.classpath
===================================================================
---
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.classpath
(rev 0)
+++
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.classpath 2011-06-30
23:07:41 UTC (rev 32513)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+ <attributes>
+ <attribute name="owner.project.facets" value="java"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Property changes on:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.project
===================================================================
---
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.project
(rev 0)
+++
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.project 2011-06-30
23:07:41 UTC (rev 32513)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SimpleJava</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.jdt.core.prefs 2011-06-30
23:07:41 UTC (rev 32513)
@@ -0,0 +1,8 @@
+#Thu Jun 30 15:14:46 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.wst.common.project.facet.core.xml 2011-06-30
23:07:41 UTC (rev 32513)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="java" version="1.6"/>
+</faceted-project>
Property changes on:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/projects/SimpleJava/.settings/org.eclipse.wst.common.project.facet.core.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
---
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2011-06-30
23:03:29 UTC (rev 32512)
+++
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2011-06-30
23:07:41 UTC (rev 32513)
@@ -26,6 +26,7 @@
import org.jboss.tools.jsf.model.pv.test.JSFPromptingProviderTest;
import org.jboss.tools.jsf.model.pv.test.JsfJbide7975Test;
import org.jboss.tools.jsf.test.project.facet.JSFFacetOnExistingProjectTest;
+import org.jboss.tools.jsf.test.project.facet.WebFragmentFacetOnExistingProjectTest;
import org.jboss.tools.jsf.test.refactoring.ELVariableRefactoringTest;
import org.jboss.tools.jsf.test.refactoring.JSF2RefactoringTest;
import org.jboss.tools.jsf.test.refactoring.MessagePropertyRefactoringTest;
@@ -44,6 +45,7 @@
TestSuite suite = new TestSuite("Test model loading for JSF projects");
//$NON-NLS-1$
suite.addTestSuite(JSFTemplateTest.class);
suite.addTestSuite(JSFFacetOnExistingProjectTest.class);
+ suite.addTestSuite(WebFragmentFacetOnExistingProjectTest.class);
TestSuite old = new TestSuite("Tests are using JSFKickStartOldFormat");
//$NON-NLS-1$
old.addTestSuite(JSFModelTest.class);
old.addTestSuite(ModelFormat_2_0_0_Test.class);
Added:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/project/facet/WebFragmentFacetOnExistingProjectTest.java
===================================================================
---
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/project/facet/WebFragmentFacetOnExistingProjectTest.java
(rev 0)
+++
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/project/facet/WebFragmentFacetOnExistingProjectTest.java 2011-06-30
23:07:41 UTC (rev 32513)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.test.project.facet;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.validation.internal.plugin.ValidationPlugin;
+import org.jboss.tools.jst.web.kb.internal.KbBuilder;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ * @author Alexey Kazakov and Viacheslav Kabanovich
+ */
+public class WebFragmentFacetOnExistingProjectTest extends TestCase {
+
+ IProject project;
+
+ @Override
+ protected void setUp() throws Exception {
+ project = ResourcesUtils.importProject("org.jboss.tools.jsf.test",
"projects/SimpleJava");
+ JobUtils.waitForIdle();
+
+ IFacetedProject fproj = ProjectFacetsManager.create(project);
+
+ IProjectFacet jsfFacet =
ProjectFacetsManager.getProjectFacet("jst.webfragment");
+ IProjectFacetVersion jsfFacetVersion = jsfFacet.getDefaultVersion();
+
+ fproj.installProjectFacet(jsfFacetVersion, createJSFDataModel(), null);
+ JobUtils.waitForIdle();
+ }
+
+ public void testProjectBuilders() throws CoreException {
+ ICommand[] cs = project.getDescription().getBuildSpec();
+ int validation = -1;
+ int kb = -1;
+ for (int i = 0; i < cs.length; i++) {
+ ICommand c = cs[i];
+ if(ValidationPlugin.VALIDATION_BUILDER_ID.equals(c.getBuilderName())) {
+ validation = i;
+ } else if(KbBuilder.BUILDER_ID.equals(c.getBuilderName())) {
+ kb = i;
+ }
+ }
+ assertTrue(kb >= 0);
+ assertTrue(validation > kb);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ ResourcesUtils.deleteProject(project.getName());
+ JobUtils.waitForIdle();
+ }
+
+ protected IDataModel createJSFDataModel() {
+ IDataModel config = DataModelFactory.createDataModel(new
JSFFacetInstallDataModelProvider());
+ return config;
+ }
+}
\ No newline at end of file
Property changes on:
branches/jbosstools-3.3.0.M2/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/project/facet/WebFragmentFacetOnExistingProjectTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain