diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-10-22 09:12:59 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2013-10-22 09:12:59 +0300 |
commit | d70961ff2539aabe99eea22683a8ae77efdc81e5 (patch) | |
tree | c3876e2266ace7e90d8dc82e35f22631e2ce29e5 /server/tests | |
parent | a48370a761a6d0b6c54196da0defdb30b47a5bb1 (diff) | |
parent | ee809e5985d7a438e031c40bed160ac78ae8d0bc (diff) | |
download | vaadin-framework-d70961ff2539aabe99eea22683a8ae77efdc81e5.tar.gz vaadin-framework-d70961ff2539aabe99eea22683a8ae77efdc81e5.zip |
Merge changes from origin/7.1
c7ae45c Validate that the connector is enabled before triggering actions for it (#12743)
ce89a75 Created constants for tested browser versions (#12786)
f9ea9b3 Allow running tests locally by overriding runLocally() (#12786)
e70ba25 Added liferay module for building liferay.zip #12748
7c12694 Add sub directory support to sass test scanner (#12790)
39fdf66 Handle numbers in the same way if they do not have a unit (#12732)
6155d61 Disable fallback in a way compatible with Atmosphere JS 2.0.3 (#12241)
f401595 Test for pushing large chunks of data (#12567)
d41967d Skip compilation of TB2 tests if tests.tb2.skip is set
6c1ba81 Reverted button click() logic check (#12743)
779c8a0 Disable automated testing on Opera until issues are resolved (#12487, #12367, #12800)
962c1c3 Fix compilation error
7ee11a7 Remove unused test super class (#12786)
a4211dc Resolve concurrency issue in running TB3 tests
20c28aa Fixed javadoc
0d36896 Add more hax to make test work with new Atmosphere JS (#12241)
ed50200 Fix serialization issue (#12703)
dd51b7f Added more exception handling to PushHandler (#12578, #11882)
6f76840 Sass variables can now start with underscore (#12716)
ab5b20c Ticket #12727 - Panels get unnecessary scroll bars in WebKit when content is 100% wide.
361ad17 Fixed focus issue in TableMoveFocusWithSelectionTest (#12540)
ee809e5 Revert broken fix and test (#12446)
Change-Id: I71b6e3c2dc6b02845794df0934ba807d7ccac784
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/src/com/vaadin/server/communication/UidlWriterTest.java | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/server/tests/src/com/vaadin/server/communication/UidlWriterTest.java b/server/tests/src/com/vaadin/server/communication/UidlWriterTest.java deleted file mode 100644 index 8dcd6cbdf4..0000000000 --- a/server/tests/src/com/vaadin/server/communication/UidlWriterTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2000-2013 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.server.communication; - -import java.io.IOException; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Locale; - -import org.easymock.EasyMock; -import org.json.JSONException; -import org.json.JSONObject; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import com.vaadin.server.ClientConnector; -import com.vaadin.server.LegacyCommunicationManager; -import com.vaadin.server.SystemMessages; -import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinService; -import com.vaadin.server.VaadinSession; -import com.vaadin.server.WrappedSession; -import com.vaadin.ui.ConnectorTracker; -import com.vaadin.ui.UI; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class UidlWriterTest { - - private UI ui; - private UidlWriter uidlWriter; - - @Before - public void setUp() { - SystemMessages messages = EasyMock.createNiceMock(SystemMessages.class); - EasyMock.expect(messages.isSessionExpiredNotificationEnabled()) - .andReturn(true).anyTimes(); - EasyMock.replay(messages); - - VaadinService service = EasyMock.createNiceMock(VaadinService.class); - EasyMock.expect( - service.getSystemMessages(EasyMock.anyObject(Locale.class), - EasyMock.anyObject(VaadinRequest.class))) - .andReturn(messages).anyTimes(); - EasyMock.replay(service); - - LegacyCommunicationManager manager = EasyMock - .createNiceMock(LegacyCommunicationManager.class); - EasyMock.replay(manager); - - WrappedSession wrappedSession = EasyMock - .createNiceMock(WrappedSession.class); - EasyMock.expect(wrappedSession.getMaxInactiveInterval()).andReturn(100) - .times(3).andReturn(200); - - EasyMock.replay(wrappedSession); - - VaadinSession session = EasyMock.createNiceMock(VaadinSession.class); - EasyMock.expect(session.getService()).andReturn(service).anyTimes(); - EasyMock.expect(session.getCommunicationManager()).andReturn(manager) - .anyTimes(); - EasyMock.expect(session.getSession()).andReturn(wrappedSession) - .anyTimes(); - EasyMock.replay(session); - - ConnectorTracker tracker = EasyMock - .createNiceMock(ConnectorTracker.class); - EasyMock.expect(tracker.getDirtyVisibleConnectors()) - .andReturn(new ArrayList<ClientConnector>()).anyTimes(); - EasyMock.replay(tracker); - - ui = EasyMock.createNiceMock(UI.class); - EasyMock.expect(ui.getSession()).andReturn(session).anyTimes(); - EasyMock.expect(ui.getConnectorTracker()).andReturn(tracker).anyTimes(); - EasyMock.replay(ui); - - uidlWriter = new UidlWriter(); - } - - @Test - public void testMetadataWriterState() throws IOException, JSONException { - - Assert.assertEquals( - "Metadata should contain redirect interval on first write", - 115, getRedirect(uidl(false, false)).optInt("interval")); - Assert.assertNull( - "Metadata should not contain redirect interval on second write", - getRedirect(uidl(false, false))); - Assert.assertEquals( - "Metadata should contain redirect interval on repaintAll", 115, - getRedirect(uidl(true, false)).optInt("interval")); - Assert.assertEquals( - "Metadata should contain redirect interval when changed in session", - 215, getRedirect(uidl(false, false)).optInt("interval")); - } - - private JSONObject uidl(boolean repaintAll, boolean async) - throws IOException, JSONException { - StringWriter writer = new StringWriter(); - uidlWriter.write(ui, writer, repaintAll, async); - return new JSONObject("{" + writer.toString() + "}"); - } - - private JSONObject getRedirect(JSONObject json) throws JSONException { - return json.getJSONObject("meta").optJSONObject("timedRedirect"); - - } -} |