package com.vaadin.tests.application;
import com.vaadin.terminal.ExternalResource;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;
-public class PaintableIdsShouldBeUnique extends TestBase {
+public class PaintableIdsShouldBeUnique extends AbstractTestCase {
@Override
- protected void setup() {
+ public void init() {
setMainWindow(new MyWindow());
}
setup();
}
+ @Override
+ public void setMainWindow(Window mainWindow) {
+ if (mainWindow != window) {
+ throw new IllegalStateException(
+ "You should not set your own main window when using TestBase. If you need to use a custom Window as the main window, use AbstractTestCase instead.");
+ }
+ super.setMainWindow(mainWindow);
+ }
+
private Window window;
private VerticalLayout layout;
import java.util.List;
import com.vaadin.data.util.BeanItemContainer;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.tests.util.Person;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Table;
import com.vaadin.ui.Window;
-public class ScrollCausesRequestLoop extends TestBase {
+public class ScrollCausesRequestLoop extends AbstractTestCase {
@Override
- protected void setup() {
+ public void init() {
setMainWindow(new Window("", new TestView()));
}
package com.vaadin.tests.components.table;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class ScrollDetachSynchronization extends TestBase {
+public class ScrollDetachSynchronization extends AbstractTestCase {
@Override
- public void setup() {
+ public void init() {
Window mainWindow = new Window("Synctest Application");
mainWindow.setContent(buildLayout());
setMainWindow(mainWindow);
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class TableClickValueChangeInteraction extends TestBase {
+public class TableClickValueChangeInteraction extends AbstractTestCase {
final Window mainWindow = new Window();
@Override
- public void setup() {
+ public void init() {
setMainWindow(mainWindow);
GridLayout layout = new GridLayout(4, 4);
import java.util.Map;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;
-public class ReplacingComponentsInHandleParameters extends TestBase {
+public class ReplacingComponentsInHandleParameters extends AbstractTestCase {
@Override
protected String getDescription() {
}
@Override
- protected void setup() {
+ public void init() {
final ClickListener clickListener = new ClickListener() {
public void buttonClick(ClickEvent event) {
event.getButton().setCaption("Clicked!");
import java.io.File;
import com.vaadin.data.util.FilesystemContainer;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Table;
import com.vaadin.ui.Window;
-public class TableWithFileSystemContainer extends TestBase {
+public class TableWithFileSystemContainer extends AbstractTestCase {
private String testPath = "C:/temp/img";
@Override
- public void setup() {
+ public void init() {
setMainWindow(new Window(""));
Table table = new Table("Documents", new FilesystemContainer(new File(
testPath)));
import com.vaadin.data.Item;
import com.vaadin.data.Validator;
import com.vaadin.data.util.BeanItem;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class GridLayoutCaptions extends TestBase {
+public class GridLayoutCaptions extends AbstractTestCase {
class CustomForm extends Form {
private com.vaadin.ui.GridLayout layout;
}
@Override
- protected void setup() {
+ public void init() {
Window mainWindow = new Window("Formlayoutcaptionboom Application");
Label label = new Label("Hello Vaadin user");
mainWindow.addComponent(label);
package com.vaadin.tests.layouts;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class GridLayoutExpandRatioModification extends TestBase implements
- ClickListener {
+public class GridLayoutExpandRatioModification extends AbstractTestCase
+ implements ClickListener {
private boolean isVisible = false;
private GridLayout mainLayout;
private Button button;
@Override
- public void setup() {
+ public void init() {
Window main = new Window("The Main Window");
mainLayout = new GridLayout(3, 3);
main.setContent(mainLayout);
package com.vaadin.tests.layouts;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class VerticalLayoutExpandRatioModification extends TestBase implements
- ClickListener {
+public class VerticalLayoutExpandRatioModification extends AbstractTestCase
+ implements ClickListener {
private boolean isVisible = false;
private VerticalLayout mainLayout;
private Button button;
@Override
- public void setup() {
+ public void init() {
Window main = new Window("The Main Window");
mainLayout = new VerticalLayout();
main.setContent(mainLayout);
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.ObjectProperty;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket6002 extends TestBase {
+public class Ticket6002 extends AbstractTestCase {
@Override
- public void setup() {
+ public void init() {
Window main = new Window("The Main Window");
setMainWindow(main);
package com.vaadin.tests.validation;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Form;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class RequiredErrorMessage extends TestBase {
+public class RequiredErrorMessage extends AbstractTestCase {
@Override
protected Integer getTicketNumber() {
}
@Override
- public void setup() {
+ public void init() {
final Window main = new Window(getClass().getName());
setMainWindow(main);