diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.classpath b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.project b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.project
new file mode 100644
index 0000000..28a1842
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.jst.jsf.context.symbol.tests</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..bd13fb2
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.jst.jsf.context.symbol.tests; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.jst.jsf.context.symbol.tests
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.jst.jsf.context.symbol;visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;visibility:=reexport,
+ org.junit;visibility:=reexport,
+ org.eclipse.jst.jsf.test.util,
+ org.eclipse.jdt.core,
+ org.eclipse.jst.jsf.core.tests,
+ org.eclipse.ui
+Eclipse-LazyStart: true
+Bundle-Activator: org.eclipse.jst.jsf.context.symbol.tests.ContextSymbolTestPlugin
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/build.properties b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/build.properties
new file mode 100644
index 0000000..1ab825d
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/build.properties
@@ -0,0 +1,12 @@
+# <copyright>
+# </copyright>
+#
+# $Id: build.properties,v 1.1 2006/07/20 19:31:24 cbateman Exp $
+
+bin.includes = .,\
+               META-INF/,\
+               plugin.xml,\
+               plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
\ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.properties
new file mode 100644
index 0000000..f7e9643
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.properties
@@ -0,0 +1,20 @@
+# <copyright>
+# </copyright>
+#
+# $Id: plugin.properties,v 1.1 2006/07/20 19:31:24 cbateman Exp $
+
+# ====================================================================
+# To code developer:
+#   Do NOT change the properties between this line and the
+#   "%%% END OF TRANSLATED PROPERTIES %%%" line.
+#   Make a new property name, append to the end of the file and change
+#   the code to use the new property.
+# ====================================================================
+
+# ====================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# ====================================================================
+
+pluginName = My Tests
+providerName = www.example.org
+
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.xml b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.xml
new file mode 100644
index 0000000..d0bc80e
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ <copyright>
+ </copyright>
+
+ $Id: plugin.xml,v 1.1 2006/07/20 19:31:24 cbateman Exp $
+-->
+
+<plugin>
+</plugin>
+
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ContextSymbolTestPlugin.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ContextSymbolTestPlugin.java
new file mode 100644
index 0000000..7de7ff7
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ContextSymbolTestPlugin.java
@@ -0,0 +1,52 @@
+package org.eclipse.jst.jsf.context.symbol.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class ContextSymbolTestPlugin extends AbstractUIPlugin 
+{
+	/**
+	 * The plug-in ID
+	 */
+	public static final String PLUGIN_ID = "org.eclipse.jst.jsf.context.symbol.tests";
+
+	// The shared instance
+	private static ContextSymbolTestPlugin plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public ContextSymbolTestPlugin() {
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static ContextSymbolTestPlugin getDefault() {
+		return plugin;
+	}
+
+}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2.java
new file mode 100644
index 0000000..fb18e70
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2.java
@@ -0,0 +1,933 @@
+package org.eclipse.jst.jsf.context.symbol.tests;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
+import org.eclipse.jst.jsf.context.symbol.SymbolPackage;
+import org.eclipse.jst.jsf.context.symbol.internal.provisional.IBeanInstanceSymbol;
+import org.eclipse.jst.jsf.context.symbol.internal.provisional.IBeanMethodSymbol;
+import org.eclipse.jst.jsf.context.symbol.internal.provisional.IBeanPropertySymbol;
+import org.eclipse.jst.jsf.context.symbol.internal.provisional.IJavaTypeDescriptor2;
+import org.eclipse.jst.jsf.core.tests.TestsPlugin;
+import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
+import org.eclipse.jst.jsf.test.util.JavaCodeResource;
+import org.eclipse.jst.jsf.test.util.ProjectTestEnvironment;
+import org.osgi.framework.Bundle;
+
+/**
+ * Test the IJavaTypeDescriptor
+ * 
+ * @author cbateman
+ *
+ */
+public class TestIJavaTypeDescriptor2 extends TestCase 
+{
+    private JDTTestEnvironment      _jdtTestEnvironment;
+    private Map                     _beanProperties;
+    private Map                     _beanSubclassProperties;
+    private Map                     _beanMethods;
+    private Map                     _beanMethodsSubclass;     
+    
+    private IBeanInstanceSymbol     _testBean1Symbol;
+    private IBeanInstanceSymbol     _testBean1SubclassSymbol;
+    private IBeanInstanceSymbol     _testBean2Symbol;
+    private IBeanInstanceSymbol     _testBean2SubclassSymbol;
+    
+    private final static String srcFolderName = "src";
+    private final static String packageName1 = "com.test";
+    private final static String testBeanName1 = "TestBean1";
+    private final static String testBeanSubclass1 = "TestBean1Subclass";
+    private final static String testBeanName2 = "TestBean2";
+    private final static String testBean2Subclass = "TestBean2Subclass";
+
+    private final static String overloadedMethodName = "overloadedMethod";
+    
+    protected void setUp() throws Exception 
+    {
+        super.setUp();
+        final ProjectTestEnvironment  projectTestEnvironment = 
+            new ProjectTestEnvironment("TestJDTBeanIntrospectorProject");
+        projectTestEnvironment.createProject();
+        
+        _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
+
+        // load ITestBean2 first due to later dependencies
+        loadSourceClass(ContextSymbolTestPlugin.getDefault().getBundle(), "/testdata/ITestBean2.java.data", "ITestBean2");
+        assertNotNull(_jdtTestEnvironment.getJavaProject().findType(packageName1+"."+"ITestBean2"));
+        
+        // load another bean first since others have a dependency on on it
+        loadSourceClass(TestsPlugin.getDefault().getBundle(), "/testfiles/AnotherBean.java.data", "AnotherBean");
+        assertNotNull(_jdtTestEnvironment.getJavaProject().findType(packageName1+"."+"AnotherBean"));
+        
+        _beanProperties = new HashMap();
+        _testBean1Symbol =
+            setupBeanProperty("/testfiles/TestBean1.java.data", testBeanName1, _beanProperties);
+        
+        _beanSubclassProperties = new HashMap();
+        _testBean1SubclassSymbol =
+            setupBeanProperty("/testfiles/TestBean1Subclass.java.data", testBeanSubclass1, _beanSubclassProperties);
+
+        _beanMethods = new HashMap();
+        _testBean2Symbol = 
+            setupBeanMethods("/testdata/TestBean2.java.data", testBeanName2, _beanMethods);
+
+        _beanMethodsSubclass = new HashMap();
+        _testBean2SubclassSymbol = 
+            setupBeanMethods("/testdata/TestBean2Subclass.java.data", testBean2Subclass, _beanMethodsSubclass);
+    }
+    
+
+    private IBeanInstanceSymbol setupBeanProperty(String fileName, String beanClassName, Map properties) throws Exception
+    {
+        loadSourceClass(TestsPlugin.getDefault().getBundle(), fileName, beanClassName);
+        
+        final IType testBean1Type = 
+            _jdtTestEnvironment.getJavaProject().findType(packageName1+"."+beanClassName);
+        assertNotNull(testBean1Type);
+        
+        final IJavaTypeDescriptor2 testBeanDescriptor = 
+            SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
+        testBeanDescriptor.setType(testBean1Type);
+        
+        IBeanInstanceSymbol  bean = 
+            SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
+        bean.setTypeDescriptor(testBeanDescriptor);
+        bean.setName(beanClassName);
+        List propertyList = bean.getProperties();
+        for(final Iterator it = propertyList.iterator(); it.hasNext();)
+        {
+            final IBeanPropertySymbol  property = 
+                (IBeanPropertySymbol) it.next();
+            properties.put(property.getName(), property);
+        }
+        
+        return bean;
+    }
+    
+    private void loadSourceClass(final Bundle bundle, final String fileName, final String beanClassName) throws Exception
+    {
+        JavaCodeResource codeRes = new JavaCodeResource();
+        codeRes.load(bundle, fileName);
+        String code = codeRes.getCode();
+        _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1, beanClassName, code);
+    }
+    
+    private IBeanInstanceSymbol setupBeanMethods(String fileName, String beanClassName, Map methods) throws Exception
+    {
+        loadSourceClass(ContextSymbolTestPlugin.getDefault().getBundle(), fileName, beanClassName);
+
+        final IType testBean1Type = 
+            _jdtTestEnvironment.getJavaProject().findType(packageName1+"."+beanClassName);
+        assertNotNull(testBean1Type);
+        
+        final IJavaTypeDescriptor2 testBeanDescriptor = 
+            SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
+        testBeanDescriptor.setType(testBean1Type);
+        
+        IBeanInstanceSymbol  bean = 
+            SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
+        bean.setTypeDescriptor(testBeanDescriptor);
+        bean.setName(beanClassName);
+        List methodList = bean.getMethods();
+        for(final Iterator it = methodList.iterator(); it.hasNext();)
+        {
+            final IBeanMethodSymbol  method = (IBeanMethodSymbol) it.next();
+
+            // exclude the overloaded methods as these are handled separately
+            if (!overloadedMethodName.equals(method.getName()))
+            {
+                methods.put(method.getName(), method);
+            }
+        }
+        
+        return bean;
+    }
+    
+    /**
+     * Basic high-level sanity check on the generate properties map
+     */
+    public void testMapSanity()
+    {
+        assertEquals("Check extra or missing properties",_beanProperties.size(), 12);
+        assertEquals("Check extra or missing properties",_beanSubclassProperties.size(), 13);
+        assertEquals("Check extra or missing methods",_beanMethods.size(), 5);
+        assertEquals("Check extra or missing methods",_beanMethodsSubclass.size(), 6);
+    }
+    
+    /**
+     * 
+     */
+    public void testStringProp1()
+    {
+        testStringProp1(_beanProperties);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testStringProp1SubClass()
+    {
+        testStringProp1(_beanSubclassProperties);
+    }
+    
+    /**
+     * @param properties
+     */
+    private void testStringProp1(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("stringProp1");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertTrue(property.isWritable());
+        assertEquals("Signature must be for a String", 
+                        "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * test property
+     */
+    public void testBooleanIsProp1()
+    {
+        testBooleanIsProp1(_beanProperties);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testBooleanIsProp1SubClass()
+    {
+        testBooleanIsProp1(_beanSubclassProperties);
+    }
+
+    
+    /**
+     * @param properties
+     */
+    private void testBooleanIsProp1(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("booleanIsProp1");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertTrue(property.isWritable());
+        assertEquals("Signature must be for a boolean", 
+                        Signature.SIG_BOOLEAN, property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testBooleanIsProp2()
+    {
+        testBooleanIsProp2(_beanProperties);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testBooleanIsProp2SubClass()
+    {
+        testBooleanIsProp2(_beanSubclassProperties);
+    }
+    
+    /**
+     * @param properties
+     */
+    private void testBooleanIsProp2(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("booleanIsProp2");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertTrue(property.isWritable());
+        assertEquals("Signature must be for a boolean", 
+                        Signature.SIG_BOOLEAN, property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testNotBooleanIsProp1()
+    {
+        testNotBooleanIsProp1(_beanProperties);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testNotBooleanIsProp1SubClass()
+    {
+        testNotBooleanIsProp1(_beanSubclassProperties);
+    }
+
+    /**
+     * 
+     */
+    private void testNotBooleanIsProp1(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("notBooleanIsProp1");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertTrue(property.isWritable());
+        assertEquals("Signature must be for a boolean", 
+                        Signature.SIG_BOOLEAN, property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testStringProperty2()
+    {
+        testStringProperty2(_beanProperties);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testStringProperty2SubClass()
+    {
+        testStringProperty2(_beanSubclassProperties);
+    }
+    
+    /**
+     * 
+     */
+    private void testStringProperty2(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("stringProperty2");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertFalse("No setter for this property", property.isWritable());
+        assertEquals("Signature must be for a String", 
+                        "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testReadonlyStringProperty()
+    {
+        testReadonlyStringProperty(_beanProperties);
+    }
+    
+    /**
+     * test inhertied
+     */
+    public void testReadonlyStringPropertySubClass()
+    {
+        testReadonlyStringProperty(_beanSubclassProperties);
+    }
+    
+    
+    /**
+     * 
+     */
+    private void testReadonlyStringProperty(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("readonlyStringProperty");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertFalse("No setter for this property", property.isWritable());
+        assertEquals("Signature must be for a String", 
+                        "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testReadonlyBooleanProperty()
+    {
+        testReadonlyBooleanProperty(_beanProperties);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testReadonlyBooleanPropertySubClass()
+    {
+        testReadonlyBooleanProperty(_beanSubclassProperties);
+    }
+    
+    /**
+     * 
+     */
+    private void testReadonlyBooleanProperty(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("readonlyBooleanProperty");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertFalse("No setter for this property", property.isWritable());
+        assertEquals("Signature must be for a boolean", 
+                        Signature.SIG_BOOLEAN, property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testStringArrayProperty()
+    {
+        testStringArrayProperty(_beanProperties);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testStringArrayPropertySubClass()
+    {
+        testStringArrayProperty(_beanSubclassProperties);
+    }
+    
+    /**
+     * 
+     */
+    private void testStringArrayProperty(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("stringArrayProperty");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertTrue(property.isWritable());
+        assertEquals("Signature must be for a String[]", 
+                "[Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
+    }
+
+    /**
+     * 
+     */
+    public void testCollectionProperty()
+    {
+        testCollectionProperty(_beanProperties);
+    }
+    
+    /**
+     * test inhertited
+     */
+    public void testCollectionPropertySubClass()
+    {
+        testCollectionProperty(_beanSubclassProperties);
+    }
+    
+    /**
+     * 
+     */
+    private void testCollectionProperty(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("collectionProperty");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertTrue(property.isWritable());
+        assertEquals("Signature must be for a Collection", 
+                "Ljava.util.Collection;", property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testMapProperty()
+    {
+        testMapProperty(_beanProperties);
+    }
+
+    /**
+     * test inherited
+     */
+    public void testMapPropertySubClass()
+    {
+        testMapProperty(_beanProperties);
+    }
+
+    /**
+     * 
+     */
+    private void testMapProperty(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("mapProperty");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertTrue(property.isWritable());
+        assertEquals("Signature must be for a Map", 
+                "Ljava.util.Map;", property.getTypeDescriptor().getTypeSignature());
+    }
+
+    /**
+     * 
+     */
+    public void testWriteonlyStringProperty()
+    {
+        testWriteonlyStringProperty(_beanProperties);
+    }
+    
+    /**
+     * inherited
+     */
+    public void testWriteonlyStringPropertySubClass()
+    {
+        testWriteonlyStringProperty(_beanSubclassProperties);
+    }
+    
+    /**
+     * 
+     */
+    private void testWriteonlyStringProperty(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("writeonlyStringProperty");
+        assertNotNull(property);
+        
+        assertFalse("No getter for this property", property.isReadable());
+        assertTrue(property.isWritable());
+        assertEquals("Signature must be for a String", 
+                "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
+    }
+    
+    /**
+     * test a locally defined bean type
+     */
+    public void testAnotherBean()
+    {
+        testAnotherBean(_beanProperties);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testAnotherBeanSubClass()
+    {
+        testAnotherBean(_beanSubclassProperties);
+    }
+
+    private void testAnotherBean(Map properties)
+    {
+        IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("anotherBean");
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        assertTrue("No setter for this property",property.isWritable());
+        assertEquals("Signature must be for a com.test.AnotherBean", 
+                "Lcom.test.AnotherBean;", property.getTypeDescriptor().getTypeSignature());
+    }
+
+    /**
+     * Test bean.anotherBean.property for TestBean1
+     */
+    public void testPropertyOfProperty()
+    {
+        testPropertyOfProperty(_beanProperties);
+    }
+    
+    /**
+     * Test in inherited anotherBean property
+     */
+    public void testPropertyOfPropertyInSubclass()
+    {
+        testPropertyOfProperty(_beanSubclassProperties);
+    }
+    
+    private void testPropertyOfProperty(Map properties)
+    {
+        final IBeanPropertySymbol  property = 
+            (IBeanPropertySymbol) properties.get("anotherBean");
+        assertNotNull(property);
+
+        boolean foundNestedProperty = false;
+        
+        final List anotherBeanProps =
+            property.getTypeDescriptor().getProperties();
+        assertTrue("The nested properties has properties", anotherBeanProps.size()>0);
+
+        SEARCH_FOR_NESTED_PROPERTY:for 
+            (final Iterator it = anotherBeanProps.iterator(); it.hasNext();)
+        {
+            final IBeanPropertySymbol nestedProp = (IBeanPropertySymbol) it.next();
+            
+            // looking for a property of AnotherBean called property
+            if ("property".equals(nestedProp.getName()))
+            {
+                foundNestedProperty = true;
+                break SEARCH_FOR_NESTED_PROPERTY;
+            }
+        }
+        
+        assertTrue(foundNestedProperty);
+    }
+    
+    /**
+     * Test a property that's in the sub-class but not the parent
+     */
+    public void testSubclassOnly()
+    {
+        final String inheritedPropertyName = "locallyDefinedProperty";
+        
+        // ensure we didn't some how put an inherited property into the
+        // parent
+        assertNull(_beanProperties.get(inheritedPropertyName));
+        IBeanPropertySymbol property = (IBeanPropertySymbol) _beanSubclassProperties.get(inheritedPropertyName);
+        assertNotNull(property);
+        
+        assertTrue(property.isReadable());
+        // no setter
+        assertFalse(property.isWritable());
+        assertEquals("Signature must be for a String", 
+                "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
+    }
+    
+/* ------ Method signature testing -----------------------*/
+    
+    /**
+     * test no arg boolean method
+     */
+    public void testABooleanMethodWithNoArgs()
+    {
+        testABooleanMethodWithNoArgs(_beanMethods);
+    }
+    
+    /**
+     * test inherited no arg boolean method
+     */
+    public void testABooleanMethodWithNoArgsSubclass()
+    {
+        testABooleanMethodWithNoArgs(_beanMethodsSubclass);
+    }
+    
+    
+    /**
+     * 
+     */
+    private void testABooleanMethodWithNoArgs(Map properties)
+    {
+        IBeanMethodSymbol  method = 
+            (IBeanMethodSymbol) properties.get("aBooleanMethodWithNoArgs");
+        
+        assertEquals("()"+Signature.SIG_BOOLEAN,
+                        method.getSignature());
+    }
+    
+    /**
+     * test no args string method
+     */
+    public void testAStringMethodWithNoArgs()
+    {
+        testAStringMethodWithNoArgs(_beanMethods);
+    }
+    
+    /**
+     * test inherited no args string method
+     */
+    public void testAStringMethodWithNoArgsSubclass()
+    {
+        testAStringMethodWithNoArgs(_beanMethodsSubclass);
+    }
+    
+    /**
+     * 
+     */
+    private void testAStringMethodWithNoArgs(Map properties)
+    {
+        IBeanMethodSymbol  method = 
+            (IBeanMethodSymbol) properties.get("aStringMethodWithNoArgs");
+        
+        assertEquals("()Ljava.lang.String;",
+                        method.getSignature());
+    }
+    
+    /**
+     * test is accessor method
+     */
+    public void testIsAnIsAccessor()
+    {
+        testIsAnIsAccessor(_beanMethods);
+    }
+    
+    /**
+     * test inherited
+     */
+    public void testIsAnIsAccessorSubclass()
+    {
+        testIsAnIsAccessor(_beanMethodsSubclass);
+    }
+    
+    /**
+     * 
+     */
+    private void testIsAnIsAccessor(Map properties)
+    {
+        IBeanMethodSymbol  method = 
+            (IBeanMethodSymbol) properties.get("isAnIsAccessor");
+        
+        assertEquals("()Z",
+                        method.getSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testAIntegerMethodThatTakesAString()
+    {
+        testAIntegerMethodThatTakesAString(_beanMethods);
+    }
+    
+    /**
+     * inherited
+     */
+    public void testAIntegerMethodThatTakesAStringSubclass()
+    {
+        testAIntegerMethodThatTakesAString(_beanMethodsSubclass);
+    }
+    
+    /**
+     * 
+     */
+    private void testAIntegerMethodThatTakesAString(Map properties)
+    {
+        IBeanMethodSymbol  method = 
+            (IBeanMethodSymbol) properties.get("aIntegerMethodThatTakesAString");
+        
+        assertEquals("(Ljava.lang.String;)"+Signature.SIG_INT,
+                        method.getSignature());
+    }
+    
+    /**
+     * 
+     */
+    public void testAIntegerMethodThatTakesAStringAndLong()
+    {
+        testAIntegerMethodThatTakesAStringAndLong(_beanMethods);
+    }
+    
+    /**
+     * inherited
+     */
+    public void testAIntegerMethodThatTakesAStringAndLongSubclass()
+    {
+        testAIntegerMethodThatTakesAStringAndLong(_beanMethodsSubclass);
+    }
+    
+    /**
+     * @param arg1
+     * @param arg2
+     */
+    private void testAIntegerMethodThatTakesAStringAndLong(Map properties)
+    {
+        IBeanMethodSymbol  method = 
+            (IBeanMethodSymbol) properties.get("aIntegerMethodThatTakesAStringAndLong");
+        
+        assertEquals("(Ljava.lang.String;Ljava.lang.Long;)"+Signature.SIG_INT,
+                        method.getSignature());
+    }
+
+    /**
+     * test that the overloaded methods are both there
+     */
+    public void testOverloadedMethod()
+    {
+        testOverloadedMethod(_testBean2Symbol);
+    }
+    
+    /**
+     * test the inherited
+     */
+    public void testOverloadedMethodSubclass()
+    {
+        testOverloadedMethod(_testBean2SubclassSymbol);
+    }
+    
+    private void testOverloadedMethod(IBeanInstanceSymbol bean)
+    {
+        final String intMethodSignature =
+            "("+Signature.SIG_INT+")"+Signature.SIG_VOID;
+        final String stringMethodSignature =
+            "(Ljava.lang.String;)V";
+        
+        boolean   foundIntOverload = false;
+        boolean   foundStringOverload = false;
+        
+        for (final Iterator it = bean.getTypeDescriptor().getMethods().iterator();
+                it.hasNext();)
+        {
+            final IBeanMethodSymbol method = (IBeanMethodSymbol) it.next();
+            if (overloadedMethodName.equals(method.getName()))
+            {
+                final String typeSignature = method.getSignature();
+                
+                if (intMethodSignature.equals(typeSignature))
+                {
+                    foundIntOverload = true;
+                }
+                else if (stringMethodSignature.equals(typeSignature))
+                {
+                    foundStringOverload = true;
+                }
+            }
+        }
+        
+        assertTrue(foundIntOverload && foundStringOverload);
+    }
+    
+    /**
+     * Test method signature that is only in the sub-class, not in the parent
+     */
+    public void testMethodSubclassOnly()
+    {
+        assertNull(_beanMethods.get("validate"));
+        
+        IBeanMethodSymbol  method = 
+            (IBeanMethodSymbol) _beanMethodsSubclass.get("validate");
+        assertNotNull(method);
+        assertEquals("(Lcom.test.TestBean2;)"+Signature.SIG_VOID,
+                        method.getSignature());
+    }
+
+/* ------ test acquisition of super-classes and interfaces -----------------------*/
+    /**
+     * Test correct super class acquistion
+     */
+    public void testSuperClassAcquisition()
+    {
+        // TestBean1
+        List superSigs =
+            _testBean1Symbol.getTypeDescriptor().getSuperTypeSignatures();
+        
+        // should only have java.lang.Object as a super
+        assertEquals(superSigs.size(), 1);
+        assertEquals("Ljava.lang.Object;", (String)superSigs.get(0));
+        
+        // TestBean1Subclass
+        superSigs = 
+            _testBean1SubclassSymbol.getTypeDescriptor().getSuperTypeSignatures();
+        
+        // should have Object and TestBean1 as parents
+        assertEquals(superSigs.size(), 2);
+        assertTrue(superSigs.contains("Ljava.lang.Object;"));
+        assertTrue(superSigs.contains("Lcom.test.TestBean1;"));
+        
+        // TestBean2
+        superSigs =
+            _testBean2Symbol.getTypeDescriptor().getSuperTypeSignatures();
+        
+        // should only have java.lang.Object as a super
+        assertEquals(superSigs.size(), 1);
+        assertEquals("Ljava.lang.Object;", (String)superSigs.get(0));
+
+        // TestBean2Subclass
+        superSigs =
+            _testBean2SubclassSymbol.getTypeDescriptor().getSuperTypeSignatures();
+        // should have Object and TestBean2 as parents
+        assertEquals(superSigs.size(), 2);
+        assertTrue(superSigs.contains("Ljava.lang.Object;"));
+        assertTrue(superSigs.contains("Lcom.test.TestBean2;"));
+
+    }
+    
+    /**
+     * Test the acquisition of the interface implemented on TestBean2 and its subclass
+     */
+    public void testInterfaceAcquisition()
+    {
+        // TestBean2
+        List superSigs =
+            _testBean2Symbol.getTypeDescriptor().getInterfaceTypeSignatures();
+        
+        // should only have ITestBean2
+        assertEquals(superSigs.size(), 1);
+        assertEquals("Lcom.test.ITestBean2;", (String)superSigs.get(0));
+
+        // TestBean2Subclass
+        superSigs =
+            _testBean2SubclassSymbol.getTypeDescriptor().getInterfaceTypeSignatures();
+        // should only have ITestBean2
+        assertEquals(superSigs.size(), 1);
+        assertEquals("Lcom.test.ITestBean2;", (String)superSigs.get(0));
+    }
+    
+// coverage of EObject generated methods
+    
+    /**
+     * Cover isSet
+     */
+    public void testIsESet()
+    {
+        IType testBean1Type = null;
+        
+        try
+        {
+            testBean1Type =
+                _jdtTestEnvironment.getJavaProject().
+                    findType(packageName1+"."+testBeanName1);
+        }
+        catch (JavaModelException jme)
+        {
+            fail(jme.getLocalizedMessage());
+        }
+        
+        assertNotNull(testBean1Type);
+
+        IJavaTypeDescriptor2  desc =
+            SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
+        
+        // there are methods and one property on TestBean2
+        assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties()));
+        assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods()));
+        assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIBeanInstanceSymbol_JavaTypeDescriptor()));
+        
+        desc.eSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties(), 
+                  _testBean2Symbol.getJavaTypeDescriptor().getBeanProperties());
+        desc.eSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods(), 
+                  _testBean2Symbol.getJavaTypeDescriptor().getBeanMethods());
+        desc.eSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type(),
+                  testBean1Type);
+        
+        assertFalse(((List)desc.eGet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties())).size() 
+                   == 0);
+        assertFalse(((List)desc.eGet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods())).size()
+                   == 0);
+        assertEquals(desc.eGet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type()),
+                testBean1Type);
+       
+        assertTrue(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties()));
+        assertTrue(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods()));
+        assertTrue(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type()));
+        
+        desc.eUnset(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties());
+        desc.eUnset(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods());
+        desc.eUnset(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type());
+        
+        // there are methods and one property on TestBean2
+        assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties()));
+        assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods()));
+        assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type()));
+    }
+    
+    /**
+     * Cover the toString
+     */
+    public void testToString()
+    {
+        _testBean2Symbol.getTypeDescriptor().toString();
+    }
+}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/ITestBean2.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/ITestBean2.java.data
new file mode 100644
index 0000000..e837d65
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/ITestBean2.java.data
@@ -0,0 +1,5 @@
+package com.test;
+
+public interface ITestBean2
+{
+}
\ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2.java.data
new file mode 100644
index 0000000..34d25e9
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2.java.data
@@ -0,0 +1,37 @@
+package com.test
+
+public class TestBean2 implements ITestBean2
+{
+	public boolean aBooleanMethodWithNoArgs()
+	{
+		return false;
+	}
+	
+	public String aStringMethodWithNoArgs()
+	{
+		return true;
+	}
+	
+	public boolean isAnIsAccessor()
+	{
+		return false;
+	}
+	
+	public int aIntegerMethodThatTakesAString(String arg)
+	{
+		return -1;
+	}
+	
+	public int aIntegerMethodThatTakesAStringAndLong(String arg1, Long arg2)
+	{
+	     return -1;
+	}
+	
+	public void overloadedMethod(int a)
+	{
+	}
+	
+	public void overloadedMethod(String a)
+	{
+	}
+}
\ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2Subclass.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2Subclass.java.data
new file mode 100644
index 0000000..cbe2224
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2Subclass.java.data
@@ -0,0 +1,8 @@
+package com.test
+
+public class TestBean2Subclass extends TestBean2
+{
+	public void validate(TestBean2 parentBean)
+	{
+	}
+}
\ No newline at end of file
