JBoss Rich Faces SVN: r12331 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-19 06:05:41 -0500 (Mon, 19 Jan 2009)
New Revision: 12331
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
Remove checking for event ordering
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-19 10:50:57 UTC (rev 12330)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-19 11:05:41 UTC (rev 12331)
@@ -1304,6 +1304,13 @@
}
+ for (SeleniumEvent ev : eventsExpected) {
+ assertEvent(ev.getName());
+ }
+
+ // Remove checking for event ordering. It may be an accidental one
+
+ /*
StringBuilder sb = new StringBuilder();
String delim = "";
for (SeleniumEvent event : eventsExpected) {
@@ -1316,6 +1323,7 @@
Assert.fail(message);
}
eventsExpected.clear();
+ */
return null;
}
16 years, 11 months
JBoss Rich Faces SVN: r12330 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-19 05:50:57 -0500 (Mon, 19 Jan 2009)
New Revision: 12330
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
Log:
Call reset method before each test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2009-01-19 10:41:00 UTC (rev 12329)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2009-01-19 10:50:57 UTC (rev 12330)
@@ -399,7 +399,7 @@
*/
@Test
public void testRequired(Template template) {
- renderPage(template);
+ renderPage(template, initMethod);
initFields();
Assert.assertTrue(selenium.getText(messagesId).length() == 0);
clickAjaxCommandAndWait(getParentId() + "testRequiredAndImmediate:submit");
@@ -418,7 +418,7 @@
@Test
public void testButtons(Template template) {
- renderPage(template);
+ renderPage(template, initMethod);
initFields();
writeStatus("Check if all buttons are disabled first time");
16 years, 11 months
JBoss Rich Faces SVN: r12329 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-19 05:41:00 -0500 (Mon, 19 Jan 2009)
New Revision: 12329
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
Log:
Fix testAction test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2009-01-19 10:39:45 UTC (rev 12328)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2009-01-19 10:41:00 UTC (rev 12329)
@@ -460,7 +460,14 @@
clickById(ajax);
waitForAjaxCompletion();
AssertTextEquals(actionResultText, "item0");
- AssertTextEquals(selectionText, "item2,item0");
+ String selectedItems = getTextById(actionResultText);
+ if (!selectedItems.contains("item2")) {
+ Assert.fail("The third item was not selected");
+ }
+ if (!selectedItems.contains("item0")) {
+ Assert.fail("The first item was not selected");
+ }
+
//AssertTextEquals(activeItemText, "Item [item0]");
writeStatus("Select one row");
16 years, 11 months
JBoss Rich Faces SVN: r12328 - trunk/sandbox/samples/maven-rd-plugin-sample.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-19 05:39:45 -0500 (Mon, 19 Jan 2009)
New Revision: 12328
Modified:
trunk/sandbox/samples/maven-rd-plugin-sample/pom.xml
Log:
Modified: trunk/sandbox/samples/maven-rd-plugin-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/maven-rd-plugin-sample/pom.xml 2009-01-19 10:39:05 UTC (rev 12327)
+++ trunk/sandbox/samples/maven-rd-plugin-sample/pom.xml 2009-01-19 10:39:45 UTC (rev 12328)
@@ -23,12 +23,12 @@
<plugin>
<artifactId>maven-resource-dependency-plugin</artifactId>
<groupId>org.richfaces.cdk.sandbox</groupId>
- <version>3.3.1-SNAPSHOT</version>
- <configuration>
- <namespaces>
- <namespace>http://richfaces.org/rich</namespace>
- <namespace>http://richfaces.org/a4j</namespace>
- </namespaces>
+ <version>3.3.1-SNAPSHOT</version>
+ <configuration>
+ <namespaces>
+ <namespace>http://richfaces.org/rich</namespace>
+ <namespace>http://richfaces.org/a4j</namespace>
+ </namespaces>
</configuration>
<executions>
<execution>
16 years, 11 months
JBoss Rich Faces SVN: r12327 - in trunk/sandbox/cdk/maven-resource-dependency-plugin: src/main/java/org/richfaces/cdk/rd and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-19 05:39:05 -0500 (Mon, 19 Jan 2009)
New Revision: 12327
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
Log:
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml 2009-01-19 10:23:28 UTC (rev 12326)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml 2009-01-19 10:39:05 UTC (rev 12327)
@@ -24,8 +24,8 @@
<version>2.0</version>
</dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
@@ -54,7 +54,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
+ <version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
@@ -92,6 +92,17 @@
<version>2.0.8</version>
<optional>true</optional>
</dependency>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.0</version>
+ </dependency>
+
</dependencies>
</project>
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java 2009-01-19 10:23:28 UTC (rev 12326)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java 2009-01-19 10:39:05 UTC (rev 12327)
@@ -16,7 +16,7 @@
private FileObject baseFile;
- private Set result = new HashSet();
+ private Set <FileObject> result = new HashSet <FileObject>();
private String [] patterns;
@@ -72,11 +72,11 @@
}
}
- public Set getResult() {
+ public Set <FileObject> getResult() {
return result;
}
- public void setResult(Set result) {
+ public void setResult(Set <FileObject> result) {
this.result = result;
}
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java 2009-01-19 10:23:28 UTC (rev 12326)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java 2009-01-19 10:39:05 UTC (rev 12327)
@@ -1,6 +1,6 @@
package org.richfaces.cdk.rd.handler;
-import java.util.Collection;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -9,7 +9,6 @@
import org.richfaces.cdk.rd.Component;
import org.richfaces.cdk.rd.Components;
import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
/**
@@ -18,48 +17,16 @@
*/
public class ComponentsHandler extends DefaultHandler{
-
-// private Set <PrefixMapping> prefixList = new HashSet<PrefixMapping>();
-//
-// private Set <String> userNamespaces = new HashSet<String>();
-//
-// public static String RICH_DEFAULT = "http://richfaces.org/rich";
-//
-// public static String A4J_DEFAULT = "http://richfaces.org/a4j";
-
private Log log;
private List <Components> components;
private String tempString;
- private Set <String> scripts = new HashSet<String>();
+ private List <String> scripts = new ArrayList<String>();
- private Set <String> styles = new HashSet<String>();
+ private List <String> styles = new ArrayList<String>();
-// @Override
-// public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
-// for (PrefixMapping prefix: prefixList) {
-//
-// String prefixUri = prefix.getUri();
-// String qname = prefix.getPrefix();
-//
-// if(uri.equals(prefixUri) && name.startsWith(qname)) {
-// getResult().add(localName);
-// }
-// }
-// }
-
-// @Override
-// public void startPrefixMapping(String prefix, String uri) throws SAXException {
-// getLog().info("Process mapping: prefix: " + prefix + " uri: " + uri );
-//
-// if (userNamespaces != null && userNamespaces.contains(uri)) {
-// PrefixMapping prefixMapping = new PrefixMapping(prefix, uri);
-// addPrefixMapping(prefixMapping);
-// }
-
-// }
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
tempString = new String(ch, start, length);
@@ -67,32 +34,48 @@
@Override
public void endElement(String uri, String localName, String name) throws SAXException {
- for (Components library: components) {
- if(library.getNamespace().equals(uri)) {
- List <Component> components = library.getComponents();
- for(Component component : components ){
- if(localName.equals(component.getComponentName())) {
- collectScripts(component.getScripts());
- collectStyles(component.getScripts());
+ if(components != null) {
+ for (Components library: components) {
+ if(library.getNamespace().equals(uri)) {
+ List <Component> components = library.getComponents();
+ for(Component component : components ){
+ if(localName.equals(component.getComponentName())) {
+ collectScripts(component);
+ collectStyles(component);
+ }
}
}
}
}
}
- private void collectStyles(Collection <String> styles) {
- this.styles.addAll(styles);
+ private void collectStyles(Component component) {
+ for(String style : component.getStyles()) {
+ if(!this.styles.contains(style)) {
+ if (getLog() != null) {
+ getLog().info("collect styles from: " + component.getComponentName() + " component");
+ }
+ this.styles.add(style);
+ }
+ }
}
- private void collectScripts(Collection <String> scripts) {
- this.scripts.addAll(scripts);
+ private void collectScripts(Component component) {
+ for(String script : component.getScripts()) {
+ if(!this.scripts.contains(script)) {
+ if (getLog() != null) {
+ getLog().info("collect script from: " + component.getComponentName() + " component");
+ }
+ this.scripts.add(script);
+ }
+ }
}
- public Set <String> getStyles() {
+ public List <String> getStyles() {
return this.styles;
}
- public Set <String> getScripts() {
+ public List <String> getScripts() {
return this.scripts;
}
@@ -103,10 +86,6 @@
public void setComponents(List<Components> components) {
this.components = components;
}
-
- @Override
- public void fatalError(SAXParseException e) throws SAXException {
- }
public Log getLog() {
return log;
@@ -115,22 +94,5 @@
public void setLog(Log log) {
this.log = log;
}
-
-
-// public void addNamespaces(Collection <String>namespaces) {
-// this.userNamespaces.addAll(namespaces);
-// }
-//
-// public Collection <String> getNamespaces() {
-// if(userNamespaces.isEmpty() || !(userNamespaces.contains(RICH_DEFAULT) && userNamespaces.contains(A4J_DEFAULT))) {
-// userNamespaces.add(RICH_DEFAULT);
-// userNamespaces.add(A4J_DEFAULT);
-// }
-// return this.userNamespaces;
-// }
-//
-// public void addPrefixMapping(PrefixMapping prefixMapping) {
-// prefixList.add(prefixMapping);
-// }
-//
+
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-19 10:23:28 UTC (rev 12326)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-19 10:39:05 UTC (rev 12327)
@@ -22,38 +22,44 @@
package org.richfaces.cdk.rd.mojo;
import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.apache.commons.digester.Digester;
import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileSystemManager;
import org.apache.commons.vfs.VFS;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.model.Dependency;
-import org.apache.maven.model.Model;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.artifact.MavenMetadataSource;
+import org.codehaus.classworlds.ClassRealm;
+import org.codehaus.classworlds.ClassWorld;
import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.util.IOUtil;
import org.richfaces.cdk.rd.Component;
import org.richfaces.cdk.rd.Components;
import org.richfaces.cdk.rd.JarResourceScanner;
import org.richfaces.cdk.rd.handler.ComponentsHandler;
-import org.xml.sax.SAXException;
/**
* @author Anton Belevich
@@ -101,13 +107,13 @@
/**
* outputScriptDirectory
- * @parameter
+ * @parameter expression = "${basedir}/src/main/webapp"
*/
- private File outputScriptDirectory;
+ private File outputScriptDirectory ;
/**
* scriptPackName
- * @parameter;
+ * @parameter expression="custom-dependencies";
*/
private String scriptPackName;
@@ -130,27 +136,47 @@
*/
private String loadOrder;
+ /**
+ *
+ * @component
+ */
+ private ArtifactMetadataSource metadataSource;
+
+
public void execute() throws MojoExecutionException {
try {
- Artifact richfaces = getUIArifact(project);
- FileObject jarRichfaces = resolveArtifact(richfaces);
- FileObject [] configs = resolveConfigsFromJar(jarRichfaces);
- List components = processConfigs(configs, new ArrayList());
- Set <String> result = findComponents(webSourceDirectory, components);
-// Set result = selectScriptResources(richConfigs,components);
+ Artifact richfacesUI = createDependencyArtifact("richfaces-ui", project.getVersion(), "jar");
+ Artifact richfacesImpl = createDependencyArtifact("richfaces-impl", project.getVersion(), "jar");
+ List <FileObject> richfaces = new ArrayList<FileObject>();
+
+ FileObject jarRichfacesUI = resolveArtifact(richfacesUI);
+ richfaces.add(jarRichfacesUI);
+ FileObject jarRichfacesImpl = resolveArtifact(richfacesImpl);
+ richfaces.add(jarRichfacesImpl);
+
+ FileObject [] configs = resolveConfigsFromJar(jarRichfacesUI);
+ List <Components> components = processConfigs(configs, new ArrayList <Components>());
+ ComponentsHandler handler = findComponents(webSourceDirectory, components);
+
+ List result = handler.getScripts();
+ mergeScripts(result, richfaces, outputScriptDirectory);
+
for (Iterator iterator = result.iterator(); iterator.hasNext();) {
getLog().info("collect: " + iterator.next());
}
+
} catch (Exception e) {
throw new MojoExecutionException(e.getMessage(),e);
}
}
- public List processConfigs(FileObject [] configs, List collector) {
+ public List <Components> processConfigs(FileObject [] configs, List collector) {
+
for (FileObject config: configs) {
+
Digester digester = new Digester();
digester.addObjectCreate("components", Components.class);
digester.addCallMethod("components/namespace", "setNamespace", 0);
@@ -159,19 +185,27 @@
digester.addCallMethod("components/component/scripts/script", "addScript",0);
digester.addCallMethod("components/component/styles/styles", "addStyle",0);
digester.addSetNext("components/component", "addComponent");
-
+ InputStream configInputStream = null;
+
try {
- collector.add(digester.parse(config.getContent().getInputStream()));
- } catch (SAXException e) {
+ configInputStream = config.getContent().getInputStream();
+ collector.add(digester.parse(configInputStream));
+
+ } catch (Exception e) {
getLog().error(e);
- } catch (IOException e) {
- getLog().error(e);
+ } finally {
+ try {
+ configInputStream.close();
+ } catch (IOException e) {
+ getLog().error(e);
+ }
}
+
}
return collector;
}
- public Set findComponents (File webSourceDir, List components) {
+ public ComponentsHandler findComponents (File webSourceDir, List <Components> components) {
DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(webSourceDir);
@@ -196,40 +230,32 @@
getLog().info("process file: " + file.getName());
try {
saxParser.parse(file, handler);
- } catch (SAXException e) {
- getLog().error(e);
- } catch (IOException e) {
- getLog().error(e);
- }
+ } catch (Exception e) {
+ getLog().error("Error process file: " + file.getAbsolutePath(), e);
+ }
}
}
- } catch (FactoryConfigurationError e) {
+ } catch (Exception e) {
getLog().error(e);
- } catch (ParserConfigurationException e) {
- getLog().error(e);
- } catch (SAXException e){
- getLog().error(e);
- }
+ }
- return handler.getScripts();
+ return handler;
}
- protected Artifact getUIArifact (MavenProject project) {
+ protected Artifact createDependencyArtifact(String id, String version, String type) throws Exception{
- Model model = project.getModel();
- List <Dependency> dependencyList = model.getDependencies();
-
+ List <Dependency> dependencies = project.getDependencies();
Artifact artifact = null;
-
- for(Dependency dependency : dependencyList) {
- if(dependency.getArtifactId().equals("richfaces-ui") && dependency.getVersion().equals(model.getVersion()) && dependency.getType().equals("jar")) {
+
+ for(Dependency dependency : dependencies) {
+ if(dependency.getArtifactId().equals(id) && dependency.getVersion().equals(version) && dependency.getType().equals(type)) {
String groupId = dependency.getGroupId();
String artifactId = dependency.getArtifactId();
- String version = dependency.getVersion();
+ String artifactVersion = dependency.getVersion();
String scope = dependency.getScope();
- String type = dependency.getType();
- artifact = factory.createArtifact(groupId, artifactId, version, scope, type);
+ String artifactType = dependency.getType();
+ artifact = factory.createArtifact(groupId, artifactId, artifactVersion, scope, artifactType);
break;
}
}
@@ -237,6 +263,19 @@
return artifact;
}
+ protected Set <Artifact> createProjectDependenciesArtifacts() {
+ ArtifactResolutionResult result = null;
+ try {
+ List <Dependency> dependencies = project.getDependencies();
+ Set <Artifact> artifacts = MavenMetadataSource.createArtifacts(factory, dependencies, null, null, project);
+ result = resolver.resolveTransitively(artifacts, project.getArtifact(), Collections.EMPTY_LIST, localRepository, metadataSource);
+ } catch (Exception e) {
+ getLog().error(e);
+ }
+ return result.getArtifacts();
+ }
+
+
protected FileObject resolveArtifact(Artifact artifact) {
FileObject jarFileObject = null;
@@ -254,9 +293,10 @@
try {
FileSystemManager manager = VFS.getManager();
jarFileObject = manager.resolveFile("jar://" + file.getAbsolutePath());
- } catch (IOException e) {
- getLog().error(e);
- }
+ } catch (FileSystemException e) {
+ getLog().error("Error during processing file: " + file.getAbsolutePath(), e);
+ }
+
}
return jarFileObject;
}
@@ -277,6 +317,83 @@
return result;
}
- public void mergeScripts(Set <String> components) throws Exception{
+ public void mergeFiles(File dest, List <FileObject> jarFileObjects, String scriptPath) throws Exception{
+
+ for(FileObject sourceFileObjects : jarFileObjects){
+
+ FileOutputStream out = new FileOutputStream(dest, true);
+ try {
+ FileObject scriptFileObject = sourceFileObjects.resolveFile(scriptPath);
+ if(scriptFileObject.exists()) {
+ InputStream in = scriptFileObject.getContent().getInputStream();
+ try {
+ IOUtil.copy(in, out);
+ if (true) {
+ out.write('\n');
+ }
+ } finally {
+ IOUtil.close(in);
+ in = null;
+ }
+ }
+ } finally {
+ IOUtil.close(out);
+ out = null;
+ }
+ }
}
+
+ protected void mergeScripts(List <String> scripts, List <FileObject> jarFileObjects, File outputScriptDirectory) {
+
+ File assemblyScriptFile = new File(outputScriptDirectory, scriptPackName + ".js");
+ if(!assemblyScriptFile.exists()) {
+ try {
+ assemblyScriptFile.createNewFile();
+ } catch (IOException e) {
+ getLog().error("Error create file: " + assemblyScriptFile.getAbsolutePath(), e);
+ }
+ }
+
+ for(String script: scripts) {
+ try {
+ if(script.endsWith(".js")) {
+ mergeFiles(assemblyScriptFile, jarFileObjects, script);
+ } else {
+
+ Set <Artifact> artifacts = createProjectDependenciesArtifacts();
+
+ //save current ContextClassloader
+ ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
+
+ //create a new classloading space
+ ClassWorld world = new ClassWorld();
+
+ //use the existing ContextClassLoader in a realm of the classloading space
+ ClassRealm realm = world.newRealm("org.richfaces.cdk", Thread.currentThread().getContextClassLoader());
+
+ //create another realm for the app jars
+ ClassRealm jars = realm.createChildRealm("jar");
+ for(Artifact jar : artifacts ) {
+ jars.addConstituent(jar.getFile().toURL());
+ }
+
+ //make the child realm the ContextClassLoader
+ Thread.currentThread().setContextClassLoader(jars.getClassLoader());
+
+ //resolve framework script path
+ Class clazz = Thread.currentThread().getContextClassLoader().loadClass(script);
+ Object obj = clazz.newInstance();
+ Method method = clazz.getMethod("getPath", new Class [0]);
+ String path = (String) method.invoke(obj, new Object[0]);
+
+ // restore old ContextClassLoader
+ Thread.currentThread().setContextClassLoader(oldClassLoader);
+
+ mergeFiles(assemblyScriptFile, jarFileObjects, path);
+ }
+ } catch (Exception e) {
+ getLog().error(e);
+ }
+ }
+ }
}
16 years, 11 months
JBoss Rich Faces SVN: r12326 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-19 05:23:28 -0500 (Mon, 19 Jan 2009)
New Revision: 12326
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
Log:
Fix Ordering List Test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2009-01-19 09:14:56 UTC (rev 12325)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2009-01-19 10:23:28 UTC (rev 12326)
@@ -475,7 +475,7 @@
@Test
public void testJSFunctions(Template template) {
- renderPage(template);
+ renderPage(template, initMethod);
initFields();
writeStatus("Select one row");
16 years, 11 months
JBoss Rich Faces SVN: r12325 - in trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces: testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-19 04:14:56 -0500 (Mon, 19 Jan 2009)
New Revision: 12325
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
Log:
Fix dataScroller Test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-18 11:23:28 UTC (rev 12324)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-19 09:14:56 UTC (rev 12325)
@@ -1237,7 +1237,13 @@
* @param isId - Pass true if ID is string, false - if ID is expression to load appropriate DOM element
*/
public void assertClassNames(String id, String[] classNames, String message, boolean isId) {
- String clazz = runScript(((isId) ? "document.getElementById('"+id+"')" : id) + ".className");
+ //String clazz = runScript(((isId) ? "document.getElementById('"+id+"')" : id) + ".className");
+ String clazz = null;
+ if (isId) {
+ clazz = selenium.getAttribute("//*[@id='" + id + "']/@class");
+ }else {
+ clazz = selenium.getAttribute(id + "/@class");
+ }
List<String> classes = (clazz != null) ? Arrays.asList(clazz.split(" ")) : new ArrayList<String>();
for (String s : classNames) {
boolean result = classes.contains(s);
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2009-01-18 11:23:28 UTC (rev 12324)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2009-01-19 09:14:56 UTC (rev 12325)
@@ -398,29 +398,23 @@
dataScrollerInFacetId = parentId + "_data:tbl:scroller";
dataScrollerTableInFacetId = parentId + "_data:tbl:scroller_table";
- //FIXME: currently dataTableId is invalid (dataTableId + ':0'). May be it's cause of problem with component state storing inside dataTable.
- dataTableId = (!template.getName().equals(Template.DATA_TABLE.getName())) ? parentId + "_data:tbl" : parentId + "_data:tbl:0";
+ dataTableId = parentId + "_data:tbl";
}
private void testHTMLEvent(String id) {
- List<String> event = new ArrayList<String>();
- event.add("onclick");
- event.add("onmousedown");
- event.add("onmousemove");
- event.add("onmouseout");
- event.add("onmouseover");
- event.add("onmouseup");
-
- clickById(id);
+ selenium.click(id);
selenium.mouseDown(id);
selenium.mouseMove(id);
selenium.mouseOut(id);
selenium.mouseOver(id);
selenium.mouseUp(id);
- assertEvents(event);
-
-
+ assertEvent("onclick");
+ assertEvent("onmousedown");
+ assertEvent("onmousemove");
+ assertEvent("onmouseout");
+ assertEvent("onmouseover");
+ assertEvent("onmouseup");
}
private void testRendering() {
@@ -514,30 +508,17 @@
}
private String getPageLinkRefScript(int n, String dataScrollerTableId) {
- StringBuffer b = new StringBuffer(WINDOW_JS_RESOLVER);
- b.append("$('");
- b.append(dataScrollerTableId);
- b.append("').rows[0].cells[");
- b.append(n);
- b.append("]");
- return b.toString();
+ return "//*[@id='" + dataScrollerTableId + "']/tbody/tr/td[" + (n + 1) + "]";
}
private void clickControl(int n, String dataScrollerTableId) {
- StringBuffer b = new StringBuffer();
- b.append(getPageLinkRefScript(n, dataScrollerTableId));
- b.append(".onclick();");
- selenium.getEval(b.toString());
+ selenium.click(getPageLinkRefScript(n, dataScrollerTableId));
waitForAjaxCompletion();
- assertEvents(events);
+ assertEvent("onpagechange");
}
private void clickControlNotWait(int n) {
- StringBuffer b = new StringBuffer();
- b.append(getPageLinkRefScript(n, dataScrollerTableId));
- b.append(".onclick();");
- selenium.getEval(b.toString());
- }
+ selenium.click(getPageLinkRefScript(n, dataScrollerTableId)); }
/* (non-Javadoc)
* @see org.richfaces.SeleniumTestBase#getTestUrl()
16 years, 11 months
JBoss Rich Faces SVN: r12324 - trunk/ui/extendedDataTable/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: pkawiak
Date: 2009-01-18 06:23:28 -0500 (Sun, 18 Jan 2009)
New Revision: 12324
Modified:
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
Log:
bug RF-4545: onkeypress, onkeyup, onkeydown attached to main table div.
Modified: trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
===================================================================
--- trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2009-01-17 00:54:52 UTC (rev 12323)
+++ trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2009-01-18 11:23:28 UTC (rev 12324)
@@ -53,6 +53,9 @@
id="#{clientId}"
class="extdt-maindiv rich-extdt-maindiv"
style="#{component.attributes['style']};width:#{component.attributes['width']};height:#{component.attributes['height']}"
+ onkeypress="#{component.attributes['onkeypress']}"
+ onkeyup="#{component.attributes['onkeyup']}"
+ onkeydown="#{component.attributes['onkeydown']}"
>
<div id="#{clientId}:od" class="extdt-outerdiv"
16 years, 11 months
JBoss Rich Faces SVN: r12323 - in trunk/sandbox/samples/colorPicker/src/main/webapp: pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-01-16 19:54:52 -0500 (Fri, 16 Jan 2009)
New Revision: 12323
Modified:
trunk/sandbox/samples/colorPicker/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/colorPicker/src/main/webapp/pages/index.jsp
Log:
rich:colorPicker sample fixed
Modified: trunk/sandbox/samples/colorPicker/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/colorPicker/src/main/webapp/WEB-INF/web.xml 2009-01-17 00:54:31 UTC (rev 12322)
+++ trunk/sandbox/samples/colorPicker/src/main/webapp/WEB-INF/web.xml 2009-01-17 00:54:52 UTC (rev 12323)
@@ -19,10 +19,10 @@
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
</context-param>
-<context-param>
+<!--context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>NONE</param-value>
-</context-param>
+</context-param-->
<!--
-->
Modified: trunk/sandbox/samples/colorPicker/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/colorPicker/src/main/webapp/pages/index.jsp 2009-01-17 00:54:31 UTC (rev 12322)
+++ trunk/sandbox/samples/colorPicker/src/main/webapp/pages/index.jsp 2009-01-17 00:54:52 UTC (rev 12323)
@@ -4,183 +4,11 @@
<html>
<head>
<title>ColorPicker sample page</title>
-<style type="text/css">
-
-.rich-colorPicker-wrapper{
- display:none;
- font-family:Arial,Helvetica,sans-serif;
- height:176px;
- !height:166px;
- overflow:hidden;
- position:absolute;
- width:350px;
- margin-top: 2px;
- !margin-top: -6px;
- !margin-left: -2px;
-}
-.rich-colorPicker-ext{
- position: relative;
- background-color: #ECF4FE;
- border: 1px solid #BED6F8;
- height: 170px;
- padding: 0px;
- margin: 0px;
-}
-
-.rich-colorPicker-color {
- background:#FF0000 none repeat scroll 0 0;
- cursor:crosshair;
- left:7px;
- top:7px;
- position:absolute;
- overflow:hidden;
- height:150px;
- width:150px;
- border: 1px solid #BED6F8;
-}
-
-.rich-colorPicker-color div {
- background:transparent url(images/colorpicker_overlay.png) repeat scroll 0 0;
- left:0;
- position:absolute;
- top:0;
- height:150px;
- width:150px;
-}
-
-.rich-colorPicker-color div div {
- background:transparent url(images/colorpicker_select.gif) repeat scroll 0 0;
- left:0;
- top:0;
- position:absolute;
- margin:-6px 0 0 -6px;
- overflow:hidden;
- width:11px;
- height:11px;
-}
-
-.rich-colorPicker-rainbow{
- cursor:n-resize;
- height:150px;
- left:160px;
- position:absolute;
- top:7px;
- width:35px;
- text-align: center;
-}
-.rich-colorPicker-rainbow div{
- background:transparent url(images/rangearrows.gif) no-repeat scroll left top;
- height:9px;
- left:1px;
- margin:-4px 0 0;
- overflow:hidden;
- position:absolute;
- width:35px;
-}
-
-.rich-colorPicker-new-color, .rich-colorPicker-current-color{
- position:absolute;
- top:7px;
- width: 60px;
- height: 30px;
- border: 1px solid #BED6F8;
-}
-
-.rich-colorPicker-current-color{
- right:7px;
- top:7px;
-}
-
-.rich-colorPicker-new-color{
- left:198px;
-}
-.rich-colorPicker-hex-wrapper {
- height:22px;
- left:202px;
- position:absolute;
- top:119px;
-}
-
-.rich-colorPicker-rgb-wrapper{
- left:184px;
- position:absolute;
- top:55px;
- width:70px;
- padding: 0px;
- text-align: right;
- margin-bottom: 2px
-}
-
-.rich-colorPicker-hsb-wrapper{
- right:7px;
- position:absolute;
- top:55px;
- width:70px;
- padding: 0px;
- text-align: right;
- margin-bottom: 2px
-}
-.rich-colorPicker-hsb-h, .rich-colorPicker-rgb-r{
- top:45px;
-}
-.rich-colorPicker-hsb-s, .rich-colorPicker-rgb-g{
- top:70px;
-}
-.rich-colorPicker-hsb-b, .rich-colorPicker-rgb-b{
- top:95px;
-}
-
-
-.rich-colorPicker-rgb-wrapper label {
- padding-top: 2px;
- font-size: 16px;
-}
-
-.rich-colorPicker-rgb-wrapper input, .rich-colorPicker-hex-wrapper input, .rich-colorPicker-hsb-wrapper input{
- width: 35px;
- background-color: #fff;
- border: 1px solid #BED6F8;
- color: #000;
- font-family: Arial,Verdana,sans-serif;
- font-size: 16px;
-}
-
-.rich-colorPicker-hex-wrapper input{
- width:60px;
- font-size: 13px;
-}
-
-.rich-colorPicker-submit, .rich-colorPicker-cancel{
- position:absolute;
-right:75px;
-top:144px;
- border: 1px solid #BED6F8;
-}
-.rich-colorPicker-cancel{
-right:7px;
-}
-.rich-colorPicker-span input{
- border: 1px solid #BED6F8;
- font-size: 12px;
- width:130px;
- vertical-align:middle;
-}
-.rich-colorPicker-icon {
- display:inline;
- cursor:pointer;
- height:16px;
- width:16px;
- vertical-align:middle;
- border: 1px solid #BED6F8;
-}
-
-</style>
-
</head>
<body>
<f:view>
<h:form>
- <colorPicker:colorPicker value="#{bean.color}" flat="false" initColor="#f0f0f0"/>
+ <colorPicker:colorPicker value="#{bean.color}" flat="false" initColor="#cccccc" showEvent="onclick"/>
<h:commandButton value="Submit" />
</h:form>
</f:view>
16 years, 11 months