+ "'expiredEpoch':1893511225000," + "'product':{'name':'"
+ productNameCval + "', 'version': 2}}";
- static final String responseJsonWithNullVersion = "{'licenseKey':'" + VALID_KEY + "',"
- + "'licensee':'Test User','type':'normal',"
+ static final String responseJsonWithNullVersion = "{'licenseKey':'"
+ + VALID_KEY + "'," + "'licensee':'Test User','type':'normal',"
+ "'expiredEpoch':1893511225000," + "'product':{'name':'"
+ productNameCval + "', 'version': null}}";
out.println("5 = this-is-another-license");
out.close();
- assertEquals("this-is-a-license", licenseChecker.readKeyFromFile(tmpLicenseFile.toURI()
- .toURL(), 3));
- assertEquals("this-is-a-license", licenseChecker.readKeyFromFile(tmpLicenseFile.toURI()
- .toURL(), 4));
+ assertEquals("this-is-a-license", licenseChecker.readKeyFromFile(
+ tmpLicenseFile.toURI().toURL(), 3));
+ assertEquals("this-is-a-license", licenseChecker.readKeyFromFile(
+ tmpLicenseFile.toURI().toURL(), 4));
assertEquals("this-is-another-license", licenseChecker.readKeyFromFile(
tmpLicenseFile.toURI().toURL(), 5));
}
@Test
- public void testReadKeyFromFile_FallbackToDefaultKeyReversed() throws Exception {
+ public void testReadKeyFromFile_FallbackToDefaultKeyReversed()
+ throws Exception {
File tmpLicenseFile = File.createTempFile("license", "lic");
PrintWriter out = new PrintWriter(tmpLicenseFile);
out.println("5 = this-is-another-license");
out.println("this-is-a-license");
out.close();
- assertEquals("this-is-a-license", licenseChecker.readKeyFromFile(tmpLicenseFile.toURI()
- .toURL(), 3));
- assertEquals("this-is-a-license", licenseChecker.readKeyFromFile(tmpLicenseFile.toURI()
- .toURL(), 4));
+ assertEquals("this-is-a-license", licenseChecker.readKeyFromFile(
+ tmpLicenseFile.toURI().toURL(), 3));
+ assertEquals("this-is-a-license", licenseChecker.readKeyFromFile(
+ tmpLicenseFile.toURI().toURL(), 4));
assertEquals("this-is-another-license", licenseChecker.readKeyFromFile(
tmpLicenseFile.toURI().toURL(), 5));
private HTML notice;
// Not using Vaadin notifications (#14597)
- private void notice(String productName) {
+ private void notice(String productName) {
if (notice == null) {
notice = new HTML();
notice.addClickHandler(new ClickHandler() {
addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
- if(isEnabled()) {
+ if (isEnabled()) {
preparePopup(popup);
showPopup(popup);
center();
/**
* Sets whether this popup is enabled.
*
- * @param enabled <code>true</code> to enable the popup, <code>false</code>
- * to disable it
+ * @param enabled
+ * <code>true</code> to enable the popup, <code>false</code> to
+ * disable it
* @since 7.3.4
*/
@Override
/**
* The id of the tab at position scrollerIndex. This is used for keeping the
* scroll position unchanged when a tab is removed from the server side and
- * the removed tab lies to the left of the current scroll position. For other
- * cases scrollerIndex alone would be sufficient. Since the tab at the current
- * scroll position can be removed, scrollerIndex is required in addition to this variable.
+ * the removed tab lies to the left of the current scroll position. For
+ * other cases scrollerIndex alone would be sufficient. Since the tab at the
+ * current scroll position can be removed, scrollerIndex is required in
+ * addition to this variable.
*/
private String scrollerPositionTabId;
}
private boolean isScrollerPrevDisabled() {
- return scrollerPrev.getClassName().contains(PREV_SCROLLER_DISABLED_CLASSNAME);
+ return scrollerPrev.getClassName().contains(
+ PREV_SCROLLER_DISABLED_CLASSNAME);
}
private boolean isIndexSkippingHiddenTabs() {
// Should not set tabs visible if they are scrolled out of view
tab.setVisible(false);
} else {
- //reset the scroller index back to zero if tab is visible
- //again and tab is in view
- if(isIndexSkippingHiddenTabs() && tabState.visible) {
+ // reset the scroller index back to zero if tab is visible
+ // again and tab is in view
+ if (isIndexSkippingHiddenTabs() && tabState.visible) {
scrollerIndex = 0;
}
tab.setVisible(tabState.visible);
if (tb.getTabCount() > 0 && tb.isVisible() && (scrolled || clipped)) {
scroller.getStyle().clearDisplay();
DOM.setElementProperty(scrollerPrev, "className",
- SCROLLER_CLASSNAME + (scrolled ? "Prev" : PREV_SCROLLER_DISABLED_CLASSNAME));
+ SCROLLER_CLASSNAME
+ + (scrolled ? "Prev"
+ : PREV_SCROLLER_DISABLED_CLASSNAME));
DOM.setElementProperty(scrollerNext, "className",
SCROLLER_CLASSNAME + (clipped ? "Next" : "Next-disabled"));
}
if (scrollerIndex >= 0 && scrollerIndex < tb.getTabCount()) {
scrollerPositionTabId = tb.getTab(scrollerIndex).id;
- }
- else{
+ } else {
scrollerPositionTabId = null;
}
}
BigDecimal bigDecimalValue = (BigDecimal) convertToNumber(value,
BigDecimal.class, locale);
- return (bigDecimalValue != null) ? bigDecimalValue.toBigInteger() : null;
+ return (bigDecimalValue != null) ? bigDecimalValue.toBigInteger()
+ : null;
}
@Override
count++;
}
if (versionColumn != null) {
- if(!item.getItemPropertyIds().contains(versionColumn)) {
+ if (!item.getItemPropertyIds().contains(versionColumn)) {
throw new IllegalArgumentException(String.format(
"Table '%s' does not contain version column '%s'.",
tableName, versionColumn));
if (type instanceof Class<?>) {
Class<?> clazz = (Class<?>) type;
if (JsonArray.class.isAssignableFrom(clazz)) {
- parameters[i] = JsonUtil.stringify((JsonArray) parameters[i]);
+ parameters[i] = JsonUtil
+ .stringify((JsonArray) parameters[i]);
}
}
}
Class<?> clazz = (Class<?>) type;
if (JsonArray.class.isAssignableFrom(clazz)) {
try {
- parameters[i] = JsonUtil.<JsonArray>parse((String) parameters[i]);
+ parameters[i] = JsonUtil
+ .<JsonArray> parse((String) parameters[i]);
} catch (JsonException e) {
throw new IOException(e);
}
+ name
+ " on the client because a callback with the same name is registered on the server.");
}
- JsonArray args = (JsonArray) JsonCodec.encode(arguments, null, Object[].class, null).getEncodedValue();
+ JsonArray args = (JsonArray) JsonCodec.encode(arguments, null,
+ Object[].class, null).getEncodedValue();
connector.addMethodInvocationToQueue(
JavaScriptCallbackRpc.class.getName(), CALL_METHOD,
new Object[] { name, args });
public class JsonCodec implements Serializable {
/* Immutable Encode Result representing null */
- private static final EncodeResult ENCODE_RESULT_NULL = new EncodeResult(Json.createNull());
+ private static final EncodeResult ENCODE_RESULT_NULL = new EncodeResult(
+ Json.createNull());
/* Immutable empty JSONArray */
- private static final JsonArray EMPTY_JSON_ARRAY = new JreJsonArray(Json.instance()) {
+ private static final JsonArray EMPTY_JSON_ARRAY = new JreJsonArray(
+ Json.instance()) {
@Override
public void set(int index, JsonValue value) {
throw new UnsupportedOperationException(
.getGenericComponentType();
return decodeArray(componentType, (JsonArray) value,
connectorTracker);
- } else if (JsonValue.class.isAssignableFrom(getClassForType(targetType))) {
+ } else if (JsonValue.class
+ .isAssignableFrom(getClassForType(targetType))) {
return value;
} else if (Enum.class.isAssignableFrom(getClassForType(targetType))) {
Class<?> classForType = getClassForType(targetType);
}
private static Map<Object, Object> decodeObjectMap(Type keyType,
- Type valueType, JsonArray jsonMap, ConnectorTracker connectorTracker)
- {
+ Type valueType, JsonArray jsonMap, ConnectorTracker connectorTracker) {
JsonArray keys = jsonMap.getArray(0);
JsonArray values = jsonMap.getArray(1);
* @param referenceValue
* @return
*/
- private static boolean jsonEquals(JsonValue fieldValue, JsonValue referenceValue) {
+ private static boolean jsonEquals(JsonValue fieldValue,
+ JsonValue referenceValue) {
if (fieldValue instanceof JsonNull) {
fieldValue = null;
}
Collection<?> collection, ConnectorTracker connectorTracker) {
JsonArray jsonArray = Json.createArray();
for (Object o : collection) {
- jsonArray.set(jsonArray.length(), encodeChild(targetType, 0, o, connectorTracker));
+ jsonArray.set(jsonArray.length(),
+ encodeChild(targetType, 0, o, connectorTracker));
}
return jsonArray;
}
- private static JsonValue encodeChild(Type targetType, int typeIndex, Object o,
- ConnectorTracker connectorTracker) {
+ private static JsonValue encodeChild(Type targetType, int typeIndex,
+ Object o, ConnectorTracker connectorTracker) {
if (targetType instanceof ParameterizedType) {
Type childType = ((ParameterizedType) targetType)
.getActualTypeArguments()[typeIndex];
* @deprecated As of 7.1. See #11411.
*/
@Deprecated
- public static JsonObject encodeState(ClientConnector connector, SharedState state) {
+ public static JsonObject encodeState(ClientConnector connector,
+ SharedState state) {
UI uI = connector.getUI();
ConnectorTracker connectorTracker = uI.getConnectorTracker();
Class<? extends SharedState> stateType = connector.getStateType();
// add invocation to rpcCalls
try {
JsonArray invocationJson = Json.createArray();
- invocationJson.set(0, invocation.getConnector().getConnectorId());
+ invocationJson.set(0, invocation.getConnector()
+ .getConnectorId());
invocationJson.set(1, invocation.getInterfaceName());
invocationJson.set(2, invocation.getMethodName());
JsonArray paramJson = Json.createArray();
* the connector tracker instance for the UI
* @return A deserialized object
*/
- T deserialize(Type type, JsonValue jsonValue, ConnectorTracker connectorTracker);
+ T deserialize(Type type, JsonValue jsonValue,
+ ConnectorTracker connectorTracker);
/**
* Serialize the given object into JSON. Must be compatible with
- * {@link #deserialize(Type, JsonValue, ConnectorTracker)} and the client side
- * com.vaadin.client.communication.JSONSerializer
+ * {@link #deserialize(Type, JsonValue, ConnectorTracker)} and the client
+ * side com.vaadin.client.communication.JSONSerializer
*
* @param value
* The object to serialize
if (request.getService().getDeploymentConfiguration()
.isSyncIdCheckEnabled()) {
- syncId = (int) json.getNumber(ApplicationConstants.SERVER_SYNC_ID);
+ syncId = (int) json
+ .getNumber(ApplicationConstants.SERVER_SYNC_ID);
} else {
syncId = -1;
}
String methodName = invocationJson.getString(2);
if (connectorTracker.getConnector(connectorId) == null
- && !connectorId.equals(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID)) {
+ && !connectorId
+ .equals(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID)) {
if (!connectorTracker.connectorWasPresentAsRequestWasSent(
connectorId, lastSyncIdSeenByClient)) {
String initialUIDL = getInitialUidl(request, uI);
params.put("uidl", initialUIDL);
- return commitJsonResponse(request, response, JsonUtil.stringify(params));
+ return commitJsonResponse(request, response,
+ JsonUtil.stringify(params));
} catch (JsonException e) {
throw new IOException("Error producing initial UIDL", e);
}
* The new theme name
*/
public void setTheme(String theme) {
- if(theme == null) {
+ if (theme == null) {
getState().theme = null;
} else {
getState().theme = VaadinServlet.stripSpecialChars(theme);
}
@Test
- public void itemWithExistingVersionColumnIsRemoved()
- throws SQLException {
+ public void itemWithExistingVersionColumnIsRemoved() throws SQLException {
container.setAutoCommit(true);
peopleQuery.setVersionColumn("ID");
}
@Test(expected = IllegalArgumentException.class)
- public void itemWithNonExistingVersionColumnCannotBeRemoved() throws SQLException {
+ public void itemWithNonExistingVersionColumnCannotBeRemoved()
+ throws SQLException {
peopleQuery.setVersionColumn("version");
container.removeItem(container.lastItemId());
SQLContainer container = new SQLContainer(new TableQuery("people",
connectionPool, SQLTestsConstants.sqlGen));
- assertTrue(container.containsId(new RowId(
- new Object[]{1 + offset})));
+ assertTrue(container.containsId(new RowId(new Object[] { 1 + offset })));
Assert.assertTrue(container.containsId(new RowId(
new Object[] { 1 + offset })));
assertTrue(this.container.containsId(new RowId(
- new Object[]{1 + offset})));
+ new Object[] { 1 + offset })));
}
@Test
public void containsId_withTableQueryAndNonexistingId_returnsFalse()
throws SQLException {
Assert.assertFalse(container.containsId(new RowId(
- new Object[]{1337 + offset})));
+ new Object[] { 1337 + offset })));
}
@Test
public void getContainerProperty_tableExistingItemIdAndNonexistingPropertyId_returnsNull()
throws SQLException {
Assert.assertNull(container.getContainerProperty(new RowId(
- new Object[]{1 + offset}), "asdf"));
+ new Object[] { 1 + offset }), "asdf"));
}
@Test
public void getContainerProperty_tableNonexistingItemId_returnsNull()
throws SQLException {
Assert.assertNull(container.getContainerProperty(new RowId(
- new Object[]{1337 + offset}), "NAME"));
+ new Object[] { 1337 + offset }), "NAME"));
}
@Test
"Ville",
container
.getContainerProperty(
- new RowId(new Object[]{new BigDecimal(
- 0 + offset)}), "NAME").getValue());
+ new RowId(new Object[] { new BigDecimal(
+ 0 + offset) }), "NAME").getValue());
} else {
Assert.assertEquals(
"Ville",
container.getContainerProperty(
- new RowId(new Object[]{0 + offset}), "NAME")
+ new RowId(new Object[] { 0 + offset }), "NAME")
.getValue());
}
}
-
@Test
public void getContainerPropertyIds_table_returnsIDAndNAME()
throws SQLException {
Collection<?> propertyIds = container.getContainerPropertyIds();
Assert.assertEquals(3, propertyIds.size());
- Assert.assertArrayEquals(new String[]{"ID", "NAME", "AGE"},
+ Assert.assertArrayEquals(new String[] { "ID", "NAME", "AGE" },
propertyIds.toArray());
}
throws SQLException {
if (SQLTestsConstants.db == DB.ORACLE) {
Assert.assertEquals(3, container.indexOfId(new RowId(
- new Object[]{new BigDecimal(3 + offset)})));
+ new Object[] { new BigDecimal(3 + offset) })));
} else {
Assert.assertEquals(3,
- container.indexOfId(new RowId(new Object[]{3 + offset})));
+ container.indexOfId(new RowId(new Object[] { 3 + offset })));
}
}
DataGenerator.addFiveThousandPeople(connectionPool);
if (SQLTestsConstants.db == DB.ORACLE) {
- container.getItem(new RowId(new Object[]{new BigDecimal(
- 1337 + offset)}));
+ container.getItem(new RowId(new Object[] { new BigDecimal(
+ 1337 + offset) }));
Assert.assertEquals(1337, container.indexOfId(new RowId(
- new Object[]{new BigDecimal(1337 + offset)})));
+ new Object[] { new BigDecimal(1337 + offset) })));
} else {
- container.getItem(new RowId(new Object[]{1337 + offset}));
+ container.getItem(new RowId(new Object[] { 1337 + offset }));
Assert.assertEquals(1337, container.indexOfId(new RowId(
- new Object[]{1337 + offset})));
+ new Object[] { 1337 + offset })));
}
}
throws SQLException {
DataGenerator.addFiveThousandPeople(connectionPool);
- Object itemId = container.getIdByIndex(1337);
+ Object itemId = container.getIdByIndex(1337);
if (SQLTestsConstants.db == DB.ORACLE) {
Assert.assertEquals(
new RowId(new Object[] { 1337 + offset }).toString(),
Object itemId = container.getIdByIndex(1337);
if (SQLTestsConstants.db == DB.ORACLE) {
Assert.assertEquals(
- new RowId(new Object[]{1336 + offset}).toString(),
+ new RowId(new Object[] { 1336 + offset }).toString(),
container.prevItemId(itemId).toString());
} else {
- Assert.assertEquals(new RowId(new Object[]{1336 + offset}),
+ Assert.assertEquals(new RowId(new Object[] { 1336 + offset }),
container.prevItemId(itemId));
}
}
public void firstItemId_table_returnsItemId0() throws SQLException {
if (SQLTestsConstants.db == DB.ORACLE) {
Assert.assertEquals(
- new RowId(new Object[]{0 + offset}).toString(),
+ new RowId(new Object[] { 0 + offset }).toString(),
container.firstItemId().toString());
} else {
- Assert.assertEquals(new RowId(new Object[]{0 + offset}),
+ Assert.assertEquals(new RowId(new Object[] { 0 + offset }),
container.firstItemId());
}
}
if (SQLTestsConstants.db == DB.ORACLE) {
Assert.assertEquals(
- new RowId(new Object[]{4999 + offset}).toString(),
+ new RowId(new Object[] { 4999 + offset }).toString(),
container.lastItemId().toString());
} else {
- Assert.assertEquals(new RowId(new Object[]{4999 + offset}),
+ Assert.assertEquals(new RowId(new Object[] { 4999 + offset }),
container.lastItemId());
}
}
public void isFirstId_tableActualFirstId_returnsTrue() throws SQLException {
if (SQLTestsConstants.db == DB.ORACLE) {
assertTrue(container.isFirstId(new RowId(
- new Object[]{new BigDecimal(0 + offset)})));
+ new Object[] { new BigDecimal(0 + offset) })));
} else {
assertTrue(container.isFirstId(new RowId(
- new Object[]{0 + offset})));
+ new Object[] { 0 + offset })));
}
}
public void isFirstId_tableSecondId_returnsFalse() throws SQLException {
if (SQLTestsConstants.db == DB.ORACLE) {
Assert.assertFalse(container.isFirstId(new RowId(
- new Object[]{new BigDecimal(1 + offset)})));
+ new Object[] { new BigDecimal(1 + offset) })));
} else {
Assert.assertFalse(container.isFirstId(new RowId(
- new Object[]{1 + offset})));
+ new Object[] { 1 + offset })));
}
}
public void isLastId_tableSecondId_returnsFalse() throws SQLException {
if (SQLTestsConstants.db == DB.ORACLE) {
Assert.assertFalse(container.isLastId(new RowId(
- new Object[]{new BigDecimal(1 + offset)})));
+ new Object[] { new BigDecimal(1 + offset) })));
} else {
Assert.assertFalse(container.isLastId(new RowId(
- new Object[]{1 + offset})));
+ new Object[] { 1 + offset })));
}
}
public void isLastId_tableLastId_returnsTrue() throws SQLException {
if (SQLTestsConstants.db == DB.ORACLE) {
assertTrue(container.isLastId(new RowId(
- new Object[]{new BigDecimal(3 + offset)})));
+ new Object[] { new BigDecimal(3 + offset) })));
} else {
- assertTrue(container.isLastId(new RowId(
- new Object[]{3 + offset})));
+ assertTrue(container
+ .isLastId(new RowId(new Object[] { 3 + offset })));
}
}
DataGenerator.addFiveThousandPeople(connectionPool);
if (SQLTestsConstants.db == DB.ORACLE) {
assertTrue(container.isLastId(new RowId(
- new Object[]{new BigDecimal(4999 + offset)})));
+ new Object[] { new BigDecimal(4999 + offset) })));
} else {
assertTrue(container.isLastId(new RowId(
- new Object[]{4999 + offset})));
+ new Object[] { 4999 + offset })));
}
}
assertTrue(garbageContainer.removeItem(first));
Assert.assertSame(second, garbageContainer.firstItemId());
}
+
@Test
public void lastItemId_tableLastItemRemoved_resultChanges()
throws SQLException {
stringToStateMap.put("string - state 1", s);
stringToStateMap.put("String - state 2", s2);
- JsonValue encodedMap = JsonCodec.encode(stringToStateMap, null, mapType,
- null).getEncodedValue();
+ JsonValue encodedMap = JsonCodec.encode(stringToStateMap, null,
+ mapType, null).getEncodedValue();
ensureDecodedCorrectly(stringToStateMap, encodedMap, mapType);
}
stateToStringMap.put(s, "string - state 1");
stateToStringMap.put(s2, "String - state 2");
- JsonValue encodedMap = JsonCodec.encode(stateToStringMap, null, mapType,
- null).getEncodedValue();
+ JsonValue encodedMap = JsonCodec.encode(stateToStringMap, null,
+ mapType, null).getEncodedValue();
ensureDecodedCorrectly(stateToStringMap, encodedMap, mapType);
}
ClientMethodInvocation copy = (ClientMethodInvocation) serializeAndDeserialize(original);
JsonArray copyArray = (JsonArray) copy.getParameters()[1];
- assertEquals(JsonUtil.stringify(originalArray), JsonUtil.stringify(copyArray));
+ assertEquals(JsonUtil.stringify(originalArray),
+ JsonUtil.stringify(copyArray));
}
public void testClientMethodSerialization_WithBasicParams_NoChanges()
/*
* (non-Javadoc)
- *
+ *
* @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
* VaadinRequest)
*/
/*
* (non-Javadoc)
- *
+ *
* @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber()
*/
@Override
-package com.vaadin.tests.components.button;\r
-\r
-import com.vaadin.server.ThemeResource;\r
-import com.vaadin.server.VaadinRequest;\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-import com.vaadin.ui.Button.ClickListener;\r
-import com.vaadin.ui.NativeButton;\r
-import com.vaadin.ui.UI;\r
-import com.vaadin.ui.VerticalLayout;\r
-\r
-@SuppressWarnings("serial")\r
-public class ButtonToggleIcons extends UI {\r
-\r
- @Override\r
- protected void init(final VaadinRequest request) {\r
- final VerticalLayout layout = new VerticalLayout();\r
- setContent(layout);\r
-\r
- final ThemeResource iconResource = new ThemeResource(\r
- "../runo/icons/16/arrow-left.png");\r
-\r
- final ClickListener iconToggleListener = new ClickListener() {\r
- @Override\r
- public void buttonClick(final ClickEvent event) {\r
- final Button btn = event.getButton();\r
- if (btn.getIcon() == null) {\r
- btn.setIcon(iconResource);\r
- } else {\r
- btn.setIcon(null);\r
- }\r
- }\r
- };\r
-\r
- layout.addComponent(new Button("Toggle icon", iconToggleListener));\r
- layout.addComponent(new NativeButton("Toggle icon", iconToggleListener));\r
- }\r
-}\r
+package com.vaadin.tests.components.button;
+
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+@SuppressWarnings("serial")
+public class ButtonToggleIcons extends UI {
+
+ @Override
+ protected void init(final VaadinRequest request) {
+ final VerticalLayout layout = new VerticalLayout();
+ setContent(layout);
+
+ final ThemeResource iconResource = new ThemeResource(
+ "../runo/icons/16/arrow-left.png");
+
+ final ClickListener iconToggleListener = new ClickListener() {
+ @Override
+ public void buttonClick(final ClickEvent event) {
+ final Button btn = event.getButton();
+ if (btn.getIcon() == null) {
+ btn.setIcon(iconResource);
+ } else {
+ btn.setIcon(null);
+ }
+ }
+ };
+
+ layout.addComponent(new Button("Toggle icon", iconToggleListener));
+ layout.addComponent(new NativeButton("Toggle icon", iconToggleListener));
+ }
+}
WebElement day = findElements(By.className("v-calendar-day-number"))
.get(2);
// IE8 requires you to click on the text part to fire the event
- new Actions(getDriver()).moveToElement(day, day.getSize().getWidth() - 3, day.getSize().getHeight() / 2).click().perform();
+ new Actions(getDriver())
+ .moveToElement(day, day.getSize().getWidth() - 3,
+ day.getSize().getHeight() / 2).click().perform();
// check that a notification was opened, this is done with a log instead
// of a screenshot or element presence check due to problems with IE
ComboBox cb = getComboBox("A combobox", false, "default");
addComponent(cb);
- cb = getComboBox("A combobox with input prompt", false, "default-prompt");
+ cb = getComboBox("A combobox with input prompt", false,
+ "default-prompt");
cb.setInputPrompt("Please select");
addComponent(cb);
cb = getComboBox("A combobox with null item", true, "null");
addComponent(cb);
- cb = getComboBox("A combobox with null item and input prompt", true, "null-prompt");
+ cb = getComboBox("A combobox with null item and input prompt", true,
+ "null-prompt");
cb.setInputPrompt("Please select");
addComponent(cb);
- cb = getComboBox("A combobox with filteringMode off", false, "filtering-off");
+ cb = getComboBox("A combobox with filteringMode off", false,
+ "filtering-off");
cb.setFilteringMode(FilteringMode.OFF);
addComponent(cb);
assertThat(getComboBoxValue(comboBox), is(""));
- //selectByText doesn't work when filtering is off.
+ // selectByText doesn't work when filtering is off.
comboBox.openPopup();
- List<WebElement> filteredItems = findElements(By.className("gwt-MenuItem"));
+ List<WebElement> filteredItems = findElements(By
+ .className("gwt-MenuItem"));
filteredItems.get(1).click();
sendKeysToComboBox(comboBox, "mnop");
import com.vaadin.ui.Label;
@SuppressWarnings("serial")
-public class ComboSelectedValueBeyondTheFirstDropdownPage extends AbstractTestUI {
+public class ComboSelectedValueBeyondTheFirstDropdownPage extends
+ AbstractTestUI {
protected static final int ITEM_COUNT = 21;
protected static final String ITEM_NAME_TEMPLATE = "Item %d";
return $(LabelElement.class).all().size() > 1;
}
-
}
\ No newline at end of file
addComponent(dateValue);
addComponent(dateField);
- dateField.addValueChangeListener( new Property.ValueChangeListener(){
+ dateField.addValueChangeListener(new Property.ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent event) {
dateValue.setValue(dateformat.format(dateField.getValue()));
});
}
- private DateField getDateField(TimeZone timezone, SimpleDateFormat dateformat) {
+ private DateField getDateField(TimeZone timezone,
+ SimpleDateFormat dateformat) {
final DateField dateField = new DateField();
try {
Date initialDate = dateformat.parse(initialDateString);
}
private SimpleDateFormat getDateFormat(TimeZone timezone) {
- final SimpleDateFormat dateformat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
+ final SimpleDateFormat dateformat = new SimpleDateFormat(
+ "MM/dd/yyyy HH:mm:ss");
dateformat.setTimeZone(timezone);
return dateformat;
}
}
private void select2ndOfSeptember() {
- for(WebElement e : findElements(By.className("v-datefield-calendarpanel-day"))) {
- if(e.getText().equals("2")) {
+ for (WebElement e : findElements(By
+ .className("v-datefield-calendarpanel-day"))) {
+ if (e.getText().equals("2")) {
e.click();
break;
}
private void openDatePicker() {
DateFieldElement dateField = $(DateFieldElement.class).first();
- dateField.findElement(By.tagName("button"))
- .click();
+ dateField.findElement(By.tagName("button")).click();
}
}
\ No newline at end of file
@Test
@Ignore
- //This test is actually testing that #7309 is NOT fixed.
- //Ignoring the test because it is not stable and it's
- //occasionally failing on browsers even when it shouldn't.
-
- //There's no point fixing this test before #7309 is actually fixed.
+ // This test is actually testing that #7309 is NOT fixed.
+ // Ignoring the test because it is not stable and it's
+ // occasionally failing on browsers even when it shouldn't.
+ // There's no point fixing this test before #7309 is actually fixed.
public void pageIsNotScrolled() throws IOException {
openTestURL();
}
private WebElement getPopupShadow() {
- //Shadows with index 0: tooltip, index 1: popup
+ // Shadows with index 0: tooltip, index 1: popup
return findElements(By.className("v-shadow")).get(1);
}
TableElement table = getTable();
assertThat(table.getCell(LASTSELECTEDROW, 1).getText(), is("updated"));
- assertThat(table.getCell(LASTSELECTEDROW-1, 1).getText(), is("updated"));
+ assertThat(table.getCell(LASTSELECTEDROW - 1, 1).getText(),
+ is("updated"));
}
private void selectRows() {
scrollToBottom();
- new Actions(getDriver()).keyDown(Keys.SHIFT).click(getTable().getCell(LASTSELECTEDROW, 0)).keyUp(Keys.SHIFT)
- .build().perform();
+ new Actions(getDriver()).keyDown(Keys.SHIFT)
+ .click(getTable().getCell(LASTSELECTEDROW, 0))
+ .keyUp(Keys.SHIFT).build().perform();
}
private TableElement getTable() {
int rowLocation = row.getLocation().getY();
- // use click x,y with non-zero offset to actually toggle the checkbox. (#13763)
+ // use click x,y with non-zero offset to actually toggle the checkbox.
+ // (#13763)
checkbox.click(5, 5);
int newRowLocation = row.getLocation().getY();
}
private void assertThatFocusTextFieldHasText(String text) {
- List<WebElement> focused = getTable().findElements(By
- .className("v-textfield-focus"));
+ List<WebElement> focused = getTable().findElements(
+ By.className("v-textfield-focus"));
assertThat(focused.get(0).getAttribute("value"), is(text));
}
private int getSelectedRowTextValue() {
WebElement selectedRow = getSelectedRow();
- //i.e. 'red 1foo'
+ // i.e. 'red 1foo'
String text = getText(selectedRow, 2);
return Integer.parseInt(text.substring(4, 5));
}
private List<WebElement> getCellContents(WebElement row) {
- return row.findElements(
- By.className("v-table-cell-content"));
+ return row.findElements(By.className("v-table-cell-content"));
}
private WebElement getSelectedRow() {
- return getTable().findElement(By
- .className("v-selected"));
+ return getTable().findElement(By.className("v-selected"));
}
private void clickOnTextField(int row) {
}
private WebElement getElement(int row, int index, String className) {
- return getRows()
- .get(row)
- .findElements(By.className(className))
+ return getRows().get(row).findElements(By.className(className))
.get(index);
}
private List<WebElement> getRows() {
return getTable().findElement(By.className("v-table-body"))
- .findElements(By.tagName("tr"));
+ .findElements(By.tagName("tr"));
}
private void selectRow(int row) {
return $(TableElement.class).first();
}
-
private void clickOnLabel(int row) {
WebElement label = getElement(row, "v-label");
label.click();
private int getSelectedRowIndex() {
List<WebElement> rows = getRows();
- //Unfortunately rows.getIndexOf(getSelectedRow()) doesn't work.
- for(WebElement r : rows) {
- if(r.getAttribute("class").contains("v-selected")) {
+ // Unfortunately rows.getIndexOf(getSelectedRow()) doesn't work.
+ for (WebElement r : rows) {
+ if (r.getAttribute("class").contains("v-selected")) {
return rows.indexOf(r);
}
}
public List<DesiredCapabilities> getBrowsersToTest() {
List<DesiredCapabilities> browsersToTest = super.getBrowsersToTest();
- //Can't get IE8 to hit the resizer, extracted IE8 to it's own test class.
+ // Can't get IE8 to hit the resizer, extracted IE8 to it's own test
+ // class.
browsersToTest.remove(Browser.IE8.getDesiredCapabilities());
return browsersToTest;
List<ButtonElement> buttons = $(ButtonElement.class).all();
- WebElement resizer = getTable().findElement(By.className("v-table-resizer"));
+ WebElement resizer = getTable().findElement(
+ By.className("v-table-resizer"));
assertEquals(100, getTextFieldWidth());
private int getTextFieldWidth() {
TableElement table = getTable();
- final WebElement textField = table.findElement(By.className("v-textfield"));
+ final WebElement textField = table.findElement(By
+ .className("v-textfield"));
return textField.getSize().width;
}
}
private void moveResizer(WebElement resizer, int offset) {
- new Actions(driver).clickAndHold(resizer).moveByOffset(offset, 0).release().perform();
+ new Actions(driver).clickAndHold(resizer).moveByOffset(offset, 0)
+ .release().perform();
}
}
-
-
-package com.vaadin.tests.components.tabsheet;\r
-\r
-import com.vaadin.annotations.Theme;\r
-import com.vaadin.server.VaadinRequest;\r
-import com.vaadin.ui.HorizontalSplitPanel;\r
-import com.vaadin.ui.Panel;\r
-import com.vaadin.ui.TabSheet;\r
-import com.vaadin.ui.UI;\r
-import com.vaadin.ui.VerticalLayout;\r
-import com.vaadin.ui.themes.Runo;\r
-\r
-@Theme("runo")\r
-public class ExtraScrollbarsInTabSheet extends UI {\r
-\r
- @Override\r
- public void init(VaadinRequest request) {\r
-\r
- VerticalLayout vl = new VerticalLayout();\r
- vl.setSizeFull();\r
-\r
- HorizontalSplitPanel horizontalSplit = new HorizontalSplitPanel();\r
-\r
- TabSheet ts = new TabSheet();\r
-\r
- VerticalLayout tabContent = new VerticalLayout();\r
- tabContent.setSizeFull();\r
-\r
- Panel p = new Panel();\r
- p.addStyleName(Runo.PANEL_LIGHT);\r
- p.setHeight("400px");\r
- tabContent.addComponent(p);\r
-\r
- ts.addTab(tabContent);\r
- horizontalSplit.setSecondComponent(ts);\r
-\r
- vl.addComponent(horizontalSplit);\r
-\r
- setContent(vl);\r
-\r
- }\r
-\r
-}\r
+package com.vaadin.tests.components.tabsheet;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.Runo;
+
+@Theme("runo")
+public class ExtraScrollbarsInTabSheet extends UI {
+
+ @Override
+ public void init(VaadinRequest request) {
+
+ VerticalLayout vl = new VerticalLayout();
+ vl.setSizeFull();
+
+ HorizontalSplitPanel horizontalSplit = new HorizontalSplitPanel();
+
+ TabSheet ts = new TabSheet();
+
+ VerticalLayout tabContent = new VerticalLayout();
+ tabContent.setSizeFull();
+
+ Panel p = new Panel();
+ p.addStyleName(Runo.PANEL_LIGHT);
+ p.setHeight("400px");
+ tabContent.addComponent(p);
+
+ ts.addTab(tabContent);
+ horizontalSplit.setSecondComponent(ts);
+
+ vl.addComponent(horizontalSplit);
+
+ setContent(vl);
+
+ }
+
+}
TabSheet tabSheet = new TabSheet();
tabSheet.setWidth("600px");
- firstTab = tabSheet.addTab(new Label("first visible tab"), "first visible tab");
+ firstTab = tabSheet.addTab(new Label("first visible tab"),
+ "first visible tab");
for (int i = 2; i < 10; i++) {
tabSheet.addTab(new Label("visible tab " + i), "visible tab " + i);
}
- addComponent(new VerticalLayout(tabSheet, new Button("Toggle first tab", new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent event) {
- firstTab.setVisible(!firstTab.isVisible());
- }
- })));
+ addComponent(new VerticalLayout(tabSheet, new Button(
+ "Toggle first tab", new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ firstTab.setVisible(!firstTab.isVisible());
+ }
+ })));
}
@Override
package com.vaadin.tests.components.tabsheet;
-
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.TabSheetElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
TabSheetElement tabSheet = $(TabSheetElement.class).first();
- Assert.assertTrue("TabSheet should have first tab visible",
- tabSheet.getTabCaptions().contains("first visible tab"));
+ Assert.assertTrue("TabSheet should have first tab visible", tabSheet
+ .getTabCaptions().contains("first visible tab"));
}
private void toggleFirstTabVisibility() {
-package com.vaadin.tests.components.tabsheet;\r
-\r
-import com.vaadin.server.VaadinRequest;\r
-import com.vaadin.tests.components.AbstractTestUI;\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-import com.vaadin.ui.HorizontalLayout;\r
-import com.vaadin.ui.Label;\r
-import com.vaadin.ui.TabSheet;\r
-\r
-/**\r
- * Main UI class\r
- */\r
-@SuppressWarnings("serial")\r
-public class MoveComponentBetweenTabsheets extends AbstractTestUI {\r
-\r
- TabSheet left, right;\r
- private Label l1;\r
- private Label l2;\r
- private Label r1;\r
- private Label r2;\r
-\r
- void doTestOperation() {\r
- right.addTab(l1, "L1");\r
- right.setSelectedTab(l1);\r
- }\r
-\r
- @Override\r
- protected void setup(VaadinRequest request) {\r
-\r
- // TODO Auto-generated method stub\r
- Button button = new Button("Move L1 to the right tabsheet");\r
- button.addClickListener(new Button.ClickListener() {\r
- @Override\r
- public void buttonClick(ClickEvent event) {\r
- doTestOperation();\r
- }\r
- });\r
-\r
- getLayout().addComponent(button);\r
-\r
- left = new TabSheet();\r
- l1 = new Label("Left 1");\r
- left.addTab(l1, "L1");\r
- l2 = new Label("Left 2");\r
- left.addTab(l2, "L2");\r
- left.setWidth("400px");\r
-\r
- right = new TabSheet();\r
- r1 = new Label("Right 1");\r
- right.addTab(r1, "R1");\r
- r2 = new Label("Right 2");\r
- right.addTab(r2, "R2");\r
- right.setWidth("400px");\r
-\r
- getLayout().addComponent(new HorizontalLayout(left, right));\r
- }\r
-\r
- @Override\r
- protected String getTestDescription() {\r
- return "Moving a component from a tabsheet to another sometimes causes a client-side error";\r
- }\r
-\r
- @Override\r
- protected Integer getTicketNumber() {\r
- return 10839;\r
- }\r
-\r
-}\r
+package com.vaadin.tests.components.tabsheet;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.TabSheet;
+
+/**
+ * Main UI class
+ */
+@SuppressWarnings("serial")
+public class MoveComponentBetweenTabsheets extends AbstractTestUI {
+
+ TabSheet left, right;
+ private Label l1;
+ private Label l2;
+ private Label r1;
+ private Label r2;
+
+ void doTestOperation() {
+ right.addTab(l1, "L1");
+ right.setSelectedTab(l1);
+ }
+
+ @Override
+ protected void setup(VaadinRequest request) {
+
+ // TODO Auto-generated method stub
+ Button button = new Button("Move L1 to the right tabsheet");
+ button.addClickListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ doTestOperation();
+ }
+ });
+
+ getLayout().addComponent(button);
+
+ left = new TabSheet();
+ l1 = new Label("Left 1");
+ left.addTab(l1, "L1");
+ l2 = new Label("Left 2");
+ left.addTab(l2, "L2");
+ left.setWidth("400px");
+
+ right = new TabSheet();
+ r1 = new Label("Right 1");
+ right.addTab(r1, "R1");
+ r2 = new Label("Right 2");
+ right.addTab(r2, "R2");
+ right.setWidth("400px");
+
+ getLayout().addComponent(new HorizontalLayout(left, right));
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Moving a component from a tabsheet to another sometimes causes a client-side error";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 10839;
+ }
+
+}
package com.vaadin.tests.components.textfield;
-
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
waitForLogToContainText("0. Current UI matches in beforeResponse? true");
waitForLogToContainText("1. Current session matches in beforeResponse? true");
}
-
+
@Test
public void canBeAccessedFromUIThread() {
$(ButtonElement.class).first().click();
waitForLogToContainText("1. Thread started, waiting for interruption");
waitForLogToContainText("2. I was interrupted");
}
-
+
@Test
public void testAccessSynchronously() {
$(ButtonElement.class).get(5).click();
assertTrue(logContainsText("2. has request after accessSynchronously? true"));
assertTrue(logContainsText("3. Test value after accessSynchornously: Set in accessSynchronosly"));
}
-
+
@Test
public void currentInstanceCanAccessValue() {
$(ButtonElement.class).get(6).click();
public class UISerializationTest extends SingleBrowserTest {
@Test
- @Ignore //Broken on all browsers since 9696e6c3e7e952b66ac3f5c9ddc3dfca4233451e
+ @Ignore
+ // Broken on all browsers since 9696e6c3e7e952b66ac3f5c9ddc3dfca4233451e
public void tb2test() throws Exception {
openTestURL();
$(ButtonElement.class).first().click();
@Override
public void call(JsonArray arguments) {
log.log("Got " + arguments.length() + " arguments");
- log.log("Argument 1 as a number: " + (int) arguments.getNumber(0));
+ log.log("Argument 1 as a number: "
+ + (int) arguments.getNumber(0));
log.log("Argument 2 as a string: " + arguments.getString(1));
log.log("Argument 3.p as a boolean: "
+ arguments.getObject(2).getBoolean("p"));
try {
fieldGroup.commit();
} catch (FieldGroup.CommitException e) {
- if (e.getCause() != null && e.getCause() instanceof Validator.InvalidValueException) {
- validationErrors.setValue(StringEscapeUtils.unescapeHtml(
- AbstractErrorMessage.getErrorMessageForException(e.getCause()).getFormattedHtmlMessage()));
+ if (e.getCause() != null
+ && e.getCause() instanceof Validator.InvalidValueException) {
+ validationErrors.setValue(StringEscapeUtils
+ .unescapeHtml(AbstractErrorMessage
+ .getErrorMessageForException(
+ e.getCause())
+ .getFormattedHtmlMessage()));
}
}
-
}
});
}
- private void bindTextField(BeanItem<PersonBeanWithValidationAnnotations> item, FieldGroup fieldGroup,
- String caption, String propertyId) {
- TextField textfield = new TextField(caption, item.getItemProperty(propertyId));
- textfield.addValidator(new BeanValidator(PersonBeanWithValidationAnnotations.class, propertyId));
+ private void bindTextField(
+ BeanItem<PersonBeanWithValidationAnnotations> item,
+ FieldGroup fieldGroup, String caption, String propertyId) {
+ TextField textfield = new TextField(caption,
+ item.getItemProperty(propertyId));
+ textfield.addValidator(new BeanValidator(
+ PersonBeanWithValidationAnnotations.class, propertyId));
fieldGroup.bind(textfield, propertyId);
}
private void clearTextField(String caption) {
- TextFieldElement textField = $(TextFieldElement.class).caption(caption).first();
+ TextFieldElement textField = $(TextFieldElement.class).caption(caption)
+ .first();
textField.clear();
}
commitTextFields();
- String validationErrors = $(LabelElement.class).id("validationErrors").getText();
+ String validationErrors = $(LabelElement.class).id("validationErrors")
+ .getText();
- assertThat(validationErrors, containsString(MultipleValidationErrors.FIRST_NAME_NOT_EMPTY_VALIDATION_MESSAGE));
- assertThat(validationErrors, containsString(MultipleValidationErrors.LAST_NAME_NOT_EMPTY_VALIDATION_MESSAGE));
+ assertThat(
+ validationErrors,
+ containsString(MultipleValidationErrors.FIRST_NAME_NOT_EMPTY_VALIDATION_MESSAGE));
+ assertThat(
+ validationErrors,
+ containsString(MultipleValidationErrors.LAST_NAME_NOT_EMPTY_VALIDATION_MESSAGE));
}
}
} else {
// type should be in [1]
Notification.show(caption,
- Type.values()[((int) arguments.getNumber(1))]);
+ Type.values()[((int) arguments
+ .getNumber(1))]);
}
} catch (JsonException e) {
package com.vaadin.tests.push;
-public class SendMultibyteCharactersLongPollingTest extends SendMultibyteCharactersTest {
+public class SendMultibyteCharactersLongPollingTest extends
+ SendMultibyteCharactersTest {
@Override
protected String getTransport() {
package com.vaadin.tests.push;
-public class SendMultibyteCharactersStreamingTest extends SendMultibyteCharactersTest {
+public class SendMultibyteCharactersStreamingTest extends
+ SendMultibyteCharactersTest {
@Override
protected String getTransport() {
TextAreaElement textArea = $(TextAreaElement.class).first();
StringBuilder text = new StringBuilder();
- for(int i=0;i < 20;i++) {
+ for (int i = 0; i < 20; i++) {
text.append("之は日本語です、テストです。");
}
package com.vaadin.tests.push;
-
import org.openqa.selenium.remote.DesiredCapabilities;
import java.util.List;
-public class SendMultibyteCharactersWebSocketTest extends SendMultibyteCharactersTest {
+public class SendMultibyteCharactersWebSocketTest extends
+ SendMultibyteCharactersTest {
@Override
public List<DesiredCapabilities> getBrowsersToTest() {
getLogRow(logRow++));
Assert.assertEquals("state.floatArray: [57, 0, -12]",
getLogRow(logRow++));
- Assert.assertTrue(getLogRow(logRow++).startsWith("state.floatObjectValue: 1.0000001"));
- Assert.assertTrue(getLogRow(logRow++).startsWith("state.floatValue: 3.14159"));
+ Assert.assertTrue(getLogRow(logRow++).startsWith(
+ "state.floatObjectValue: 1.0000001"));
+ Assert.assertTrue(getLogRow(logRow++).startsWith(
+ "state.floatValue: 3.14159"));
Assert.assertEquals("state.longArray: [-57841235865, 57]",
getLogRow(logRow++));
Assert.assertEquals("state.longObjectValue: 577431841360",
public abstract class MultiBrowserTest extends PrivateTB3Configuration {
protected List<DesiredCapabilities> getBrowsersSupportingWebSocket() {
- List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(getAllBrowsers());
+ List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(
+ getAllBrowsers());
browsers.remove(Browser.IE8.getDesiredCapabilities());
browsers.remove(Browser.IE9.getDesiredCapabilities());
}
protected List<DesiredCapabilities> getBrowsersExcludingPhantomJS() {
- List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(getAllBrowsers());
+ List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(
+ getAllBrowsers());
browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
}
protected List<DesiredCapabilities> getBrowsersExcludingIE() {
- List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(getAllBrowsers());
+ List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(
+ getAllBrowsers());
browsers.remove(Browser.IE8.getDesiredCapabilities());
browsers.remove(Browser.IE9.getDesiredCapabilities());
browsers.remove(Browser.IE10.getDesiredCapabilities());
}
protected List<DesiredCapabilities> getBrowsersSupportingShiftClick() {
- List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(getAllBrowsers());
+ List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(
+ getAllBrowsers());
- //IE supports shift click only when require window focus is true
+ // IE supports shift click only when require window focus is true
browsers.remove(Browser.FIREFOX.getDesiredCapabilities());
browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities());
- return browsers;
- }
+ return browsers;
+ }
protected List<DesiredCapabilities> getIEBrowsersOnly() {
List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>();
return browsers;
}
-
public enum Browser {
FIREFOX(BrowserUtil.firefox(24)), CHROME(BrowserUtil.chrome(33)), SAFARI(
BrowserUtil.safari(7)), IE8(BrowserUtil.ie(8)), IE9(BrowserUtil
}
private int getRetryCount() {
- String retryCount = System.getProperty("com.vaadin.testbench.max.retries");
+ String retryCount = System
+ .getProperty("com.vaadin.testbench.max.retries");
- if(retryCount != null && retryCount != "") {
+ if (retryCount != null && retryCount != "") {
return Integer.parseInt(retryCount);
}
@Override
public List<DesiredCapabilities> getBrowsersToTest() {
- return new ArrayList<DesiredCapabilities>(getBrowsersSupportingWebSocket());
+ return new ArrayList<DesiredCapabilities>(
+ getBrowsersSupportingWebSocket());
}
}
private int getResponseCode(String theme) {
try {
- URL url = new URL(String.format("%s/VAADIN/themes/%s/favicon.ico", getBaseURL(), theme));
- HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+ URL url = new URL(String.format("%s/VAADIN/themes/%s/favicon.ico",
+ getBaseURL(), theme));
+ HttpURLConnection connection = (HttpURLConnection) url
+ .openConnection();
connection.setRequestMethod("GET");
connection.connect();
@Override
protected void setup(VaadinRequest request) {
-
addButton("Notification", new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent event) {
openTestURL();
$(ButtonElement.class).first().click();
- NotificationElement notificationElement
- = $(NotificationElement.class).first();
+ NotificationElement notificationElement = $(NotificationElement.class)
+ .first();
assertThat(notificationElement.getCssValue("background-image"),
containsString("chameleon/img/grad"));
openModalWindow();
- WebElement modalityCurtain = findElement(By.className("v-window-modalitycurtain"));
+ WebElement modalityCurtain = findElement(By
+ .className("v-window-modalitycurtain"));
- assertThat(modalityCurtain.getCssValue("-webkit-animation-name"), is("none"));
+ assertThat(modalityCurtain.getCssValue("-webkit-animation-name"),
+ is("none"));
}
private void openModalWindow() {
Table table = new Table();
table.addContainerProperty("Index", Integer.class, "");
- for(int i=0;i<10;i++) {
- table.addItem(new Object[] {i}, i);
+ for (int i = 0; i < 10; i++) {
+ table.addItem(new Object[] { i }, i);
}
table.setPageLength(0);
@Override
protected String getTestDescription() {
- return "For Valo, sorting indicators should point up when sorted asc " +
- "and down when sorted desc.";
+ return "For Valo, sorting indicators should point up when sorted asc "
+ + "and down when sorted desc.";
}
@Override