Author: max.andersen(a)jboss.com
Date: 2007-10-21 10:09:37 -0400 (Sun, 21 Oct 2007)
New Revision: 4399
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1107 Seam 2 support
test project has greenlight now, but waaay to many jars.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2007-10-21
10:03:00 UTC (rev 4398)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2007-10-21
14:09:37 UTC (rev 4399)
@@ -16,8 +16,12 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
import java.util.Properties;
+import java.util.Set;
import org.apache.tools.ant.types.FilterSet;
import org.apache.tools.ant.types.FilterSetCollection;
@@ -96,15 +100,24 @@
.include("mvel14.jar") //$NON-NLS-1$
.include("jboss-el.jar"); //$NON-NLS-1$
- public static AntCopyUtils.FileSet JBOSS_TEST_LIB_FILESET = new AntCopyUtils.FileSet()
+ // test/*.jar are duplicated here since the filtering seem to be assymetric when
matching
+ public static AntCopyUtils.FileSet JBOSS_TEST_LIB_FILESET = new AntCopyUtils.FileSet()
+ .exclude("jboss-seam.*")
+ .exclude("jboss-aop\\.jar")
+ .exclude("jboss-container\\.jar")
+ .include(".*\\.jar") //$NON-NLS-1$ // TODO: fix this, since test
shouldn't need them all ;(
.include("testng\\.jar") //$NON-NLS-1$
.include("test/jboss-deployers.jar") //$NON-NLS-1$
+ .include("jboss-deployers.jar") //$NON-NLS-1$
.include("test/jboss-embedded-all.jar") //$NON-NLS-1$
+ .include("jboss-embedded-all.jar") //$NON-NLS-1$
.include("myfaces-api-.*\\.jar") //$NON-NLS-1$
.include("myfaces-impl-.*\\.jar") //$NON-NLS-1$
.include("servlet-api\\.jar") //$NON-NLS-1$
.include("test/hibernate-all\\.jar") //$NON-NLS-1$
+ .include("hibernate-all\\.jar") //$NON-NLS-1$
.include("test/thirdparty-all\\.jar") //$NON-NLS-1$
+ .include("thirdparty-all\\.jar") //$NON-NLS-1$
//.include("el-api\\.jar") //$NON-NLS-1$
//.include("el-ri\\.jar") //$NON-NLS-1$
.exclude(".*/CVS") //$NON-NLS-1$
@@ -325,6 +338,9 @@
new
File(project.getLocation().toFile(),source.getFullPath().lastSegment()+"/action/"
+
model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.',
'/')+"/"+"Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
new FilterSetCollection(filtersFilterSet), true);
+ // Needed to make sure /dev is picked up by test, so need seam.properties.
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"),
new
File(project.getLocation().toFile(),source.getFullPath().lastSegment()+"/action"),
true); //$NON-NLS-1$
+
AntCopyUtils.copyFileToFile(
persistenceFile,
new File(srcFolder,"META-INF/persistence.xml"), //$NON-NLS-1$
@@ -599,16 +615,20 @@
File[] firstlibs = includeLibs.getDir().listFiles(new
AntCopyUtils.FileSetFileFilter(includeLibs));
File[] secondLibs = secondSetincludeLibs.getDir().listFiles(new
AntCopyUtils.FileSetFileFilter(secondSetincludeLibs));
-
- StringBuffer testLibraries = new StringBuffer();
-
- for (File file : firstlibs) {
- testLibraries.append("\t<classpathentry kind=\"lib\"
path=\"lib/" + file.getName() + "\"/>\n"); //$NON-NLS-1$
//$NON-NLS-2$
+ Set<String> allLibs = new HashSet<String>(); // HACK: needed to be unique
because some jboss-*.jars are duplicated
+ for(File f : firstlibs) {
+ allLibs.add(f.getName());
}
- for (File file : secondLibs) {
- testLibraries.append("\t<classpathentry kind=\"lib\"
path=\"lib/" + file.getName() + "\"/>\n"); //$NON-NLS-1$
//$NON-NLS-2$
+ for(File f : secondLibs) {
+ allLibs.add(f.getName());
}
+
+ StringBuffer testLibraries = new StringBuffer();
+ for (String file : allLibs) {
+ testLibraries.append("\t<classpathentry kind=\"lib\"
path=\"lib/" + file + "\"/>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
StringBuffer requiredProjects = new StringBuffer();
requiredProjects.append(
"\t<classpathentry combineaccessrules=\"false\"
kind=\"src\" path=\"/" + seamWebProject.getName() +
"\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2007-10-21
10:03:00 UTC (rev 4398)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2007-10-21
14:09:37 UTC (rev 4399)
@@ -13,6 +13,7 @@
import java.io.File;
import java.io.IOException;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -130,6 +131,20 @@
}
+
+ public void testSeamProperties() {
+ SeamProjectsSet warPs = new SeamProjectsSet(warProject.getProject());
+
+ IProject warProject = warPs.getWarProject();
+ assertTrue(warProject.exists());
+
+ assertNotNull(warProject.findMember("src/model/seam.properties"));
+ IResource findMember = warProject.findMember("src/action/seam.properties");
+ assertNotNull(findMember);
+ assertTrue(findMember instanceof IFile);
+
+ }
+
public void testJbpmPresent() throws CoreException, IOException {
SeamProjectsSet earPs = new SeamProjectsSet(earProject.getProject());