@@ -0,0 +1,1789 @@
+package com.vaadin.tests.components.table;%0A%0Aimport com.vaadin.tests.components.TestBase;%0Aimport com.vaadin.tests.util.TestUtils;%0Aimport com.vaadin.ui.Table;%0Aimport com.vaadin.ui.Table.CellStyleGenerator;%0A%0A@SuppressWarnings(%22serial%22)%0Apublic class CellStyleGeneratorTest extends TestBase %7B%0A%0A    @Override%0A    protected void setup() %7B%0A        TestUtils%0A                .injectCSS(getMainWindow(),%0A                        %22.v-table-cell-content-red%7Bbackground:red;%7D.v-table-row-blue%7Bbackground:blue;%7D%22);%0A%0A        CellStyleGenerator g = new CellStyleGenerator() %7B%0A%0A            public String getStyle(Object itemId, Object propertyId) %7B%0A                if (propertyId != null && propertyId.equals(%22red%22)) %7B%0A                    return %22red%22;%0A                %7D else if (itemId.equals(%22blue%22) && propertyId == null) %7B%0A                    // row style%0A                    return %22blue%22;%0A                %7D%0A                return null;%0A            %7D%0A%0A        %7D;%0A%0A        Table table = new Table();%0A        table.addContainerProperty(%22foo%22, String.class, %22foo%22);%0A        table.addContainerProperty(%22red%22, String.class, %22red%22);%0A        table.addItem();%0A        table.addItem(%22blue%22);%0A        table.setCellStyleGenerator(g);%0A%0A        addComponent(table);%0A%0A        table = new Table();%0A        table.addContainerProperty(%22foo%22, String.class, %22foo%22);%0A        table.addContainerProperty(%22red%22, String.class, %22red%22);%0A        table.addItem();%0A        table.addItem(%22blue%22);%0A        table.setCellStyleGenerator(g);%0A        table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);%0A%0A        addComponent(table);%0A%0A    %7D%0A%0A    @Override%0A    protected String getDescription() %7B%0A        return %22Cell style generators should work%22;%0A    %7D%0A%0A    @Override%0A    protected Integer getTicketNumber() %7B%0A        return null;%0A    %7D%0A%0A%7D%0A

test case