Author: scabanovich
Date: 2011-11-03 18:35:24 -0400 (Thu, 03 Nov 2011)
New Revision: 36163
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/WebWithModuleTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java
Log:
JBIDE-10103
https://issues.jboss.org/browse/JBIDE-10103
Loaded composite components from Java source folders.
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java 2011-11-03
21:04:41 UTC (rev 36162)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java 2011-11-03
22:35:24 UTC (rev 36163)
@@ -14,6 +14,7 @@
import junit.framework.TestSuite;
import org.jboss.tools.common.model.util.test.XProjectImportTestSetUp;
+import org.jboss.tools.jsf.kb.test.WebWithModuleTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
/**
@@ -22,6 +23,7 @@
public class JsfKbAllTests {
public static Test suite() {
+ TestSuite suiteAll = new TestSuite("JSF Core Tests");
TestSuite suite = new TestSuite(JsfKbAllTests.class.getName());
suite.addTestSuite(FaceletsKbModelTest.class);
suite.addTestSuite(KbModelTest.class);
@@ -29,6 +31,14 @@
"org.jboss.tools.jsf.test",
new String[]{"projects/TestKbModel"},
new String[]{"TestKbModel"});
+ suiteAll.addTest(testSetup);
+ suite = new TestSuite(WebWithModuleTest.class.getName());
+ suite.addTestSuite(WebWithModuleTest.class);
+ testSetup = new XProjectImportTestSetUp(suite,
+ "org.jboss.tools.jst.web.kb.test",
+ new String[]{"projects/utility", "projects/webapp"},
+ new String[]{"utility", "webapp"});
+ suiteAll.addTest(testSetup);
return testSetup;
}
}
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/WebWithModuleTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/WebWithModuleTest.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/WebWithModuleTest.java 2011-11-03
22:35:24 UTC (rev 36163)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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.kb.test;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
+import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class WebWithModuleTest extends TestCase {
+ protected IProject utility = null;
+ protected IProject webapp = null;
+
+ public WebWithModuleTest() {
+ super("MyFaces Kb Model Test");
+ }
+
+ public void setUp() throws Exception {
+ utility = ResourcesPlugin.getWorkspace().getRoot().getProject("utility");
+ assertNotNull("Can't load utility", utility); //$NON-NLS-1$
+ webapp = ResourcesPlugin.getWorkspace().getRoot().getProject("webapp");
+ assertNotNull("Can't load webapp", webapp); //$NON-NLS-1$
+ }
+
+ /**
+ * webapp project has kb nature, and depends on utility project without kb nature.
+ * In this case builder adds kb problem marker to 'webapp'
+ * and sets on 'utility' property '...mock' to 'true'..
+ *
+ * Check that file 'utility' has correct property '...mock'.
+ * Check that kb model of 'webapp' has tag library declared in sources of
'utility'.
+ *
+ * @throws CoreException
+ */
+ public void testWebProject() throws CoreException {
+ assertTrue("true".equals(utility.getPersistentProperty(KbProjectFactory.NATURE_MOCK)));
+
+ IKbProject kbUtility = KbProjectFactory.getKbProject(utility, true);
+ assertNotNull(kbUtility);
+ int w = 0;
+ while(kbUtility.getTagLibraries().length == 0 && w++ < 50) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ break;
+ }
+ }
+
+ IKbProject kb = KbProjectFactory.getKbProject(webapp, true);
+ ITagLibrary[] ls = kb.getTagLibraries("utility-lib");
+ assertTrue(ls.length > 0);
+ ls =
kb.getTagLibraries("http://java.sun.com/jsf/composite/cc");
+ assertTrue(ls.length > 0);
+ IComponent c = ls[0].getComponent("inputText");
+ assertNotNull(c);
+ }
+
+}
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/WebWithModuleTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain