Author: dgolovin
Date: 2007-07-06 09:52:48 -0400 (Fri, 06 Jul 2007)
New Revision: 2341
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
http://jira.jboss.org/jira/browse/EXIN-221
now project deployed and started under Jboss AS
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-06 12:34:49 UTC (rev
2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-06 13:52:48 UTC (rev
2341)
@@ -50,7 +50,7 @@
</project-facet>
<project-facet-version
facet="jst.seam"
- version="1.2">
+ version="2.0">
<constraint>
<and>
<requires
@@ -61,14 +61,18 @@
facet="jst.jsf"
version="[1.1">
</requires>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
</and>
</constraint>
</project-facet-version>
<action
facet="jst.seam"
- id="jst.seam.1.2.install"
+ id="jst.seam.2.0.install"
type="install"
- version="1.2">
+ version="2.0">
<delegate
class="org.jboss.tools.seam.core.internal.project.facet.SeamFacetInstallDelegete">
</delegate>
@@ -78,9 +82,9 @@
</action>
<action
facet="jst.seam"
- id="jst.seam.1.2.uninstall"
+ id="jst.seam.2.0.uninstall"
type="uninstall"
- version="1.2">
+ version="2.0">
<delegate
class="org.jboss.tools.seam.core.internal.project.facet.SeamFacetUninstallDelegate">
</delegate>
@@ -91,13 +95,27 @@
<supported>
<facet
id="jst.seam"
- version="1.2">
+ version="2.0">
</facet>
<runtime-component
any="true">
</runtime-component>
</supported>
</extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.presets">
+ <static-preset
+ id="preset.jst.seam.v2_0">
+ <label>Seam 2.0 project</label>
+ <facet id="jst.java" version="5.0" />
+ <facet id="jst.web" version="2.4"/>
+ <facet id="jst.jsf" version="1.1" />
+ <facet id="jst.seam" version="2.0"/>
+ <description>
+ Seam 2.0 project
+ </description>
+ </static-preset>
+ </extension>
<extension
point="org.eclipse.wst.validation.validator"
@@ -130,4 +148,4 @@
type="org.eclipse.wst.validation.problemmarker">
</super>
</extension>
-</plugin>
\ No newline at end of file
+</plugin>
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java 2007-07-06
12:34:49 UTC (rev 2340)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java 2007-07-06
13:52:48 UTC (rev 2341)
@@ -54,8 +54,8 @@
}
}
- public static void copyFile(File source, File dest, boolean override) {
- copyFileToFolder(source, new File(dest,source.getName()),new
FilterSetCollection(),override);
+ public static void copyFileToFolder(File source, File dest, boolean override) {
+ copyFileToFolder(source, dest,new FilterSetCollection(),override);
}
public static void copyFileToFolder(File source, File dest, FilterSetCollection
filterSetCollection, boolean override ) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java 2007-07-06
12:34:49 UTC (rev 2340)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java 2007-07-06
13:52:48 UTC (rev 2341)
@@ -27,6 +27,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.core.JavaModel;
+import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -53,10 +56,26 @@
.include("img")
.exclude(".*/.*\\.ftl");
- public static FileSet SEAM_JARS = new FileSet()
- .include("jboss-seam.*\\.jar")
- .exclude("jboss-seam-gen\\.jar");
+ public static FileSet SEAM_THIRD_PARTY_JARS = new FileSet()
+ .include("ajax4jsf.*\\.jar")
+ .include("richfaces.*\\.jar")
+ .include("oscache.*\\.jar")
+ .include("jsf-facelets\\.jar")
+ .include("jboss-seam-.*\\.jar")
+ .exclude("jboss-seam-gen\\.jar")
+ .include("drools-.*\\.jar")
+ .include("janino-.*\\.jar")
+ .include("antlr-.*\\.jar")
+ .include("mvel.*\\.jar")
+ .include("groovy-.*\\.jar");
+ public static FileSet SEAM_JARS = new FileSet()
+ .include("jboss-seam\\.jar")
+ .include("jbpm*\\.jar")
+ .include("jboss-el\\.jar")
+ .include("commons-digester-.*\\.jar")
+ .include("commons-beanutils-.*\\.jar");
+
public static FileSet JAVA_LIBS = new FileSet()
.include(".[^/]*\\.jar")
.include(".[^/]*\\.zip");
@@ -72,6 +91,9 @@
.include("META-INF/persistence-" + PROFILE + "\\.xml" )
.include("import-" + PROFILE + "\\.sql");
+ public static FileSet JBOOS_WAR_RESOURCE_SET2 = new FileSet()
+ .include("WEB-INF/jboss-web\\.xml")
+ .include("META-INF/persistence-" + PROFILE + "\\.xml" );
public static String DROOLS_LIB_SEAM_RELATED_PATH = "drools/lib";
@@ -88,10 +110,12 @@
WebArtifactEdit.getWebArtifactEditForRead(project);
IVirtualComponent com = ComponentCore.createComponent(project);
IVirtualFolder webRootFolder = com.getRootFolder().getFolder(new Path("/"));
+ IVirtualFolder srcRootFolder = com.getRootFolder().getFolder(new
Path("/WEB-INF/classes"));
IContainer folder = webRootFolder.getUnderlyingFolder();
File webContentFolder = folder.getLocation().toFile();
-
+ File webInfFolder = new File(webContentFolder,"WEB-INF");
+ File srcFolder = srcRootFolder.getUnderlyingFolder().getLocation().toFile();
model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
String seamHomePath =
model.getProperty(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString();
@@ -99,15 +123,18 @@
File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
File seamGenResFolder = new File(seamHomePath,"seam-gen/resources");
File droolsLibFolder = new File(seamHomePath,DROOLS_LIB_SEAM_RELATED_PATH);
- File seamGenViewSource = new File(seamHomePath,"seam-gen/view");
+ File securityDrools = new File(seamGenResFolder,"security.drl");
+ File seamGenHomeFolder = new File(seamHomePath,"seam-gen");
+ File seamGenViewSource = new File(seamGenHomeFolder,"view");
File jdbcDriverFile = new
File(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH).toString());
- File hibernateConsoleLaunchFile = new File(seamHomeFolder,
"seam-gen/hibernatetools/hibernate-console.launch");
- File hibernateConsolePropsFile = new File(seamHomeFolder,
"seam-gen/hibernatetools/hibernate-console.properties");
+ File hibernateConsoleLaunchFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.launch");
+ File hibernateConsolePropsFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.properties");
+ File hibernateConsolePref = new File(seamGenHomeFolder,
"hibernatetools/.settings/org.hibernate.eclipse.console.prefs");
-
FilterSet jdbcFilterSet = FilterSetFactory.createJdbcFilterSet(model);
FilterSet projectFilterSet = FilterSetFactory.createProjectFilterSet(model);
+ FilterSet filtersFilterSet = FilterSetFactory.createFiltersFilterSet(model);
// ****************************************************************
// Copy view folder from seam-gen installation to WebContent folder
@@ -145,10 +172,15 @@
// TODO add copy for /hibernatetools/seam-gen.reveng.xml
- // *************************************
- // TODO modify existing faces-config.xml
- // *************************************
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(project.getLocation().toFile(),".settings"),
+ new FilterSetCollection(projectFilterSet), true);
+ AntCopyUtils.copyFileToFolder(
+ securityDrools,
+ srcFolder,
+ true);
//
********************************************************************************************
// TODO copy libraries/link libraries (seam jars, seam dependencies jars, drols jars,
jdbc jar)
@@ -157,18 +189,51 @@
File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_JARS).dir(seamHomeFolder)));
copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_JARS).dir(seamLibFolder)));
- copyFiles(droolsLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_JARS).dir(droolsLibFolder)));
-
+ copyFiles(droolsLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_THIRD_PARTY_JARS).dir(droolsLibFolder)));
+ copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_THIRD_PARTY_JARS).dir(seamHomeFolder)));
+ copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_THIRD_PARTY_JARS).dir(seamLibFolder)));
+
if(jdbcDriverFile.exists())
- AntCopyUtils.copyFile(jdbcDriverFile, webLibFolder, true);
+ AntCopyUtils.copyFileToFolder(jdbcDriverFile, webLibFolder, true);
// TODO generate db support as seam-gen does
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder,"src/Authenticator.java"),
+ new File(project.getLocation().toFile(),"src/" +
model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.',
'/')+"/"+"Authenticator.java"),
+ new FilterSetCollection(filtersFilterSet), true);
+ // TODO copy sources to src
+
+
// TODO may be generate RHDS studio feature to show it on projects view
// TODO say JBoss AS adapter what kind of deployment to use
+ // copy war files
+ if(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS).equals("war"))
{
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenResFolder,"WEB-INF/components-war.xml"),
+ new File(webInfFolder,"components.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ AntCopyUtils.copyFileToFile(
+ new File(seamHomeFolder,"seam-gen/build-scripts/build-war.xml"),
+ new File(project.getLocation().toFile(),"build.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ FileSet web2FileSet = new FileSet(JBOOS_WAR_RESOURCE_SET2).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder, webContentFolder, new FileSetFileFilter(web2FileSet),
viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"),
srcFolder, true);
+
+ } else {
+ // copy ear files
+ AntCopyUtils.copyFileToFile(
+ new File(seamHomeFolder,"seam-gen/build-scripts/build.xml"),
+ new File(project.getLocation().toFile(),"build.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+ }
- // TODO generate build.xml
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
@@ -176,6 +241,7 @@
public static void copyFiles(File source, File dest, FileFilter filter) {
dest.mkdir();
for (File file:source.listFiles(filter)) {
+ if(file.isDirectory())continue;
try {
FileUtils.getFileUtils().copyFile(file, new File(dest,file.getName()),new
FilterSetCollection(),true);
} catch (IOException e) {
@@ -256,6 +322,13 @@
public List<Pattern> getIncluded() {
return Collections.unmodifiableList(include);
}
+
+ /**
+ * @return
+ */
+ public File getDir() {
+ return dir;
+ }
}
public static class FileSetFileFilter implements FileFilter {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-06 12:34:49
UTC (rev 2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-06 13:52:48
UTC (rev 2341)
@@ -20,7 +20,12 @@
org.jboss.tools.seam.core,
org.apache.log4j,
org.hibernate.eclipse.console,
- org.eclipse.jst.j2ee
+ org.eclipse.jst.j2ee,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jem,
+ org.eclipse.jem.util,
+ org.eclipse.emf.ecore,
+ org.eclipse.jst.j2ee.web
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.internal.project.facet;x-internal:=true,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-06 12:34:49 UTC (rev
2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-06 13:52:48 UTC (rev
2341)
@@ -77,7 +77,7 @@
</extension>
<extension
point="org.eclipse.wst.common.project.facet.ui.wizardPages">
- <wizard-pages action="jst.seam.1.2.install">
+ <wizard-pages action="jst.seam.2.0.install">
<page
class="org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage"/>
</wizard-pages>
</extension>
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-06
12:34:49 UTC (rev 2340)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-06
13:52:48 UTC (rev 2341)
@@ -102,10 +102,10 @@
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
"Session Bean Package Name:","com.mydomain.projectname.session");
IFieldEditor entityBeanPkgNameditor = IFieldEditorFactory.INSTANCE.createTextEditor(
- ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
+ ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
"Entity Bean Package Name:","com.mydomain.projectname.entity");
IFieldEditor testsPkgNameditor = IFieldEditorFactory.INSTANCE.createTextEditor(
- ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
+ ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME,
"Session Bean Package Name:","com.mydomain.projectname.test");
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java 2007-07-06
12:34:49 UTC (rev 2340)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java 2007-07-06
13:52:48 UTC (rev 2341)
@@ -12,16 +12,43 @@
import java.util.ArrayList;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.*;
import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.SWT;
-import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.DrillDownAdapter;
+import org.eclipse.ui.part.ViewPart;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
/**
@@ -275,7 +302,16 @@
private void makeActions() {
action1 = new Action() {
public void run() {
- showMessage("Action 1 executed");
+
+ IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject("t9");
+ ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
+ WebArtifactEdit edit =
+ WebArtifactEdit.getWebArtifactEditForRead(project);
+ IVirtualComponent com = ComponentCore.createComponent(project);
+ IVirtualFolder webRootFolder = com.getRootFolder().getFolder(new
Path("/WEB-INF/classes"));
+ IContainer folder = webRootFolder.getUnderlyingFolder();
+ webRootFolder.getUnderlyingFolders();
+ showMessage(webRootFolder.getUnderlyingFolder().getLocation().toString());
}
};
action1.setText("Action 1");
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2007-07-06
12:34:49 UTC (rev 2340)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2007-07-06
13:52:48 UTC (rev 2341)
@@ -30,6 +30,7 @@
import org.jboss.tools.seam.core.SeamCoreBuilder;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
+import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
public class ScannerTest extends TestCase {
TestProjectProvider provider = null;
@@ -70,20 +71,20 @@
IFileScanner scanner = SeamCoreBuilder.getXMLScanner();
assertTrue("Scanner cannot recognise components.xml",
scanner.isRelevant(f));
assertTrue("Scanner cannot recognise components.xml content",
scanner.isLikelyComponentSource(f));
- ISeamComponentDeclaration[] cs = null;
+ LoadedDeclarations cs = null;
try {
cs = scanner.parse(f);
} catch (Exception e) {
fail("Error in xml scanner:" + e.getMessage());
}
- assertTrue("Components are not found in components.xml", cs != null
&& cs.length > 0);
+ assertTrue("Components are not found in components.xml", cs != null
&& cs.getComponents().size() > 0);
- assertTrue("First component name must be " + "myComponent",
"myComponent".equals(cs[0].getName()));
+ assertTrue("First component name must be " + "myComponent",
"myComponent".equals(cs.getComponents().get(0).getName()));
//After having tested details of xml scanner now let us check
// that it succeeded in build.
- Set<ISeamComponent> components =
seamProject.getComponentsByName("myComponent");
+ Set<ISeamComponent> components = seamProject.getComponents();
assertTrue("Seam builder must put myComponent to project.", components.size()
== 1);
@@ -121,20 +122,20 @@
IFileScanner scanner = SeamCoreBuilder.getJavaScanner();
assertTrue("Scanner cannot recognise User.java", scanner.isRelevant(f));
assertTrue("Scanner cannot recognise User.java content",
scanner.isLikelyComponentSource(f));
- ISeamComponentDeclaration[] cs = null;
+ LoadedDeclarations cs = null;
try {
cs = scanner.parse(f);
} catch (Exception e) {
fail("Error in java scanner:" + e.getMessage());
}
- assertTrue("Components are not found in User.java", cs != null &&
cs.length > 0);
+ assertTrue("Components are not found in User.java", cs != null &&
cs.getComponents().size() > 0);
- assertTrue("First component name must be " + "myUser",
"myUser".equals(cs[0].getName()));
+ assertTrue("First component name must be " + "myUser",
"myUser".equals(cs.getComponents().get(0).getName()));
//After having tested details of java scanner now let us check
//that it succeeded in build.
- Set<ISeamComponent> components =
seamProject.getComponentsByName("myUser");
+ Set<ISeamComponent> components = seamProject.getComponents();
assertTrue("Seam builder must put myUser to project.", components.size() ==
1);
@@ -162,18 +163,18 @@
IFileScanner scanner = SeamCoreBuilder.getLibraryScanner();
assertTrue("Scanner cannot recognise jboss-seam.jar",
scanner.isRelevant(f));
assertTrue("Scanner cannot recognise jboss-seam.jar content",
scanner.isLikelyComponentSource(f));
- ISeamComponentDeclaration[] cs = null;
+ LoadedDeclarations cs = null;
try {
cs = scanner.parse(f);
} catch (Exception e) {
fail("Error in library scanner:" + e.getMessage());
}
- assertTrue("Components are not found in jboss-seam.jar", cs != null
&& cs.length > 0);
+ assertTrue("Components are not found in jboss-seam.jar", cs != null
&& cs.getComponents().size() > 0);
boolean hasActor = false;
- for (int i = 0; i < cs.length && !hasActor; i++) {
- if("actor".equals(cs[0].getName())) hasActor = true;
+ for (int i = 0; i < cs.getComponents().size() && !hasActor; i++) {
+ if("actor".equals(cs.getComponents().get(0).getName())) hasActor = true;
}
assertTrue("Component " + "actor" + " is not found in
jboss-seam.jar", hasActor);
@@ -189,7 +190,7 @@
* After having tested details of library scanner now let us check
* that it succeeded in build.
*/
- Set<ISeamComponent> components =
seamProject.getComponentsByName("actor");
+ Set<ISeamComponent> components = seamProject.getComponents();
assertTrue("Seam builder must put actor to project.",
components.size()==1);
}