mercredi 6 mai 2015

Test Eclipse 4 RCP Application. Provide necessary Objects

I´m developing an Eclipse 4 RCP Application and I want to test some functions of my Parts. I have a Test Class like this:

@BeforeClass
public static void initUI() {
    display = new Display();
    shell = new Shell(display);

    configPart = new ConfigPart();
    configPart.postConstruct(shell);
}

@Test
public void testConfigPart() {
    String testText = "TitleText";
    configPart.title.setText(testText);

    assertEquals(testText, ConfigHandler.getInstance().getInternalConfig()
            .getTitle());
}

During the creation of the ConfigPart a DataBinding is created and that is where I run into an AssertionFailedException. The statement is:

DataBindingContext ctx = new DataBindingContext();

Is there a way to avoid this or is there another way to test E4 Applications?

Aucun commentaire:

Enregistrer un commentaire