Author: dazarov
Date: 2010-05-24 10:05:12 -0400 (Mon, 24 May 2010)
New Revision: 22282
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Foo.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Producer.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerDecorator.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerImpl.java
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/decorators/invocation/producer/method/CustomProducerImpl.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointInProducerMethodHyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6311
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/decorators/invocation/producer/method/CustomProducerImpl.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/decorators/invocation/producer/method/CustomProducerImpl.java 2010-05-24
13:46:57 UTC (rev 22281)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/decorators/invocation/producer/method/CustomProducerImpl.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.jsr299.tck.tests.decorators.invocation.producer.method;
-
-import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.New;
-import javax.enterprise.inject.Produces;
-
-
-/**
- * @author pmuir
- *
- */
-public class CustomProducerImpl implements Producer
-{
-
- private static boolean disposedCorrectly = false;
-
- /**
- * @param log the log to set
- */
- public static void reset()
- {
- disposedCorrectly = false;
- }
-
- @Produces
- public Foo produce()
- {
- return new Foo("foo!");
- }
-
- @Produces
- public Foo produce2((a)New(Foo.class) Foo order)
- {
- return new Foo("foo!");
- }
-
- public void dispose(@Disposes Foo foo)
- {
- disposedCorrectly = foo.getFoo().equals("decorated");
- }
-
- /**
- * @return the disposedCorrectly
- */
- public static boolean isDisposedCorrectly()
- {
- return disposedCorrectly;
- }
-
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -0,0 +1,50 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.New;
+import javax.enterprise.inject.Produces;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public class CustomProducerImpl implements Producer
+{
+
+ private static boolean disposedCorrectly = false;
+
+ /**
+ * @param log the log to set
+ */
+ public static void reset()
+ {
+ disposedCorrectly = false;
+ }
+
+ @Produces
+ public Foo produce()
+ {
+ return new Foo("foo!");
+ }
+
+ @Produces
+ public Foo produce2((a)New(Foo.class) Foo order)
+ {
+ return new Foo("foo!");
+ }
+
+ public void dispose(@Disposes Foo foo)
+ {
+ disposedCorrectly = foo.getFoo().equals("decorated");
+ }
+
+ /**
+ * @return the disposedCorrectly
+ */
+ public static boolean isDisposedCorrectly()
+ {
+ return disposedCorrectly;
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Foo.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Foo.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Foo.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+/**
+ * @author pmuir
+ *
+ */
+public class Foo
+{
+
+ private String foo;
+
+ public Foo(String foo)
+ {
+ this.foo = foo;
+ }
+
+ /**
+ * @return the foo
+ */
+ public String getFoo()
+ {
+ return foo;
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Producer.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Producer.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Producer.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public interface Producer
+{
+
+ public Foo produce();
+
+ public void dispose(Foo foo);
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/Producer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerDecorator.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerDecorator.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerDecorator.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -0,0 +1,38 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+
+/**
+ * @author pmuir
+ *
+ */
+@Decorator
+public class ProducerDecorator implements Producer
+{
+
+ @Inject @Delegate
+ private Producer producer;
+
+ public Foo produce()
+ {
+ return new Foo(producer.produce().getFoo() + "!!");
+ }
+
+ /**
+ * @param message the message to set
+ */
+ public static void reset()
+ {
+
+ }
+
+ public void dispose(Foo foo)
+ {
+ producer.dispose(new Foo("decorated"));
+ }
+
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerDecorator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerImpl.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerImpl.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerImpl.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -0,0 +1,43 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public class ProducerImpl implements Producer
+{
+
+ private static boolean disposedCorrectly = false;
+
+ /**
+ * @param log the log to set
+ */
+ public static void reset()
+ {
+ disposedCorrectly = false;
+ }
+
+ @Produces
+ public Foo produce()
+ {
+ return new Foo("foo!");
+ }
+
+ public void dispose(@Disposes Foo foo)
+ {
+ disposedCorrectly = foo.getFoo().equals("decorated");
+ }
+
+ /**
+ * @return the disposedCorrectly
+ */
+ public static boolean isDisposedCorrectly()
+ {
+ return disposedCorrectly;
+ }
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ProducerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java 2010-05-24
13:46:57 UTC (rev 22281)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -38,7 +38,8 @@
.getActiveWorkbenchWindow().getActivePage();
return IDE.openEditor(page, input, true);
} catch (PartInitException pie) {
-
+ pie.printStackTrace();
+ fail(pie.getMessage());
}
}
return null;
@@ -67,7 +68,10 @@
IRegion region = null;
try {
region = JavaWordFinder.findWord(document, offset);
- } catch (Exception x) {}
+ } catch (Exception x) {
+ x.printStackTrace();
+ fail(x.getMessage());
+ }
return region;
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2010-05-24
13:46:57 UTC (rev 22281)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -3,35 +3,22 @@
import java.util.ArrayList;
import junit.framework.Test;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.DocumentProviderRegistry;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlinkDetector;
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
-import org.jboss.tools.common.text.ext.util.AxisUtil;
public class InjectedPointHyperlinkDetectorTest extends HyperlinkDetectorTest {
private static final String PROJECT_NAME = "/tests/lookup/injectionpoint";
@@ -56,25 +43,21 @@
FileEditorInput editorInput = new FileEditorInput(javaFile);
IDocumentProvider documentProvider = null;
- Throwable exception = null;
try {
documentProvider =
DocumentProviderRegistry.getDefault().getDocumentProvider(editorInput);
} catch (Exception x) {
- exception = x;
x.printStackTrace();
+ fail("An exception caught: " + x.getMessage());
}
- assertNull("An exception caught: " + (exception != null?
exception.getMessage() : ""), exception);
assertNotNull("The document provider for the file \"" + FILE_NAME +
"\" is not loaded", documentProvider);
try {
documentProvider.connect(editorInput);
} catch (Exception x) {
- exception = x;
x.printStackTrace();
- assertTrue("The document provider is not able to be initialized with the editor
input", false);
+ fail("The document provider is not able to be initialized with the editor
input\nAn exception caught: "+x.getMessage());
}
- assertNull("An exception caught: " + (exception != null?
exception.getMessage() : ""), exception);
IDocument document = documentProvider.getDocument(editorInput);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointInProducerMethodHyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointInProducerMethodHyperlinkDetectorTest.java 2010-05-24
13:46:57 UTC (rev 22281)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointInProducerMethodHyperlinkDetectorTest.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -21,8 +21,8 @@
import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlinkDetector;
public class InjectedPointInProducerMethodHyperlinkDetectorTest extends
HyperlinkDetectorTest{
- private static final String PROJECT_NAME =
"/tests/decorators/invocation/producer/method";
- private static final String FILE_NAME =
"JavaSource/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/CustomProducerImpl.java";
+ private static final String PROJECT_NAME = "/tests/jbt/openon";
+ private static final String FILE_NAME =
"JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/CustomProducerImpl.java";
public static Test suite() {
return new TestSuite(InjectedPointInProducerMethodHyperlinkDetectorTest.class);
@@ -43,25 +43,21 @@
FileEditorInput editorInput = new FileEditorInput(javaFile);
IDocumentProvider documentProvider = null;
- Throwable exception = null;
try {
documentProvider =
DocumentProviderRegistry.getDefault().getDocumentProvider(editorInput);
} catch (Exception x) {
- exception = x;
x.printStackTrace();
+ fail("An exception caught: " + x.getMessage());
}
- assertNull("An exception caught: " + (exception != null?
exception.getMessage() : ""), exception);
assertNotNull("The document provider for the file \"" + FILE_NAME +
"\" is not loaded", documentProvider);
try {
documentProvider.connect(editorInput);
} catch (Exception x) {
- exception = x;
x.printStackTrace();
- assertTrue("The document provider is not able to be initialized with the editor
input", false);
+ fail("The document provider is not able to be initialized with the editor
input\nAn exception caught: "+x.getMessage());
}
- assertNull("An exception caught: " + (exception != null?
exception.getMessage() : ""), exception);
IDocument document = documentProvider.getDocument(editorInput);
@@ -70,9 +66,9 @@
InjectedPointHyperlinkDetector elPartitioner = new InjectedPointHyperlinkDetector();
ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(1374, 5)); // order
- regionList.add(new Region(1462, 3));
- regionList.add(new Region(1498, 3));
+ regionList.add(new Region(571, 5)); // order
+ regionList.add(new Region(659, 3));
+ regionList.add(new Region(695, 3));
IEditorPart part = openFileInEditor(javaFile);
ISourceViewer viewer = null;
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java 2010-05-24
13:46:57 UTC (rev 22281)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java 2010-05-24
14:05:12 UTC (rev 22282)
@@ -43,25 +43,21 @@
FileEditorInput editorInput = new FileEditorInput(javaFile);
IDocumentProvider documentProvider = null;
- Throwable exception = null;
try {
documentProvider =
DocumentProviderRegistry.getDefault().getDocumentProvider(editorInput);
} catch (Exception x) {
- exception = x;
x.printStackTrace();
+ fail("An exception caught: " + x.getMessage());
}
- assertNull("An exception caught: " + (exception != null?
exception.getMessage() : ""), exception);
assertNotNull("The document provider for the file \"" + FILE_NAME +
"\" is not loaded", documentProvider);
try {
documentProvider.connect(editorInput);
} catch (Exception x) {
- exception = x;
x.printStackTrace();
- assertTrue("The document provider is not able to be initialized with the editor
input", false);
+ fail("The document provider is not able to be initialized with the editor
input\nAn exception caught: "+x.getMessage());
}
- assertNull("An exception caught: " + (exception != null?
exception.getMessage() : ""), exception);
IDocument document = documentProvider.getDocument(editorInput);