Author: akazakov
Date: 2011-09-09 15:09:18 -0400 (Fri, 09 Sep 2011)
New Revision: 34615
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java
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/marker/CDIMarkerResolutionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
Log:
https://issues.jboss.org/browse/JBIDE-9685 Seam JMS: CDI validator should be aware of JMS
resource injections
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -394,8 +394,34 @@
}
/**
- * Return @Named declaration or the stereotype declaration if it declares @Named.
+ * Returns the annotation declaration directly or indirectly declared for this element.
+ * For instance some annotation directly declared for the element may declare wanted
annotation then the method will return this declaration.
+ * So the returned declaration may be from a resource other than the resource of the
element.
+ * Returns null if no declaration found.
*
+ * @param injection
+ * @param qualifierTypeName
+ * @return
+ */
+ public static IAnnotationDeclaration getAnnotationDeclaration(IAnnotated element, String
annotationTypeName) {
+ List<IAnnotationDeclaration> declarations = element.getAnnotations();
+ for (IAnnotationDeclaration declaration : declarations) {
+ IAnnotationType type = declaration.getAnnotation();
+ if(type!=null) {
+ if(annotationTypeName.equals(type.getSourceType().getFullyQualifiedName())) {
+ return declaration;
+ }
+ if(type instanceof IAnnotated) {
+ return getAnnotationDeclaration((IAnnotated)type, annotationTypeName);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns @Named declaration or the stereotype declaration if it declares @Named.
+ *
* @param stereotyped
* @return
*/
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.cdi.core;
+import org.jboss.tools.common.java.IAnnotated;
+
/**
* Represents a qualifier.
*
* @author Viacheslav Kabanovich
*/
-public interface IQualifier extends ICDIAnnotation {
+public interface IQualifier extends ICDIAnnotation, IAnnotated {
}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -20,14 +20,16 @@
import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationMemberDefinition;
+import org.jboss.tools.common.java.IAnnotated;
import org.jboss.tools.common.java.IAnnotationDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class CDIAnnotationElement extends CDIElement implements ICDIAnnotation {
+public class CDIAnnotationElement extends CDIElement implements ICDIAnnotation,
IAnnotated {
protected AnnotationDefinition definition;
@@ -88,9 +90,49 @@
return definition.getAnnotation(typeName);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.java.IAnnotated#getAnnotations()
+ */
+ @Override
+ public List<IAnnotationDeclaration> getAnnotations() {
+ return definition.getAnnotations();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.java.IAnnotated#getAnnotation(java.lang.String)
+ */
+ @Override
+ public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
+ return definition.getAnnotation(annotationTypeName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.java.IAnnotated#getAnnotationPosition(java.lang.String)
+ */
+ @Override
+ public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
+ return definition.getAnnotationPosition(annotationTypeName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.java.IAnnotated#isAnnotationPresent(java.lang.String)
+ */
+ @Override
+ public boolean isAnnotationPresent(String annotationTypeName) {
+ return definition.isAnnotationPresent(annotationTypeName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
public String toString() {
String type = getSourceType() == null ? "" :
getSourceType().getFullyQualifiedName();
return super.toString() + " type=" + type;
}
-
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml 2011-09-09 18:35:11 UTC
(rev 34614)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml 2011-09-09 19:09:18 UTC
(rev 34615)
@@ -12,21 +12,22 @@
<extension
point="org.jboss.tools.cdi.core.cdiextensions">
- <cdiextension
-
class="org.jboss.tools.cdi.seam.core.international.CDISeamInternationalExtension"
-
runtime="org.jboss.seam.international.status.TypedStatusMessageBundleExtension">
- </cdiextension>
- <cdiextension
-
class="org.jboss.tools.cdi.seam.core.persistence.CDISeamPersistenceExtension"
-
runtime="org.jboss.seam.persistence.ManagedPersistenceContextExtension">
- </cdiextension>
- </extension>
-
- <extension
- point="org.jboss.tools.cdi.core.cdiextensions">
+ <cdiextension
+
class="org.jboss.tools.cdi.seam.core.international.CDISeamInternationalExtension"
+
runtime="org.jboss.seam.international.status.TypedStatusMessageBundleExtension">
+ </cdiextension>
<cdiextension
+
class="org.jboss.tools.cdi.seam.core.persistence.CDISeamPersistenceExtension"
+
runtime="org.jboss.seam.persistence.ManagedPersistenceContextExtension">
+ </cdiextension>
+ <cdiextension
class="org.jboss.tools.cdi.seam.core.servlet.SeamServletExtension"
runtime="org.jboss.seam.servlet.ServletExtension">
</cdiextension>
+ <cdiextension
+ class="org.jboss.tools.cdi.seam.core.jms.JmsDestinationExtension"
+ runtime="org.jboss.seam.jms.Seam3JmsExtension">
+ </cdiextension>
</extension>
+
</plugin>
\ No newline at end of file
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.jms;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.CDIUtil;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JmsDestinationExtension implements ICDIExtension,
IInjectionPointValidatorFeature {
+
+ private static final Set<String> INJECTION_TYPES = new HashSet<String>();
+ static{
+ INJECTION_TYPES.add("javax.jms.Connection");
+ INJECTION_TYPES.add("javax.jms.Session");
+ INJECTION_TYPES.add("javax.jms.Topic");
+ INJECTION_TYPES.add("javax.jms.Queue");
+ INJECTION_TYPES.add("javax.jms.TopicPublisher");
+ INJECTION_TYPES.add("javax.jms.QueueSender");
+ INJECTION_TYPES.add("javax.jms.TopicSubscriber");
+ INJECTION_TYPES.add("javax.jms.QueueReceiver");
+ }
+
+ private static final String JMS_DESTINATION_QUALIFIER =
"org.jboss.seam.jms.annotations.JmsDestination";
+
+ /**
+ * The following JMS resources are available for injection in Seam JMS:
+ *
+ * javax.jms.Connection
+ * javax.jms.Session
+ *
+ * Destination-based resources:
+ *
+ * javax.jms.Topic
+ * javax.jms.Queue
+ * javax.jms.TopicPublisher
+ * javax.jms.QueueSender
+ * javax.jms.TopicSubscriber
+ * javax.jms.QueueReceiver
+ *
+ * If an injection has any type from the list above and also it has a qualifier
JmsDestination then it should be ignored by CDI validator.
+ *
+ * See
https://issues.jboss.org/browse/JBIDE-9685
+ */
+ @Override
+ public boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint
injection) {
+ if(typeOfInjectionPoint!=null &&
INJECTION_TYPES.contains(typeOfInjectionPoint.getFullyQualifiedName())) {
+ IAnnotationDeclaration declaration = CDIUtil.getAnnotationDeclaration(injection,
JMS_DESTINATION_QUALIFIER);
+ return declaration!=null;
+ }
+ return false;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -31,7 +31,6 @@
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.test.tck.validation.CoreValidationTest;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.common.EclipseUtil;
@@ -42,8 +41,6 @@
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.common.validation.ValidatorManager;
-import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.osgi.framework.Bundle;
@@ -75,10 +72,10 @@
if(tckProject==null) {
try {
tckProject = findTestProject();
- if(tckProject==null || !tckProject.exists()) {
+ if(!tckProject.exists()) {
// ValidatorManager.setStatus(CoreValidationTest.VALIDATION_STATUS);
tckProject = importPreparedProject("/");
- TestUtil._waitForValidation(tckProject);
+// TestUtil._waitForValidation(tckProject);
// TestUtil.waitForValidation();
}
} catch (Exception e) {
@@ -101,7 +98,7 @@
public static IProject importPreparedProject(String packPath) throws Exception {
Bundle b = Platform.getBundle(PLUGIN_ID);
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- if(project==null || !project.exists()) {
+ if(!project.exists()) {
project = ResourcesUtils.importProject(b, PROJECT_PATH);
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
}
@@ -120,7 +117,8 @@
FileUtil.copyDir(from, webInfTo, true, true, true, new XmlFileFilter());
}
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
+ TestUtil._waitForValidation(project);
+// JobUtils.waitForIdle();
return project;
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -15,12 +15,13 @@
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.common.base.test.contentassist.CATestUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
-import org.jboss.tools.test.util.JobUtils;
/**
* Test case testing
http://jira.jboss.com/jira/browse/JBIDE-9633 issue.
@@ -40,17 +41,8 @@
}
public void setUp() {
- if (project == null) {
- try {
- IProject testProject = TCKUITest.importPreparedProject("/tests/lookup");
- testProject = TCKUITest.importPreparedProject("/tests/ca");
- caTest.setProject(testProject);
- project = testProject;
- } catch (Exception e) {
- project = null;
- e.printStackTrace();
- }
- }
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(TCKTest.PROJECT_NAME);
+ caTest.setProject(project);
}
public void testCAELProposalFilteringInJSP () {
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -13,6 +13,7 @@
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
@@ -27,14 +28,9 @@
private String[] beanProposals = new String[] {"example",
"example.com", "fishJBT", "game", "haddock",
"salmon", "sheep", "tunaFarm", "whitefishJBT",
"wolf"};
private String[] propertyProposals = new String[] {"game.value",
"game.initialize()"};
- public CATest() {
- super();
- try {
- project = TCKUITest.importPreparedProject("/tests/lookup");
- caTest.setProject(project);
- } catch (Exception e) {
- e.printStackTrace();
- }
+ public void setUp() {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(TCKTest.PROJECT_NAME);
+ caTest.setProject(project);
}
public void testEL() {
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-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -65,21 +65,12 @@
suiteAll.addTestSuite(NewCDIClassWizardFactoryTest.class);
suiteAll.addTestSuite(CDIPreferencePageTest.class);
suiteAll.addTestSuite(NewCDIWizardTest.class);
- suiteAll.addTestSuite(CATest.class);
suiteAll.addTestSuite(CAELProposalFilteringTest.class);
suite.addTestSuite(CDISearchParticipantTest.class);
suite.addTestSuite(ELReferencesQueryParticipantTest.class);
- suiteAll.addTest(new CDICoreTestSetup(suite) {
- @Override
- protected void setUp() throws Exception {
- tckProject = TCKUITest.importPreparedProject("/");
- }
- protected void tearDown() throws Exception {
- tckProject.delete(true, true, null);
- }
- }
- );
+ suite.addTestSuite(CATest.class);
+ suiteAll.addTest(new CDICoreTestSetup(suite));
suiteAll.addTestSuite(AddQualifiersToBeanWizardTest.class);
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -1,74 +0,0 @@
-package org.jboss.tools.cdi.ui.test;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.cdi.core.test.tck.TCKTest;
-import org.jboss.tools.cdi.core.test.tck.TCKTest.JavaFileFilter;
-import org.jboss.tools.cdi.core.test.tck.TCKTest.PageFileFilter;
-import org.jboss.tools.cdi.core.test.tck.TCKTest.XmlFileFilter;
-import org.jboss.tools.cdi.core.test.tck.validation.CoreValidationTest;
-import org.jboss.tools.common.EclipseUtil;
-import org.jboss.tools.common.base.test.validation.TestUtil;
-import org.jboss.tools.common.java.IParametedType;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
-import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.common.validation.ValidatorManager;
-import org.jboss.tools.test.util.ResourcesUtils;
-import org.osgi.framework.Bundle;
-
-public class TCKUITest extends TCKTest {
- public IProject getTestProject() {
- try {
- if(tckProject==null) {
- tckProject = findTestProject();
- if(tckProject==null || !tckProject.exists()) {
- ValidatorManager.setStatus(CoreValidationTest.VALIDATION_STATUS);
- tckProject = importPreparedProject("/");
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail("Can't import CDI test project: " + e.getMessage());
- }
-
- return tckProject;
- }
-
- public static IProject importPreparedProject(String packPath) throws Exception {
- Bundle b = Platform.getBundle(PLUGIN_ID);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- if(project==null || !project.exists()) {
- project = ResourcesUtils.importProject(b, PROJECT_PATH);
- }
- String projectPath = project.getLocation().toOSString();
- String resourcePath = FileLocator.resolve(b.getEntry(TCK_RESOURCES_PREFIX)).getFile();
-
- File from = new File(resourcePath + packPath);
- if(from.isDirectory()) {
- File javaSourceTo = new File(projectPath + JAVA_SOURCE_SUFFIX + PACKAGE + packPath);
- FileUtil.copyDir(from, javaSourceTo, true, true, true, new JavaFileFilter());
-
- File webContentTo = new File(projectPath + WEB_CONTENT_SUFFIX);
- FileUtil.copyDir(from, webContentTo, true, true, true, new PageFileFilter());
-
- File webInfTo = new File(projectPath + WEB_CONTENT_SUFFIX + WEB_INF_SUFFIX);
- FileUtil.copyDir(from, webInfTo, true, true, true, new XmlFileFilter());
- }
-
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- project.build(IncrementalProjectBuilder.CLEAN_BUILD,null);
- project.build(IncrementalProjectBuilder.FULL_BUILD,null);
- TestUtil._waitForValidation(project);
-
- return project;
- }
-}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -24,7 +24,7 @@
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
-import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.marker.AddAnnotationMarkerResolution;
@@ -40,16 +40,14 @@
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
-import org.jboss.tools.cdi.ui.test.TCKUITest;
import org.jboss.tools.common.base.test.validation.TestUtil;
import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.common.validation.ValidatorManager;
/**
* @author Daniel Azarov
*
*/
-public class CDIMarkerResolutionTest extends TCKUITest {
+public class CDIMarkerResolutionTest extends TCKTest {
private void checkResolution(IProject project, String[] fileNames, String markerType,
String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws
CoreException {
checkResolution(project, fileNames, new String[]{}, markerType, idName, id,
resolutionClass);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -30,10 +30,9 @@
import org.jboss.tools.cdi.ui.search.CDIBeanQueryParticipant;
import org.jboss.tools.cdi.ui.search.CDIMatch;
import org.jboss.tools.cdi.ui.search.InjectionPointQueryParticipant;
-import org.jboss.tools.cdi.ui.test.TCKUITest;
import org.jboss.tools.common.EclipseUtil;
-public class CDISearchParticipantTest extends TCKUITest {
+public class CDISearchParticipantTest extends TCKTest {
private static final int FIELD_SEARCH = 1;
private static final int METHOD_SEARCH = 2;
private static final int TYPE_SEARCH = 3;
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -3,12 +3,12 @@
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
-import org.jboss.tools.cdi.ui.test.TCKUITest;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.jst.web.kb.refactoring.ELReferencesQueryParticipant;
import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils;
import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.MatchStructure;
-public class ELReferencesQueryParticipantTest extends TCKUITest{
+public class ELReferencesQueryParticipantTest extends TCKTest{
public void testELReferencesQueryParticipantForType() throws CoreException{
ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
Modified:
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 2011-09-09
18:35:11 UTC (rev 34614)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java 2011-09-09
19:09:18 UTC (rev 34615)
@@ -10,6 +10,7 @@
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.common.java.IAnnotationDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
public class CDIQualifier implements IQualifier{
private ICDIProject project;
@@ -62,7 +63,6 @@
@Override
public ICDIProject getDeclaringProject() {
- // TODO Auto-generated method stub
return null;
}
@@ -70,4 +70,24 @@
public boolean exists() {
return false;
}
+
+ @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;
+ }
}
\ No newline at end of file