GwtTestIntrospection.java :  » GWT » gwittir » com » totsp » gwittir » client » beans » Java Open Source

Java Open Source » GWT » gwittir 
gwittir » com » totsp » gwittir » client » beans » GwtTestIntrospection.java
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.totsp.gwittir.client.beans;

import com.google.gwt.core.client.GWT;
import com.google.gwt.junit.client.GWTTestCase;
import com.totsp.gwittir.client.testmodel.TestFileDeclaredIntrospection;

/**
 *
 * @author kebernet
 */
public class GwtTestIntrospection extends GWTTestCase {

    public String getModuleName() {
        return "com.totsp.gwittir.GwittirTest";
    }

    public void testFileDeclared() throws Exception {
        TestFileDeclaredIntrospection bean = new TestFileDeclaredIntrospection();
        Property p = Introspector.INSTANCE.getDescriptor(bean).getProperty("stringProperty");
        System.out.println( "String property: "+p);
        assertTrue( p.getName().equals("stringProperty") );
        p = Introspector.INSTANCE.getDescriptor(bean).getProperty("intProperty");
        assertTrue( p.getName().equals("intProperty"));
        try{
            p = Introspector.INSTANCE.getDescriptor(bean).getProperty("doubleProperty");
            if(GWT.isScript()){
                fail();
            }
        }
        catch(RuntimeException e) {
            assertTrue( e != null );
        }


    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.