JBoss Tools SVN: r31446 - in trunk/ws: plugins/org.jboss.tools.ws.jaxrs.core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-05-24 12:03:07 -0400 (Tue, 24 May 2011)
New Revision: 31446
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/.classpath
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/build.properties
trunk/ws/pom.xml
Log:
fix for maven build compilation errors.
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/.classpath
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/.classpath 2011-05-24 15:33:03 UTC (rev 31445)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/.classpath 2011-05-24 16:03:07 UTC (rev 31446)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="lib/jaxrs-api.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/jaxrs-api.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF 2011-05-24 15:33:03 UTC (rev 31445)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF 2011-05-24 16:03:07 UTC (rev 31446)
@@ -29,5 +29,5 @@
org.jboss.tools.ws.jaxrs.core.internal.builder;x-friends:="org.jboss.tools.ws.jaxrs.core.test",
org.jboss.tools.ws.jaxrs.core.metamodel,
org.jboss.tools.ws.jaxrs.core.utils
-Bundle-ClassPath: lib/jaxrs-api.jar,
- .
+Bundle-ClassPath: .,
+ lib/jaxrs-api.jar
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/build.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/build.properties 2011-05-24 15:33:03 UTC (rev 31445)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/build.properties 2011-05-24 16:03:07 UTC (rev 31446)
@@ -3,7 +3,7 @@
bin.includes = META-INF/,\
.,\
plugin.xml,\
+ plugin.properties,\
lib/jaxrs-api.jar
jars.compile.order = .,\
lib/jaxrs-api.jar
-source.lib/jaxrs-api.jar =
Modified: trunk/ws/pom.xml
===================================================================
--- trunk/ws/pom.xml 2011-05-24 15:33:03 UTC (rev 31445)
+++ trunk/ws/pom.xml 2011-05-24 16:03:07 UTC (rev 31446)
@@ -1,6 +1,12 @@
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.2-SNAPSHOT</version>
+ <relativePath>../build/parent/pom.xml</relativePath>
+ </parent>
<groupId>org.jboss.tools</groupId>
<artifactId>ws</artifactId>
<name>ws.all</name>
13 years, 1 month
JBoss Tools SVN: r31445 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl: definition and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-24 11:33:03 -0400 (Tue, 24 May 2011)
New Revision: 31445
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java
Log:
JBIDE-8983
https://issues.jboss.org/browse/JBIDE-8985
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2011-05-24 15:15:11 UTC (rev 31444)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2011-05-24 15:33:03 UTC (rev 31445)
@@ -12,9 +12,12 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.ILocalVariable;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IBeanMember;
@@ -37,20 +40,30 @@
return (BeanMemberDefinition)definition;
}
- protected void setMember(IMember member) {
+ protected void setMember(IJavaElement member) {
try {
- String returnType = member instanceof IField ? ((IField)member).getTypeSignature()
- : member instanceof IMethod ? ((IMethod)member).getReturnType() : null;
+ String returnType = null;
+ IMember currentMember = null;
+ if (member instanceof IField) {
+ returnType = ((IField)member).getTypeSignature();
+ currentMember = (IMember)member;
+ } else if (member instanceof IMethod) {
+ returnType = ((IMethod)member).getReturnType();
+ currentMember = (IMember)member;
+ } else if (member instanceof ILocalVariable) {
+ returnType = ((ILocalVariable)member).getTypeSignature();
+ currentMember = ((ILocalVariable)member).getDeclaringMember();
+ }
if(returnType != null) {
- ParametedType p = getCDIProject().getNature().getTypeFactory().getParametedType(member, returnType);
+ ParametedType p = getCDIProject().getNature().getTypeFactory().getParametedType(currentMember, returnType);
if(p != null) {
int offset = -1;
int length = 0;
String content = getDefinition().getTypeDefinition().getContent();
if(content != null) {
- ISourceRange sr = member.getSourceRange();
- ISourceRange nr = member.getNameRange();
+ ISourceRange sr = ((ISourceReference)member).getSourceRange();
+ ISourceRange nr = ((ISourceReference)member).getNameRange();
if(sr != null && nr != null && sr.getOffset() < nr.getOffset() && nr.getOffset() < content.length()) {
String start = content.substring(sr.getOffset(), nr.getOffset());
int off = -1;
@@ -105,16 +118,25 @@
return super.getResource();
}
+ protected ISourceReference getSourceReference() {
+ return getSourceMember();
+ }
+
+ protected ISourceRange getSourceRange() {
+ ISourceRange result = null;
+ try {
+ result = getSourceReference().getSourceRange();
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ return result;
+ }
+
public int getLength() {
if(definition.getOriginalDefinition() != null) {
return definition.getOriginalDefinition().getLength();
}
- ISourceRange r = null;
- try {
- getSourceMember().getSourceRange();
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
- }
+ ISourceRange r = getSourceRange();
return r == null ? 0 : r.getLength();
}
@@ -122,16 +144,11 @@
if(definition.getOriginalDefinition() != null) {
return definition.getOriginalDefinition().getStartPosition();
}
- ISourceRange r = null;
- try {
- getSourceMember().getSourceRange();
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
- }
+ ISourceRange r = getSourceRange();
return r == null ? 0 : r.getOffset();
}
public boolean isNullable() {
- return typeDeclaration==null?false:!typeDeclaration.isPrimitive();
+ return typeDeclaration == null ? false : !typeDeclaration.isPrimitive();
}
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-05-24 15:15:11 UTC (rev 31444)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-05-24 15:33:03 UTC (rev 31445)
@@ -318,40 +318,19 @@
}
}
- boolean isParameter = false;// injectionPoint instanceof InjectionPointParameter;
boolean isNew = false;
Set<IQualifierDeclaration> qs = injectionPoint.getQualifierDeclarations();
- List<IType> qs2 = null;
- if(isParameter) {
- qs2 = new ArrayList<IType>();
- Set<IQualifier> qs_ = ((InjectionPointParameter)injectionPoint).getQualifiers();
- for (IQualifier q: qs_) {
- IType t = q.getSourceType();
- if(t != null) {
- if(CDIConstants.NEW_QUALIFIER_TYPE_NAME.equals(t.getFullyQualifiedName())) {
- isNew = true;
- } else {
- qs2.add(t);
- }
- }
- }
- } else {
- for (IQualifierDeclaration d: qs) {
- if(CDIConstants.NEW_QUALIFIER_TYPE_NAME.equals(d.getTypeName())) {
- isNew = true;
- break;
- }
- }
+ for (IQualifierDeclaration d: qs) {
+ if(CDIConstants.NEW_QUALIFIER_TYPE_NAME.equals(d.getTypeName())) {
+ isNew = true;
+ break;
+ }
}
if(isBuiltIn(type.getType())) {
Set<IBean> rslt = null;
- if(isParameter) {
- rslt = getBeans(attemptToResolveAmbiguousDependency, type, qs2.toArray(new IType[0]));
- } else {
- rslt = getBeans(attemptToResolveAmbiguousDependency, type, qs.toArray(new IQualifierDeclaration[0]));
- }
+ rslt = getBeans(attemptToResolveAmbiguousDependency, type, qs.toArray(new IQualifierDeclaration[0]));
if(rslt.isEmpty()) {
BuiltInBean builtInBean = new BuiltInBean(type);
builtInBean.setParent(this);
@@ -396,14 +375,8 @@
continue;
}
Set<IQualifierDeclaration> qsb = b.getQualifierDeclarations(true);
- if(isParameter) {
- if(areMatchingQualifiers(qsb, qs2.toArray(new IType[0]))) {
- result.add(b);
- }
- } else {
- if(areMatchingQualifiers(qsb, qs)) {
- result.add(b);
- }
+ if(areMatchingQualifiers(qsb, qs)) {
+ result.add(b);
}
} catch (CoreException e) {
CDICorePlugin.getDefault().logError(e);
@@ -901,6 +874,10 @@
for (IClassBean b: classBeans.values()) {
Set<IInjectionPoint> ps = b.getInjectionPoints();
for (IInjectionPoint p: ps) {
+ if(p.getType() == null && p instanceof IInjectionPointField) {
+ System.out.println("shit");
+ continue;
+ }
if(p instanceof IInjectionPointField) {
IParametedType eventType = getEventType(p.getType());
if(eventType != null && ((ParametedType)eventType).isAssignableTo((ParametedType)paramType, true)) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java 2011-05-24 15:15:11 UTC (rev 31444)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java 2011-05-24 15:33:03 UTC (rev 31445)
@@ -3,44 +3,55 @@
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.jdt.core.ILocalVariable;
import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.ISourceReference;
import org.jboss.tools.cdi.core.IBeanMethod;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IParameter;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.internal.core.impl.definition.ParameterDefinition;
-import org.jboss.tools.common.text.ITextSourceReference;
-public class Parameter extends AbstractBeanElement implements IParameter {
- ParameterDefinition definition;
+public class Parameter extends BeanMember implements IParameter {
BeanMethod beanMethod;
public Parameter() {}
+ public ParameterDefinition getDefinition() {
+ return (ParameterDefinition)definition;
+ }
+
public void setBeanMethod(BeanMethod beanMethod) {
this.beanMethod = beanMethod;
setParent(beanMethod);
}
public void setDefinition(ParameterDefinition definition) {
+ if(beanMethod.getMethod().getElementName().equals("obs")) {
+ System.out.println("!!");
+ }
super.setDefinition(definition);
this.definition = definition;
}
+ public void setLocalVariable(ILocalVariable v) {
+ setMember(v);
+ }
+
public String getName() {
- return definition.getName();
+ return getDefinition().getName();
}
public IParametedType getMemberType() {
- return definition.getType();
+ return getDefinition().getType();
}
public IParametedType getType() {
- if(definition.getOverridenType() != null) {
- return definition.getOverridenType();
+ if(getDefinition().getOverridenType() != null) {
+ return getDefinition().getOverridenType();
}
- return definition.getType();
+ return getDefinition().getType();
}
public IClassBean getClassBean() {
@@ -48,40 +59,17 @@
}
public IMember getSourceMember() {
- return definition.getMethodDefinition().getMethod();
+ return getDefinition().getMethodDefinition().getMethod();
}
- public int getLength() {
- ITextSourceReference p = definition.getPosition();
- return p == null ? 0 : p.getLength();
+ protected ISourceReference getSourceReference() {
+ return getDefinition().getVariable();
}
- public int getStartPosition() {
- ITextSourceReference p = definition.getPosition();
- return p == null ? 0 : p.getStartPosition();
- }
-
public Set<String> getAnnotationTypes() {
- return definition.getAnnotationTypes();
+ return getDefinition().getAnnotationTypes();
}
- public String getValue(String annotationTypeName) {
- String text = definition.getAnnotationText(annotationTypeName);
- if(text != null) {
- int i = text.indexOf('(');
- int j = text.lastIndexOf(')');
- if(i >= 0 && j > i) {
- String values = text.substring(i + 1, j).trim();
- if(values.startsWith("\"") && values.endsWith("\"")) {
- return values.substring(1, values.length() - 1);
- }
- //TODO improve
- return values;
- }
- }
- return null;
- }
-
/*
* (non-Javadoc)
* @see org.jboss.tools.cdi.core.IParameter#getBeanMethod()
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2011-05-24 15:15:11 UTC (rev 31444)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2011-05-24 15:33:03 UTC (rev 31445)
@@ -362,7 +362,6 @@
packages = workingCopy.packages;
packageDefinitions = workingCopy.packageDefinitions;
beanXMLs = workingCopy.beanXMLs;
- dependencies = workingCopy.dependencies;
Set<IProcessAnnotatedTypeFeature> fs = project.getExtensionManager().getProcessAnnotatedTypeFeature();
if(fs != null && !fs.isEmpty()) {
@@ -377,6 +376,9 @@
e.applyWorkingCopy();
}
+ //extensions may add to dependencies while they change
+ dependencies = workingCopy.dependencies;
+
project.getDelegate().update();
workingCopy = null;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2011-05-24 15:15:11 UTC (rev 31444)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2011-05-24 15:33:03 UTC (rev 31445)
@@ -16,13 +16,10 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.ILocalVariable;
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IInterceptorBinding;
@@ -30,11 +27,7 @@
import org.jboss.tools.cdi.core.IRootDefinitionContext;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
-import org.jboss.tools.cdi.internal.core.impl.AnnotationLiteral;
import org.jboss.tools.cdi.internal.core.impl.ClassBean;
-import org.jboss.tools.cdi.internal.core.impl.ParametedType;
-import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
/**
*
@@ -66,7 +59,6 @@
protected void init(IType contextType, IRootDefinitionContext context, int flags) throws CoreException {
super.init(contextType, context, flags);
isConstructor = method.isConstructor();
- //TODO process parameters for disposers and observers
loadParamDefinitions(contextType, context, flags);
}
@@ -76,85 +68,31 @@
void loadParamDefinitions(IType contextType, IRootDefinitionContext context, int flags) throws CoreException {
if(method == null) return;
+ ILocalVariable[] ps = method.getParameters();
+
boolean loadAll = (flags & FLAG_ALL_MEMBERS) > 0;
boolean parametersAreInjectionPoints = parametersAreInjectionPoints();
- String[] parameterNames = method.getParameterNames();
- if(parameterNames == null || parameterNames.length == 0) return;
+
+ if(ps.length == 0) return;
if(contextType == null || contextType.isBinary()) return;
- String content = typeDefinition.getContent();
- if(content == null) return;
- ISourceRange range = method.getSourceRange();
- ISourceRange nameRange = method.getNameRange();
- if(nameRange != null) range = nameRange;
- int paramStart = content.indexOf('(', range.getOffset());
- if(paramStart < 0) return;
- int declEnd = content.indexOf('{', paramStart);
- if(declEnd < 0) return;
- int paramEnd = content.lastIndexOf(')', declEnd);
- if(paramEnd < paramStart) paramEnd = declEnd;
- String paramsString = content.substring(paramStart + 1, paramEnd);
- if(!parametersAreInjectionPoints && paramsString.indexOf("@Observes") >= 0) {
- parametersAreInjectionPoints = true;
- }
- if(!loadAll && !parametersAreInjectionPoints && paramsString.indexOf('@') < 0) return;
- String[] params = getParams(paramsString);
- String[] ps = method.getParameterTypes();
- int start = paramStart + 1;
- for (int i = 0; i < params.length; i++) {
- if(ps.length <= i) {
- // CDICorePlugin.getDefault().logError(new IllegalArgumentException("Cannot parse method parameters for " + paramsString));
- // The source code may be broken. Just ignore such errors.
- break;
- }
- if(!loadAll && !parametersAreInjectionPoints && params[i].indexOf('@') < 0) {
- start += params[i].length() + 1;
- continue; //do not need parameters without annotation
- }
-
+ ParameterDefinition[] ds = new ParameterDefinition[ps.length];
+ for (int i = 0; i < ps.length; i++) {
ParameterDefinition pd = new ParameterDefinition();
-
- ParametedType type = context.getProject().getTypeFactory().getParametedType(method, ps[i]);
-
- pd.methodDefinition = this;
- pd.name = parameterNames[i];
+ pd.setMethodDefinition(this);
pd.index = i;
- pd.type = type;
-
- String p = params[i].trim();
- int pi = params[i].indexOf(p);
-
- ValueInfo v = new CheckingValueInfo(method);
- v.setValue(params[i]);
- v.valueStartPosition = start + pi;
- v.valueLength = p.length();
- v.setResource((IFile)resource);
- pd.setPosition(v);
-
- String[] tokens = getParamTokens(p);
- for (String q: tokens) {
- if(!q.startsWith("@")) continue;
- int valueStartPosition = start + params[i].indexOf(q);
- int valueLength = q.length();
- int s = q.indexOf('(');
- if(s >= 0) q = q.substring(0, s).trim();
- String annotationType = EclipseJavaUtil.resolveType(contextType, q.substring(1).trim());
- IType t = context.getProject().getType(annotationType);
- if(t != null) {
- String source = content.substring(valueStartPosition, valueStartPosition + valueLength);
- IMemberValuePair[] pairs = ParameterDefinition.getMemberValues(source);
- AnnotationLiteral ja = new AnnotationLiteral(method.getResource(), valueStartPosition, valueLength, null, IMemberValuePair.K_UNKNOWN, t);
- if(pairs != null && pairs.length > 0) for (IMemberValuePair pair: pairs) {
- ja.addMemberValuePair(pair.getMemberName(), pair.getValue(), pair.getValueKind());
- }
- pd.addAnnotation(ja, context);
- }
+ pd.setLocalVariable(ps[i], context, flags);
+ if(pd.isAnnotationPresent(CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME)) {
+ parametersAreInjectionPoints = true;
}
-
- parameters.add(pd);
-
- start += params[i].length() + 1;
+ ds[i] = pd;
}
+ for (int i = 0; i < ps.length; i++) {
+ if(!loadAll && !parametersAreInjectionPoints && ds[i].getAnnotations().isEmpty()) {
+ continue; //do not need parameters without annotation
+ }
+ parameters.add(ds[i]);
+ }
}
@Override
@@ -207,120 +145,4 @@
return annotationsByType.get(CDIConstants.POST_CONSTRUCTOR_TYPE_NAME);
}
- static String[] getParams(String paramsString) {
- List<String> result = new ArrayList<String>();
- int i = 0;
- int c1 = 0;
- int c2 = 0;
- char quote = '\0';
- StringBuffer sb = new StringBuffer();
- while(i < paramsString.length()) {
- char c = paramsString.charAt(i);
- if(c == ',' && c1 == 0 && c2 == 0 && quote == '\0') {
- if(sb.toString().trim().length() > 0) {
- result.add(sb.toString());
- }
- sb.setLength(0);
- i++;
- continue;
- } else if(c == '(' && quote == '\0') {
- c1++;
- } else if(c == ')' && quote == '\0') {
- c1--;
- } else if(c == '<' && quote == '\0') {
- c2++;
- } else if(c == '>' && quote == '\0') {
- c2--;
- } else if((c == '\'' || c == '"') && quote == '\0') {
- quote = c;
- } else if(quote == c) {
- quote = '\0';
- }
- sb.append(c);
- i++;
- }
- if(sb.length() > 0) {
- result.add(sb.toString());
- }
- return result.toArray(new String[0]);
- }
-
- static String[] getParamTokens(String paramsString) {
- List<String> result = new ArrayList<String>();
- int i = 0;
- int c1 = 0;
- int c2 = 0;
- char quote = '\0';
- StringBuffer sb = new StringBuffer();
- while(i < paramsString.length()) {
- char c = paramsString.charAt(i);
- boolean ws = Character.isWhitespace(c);
- if(ws && c1 == 0 && c2 == 0 && quote == '\0') {
- String t = sb.toString().trim();
- if(t.length() > 0) {
- result.add(t);
- }
- sb.setLength(0);
- i++;
- continue;
- } else if(c == '(' && quote == '\0') {
- c1++;
- } else if(c == ')' && quote == '\0') {
- c1--;
- } else if(c == '<' && quote == '\0') {
- c2++;
- } else if(c == '>' && quote == '\0') {
- c2--;
- } else if((c == '\'' || c == '"') && quote == '\0') {
- quote = c;
- } else if(quote == c) {
- quote = '\0';
- }
- sb.append(c);
- i++;
- }
- if(sb.length() > 0) {
- result.add(sb.toString());
- }
- return result.toArray(new String[0]);
- }
-
- class CheckingValueInfo extends ValueInfo {
- IMethod m;
- CheckingValueInfo(IMethod m) {
- this.m = m;
- }
-
- void check() {
- ISourceRange r = null;
- try {
- r = m.getSourceRange();
- } catch (JavaModelException e) {
- System.out.println("Method is obsolete: " + m);
- }
- if(r == null) {
- valueStartPosition = 0;
- valueLength = 0;
- } else {
- if(valueStartPosition + valueLength > r.getOffset() + r.getLength()) {
- System.out.println("Method is modified: " + m);
- valueStartPosition = 0;
- valueLength = 0;
- }
- }
-
- }
-
- public int getStartPosition() {
- check();
- return valueStartPosition;
- }
-
- public int getLength() {
- check();
- return valueLength;
- }
-
- }
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java 2011-05-24 15:15:11 UTC (rev 31444)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java 2011-05-24 15:33:03 UTC (rev 31445)
@@ -12,26 +12,43 @@
import java.util.Set;
-import org.eclipse.jdt.core.IMemberValuePair;
-import org.eclipse.jdt.internal.core.MemberValuePair;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IRootDefinitionContext;
import org.jboss.tools.cdi.internal.core.impl.ParametedType;
import org.jboss.tools.cdi.internal.core.impl.TypeDeclaration;
import org.jboss.tools.common.text.ITextSourceReference;
-public class ParameterDefinition extends AbstractMemberDefinition {
+public class ParameterDefinition extends BeanMemberDefinition {
protected MethodDefinition methodDefinition;
- protected String name;
+ ILocalVariable variable;
protected ParametedType type;
protected TypeDeclaration overridenType;
protected int index;
- protected ITextSourceReference position = null;
-
public ParameterDefinition() {}
+ public void setMethodDefinition(MethodDefinition methodDefinition) {
+ this.methodDefinition = methodDefinition;
+ typeDefinition = methodDefinition.getTypeDefinition();
+ }
+
+ public void setLocalVariable(ILocalVariable v, IRootDefinitionContext context, int flags) {
+ variable = v;
+ super.setAnnotatable(v, v.getDeclaringMember().getDeclaringType(), context, flags);
+ }
+
+ @Override
+ protected void init(IType contextType, IRootDefinitionContext context, int flags) throws CoreException {
+ super.init(contextType, context, flags);
+ type = context.getProject().getTypeFactory().getParametedType(variable.getDeclaringMember(), variable.getTypeSignature());
+ }
+
public String getName() {
- return name;
+ return variable.getElementName();
}
public ParametedType getType() {
@@ -50,45 +67,14 @@
return methodDefinition;
}
- private static IMemberValuePair[] EMPTY_PAIRS = new IMemberValuePair[0];
-
- static IMemberValuePair[] getMemberValues(String source) {
- int p1 = source.indexOf('(');
- int p2 = source.indexOf(')');
- if(p1 >= 0 && p2 > p1) {
- String params = source.substring(p1 + 1, p2).trim();
- if(params.length() > 0) {
- if(params.startsWith("{") && params.endsWith("}")) {
- //TODO
- } else if(params.endsWith(".class")) {
- params = params.substring(0, params.length() - 6);
- IMemberValuePair pair = new MemberValuePair("value", params, IMemberValuePair.K_CLASS);
- return new IMemberValuePair[]{pair};
- } else if(params.startsWith("\"") && params.endsWith("\"")) {
- params = params.substring(1, params.length() - 1);
- IMemberValuePair pair = new MemberValuePair("value", params, IMemberValuePair.K_STRING);
- return new IMemberValuePair[]{pair};
- } else {
- //TODO
- }
- }
- }
-
- return EMPTY_PAIRS;
- }
-
public Set<String> getAnnotationTypes() {
return annotationsByType.keySet();
}
- public void setPosition(ITextSourceReference position) {
- this.position = position;
+ public ILocalVariable getVariable() {
+ return variable;
}
- public ITextSourceReference getPosition() {
- return position;
- }
-
public String getAnnotationText(String annotationTypeName) {
ITextSourceReference pos = getAnnotationPosition(annotationTypeName);
if(pos == null) return null;
13 years, 1 month
JBoss Tools SVN: r31444 - workspace.
by jbosstools-commits@lists.jboss.org
Author: rcernich
Date: 2011-05-24 11:15:11 -0400 (Tue, 24 May 2011)
New Revision: 31444
Added:
workspace/rcernich/
Log:
create workspace folder rcernich
13 years, 1 month
JBoss Tools SVN: r31443 - in trunk: as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-05-24 10:00:31 -0400 (Tue, 24 May 2011)
New Revision: 31443
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/bean/JBossServerType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/bean/ServerBeanLoader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeLocator.java
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/IJBossRuntimePluginConstants.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Messages.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/DroolsHandler.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/messages.properties
Log:
JBIDE-8906 jboss runtime detection doesn't spot AS 7 installations
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/bean/JBossServerType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/bean/JBossServerType.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/bean/JBossServerType.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -11,6 +11,7 @@
package org.jboss.ide.eclipse.as.core.server.bean;
import java.io.File;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Properties;
import java.util.zip.ZipEntry;
@@ -54,6 +55,17 @@
BIN_PATH+File.separatorChar + TWIDDLE_JAR_NAME,
new String[]{V6_0,V5_1, V5_0, V4_2, V4_0, V3_2}, new ASServerTypeCondition());
+ public static final JBossServerType AS7 = new JBossServerType(
+ "AS", //$NON-NLS-1$
+ "Application Server", //$NON-NLS-1$
+ "modules" + File.separatorChar + //$NON-NLS-1$
+ "org" + File.separatorChar + //$NON-NLS-1$
+ "jboss" + File.separatorChar + //$NON-NLS-1$
+ "as" + File.separatorChar + //$NON-NLS-1$
+ "server" + File.separatorChar + //$NON-NLS-1$
+ "main", //$NON-NLS-1$
+ new String[]{V7_0,}, new AS7ServerTypeCondition());
+
public static final JBossServerType EAP_STD = new JBossServerType(
"EAP_STD",//$NON-NLS-1$
"Enterprise Application Platform",//$NON-NLS-1$
@@ -94,7 +106,7 @@
UNKNOWN_STR,
UNKNOWN_STR,
"",//$NON-NLS-1$
- new String[]{V6_0, V5_1, V5_0, V4_3, V4_2, V4_0, V3_2}, null);
+ new String[]{V7_0, V6_0, V5_1, V5_0, V4_3, V4_2, V4_0, V3_2}, null);
public String toString() {
return id;
@@ -194,6 +206,19 @@
}
}
+ public static class AS7ServerTypeCondition implements Condition {
+
+ public boolean isServerRoot(File location) {
+ String standaloneScriptPath = new StringBuilder(location.getAbsolutePath())
+ .append(File.separator)
+ .append("bin") //$NON-NLS-1$
+ .append(File.separator)
+ .append("standalone.sh") //$NON-NLS-1$
+ .toString();
+ return new File(standaloneScriptPath).exists();
+ }
+ }
+
public static class SOAPServerTypeCondition extends EAPServerTypeCondition{
public boolean isServerRoot(File location) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/bean/ServerBeanLoader.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/bean/ServerBeanLoader.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/bean/ServerBeanLoader.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -12,6 +12,7 @@
package org.jboss.ide.eclipse.as.core.server.bean;
import java.io.File;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Properties;
import java.util.zip.ZipEntry;
@@ -35,6 +36,8 @@
public JBossServerType getServerType(File location) {
if(JBossServerType.AS.isServerRoot(location)) {
return JBossServerType.AS;
+ } else if(JBossServerType.AS7.isServerRoot(location)) {
+ return JBossServerType.AS7;
} else if(JBossServerType.EAP_STD.isServerRoot(location)) {
return JBossServerType.EAP_STD;
} else if(JBossServerType.EAP.isServerRoot(location) && JBossServerType.SOAP.isServerRoot(location)) {
@@ -56,6 +59,18 @@
}
public String getFullServerVersion(File systemJarFile) {
+ if (systemJarFile.isDirectory()) {
+ File[] files = systemJarFile.listFiles(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".jar"); //$NON-NLS-1$
+ }
+ });
+ if (files != null && files.length == 1) {
+ systemJarFile = files[0];
+ }
+ }
+
String version = null;
ZipFile jar = null;
if(systemJarFile.canRead()) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeLocator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeLocator.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeLocator.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -98,6 +98,8 @@
JBossServerType type = loader.getServerType(path.toFile());
if( type == JBossServerType.AS)
return createASRuntime(path, loader);
+ if( type == JBossServerType.AS7)
+ return createAS7Runtime(path, loader);
if( type == JBossServerType.EAP)
return createEAPRuntime(path, loader);
if( type == JBossServerType.SOAP)
@@ -105,6 +107,16 @@
return null;
}
+ private static IRuntimeWorkingCopy createAS7Runtime(IPath path, ServerBeanLoader loader) {
+ String runtimeTypeId = IJBossToolingConstants.AS_70;
+ try {
+ IRuntimeWorkingCopy wc = createRuntimeWorkingCopy(runtimeTypeId, path.toOSString(), IJBossRuntimeResourceConstants.DEFAULT_CONFIGURATION);
+ return launchRuntimeWizard(wc);
+ } catch( CoreException ce) {
+ }
+ return null;
+ }
+
private static IRuntimeWorkingCopy createASRuntime(IPath path, ServerBeanLoader loader) {
String version = new ServerBeanLoader().getFullServerVersion(new File(path.toFile(), JBossServerType.AS.getSystemJarPath()));
String runtimeTypeId = null;
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/IJBossRuntimePluginConstants.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/IJBossRuntimePluginConstants.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/IJBossRuntimePluginConstants.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -50,7 +50,8 @@
"org.jboss.ide.eclipse.as.runtime.51", //$NON-NLS-1$
"org.jboss.ide.eclipse.as.runtime.60", //$NON-NLS-1$
"org.jboss.ide.eclipse.as.runtime.eap.43", //$NON-NLS-1$
- "org.jboss.ide.eclipse.as.runtime.eap.50" //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.eap.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.70" //$NON-NLS-1$
};
public static final String HSQLDB_DRIVER_JAR_NAME = "hsqldb.jar"; //$NON-NLS-1$
@@ -80,6 +81,7 @@
"org.jboss.ide.eclipse.as.60", //$NON-NLS-1$
"org.jboss.ide.eclipse.as.eap.43", //$NON-NLS-1$
"org.jboss.ide.eclipse.as.eap.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.70" //$NON-NLS-1$
};
public static final String JBOSS_AS_NAME[] = {
@@ -90,7 +92,8 @@
Messages.JBossRuntimeStartup_JBoss_Application_Server_5_1,
Messages.JBossRuntimeStartup_JBoss_Application_Server_6_0,
Messages.JBossRuntimeStartup_JBoss_EAP_Server_4_3,
- Messages.JBossRuntimeStartup_JBoss_EAP_Server_5_0
+ Messages.JBossRuntimeStartup_JBoss_EAP_Server_5_0,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_7_0
};
public static final String JBOSS_AS_HOST = "localhost"; //$NON-NLS-1$
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Messages.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Messages.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Messages.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -15,6 +15,7 @@
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.jboss.tools.runtime.messages"; //$NON-NLS-1$
public static String JBossRuntimeStartup_JBoss_Application_Server_6_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_7_0;
public static String JBossRuntimeStartup_Cannot_create_new_JBoss_Server;
public static String JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile;
public static String JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver;
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/DroolsHandler.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/DroolsHandler.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/DroolsHandler.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -18,9 +18,11 @@
import org.drools.eclipse.util.DroolsRuntime;
import org.drools.eclipse.util.DroolsRuntimeManager;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.jboss.tools.runtime.IJBossRuntimePluginConstants;
import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
import org.jboss.tools.runtime.core.model.ServerDefinition;
+import org.osgi.framework.Bundle;
public class DroolsHandler extends AbstractRuntimeDetector implements IJBossRuntimePluginConstants {
@@ -134,4 +136,13 @@
serverDefinition.getIncludedServerDefinitions().add(sd);
}
}
+
+ @Override
+ public boolean isValid() {
+ if (super.isValid()) {
+ Bundle droolsBundle = Platform.getBundle("org.eclipse.drools");
+ return droolsBundle != null;
+ }
+ return false;
+ }
}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -13,8 +13,6 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import java.util.Properties;
@@ -51,7 +49,6 @@
import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
import org.jboss.ide.eclipse.as.core.server.bean.ServerBean;
import org.jboss.ide.eclipse.as.core.server.bean.ServerBeanLoader;
@@ -63,6 +60,8 @@
public class JBossASHandler extends AbstractRuntimeDetector implements IJBossRuntimePluginConstants {
+ private static final int JBOSS_AS7_INDEX = 8;
+
public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
createInitialJBossServer();
createJBossServerFromDefinitions(serverDefinitions);
@@ -138,6 +137,8 @@
index = 4;
} else if ("6.0".equals(version)) { //$NON-NLS-1$
index = 5;
+ } else if ("7.0".equals(version)) { //$NON-NLS-1$
+ index = 8;
}
createJBossServer(serverDefinition.getLocation(),index,serverDefinition.getName(),serverDefinition.getName() + " " + RUNTIME); //$NON-NLS-1$
}
@@ -279,20 +280,21 @@
server.setHost(JBOSS_AS_HOST);
server.setName(name);
- // JBossServer.DEPLOY_DIRECTORY
- // JBIDE-7822
- //String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
- //((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory", deployVal); //$NON-NLS-1$
- ((ServerWorkingCopy) server).setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_SERVER);
+ if (index != JBOSS_AS7_INDEX) {
+ // JBossServer.DEPLOY_DIRECTORY
+ // JBIDE-7822
+ //String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
+ //((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory", deployVal); //$NON-NLS-1$
+ ((ServerWorkingCopy) server).setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_SERVER);
- // IDeployableServer.TEMP_DEPLOY_DIRECTORY
- String deployTmpFolderVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp").append("jbosstoolsTemp").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.tempDeployDirectory", deployTmpFolderVal); //$NON-NLS-1$
+ // IDeployableServer.TEMP_DEPLOY_DIRECTORY
+ String deployTmpFolderVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp").append("jbosstoolsTemp").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.tempDeployDirectory", deployTmpFolderVal); //$NON-NLS-1$
- // If we'd need to set up a username / pw for JMX, do it here.
-// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
-// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
-
+ // If we'd need to set up a username / pw for JMX, do it here.
+// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
+// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
+ }
server.save(false, progressMonitor);
return server;
}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/messages.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/messages.properties 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/messages.properties 2011-05-24 14:00:31 UTC (rev 31443)
@@ -7,6 +7,7 @@
JBossRuntimeStartup_JBoss_Application_Server_5_0=JBoss Application Server 5.0
JBossRuntimeStartup_JBoss_Application_Server_5_1=JBoss Application Server 5.1
JBossRuntimeStartup_JBoss_Application_Server_6_0=JBoss Application Server 6.0
+JBossRuntimeStartup_JBoss_Application_Server_7_0=JBoss Application Server 7.0
JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
JBossRuntimeStartup_JBoss_EAP_Server_5_0=JBoss EAP Server 5.0
JBossRuntimeStartup_Runtime=Runtime
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -250,7 +250,7 @@
public static boolean runtimeExists(ServerDefinition serverDefinition) {
Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getRuntimeDetectors();
for (IRuntimeDetector detector:detectors) {
- if (detector.exists(serverDefinition)) {
+ if (detector.isEnabled() && detector.exists(serverDefinition)) {
return true;
}
}
@@ -258,17 +258,19 @@
}
public static void refreshPreferencePage(Shell shell) {
- Shell mainShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ Shell mainShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell();
if (shell != null && !shell.isDisposed()) {
shell.close();
- } else {
- shell = Display.getCurrent().getActiveShell();
- if (shell != mainShell) {
- shell.close();
- }
}
- shell = mainShell;
- PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(shell, RuntimePreferencePage.ID, null, null);
+ shell = Display.getCurrent().getActiveShell();
+ if (shell != mainShell && shell != null) {
+ shell.close();
+ }
+ PreferenceDialog preferenceDialog = PreferencesUtil
+ .createPreferenceDialogOn(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(),
+ RuntimePreferencePage.ID, null, null);
preferenceDialog.open();
}
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java 2011-05-24 09:55:23 UTC (rev 31442)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java 2011-05-24 14:00:31 UTC (rev 31443)
@@ -256,7 +256,13 @@
setReturnCode(OK);
close();
if (needRefresh) {
- RuntimeUIActivator.refreshPreferencePage(getShell());
+ Display.getCurrent().asyncExec(new Runnable() {
+
+ public void run() {
+ RuntimeUIActivator.refreshPreferencePage(getShell());
+ }
+ });
+
}
}
13 years, 1 month
JBoss Tools SVN: r31440 - in trunk/cdi: plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl and 3 other directories.
by jbosstools-commits@lists.jboss.org
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
13 years, 1 month
JBoss Tools SVN: r31439 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-23 17:12:28 -0400 (Mon, 23 May 2011)
New Revision: 31439
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CANotEmptyWhenThereIsNoSpaceBetweenInvertedCommandsInAttributeJBIDE1759Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CASuggestsNotOnlyELProposalsJBIDE2437Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1704Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1717Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide6259Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/MissingKBBuilderTest.java
Log:
JBIDE-8983
https://issues.jboss.org/browse/JBIDE-8983
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CANotEmptyWhenThereIsNoSpaceBetweenInvertedCommandsInAttributeJBIDE1759Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CANotEmptyWhenThereIsNoSpaceBetweenInvertedCommandsInAttributeJBIDE1759Test.java 2011-05-23 21:03:06 UTC (rev 31438)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CANotEmptyWhenThereIsNoSpaceBetweenInvertedCommandsInAttributeJBIDE1759Test.java 2011-05-23 21:12:28 UTC (rev 31439)
@@ -7,9 +7,8 @@
import junit.framework.TestSuite;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -83,10 +82,10 @@
jspTextEditor.setText(documentContentModified);
- ICompletionProposal[] result= null;
- String errorMessage = null;
+// ICompletionProposal[] result= null;
+// String errorMessage = null;
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0)); //$NON-NLS-1$
@@ -117,7 +116,7 @@
jspTextEditor.setText(documentContentModified);
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0)); //$NON-NLS-1$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CASuggestsNotOnlyELProposalsJBIDE2437Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CASuggestsNotOnlyELProposalsJBIDE2437Test.java 2011-05-23 21:03:06 UTC (rev 31438)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CASuggestsNotOnlyELProposalsJBIDE2437Test.java 2011-05-23 21:12:28 UTC (rev 31439)
@@ -10,8 +10,8 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -39,12 +39,12 @@
public void testThereAreNotOnlyELProposalsJBIDE2437 () throws BadLocationException {
openEditor(PAGE_NAME);
JobUtils.waitForIdle();
- ICompletionProposal[] result= null;
- String errorMessage = null;
+// ICompletionProposal[] result= null;
+// String errorMessage = null;
IRegion reg = new FindReplaceDocumentAdapter(document).find(0, "/templates/common.xhtml", true, true, false, false);
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, reg.getOffset());
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, reg.getOffset());
assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0)); //$NON-NLS-1$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1704Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1704Test.java 2011-05-23 21:03:06 UTC (rev 31438)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1704Test.java 2011-05-23 21:12:28 UTC (rev 31439)
@@ -1,6 +1,5 @@
package org.jboss.tools.jsf.jsp.ca.test;
-import java.util.ArrayList;
import java.util.List;
import junit.framework.Test;
@@ -9,12 +8,10 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.FindReplaceDocumentAdapter;
import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -61,9 +58,9 @@
final IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
" var=\"msg\"", true, true, false, false);
String text = document.get();
- String errorMessage = null;
+// String errorMessage = null;
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, reg.getOffset());
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, reg.getOffset());
assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1717Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1717Test.java 2011-05-23 21:03:06 UTC (rev 31438)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1717Test.java 2011-05-23 21:12:28 UTC (rev 31439)
@@ -7,9 +7,8 @@
import junit.framework.TestSuite;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -61,7 +60,7 @@
String errorMessage = null;
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
List<String> customCompletionProposals = new ArrayList<String>();
@@ -96,7 +95,7 @@
jspTextEditor.setText(documentContentModified);
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
if (res != null) {
for (ICompletionProposal proposal : res) {
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide6259Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide6259Test.java 2011-05-23 21:03:06 UTC (rev 31438)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide6259Test.java 2011-05-23 21:12:28 UTC (rev 31439)
@@ -14,9 +14,8 @@
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.common.el.core.ELCorePlugin;
import org.jboss.tools.common.el.core.ca.preferences.ELContentAssistPreferences;
-import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoELContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -124,7 +123,7 @@
// getters and setters are to be shown
setupELContentAssistPreferences(false, true);
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
@@ -137,8 +136,8 @@
// getters and setters are to be shown
setupELContentAssistPreferences(true, true);
- TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ CATestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
+ res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
@@ -152,8 +151,8 @@
setupELContentAssistPreferences(false, true);
- TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ CATestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
+ res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
@@ -167,8 +166,8 @@
setupELContentAssistPreferences(false, false);
- TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ CATestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
+ res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/MissingKBBuilderTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/MissingKBBuilderTest.java 2011-05-23 21:03:06 UTC (rev 31438)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/MissingKBBuilderTest.java 2011-05-23 21:12:28 UTC (rev 31439)
@@ -1,9 +1,8 @@
package org.jboss.tools.jsf.jsp.ca.test;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -48,7 +47,7 @@
ICompletionProposal[] result = null;
- IContentAssistProcessor p = TestUtil.getProcessor(viewer, position + offset, contentAssistant);
+ IContentAssistProcessor p = CATestUtil.getProcessor(viewer, position + offset, contentAssistant);
if (p != null) {
try {
result = p.computeCompletionProposals(viewer, position + offset);
13 years, 1 month
JBoss Tools SVN: r31438 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-23 17:03:06 -0400 (Mon, 23 May 2011)
New Revision: 31438
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
Log:
JBIDE-8983
https://issues.jboss.org/browse/JBIDE-8983
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2011-05-23 20:56:13 UTC (rev 31437)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2011-05-23 21:03:06 UTC (rev 31438)
@@ -17,8 +17,8 @@
import junit.framework.TestSuite;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.TestProjectProvider;
public class JstJspJbide1585Test extends ContentAssistantTestCase {
@@ -64,7 +64,7 @@
jspTextEditor.setText(documentContentModified);
try {
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0)); //$NON-NLS-1$
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2011-05-23 20:56:13 UTC (rev 31437)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2011-05-23 21:03:06 UTC (rev 31438)
@@ -16,11 +16,9 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -73,10 +71,10 @@
JobUtils.waitForIdle();
// ICompletionProposal[] result= null;
- String errorMessage = null;
+// String errorMessage = null;
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0));
13 years, 1 month
JBoss Tools SVN: r31437 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-23 16:56:13 -0400 (Mon, 23 May 2011)
New Revision: 31437
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java
Log:
JBIDE-8983
https://issues.jboss.org/browse/JBIDE-8983
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2011-05-23 20:34:29 UTC (rev 31436)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2011-05-23 20:56:13 UTC (rev 31437)
@@ -10,7 +10,7 @@
import org.jboss.tools.common.el.core.ELCorePlugin;
import org.jboss.tools.common.el.core.ca.preferences.ELContentAssistPreferences;
import org.jboss.tools.common.el.ui.ca.ELProposalProcessor;
-import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -70,10 +70,10 @@
jspTextEditor.setText(documentContentModified);
- ICompletionProposal[] result= null;
- String errorMessage = null;
+// ICompletionProposal[] result= null;
+// String errorMessage = null;
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
assertTrue("Content Assistant peturned no proposals", (res != null && res.size() > 0));
for (ICompletionProposal proposal : res) {
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java 2011-05-23 20:34:29 UTC (rev 31436)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java 2011-05-23 20:56:13 UTC (rev 31437)
@@ -10,7 +10,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
@@ -22,16 +21,14 @@
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.common.el.ui.ca.ELProposalProcessor;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.test.util.TestProjectProvider;
-import org.jboss.tools.test.util.WorkbenchUtils;
public class SeamELContentAssistJbide1676Test extends TestCase {
TestProjectProvider provider = null;
@@ -263,7 +260,7 @@
ISourceViewer viewer = javaEditor.getViewer();
IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(javaEditor);
+ SourceViewerConfiguration config = CATestUtil.getSourceViewerConfiguration(javaEditor);
IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
assertTrue("Cannot get the Content Assistant instance for the editor for file \"" + JAVA_FILENAME + "\"", (contentAssistant != null));
@@ -277,7 +274,7 @@
ICompletionProposal[] result= null;
String errorMessage = null;
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
+ IContentAssistProcessor p= CATestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
if (p != null) {
result= p.computeCompletionProposals(viewer, offsetToTest);
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java 2011-05-23 20:34:29 UTC (rev 31436)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java 2011-05-23 20:56:13 UTC (rev 31437)
@@ -26,7 +26,6 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
@@ -34,9 +33,9 @@
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.jboss.tools.common.el.core.ELCorePlugin;
import org.jboss.tools.common.el.core.ca.preferences.ELContentAssistPreferences;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.JobUtils;
@@ -478,7 +477,7 @@
ICompletionProposal[] result= null;
String errorMessage = null;
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offset);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offset);
assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
// if (errorMessage != null && errorMessage.trim().length() > 0) {
@@ -576,7 +575,7 @@
ICompletionProposal[] result= null;
String errorMessage = null;
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offset);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offset);
assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
// if (errorMessage != null && errorMessage.trim().length() > 0) {
// System.out.println("#" + offset + ": ERROR MESSAGE: " + errorMessage);
@@ -648,7 +647,7 @@
String errorMessage = null;
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offset);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offset);
assertNotNull("Proposals were not created.", res);
assertEquals("Incorrect number of proposals for #{'aa'.subst|ring(1)}", 3, res.size());
}
13 years, 1 month
JBoss Tools SVN: r31436 - in trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test: src/org/jboss/tools/jst/jsp/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-23 16:34:29 -0400 (Mon, 23 May 2011)
New Revision: 31436
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
Log:
JBIDE-8983
https://issues.jboss.org/browse/JBIDE-8983
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2011-05-23 20:28:31 UTC (rev 31435)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2011-05-23 20:34:29 UTC (rev 31436)
@@ -16,7 +16,7 @@
org.junit;bundle-version="3.8.2",
org.jboss.tools.jst.web;bundle-version="3.2.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
- org.jboss.tools.common.text.xml;bundle-version="3.2.0"
+ org.jboss.tools.common.model.ui
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.jboss.tools.jst.jsp.test,
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2011-05-23 20:28:31 UTC (rev 31435)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2011-05-23 20:34:29 UTC (rev 31436)
@@ -1,153 +1,7 @@
package org.jboss.tools.jst.jsp.test;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import org.jboss.tools.common.text.xml.contentassist.test.CATestUtil;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistantExtension;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
-import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
-import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
+public class TestUtil extends CATestUtil {
-public class TestUtil {
-
- /** The Constant MAX_IDLE. */
- public static final long MAX_IDLE = 5*60*1000L;
-
- /**
- * Returns the CA Processor from content assistant for the given offset in the document.
- *
- *
- * @param viewer
- * @param offset
- * @param ca
- */
-
- public static IContentAssistProcessor getProcessor(ITextViewer viewer, int offset, IContentAssistant ca) {
- try {
- IDocument document= viewer.getDocument();
- String type= TextUtilities.getContentType(document, ((IContentAssistantExtension)ca).getDocumentPartitioning(), offset, true);
- return ca.getContentAssistProcessor(type);
- } catch (BadLocationException x) {
- }
-
- return null;
- }
-
- /**
- * Process UI input but do not return for the specified time interval.
- *
- * @param waitTimeMillis
- * the number of milliseconds
- */
- public static void delay(long waitTimeMillis) {
- Display display = Display.getCurrent();
-
- // If this is the UI thread,
- // then process input.
- if (display != null) {
- long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
- while (System.currentTimeMillis() < endTimeMillis) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.update();
- }
- // Otherwise, perform a simple sleep.
- else {
- try {
- Thread.sleep(waitTimeMillis);
- } catch (InterruptedException e) {
- // Ignored.
- }
- }
- }
-
- /**
- * Wait for idle.
- */
- public static void waitForIdle(long maxIdle) {
- long start = System.currentTimeMillis();
- while (!Job.getJobManager().isIdle()) {
- delay(500);
- if ( (System.currentTimeMillis()-start) > maxIdle )
- throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
- }
- }
-
- public static SourceViewerConfiguration getSourceViewerConfiguration(AbstractTextEditor editor) {
- Class editorClass = editor.getClass();
- while (editorClass != null) {
- try {
- Method m = editorClass.getDeclaredMethod("getSourceViewerConfiguration", new Class[] {});
-
- if(m != null) {
- m.setAccessible(true);
- Object result = m.invoke(editor, new Object[]{});
- return (result instanceof SourceViewerConfiguration ? (SourceViewerConfiguration)result : null);
- }
- } catch (NoSuchMethodException ne) {
- } catch (Exception e) {
- }
- editorClass = editorClass.getSuperclass();
- }
- return null;
-
- }
-
- public static void prepareCAInvokation(IContentAssistant ca, ITextViewer viewer, int offset) {
- if (ca == null || viewer == null)
- return;
-
- // sets cursor position
- viewer.getTextWidget().setCaretOffset(offset);
-
- TestUtil.waitForIdle(TestUtil.MAX_IDLE);
- TestUtil.delay(1000);
-
- ca.showPossibleCompletions();
- }
-
- public static int MAX_CATEGORIES_COUNT = 10;
- public static List<ICompletionProposal> collectProposals(IContentAssistant ca, ITextViewer viewer, int offset) {
- prepareCAInvokation(ca, viewer, offset);
-
- final IContentAssistProcessor p= TestUtil.getProcessor(viewer, offset, ca);
- List<ICompletionProposal> res= new ArrayList<ICompletionProposal>();
- // Try to acquire all the proposal categories assuming that there are less than 10 or equal
- for (int i = 0; i < MAX_CATEGORIES_COUNT && p != null; i++) {
- ICompletionProposal[] result= p.computeCompletionProposals(viewer, offset);
- for (int j = 0; result != null && j < result.length; j++) {
- res.add(result[j]);
- }
- }
- return ProposalSorter.filterAndSortProposals(res, null, null);
- }
- /**
- * Close all opened editors
- * @author mareshkau
- */
- public static final void closeAllEditors(){
- IWorkbenchPage page = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage();
- IWorkbenchPart part = page.getViewReferences()[0].getPart(false);
- page.activate(part);
- // close
- page.closeAllEditors(false);
- }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2011-05-23 20:28:31 UTC (rev 31435)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2011-05-23 20:34:29 UTC (rev 31436)
@@ -11,38 +11,19 @@
package org.jboss.tools.jst.jsp.test.ca;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.common.text.xml.contentassist.test.AbstractContentAssistantTestCase;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.WorkbenchUtils;
-public class ContentAssistantTestCase extends TestCase {
- protected IProject project = null;
+public class ContentAssistantTestCase extends AbstractContentAssistantTestCase {
protected JSPMultiPageEditor jspEditor = null;
protected JSPTextEditor jspTextEditor = null;
- protected StructuredTextViewer viewer = null;
- protected IContentAssistant contentAssistant = null;
- protected IDocument document = null;
- public void openEditor(String fileName) {
- IEditorPart editorPart = WorkbenchUtils.openEditor(project.getName()+"/"+ fileName); //$NON-NLS-1$
-// System.out.println("openEditor: " + project.getName()+"/"+ fileName);
+ protected void obtainTextEditor(IEditorPart editorPart) {
if (editorPart instanceof JSPMultiPageEditor)
jspEditor = (JSPMultiPageEditor) editorPart;
@@ -52,141 +33,14 @@
// clean deffered events
while (Display.getCurrent().readAndDispatch());
- jspTextEditor = jspEditor.getJspEditor();
- viewer = jspTextEditor.getTextViewer();
- document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil
- .getSourceViewerConfiguration(jspTextEditor);
- contentAssistant = (config == null ? null : config
- .getContentAssistant(viewer));
-
- assertTrue(
- "Cannot get the Content Assistant instance for the editor for page \"" //$NON-NLS-1$
- + fileName + "\"", (contentAssistant != null)); //$NON-NLS-1$
-
- assertTrue("The IDocument is not instance of IStructuredDocument for page \"" //$NON-NLS-1$
- + fileName + "\"", //$NON-NLS-1$
- (document instanceof IStructuredDocument));
-
+ textEditor = jspTextEditor = jspEditor.getJspEditor();
}
- public ICompletionProposal[] checkProposals(String fileName, int offset, String[] proposals, boolean exactly) {
- return checkProposals(fileName, null, offset, proposals, exactly, true);
- }
-
- public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly) {
- return checkProposals(fileName, substring, offset, proposals, exactly, false);
+ protected boolean isRelevantProposal(ICompletionProposal proposal) {
+ return proposal instanceof AutoContentAssistantProposal;
}
- public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly, boolean excludeELProposalsFromExactTest){
-// System.out.println("checkProposals >>> Enterring");
-// System.out.println("checkProposals >>> invoking openEditor() for " + fileName);
- openEditor(fileName);
-// System.out.println("checkProposals >>> openEditor() is invoked for " + fileName);
- int position = 0;
- if (substring != null) {
- String documentContent = document.get();
- position = documentContent.indexOf(substring);
- }
-
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, position+offset);
-
- assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0)); //$NON-NLS-1$
-
- // for (int i = 0; i < result.length; i++) {
- // System.out.println("proposal - "+result[i].getDisplayString());
- // }
-
- ICompletionProposal[] result = res.toArray(new ICompletionProposal[res.size()]);
- int foundCounter = 0;
- for (int i = 0; i < proposals.length; i++) {
- boolean found = compareProposal(proposals[i], result);
- if (found)
- foundCounter++;
- assertTrue("Proposal " + proposals[i] + " not found!", found ); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (exactly) {
- if (excludeELProposalsFromExactTest) {
- assertTrue("Some other proposals were found!", foundCounter == proposals.length); //$NON-NLS-1$
- } else {
- assertTrue("Some other proposals were found!", result.length == proposals.length); //$NON-NLS-1$
- }
- }
-
-// System.out.println("checkProposals <<< Exiting");
- return result;
- }
-
- public boolean compareProposal(String proposalName, ICompletionProposal[] proposals){
- for (int i = 0; i < proposals.length; i++) {
- if (proposals[i] instanceof AutoContentAssistantProposal) {
- AutoContentAssistantProposal ap = (AutoContentAssistantProposal)proposals[i];
- String replacementString = ap.getReplacementString().toLowerCase();
- if (replacementString.equalsIgnoreCase(proposalName)) return true;
-
-
- // For a tag proposal there will be not only the the tag name but all others characters like default attributes, tag ending characters and so on
- if (replacementString.indexOf("/>") != -1) {
- replacementString = replacementString.substring(0, replacementString.indexOf("/>"));
- }
- if (replacementString.indexOf('>') != -1) {
- replacementString = replacementString.substring(0, replacementString.indexOf('>'));
- }
- if (replacementString.equalsIgnoreCase(proposalName)) return true;
-
- String[] replacementStringParts = replacementString.split(" "); //$NON-NLS-1$
- if (replacementStringParts != null && replacementStringParts.length > 0) {
- if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
- }
-
- // for an attribute proposal there will be a pare of attribute-value (i.e. attrName="attrValue")
- replacementStringParts = replacementString.split("="); //$NON-NLS-1$
- if (replacementStringParts != null && replacementStringParts.length > 0) {
- if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
- }
-
- // for an Unclosed EL the closing character is appended to the proposal string (i.e. person} )
- // perform case sensitive compare operation
- replacementStringParts = replacementString.split("}"); //$NON-NLS-1$
- if (replacementStringParts != null && replacementStringParts.length > 0) {
- if (replacementStringParts[0].equals(proposalName)) return true;
- }
-
- // For an attribute value proposal there will be the quote characters
- replacementString = Utils.trimQuotes(replacementString);
- if (replacementString.equalsIgnoreCase(proposalName)) return true;
-
- } else {
- if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase())) return true;
- }
- }
- return false;
- }
-
- public void closeEditor() {
- if (jspEditor != null) {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getActivePage().closeEditor(jspEditor, false);
- jspEditor = null;
- }
- }
-
/**
- * @return the project
- */
- public IProject getProject() {
- return project;
- }
-
- /**
- * @param project the project to set
- */
- public void setProject(IProject project) {
- this.project = project;
- }
-
- /**
* @return the jspEditor
*/
public JSPMultiPageEditor getJspEditor() {
@@ -214,45 +68,4 @@
this.jspTextEditor = jspTextEditor;
}
- /**
- * @return the viewer
- */
- public StructuredTextViewer getViewer() {
- return viewer;
- }
-
- /**
- * @param viewer the viewer to set
- */
- public void setViewer(StructuredTextViewer viewer) {
- this.viewer = viewer;
- }
-
- /**
- * @return the contentAssistant
- */
- public IContentAssistant getContentAssistant() {
- return contentAssistant;
- }
-
- /**
- * @param contentAssistant the contentAssistant to set
- */
- public void setContentAssistant(IContentAssistant contentAssistant) {
- this.contentAssistant = contentAssistant;
- }
-
- /**
- * @return the document
- */
- public IDocument getDocument() {
- return document;
- }
-
- /**
- * @param document the document to set
- */
- public void setDocument(IDocument document) {
- this.document = document;
- }
}
\ No newline at end of file
13 years, 1 month
JBoss Tools SVN: r31435 - trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-23 16:28:31 -0400 (Mon, 23 May 2011)
New Revision: 31435
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
Log:
JBIDE-8983
https://issues.jboss.org/browse/JBIDE-8983
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2011-05-23 20:27:12 UTC (rev 31434)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2011-05-23 20:28:31 UTC (rev 31435)
@@ -27,6 +27,7 @@
org.jboss.tools.common.el.core,
org.jboss.tools.common.ui,
org.jboss.tools.common.el.ui,
+ org.jboss.tools.common.text.xml,
org.jboss.tools.jsf.text.ext,
org.eclipse.datatools.enablement.hsqldb,
org.eclipse.debug.core,
13 years, 1 month