Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[stp-dev] patch for bug 170421

hi,

For class type attributes of an annotation, we can use TypeLiteral
as the value of a MemberValuePair for a NormalAnnotation and easily
support editing and synchronizating class type attrbutes of an annotation.

For array type attributes, we have to use hierarchical structure to store
values for different elements of an array. We have to support adding and
removing element of an array.

All above two features are added to the annotation view.

Please find attached the patch file.

regards,

frank
### Eclipse Workspace Patch 1.0
#P org.eclipse.stp.common
Index: src/org/eclipse/stp/common/utils/JDTUtils.java
===================================================================
RCS file: /cvsroot/stp/org.eclipse.stp.servicecreation/org.eclipse.stp.common/src/org/eclipse/stp/common/utils/JDTUtils.java,v
retrieving revision 1.3
diff -u -r1.3 JDTUtils.java
--- src/org/eclipse/stp/common/utils/JDTUtils.java	25 Dec 2006 05:57:37 -0000	1.3
+++ src/org/eclipse/stp/common/utils/JDTUtils.java	15 Jan 2007 07:52:52 -0000
@@ -18,7 +18,6 @@
 import java.util.List;
 import java.util.StringTokenizer;
 
-
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
@@ -43,6 +42,7 @@
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.dom.AST;
 import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.TypeLiteral;
 import org.eclipse.jdt.core.dom.ASTParser;
 import org.eclipse.jdt.core.dom.Annotation;
 import org.eclipse.jdt.core.dom.ArrayInitializer;
@@ -65,7 +65,6 @@
 import org.eclipse.jdt.core.dom.StringLiteral;
 import org.eclipse.jdt.core.dom.Type;
 import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.TypeLiteral;
 import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
 import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
 import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
@@ -791,29 +790,30 @@
                     value = ast.newPrimitiveType(pType.getPrimitiveTypeCode());
                 }
             } else if (type.isQualifiedType()) {
-                value = ast.newQualifiedType(type, ast.newSimpleName(name));
+            	// comment out by frank
+                // value = ast.newQualifiedType(type, ast.newSimpleName(name));
             } else if (type.isSimpleType()) {
-                SimpleType st = (SimpleType)type;
-                SimpleName sName = ast.newSimpleName(st.getName().getFullyQualifiedName());
-                value = ast.newSimpleType(sName);
+            	// comment out by frank
+                // SimpleType st = (SimpleType)type;
+                // SimpleName sName = ast.newSimpleName(st.getName().getFullyQualifiedName());
+                // value = ast.newSimpleType(sName);
             }
 
             tl.setType((Type)value);
             exp = tl;
         } else if (value.getClass().isArray()) {
             //StringArray
-            String[] strings = (String[])value;
-            ArrayInitializer arrayInit = ast.newArrayInitializer();
-            List expList = arrayInit.expressions();
-
-            for (String str : strings) {
-                StringLiteral sl = ast.newStringLiteral();
-                sl.setLiteralValue(str);
-                expList.add(sl);
-            }
+       		String[] strings = (String[])value;
+       		ArrayInitializer arrayInit = ast.newArrayInitializer();
+       		List expList = arrayInit.expressions();
+
+       		for (String str : strings) {
+       			StringLiteral sl = ast.newStringLiteral();
+       			sl.setLiteralValue(str);
+       			expList.add(sl);
+       		}
 
-            exp = arrayInit;
-        
+       		exp = arrayInit;
         } else if (value.getClass().isEnum()) {
             LOG.debug("handling enum attribute");
 
@@ -835,6 +835,27 @@
 
             enumName = ast.newQualifiedName(enumName, ast.newSimpleName(value.toString()));
             exp = enumName;
+        } else if (value instanceof Class) {
+            LOG.debug("handling class attribute");
+
+            String classCanonicalName = ((Class)value).getCanonicalName();
+            int previousIndex = -1;
+            int nextIndex = classCanonicalName.indexOf('.');
+            Type theType = ast.newSimpleType(ast.newSimpleName(classCanonicalName.substring(1 + previousIndex, nextIndex)));
+            previousIndex = nextIndex;
+            nextIndex = classCanonicalName.indexOf('.', previousIndex + 1);
+            while (nextIndex != -1) {
+                String substring = classCanonicalName.substring(1 + previousIndex, nextIndex);
+                theType = ast.newQualifiedType(theType, ast.newSimpleName(substring));
+                previousIndex = nextIndex;
+                nextIndex = classCanonicalName.indexOf('.', previousIndex + 1);
+            }
+            String substring = classCanonicalName.substring(1 + previousIndex);
+            theType = ast.newQualifiedType(theType, ast.newSimpleName(substring));
+
+            TypeLiteral typeLiteral = ast.newTypeLiteral();
+            typeLiteral.setType(theType);
+            exp = typeLiteral;
         }
 
         valPair.setValue(exp);
@@ -934,11 +955,39 @@
         return null;
     }
 
-    
+    public static void removeAnnotationOnField(CompilationUnit compilationUnitAstNode,
+                                               Annotation annotationNode,
+                                               IField field,
+                                               ASTRewrite rewrite) {
 
-    
+    	IType type = field.getDeclaringType();
 
-    
+        for (Iterator it = compilationUnitAstNode.types().iterator(); it.hasNext();) {
+            TypeDeclaration t = (TypeDeclaration)it.next();
+
+            if (t.getName().getIdentifier().equals(type.getElementName())) {
+                FieldDeclaration[] fields = t.getFields();
+                String fieldName = field.getElementName();
+
+                for (int inx = 0; inx < fields.length; inx++) {
+                	for (Object obj : fields[inx].fragments()) {
+                		VariableDeclarationFragment var = (VariableDeclarationFragment)obj;
+                		if (var.getName().getFullyQualifiedName().equals(fieldName)) {
+                            ListRewrite lrw2 = rewrite.getListRewrite((ASTNode)fields[inx],
+                                                                      FieldDeclaration.MODIFIERS2_PROPERTY);
+                            Annotation annot = findAnnotation(lrw2.getOriginalList(), annotationNode);
+                            
+                            if (annot != null) {
+                            	lrw2.remove(annot, null);
+                            }
+                		}
+
+                	}
+                }
+            }
+        }
+    	
+    }
 
     public static void removeAnnotationOnMethod(CompilationUnit compilationUnitAstNode,
                                                 Annotation annotationNode,
@@ -1155,10 +1204,9 @@
         while (iter.hasNext()) {
             Annotation currentAnnotationNode = iter.next();
             if (member instanceof IField) {
-                // TODO
-                throw new UnsupportedOperationException("removal of annotation from a fields needs to be"
-                                                        + " implemented");
-                //removeAnnotationOnField(astRoot, currentAnnotation, (IField)member, rewrite);
+                removeAnnotationOnField(compilationUnitAstNode,
+                                        currentAnnotationNode,
+                                        (IField)member, rewrite);
         
             } else if (methodParam != null) {
                 removeAnnotationOnMethodParam(compilationUnitAstNode,
#P org.eclipse.stp.sc.jaxws.test
Index: src/org/eclipse/stp/sc/jaxws/views/AnnotationViewTest.java
===================================================================
RCS file: /cvsroot/stp/org.eclipse.stp.servicecreation/org.eclipse.stp.sc.jaxws.test/src/org/eclipse/stp/sc/jaxws/views/AnnotationViewTest.java,v
retrieving revision 1.7
diff -u -r1.7 AnnotationViewTest.java
--- src/org/eclipse/stp/sc/jaxws/views/AnnotationViewTest.java	25 Dec 2006 06:37:08 -0000	1.7
+++ src/org/eclipse/stp/sc/jaxws/views/AnnotationViewTest.java	15 Jan 2007 07:53:48 -0000
@@ -29,7 +29,7 @@
 
 public class AnnotationViewTest extends TestCase {
 
-    private static final String ANNOTATION_VIEW_ID = "org.eclipse.stp.sc.jaxws.views.AnnotationView";
+    private static final String ANNOTATION_VIEW_ID = "org.eclipse.stp.sc.common.views.AnnotationView";
     private static final String TEST_PROJECT_NAME = "AnnotationViewTestProject";
     private static final String LOCAL_JAVA = "src/MyWebService.java";
     private static final String JAVA_RESOURCE = "/resources/MyWebService.java_resource";
@@ -85,7 +85,7 @@
     }
     
     public void testBasics() throws Exception {
-        theView.workbenchSelectionListener.selectionChanged(theEditor, new TextSelection(33, 0));
+        theView.workbenchSelectionListener.selectionChanged(theEditor, new TextSelection(22, 320));
         assertEquals(3, theView.annotationsviewer.getTree().getItemCount());
         assertEquals("Type : MyWebService --- MyWebService.java", theView.getContentDescription());
         
Index: src/org/eclipse/stp/sc/jaxws/utils/JaxWsAnnotationUtilsTest.java
===================================================================
RCS file: /cvsroot/stp/org.eclipse.stp.servicecreation/org.eclipse.stp.sc.jaxws.test/src/org/eclipse/stp/sc/jaxws/utils/JaxWsAnnotationUtilsTest.java,v
retrieving revision 1.11
diff -u -r1.11 JaxWsAnnotationUtilsTest.java
--- src/org/eclipse/stp/sc/jaxws/utils/JaxWsAnnotationUtilsTest.java	26 Dec 2006 10:22:03 -0000	1.11
+++ src/org/eclipse/stp/sc/jaxws/utils/JaxWsAnnotationUtilsTest.java	15 Jan 2007 07:53:44 -0000
@@ -99,7 +99,7 @@
     }
     
     public void testGetAvailableAnnotationsForType() throws Exception {
-        assertEquals(3, ScAnnotationSupportUtils.getAvailableAnnotationsForType(project).size());
+        assertEquals(3, ScAnnotationSupportUtils.getAvailableAnnotationsForClass(project).size());
     }
     
     public void testNewOneWayAnnotation() throws Exception {
Index: src/org/eclipse/stp/sc/jaxws/annotations/ScAnnotationSupportUtilsTest.java
===================================================================
RCS file: src/org/eclipse/stp/sc/jaxws/annotations/ScAnnotationSupportUtilsTest.java
diff -N src/org/eclipse/stp/sc/jaxws/annotations/ScAnnotationSupportUtilsTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/stp/sc/jaxws/annotations/ScAnnotationSupportUtilsTest.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,89 @@
+/*******************************************************************************
+* Copyright (c) 2006 IONA Technologies PLC
+* 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:
+*     IONA Technologies PLC - initial API and implementation
+*******************************************************************************/
+package org.eclipse.stp.sc.jaxws.annotations;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.stp.sc.common.annotations.ScAnnotationSupportUtils;
+import org.eclipse.stp.sc.jaxws.utils.TestUtilities;
+import org.eclipse.stp.sc.jaxws.workspace.JaxWsWorkspaceManager;
+
+import junit.framework.TestCase;
+
+/**
+ * @author ffan
+ *
+ */
+public class ScAnnotationSupportUtilsTest extends TestCase {
+
+	public static final String JAVA_PROJECT_NAME = "ScAnnotationSupportTest_JAVA";
+	public static final String JAXWS_PROJECT_NAME = "ScAnnotationSupportTest_JAXWS";
+	
+	IProject javaProject;
+	IProject jaxwsProject;
+	
+	protected void setUp() throws Exception {
+		super.setUp();
+		jaxwsProject = ResourcesPlugin.getWorkspace().getRoot()
+				.getProject(JAXWS_PROJECT_NAME);
+
+		if (!jaxwsProject.exists()) {
+			jaxwsProject = createJaxWsProject();
+		} else {
+			try {
+				jaxwsProject.open(null);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+
+		javaProject = TestUtilities.createTestCeltixProject(JAVA_PROJECT_NAME);
+	}
+	
+	protected void tearDown() throws Exception {
+		javaProject.delete(true, null);
+		jaxwsProject.delete(true, null);
+		super.tearDown();
+	}
+
+	private IProject createJaxWsProject() {
+		IProject newProject = JaxWsWorkspaceManager.createProject(null, JAXWS_PROJECT_NAME,
+				Platform.getLocation());
+		return newProject;
+	}
+	
+    public void testAnnotationForTypes() throws Exception {
+        List<Class> annoList;
+        annoList = ScAnnotationSupportUtils.getAvailableAnnotationsForClass(jaxwsProject);
+        assertTrue("should return 10 class annotaions for jax-ws project", annoList.size() == 10);
+        annoList = ScAnnotationSupportUtils.getAvailableAnnotationsForInterface(jaxwsProject);
+        assertTrue("should return 6 interface annotaions for jax-ws project", annoList.size() == 6);
+    }
+
+    public void testJavaAnnotationNature() throws Exception {
+        List<Class> annoList;
+        annoList = ScAnnotationSupportUtils.getAvailableAnnotationsForClass(javaProject);
+        assertTrue("should return no class annotation for java project", annoList.size() == 0);
+        annoList = ScAnnotationSupportUtils.getAvailableAnnotationsForInterface(javaProject);
+        assertTrue("should return no interface annotation for java project", annoList.size() == 0);
+    }
+    
+    public void testJaxWsAnnotationNature() throws Exception {
+        List<Class> annoList;
+        annoList = ScAnnotationSupportUtils.getAvailableAnnotationsForClass(jaxwsProject);
+        assertTrue("should return 10 class annotaions for jax-ws project", annoList.size() == 10);
+        annoList = ScAnnotationSupportUtils.getAvailableAnnotationsForInterface(jaxwsProject);
+        assertTrue("should return 6 interface annotaions for jax-ws project", annoList.size() == 6);
+    }
+}
Index: src/org/eclipse/stp/sc/jaxws/utils/JAXWSAnnotationInitializerTest.java
===================================================================
RCS file: src/org/eclipse/stp/sc/jaxws/utils/JAXWSAnnotationInitializerTest.java
diff -N src/org/eclipse/stp/sc/jaxws/utils/JAXWSAnnotationInitializerTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/stp/sc/jaxws/utils/JAXWSAnnotationInitializerTest.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,212 @@
+package org.eclipse.stp.sc.jaxws.utils;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IMethod;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.MemberValuePair;
+import org.eclipse.jdt.core.dom.ArrayInitializer;
+import org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.eclipse.jdt.core.dom.QualifiedType;
+import org.eclipse.jdt.core.dom.StringLiteral;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.TypeLiteral;
+
+import org.eclipse.stp.common.utils.JDTUtils;
+import org.eclipse.stp.sc.jaxws.tests.ScProjectBaseTest;
+import org.eclipse.stp.sc.jaxws.utils.ext.JAXWSAnnotationInitializer;
+import org.eclipse.stp.sc.common.annotations.ext.IAnnotationInitializer;
+
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.WebServiceRefs;
+
+
+import java.util.*;
+
+public class JAXWSAnnotationInitializerTest extends ScProjectBaseTest {
+
+	private static final String PROJECT_NAME = "JAXWSAnnotationInitializerTestProject";
+    
+    protected String[] projectFiles = new String[] {
+        "/src/com/iona/helloworld/HelloWorld.java"
+    };
+    
+    protected String[] resourceFiles = new String[] {
+        "/resources/HelloWorld.java_resource"
+    };
+    
+    private CompilationUnit astRoot = null;
+    private ICompilationUnit compilationUnit = null;
+    private IAnnotationInitializer initializer = null; 
+    
+    private IType jdtType = null;
+    private IField jdtField = null;
+    private IMethod jdtMethod = null;
+    
+	protected void setUp() throws Exception {
+		super.setUp();
+		initializer = new JAXWSAnnotationInitializer();
+		compilationUnit = JDTUtils.getJavaUnitFromFile(files[0]);
+        astRoot = JDTUtils.getDomRootCompilationUnit(JDTUtils.getJavaUnitFromFile(files[0]));        
+    	jdtType = (IType)compilationUnit.getElementAt(0x22);
+    	jdtField = (IField)compilationUnit.getElementAt(0x3e);
+    	jdtMethod = (IMethod)compilationUnit.getElementAt(0x67);
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    protected String getProjectName() {
+        return PROJECT_NAME;
+    }
+
+    protected String[] getProjectFiles() {
+        return projectFiles;
+    }
+
+    protected String[] getResourceFiles() {
+        return resourceFiles;
+    }
+    
+    public void testRequestWrapper() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(RequestWrapper.class, astRoot, jdtMethod, null);
+    	assertTrue(mvpList.size() == 3);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("className"));
+    	assertTrue(mvpList.get(1).getName().getIdentifier().equals("localName"));
+    	assertTrue(mvpList.get(2).getName().getIdentifier().equals("targetNamespace"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("com.iona.helloworld.SayHiRequest"));
+    	assertTrue(((StringLiteral)mvpList.get(1).getValue()).getLiteralValue().equals("SayHiRequest"));
+    	assertTrue(((StringLiteral)mvpList.get(2).getValue()).getLiteralValue().equals("http://helloworld.iona.com/";));
+    }
+
+    public void testResponseWrapper() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(ResponseWrapper.class, astRoot, jdtMethod, null);
+    	assertTrue(mvpList.size() == 3);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("className"));
+    	assertTrue(mvpList.get(1).getName().getIdentifier().equals("localName"));
+    	assertTrue(mvpList.get(2).getName().getIdentifier().equals("targetNamespace"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("com.iona.helloworld.SayHiResponse"));
+    	assertTrue(((StringLiteral)mvpList.get(1).getValue()).getLiteralValue().equals("SayHiResponse"));
+    	assertTrue(((StringLiteral)mvpList.get(2).getValue()).getLiteralValue().equals("http://helloworld.iona.com/";));
+    }
+
+    public void testServiceMode() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(ServiceMode.class, astRoot, jdtType, null);
+    	assertTrue(mvpList.size() == 1);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("value"));
+    	assertTrue(((QualifiedName)mvpList.get(0).getValue()).getFullyQualifiedName().equals("javax.xml.ws.Service.Mode.PAYLOAD"));
+    }
+
+    public void testWebFault() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(WebFault.class, astRoot, jdtType, null);
+    	assertTrue(mvpList.size() == 3);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("faultBean"));
+    	assertTrue(mvpList.get(1).getName().getIdentifier().equals("name"));
+    	assertTrue(mvpList.get(2).getName().getIdentifier().equals("targetNamespace"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("com.iona.helloworld.HelloWorldFaultBean"));
+    	assertTrue(((StringLiteral)mvpList.get(1).getValue()).getLiteralValue().equals("HelloWorldFault"));
+    	assertTrue(((StringLiteral)mvpList.get(2).getValue()).getLiteralValue().equals("http://helloworld.iona.com/";));
+    }
+
+    public void testWebServiceClient() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(WebServiceClient.class, astRoot, jdtType, null);
+    	assertTrue(mvpList.size() == 3);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("name"));
+    	assertTrue(mvpList.get(1).getName().getIdentifier().equals("targetNamespace"));
+    	assertTrue(mvpList.get(2).getName().getIdentifier().equals("wsdlLocation"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("com.iona.helloworld.HelloWorld"));
+    	assertTrue(((StringLiteral)mvpList.get(1).getValue()).getLiteralValue().equals("http://helloworld.iona.com/";));
+    	assertTrue(((StringLiteral)mvpList.get(2).getValue()).getLiteralValue().equals("http://helloworld.iona.com/helloworld.wsdl";));
+    }
+
+    public void testWebEndpoint() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(WebEndpoint.class, astRoot, jdtMethod, null);
+    	assertTrue(mvpList.size() == 1);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("name"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("HelloWorldHTTPPort"));
+    }
+
+    public void testWebServiceProvider() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(WebServiceProvider.class, astRoot, jdtType, null);
+    	assertTrue(mvpList.size() == 4);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("portName"));
+    	assertTrue(mvpList.get(1).getName().getIdentifier().equals("serviceName"));
+    	assertTrue(mvpList.get(2).getName().getIdentifier().equals("targetNamespace"));
+    	assertTrue(mvpList.get(3).getName().getIdentifier().equals("wsdlLocation"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("HelloWorldPort"));
+    	assertTrue(((StringLiteral)mvpList.get(1).getValue()).getLiteralValue().equals("HelloWorldService"));
+    	assertTrue(((StringLiteral)mvpList.get(2).getValue()).getLiteralValue().equals("http://helloworld.iona.com/";));
+    	assertTrue(((StringLiteral)mvpList.get(3).getValue()).getLiteralValue().equals("http://helloworld.iona.com/helloworld.wsdl";));
+    }
+
+    public void testBindingType() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(BindingType.class, astRoot, jdtType, null);
+    	assertTrue(mvpList.size() == 1);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("value"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("http://schemas.xmlsoap.org/wsdl/soap/http";));
+    }
+
+    public void testWebServiceRefType() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(WebServiceRef.class, astRoot, jdtType, null);
+    	assertTrue(mvpList.size() == 3);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("name"));
+    	assertTrue(mvpList.get(1).getName().getIdentifier().equals("type"));
+    	assertTrue(mvpList.get(2).getName().getIdentifier().equals("value"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("<specify name here>"));
+    	assertTrue(((QualifiedType)((TypeLiteral)mvpList.get(1).getValue()).getType()).getName().getFullyQualifiedName().equals("Object"));
+    	assertTrue(((QualifiedType)((TypeLiteral)mvpList.get(2).getValue()).getType()).getName().getFullyQualifiedName().equals("Object"));
+    }
+
+    public void testWebServiceRefField() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(WebServiceRef.class, astRoot, jdtField, null);
+    	assertTrue(mvpList.size() == 2);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("type"));
+    	assertTrue(mvpList.get(1).getName().getIdentifier().equals("value"));
+    	assertTrue(((QualifiedType)((TypeLiteral)mvpList.get(0).getValue()).getType()).getName().getFullyQualifiedName().equals("Object"));
+    	assertTrue(((QualifiedType)((TypeLiteral)mvpList.get(1).getValue()).getType()).getName().getFullyQualifiedName().equals("Object"));
+    }
+
+    public void testWebServiceRefMethod() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(WebServiceRef.class, astRoot, jdtMethod, null);
+    	assertTrue(mvpList.size() == 3);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("name"));
+    	assertTrue(mvpList.get(1).getName().getIdentifier().equals("type"));
+    	assertTrue(mvpList.get(2).getName().getIdentifier().equals("value"));
+    	assertTrue(((StringLiteral)mvpList.get(0).getValue()).getLiteralValue().equals("<specify name here>"));
+    	assertTrue(((QualifiedType)((TypeLiteral)mvpList.get(1).getValue()).getType()).getName().getFullyQualifiedName().equals("Object"));
+    	assertTrue(((QualifiedType)((TypeLiteral)mvpList.get(2).getValue()).getType()).getName().getFullyQualifiedName().equals("Object"));
+    }
+
+    public void testWebServiceRefs() throws Exception {
+    	List<MemberValuePair> mvpList = initializer.getDefaultAttributes(WebServiceRefs.class, astRoot, jdtType, null);
+    	assertTrue(mvpList.size() == 1);
+    	assertTrue(mvpList.get(0).getName().getIdentifier().equals("value"));
+    	ArrayInitializer arrayInit = ((ArrayInitializer)mvpList.get(0).getValue());
+    	List expList = arrayInit.expressions();
+    	for (Object obj : expList) {
+    		NormalAnnotation anno = (NormalAnnotation)obj;
+    		List pairList = anno.values();
+    		MemberValuePair mvp;
+    		mvp = (MemberValuePair)pairList.get(0);
+    		assertTrue(mvp.getName().getIdentifier().equals("name"));
+        	assertTrue(((StringLiteral)mvp.getValue()).getLiteralValue().equals("<specify name here>"));
+    		mvp = (MemberValuePair)pairList.get(1);
+    		assertTrue(mvp.getName().getIdentifier().equals("type"));
+        	assertTrue(((QualifiedType)((TypeLiteral)mvp.getValue()).getType()).getName().getFullyQualifiedName().equals("Object"));
+    		mvp = (MemberValuePair)pairList.get(2);
+    		assertTrue(mvp.getName().getIdentifier().equals("value"));
+        	assertTrue(((QualifiedType)((TypeLiteral)mvp.getValue()).getType()).getName().getFullyQualifiedName().equals("Object"));
+    	}
+    }
+}
Index: src/resources/HelloWorld.java_resource
===================================================================
RCS file: src/resources/HelloWorld.java_resource
diff -N src/resources/HelloWorld.java_resource
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/resources/HelloWorld.java_resource	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,9 @@
+
+package com.iona.helloworld;
+
+public class HelloWorld {
+	public String myName = "anonymous";
+    public void sayHi(String msg) {
+    	System.out.println(msg);
+    }
+}

Back to the top