JBoss Tools SVN: r27147 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-03 09:56:12 -0500 (Fri, 03 Dec 2010)
New Revision: 27147
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterWizard.java
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilter.java
Log:
[JBIDE-7688] renamed ImageFilter to ImageFilterWizard since it is a wizard
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilter.java 2010-12-03 13:41:37 UTC (rev 27146)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilter.java 2010-12-03 14:56:12 UTC (rev 27147)
@@ -1,52 +0,0 @@
-package org.jboss.tools.internal.deltacloud.ui.wizards;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.core.DeltaCloudManager;
-import org.jboss.tools.deltacloud.ui.ErrorUtils;
-
-public class ImageFilter extends Wizard {
-
- private DeltaCloud cloud;
- private ImageFilterPage mainPage;
-
- public ImageFilter(DeltaCloud cloud) {
- this.cloud = cloud;
- }
-
- @Override
- public void addPages() {
- // TODO Auto-generated method stub
- mainPage = new ImageFilterPage(cloud);
- addPage(mainPage);
- }
-
- @Override
- public boolean canFinish() {
- return mainPage.isPageComplete();
- }
-
- @Override
- public boolean performFinish() {
- String nameRule = mainPage.getNameRule();
- String idRule = mainPage.getIdRule();
- String archRule = mainPage.getArchRule();
- String descRule = mainPage.getDescRule();
-
- try {
- cloud.updateImageFilter(nameRule + ";" + //$NON-NLS-1$
- idRule + ";" + //$NON-NLS-1$
- archRule + ";" + //$NON-NLS-1$
- descRule);
- DeltaCloudManager.getDefault().saveClouds();
- } catch (Exception e) {
- // TODO: internationalize strings
- ErrorUtils.handleError(
- "Error",
- "Cloud not get update filters on cloud " + cloud.getName(), e, getShell());
- }
-
- return true;
- }
-
-}
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterWizard.java (from rev 27061, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilter.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterWizard.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterWizard.java 2010-12-03 14:56:12 UTC (rev 27147)
@@ -0,0 +1,52 @@
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.ui.ErrorUtils;
+
+public class ImageFilterWizard extends Wizard {
+
+ private DeltaCloud cloud;
+ private ImageFilterPage mainPage;
+
+ public ImageFilterWizard(DeltaCloud cloud) {
+ this.cloud = cloud;
+ }
+
+ @Override
+ public void addPages() {
+ // TODO Auto-generated method stub
+ mainPage = new ImageFilterPage(cloud);
+ addPage(mainPage);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return mainPage.isPageComplete();
+ }
+
+ @Override
+ public boolean performFinish() {
+ String nameRule = mainPage.getNameRule();
+ String idRule = mainPage.getIdRule();
+ String archRule = mainPage.getArchRule();
+ String descRule = mainPage.getDescRule();
+
+ try {
+ cloud.updateImageFilter(nameRule + ";" + //$NON-NLS-1$
+ idRule + ";" + //$NON-NLS-1$
+ archRule + ";" + //$NON-NLS-1$
+ descRule);
+ DeltaCloudManager.getDefault().saveClouds();
+ } catch (Exception e) {
+ // TODO: internationalize strings
+ ErrorUtils.handleError(
+ "Error",
+ "Cloud not get update filters on cloud " + cloud.getName(), e, getShell());
+ }
+
+ return true;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27146 - trunk/archives/tests/org.jboss.ide.eclipse.archives.test/libs.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-12-03 08:41:37 -0500 (Fri, 03 Dec 2010)
New Revision: 27146
Modified:
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/libs/some.jar
Log:
JBIDE-7199 unit test still not fixed
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/libs/some.jar
===================================================================
(Binary files differ)
14 years
JBoss Tools SVN: r27145 - trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-12-03 08:40:10 -0500 (Fri, 03 Dec 2010)
New Revision: 27145
Modified:
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java
Log:
JBIDE-7199 unit test still not fixed
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java 2010-12-03 13:28:03 UTC (rev 27144)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java 2010-12-03 13:40:10 UTC (rev 27145)
@@ -10,25 +10,29 @@
******************************************************************************/
package org.jboss.ide.eclipse.archives.test.projects;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.Date;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
import junit.framework.TestCase;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
import org.jboss.ide.eclipse.archives.test.ArchivesTest;
-import org.jboss.tools.test.util.ResourcesUtils;
import org.osgi.framework.Bundle;
+import de.schlichtherle.io.AbstractArchiveDetector;
+import de.schlichtherle.io.ArchiveDetector;
import de.schlichtherle.io.File;
+import de.schlichtherle.io.archive.spi.ArchiveDriver;
/**
* This class tests first and foremost
@@ -45,25 +49,14 @@
public class InnerZipResourceTimestampTest extends TestCase {
private long startTime;
private Bundle bundle;
- private final String projName = "InnerZipProj";
- private IProject project;
- IPath projLocation;
- private IFolder outputDir, libDir;
protected void setUp() throws Exception {
startTime = new Date().getTime();
bundle = ArchivesTest.getDefault().getBundle();
- project = ResourcesUtils.createEclipseProject(projName, new NullProgressMonitor());
- projLocation = project.getLocation(); // for debugging
- assertTrue(project.exists());
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- outputDir = project.getFolder("output");
- outputDir.create(true, true, new NullProgressMonitor());
- assertTrue(outputDir.exists());
- libDir = project.getFolder("libs");
- libDir.create(true, true, new NullProgressMonitor());
- assertTrue(libDir.exists());
}
-
+
+ protected void tearDown() throws Exception {
+ }
+
protected java.io.File findSomeJar() {
try {
URL bundleURL = FileLocator.toFileURL(bundle.getEntry(""));
@@ -73,28 +66,91 @@
return null;
}
+ public void testRawTruezipTimestamps() {
+ java.io.File someJar = findSomeJar();
+ IPath src = new Path(someJar.getAbsolutePath());
+ IPath dest = ArchivesTest.getDefault().getStateLocation().append("some.jar");
+ //File destFile = new de.schlichtherle.io.File(dest.toOSString(), new PureSourceArchiveDetector());
+ File destFile = new de.schlichtherle.io.File(dest.toOSString(), ArchiveDetector.NULL);
+
+ boolean copySuccess = new de.schlichtherle.io.File(someJar).archiveCopyAllTo(destFile);
+ destFile.setLastModified(new Date().getTime());
+ TrueZipUtil.umount();
+ assertTrue(copySuccess);
+ java.io.File destNonTruezip = new java.io.File(destFile.getAbsolutePath());
+ assertTrue(destNonTruezip.exists());
+ assertTrue(destNonTruezip.isFile());
+ assertTrue(destNonTruezip.lastModified() > someJar.lastModified());
+
+ verifyEquals(src, dest, "plugin.xml");
+ verifyEquals(src, dest, "plugin.properties");
+ verifyEquals(src, dest, "about.html");
+ verifyEquals(src, dest, ".options");
+ verifyEquals(src, dest, ".api_description");
+ verifyEquals(src, dest, "jdtCompilerAdapter.jar");
+
+ IPath tmp1 = ArchivesTest.getDefault().getStateLocation().append("tmp1");
+ IPath tmp2 = ArchivesTest.getDefault().getStateLocation().append("tmp2");
+ tmp1.toFile().mkdir();
+ tmp2.toFile().mkdir();
+ unzipFile(src, tmp1);
+ unzipFile(dest, tmp2);
+
+ String[] children = tmp1.toFile().list();
+ for( int i = 0; i < children.length; i++ ) {
+ assertTrue(tmp1.append(children[i]).toFile().exists());
+ assertTrue(tmp1.append(children[i]).toFile().isFile());
+ assertTrue(tmp2.append(children[i]).toFile().isFile());
+ assertTrue(tmp2.append(children[i]).toFile().isFile());
+ assertEquals(tmp1.append(children[i]).toFile().length(),
+ tmp2.append(children[i]).toFile().length());
+ }
+ System.out.println("DONE");
+ }
- protected void tearDown() throws Exception {
- ResourcesUtils.deleteProject(projName);
+ private void verifyEquals(IPath src, IPath dest, String relative) {
+ File prePath = new File(src.append(relative).toOSString());
+ File postPath = new File(dest.append(relative).toOSString());
+ assertEquals(prePath.lastModified(), postPath.lastModified());
+ assertEquals(prePath.length(), postPath.length());
}
-
- public void testInnerZipTimestamps() {
- // test the original
- java.io.File someJar = findSomeJar();
- File file = TrueZipUtil.getFile(new Path(someJar.getAbsolutePath()).append("META-INF").append("MANIFEST.MF"));
- long last = file.lastModified();
- assertTrue(last < startTime);
-
+
+
+
+ public static void unzipFile(IPath zipped, IPath toLoc) {
+ toLoc.toFile().mkdirs();
+ final int BUFFER = 2048;
try {
- boolean copyVal = TrueZipUtil.copyFile(someJar.getAbsolutePath(), libDir.getLocation().append("some.jar"));
- TrueZipUtil.umount();
- IPath workspaceJarPath = libDir.getLocation().append("some.jar");
- long workspaceJarLastModified = workspaceJarPath.toFile().lastModified();
- assertTrue(workspaceJarLastModified > startTime);
- File workspaceFile = TrueZipUtil.getFile(workspaceJarPath.append("META-INF").append("MANIFEST.MF"));
- long workspaceResourceMod = workspaceFile.lastModified();
- assertTrue(workspaceResourceMod < startTime);
- } catch(IOException ioe) {
- } finally {}
+ BufferedOutputStream dest = null;
+ FileInputStream fis = new
+ FileInputStream(zipped.toFile());
+ ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
+ ZipEntry entry;
+ while((entry = zis.getNextEntry()) != null) {
+ int count;
+ byte data[] = new byte[BUFFER];
+ // write the files to the disk
+ toLoc.append(entry.getName()).toFile().getParentFile().mkdirs();
+ if( !toLoc.append(entry.getName()).toFile().exists()) {
+ FileOutputStream fos = new FileOutputStream(toLoc.append(entry.getName()).toOSString());
+ dest = new BufferedOutputStream(fos, BUFFER);
+ while ((count = zis.read(data, 0, BUFFER)) != -1) {
+ dest.write(data, 0, count);
+ }
+ dest.flush();
+ dest.close();
+ }
+ }
+ zis.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
}
+
+
+ private static class PureSourceArchiveDetector extends AbstractArchiveDetector {
+ public ArchiveDriver getArchiveDriver(String path) {
+ return null;
+ }
+ }
}
14 years
JBoss Tools SVN: r27144 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-03 08:28:03 -0500 (Fri, 03 Dec 2010)
New Revision: 27144
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
Log:
[JBIDE-7688] removed duplicate methods
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2010-12-03 13:27:06 UTC (rev 27143)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2010-12-03 13:28:03 UTC (rev 27144)
@@ -10,7 +10,11 @@
******************************************************************************/
package org.jboss.tools.deltacloud.core;
-public interface ICloudElementFilter {
+/**
+ * @author Jeff Johnston
+ * @author André Dietisheim
+ */
+public interface ICloudElementFilter<CLOUDCHILD> {
public static final String EXPRESSION_DELIMITER = ";"; // $NON-NLS-1$
@@ -22,6 +26,11 @@
+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // arch
+ ALL_MATCHER_EXPRESSION; // desc
+ public boolean isVisible(CLOUDCHILD cloudChild);
+ public void setRules(String ruleString);
+ public IFieldMatcher getNameRule();
+ public IFieldMatcher getIdRule();
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java 2010-12-03 13:27:06 UTC (rev 27143)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java 2010-12-03 13:28:03 UTC (rev 27144)
@@ -10,12 +10,12 @@
******************************************************************************/
package org.jboss.tools.deltacloud.core;
-public interface IImageFilter extends ICloudElementFilter {
+/**
+ * @author Jeff Johnston
+ * @author André Dietisheim
+ */
+public interface IImageFilter extends ICloudElementFilter<DeltaCloudImage> {
- public boolean isVisible(DeltaCloudImage image);
- public void setRules(String ruleString);
- public IFieldMatcher getNameRule();
- public IFieldMatcher getIdRule();
public IFieldMatcher getArchRule();
public IFieldMatcher getDescRule();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2010-12-03 13:27:06 UTC (rev 27143)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2010-12-03 13:28:03 UTC (rev 27144)
@@ -10,12 +10,12 @@
******************************************************************************/
package org.jboss.tools.deltacloud.core;
-public interface IInstanceFilter extends ICloudElementFilter {
+/**
+ * @author Jeff Johnston
+ * @author André Dietisheim
+ */
+public interface IInstanceFilter extends ICloudElementFilter<DeltaCloudInstance> {
- public boolean isVisible(DeltaCloudInstance instance);
- public void setRules(String ruleString);
- public IFieldMatcher getNameRule();
- public IFieldMatcher getIdRule();
public IFieldMatcher getImageIdRule();
public IFieldMatcher getOwnerIdRule();
public IFieldMatcher getKeyNameRule();
14 years
JBoss Tools SVN: r27143 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-03 08:27:06 -0500 (Fri, 03 Dec 2010)
New Revision: 27143
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
Log:
[JBIDE-7688] added copyright header and author
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2010-12-03 12:48:25 UTC (rev 27142)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2010-12-03 13:27:06 UTC (rev 27143)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.deltacloud.core;
import java.util.regex.PatternSyntaxException;
@@ -2,2 +12,5 @@
+/**
+ * @author Jeff Johnston
+ */
public class InstanceFilter implements IInstanceFilter {
@@ -63,7 +76,6 @@
public IFieldMatcher getIdRule() {
return idRule;
}
-
@Override
public IFieldMatcher getImageIdRule() {
14 years
JBoss Tools SVN: r27142 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2010-12-03 07:48:25 -0500 (Fri, 03 Dec 2010)
New Revision: 27142
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
Log:
esb tests: fixed project example test
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2010-12-03 12:33:40 UTC (rev 27141)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2010-12-03 12:48:25 UTC (rev 27142)
@@ -13,8 +13,10 @@
SWTBotTree tree = projectExplorer.show().bot().tree();
SWTBotTreeItem proj = tree.select(project).getTreeItem(project);
boolean fixed=false;
+ boolean found=false;
for (SWTBotTreeItem item : proj.getItems()) {
if (item.getText().startsWith(lib)) {
+ found = true;
ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.PROPERTIES, false)).click();
SWTBotShell shell = bot.activeShell();
@@ -24,7 +26,8 @@
break;
}
}
- if (!fixed) {
+ if (!fixed && found) {
+ log.error("Libray starting with '"+lib+"' in project '"+project+"' was not fixed.");
bot.sleep(Long.MAX_VALUE);
}
}
14 years
JBoss Tools SVN: r27141 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-12-03 07:33:40 -0500 (Fri, 03 Dec 2010)
New Revision: 27141
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
Log:
https://jira.jboss.org/browse/JBIDE-6575 Added 5.1.3. Inconsistent specialization validation rules.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java 2010-12-03 12:33:40 UTC (rev 27141)
@@ -54,12 +54,10 @@
*/
Set<IBeanMethod> getObserverMethods();
-
/**
- * Returns all directly derived classes that declare annotation @Specializes
+ * Returns all the directly derived classes that declare annotation @Specializes
*
- * @return
+ * @return all the directly derived classes that declare annotation @Specializes
*/
Set<? extends IClassBean> getSpecializingBeans();
-
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-12-03 12:33:40 UTC (rev 27141)
@@ -51,6 +51,7 @@
defaultPreferences.put(CDIPreferences.ILLEGAL_CONDITIONAL_OBSERVER, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.MISSING_OR_INCORRECT_TARGET_OR_RETENTION_IN_ANNOTATION_TYPE, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.INCONSISTENT_SPECIALIZATION, CDIPreferences.WARNING);
defaultPreferences.putInt(SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME, SeverityPreferences.DEFAULT_MAX_NUMBER_OF_MARKERS_PER_FILE);
}
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java 2010-12-03 12:33:40 UTC (rev 27141)
@@ -224,6 +224,10 @@
// - interceptor is annotated @Specializes (4.3.1 non-portable)
// - decorator is annotated @Specializes (4.3.1 non-portable)
public static final String INTERCEPTOR_ANNOTATED_SPECIALIZES = INSTANCE.createSeverityOption("interceptorAnnotatedSpecializes"); //$NON-NLS-1$
+// 5.1.3. Inconsistent specialization
+// - Suppose an enabled bean X specializes a second bean Y. If there is another enabled bean that specializes Y we say that inconsistent
+// specialization exists. The container automatically detects inconsistent specialization and treats it as a deployment problem.
+ public static final String INCONSISTENT_SPECIALIZATION = INSTANCE.createSeverityOption("inconsistentSpecialization"); //$NON-NLS-1$
//Miscellaneous
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-03 12:33:40 UTC (rev 27141)
@@ -110,7 +110,7 @@
CDIProjectSet projectSet;
private BeansXmlValidationDelegate beansXmlValidator = new BeansXmlValidationDelegate(this);
- private AnnotationValidationDelegate annptationValidator = new AnnotationValidationDelegate(this);
+ private AnnotationValidationDelegate annotationValidator = new AnnotationValidationDelegate(this);
/*
* (non-Javadoc)
@@ -313,7 +313,7 @@
Set<String> scopes = cdiProject.getScopeNames();
for (String scope: scopes) {
- annptationValidator.validateScopeType(cdiProject.getScope(scope));
+ annotationValidator.validateScopeType(cdiProject.getScope(scope));
}
List<IFile> beansXmls = getAllBeansXmls();
@@ -350,7 +350,7 @@
validateQualifier(qualifier);
IScope scope = cdiProject.getScope(file.getFullPath());
- annptationValidator.validateScopeType(scope);
+ annotationValidator.validateScopeType(scope);
IInterceptorBinding binding = cdiProject.getInterceptorBinding(file.getFullPath());
validateInterceptorBinding(binding);
@@ -673,49 +673,75 @@
addError(CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, CDIPreferences.INTERCEPTOR_ANNOTATED_SPECIALIZES, specializesDeclaration, bean.getResource());
}
}
+ IBean specializedBean = bean.getSpecializedBean();
+ if(specializedBean!=null) {
+ if(!specializedBean.getBeanClass().isReadOnly()) {
+ getValidationContext().addLinkedCoreResource(bean.getSourcePath().toOSString(), specializedBean.getResource().getFullPath(), false);
+ }
- IBean specializingBean = bean.getSpecializedBean();
- if(specializingBean==null) {
- return;
- }
- if(!specializingBean.getBeanClass().isReadOnly()) {
- getValidationContext().addLinkedCoreResource(bean.getSourcePath().toOSString(), specializingBean.getResource().getFullPath(), false);
- }
-
- String beanClassName = bean.getBeanClass().getElementName();
- String beanName = bean instanceof IBeanMethod?beanClassName + "." + ((IBeanMethod)bean).getSourceMember().getElementName() + "()":beanClassName;
- String specializingBeanClassName = specializingBean.getBeanClass().getElementName();
- String specializingBeanName = specializingBean instanceof IBeanMethod?specializingBeanClassName + "." + ((IBeanMethod)specializingBean).getSourceMember().getElementName() + "()":specializingBeanClassName;
- /*
- * 4.3.1. Direct and indirect specialization
- * - X specializes Y but does not have some bean type of Y
- */
- Set<IParametedType> beanTypes = bean.getLegalTypes();
- Set<IParametedType> specializingBeanTypes = specializingBean.getLegalTypes();
- for (IParametedType specializingType : specializingBeanTypes) {
- boolean found = false;
- for (IParametedType type : beanTypes) {
- if(specializingType.getType().getFullyQualifiedName().equals(type.getType().getFullyQualifiedName())) {
- found = true;
- break;
+ String beanClassName = bean.getBeanClass().getElementName();
+ String beanName = bean instanceof IBeanMethod?beanClassName + "." + ((IBeanMethod)bean).getSourceMember().getElementName() + "()":beanClassName;
+ String specializingBeanClassName = specializedBean.getBeanClass().getElementName();
+ String specializingBeanName = specializedBean instanceof IBeanMethod?specializingBeanClassName + "." + ((IBeanMethod)specializedBean).getSourceMember().getElementName() + "()":specializingBeanClassName;
+ /*
+ * 4.3.1. Direct and indirect specialization
+ * - X specializes Y but does not have some bean type of Y
+ */
+ Set<IParametedType> beanTypes = bean.getLegalTypes();
+ Set<IParametedType> specializingBeanTypes = specializedBean.getLegalTypes();
+ for (IParametedType specializingType : specializingBeanTypes) {
+ boolean found = false;
+ for (IParametedType type : beanTypes) {
+ if(specializingType.getType().getFullyQualifiedName().equals(type.getType().getFullyQualifiedName())) {
+ found = true;
+ break;
+ }
}
+ if(!found) {
+ addError(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, CDIPreferences.MISSING_TYPE_IN_SPECIALIZING_BEAN,
+ new String[]{beanName, specializingBeanName, specializingType.getType().getElementName()},
+ bean.getSpecializesAnnotationDeclaration(), bean.getResource());
+ }
}
- if(!found) {
- addError(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, CDIPreferences.MISSING_TYPE_IN_SPECIALIZING_BEAN,
- new String[]{beanName, specializingBeanName, specializingType.getType().getElementName()},
- bean.getSpecializesAnnotationDeclaration(), bean.getResource());
+ /*
+ * 4.3.1. Direct and indirect specialization
+ * - X specializes Y and Y has a name and X declares a name explicitly, using @Named
+ */
+ if(specializedBean.getName()!=null) {
+ IAnnotationDeclaration nameDeclaration = bean.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ if(nameDeclaration!=null) {
+ addError(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, CDIPreferences.CONFLICTING_NAME_IN_SPECIALIZING_BEAN,
+ new String[]{beanName, specializingBeanName},
+ nameDeclaration, bean.getResource());
+ }
}
- }
- /*
- * 4.3.1. Direct and indirect specialization
- * - X specializes Y and Y has a name and X declares a name explicitly, using @Named
- */
- if(specializingBean.getName()!=null) {
- IAnnotationDeclaration nameDeclaration = bean.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
- if(nameDeclaration!=null) {
- addError(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, CDIPreferences.CONFLICTING_NAME_IN_SPECIALIZING_BEAN,
- new String[]{beanName, specializingBeanName},
- nameDeclaration, bean.getResource());
+ /*
+ * 5.1.3. Inconsistent specialization
+ * - Suppose an enabled bean X specializes a second bean Y. If there is another enabled bean that specializes Y we say that inconsistent
+ * specialization exists. The container automatically detects inconsistent specialization and treats it as a deployment problem.
+ */
+ if(bean.isEnabled() && specializedBean instanceof IClassBean) {
+ IClassBean supperClassBean = (IClassBean)specializedBean;
+ Set<? extends IClassBean> allSpecializingBeans = supperClassBean.getSpecializingBeans();
+ if(allSpecializingBeans.size()>1) {
+ StringBuffer sb = new StringBuffer(bean.getSimpleJavaName());
+ boolean moreThanTwo = false;
+ for (IClassBean specializingBean : allSpecializingBeans) {
+ if(specializingBean!=bean && specializingBean.isEnabled()) {
+ sb.append(", ").append(specializingBean.getSimpleJavaName());
+ moreThanTwo = true;
+ if(!specializingBean.getBeanClass().isReadOnly()) {
+ getValidationContext().addLinkedCoreResource(specializingBean.getResource().getFullPath().toOSString(), bean.getSourcePath(), false);
+ getValidationContext().addLinkedCoreResource(bean.getSourcePath().toOSString(), specializingBean.getResource().getFullPath(), false);
+ }
+ }
+ }
+ if(moreThanTwo && specializesDeclaration!=null) {
+ addError(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, CDIPreferences.INCONSISTENT_SPECIALIZATION,
+ new String[]{sb.toString(), supperClassBean.getSimpleJavaName()},
+ specializesDeclaration, bean.getResource());
+ }
+ }
}
}
}
@@ -2099,7 +2125,7 @@
}
try {
- annptationValidator.validateStereotypeAnnotationTypeAnnotations(stereotype, resource);
+ annotationValidator.validateStereotypeAnnotationTypeAnnotations(stereotype, resource);
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
}
@@ -2145,7 +2171,7 @@
* Qualifier annotation type should be annotated with @Target({METHOD, FIELD, PARAMETER, TYPE})
*/
try {
- annptationValidator.validateQualifierAnnotationTypeAnnotations(qualifier, resource);
+ annotationValidator.validateQualifierAnnotationTypeAnnotations(qualifier, resource);
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-12-03 12:33:40 UTC (rev 27141)
@@ -130,6 +130,7 @@
public static String CONFLICTING_NAME_IN_SPECIALIZING_BEAN;
public static String INTERCEPTOR_ANNOTATED_SPECIALIZES;
public static String DECORATOR_ANNOTATED_SPECIALIZES;
+ public static String INCONSISTENT_SPECIALIZATION;
public static String ILLEGAL_INJECTING_USERTRANSACTION_TYPE;
public static String ILLEGAL_INJECTING_INJECTIONPOINT_TYPE;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-12-03 12:33:40 UTC (rev 27141)
@@ -184,6 +184,9 @@
Deployment problems
+5.1.3. Inconsistent specialization
+- Suppose an enabled bean X specializes a second bean Y. If there is another enabled bean that specializes Y we say that inconsistent
+ specialization exists. The container automatically detects inconsistent specialization and treats it as a deployment problem.
5.2.1. Unsatisfied and ambiguous dependencies
- If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and
@@ -240,10 +243,4 @@
the class with the specified name is not an interceptor class, the container automatically detects the problem and treats it as
a deployment problem.
- If the same class is listed twice under the <interceptors> element, the container automatically detects the problem and treats it as
- a deployment problem.
-
- Unimplemented:
-
-5.1.3. Inconsistent specialization
-- Suppose an enabled bean X specializes a second bean Y. If there is another enabled bean that specializes Y we say that inconsistent
- specialization exists. The container automatically detects inconsistent specialization and treats it as a deployment problem.
\ No newline at end of file
+ a deployment problem.
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-12-03 12:33:40 UTC (rev 27141)
@@ -109,6 +109,7 @@
CONFLICTING_NAME_IN_SPECIALIZING_BEAN=Bean {0} specializes {1} and {1} has a name and {0} declares a name explicitly, using @Named [JSR-299 �4.3.1]
INTERCEPTOR_ANNOTATED_SPECIALIZES=Interceptor is annotated @Specializes [JSR-299 �4.3.1]
DECORATOR_ANNOTATED_SPECIALIZES=Decorator is annotated @Specializes [JSR-299 �4.3.1]
+INCONSISTENT_SPECIALIZATION=There are a few enabled beans ({0}) that specialize the same bean {1} [JSR-299 �5.1.3]
ILLEGAL_INJECTING_USERTRANSACTION_TYPE=Java EE component class has an injection point of type UserTransaction and qualifier @Default, and may not validly make use of the JTA UserTransaction according to the Java EE platform specification [JSR-299 �3.6]
ILLEGAL_INJECTING_INJECTIONPOINT_TYPE=Java EE component class supporting injection that is not a bean has an injection point of type InjectionPoint and qualifier @Default [JSR-299 �5.5.7]
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-12-03 12:33:40 UTC (rev 27141)
@@ -134,6 +134,7 @@
{CDIPreferences.MISSING_TYPE_IN_SPECIALIZING_BEAN, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingTypeInSpecializingBean_label},
{CDIPreferences.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_conflictingNameInSpecializingBean_label},
{CDIPreferences.INTERCEPTOR_ANNOTATED_SPECIALIZES, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_interceptorAnnotatedSpecializes_label},
+ {CDIPreferences.INCONSISTENT_SPECIALIZATION, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_inconsistentSpecialization_label},
},
CDICorePlugin.PLUGIN_ID
);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java 2010-12-03 12:33:40 UTC (rev 27141)
@@ -117,6 +117,7 @@
public static String CDIValidatorConfigurationBlock_pb_missingTypeInSpecializingBean_label;
public static String CDIValidatorConfigurationBlock_pb_conflictingNameInSpecializingBean_label;
public static String CDIValidatorConfigurationBlock_pb_interceptorAnnotatedSpecializes_label;
+ public static String CDIValidatorConfigurationBlock_pb_inconsistentSpecialization_label;
// Miscellaneous
public static String CDIValidatorConfigurationBlock_section_miscellaneous;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2010-12-03 12:33:40 UTC (rev 27141)
@@ -106,6 +106,7 @@
CDIValidatorConfigurationBlock_pb_missingTypeInSpecializingBean_label=Missing type in Specializing Bean:
CDIValidatorConfigurationBlock_pb_conflictingNameInSpecializingBean_label=Conflicting name in Specializing Bean:
CDIValidatorConfigurationBlock_pb_interceptorAnnotatedSpecializes_label=Interceptor or decorator annotated @Specializes:
+CDIValidatorConfigurationBlock_pb_inconsistentSpecialization_label=Inconsistent specialization:
##Miscellaneous
CDIValidatorConfigurationBlock_section_miscellaneous=Miscellaneous
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-12-03 11:32:19 UTC (rev 27140)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-12-03 12:33:40 UTC (rev 27141)
@@ -22,6 +22,20 @@
public class DeploymentProblemsValidationTests extends ValidationTest {
/**
+ * 5.1.3. Inconsistent specialization
+ * - Suppose an enabled bean X specializes a second bean Y. If there is another enabled bean that specializes Y we say that inconsistent
+ * specialization exists. The container automatically detects inconsistent specialization and treats it as a deployment problem.
+ *
+ * @throws Exception
+ */
+ public void testInconsistentSpecialization() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Maid.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Maid, Manager", "Employee"), 21);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Manager.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Manager, Maid", "Employee"), 21);
+ }
+
+ /**
* 5.2.1. Unsatisfied and ambiguous dependencies
* - If an unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
*
14 years
JBoss Tools SVN: r27140 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-03 06:32:19 -0500 (Fri, 03 Dec 2010)
New Revision: 27140
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java
Log:
JBIDE-7721
https://jira.jboss.org/browse/JBIDE-7721
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2010-12-03 11:16:49 UTC (rev 27139)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2010-12-03 11:32:19 UTC (rev 27140)
@@ -84,4 +84,8 @@
old = ((CDIProject)cdiProject).replaceBeanXML(old);
}
}
+
+ public void testCustomDecorator() throws CoreException {
+ getDecorator("JavaSource/org/jboss/jsr299/tck/tests/decorators/custom/VehicleDecorator.java");
+ }
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java 2010-12-03 11:16:49 UTC (rev 27139)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java 2010-12-03 11:32:19 UTC (rev 27140)
@@ -10,15 +10,18 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
+
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IInterceptor;
import org.jboss.tools.cdi.core.IInterceptorBinding;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
import org.jboss.tools.cdi.core.IStereotype;
@@ -138,4 +141,11 @@
}
+ public void testCustomInterceptor() throws CoreException {
+ String path = "JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SimpleInterceptorWithoutAnnotations.java";
+ IClassBean bean = getClassBean(path);
+ assertNotNull("Can't find the bean.", bean);
+ assertTrue("The bean is not a decorator.", bean instanceof IInterceptor);
+ }
+
}
14 years
JBoss Tools SVN: r27139 - trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-12-03 06:16:49 -0500 (Fri, 03 Dec 2010)
New Revision: 27139
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java
Log:
JBIDE-7744 - unit test failure, adding asserts to investigate
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java 2010-12-03 10:51:13 UTC (rev 27138)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java 2010-12-03 11:16:49 UTC (rev 27139)
@@ -12,6 +12,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IModule;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
+import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.ide.eclipse.as.core.publishers.SingleFilePublisher;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
@@ -190,12 +191,23 @@
assertEquals(mods.length, 1);
server = ServerRuntimeUtils.addModule(server, mods[0]);
IPath deployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
- deployRoot.toFile().mkdirs();
+ File f0 = deployRoot.toFile();
+ assertFalse(f0.exists());
+ assertTrue(deployRoot.toFile().mkdirs());
assertEquals(IOUtil.countFiles(deployRoot.toFile()), 0);
assertEquals(IOUtil.countAllResources(deployRoot.toFile()), 1);
-
+
// publish and verify deployment
+ File publishLog = ServerLogger.getDefault().getServerLogFile(server);
+ publishLog.delete();
+ assertTrue(!publishLog.exists());
+ IJBossServerPublisher publisher = ExtensionManager.getDefault().getPublisher(server, mods, "local");
+ assertNotNull(publisher);
+ assertTrue(publisher.getClass().getName() + " not equal to WTPZippedPublisher",
+ publisher.getClass().getName().contains("WTPZippedPublisher"));
ServerRuntimeUtils.publish(server);
+ assertTrue(publishLog.exists());
+ System.out.println(IOUtil.getContents(publishLog));
assertEquals(IOUtil.countFiles(deployRoot.toFile()), 1);
assertEquals(IOUtil.countAllResources(deployRoot.toFile()), 2);
14 years
JBoss Tools SVN: r27138 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-03 05:51:13 -0500 (Fri, 03 Dec 2010)
New Revision: 27138
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/StringUtils.java
Log:
[JBIDE-7149] added listener to gloabl selection, changing selected cloud in instance- and image-view accordingly
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/StringUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/StringUtils.java 2010-12-03 10:45:59 UTC (rev 27137)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/StringUtils.java 2010-12-03 10:51:13 UTC (rev 27138)
@@ -10,7 +10,9 @@
******************************************************************************/
package org.jboss.tools.internal.deltacloud.ui.utils;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
/**
* @author Andre Dietisheim
@@ -21,12 +23,12 @@
* Returns a formatted string for a collection of elements that get
* formatted by a user supplied element formatter.
*
- * @param <E>
- * the element type
* @param elements
+ * the elements to be processed
+ * @param elements
* the elements
* @param elementFormatter
- * the element formatter
+ * the formatter to apply on each element to be processed
* @return the formatted string
*/
public static <E> String getFormattedString(Collection<E> elements, IElementFormatter<E> elementFormatter) {
@@ -48,4 +50,27 @@
public String format(E element);
}
+ /**
+ * Returns a collection of formatted strings for the given collection of
+ * elements and given formatter
+ *
+ * @param <E>
+ * the type of elements that shall be processed
+ * @param elements
+ * the elements to be processed
+ * @param elementFormatter
+ * the formatter to apply on each element to be processed
+ * @return the formatted strings
+ */
+ public static <E> Collection<String> getFormattedStrings(Collection<E> elements,
+ IElementFormatter<E> elementFormatter) {
+ List<String> strings = new ArrayList<String>();
+ for (E element : elements) {
+ String formattedElement = elementFormatter.format(element);
+ if (formattedElement != null && formattedElement.length() > 0) {
+ strings.add(formattedElement);
+ }
+ }
+ return strings;
+ }
}
14 years