blob: 8f8bbf08c3481877dfd08e6463d539d56c6cc6b6 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.xwt.tests.databinding.pojo.attribute;
import java.net.URL;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Text;
import org.eclipse.xwt.IConstants;
import org.eclipse.xwt.XWT;
import org.eclipse.xwt.tests.XWTTestCase;
public class PojoAttrDataBindingTests extends XWTTestCase {
public void testDataBinding() throws Exception {
URL url = PojoAttrDataBindingTests.class.getResource(DataBinding.class
.getSimpleName()
+ IConstants.XWT_EXTENSION_SUFFIX);
runTest(url, new Runnable() {
public void run() {
checkButton();
}
public void checkButton() {
Object element = XWT.findElementByName(root, "Button");
assertTrue(element instanceof Button);
}
}, new Runnable() {
public void run() {
checkButton();
}
public void checkButton() {
Object element = XWT.findElementByName(root, "Name");
assertTrue(element instanceof Text);
Text text = (Text) element;
assertEquals(text.getText(), "Soyatec");
}
});
}
}