<batchtest fork="yes">
<fileset dir="${test.src}">
<exclude name="**/Abstract*" />
+ <exclude name="**/Mock*" />
<exclude name="com/vaadin/tests/data/bean/*" />
<exclude name="com/vaadin/tests/util/*" />
<exclude name="**/VaadinClasses.java" />
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
-import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
super.setUp();
servlet = new VaadinServlet();
-
- // Workaround to avoid calling init and creating servlet config
- Field f = VaadinServlet.class.getDeclaredField("servletService");
- f.setAccessible(true);
- VaadinServletService service = new VaadinServletService(servlet,
- new DefaultDeploymentConfiguration(servlet.getClass(),
- new Properties()));
- service.init();
- f.set(servlet, service);
-
+ servlet.init(new MockServletConfig());
}
public void testWidgetSetLocation() throws Exception {
import org.easymock.EasyMock;
import com.vaadin.server.LegacyCommunicationManager;
+import com.vaadin.server.MockServletConfig;
import com.vaadin.server.StreamVariable;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
private LegacyCommunicationManager createCommunicationManager()
throws Exception {
- VaadinServletService vss = new VaadinServletService(
- EasyMock.createMock(VaadinServlet.class),
+ VaadinServlet servlet = new VaadinServlet();
+ VaadinServletService vss = new VaadinServletService(servlet,
new MockDeploymentConfiguration());
- vss.init();
+ servlet.init(new MockServletConfig());
return new LegacyCommunicationManager(
new AlwaysLockedVaadinSession(vss));
}
import com.vaadin.data.util.converter.StringToIntegerConverter;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinSession;
+import com.vaadin.tests.util.AlwaysLockedVaadinSession;
public class AbsFieldDataSourceLocaleChange {
@Before
public void setup() {
- vaadinSession = new VaadinSession(null);
+ vaadinSession = new AlwaysLockedVaadinSession(null);
VaadinSession.setCurrent(vaadinSession);
ui = new UI() {