JBoss Tools SVN: r20069 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common: meta/action/impl and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-02 09:09:31 -0500 (Tue, 02 Feb 2010)
New Revision: 20069
Added:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerContext.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java
Removed:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerExtension.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModel.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/CreateFileHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/ExtensionChange.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarFolderImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/AuxiliaryFileRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/MainFileRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/DeleteProjectHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/DefaultEntityRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/MappedEntityRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5781
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -24,8 +24,12 @@
public class AntEntityRecognizer implements EntityRecognizer {
private static final QualifiedName[] SUPPORTED_OPTIONS = new QualifiedName[] {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK};
public AntEntityRecognizer() {}
+
+ public String getEntityName(EntityRecognizerContext context) {
+ return getEntityName(context.getExtension(), context.getBody());
+ }
- public String getEntityName(String ext, String body) {
+ String getEntityName(String ext, String body) {
if(body == null) return null;
IContentType cd = Platform.getContentTypeManager().getContentType("org.eclipse.ant.core.antBuildFile"); //$NON-NLS-1$
AntBuildfileContentDescriber d = new AntBuildfileContentDescriber();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -20,6 +20,7 @@
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.CreateFileHandler;
+import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
public class DefaultWizardDataValidator implements WizardDataValidator {
@@ -97,7 +98,7 @@
String entity = support.action.getProperty(XMetaDataConstants.ENTITY);
if(entity == null) {
String ext = null;
- entity = (ext != null) ? support.getTarget().getModel().getEntityRecognizer().getEntityName(ext, null)
+ entity = (ext != null) ? support.getTarget().getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(ext))
: ds[step].getModelEntity().getName();
if(entity == null || support.getTarget().getModel().getMetaData().getEntity(entity) == null)
entity = ds[step].getModelEntity().getName();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModel.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModel.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModel.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -16,7 +16,6 @@
import org.jboss.tools.common.model.event.*;
import org.jboss.tools.common.model.undo.XUndoManager;
import org.jboss.tools.common.model.loaders.EntityRecognizer;
-import org.jboss.tools.common.model.loaders.EntityRecognizerExtension;
import org.jboss.tools.common.model.filesystems.impl.FileSystemPeer;
/**
@@ -180,7 +179,7 @@
* Returns a singleton used to resolve entity of a file object.
* @return
*/
- public EntityRecognizerExtension getEntityRecognizer();
+ public EntityRecognizer getEntityRecognizer();
/**
* Returns registry keeping time stamps of loaded file objects.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -25,6 +25,7 @@
import org.jboss.tools.common.meta.impl.XMetaDataConstants;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.filesystems.impl.*;
+import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.loaders.impl.MappedEntityRecognizer;
import org.jboss.tools.common.model.plugin.ModelMessages;
import org.jboss.tools.common.model.util.*;
@@ -298,7 +299,7 @@
entity = action.getProperty(XMetaDataConstants.ENTITY);
}
if(entity == null) {
- entity = new MappedEntityRecognizer().getEntityName(extension, null);
+ entity = new MappedEntityRecognizer().getEntityName(new EntityRecognizerContext(extension));
}
if(entity != null && getTarget().getModel().getMetaData().getEntity(entity) != null) {
return entity;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -163,7 +163,7 @@
if(body == null) return;
if(!isForceLoadOn() && body.equals(getAsText())) return;
- String entity = getModel().getEntityRecognizer().getEntityName(toFileName(this), getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION), body);
+ String entity = getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(toFileName(this), getAttributeValue(XModelObjectConstants.ATTR_NAME_EXTENSION), body));
if(entity == null || !entity.equals(getModelEntity().getName())) {
String[] errors = (body.length() == 0) ? null : XMLUtil.getXMLErrors(new java.io.StringReader(body), false);
if(errors == null || errors.length == 0) errors = new String[]{"Doctype has been changed. Please save file for the change to take effect in object model. :0:0"};
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/CreateFileHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/CreateFileHandler.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/CreateFileHandler.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -19,6 +19,7 @@
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.meta.action.impl.handlers.*;
import org.jboss.tools.common.meta.impl.XMetaDataConstants;
+import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.util.*;
public class CreateFileHandler extends DefaultCreateHandler {
@@ -32,7 +33,7 @@
String ext = p.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION);
String entity = action.getProperty(XMetaDataConstants.ENTITY);
if(entity == null) {
- entity = (ext != null) ? object.getModel().getEntityRecognizer().getEntityName(ext, null)
+ entity = (ext != null) ? object.getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(ext))
: data[0].getModelEntity().getName();
if(entity == null || object.getModel().getMetaData().getEntity(entity) == null)
entity = data[0].getModelEntity().getName();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/ExtensionChange.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/ExtensionChange.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/ExtensionChange.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -20,6 +20,7 @@
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.loaders.XObjectLoader;
import org.jboss.tools.common.model.undo.XTransactionUndo;
import org.jboss.tools.common.model.undo.XUndoManager;
@@ -41,7 +42,7 @@
private boolean execute() {
XModel model = file.getModel();
- String entity = model.getEntityRecognizer().getEntityName(extension, null);
+ String entity = model.getEntityRecognizer().getEntityName(new EntityRecognizerContext(extension));
String oldEntity = file.getModelEntity().getName();
String body = __body();
if(body == null) return false;
@@ -50,7 +51,7 @@
if(FileUtil.isText(body)) entity = "FileTXT";
else return false;
} else if(entity == null) {
- entity = model.getEntityRecognizer().getEntityName(extension, body);
+ entity = model.getEntityRecognizer().getEntityName(new EntityRecognizerContext(extension, body));
}
if(entity == null || model.getMetaData().getEntity(entity) == null) entity = "FileAny";
if(file.getModelEntity().getName().equals(entity)) return false;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -48,6 +48,7 @@
import org.jboss.tools.common.model.impl.RegularObjectImpl;
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.model.loaders.AuxiliaryLoader;
+import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.loaders.Reloadable;
import org.jboss.tools.common.model.loaders.XObjectLoader;
import org.jboss.tools.common.model.loaders.impl.PropertiesLoader;
@@ -205,14 +206,14 @@
parseFileName(p, f.getName());
String ext = p.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION);
String body = null;
- String entity = getModel().getEntityRecognizer().getEntityName(f.getName(), ext, body);
+ String entity = getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(f.getName(), ext, body));
if("FileAny".equals(entity)) { //$NON-NLS-1$
boolean isText = XModelObjectLoaderUtil.isTextFile(f, 100);
if(f.length() > 100000 || !isText) entity = XModelObjectConstants.ENT_FILE_ANY_LONG;
else if(isText) entity = "FileTXT"; //$NON-NLS-1$
} else /*if(entity == null)*/ {
body = getBodySource(f).get();
- entity = getModel().getEntityRecognizer().getEntityName(f.getName(), ext, body);
+ entity = getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(f.getName(), ext, body));
}
if(entity == null || getModel().getMetaData().getEntity(entity) == null) entity = "FileAny"; //$NON-NLS-1$
p.setProperty(XMetaDataConstants.ENTITY, entity);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarFolderImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarFolderImpl.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarFolderImpl.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -84,13 +84,13 @@
FolderImpl.parseFileName(p, name);
String ext = p.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION);
String body = null;
- String entity = getModel().getEntityRecognizer().getEntityName(name, ext, body);
+ String entity = getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(name, ext, body));
if("FileAny".equals(entity)) { //$NON-NLS-1$
if(jar.getSize(cpath) > 100000) entity = XModelObjectConstants.ENT_FILE_ANY_LONG;
else if(jar.isTextEntry(cpath, 100)) entity = "FileTXT"; //$NON-NLS-1$
} else /*if(entity == null)*/ {
body = jar.getContent(cpath);
- entity = getModel().getEntityRecognizer().getEntityName(name, ext, body);
+ entity = getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(name, ext, body));
}
if(entity == null || getModel().getMetaData().getEntity(entity) == null) entity = "FileAny"; //$NON-NLS-1$
XModelObject c = getModel().createModelObject(entity, p);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/AuxiliaryFileRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/AuxiliaryFileRecognizer.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/AuxiliaryFileRecognizer.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -14,7 +14,11 @@
public class AuxiliaryFileRecognizer implements EntityRecognizer {
- public String getEntityName(String ext, String body) {
+ public String getEntityName(EntityRecognizerContext context) {
+ return getEntityName(context.getExtension(), context.getBody());
+ }
+
+ String getEntityName(String ext, String body) {
if(body == null) return null;
return "efe".equals(ext) ? "FileAnyAuxiliary" : null; //$NON-NLS-1$ //$NON-NLS-2$
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/MainFileRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/MainFileRecognizer.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/example/MainFileRecognizer.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -14,7 +14,11 @@
public class MainFileRecognizer implements EntityRecognizer {
- public String getEntityName(String ext, String body) {
+ public String getEntityName(EntityRecognizerContext context) {
+ return getEntityName(context.getExtension(), context.getBody());
+ }
+
+ String getEntityName(String ext, String body) {
if(body == null) return null;
return "mfe".equals(ext) ? "FileXTMain" : null; //$NON-NLS-1$ //$NON-NLS-2$
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/DeleteProjectHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/DeleteProjectHandler.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/DeleteProjectHandler.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -34,7 +34,7 @@
IProject project = EclipseResourceUtil.getProject(object);
if (project != null)
{
- DeleteResourceAction deleteAction = new DeleteResourceAction(ModelPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell());
+ DeleteResourceAction deleteAction = new DeleteResourceAction(ModelPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
deleteAction.selectionChanged(new StructuredSelection(project));
deleteAction.run();
if(!project.exists()) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -48,7 +48,6 @@
import org.jboss.tools.common.model.filesystems.impl.FileSystemImpl;
import org.jboss.tools.common.model.filesystems.impl.FileSystemPeer;
import org.jboss.tools.common.model.loaders.EntityRecognizer;
-import org.jboss.tools.common.model.loaders.EntityRecognizerExtension;
import org.jboss.tools.common.model.loaders.XObjectLoader;
import org.jboss.tools.common.model.loaders.impl.ModelEntityRecognizer;
import org.jboss.tools.common.model.plugin.ModelMessages;
@@ -121,7 +120,7 @@
return buffer;
}
- public EntityRecognizerExtension getEntityRecognizer() {
+ public EntityRecognizer getEntityRecognizer() {
return recognizer;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizer.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizer.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -21,6 +21,6 @@
* @param body
* @return
*/
- public String getEntityName(String ext, String body);
+ public String getEntityName(EntityRecognizerContext context);
}
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerContext.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerContext.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.common.model.loaders;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class EntityRecognizerContext {
+ protected String fileName;
+ protected String extension;
+ protected String body;
+ protected XMLRecognizerContext xml = null;
+
+ public EntityRecognizerContext(String extension) {
+ this.extension = extension;
+ }
+
+ public EntityRecognizerContext(String extension, String body) {
+ this.extension = extension;
+ this.body = body;
+ }
+
+ public EntityRecognizerContext(String fileName, String extension, String body) {
+ this.fileName = fileName;
+ this.extension = extension;
+ this.body = body;
+ }
+
+ public String getFileName() {
+ return fileName;
+ }
+
+ public String getExtension() {
+ return extension;
+ }
+
+ public String getBody() {
+ return body;
+ }
+
+ public XMLRecognizerContext getXMLContext() {
+ if(xml == null) {
+ xml = new XMLRecognizerContext(this);
+ }
+ return xml;
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerExtension.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerExtension.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/EntityRecognizerExtension.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.common.model.loaders;
-
-/**
- *
- * Interface is used for cases when file name is sufficient to define entity of file model object.
- * @author Viacheslav Kabanovich
- *
- */
-public interface EntityRecognizerExtension extends EntityRecognizer {
-
- public String getEntityName(String fileName, String ext, String body);
-
-}
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.common.model.loaders;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.HashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+
+import org.jboss.tools.common.model.util.SafeDocumentBuilderFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class XMLRecognizerContext extends EntityRecognizerContext {
+ protected boolean isDTD = false;
+
+ protected DoctypeInfo doctypeInfo = null;
+
+ static protected class DoctypeInfo {
+ protected String publicId;
+ protected String systemId;
+ protected String name;
+ }
+ static DoctypeInfo NULL_INFO = new DoctypeInfo();
+
+ public XMLRecognizerContext(EntityRecognizerContext context) {
+ super(context.getFileName(), context.getExtension(), context.getBody());
+ init();
+ }
+
+ void init() {
+ if(body == null) return;
+
+ String doctypeText = getUnformattedDoctypeFromBody(body);
+ if (doctypeText != null) {
+ isDTD = true;
+ doctypeInfo = checkDocType(doctypeText);
+ }
+
+ }
+
+ public boolean isDTD() {
+ return isDTD;
+ }
+
+ public String getPublicId() {
+ return doctypeInfo == null ? null : doctypeInfo.publicId;
+ }
+
+ public String getSystemId() {
+ return doctypeInfo == null ? null : doctypeInfo.systemId;
+ }
+
+ public String getRootName() {
+ if(doctypeInfo != null) {
+ return doctypeInfo.name;
+ }
+ //TODO
+ return null;
+ }
+
+ public XMLRecognizerContext getXMLContext() {
+ return this;
+ }
+
+ static HashMap<String, DoctypeInfo> doctypes = new HashMap<String, DoctypeInfo>();
+
+ private DoctypeInfo checkDocType(String docTypeString) {
+ if(doctypes.containsKey(docTypeString)) {
+ return doctypes.get(docTypeString);
+ }
+ Reader xml = new StringReader(docTypeString + "<root></root>"); //$NON-NLS-1$
+ DocumentBuilder db = SafeDocumentBuilderFactory.createDocumentBuilder(false);
+ try {
+ db.setErrorHandler(new ErrorHandler() {
+ public void warning(SAXParseException exception)
+ throws SAXException {
+ }
+
+ public void fatalError(SAXParseException exception)
+ throws SAXException {
+ }
+
+ public void error(SAXParseException exception)
+ throws SAXException {
+ }
+ });
+ db.setEntityResolver(new EntityResolver() {
+ public InputSource resolveEntity(String publicId,
+ String systemId) throws SAXException, IOException {
+ return new InputSource(new StringReader("")); //$NON-NLS-1$
+ }
+ });
+ Document doc = db.parse(new InputSource(xml));
+ if(doc != null) {
+ DocumentType dt = doc.getDoctype();
+ DoctypeInfo doctypeInfo = new DoctypeInfo();
+ doctypeInfo.publicId = dt.getPublicId();
+ doctypeInfo.systemId = dt.getSystemId();
+ doctypeInfo.name = dt.getName();
+ doctypes.put(docTypeString, doctypeInfo);
+ // System.out.println("" + doctypes.size() + " " +
+ // doctypeInfo.publicId + " " + doctypeInfo.systemId + " " +
+ // doctypeInfo.name);
+ return doctypeInfo;
+ }
+ } catch (SAXException e1) {
+ //ignore - doctype is corrupted
+ } catch (IOException e2) {
+ //ignore - impossible
+ } finally {
+ try {
+ xml.close();
+ } catch (IOException e) {
+ }
+ }
+ doctypes.put(docTypeString, NULL_INFO);
+ return NULL_INFO;
+ }
+
+ private String getUnformattedDoctypeFromBody(String body) {
+ int i = body.indexOf("<!DOCTYPE"); //$NON-NLS-1$
+ if (i < 0)
+ return null;
+ int j = body.indexOf(">", i); //$NON-NLS-1$
+ if (j < 0)
+ return null;
+ return body.substring(i, j+1);
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/DefaultEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/DefaultEntityRecognizer.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/DefaultEntityRecognizer.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -20,7 +20,8 @@
public DefaultEntityRecognizer() {}
- public String getEntityName(String ext, String body) {
+ public String getEntityName(EntityRecognizerContext context) {
+ String body = context.getBody();
if(body == null) return null;
Element e = XMLUtil.getElement(new StringReader(body));
if(e == null) return null;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/MappedEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/MappedEntityRecognizer.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/MappedEntityRecognizer.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -32,8 +32,12 @@
}
}
+ public String getEntityName(EntityRecognizerContext context) {
+ return getEntityName(context.getExtension(), context.getBody());
+ }
+
// NB i18n: there is code that depends on these entity names (in English)
- public String getEntityName(String ext, String body) {
+ String getEntityName(String ext, String body) {
if(ext == null) return null;
String s = (String)map.get(ext.toLowerCase());
return (s != null) ? s : "File" + ext.toUpperCase(); //$NON-NLS-1$
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java 2010-02-02 13:00:54 UTC (rev 20068)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java 2010-02-02 14:09:31 UTC (rev 20069)
@@ -16,7 +16,7 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
-public class ModelEntityRecognizer implements EntityRecognizerExtension {
+public class ModelEntityRecognizer implements EntityRecognizer {
private XModelMetaData meta = null;
private HashMap<String,EntityRecognizer[]> recognizers = new HashMap<String,EntityRecognizer[]>();
@@ -30,33 +30,18 @@
load();
}
- public String getEntityName(String fileName, String ext, String body) {
+ public String getEntityName(EntityRecognizerContext context) {
+ String ext = context.getExtension();
if(ext != null) ext = ext.toLowerCase();
EntityRecognizer[] list = recognizers.get(ext);
if(list == null || list.length == 0) return "FileAny"; //$NON-NLS-1$
for (EntityRecognizer r: list) {
- String n = null;
- if(r instanceof EntityRecognizerExtension) {
- n = ((EntityRecognizerExtension)r).getEntityName(fileName, ext, body);
- } else {
- n = r.getEntityName(ext, body);
- }
+ String n = r.getEntityName(context);
if(n != null) return n;
}
return null;
}
- public String getEntityName(String ext, String body) {
- if(ext != null) ext = ext.toLowerCase();
- EntityRecognizer[] list = recognizers.get(ext);
- if(list == null || list.length == 0) return "FileAny"; //$NON-NLS-1$
- for (int i = 0; i < list.length; i++) {
- String n = list[i].getEntityName(ext, body);
- if(n != null) return n;
- }
- return null;
- }
-
private void load() {
XMapping m = meta.getMapping("Recognizers"); //$NON-NLS-1$
if(m == null) return;
@@ -158,7 +143,7 @@
}
}
- private class EntityRecognizerWrapper implements EntityRecognizerExtension {
+ private class EntityRecognizerWrapper implements EntityRecognizer {
String clsname;
EntityRecognizer resolved;
@@ -174,17 +159,9 @@
return resolved != null;
}
- public String getEntityName(String ext, String body) {
- return checkResolved() ? resolved.getEntityName(ext, body) : null;
- }
-
- public String getEntityName(String fileName, String ext, String body) {
+ public String getEntityName(EntityRecognizerContext context) {
if(!checkResolved()) return null;
- if(resolved instanceof EntityRecognizerExtension) {
- return ((EntityRecognizerExtension)resolved).getEntityName(fileName, ext, body);
- } else {
- return resolved.getEntityName(ext, body);
- }
+ return resolved.getEntityName(context);
}
}
14 years, 3 months
JBoss Tools SVN: r20068 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-02-02 08:00:54 -0500 (Tue, 02 Feb 2010)
New Revision: 20068
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5218, JUnit was updated.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java 2010-02-02 12:53:39 UTC (rev 20067)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java 2010-02-02 13:00:54 UTC (rev 20068)
@@ -188,10 +188,15 @@
VpeController controller = openInVpe(
JsfAllTests.IMPORT_JSF_LOCALES_PROJECT_NAME, NO_DEFLOC_SEVERAL_FVIEWS_PAGE);
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
+ /*
+ * Make a visual refresh
+ */
+ controller.visualRefresh();
+ TestUtil.waitForIdle();
nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT0_ID);
String localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in 'default' locale", HELLO_EN.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in 'en_GB' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
localeText = doc.getElementById(LOCALE_TEXT1_ID);
localizedText = getLocalizedText(localeText);
@@ -217,6 +222,12 @@
JsfAllTests.IMPORT_JSF_LOCALES_PROJECT_NAME,
NO_DEFLOC_CHANGE_REFRESH_PAGE);
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
+ /*
+ * Make a visual refresh
+ */
+ controller.visualRefresh();
+ TestUtil.waitForIdle();
+
nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT_ID);
String localizedText = getLocalizedText(localeText);
assertTrue("Text is '"+localizedText+"', but should be in 'de' locale", HELLO2_DE.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
@@ -245,26 +256,31 @@
VpeController controller = openInVpe(
JsfAllTests.IMPORT_JSF_LOCALES_PROJECT_NAME, NO_DEFLOC_ONE_LOAD_BUNDLE_PAGE);
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
+ /*
+ * Make a visual refresh
+ */
+ controller.visualRefresh();
+ TestUtil.waitForIdle();
nsIDOMElement localeText = doc.getElementById(LOCALE_TEXT0_ID);
String localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in 'default' locale", HELLO_EN.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in 'en_GB' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
localeText = doc.getElementById(LOCALE_TEXT1_ID);
localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in 'default' locale", HELLO_EN.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in 'en_GB' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
localeText = doc.getElementById(LOCALE_TEXT2_ID);
localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in 'default' locale", HELLO_EN.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in 'en_GB' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
localeText = doc.getElementById(LOCALE_TEXT3_ID);
localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in 'default' locale", HELLO_EN.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in 'en_GB' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
localeText = doc.getElementById(LOCALE_TEXT_ID);
localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in 'default' locale", HELLO_EN.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in 'en_GB' locale", HELLO_EN_GB.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
closeEditors();
}
14 years, 3 months
JBoss Tools SVN: r20067 - trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-02-02 07:53:39 -0500 (Tue, 02 Feb 2010)
New Revision: 20067
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5777
junit test fix.
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java 2010-02-02 10:54:53 UTC (rev 20066)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java 2010-02-02 12:53:39 UTC (rev 20067)
@@ -99,9 +99,9 @@
public void testId(){
Configuration config = getConfigurationFor("pack.A"); //$NON-NLS-1$
- checkClassesMaped(config, "A", "B"); //$NON-NLS-1$ //$NON-NLS-2$
- PersistentClass a = config.getClassMapping("A"); //$NON-NLS-1$
- PersistentClass b = config.getClassMapping("B"); //$NON-NLS-1$
+ checkClassesMaped(config, "pack.A", "pack.B"); //$NON-NLS-1$ //$NON-NLS-2$
+ PersistentClass a = config.getClassMapping("pack.A"); //$NON-NLS-1$
+ PersistentClass b = config.getClassMapping("pack.B"); //$NON-NLS-1$
Property aId= a.getIdentifierProperty();
Property bId= b.getIdentifierProperty();
@@ -113,8 +113,8 @@
public void testProperty(){
Configuration config = getConfigurationFor("pack.A"); //$NON-NLS-1$
- checkClassesMaped(config, "A", "B"); //$NON-NLS-1$ //$NON-NLS-2$
- PersistentClass a = config.getClassMapping("A"); //$NON-NLS-1$
+ checkClassesMaped(config, "pack.A", "pack.B"); //$NON-NLS-1$ //$NON-NLS-2$
+ PersistentClass a = config.getClassMapping("pack.A"); //$NON-NLS-1$
Property prop = a.getProperty("prop"); //$NON-NLS-1$
Value value = prop.getValue();
@@ -126,9 +126,9 @@
public void testArray(){
Configuration config = getConfigurationFor("pack.A"); //$NON-NLS-1$
- checkClassesMaped(config, "A", "B"); //$NON-NLS-1$ //$NON-NLS-2$
- PersistentClass a = config.getClassMapping("A"); //$NON-NLS-1$
- PersistentClass b = config.getClassMapping("B"); //$NON-NLS-1$
+ checkClassesMaped(config, "pack.A", "pack.B"); //$NON-NLS-1$ //$NON-NLS-2$
+ PersistentClass a = config.getClassMapping("pack.A"); //$NON-NLS-1$
+ PersistentClass b = config.getClassMapping("pack.B"); //$NON-NLS-1$
Property bs = a.getProperty("bs"); //$NON-NLS-1$
Value value = bs.getValue();
@@ -152,9 +152,9 @@
public void testList(){
Configuration config = getConfigurationFor("pack.A"); //$NON-NLS-1$
- checkClassesMaped(config, "A", "B"); //$NON-NLS-1$ //$NON-NLS-2$
- PersistentClass a = config.getClassMapping("A"); //$NON-NLS-1$
- PersistentClass b = config.getClassMapping("B"); //$NON-NLS-1$
+ checkClassesMaped(config, "pack.A", "pack.B"); //$NON-NLS-1$ //$NON-NLS-2$
+ PersistentClass a = config.getClassMapping("pack.A"); //$NON-NLS-1$
+ PersistentClass b = config.getClassMapping("pack.B"); //$NON-NLS-1$
Property listProp = a.getProperty("list"); //$NON-NLS-1$
Value value = listProp.getValue();
@@ -170,9 +170,9 @@
public void testSet(){
Configuration config = getConfigurationFor("pack.A"); //$NON-NLS-1$
- checkClassesMaped(config, "A", "B"); //$NON-NLS-1$ //$NON-NLS-2$
- PersistentClass a = config.getClassMapping("A"); //$NON-NLS-1$
- PersistentClass b = config.getClassMapping("B"); //$NON-NLS-1$
+ checkClassesMaped(config, "pack.A", "pack.B"); //$NON-NLS-1$ //$NON-NLS-2$
+ PersistentClass a = config.getClassMapping("pack.A"); //$NON-NLS-1$
+ PersistentClass b = config.getClassMapping("pack.B"); //$NON-NLS-1$
Property setProp = a.getProperty("set"); //$NON-NLS-1$
Value value = setProp.getValue();
@@ -187,9 +187,9 @@
public void testMap(){
Configuration config = getConfigurationFor("pack.A"); //$NON-NLS-1$
- checkClassesMaped(config, "A", "B"); //$NON-NLS-1$ //$NON-NLS-2$
- PersistentClass a = config.getClassMapping("A"); //$NON-NLS-1$
- PersistentClass b = config.getClassMapping("B"); //$NON-NLS-1$
+ checkClassesMaped(config, "pack.A", "pack.B"); //$NON-NLS-1$ //$NON-NLS-2$
+ PersistentClass a = config.getClassMapping("pack.A"); //$NON-NLS-1$
+ PersistentClass b = config.getClassMapping("pack.B"); //$NON-NLS-1$
Property mapValue = a.getProperty("mapValue"); //$NON-NLS-1$
Value value = mapValue.getValue();
14 years, 3 months
JBoss Tools SVN: r20066 - trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-02-02 05:54:53 -0500 (Tue, 02 Feb 2010)
New Revision: 20066
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5778
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java 2010-02-02 04:37:56 UTC (rev 20065)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java 2010-02-02 10:54:53 UTC (rev 20066)
@@ -139,7 +139,7 @@
regionList = new ArrayList<Region>();
regionList.add(new Region(859, 11));
- regionList.add(new Region(870, 16));
+ //regionList.add(new Region(870, 16));
regionList.add(new Region(886, 1));
recognitionTest.put("org.jboss.tools.common.text.ext.jsp.JSP_EXPRESSION", regionList);
@@ -213,7 +213,7 @@
}
}
- assertEquals("Wrong recognized region count: ", 132, counter);
+ assertEquals("Wrong recognized region count: ", 131, counter);
model.releaseFromEdit();
14 years, 3 months
JBoss Tools SVN: r20065 - trunk/bpel/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-02-01 23:37:56 -0500 (Mon, 01 Feb 2010)
New Revision: 20065
Modified:
trunk/bpel/releng/testing.properties
Log:
remove extraneous properties no longer needed
Modified: trunk/bpel/releng/testing.properties
===================================================================
--- trunk/bpel/releng/testing.properties 2010-02-02 01:02:01 UTC (rev 20064)
+++ trunk/bpel/releng/testing.properties 2010-02-02 04:37:56 UTC (rev 20065)
@@ -6,22 +6,5 @@
# the test plugin to deviate from default one-suite-per-plugin operation
org.jboss.tools.bpel.ui.test.suite=org.jboss.tools.bpel.ui.test.BpelUIAllTests
-# to use a different library-file than the default from org.eclipse.test/library.xml
-#library-file=${relengCommonBuilderDir}/builder/tests/custom-library.xml
-
-# to dump test properties into console log and separate file (for debugging purposes), set echotestproperties=true
-#echotestproperties=true
-
# could also add things like: -Xbootclasspath/a:/path/to/emma.jar ?
Xflags= -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
-
-#############################################################
-# SHOULD NOT HAVE TO CHANGE OR OVERRIDE ANYTHING BELOW HERE #
-#############################################################
-
-#see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=106396 for rationale for "-Dosgi.bundlefile.limit=100"
-#Dflags=-Dosgi.bundlefile.limit=100
-
-#arguments to ${testExecutable} - .sh script + args
-#args=${executionDir}/${shell} -vmExecutable ${vmExecutable} -consolelog ${consolelog} ${Xflags} ${Dflags}
-
14 years, 3 months
JBoss Tools SVN: r20064 - trunk/common/plugins/org.jboss.tools.common.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-02-01 20:02:01 -0500 (Mon, 01 Feb 2010)
New Revision: 20064
Modified:
trunk/common/plugins/org.jboss.tools.common/plugin.properties
Log:
replace Red Hat with JBoss Tools in plugin name
Modified: trunk/common/plugins/org.jboss.tools.common/plugin.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/plugin.properties 2010-02-01 22:41:57 UTC (rev 20063)
+++ trunk/common/plugins/org.jboss.tools.common/plugin.properties 2010-02-02 01:02:01 UTC (rev 20064)
@@ -3,5 +3,5 @@
reportParameterName=reportDescription
reportingUrl=http://box.exadel.com/goto/bugreport.jsp
reportingJobName=Bug reporting
-errorReportingMessage=Can't report to Red Hat
-Bundle-Name.0 = Red Hat Common
\ No newline at end of file
+errorReportingMessage=Can't submit report
+Bundle-Name.0 = JBoss Tools Common
\ No newline at end of file
14 years, 3 months
JBoss Tools SVN: r20063 - workspace/snjeza/seam-examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-02-01 17:41:57 -0500 (Mon, 01 Feb 2010)
New Revision: 20063
Modified:
workspace/snjeza/seam-examples/photoalbum-mavenized.zip
workspace/snjeza/seam-examples/photoalbum.zip
Log:
https://jira.jboss.org/jira/browse/JBIDE-5686 JBDS 3.0 CR1, and Seam 2.2 Examples
Modified: workspace/snjeza/seam-examples/photoalbum-mavenized.zip
===================================================================
(Binary files differ)
Modified: workspace/snjeza/seam-examples/photoalbum.zip
===================================================================
(Binary files differ)
14 years, 3 months
JBoss Tools SVN: r20062 - in workspace: snjeza/seam-examples and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-02-01 17:34:44 -0500 (Mon, 01 Feb 2010)
New Revision: 20062
Modified:
workspace/examples/project-examples-3.1.xml
workspace/snjeza/seam-examples/photoalbum-mavenized.zip
workspace/snjeza/seam-examples/photoalbum.zip
Log:
https://jira.jboss.org/jira/browse/JBIDE-5686 JBDS 3.0 CR1, and Seam 2.2 Examples
Modified: workspace/examples/project-examples-3.1.xml
===================================================================
--- workspace/examples/project-examples-3.1.xml 2010-02-01 21:38:15 UTC (rev 20061)
+++ workspace/examples/project-examples-3.1.xml 2010-02-01 22:34:44 UTC (rev 20062)
@@ -134,7 +134,7 @@
<included-projects>
photoalbum-mavenized,photoalbum-mavenized-ear,photoalbum-mavenized-ejb,photoalbum-mavenized-parent
</included-projects>
- <shortDescription>PhotoAlbum - EAR mavenized (RichFaces 3.3.1.GA, Seam 2.2.0.CR1)</shortDescription>
+ <shortDescription>PhotoAlbum - EAR mavenized (RichFaces 3.3.1.GA, Seam 2.2.0.GA)</shortDescription>
<description>This example demonstrates the use of RichFaces components. It includes the photoalbum-mavenized,photoalbum-mavenized-ear,photoalbum-mavenized-ejb and photoalbum-mavenized-parent projects.
</description>
<size>16441344</size>
Modified: workspace/snjeza/seam-examples/photoalbum-mavenized.zip
===================================================================
(Binary files differ)
Modified: workspace/snjeza/seam-examples/photoalbum.zip
===================================================================
(Binary files differ)
14 years, 3 months
JBoss Tools SVN: r20061 - trunk/bpel/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-02-01 16:38:15 -0500 (Mon, 01 Feb 2010)
New Revision: 20061
Modified:
trunk/bpel/releng/testing.properties
Log:
comment out extra overrides and just set Xflags - see if build OOMs
Modified: trunk/bpel/releng/testing.properties
===================================================================
--- trunk/bpel/releng/testing.properties 2010-02-01 18:54:51 UTC (rev 20060)
+++ trunk/bpel/releng/testing.properties 2010-02-01 21:38:15 UTC (rev 20061)
@@ -7,7 +7,7 @@
org.jboss.tools.bpel.ui.test.suite=org.jboss.tools.bpel.ui.test.BpelUIAllTests
# to use a different library-file than the default from org.eclipse.test/library.xml
-library-file=${relengCommonBuilderDir}/builder/tests/custom-library.xml
+#library-file=${relengCommonBuilderDir}/builder/tests/custom-library.xml
# to dump test properties into console log and separate file (for debugging purposes), set echotestproperties=true
#echotestproperties=true
@@ -20,8 +20,8 @@
#############################################################
#see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=106396 for rationale for "-Dosgi.bundlefile.limit=100"
-Dflags=-Dosgi.bundlefile.limit=100
+#Dflags=-Dosgi.bundlefile.limit=100
#arguments to ${testExecutable} - .sh script + args
-args=${executionDir}/${shell} -vmExecutable ${vmExecutable} -consolelog ${consolelog} ${Xflags} ${Dflags}
+#args=${executionDir}/${shell} -vmExecutable ${vmExecutable} -consolelog ${consolelog} ${Xflags} ${Dflags}
14 years, 3 months
JBoss Tools SVN: r20059 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-02-01 13:51:29 -0500 (Mon, 01 Feb 2010)
New Revision: 20059
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForIDTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
Log:
JBIDE-3290: sorting/filtering is not updating correctly in code completion of source page in VPE
JstJspAllTests are corrected against the changes made for the issue
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForIDTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForIDTest.java 2010-02-01 17:08:23 UTC (rev 20058)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/CAForIDTest.java 2010-02-01 18:51:29 UTC (rev 20059)
@@ -24,7 +24,7 @@
"greetingForm",
};
- checkProposals(PAGE_NAME, "<a4j:commandButton focus=\"\"/>", 26, proposals, false);
+ checkProposals(PAGE_NAME, "<a4j:commandButton focus=\"\"/>", 26, proposals, false, false);
}
public void testCAForConverterIDTest(){
@@ -32,7 +32,7 @@
"converter1",
};
- checkProposals(PAGE_NAME, "<h:inputText value=\"#{user.name}\" required=\"true\" converter=\"\">", 61, proposals, false);
+ checkProposals(PAGE_NAME, "<h:inputText value=\"#{user.name}\" required=\"true\" converter=\"\">", 61, proposals, false, false);
}
public void testCAForValidatorIDTest(){
@@ -40,6 +40,6 @@
"validator1",
};
- checkProposals(PAGE_NAME, "<f:validator validatorId=\"\" />", 26, proposals, false);
+ checkProposals(PAGE_NAME, "<f:validator validatorId=\"\" />", 26, proposals, false, false);
}
}
\ No newline at end of file
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2010-02-01 17:08:23 UTC (rev 20058)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2010-02-01 18:51:29 UTC (rev 20059)
@@ -52,11 +52,17 @@
}
public ICompletionProposal[] checkProposals(String fileName, int offset, String[] proposals, boolean exactly) {
- return checkProposals(fileName, null, offset, proposals, exactly);
+ return checkProposals(fileName, null, offset, proposals, exactly, true);
}
- public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly){
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly) {
+ return checkProposals(fileName, substring, offset, proposals, exactly, false);
+ }
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly, boolean excludeELProposalsFromExactTest){
+// System.out.println("checkProposals >>> Enterring");
+// System.out.println("checkProposals >>> invoking openEditor() for " + fileName);
openEditor(fileName);
+// System.out.println("checkProposals >>> openEditor() is invoked for " + fileName);
int position = 0;
if (substring != null) {
@@ -66,14 +72,19 @@
ICompletionProposal[] result = null;
+// System.out.println("checkProposals >>> invoking TestUtil.getProcessor() for position " + (position + offset));
IContentAssistProcessor p = TestUtil.getProcessor(viewer, position + offset, contentAssistant);
+// System.out.println("checkProposals >>> TestUtil.getProcessor() is invoked for " + (position + offset));
if (p != null) {
try {
+// System.out.println("checkProposals >>> invoking p.computeCompletionProposals() for position " + (position + offset));
result = p.computeCompletionProposals(viewer, position + offset);
+// System.out.println("checkProposals >>> p.computeCompletionProposals() is invoked for " + (position + offset));
} catch (Throwable x) {
x.printStackTrace();
}
}
+// System.out.println("checkProposals >>> Performing the values check up");
assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
@@ -81,14 +92,24 @@
// System.out.println("proposal - "+result[i].getDisplayString());
// }
+ int foundCounter = 0;
for (int i = 0; i < proposals.length; i++) {
- assertTrue("Proposal " + proposals[i] + " not found!", compareProposal(proposals[i], result));
+ boolean found = compareProposal(proposals[i], result);
+ if (found)
+ foundCounter++;
+ assertTrue("Proposal " + proposals[i] + " not found!", found );
}
if (exactly) {
- assertTrue("Some other proposals was found!", result.length == proposals.length);
+ if (excludeELProposalsFromExactTest) {
+ assertTrue("Some other proposals were found!", foundCounter == proposals.length);
+ } else {
+ assertTrue("Some other proposals were found!", result.length == proposals.length);
+ }
}
- return result;
+
+// System.out.println("checkProposals <<< Exiting");
+ return result;
}
public boolean compareProposal(String proposalName, ICompletionProposal[] proposals){
@@ -120,9 +141,7 @@
// For an attribute value proposal there will be the quote characters
replacementString = Utils.trimQuotes(replacementString);
if (replacementString.equalsIgnoreCase(proposalName)) return true;
-
-
-
+
} else {
if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase())) return true;
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2010-02-01 17:08:23 UTC (rev 20058)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2010-02-01 18:51:29 UTC (rev 20059)
@@ -62,11 +62,12 @@
result= p.computeCompletionProposals(viewer, reg.getOffset());
}
for (int k = 0; result != null && k < result.length; k++) {
- // There should not be a proposal of type Red.Proposal in the result
+ // There should not be a proposal of type AutoContentAssistantProposal in the result
+ // (the only exclusion is EL-proposals)
if ((result[k] instanceof AutoContentAssistantProposal) &&
- result[k].getDisplayString().toLowerCase().equals(THE_ONLY_ALLOWED_TEMPLATE)) {
- // The only new EL template proposal is allowed to be shown here
+ ((AutoContentAssistantProposal)result[k]).getReplacementString().startsWith("#{")) {
+ // The only EL template proposal is allowed to be shown here
continue;
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2010-02-01 17:08:23 UTC (rev 20058)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2010-02-01 18:51:29 UTC (rev 20059)
@@ -30,6 +30,6 @@
"#{}"
};
- checkProposals(PAGE_NAME, "<input type=\"image\" src=\"", 25, proposals, true);
+ checkProposals(PAGE_NAME, "<input type=\"image\" src=\"", 25, proposals, true, true);
}
}
\ No newline at end of file
14 years, 3 months