Author: lfryc(a)redhat.com
Date: 2010-07-28 09:42:37 -0400 (Wed, 28 Jul 2010)
New Revision: 18258
Added:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/ConsoleStatusTestListener.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Uses.java
Removed:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Named.java
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Use.java
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java
Log:
support for replacing data provider (configuration on method/class basis)
Added:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/ConsoleStatusTestListener.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/ConsoleStatusTestListener.java
(rev 0)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/ConsoleStatusTestListener.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009-2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest;
+
+import java.lang.reflect.Field;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.jboss.test.selenium.utils.testng.TestLoggingUtils;
+import org.testng.ITestResult;
+import org.testng.TestListenerAdapter;
+
+/**
+ * This class is used as ITestListener in testNG tests to put test's status to the
console output
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>, <a
href="mailto:pjha@redhat.com">Prabhat Jha</a>, <a
+ * href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ *
+ */
+public class ConsoleStatusTestListener extends TestListenerAdapter {
+
+ @Override
+ public void onTestStart(ITestResult result) {
+ logStatus(result, true);
+ }
+
+ @Override
+ public void onTestFailure(ITestResult result) {
+ logStatus(result, false);
+ }
+
+ @Override
+ public void onTestSkipped(ITestResult result) {
+ logStatus(result, false);
+ }
+
+ @Override
+ public void onTestSuccess(ITestResult result) {
+ logStatus(result, false);
+ }
+
+ @Override
+ public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
+ logStatus(result, false);
+ }
+
+ /**
+ * This method will output method name and status on the standard output
+ *
+ * @param result
+ * from the fine-grained listener's method such as
onTestFailure(ITestResult)
+ */
+ private void logStatus(ITestResult result, boolean isTestStart) {
+ String message = TestLoggingUtils.getTestDescription(result, isTestStart);
+
+ Map<Field, Object> configuration = (Map<Field, Object>)
result.getAttribute("matrix-configuration");
+ if (!configuration.isEmpty()) {
+ message += " {";
+ for (Entry<Field, Object> entry : configuration.entrySet()) {
+
+ final String name = entry.getKey().getName();
+ final Object value = entry.getValue();
+
+ if (value != null) {
+ message += name + ": " + value + ", ";
+ }
+ }
+ message += "}";
+ }
+
+ System.out.println(message);
+ if (!isTestStart) {
+ System.out.println();
+ }
+ }
+}
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2010-07-28
13:41:42 UTC (rev 18257)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -27,6 +27,7 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -46,70 +47,40 @@
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.annotations.Uses;
import org.testng.IAnnotationTransformer;
import org.testng.IInvokedMethod;
import org.testng.IInvokedMethodListener;
import org.testng.IMethodInstance;
import org.testng.IMethodInterceptor;
import org.testng.ITestContext;
+import org.testng.ITestListener;
import org.testng.ITestNGMethod;
import org.testng.ITestResult;
-import org.testng.annotations.DataProvider;
import org.testng.annotations.ITestAnnotation;
-import org.testng.annotations.Test;
/**
* @author <a href="mailto:ppitonak@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
public class MatrixConfigurator extends TestMethodSelector implements
IAnnotationTransformer, IInvokedMethodListener,
- IMethodInterceptor {
+ IMethodInterceptor, ITestListener {
Map<Class<?>, Map<Method, Configuration>> configurations = new
HashMap<Class<?>, Map<Method, Configuration>>();
LinkedList<Method> methods = new LinkedList<Method>();
boolean methodConfigured = false;
+ Map<Field, Object> currentConfiguration;
public List<IMethodInstance> intercept(List<IMethodInstance>
methodInstances, ITestContext context) {
for (IMethodInstance methodInstance : methodInstances) {
- int parameterCount = 1;
- Test testAnnotation =
methodInstance.getMethod().getMethod().getAnnotation(Test.class);
- if (!"".equals(testAnnotation.dataProvider())) {
- Object testInstance = methodInstance.getMethod().getInstances()[0];
- try {
- Method method = getProvidingMethod(testAnnotation.dataProvider(),
testInstance.getClass());
- boolean isAccessible = method.isAccessible();
- if (!isAccessible) {
- method.setAccessible(true);
- }
- Object[][] result = (Object[][]) method.invoke(testInstance);
- method.setAccessible(isAccessible);
- parameterCount = result.length;
- } catch (Exception e) {
- throw new IllegalStateException("Cannot obtain data from
dataProvider", e);
- }
- }
-
- for (int i = 0; i < (parameterCount *
methodInstance.getMethod().getInvocationCount()); i++) {
+ for (int i = 0; i < methodInstance.getMethod().getInvocationCount(); i++)
{
methods.add(methodInstance.getMethod().getMethod());
}
}
return methodInstances;
}
- private Method getProvidingMethod(String providerName, Class<?>
testInstanceClass) {
- for (Method method : getAllMethods(testInstanceClass)) {
- DataProvider dataProvider = method.getAnnotation(DataProvider.class);
- if (dataProvider != null) {
- if (providerName.equals(dataProvider.name())) {
- return method;
- }
- }
- }
-
- throw new IllegalStateException("For provider name '" +
providerName + "' doesn't exists associated provider");
- }
-
public void beforeInvocation(IInvokedMethod invokedMethod, ITestResult testResult) {
if (!methodConfigured) {
if (isAfterConfiguration(invokedMethod.getTestMethod())) {
@@ -122,6 +93,10 @@
}
}
+ public void onTestStart(ITestResult result) {
+ result.setAttribute("matrix-configuration", currentConfiguration);
+ }
+
private boolean isAfterConfiguration(ITestNGMethod m) {
return m.isAfterClassConfiguration() || m.isAfterGroupsConfiguration() ||
m.isAfterMethodConfiguration()
|| m.isAfterSuiteConfiguration() || m.isAfterTestConfiguration();
@@ -130,39 +105,25 @@
private void configureMethod(ITestResult testResult) {
Method realMethod = ((Queue<Method>) methods).poll();
+ if (realMethod == null) {
+ throw new IllegalStateException("can't find more configured
methods");
+ }
+
Class<?> realClass = realMethod.getDeclaringClass();
- if (!configurations.get(realClass).get(realMethod).hasNext()) {
- return;
+ final Object testInstance = testResult.getInstance();
+ Configuration configuration = configurations.get(realClass).get(realMethod);
+ if (!configuration.hasNext()) {
+ throw new IllegalStateException("can't find more
configurations");
}
+ currentConfiguration = configuration.next();
- final Object testInstance = testResult.getInstance();
- Map<Field, Object> configuration =
configurations.get(realClass).get(realMethod).next();
-
try {
- for (Entry<Field, Object> entry : configuration.entrySet()) {
+ for (Entry<Field, Object> entry : currentConfiguration.entrySet()) {
final Field field = entry.getKey();
- final Object parameter = entry.getValue();
+ final Object assignment = entry.getValue();
- Object assignment;
- if (parameter instanceof String &&
!parameter.getClass().isAssignableFrom(field.getType())) {
- Field parameterField = realClass.getDeclaredField((String)
parameter);
- boolean isAccessible = parameterField.isAccessible();
- if (!isAccessible) {
- parameterField.setAccessible(true);
- }
- assignment = parameterField.get(testInstance);
- parameterField.setAccessible(isAccessible);
- } else {
- assignment = parameter;
- }
-
- boolean isAccessible = field.isAccessible();
- if (!isAccessible) {
- field.setAccessible(true);
- }
- field.set(testInstance, assignment);
- field.setAccessible(isAccessible);
+ setDeclaredFieldValue(testInstance, field, assignment);
}
} catch (Exception e) {
throw new IllegalStateException("Cannot configure method", e);
@@ -197,23 +158,19 @@
parameters.put(field,
getTemplatesParameter(realClass, field.getType(),
field.getAnnotation(Templates.class)));
} else {
+ parameters.put(field, null);
unsatisfied.add(field);
}
}
}
- for (Annotation annotation : realMethod.getAnnotations()) {
- if (annotation.annotationType() == Use.class) {
- Use use = (Use) annotation;
- for (Field field : parameters.keySet()) {
- if (field.getName().equals(use.field())) {
- parameters.put(field, getUseParameter(realClass, field.getType(),
use));
- unsatisfied.remove(field);
- }
- }
- }
- }
+ // fulfill parameters by super classes' annotations
+ fulfillParametersFromAnnotations(realClass, parameters, unsatisfied,
+ getAnnotationsForAllSuperClasses(realClass));
+ // fulfill parameters by method annotations
+ fulfillParametersFromAnnotations(realClass, parameters, unsatisfied,
realMethod.getAnnotations());
+
if (!unsatisfied.isEmpty()) {
throw new IllegalStateException("cannot satisfy following injection
points: " + unsatisfied.toString());
}
@@ -232,6 +189,29 @@
return Math.max(1, count);
}
+ private void fulfillParametersFromAnnotations(Class<?> testClass, Map<Field,
List<? extends Object>> parameters,
+ List<Field> unsatisfied, Annotation... annotations) {
+ for (Annotation annotation : annotations) {
+ Use[] useAnnotations = null;
+ if (annotation.annotationType() == Uses.class) {
+ useAnnotations = ((Uses) annotation).value();
+ }
+ if (annotation.annotationType() == Use.class) {
+ useAnnotations = new Use[] { (Use) annotation };
+ }
+ if (useAnnotations != null) {
+ for (Use useAnnotation : useAnnotations) {
+ for (Field field : parameters.keySet()) {
+ if (field.getName().equals(useAnnotation.field())) {
+ parameters.put(field, getUseParameter(testClass,
field.getType(), useAnnotation));
+ unsatisfied.remove(field);
+ }
+ }
+ }
+ }
+ }
+ }
+
private Field[] getAllFields(Class<?> testClass) {
List<Field> fields = new ArrayList<Field>();
@@ -247,19 +227,22 @@
return fields.toArray(new Field[fields.size()]);
}
- private Method[] getAllMethods(Class<?> testClass) {
- List<Method> allMethods = new ArrayList<Method>();
+ private Annotation[] getAnnotationsForAllSuperClasses(Class<?> testClass) {
+ List<Annotation> annotations = new LinkedList<Annotation>();
Class<?> currentClass = testClass;
while (currentClass != Object.class) {
- allMethods.addAll(Arrays.asList(currentClass.getDeclaredMethods()));
+ annotations.addAll(Arrays.asList(currentClass.getAnnotations()));
if (currentClass == AbstractMetamerTest.class) {
break;
}
currentClass = currentClass.getSuperclass();
}
- return allMethods.toArray(new Method[allMethods.size()]);
+ // needs to be returned in reversed order because of the lowel level annnotations
needs to be processed first
+ Collections.reverse(annotations);
+
+ return annotations.toArray(new Annotation[annotations.size()]);
}
private Map<Method, Configuration> getClassConfigurations(Class<?>
realClass) {
@@ -270,12 +253,19 @@
}
private List<? extends Object> getUseParameter(Class<?> testClass,
Class<?> parameterType, Use useAnnotation) {
- if (parameterType == int.class || parameterType == Integer.class) {
- return Arrays.asList(ArrayUtils.toObject(useAnnotation.ints()));
+ if (useAnnotation.empty()) {
+ return Arrays.asList(new Object[] { null });
}
+ if (useAnnotation.ints().length > 0) {
+ if (parameterType == int.class || parameterType == Integer.class) {
+ return Arrays.asList(ArrayUtils.toObject(useAnnotation.ints()));
+ }
+ }
+
// tries satisfy parameter from fields
List<Object> result = new LinkedList<Object>();
+ Object testInstance = getTestInstance(testClass);
for (int i = 0; i < useAnnotation.value().length; i++) {
boolean satisfied = false;
for (Field field : testClass.getDeclaredFields()) {
@@ -284,9 +274,22 @@
name = StringUtils.replace(name, "?", ".");
Pattern pattern = Pattern.compile(name);
if (pattern.matcher(field.getName()).matches()) {
- if (parameterType.isAssignableFrom(field.getType())) {
- result.add(field.getName());
+ boolean isArray = field.getType().isArray();
+ Class<?> representedType;
+ if (isArray) {
+ representedType = field.getType().getComponentType();
+ } else {
+ representedType = field.getType();
+ }
+ if (parameterType.isAssignableFrom(representedType)) {
+ Object[] assignments = getDeclaredFieldValues(testInstance,
field);
+ for (Object assignment : assignments) {
+ result.add(assignment);
+ }
satisfied = true;
+ } else {
+ throw new IllegalStateException("cannot satisfy parameter
with declared field"
+ + field.getName());
}
}
}
@@ -298,6 +301,43 @@
return result;
}
+ private Object getTestInstance(Class<?> testClass) {
+ try {
+ return testClass.newInstance();
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ private void setDeclaredFieldValue(Object testInstance, Field field, Object
assignment)
+ throws IllegalArgumentException, IllegalAccessException {
+ boolean isAccessible = field.isAccessible();
+ if (!isAccessible) {
+ field.setAccessible(true);
+ }
+ field.set(testInstance, assignment);
+ field.setAccessible(isAccessible);
+ }
+
+ private Object[] getDeclaredFieldValues(Object testInstance, Field field) {
+ try {
+ boolean isAccessible = field.isAccessible();
+ if (!isAccessible) {
+ field.setAccessible(true);
+ }
+ Object[] result;
+ if (field.getType().isArray()) {
+ result = (Object[]) field.get(testInstance);
+ } else {
+ result = new Object[] { field.get(testInstance) };
+ }
+ field.setAccessible(isAccessible);
+ return result;
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
private List<TemplatesList> getTemplatesParameter(Class<?> testClass,
Class<?> parameterType,
Templates templatesAnnotation) {
if (parameterType != TemplatesList.class) {
@@ -314,7 +354,7 @@
return templates;
}
- private class Configuration implements Iterator<Map<Field, Object>> {
+ public class Configuration implements Iterator<Map<Field, Object>> {
Map<Field, List<? extends Object>> parameters;
Map<Field, Queue<? extends Object>> queues;
Queue<? extends Object> lastQueue;
@@ -374,4 +414,34 @@
throw new UnsupportedOperationException();
}
}
+
+ public void onTestSuccess(ITestResult result) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onTestFailure(ITestResult result) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onTestSkipped(ITestResult result) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onStart(ITestContext context) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onFinish(ITestContext context) {
+ // TODO Auto-generated method stub
+
+ }
}
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2010-07-28
13:41:42 UTC (rev 18257)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -36,7 +36,9 @@
import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.testng.annotations.DataProvider;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.annotations.Uses;
import org.testng.annotations.Test;
/**
@@ -47,6 +49,19 @@
*/
public class TestA4JOutputPanel extends AbstractMetamerTest {
+ Event[] events = new Event[] { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN,
MOUSEMOVE, MOUSEOUT,
+ MOUSEOVER, MOUSEUP };
+
+ String[] layouts = new String[] { "block", "inline" };
+
+ @Inject
+ @Use(empty = true)
+ Event event;
+
+ @Inject
+ @Use(empty = true)
+ String layout;
+
private JQueryLocator increaseCounterButton = pjq("input[id$=button]");
private JQueryLocator outputDiv = pjq("div[id$=outputPanel]");
private JQueryLocator outputSpan = pjq("span[id$=outputPanel]");
@@ -58,39 +73,12 @@
return buildUrl(contextPath,
"faces/components/a4jOutputPanel/simple.xhtml");
}
- /**
- * Data provider for templates, events and layout of output panel.
- *
- * @return array containing templates that should be used (defined in testng.xml) or
default array (containing only
- * plain template) if nothing is defined, JavaScript events that are defined
for output panel and layout of
- * panel (block or inline)
- */
- @SuppressWarnings("unused")
- @DataProvider(name = "eventsLayouts")
- private Object[][] getEventsLayouts() {
- final int layoutsCount = 2;
- // list of events that will be tested
- Event[] events = new Event[] { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP,
MOUSEDOWN, MOUSEMOVE, MOUSEOUT,
- MOUSEOVER, MOUSEUP };
-
- Object[][] result = new Object[events.length * layoutsCount][];
- int index = 0;
-
- for (int i = 0; i < events.length; i++) {
- for (int j = 0; j < layoutsCount; j++) {
- index = i * layoutsCount + j;
- result[index] = new Object[] { events[i], j == 0 ? "block" :
"inline" };
- }
- }
-
- return result;
- }
-
- @Test(dataProvider = "eventsLayouts")
- public void testEvent(Event event, String type) {
+ @Uses({ @Use(field = "event", value = "events"), @Use(field =
"layout", value = "layouts") })
+ @Test
+ public void testEvent() {
JQueryLocator element = null;
- if ("inline".equals(type)) {
+ if ("inline".equals(layout)) {
// for inline layout set background to blue
selenium.click(pjq("input[name$=layoutInput][value=inline]"));
selenium.waitForPageToLoad(TIMEOUT);
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java 2010-07-28
13:41:42 UTC (rev 18257)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -1,3 +1,24 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
package org.richfaces.tests.metamer.ftest.annotations;
import java.lang.annotation.Retention;
@@ -5,6 +26,10 @@
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
+/**
+ * @author <a href="mailto:ppitonak@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
@Target({ TYPE, FIELD, METHOD, PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface Inject {
Deleted:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Named.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Named.java 2010-07-28
13:41:42 UTC (rev 18257)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Named.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -1,12 +0,0 @@
-package org.richfaces.tests.metamer.ftest.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import static java.lang.annotation.ElementType.*;
-
-@Target({ PARAMETER })
-(a)Retention(RetentionPolicy.RUNTIME)
-public @interface Named {
- String value();
-}
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java 2010-07-28
13:41:42 UTC (rev 18257)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -1,3 +1,24 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
package org.richfaces.tests.metamer.ftest.annotations;
import java.lang.annotation.Retention;
@@ -6,6 +27,10 @@
import static java.lang.annotation.ElementType.*;
+/**
+ * @author <a href="mailto:ppitonak@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
@Target({ TYPE, FIELD, METHOD, PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface Templates {
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Use.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Use.java 2010-07-28
13:41:42 UTC (rev 18257)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Use.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -1,3 +1,24 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
package org.richfaces.tests.metamer.ftest.annotations;
import java.lang.annotation.Retention;
@@ -5,7 +26,11 @@
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
-@Target({ FIELD, METHOD })
+/**
+ * @author <a href="mailto:ppitonak@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@Target({ TYPE, FIELD, METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Use {
String field() default "";
@@ -13,4 +38,6 @@
String[] value() default {};
int[] ints() default {};
+
+ boolean empty() default false;
}
Added:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Uses.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Uses.java
(rev 0)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Uses.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+
+/**
+ * @author <a href="mailto:ppitonak@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@Target({ TYPE, METHOD })
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface Uses {
+ Use[] value() default {};
+}
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java 2010-07-28
13:41:42 UTC (rev 18257)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java 2010-07-28
13:42:37 UTC (rev 18258)
@@ -31,7 +31,6 @@
import org.jboss.test.selenium.locator.IdLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.Named;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.model.AssertingDataScroller;
import org.richfaces.tests.metamer.ftest.model.DataTable;
@@ -70,13 +69,6 @@
public TestPagination() {
}
- public TestPagination(AssertingDataScroller dataScroller,
@Named("fastStep") int fastStep,
- @Named("maxPages") int maxPages) {
- this.dataScroller = dataScroller;
- this.fastStep = fastStep;
- this.maxPages = maxPages;
- }
-
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richDataScroller/simple.xhtml");