Author: dazarov
Date: 2011-05-23 20:22:04 -0400 (Mon, 23 May 2011)
New Revision: 31440
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIClass.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIElement.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIInjectionPoint.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-8984
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2011-05-23
21:12:28 UTC (rev 31439)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -49,6 +49,10 @@
public void deploy(IQualifier qualifier){
page.deploy(qualifier);
}
+
+ public void remove(IQualifier qualifier){
+ page.remove(qualifier);
+ }
public boolean checkBeans(){
return page.checkBeans();
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2011-05-23
21:12:28 UTC (rev 31439)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -48,6 +48,10 @@
public void deploy(IQualifier qualifier){
composite.deploy(qualifier);
}
+
+ public void remove(IQualifier qualifier){
+ composite.remove(qualifier);
+ }
public boolean checkBeans(){
return composite.checkBeans();
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-05-23
21:12:28 UTC (rev 31439)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -662,6 +662,11 @@
moveAll(qualifiers, true);
}
+ public void remove(IQualifier qualifier){
+ IQualifier[] qualifiers = new IQualifier[]{qualifier};
+ moveAll(qualifiers, false);
+ }
+
public ArrayList<IQualifier> getAvailableQualifiers(){
return qualifiers;
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-05-23
21:12:28 UTC (rev 31439)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -19,6 +19,7 @@
import org.jboss.tools.cdi.ui.test.perspective.CDIPerspectiveTest;
import org.jboss.tools.cdi.ui.test.preferences.CDIPreferencePageTest;
import org.jboss.tools.cdi.ui.test.search.CDISearchParticipantTest;
+import org.jboss.tools.cdi.ui.test.wizard.AddQualifiersToBeanWizardTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIClassWizardFactoryTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIWizardTest;
@@ -45,6 +46,8 @@
suiteAll.addTestSuite(CATest.class);
suiteAll.addTest(new CDICoreTestSetup(suite));
+
+ suiteAll.addTestSuite(AddQualifiersToBeanWizardTest.class);
return suiteAll;
}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -0,0 +1,268 @@
+package org.jboss.tools.cdi.ui.test.testmodel;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IBeanMethod;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInterceptorBinding;
+import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
+import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.cdi.core.IProducer;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
+import org.jboss.tools.cdi.core.IScope;
+import org.jboss.tools.cdi.core.IScopeDeclaration;
+import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+import org.jboss.tools.cdi.core.ITypeDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
+
+public class CDIBean extends CDIElement implements IClassBean{
+ private ICDIProject project;
+ private HashSet<IQualifier> qualifiers;
+ private CDIClass cdiClass;
+
+ public CDIBean(ICDIProject project, String qualifiedName){
+ this.project = project;
+ qualifiers = new HashSet<IQualifier>();
+ IQualifier anyQualifier = project.getQualifier(CDIConstants.ANY_QUALIFIER_TYPE_NAME);
+ IQualifier defaultQualifier =
project.getQualifier(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME);
+ qualifiers.add(anyQualifier);
+ qualifiers.add(defaultQualifier);
+ cdiClass = new CDIClass(qualifiedName);
+ }
+
+ @Override
+ public IScope getScope() {
+ return null;
+ }
+
+ @Override
+ public Set<IScopeDeclaration> getScopeDeclarations() {
+ return null;
+ }
+
+ @Override
+ public Set<IStereotypeDeclaration> getStereotypeDeclarations() {
+ return null;
+ }
+
+ @Override
+ public List<IAnnotationDeclaration> getAnnotations() {
+ return null;
+ }
+
+ @Override
+ public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
+ return null;
+ }
+
+ @Override
+ public ITextSourceReference getAnnotationPosition(
+ String annotationTypeName) {
+ return null;
+ }
+
+ @Override
+ public boolean isAnnotationPresent(String annotationTypeName) {
+ return false;
+ }
+
+ @Override
+ public ICDIProject getCDIProject() {
+ return project;
+ }
+
+ @Override
+ public IPath getSourcePath() {
+ return null;
+ }
+
+ @Override
+ public IResource getResource() {
+ return null;
+ }
+
+ @Override
+ public IType getBeanClass() {
+ return cdiClass;
+ }
+
+ @Override
+ public String getName() {
+ return null;
+ }
+
+ @Override
+ public ITextSourceReference getNameLocation() {
+ return null;
+ }
+
+ @Override
+ public Set<IParametedType> getLegalTypes() {
+ return null;
+ }
+
+ @Override
+ public Set<IParametedType> getAllTypes() {
+ return null;
+ }
+
+ @Override
+ public String getSimpleJavaName() {
+ return null;
+ }
+
+ @Override
+ public Set<ITypeDeclaration> getAllTypeDeclarations() {
+ return null;
+ }
+
+ @Override
+ public Set<ITypeDeclaration> getRestrictedTypeDeclaratios() {
+ return null;
+ }
+
+ @Override
+ public Set<IQualifierDeclaration> getQualifierDeclarations() {
+ return null;
+ }
+
+ @Override
+ public Set<IQualifierDeclaration> getQualifierDeclarations(
+ boolean includeInherited) {
+ return null;
+ }
+
+ @Override
+ public Set<IQualifier> getQualifiers() {
+ return qualifiers;
+ }
+
+ @Override
+ public boolean isAlternative() {
+ return false;
+ }
+
+ @Override
+ public boolean isSelectedAlternative() {
+ return false;
+ }
+
+ @Override
+ public IAnnotationDeclaration getAlternativeDeclaration() {
+ return null;
+ }
+
+ @Override
+ public Set<IInjectionPoint> getInjectionPoints() {
+ return null;
+ }
+
+ @Override
+ public IBean getSpecializedBean() {
+ return null;
+ }
+
+ @Override
+ public IAnnotationDeclaration getSpecializesAnnotationDeclaration() {
+ return null;
+ }
+
+ @Override
+ public boolean isSpecializing() {
+ return false;
+ }
+
+ @Override
+ public boolean isDependent() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return false;
+ }
+
+ @Override
+ public boolean isNullable() {
+ return false;
+ }
+
+ @Override
+ public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations(
+ boolean includeInherited) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<IInterceptorBinding> getInterceptorBindings() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<IProducer> getProducers() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<IBeanMethod> getDisposers() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<IBeanMethod> getBeanConstructors() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<IBeanMethod> getAllMethods() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<IBeanMethod> getObserverMethods() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<? extends IClassBean> getSpecializingBeans() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IParametedType getSuperType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IClassBean getSuperClassBean() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setSuperClassBean(IClassBean bean) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIClass.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIClass.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIClass.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -0,0 +1,656 @@
+package org.jboss.tools.cdi.ui.test.testmodel;
+
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jdt.core.CompletionRequestor;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.ICompletionRequestor;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IInitializer;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IOpenable;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.ITypeParameter;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.IWorkingCopy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+
+public class CDIClass extends CDIElement implements IType {
+ private String qualifiedName;
+
+ public CDIClass(String qualifiedName){
+ this.qualifiedName = qualifiedName;
+ }
+
+ @Override
+ public String[] getCategories() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IClassFile getClassFile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ICompilationUnit getCompilationUnit() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IType getDeclaringType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getFlags() throws JavaModelException {
+ return ClassFileConstants.AccPublic;
+ }
+
+ @Override
+ public ISourceRange getJavadocRange() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getOccurrenceCount() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public ITypeRoot getTypeRoot() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IType getType(String name, int occurrenceCount) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isBinary() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean exists() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public IJavaElement getAncestor(int ancestorType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getAttachedJavadoc(IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IResource getCorrespondingResource() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getElementType() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public String getHandleIdentifier() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaModel getJavaModel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaProject getJavaProject() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IOpenable getOpenable() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaElement getParent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IPath getPath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaElement getPrimaryElement() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IResource getResource() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ISchedulingRule getSchedulingRule() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IResource getUnderlyingResource() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStructureKnown() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getSource() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ISourceRange getSourceRange() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ISourceRange getNameRange() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void copy(IJavaElement container, IJavaElement sibling,
+ String rename, boolean replace, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void delete(boolean force, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void move(IJavaElement container, IJavaElement sibling,
+ String rename, boolean replace, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void rename(String name, boolean replace, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IJavaElement[] getChildren() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public IAnnotation getAnnotation(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IAnnotation[] getAnnotations() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void codeComplete(char[] snippet, int insertion, int position,
+ char[][] localVariableTypeNames, char[][] localVariableNames,
+ int[] localVariableModifiers, boolean isStatic,
+ ICompletionRequestor requestor) throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void codeComplete(char[] snippet, int insertion, int position,
+ char[][] localVariableTypeNames, char[][] localVariableNames,
+ int[] localVariableModifiers, boolean isStatic,
+ ICompletionRequestor requestor, WorkingCopyOwner owner)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void codeComplete(char[] snippet, int insertion, int position,
+ char[][] localVariableTypeNames, char[][] localVariableNames,
+ int[] localVariableModifiers, boolean isStatic,
+ CompletionRequestor requestor) throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void codeComplete(char[] snippet, int insertion, int position,
+ char[][] localVariableTypeNames, char[][] localVariableNames,
+ int[] localVariableModifiers, boolean isStatic,
+ CompletionRequestor requestor, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void codeComplete(char[] snippet, int insertion, int position,
+ char[][] localVariableTypeNames, char[][] localVariableNames,
+ int[] localVariableModifiers, boolean isStatic,
+ CompletionRequestor requestor, WorkingCopyOwner owner)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void codeComplete(char[] snippet, int insertion, int position,
+ char[][] localVariableTypeNames, char[][] localVariableNames,
+ int[] localVariableModifiers, boolean isStatic,
+ CompletionRequestor requestor, WorkingCopyOwner owner,
+ IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IField createField(String contents, IJavaElement sibling,
+ boolean force, IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IInitializer createInitializer(String contents,
+ IJavaElement sibling, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IMethod createMethod(String contents, IJavaElement sibling,
+ boolean force, IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IType createType(String contents, IJavaElement sibling,
+ boolean force, IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IMethod[] findMethods(IMethod method) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaElement[] getChildrenForCategory(String category)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getElementName() {
+ return getShortName(qualifiedName);
+ }
+
+ @Override
+ public IField getField(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IField[] getFields() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return qualifiedName;
+ }
+
+ @Override
+ public String getFullyQualifiedName(char enclosingTypeSeparator) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getFullyQualifiedParameterizedName()
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IInitializer getInitializer(int occurrenceCount) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IInitializer[] getInitializers() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getKey() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IMethod getMethod(String name, String[] parameterTypeSignatures) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IMethod[] getMethods() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IPackageFragment getPackageFragment() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getSuperclassName() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getSuperclassTypeSignature() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getSuperInterfaceTypeSignatures() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getSuperInterfaceNames() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getTypeParameterSignatures() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeParameter[] getTypeParameters() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IType getType(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeParameter getTypeParameter(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getTypeQualifiedName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getTypeQualifiedName(char enclosingTypeSeparator) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IType[] getTypes() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isAnonymous() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isClass() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isEnum() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isInterface() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isAnnotation() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isLocal() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isMember() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isResolved() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public ITypeHierarchy loadTypeHierachy(InputStream input,
+ IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newSupertypeHierarchy(IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newSupertypeHierarchy(
+ ICompilationUnit[] workingCopies, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newSupertypeHierarchy(IWorkingCopy[] workingCopies,
+ IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newSupertypeHierarchy(WorkingCopyOwner owner,
+ IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newTypeHierarchy(IJavaProject project,
+ IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newTypeHierarchy(IJavaProject project,
+ WorkingCopyOwner owner, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newTypeHierarchy(ICompilationUnit[] workingCopies,
+ IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newTypeHierarchy(IWorkingCopy[] workingCopies,
+ IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeHierarchy newTypeHierarchy(WorkingCopyOwner owner,
+ IProgressMonitor monitor) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[][] resolveType(String typeName) throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[][] resolveType(String typeName, WorkingCopyOwner owner)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIClass.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIElement.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIElement.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIElement.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -0,0 +1,13 @@
+package org.jboss.tools.cdi.ui.test.testmodel;
+
+public class CDIElement {
+ protected static String getShortName(String qualifiedName){
+ int lastDot = qualifiedName.lastIndexOf(".");
+ String name;
+ if(lastDot < 0)
+ name = qualifiedName;
+ else
+ name = qualifiedName.substring(lastDot+1);
+ return name;
+ }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIElement.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIInjectionPoint.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIInjectionPoint.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIInjectionPoint.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -0,0 +1,132 @@
+package org.jboss.tools.cdi.ui.test.testmodel;
+
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IMember;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
+
+public class CDIInjectionPoint implements IInjectionPoint {
+ private ICDIProject project;
+ private IClassBean bean;
+
+ public CDIInjectionPoint(ICDIProject project, IClassBean bean){
+ this.project = project;
+ this.bean = bean;
+ }
+
+ @Override
+ public ICDIProject getCDIProject() {
+ return project;
+ }
+
+ @Override
+ public IPath getSourcePath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IResource getResource() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IClassBean getClassBean() {
+ return bean;
+ }
+
+ @Override
+ public IParametedType getMemberType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IMember getSourceMember() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getStartPosition() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getLength() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public List<IAnnotationDeclaration> getAnnotations() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isAnnotationPresent(String annotationTypeName) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public IParametedType getType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<IQualifierDeclaration> getQualifierDeclarations() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean hasDefaultQualifier() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isDelegate() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public ITextSourceReference getDelegateAnnotation() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IAnnotationDeclaration getInjectAnnotation() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIInjectionPoint.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -0,0 +1,303 @@
+package org.jboss.tools.cdi.ui.test.testmodel;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IBeanMethod;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IDecorator;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInterceptor;
+import org.jboss.tools.cdi.core.IInterceptorBinding;
+import org.jboss.tools.cdi.core.IObserverMethod;
+import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.cdi.core.IParameter;
+import org.jboss.tools.cdi.core.IProducerMethod;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
+import org.jboss.tools.cdi.core.IScope;
+import org.jboss.tools.cdi.core.IStereotype;
+import org.jboss.tools.common.text.INodeReference;
+
+public class CDIProject implements ICDIProject{
+ public static final String QUALIFIER1 = "org.test.Qualifier1";
+ public static final String QUALIFIER2 = "org.test.Qualifier2";
+ public static final String QUALIFIER3 = "org.test.Qualifier3";
+ public static final String QUALIFIER4 = "org.test.Qualifier4";
+ public static final String QUALIFIER5 = "org.test.Qualifier5";
+
+ private IQualifier defaultQualifier, namedQualifier, anyQualifier, newQualifier;
+
+ private ArrayList<IQualifier> qualifiers = new ArrayList<IQualifier>();
+
+ public CDIProject(){
+ defaultQualifier = new CDIQualifier(this, CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME);
+ anyQualifier = new CDIQualifier(this, CDIConstants.ANY_QUALIFIER_TYPE_NAME);
+ namedQualifier = new CDIQualifier(this, CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ newQualifier = new CDIQualifier(this, CDIConstants.NEW_QUALIFIER_TYPE_NAME);
+
+ qualifiers.add(namedQualifier);
+ qualifiers.add(newQualifier);
+ qualifiers.add(new CDIQualifier(this, QUALIFIER1));
+ qualifiers.add(new CDIQualifier(this, QUALIFIER2));
+ qualifiers.add(new CDIQualifier(this, QUALIFIER3));
+ qualifiers.add(new CDIQualifier(this, QUALIFIER4));
+ qualifiers.add(new CDIQualifier(this, QUALIFIER5));
+ }
+
+ @Override
+ public IBean[] getBeans() {
+ return null;
+ }
+
+ @Override
+ public Set<IBean> getNamedBeans(boolean attemptToResolveAmbiguousNames) {
+ return null;
+ }
+
+ @Override
+ public Set<IBean> getBeans(String name,
+ boolean attemptToResolveAmbiguousNames) {
+ return null;
+ }
+
+ @Override
+ public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
+ IParametedType beanType, IQualifierDeclaration... qualifiers) {
+ return null;
+ }
+
+ @Override
+ public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
+ IParametedType beanType, IType... qualifiers) {
+ return null;
+ }
+
+ @Override
+ public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
+ String fullyQualifiedBeanType,
+ String... fullyQualifiedQualifiersTypes) {
+ return null;
+ }
+
+ @Override
+ public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
+ IInjectionPoint injectionPoint) {
+ return null;
+ }
+
+ @Override
+ public IClassBean getBeanClass(IType type) {
+ return null;
+ }
+
+ @Override
+ public Set<IBean> getBeans(IPath path) {
+ return null;
+ }
+
+ @Override
+ public IQualifier[] getQualifiers() {
+ return (IQualifier[])qualifiers.toArray(new IQualifier[qualifiers.size()]);
+ }
+
+ @Override
+ public IStereotype[] getStereotypes() {
+ return null;
+ }
+
+ @Override
+ public IBean[] getAlternatives() {
+ return null;
+ }
+
+ @Override
+ public IDecorator[] getDecorators() {
+ return null;
+ }
+
+ @Override
+ public IInterceptor[] getInterceptors() {
+ return null;
+ }
+
+ @Override
+ public IStereotype getStereotype(String qualifiedName) {
+ return null;
+ }
+
+ @Override
+ public IStereotype getStereotype(IPath path) {
+ return null;
+ }
+
+ @Override
+ public IStereotype getStereotype(IType type) {
+ return null;
+ }
+
+ @Override
+ public IInterceptorBinding[] getInterceptorBindings() {
+ return null;
+ }
+
+ @Override
+ public IInterceptorBinding getInterceptorBinding(String qualifiedName) {
+ return null;
+ }
+
+ @Override
+ public IInterceptorBinding getInterceptorBinding(IPath path) {
+ return null;
+ }
+
+ @Override
+ public IQualifier getQualifier(String qualifiedName) {
+ if(qualifiedName.equals(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME))
+ return defaultQualifier;
+ else if(qualifiedName.equals(CDIConstants.NAMED_QUALIFIER_TYPE_NAME))
+ return namedQualifier;
+ else if(qualifiedName.equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME))
+ return anyQualifier;
+ else if(qualifiedName.equals(CDIConstants.NEW_QUALIFIER_TYPE_NAME))
+ return newQualifier;
+ else{
+ for(IQualifier q : qualifiers){
+ if(q.getSourceType().getFullyQualifiedName().equals(qualifiedName))
+ return q;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public IQualifier getQualifier(IPath path) {
+ return null;
+ }
+
+ @Override
+ public Set<String> getScopeNames() {
+ return null;
+ }
+
+ @Override
+ public IScope getScope(String qualifiedName) {
+ return null;
+ }
+
+ @Override
+ public IScope getScope(IPath path) {
+ return null;
+ }
+
+ @Override
+ public Set<IObserverMethod> resolveObserverMethods(
+ IInjectionPoint injectionPoint) {
+ return null;
+ }
+
+ @Override
+ public Set<IInjectionPoint> findObservedEvents(
+ IParameter observedEventParameter) {
+ return null;
+ }
+
+ @Override
+ public Set<IBean> resolve(Set<IBean> beans) {
+ return null;
+ }
+
+ @Override
+ public Set<IBeanMethod> resolveDisposers(IProducerMethod producer) {
+ return null;
+ }
+
+ @Override
+ public boolean isScope(IType annotationType) {
+ return false;
+ }
+
+ @Override
+ public boolean isNormalScope(IType annotationType) {
+ return false;
+ }
+
+ @Override
+ public boolean isPassivatingScope(IType annotationType) {
+ return false;
+ }
+
+ @Override
+ public boolean isQualifier(IType annotationType) {
+ return false;
+ }
+
+ @Override
+ public boolean isStereotype(IType annotationType) {
+ return false;
+ }
+
+ @Override
+ public List<INodeReference> getAlternativeClasses() {
+ return null;
+ }
+
+ @Override
+ public List<INodeReference> getAlternativeStereotypes() {
+ return null;
+ }
+
+ @Override
+ public List<INodeReference> getAlternatives(String fullyQualifiedTypeName) {
+ return null;
+ }
+
+ @Override
+ public List<INodeReference> getDecoratorClasses() {
+ return null;
+ }
+
+ @Override
+ public List<INodeReference> getDecoratorClasses(
+ String fullyQualifiedTypeName) {
+ return null;
+ }
+
+ @Override
+ public List<INodeReference> getInterceptorClasses() {
+ return null;
+ }
+
+ @Override
+ public List<INodeReference> getInterceptorClasses(
+ String fullyQualifiedTypeName) {
+ return null;
+ }
+
+ @Override
+ public Set<IInjectionPoint> getInjections(String fullyQualifiedTypeName) {
+ return null;
+ }
+
+ @Override
+ public CDICoreNature getNature() {
+ return null;
+ }
+
+ @Override
+ public void setNature(CDICoreNature n) {
+
+ }
+
+ @Override
+ public void update() {
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -0,0 +1,63 @@
+package org.jboss.tools.cdi.ui.test.testmodel;
+
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IQualifier;
+
+public class CDIQualifier implements IQualifier{
+ private ICDIProject project;
+ private CDIClass cdiClass;
+
+ public CDIQualifier(ICDIProject project, String qualifiedName){
+ this.project = project;
+ this.cdiClass = new CDIClass(qualifiedName);
+ }
+
+ @Override
+ public IType getSourceType() {
+ return cdiClass;
+ }
+
+ @Override
+ public IAnnotationDeclaration getInheritedDeclaration() {
+ return null;
+ }
+
+ @Override
+ public List<IAnnotationDeclaration> getAnnotationDeclarations() {
+ return null;
+ }
+
+ @Override
+ public IAnnotationDeclaration getAnnotationDeclaration(String typeName) {
+ return null;
+ }
+
+ @Override
+ public Set<IMethod> getNonBindingMethods() {
+ return null;
+ }
+
+ @Override
+ public ICDIProject getCDIProject() {
+ return project;
+ }
+
+ @Override
+ public IPath getSourcePath() {
+ return null;
+ }
+
+ @Override
+ public IResource getResource() {
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java 2011-05-24
00:22:04 UTC (rev 31440)
@@ -0,0 +1,180 @@
+package org.jboss.tools.cdi.ui.test.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.ui.test.testmodel.CDIBean;
+import org.jboss.tools.cdi.ui.test.testmodel.CDIInjectionPoint;
+import org.jboss.tools.cdi.ui.test.testmodel.CDIProject;
+import org.jboss.tools.cdi.ui.wizard.AddQualifiersToBeanWizard;
+
+
+public class AddQualifiersToBeanWizardTest extends TestCase{
+ private AddQualifiersToBeanWizard wizard;
+ private WizardDialog dialog;
+ private ICDIProject project;
+ private ArrayList<IQualifier> availableCheck, deployedCheck;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ project = new CDIProject();
+
+ IClassBean bean = new CDIBean(project, "org.test.FooBean");
+
+ IInjectionPoint injectionPoint = new CDIInjectionPoint(project, bean);
+
+ ArrayList<IBean> beans = new ArrayList<IBean>();
+ beans.add(bean);
+
+ availableCheck = new ArrayList<IQualifier>();
+
+ availableCheck.add(project.getQualifier(CDIConstants.NAMED_QUALIFIER_TYPE_NAME));
+ availableCheck.add(project.getQualifier(CDIConstants.NEW_QUALIFIER_TYPE_NAME));
+ availableCheck.add(project.getQualifier(CDIProject.QUALIFIER1));
+ availableCheck.add(project.getQualifier(CDIProject.QUALIFIER2));
+ availableCheck.add(project.getQualifier(CDIProject.QUALIFIER3));
+ availableCheck.add(project.getQualifier(CDIProject.QUALIFIER4));
+ availableCheck.add(project.getQualifier(CDIProject.QUALIFIER5));
+
+ deployedCheck = new ArrayList<IQualifier>();
+
+ deployedCheck.add(project.getQualifier(CDIConstants.ANY_QUALIFIER_TYPE_NAME));
+ deployedCheck.add(project.getQualifier(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME));
+
+
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ wizard = new AddQualifiersToBeanWizard(injectionPoint, beans, bean);
+ dialog = new WizardDialog(shell, wizard);
+
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ dialog.close();
+ super.tearDown();
+ }
+
+ private void checkQualifierLists(List<IQualifier> checkQualifiers,
List<IQualifier> actualQualifiers){
+ for(IQualifier q : checkQualifiers){
+ if(!actualQualifiers.contains(q))
+ fail("Qualifier - "+q.getSourceType().getFullyQualifiedName()+" not
found");
+ }
+ for(IQualifier q : actualQualifiers){
+ if(!checkQualifiers.contains(q))
+ fail("Wrong Qualifier - "+q.getSourceType().getFullyQualifiedName()+"
found");
+ }
+ }
+
+ public void testAddQualifier(){
+ List<IQualifier> available = wizard.getAvailableQualifiers();
+
+ checkQualifierLists(availableCheck, available);
+
+ List<IQualifier> deployed = wizard.getDeployedQualifiers();
+
+ checkQualifierLists(deployedCheck, deployed);
+
+ // Deploy qualifier
+ IQualifier qualifier = project.getQualifier(CDIProject.QUALIFIER1);
+ IQualifier defaultQualifier =
project.getQualifier(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME);
+
+ wizard.deploy(qualifier);
+
+ available = wizard.getAvailableQualifiers();
+ availableCheck.remove(qualifier);
+
+ checkQualifierLists(availableCheck, available);
+
+ deployed = wizard.getDeployedQualifiers();
+
+ deployedCheck.add(qualifier);
+ deployedCheck.remove(defaultQualifier);
+
+ checkQualifierLists(deployedCheck, deployed);
+ }
+
+ public void testAddAndRemoveQualifier(){
+ List<IQualifier> available = wizard.getAvailableQualifiers();
+
+ checkQualifierLists(availableCheck, available);
+
+ List<IQualifier> deployed = wizard.getDeployedQualifiers();
+
+ checkQualifierLists(deployedCheck, deployed);
+
+ // Deploy qualifier
+ IQualifier qualifier = project.getQualifier(CDIProject.QUALIFIER2);
+ IQualifier defaultQualifier =
project.getQualifier(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME);
+
+ wizard.deploy(qualifier);
+
+ available = wizard.getAvailableQualifiers();
+ availableCheck.remove(qualifier);
+
+ checkQualifierLists(availableCheck, available);
+
+ deployed = wizard.getDeployedQualifiers();
+
+ deployedCheck.add(qualifier);
+ deployedCheck.remove(defaultQualifier);
+
+ checkQualifierLists(deployedCheck, deployed);
+
+ // Remove qualifier
+ wizard.remove(qualifier);
+
+ available = wizard.getAvailableQualifiers();
+ availableCheck.add(qualifier);
+
+ checkQualifierLists(availableCheck, available);
+
+ deployed = wizard.getDeployedQualifiers();
+
+ deployedCheck.remove(qualifier);
+ deployedCheck.add(defaultQualifier);
+
+ checkQualifierLists(deployedCheck, deployed);
+ }
+
+ public void testAddNamedQualifier(){
+ List<IQualifier> available = wizard.getAvailableQualifiers();
+
+ checkQualifierLists(availableCheck, available);
+
+ List<IQualifier> deployed = wizard.getDeployedQualifiers();
+
+ checkQualifierLists(deployedCheck, deployed);
+
+ // Deploy @Named qualifier
+ IQualifier named = project.getQualifier(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+
+ wizard.deploy(named);
+
+ available = wizard.getAvailableQualifiers();
+ availableCheck.remove(named);
+
+ checkQualifierLists(availableCheck, available);
+
+ deployed = wizard.getDeployedQualifiers();
+
+ deployedCheck.add(named);
+
+ checkQualifierLists(deployedCheck, deployed);
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain