JBoss Tools SVN: r36509 - in branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-11-21 12:58:25 -0500 (Mon, 21 Nov 2011)
New Revision: 36509
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.2.1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-4.0.0.Final.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR6.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.3.Final.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.1.GA.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.1.0.CR1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Beta.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java
Removed:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-3.2.0.Final.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.0.Beta7.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.0.GA.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.0.0.Beta5.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jta-1.1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Alpha.jar
Modified:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/.classpath
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/build.properties
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/ConfigurationFactory.java
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
Log:
Move to Hibernate4.0.0.CR6
Modified: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/.classpath
===================================================================
--- branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/.classpath 2011-11-21 17:21:57 UTC (rev 36508)
+++ branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/.classpath 2011-11-21 17:58:25 UTC (rev 36509)
@@ -1,24 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="lib/jpa/hibernate-entitymanager-4.0.0.CR1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/required/slf4j-api-1.5.8.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/required/antlr-2.7.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/required/classmate-0.5.4.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/required/commons-collections-3.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/required/commons-collections-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/required/dom4j-1.6.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/required/hibernate-commons-annotations-3.2.0.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/required/hibernate-commons-annotations-4.0.0.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/required/hibernate-core-4.0.0.CR6.jar" sourcepath="/home/eskimo/Downloads/hibernate-release-4.0.0.CR6/project"/>
<classpathentry exported="true" kind="lib" path="lib/required/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/required/jandex-1.0.0.Beta7.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/required/javassist-3.12.0.GA.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/required/jboss-logging-3.0.0.Beta5.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/required/jta-1.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/required/slf4j-api-1.5.8.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/required/jandex-1.0.3.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/required/javassist-3.12.1.GA.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/required/jboss-logging-3.1.0.CR1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>
<classpathentry exported="true" kind="lib" path="lib/tools/freemarker.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/tools/hibernate-tools-3.5.0.Alpha.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/tools/hibernate-tools-3.5.0.Beta.jar"/>
<classpathentry exported="true" kind="lib" path="lib/tools/jtidy-r8-20060801.jar"/>
<classpathentry exported="true" kind="lib" path="lib/bsh-core-2.0b4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.15.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.8.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="lib" path="lib/required/hibernate-core-4.0.0.CR1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/META-INF/MANIFEST.MF 2011-11-21 17:21:57 UTC (rev 36508)
+++ branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/META-INF/MANIFEST.MF 2011-11-21 17:58:25 UTC (rev 36509)
@@ -16,23 +16,24 @@
org.eclipse.jdt.core;bundle-version="3.7.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ClassPath: lib/required/hibernate-core-4.0.0.CR1.jar,
- lib/jpa/hibernate-entitymanager-4.0.0.CR1.jar,
+Bundle-ClassPath: lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar,
lib/required/antlr-2.7.7.jar,
lib/required/classmate-0.5.4.jar,
- lib/required/commons-collections-3.1.jar,
+ lib/required/commons-collections-3.2.1.jar,
lib/required/dom4j-1.6.1.jar,
- lib/required/hibernate-commons-annotations-3.2.0.Final.jar,
+ lib/required/hibernate-commons-annotations-4.0.0.Final.jar,
+ lib/required/hibernate-core-4.0.0.CR6.jar,
lib/required/hibernate-jpa-2.0-api-1.0.1.Final.jar,
- lib/required/jandex-1.0.0.Beta7.jar,
- lib/required/javassist-3.12.0.GA.jar,
- lib/required/jboss-logging-3.0.0.Beta5.jar,
- lib/required/jta-1.1.jar,
- lib/required/slf4j-api-1.5.8.jar,
+ lib/required/jandex-1.0.3.Final.jar,
+ lib/required/javassist-3.12.1.GA.jar,
+ lib/required/jboss-logging-3.1.0.CR1.jar,
+ lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar,
lib/tools/freemarker.jar,
lib/tools/hibernate-tools-3.5.0.Alpha.jar,
+ lib/tools/hibernate-tools-3.5.0.Beta.jar,
lib/tools/jtidy-r8-20060801.jar,
lib/bsh-core-2.0b4.jar,
+ lib/required/slf4j-api-1.5.8.jar,
lib/log4j-1.2.15.jar,
lib/slf4j-log4j12-1.5.8.jar,
.
Modified: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/build.properties
===================================================================
--- branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/build.properties 2011-11-21 17:21:57 UTC (rev 36508)
+++ branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/build.properties 2011-11-21 17:58:25 UTC (rev 36509)
@@ -7,4 +7,5 @@
lib/bsh-core-2.0b4.jar,\
lib/jpa/,\
lib/required/,\
- lib/tools/
+ lib/tools/,\
+ lib/required/slf4j-api-1.5.8.jar
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR1.jar
===================================================================
(Binary files differ)
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.1.jar
===================================================================
(Binary files differ)
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.2.1.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.2.1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-3.2.0.Final.jar
===================================================================
(Binary files differ)
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-4.0.0.Final.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-4.0.0.Final.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR1.jar
===================================================================
(Binary files differ)
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR6.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR6.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.0.Beta7.jar
===================================================================
(Binary files differ)
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.3.Final.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.3.Final.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.0.GA.jar
===================================================================
(Binary files differ)
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.1.GA.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.1.GA.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.0.0.Beta5.jar
===================================================================
(Binary files differ)
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.1.0.CR1.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.1.0.CR1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jta-1.1.jar
===================================================================
(Binary files differ)
Deleted: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Alpha.jar
===================================================================
(Binary files differ)
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Beta.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Beta.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/ConfigurationFactory.java
===================================================================
--- branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/ConfigurationFactory.java 2011-11-21 17:21:57 UTC (rev 36508)
+++ branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/ConfigurationFactory.java 2011-11-21 17:58:25 UTC (rev 36509)
@@ -68,7 +68,7 @@
public class ConfigurationFactory {
- public static final String FAKE_TM_LOOKUP = "org.hibernate.console.FakeTransactionManagerLookup"; //$NON-NLS-1$
+ public static final String FAKE_TM_LOOKUP = "org.jboss.tools.hibernate4_0.FakeTransactionManagerLookup"; //$NON-NLS-1$
private ConsoleConfigurationPreferences prefs;
private Map<String, FakeDelegatingDriver> fakeDrivers;
Added: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java
===================================================================
--- branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java (rev 0)
+++ branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java 2011-11-21 17:58:25 UTC (rev 36509)
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate4_0;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+
+import org.hibernate.HibernateException;
+import org.hibernate.service.ServiceRegistry;
+import org.hibernate.service.ServiceRegistryBuilder;
+import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
+import org.hibernate.transaction.TransactionManagerLookup;
+
+public class FakeTransactionManagerLookup implements TransactionManagerLookup {
+
+ public TransactionManager getTransactionManager(Properties props)
+ throws HibernateException {
+ if ( FakeTransactionManager.INSTANCE == null ) {
+ FakeTransactionManager.INSTANCE = new FakeTransactionManager(props);
+ }
+ return FakeTransactionManager.INSTANCE;
+ }
+
+ public String getUserTransactionName() {
+ return null; //throw new UnsupportedOperationException();
+ }
+
+ public Object getTransactionIdentifier(Transaction transaction) {
+ return transaction;
+ }
+
+}
+
+class FakeTransactionManager implements TransactionManager {
+
+ public static FakeTransactionManager INSTANCE;
+
+ private FakeTransaction current;
+ ConnectionProvider connections;
+
+ public FakeTransactionManager(Properties props) {
+ ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
+ ServiceRegistry buildServiceRegistry = builder.applySettings(props).buildServiceRegistry();
+ connections = buildServiceRegistry.getService(ConnectionProvider.class);
+ }
+
+ public void begin() throws NotSupportedException, SystemException {
+ current = new FakeTransaction(this);
+ current.begin();
+ }
+
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException {
+ if(current!=null) current.commit();
+ }
+
+
+ public int getStatus() throws SystemException {
+ if(current!=null) {
+ return current.getStatus();
+ } else {
+ return Status.STATUS_NO_TRANSACTION;
+ }
+ }
+
+ public Transaction getTransaction() throws SystemException {
+ return current;
+ }
+
+ public void resume(Transaction tx) throws InvalidTransactionException,
+ IllegalStateException, SystemException {
+ current = (FakeTransaction) tx;
+ }
+
+ public void rollback() throws IllegalStateException, SecurityException,
+ SystemException {
+ if(current!=null) current.rollback();
+ }
+
+ public void setRollbackOnly() throws IllegalStateException, SystemException {
+ if(current!=null) current.setRollbackOnly();
+ }
+
+ public void setTransactionTimeout(int t) throws SystemException {
+ }
+
+ public Transaction suspend() throws SystemException {
+ Transaction result = current;
+ current = null;
+ return result;
+ }
+
+ public FakeTransaction getCurrent() {
+ return current;
+ }
+
+ void endCurrent(FakeTransaction tx) {
+ if (current==tx) current=null;
+ }
+
+}
+
+class FakeTransaction implements Transaction {
+
+ int status;
+ private Connection connection;
+ List<Synchronization> synchronizations = new ArrayList<Synchronization>();
+ private FakeTransactionManager transactionManager;
+
+ FakeTransaction(FakeTransactionManager transactionManager) {
+ status = Status.STATUS_NO_TRANSACTION;
+ this.transactionManager = transactionManager;
+ }
+
+ public void begin() throws SystemException {
+ try {
+ connection = transactionManager.connections.getConnection();
+ }
+ catch (SQLException sqle) {
+
+ sqle.printStackTrace();
+ throw new SystemException(sqle.toString());
+ }
+ status = Status.STATUS_ACTIVE;
+ }
+
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException {
+
+ if (status == Status.STATUS_MARKED_ROLLBACK) {
+ rollback();
+ }
+ else {
+ status = Status.STATUS_PREPARING;
+
+ for (Synchronization s : synchronizations) {
+ s.beforeCompletion();
+ }
+
+ status = Status.STATUS_COMMITTING;
+
+ try {
+ connection.commit();
+ connection.close();
+ }
+ catch (SQLException sqle) {
+ status = Status.STATUS_UNKNOWN;
+ throw new SystemException();
+ }
+
+ status = Status.STATUS_COMMITTED;
+
+ for (Synchronization s : synchronizations) {
+ s.afterCompletion(status);
+ }
+
+ //status = Status.STATUS_NO_TRANSACTION;
+ transactionManager.endCurrent(this);
+ }
+
+ }
+
+ public boolean delistResource(XAResource arg0, int arg1)
+ throws IllegalStateException, SystemException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean enlistResource(XAResource arg0) throws RollbackException,
+ IllegalStateException, SystemException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public int getStatus() throws SystemException {
+ return status;
+ }
+
+ public void registerSynchronization(Synchronization sync)
+ throws RollbackException, IllegalStateException, SystemException {
+ synchronizations.add(sync);
+ }
+
+ public void rollback() throws IllegalStateException, SystemException {
+
+ status = Status.STATUS_ROLLING_BACK;
+
+// Synch.beforeCompletion() should *not* be called for rollbacks
+// for ( int i=0; i<synchronizations.size(); i++ ) {
+// Synchronization s = (Synchronization) synchronizations.get(i);
+// s.beforeCompletion();
+// }
+
+ status = Status.STATUS_ROLLEDBACK;
+
+ try {
+ connection.rollback();
+ connection.close();
+ }
+ catch (SQLException sqle) {
+ status = Status.STATUS_UNKNOWN;
+ throw new SystemException();
+ }
+
+ for (Synchronization s : synchronizations) {
+ s.afterCompletion(status);
+ }
+
+ //status = Status.STATUS_NO_TRANSACTION;
+ transactionManager.endCurrent(this);
+ }
+
+ public void setRollbackOnly() throws IllegalStateException, SystemException {
+ status = Status.STATUS_MARKED_ROLLBACK;
+ }
+
+ void setConnection(Connection connection) {
+ this.connection = connection;
+ }
+
+ public Connection getConnection() {
+ return connection;
+ }
+}
Property changes on: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java
___________________________________________________________________
Added: svn:executable
+ *
Modified: branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
===================================================================
--- branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2011-11-21 17:21:57 UTC (rev 36508)
+++ branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2011-11-21 17:58:25 UTC (rev 36509)
@@ -35,9 +35,9 @@
import org.hibernate.console.ext.QueryResultImpl;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.console.preferences.PreferencesClassPathUtils;
-import org.hibernate.service.BasicServiceRegistry;
+import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;
-import org.hibernate.service.internal.BasicServiceRegistryImpl;
+import org.hibernate.service.internal.StandardServiceRegistryImpl;
/**
*
@@ -56,7 +56,7 @@
private SessionFactory sessionFactory;
- private BasicServiceRegistry serviceRegistry;
+ private ServiceRegistry serviceRegistry;
private Map<String, FakeDelegatingDriver> fakeDrivers = new HashMap<String, FakeDelegatingDriver>();
@@ -151,7 +151,7 @@
if (sessionFactory != null) {
sessionFactory.close();
sessionFactory = null;
- ( (BasicServiceRegistryImpl) serviceRegistry ).destroy();
+ ( (StandardServiceRegistryImpl) serviceRegistry ).destroy();
serviceRegistry = null;
res = true;
}
13 years, 1 month
JBoss Tools SVN: r36508 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test: resources and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-11-21 12:21:57 -0500 (Mon, 21 Nov 2011)
New Revision: 36508
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beans.xml.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithAlternative.xml.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithDecorator.xml.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithInterceptor.xml.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/annotations/BeansXMLValidationErrors.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/BeansXMLValidationHelper.java
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/codeCompletion/
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/BeanValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3Test.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/todo.txt
Log:
BeanXML Validation test completed + refactoring + new BeanValidation Helper class
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beans.xml.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beans.xml.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beans.xml.cdi 2011-11-21 17:21:57 UTC (rev 36508)
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithAlternative.xml.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithAlternative.xml.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithAlternative.xml.cdi 2011-11-21 17:21:57 UTC (rev 36508)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+<alternatives>
+ <class>Component</class>
+</alternatives>
+
+</beans>
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithDecorator.xml.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithDecorator.xml.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithDecorator.xml.cdi 2011-11-21 17:21:57 UTC (rev 36508)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+<decorators>
+ <class>Component</class>
+</decorators>
+
+</beans>
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithInterceptor.xml.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithInterceptor.xml.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/beansXML/beansXmlWithInterceptor.xml.cdi 2011-11-21 17:21:57 UTC (rev 36508)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+<interceptors>
+ <class>Component</class>
+</interceptors>
+
+</beans>
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -48,7 +48,7 @@
* JAVA=1.6,/space/java/sdk/jdk1.6.0_22
*
*
- * Suite duration: aprox. 23min
+ * Suite duration: aprox. 21min
*
* @author Lukas Jungmann
* @author Jaroslav Jankovic
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.bot.test;
+import org.jboss.tools.cdi.bot.test.uiutils.BeansXMLValidationHelper;
import org.jboss.tools.cdi.bot.test.uiutils.CDIProjectHelper;
import org.jboss.tools.cdi.bot.test.uiutils.EditorResourceHelper;
import org.jboss.tools.cdi.bot.test.uiutils.LibraryHelper;
@@ -22,13 +23,14 @@
private String projectName = "CDIProject";
private String packageName = "cdi";
- public final String LINE_SEPARATOR = System.getProperty("line.separator");
+ protected final String LINE_SEPARATOR = System.getProperty("line.separator");
- public static CDIProjectHelper projectHelper = new CDIProjectHelper();
- public static CDIWizard wizard = new CDIWizard();
- public static OpenOnHelper openOnUtil = new OpenOnHelper();
- public static LibraryHelper libraryUtil = new LibraryHelper();
- public static EditorResourceHelper editResourceUtil = new EditorResourceHelper();
+ protected static CDIProjectHelper projectHelper = new CDIProjectHelper();
+ protected static BeansXMLValidationHelper beansHelper = new BeansXMLValidationHelper();
+ protected static CDIWizard wizard = new CDIWizard();
+ protected static OpenOnHelper openOnUtil = new OpenOnHelper();
+ protected static LibraryHelper libraryUtil = new LibraryHelper();
+ protected static EditorResourceHelper editResourceUtil = new EditorResourceHelper();
@Before
public void checkAndCreateProject() {
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/annotations/BeansXMLValidationErrors.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/annotations/BeansXMLValidationErrors.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/annotations/BeansXMLValidationErrors.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -0,0 +1,7 @@
+package org.jboss.tools.cdi.bot.test.annotations;
+
+public enum BeansXMLValidationErrors {
+
+ ALTERNATIVE, DECORATOR, INTERCEPTOR, NO_SUCH_CLASS
+
+}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -51,7 +51,7 @@
@Test
public void testPossibleCompletionInBeansXML() {
- wizard.createClearBeansXML(getPackageName());
+ beansHelper.createClearBeansXML(getPackageName());
LOGGER.info("Clear beans.xml was created");
List<String> autoCompletion = getAutoCompletion(3, 0, "<");
@@ -65,7 +65,7 @@
prepareInterceptors();
- wizard.createClearBeansXML(getPackageName());
+ beansHelper.createClearBeansXML(getPackageName());
LOGGER.info("Clear beans.xml was created");
}
@@ -75,7 +75,7 @@
prepareDecorators();
- wizard.createClearBeansXML(getPackageName());
+ beansHelper.createClearBeansXML(getPackageName());
LOGGER.info("Clear beans.xml was created");
}
@@ -85,46 +85,46 @@
prepareAlternatives();
- wizard.createClearBeansXML(getPackageName());
+ beansHelper.createClearBeansXML(getPackageName());
LOGGER.info("Clear beans.xml was created");
}
private void prepareInterceptors() {
- wizard.createComponent(CDIWizardType.INTERCEPTOR, "Interceptor1",
+ wizard.createCDIComponent(CDIWizardType.INTERCEPTOR, "Interceptor1",
getPackageName(), null);
- wizard.createComponent(CDIWizardType.INTERCEPTOR, "Interceptor2",
+ wizard.createCDIComponent(CDIWizardType.INTERCEPTOR, "Interceptor2",
getPackageName(), null);
- wizard.createComponent(CDIWizardType.INTERCEPTOR, "Interceptor3",
+ wizard.createCDIComponent(CDIWizardType.INTERCEPTOR, "Interceptor3",
getPackageName(), null);
}
private void prepareDecorators() {
- wizard.createComponent(CDIWizardType.DECORATOR, "Decorator1",
+ wizard.createCDIComponent(CDIWizardType.DECORATOR, "Decorator1",
getPackageName(), "java.util.Set");
- wizard.createComponent(CDIWizardType.DECORATOR, "Decorator2",
+ wizard.createCDIComponent(CDIWizardType.DECORATOR, "Decorator2",
getPackageName(), "java.util.Set");
- wizard.createComponent(CDIWizardType.DECORATOR, "Decorator3",
+ wizard.createCDIComponent(CDIWizardType.DECORATOR, "Decorator3",
getPackageName(), "java.util.Set");
}
private void prepareAlternatives() {
- wizard.createComponent(CDIWizardType.BEAN, "Alternative1",
+ wizard.createCDIComponent(CDIWizardType.BEAN, "Alternative1",
getPackageName(), "alternative");
- wizard.createComponent(CDIWizardType.BEAN, "Alternative2",
+ wizard.createCDIComponent(CDIWizardType.BEAN, "Alternative2",
getPackageName(), "alternative");
- wizard.createComponent(CDIWizardType.BEAN, "Alternative3",
+ wizard.createCDIComponent(CDIWizardType.BEAN, "Alternative3",
getPackageName(), "alternative");
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -11,17 +11,15 @@
package org.jboss.tools.cdi.bot.test.beansxml;
-import java.util.logging.Logger;
-
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.CDITestBase;
+import org.jboss.tools.cdi.bot.test.annotations.BeansXMLValidationErrors;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
-import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -38,93 +36,117 @@
@SuiteClasses({ CDIAllBotTests.class })
public class BeansXMLValidationTest extends CDITestBase {
- private static final Logger LOGGER = Logger
- .getLogger(BeansXMLValidationTest.class.getName());
-
+ private final String someBean = "Bean1";
+ private final String nonExistingPackage = "somePackage";
+
@Override
public String getProjectName() {
return "CDIBeansValidation";
}
+ @BeforeClass
+ public static void setup() {
+ problems.show();
+ }
+
@Test
public void testClearBeansXMLValidation() {
- wizard.createClearBeansXML(getProjectName());
- LOGGER.info("Clear beans.xml was created");
+ beansHelper.createClearBeansXML(getProjectName());
+
+ assertTrue(beansHelper.getBeansXMLValidationErrors(
+ getProjectName()).length == 0);
- SWTBotTreeItem[] validationErrors = getBeansXMLValidationErrors();
-
- assertTrue(validationErrors.length == 0);
-
}
@Test
public void testInterceptorsValidation() {
- String firstPackage = getPackageName() + ".test1";
- String secondPackage = getPackageName() + ".test2";
- String nonExistingPackage = getPackageName() + ".test3";
+ String className = "I1";
- prepareTwoInterceptors(firstPackage, secondPackage);
+ if (!projectExplorer.isFilePresent(getProjectName(),
+ ("Java Resources/src/" + getPackageName() +
+ "/" + someBean + ".java").split("/"))) {
+ wizard.createCDIComponent(CDIWizardType.BEAN, someBean, getPackageName(), null);
+ }
+
+ wizard.createCDIComponent(CDIWizardType.INTERCEPTOR, className, getPackageName(), null);
- wizard.createClearBeansXML(getProjectName());
- LOGGER.info("Clear beans.xml was created");
+ assertTrue(beansHelper.checkInterceptorInBeansXML(getProjectName(),
+ getPackageName(), className));
- String interceptorTag = "<interceptors>" + LINE_SEPARATOR +
- "</interceptors>" + LINE_SEPARATOR;
- String firstInterceptor = "<class>" + firstPackage + ".I1</class>" + LINE_SEPARATOR;
-
- editResourceUtil.insertInEditor(3, 0, interceptorTag);
- editResourceUtil.insertInEditor(4, 0, firstInterceptor);
- assertTrue(getBeansXMLValidationErrors().length == 0);
- String secondDecorator = "<class>" + secondPackage + ".I2</class>" + LINE_SEPARATOR;
- editResourceUtil.insertInEditor(5, 0, secondDecorator);
- assertTrue(getBeansXMLValidationErrors().length == 0);
+ assertFalse(beansHelper.checkInterceptorInBeansXML(getProjectName(),
+ nonExistingPackage, className));
+ assertTrue(beansHelper.checkValidationErrorInBeansXML(getProjectName(),
+ BeansXMLValidationErrors.NO_SUCH_CLASS));
- editResourceUtil.replaceInEditor(firstPackage, nonExistingPackage);
-
- SWTBotTreeItem[] validationErrors = getBeansXMLValidationErrors();
- assertTrue(validationErrors.length == 1);
- assertTrue(validationErrors[0].getText().contains("There is no class with the specified name"));
-
- wizard.createComponent(CDIWizardType.BEAN, "Bean1", firstPackage, null);
- bot.editorByTitle("beans.xml").show();
- bot.editorByTitle("beans.xml").setFocus();
- setEd(bot.activeEditor().toTextEditor());
- editResourceUtil.replaceInEditor(nonExistingPackage + ".I1", firstPackage + ".Bean1");
-
- validationErrors = getBeansXMLValidationErrors();
- assertTrue(validationErrors.length == 1);
- assertTrue(validationErrors[0].getText().contains("must specify the name of an interceptor class"));
+ assertFalse(beansHelper.checkInterceptorInBeansXML(getProjectName(),
+ getPackageName(), someBean));
+ assertTrue(beansHelper.checkValidationErrorInBeansXML(getProjectName(),
+ BeansXMLValidationErrors.INTERCEPTOR));
}
@Test
public void testDecoratorsValidation() {
+
+ String className = "D1";
+
+ if (!projectExplorer.isFilePresent(getProjectName(),
+ ("Java Resources/src/" + getPackageName() +
+ "/" + someBean + ".java").split("/"))) {
+ wizard.createCDIComponent(CDIWizardType.BEAN, someBean, getPackageName(), null);
+ }
+
+ wizard.createCDIComponent(CDIWizardType.DECORATOR, className,
+ getPackageName(), "java.util.Set");
+ assertTrue(beansHelper.checkDecoratorInBeansXML(getProjectName(),
+ getPackageName(), className));
+
+
+ assertFalse(beansHelper.checkDecoratorInBeansXML(getProjectName(),
+ nonExistingPackage, className));
+ assertTrue(beansHelper.checkValidationErrorInBeansXML(getProjectName(),
+ BeansXMLValidationErrors.NO_SUCH_CLASS));
+
+
+ assertFalse(beansHelper.checkDecoratorInBeansXML(getProjectName(),
+ getPackageName(), someBean));
+ assertTrue(beansHelper.checkValidationErrorInBeansXML(getProjectName(),
+ BeansXMLValidationErrors.DECORATOR));
}
@Test
public void testAlternativesValidation() {
+
+ String className = "A1";
+
+ if (!projectExplorer.isFilePresent(getProjectName(),
+ ("Java Resources/src/" + getPackageName() +
+ "/" + someBean + ".java").split("/"))) {
+ wizard.createCDIComponent(CDIWizardType.BEAN, someBean, getPackageName(), null);
+ }
+
+ wizard.createCDIComponent(CDIWizardType.BEAN, className,
+ getPackageName(), "alternative");
- }
-
- @Test
- public void testNotSupportedCDIComponentsValidation() {
+ assertTrue(beansHelper.checkAlternativeInBeansXML(getProjectName(),
+ getPackageName(), className));
- }
-
- private SWTBotTreeItem[] getBeansXMLValidationErrors() {
- return ProblemsView.getFilteredErrorsTreeItems(bot, null, "/"
- + getProjectName() + "/WebContent/WEB-INF", "beans.xml", "CDI Problem");
- }
-
- private void prepareTwoInterceptors(String firstPackage, String secondPackage) {
- wizard.createComponent(CDIWizardType.INTERCEPTOR, "I1", firstPackage, null);
+ assertFalse(beansHelper.checkAlternativeInBeansXML(getProjectName(),
+ nonExistingPackage, className));
+ assertTrue(beansHelper.checkValidationErrorInBeansXML(getProjectName(),
+ BeansXMLValidationErrors.NO_SUCH_CLASS));
- wizard.createComponent(CDIWizardType.INTERCEPTOR, "I2", secondPackage, null);
+ assertFalse(beansHelper.checkAlternativeInBeansXML(getProjectName(),
+ getPackageName(), someBean));
+ assertTrue(beansHelper.checkValidationErrorInBeansXML(getProjectName(),
+ BeansXMLValidationErrors.ALTERNATIVE));
+
}
+
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -48,8 +48,29 @@
prepareSimpleObserverFinding();
- testSimpleObserverFinding();
+ for (int i = 0; i < events.length; i++) {
+ String eventsClass = "EventsProducer.java";
+
+ String showObserverOption = "Show CDI Observer Methods...";
+
+ checkEventsAndObserver(events[i], eventsClass, showObserverOption);
+ }
+
+ for (int i = 0; i < observers.length; i++) {
+ String observerClass = "ObserverBean.java";
+
+ /**
+ * there are two observer methods for which there is only one
+ * event, so there will be no "Show CDI Events" option, instead
+ * of that, there will be "Open CDI Event" option
+ */
+ String showObserverOption = ((observers[i].equals("observeQ1MyBean2")) ||
+ (observers[i].equals("observeQ2MyBean2"))) ? "Open CDI Event" : "Show CDI Events...";
+
+ checkEventsAndObserver(observers[i], observerClass, showObserverOption);
+ }
+
}
// not implemented yet
@@ -63,70 +84,32 @@
private void prepareSimpleObserverFinding() {
- wizard.createComponent(CDIWizardType.QUALIFIER, "Q1", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Q1", getPackageName(), null);
- wizard.createComponent(CDIWizardType.QUALIFIER, "Q2", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Q2", getPackageName(), null);
- wizard.createComponent(CDIWizardType.BEAN, "MyBean1", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean1", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(FindObserverForEventTest.class
.getResourceAsStream("/resources/events/MyBean1.java.cdi"),
false);
- wizard.createComponent(CDIWizardType.BEAN, "MyBean2", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean2", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(FindObserverForEventTest.class
.getResourceAsStream("/resources/events/MyBean2.java.cdi"),
false);
- wizard.createComponent(CDIWizardType.BEAN, "EventsProducer", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "EventsProducer", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(FindObserverForEventTest.class
.getResourceAsStream("/resources/events/EventsProducer.java.cdi"),
false);
- wizard.createComponent(CDIWizardType.BEAN, "ObserverBean", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "ObserverBean", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(FindObserverForEventTest.class
.getResourceAsStream("/resources/events/ObserverBean.java.cdi"),
false);
util.waitForNonIgnoredJobs();
}
- private void testSimpleObserverFinding() {
-
-
- for (int i = 0; i < events.length; i++) {
- checkObserverMethodsForEvent(events[i]);
- }
-
-
- for (int i = 0; i < observers.length; i++) {
- checkEventsForObserverMethods(observers[i]);
- }
- }
-
- private void checkObserverMethodsForEvent(String eventName) {
-
- String eventsClass = "EventsProducer.java";
-
- String showObserverOption = "Show CDI Observer Methods...";
-
- checkEventsAndObserver(eventName, eventsClass, showObserverOption);
-
- }
-
- private void checkEventsForObserverMethods(String observerName) {
-
- String observerClass = "ObserverBean.java";
-
- /**
- * there are two observer methods for which there is only one
- * event, so there will be no "Show CDI Events" option, instead
- * of that, there will be "Open CDI Event" option
- */
- String showObserverOption = ((observerName.equals("observeQ1MyBean2")) ||
- (observerName.equals("observeQ2MyBean2"))) ? "Open CDI Event" : "Show CDI Events...";
-
- checkEventsAndObserver(observerName, observerClass, showObserverOption);
- }
-
private void checkEventsAndObserver(String name, String className,
String option) {
openOnUtil.openOnByOption(name, className, option);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnBase.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnBase.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -12,10 +12,11 @@
package org.jboss.tools.cdi.bot.test.openon;
import org.jboss.tools.cdi.bot.test.CDITestBase;
+import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
public class OpenOnBase extends CDITestBase{
- public static final String[] events = { "myBean1Q1Event", "myBean1AnyEvent",
+ protected static final String[] events = { "myBean1Q1Event", "myBean1AnyEvent",
"myBean2Q1Event", "myBean2AnyEvent", "myBean1Q2Event",
"myBean2Q2Event", "myBean1Q1Event.fire(new MyBean1());",
"myBean1AnyEvent.fire(new MyBean1())",
@@ -24,9 +25,38 @@
"myBean1Q2Event.fire(new MyBean1())",
"myBean2Q2Event.fire(new MyBean2())",
"myBean1AnyEvent.fire(new MyBean2())" };
- public static final String[] observers = { "observeNoQualifierMyBean1",
+
+ protected static final String[] observers = { "observeNoQualifierMyBean1",
"observeAnyMyBean1", "observeQ1MyBean1",
"observeNoQualifierMyBean2", "observeAnyMyBean2",
"observeQ1MyBean2", "observeQ2MyBean1", "observeQ2MyBean2" };
+
+
+ protected boolean checkBeanXMLDecoratorOpenOn(String packageName, String className) {
+ wizard.createCDIComponent(CDIWizardType.DECORATOR, className, packageName,
+ "java.util.Set");
+ bot.editorByTitle("beans.xml").show();
+ bot.cTabItem("Source").activate();
+ openOnUtil.openOnDirect(packageName + "." + className, "beans.xml");
+ return getEd().getTitle().equals(className + ".java");
+ }
+
+ protected boolean checkBeanXMLInterceptorOpenOn(String packageName, String className) {
+ wizard.createCDIComponent(CDIWizardType.INTERCEPTOR, className, packageName,
+ null);
+ bot.editorByTitle("beans.xml").show();
+ bot.cTabItem("Source").activate();
+ openOnUtil.openOnDirect(packageName + "." + className, "beans.xml");
+ return getEd().getTitle().equals(className + ".java");
+ }
+
+ protected boolean checkBeanXMLAlternativeOpenOn(String packageName, String className) {
+ wizard.createCDIComponent(CDIWizardType.BEAN, className, packageName,
+ "alternative+beansxml");
+ bot.editorByTitle("beans.xml").show();
+ bot.cTabItem("Source").activate();
+ openOnUtil.openOnDirect(packageName + "." + className, "beans.xml");
+ return getEd().getTitle().equals(className + ".java");
+ }
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -15,7 +15,6 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
-import org.jboss.tools.cdi.bot.test.CDITestBase;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.Timing;
@@ -36,7 +35,7 @@
@Require(clearProjects = true, perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDIAllBotTests.class })
-public class OpenOnTest extends CDITestBase {
+public class OpenOnTest extends OpenOnBase {
private static final Logger LOGGER = Logger.getLogger(OpenOnTest.class.getName());
@@ -50,58 +49,30 @@
prepareInjectedPointsComponents();
- testInjectedPoints();
+ String injectOption = null;
+ for (int i = 1; i < 12; i++) {
+ String injectPoint = "myBean" + i;
+ injectOption = "Show All Assignable Beans...";
+ if (i > 8) injectOption = "Open @Inject Bean";
+ checkInjectedPoint(injectPoint, injectOption);
+ }
}
-
- /**
- * https://issues.jboss.org/browse/JBIDE-7025
- */
+
+ // https://issues.jboss.org/browse/JBIDE-7025
@Test
public void testBeansXMLClassesOpenOn() {
- /**
- * check if beans.xml was not wizard.created in previous tests. If so, I cannot wizard.create
- * beans.xml into getProjectName()/WebContent/WEB-INF/beans.xml.
- */
- if (!projectExplorer.isFilePresent(getProjectName(),
- "WebContent/META-INF/beans.xml".split("/")) &&
- !projectExplorer.isFilePresent(getProjectName(),
- "WebContent/WEB-INF/beans.xml".split("/"))) {
- wizard.createComponent(CDIWizardType.BEANS_XML, null, getProjectName() + "/WebContent/WEB-INF", null);
- }
+ beansHelper.createClearBeansXML(getProjectName());
+
+ assertTrue(checkBeanXMLDecoratorOpenOn(getProjectName(), "D1"));
- wizard.createComponent(CDIWizardType.DECORATOR, "D1", getPackageName(),
- "java.util.Set");
- bot.editorByTitle("beans.xml").show();
- bot.cTabItem("Source").activate();
- openOnUtil.openOnDirect(getPackageName() + ".D1", "beans.xml");
- assertTrue("ERROR: redirected to " + getEd().getTitle(),
- getEd().getTitle().equals("D1.java"));
+ assertTrue(checkBeanXMLInterceptorOpenOn(getProjectName(), "I1"));
- wizard.createComponent(CDIWizardType.INTERCEPTOR, "Interceptor1", getPackageName(),
- null);
- bot.editorByTitle("beans.xml").show();
- openOnUtil.openOnDirect(getPackageName() + ".Interceptor1", "beans.xml");
- assertTrue("ERROR: redirected to " + getEd(),
- getEd().getTitle().equals("Interceptor1.java"));
+ assertTrue(checkBeanXMLAlternativeOpenOn(getProjectName(), "A1"));
- wizard.createComponent(CDIWizardType.BEAN, "B1", getPackageName(),
- "alternative+beansxml");
- bot.editorByTitle("beans.xml").show();
- openOnUtil.openOnDirect(getPackageName() + ".B1", "beans.xml");
- assertTrue("ERROR: redirected to " + getEd(),
- getEd().getTitle().equals("B1.java"));
-
- wizard.createComponent(CDIWizardType.STEREOTYPE, "S1", getPackageName(),
- "alternative+beansxml");
- bot.editorByTitle("beans.xml").show();
- openOnUtil.openOnDirect(getPackageName() + ".S1", "beans.xml");
- assertTrue("ERROR: redirected to " + getEd(),
- getEd().getTitle().equals("S1.java"));
-
}
-
+
/**
* https://issues.jboss.org/browse/JBIDE-6251
*/
@@ -110,7 +81,7 @@
String className = "Bean1";
- wizard.createComponent(CDIWizardType.BEAN, className, getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, className, getPackageName(), null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
.getResourceAsStream("/resources/openon/BeanWithDisposerAndProducer.java.cdi"),
false);
@@ -124,11 +95,11 @@
@Test
public void testObserverOpenOn() {
- wizard.createComponent(CDIWizardType.BEAN, "EventBean", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "EventBean", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
.getResourceAsStream("/resources/openon/EventBean.java.cdi"),
false);
- wizard.createComponent(CDIWizardType.BEAN, "ObserverBean", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "ObserverBean", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
.getResourceAsStream("/resources/openon/ObserverBean.java.cdi"),
false);
@@ -145,49 +116,38 @@
}
private void prepareInjectedPointsComponents() {
- wizard.createComponent(CDIWizardType.QUALIFIER, "Q1", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Q1", getPackageName(), null);
- wizard.createComponent(CDIWizardType.QUALIFIER, "Q2", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Q2", getPackageName(), null);
- wizard.createComponent(CDIWizardType.BEAN, "MyBean1", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean1", getPackageName(), null);
- wizard.createComponent(CDIWizardType.BEAN, "MyBean2", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean2", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
.getResourceAsStream("/resources/openon/InjectedPoints/MyBean2.java.cdi"),
false);
- wizard.createComponent(CDIWizardType.BEAN, "MyBean3", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean3", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
.getResourceAsStream("/resources/openon/InjectedPoints/MyBean3.java.cdi"),
false);
- wizard.createComponent(CDIWizardType.BEAN, "MyBean4", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean4", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
.getResourceAsStream("/resources/openon/InjectedPoints/MyBean4.java.cdi"),
false);
- wizard.createComponent(CDIWizardType.BEAN, "MyBean5", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean5", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
.getResourceAsStream("/resources/openon/InjectedPoints/MyBean5.java.cdi"),
false);
- wizard.createComponent(CDIWizardType.BEAN, "MainBean", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MainBean", getPackageName(), null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
.getResourceAsStream("/resources/openon/InjectedPoints/MainBean.java.cdi"),
false);
}
- private void testInjectedPoints() {
- String injectOption = null;
- for (int i = 1; i < 12; i++) {
- String injectPoint = "myBean" + i;
- injectOption = "Show All Assignable Beans...";
- if (i > 8) injectOption = "Open @Inject Bean";
- checkInjectedPoint(injectPoint, injectOption);
- }
-
- }
-
private void checkInjectedPoint(String injectedPoint, String option) {
openOnUtil.openOnByOption(injectedPoint, "MainBean.java", option);
bot.sleep(Timing.time1S());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/BeanValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/BeanValidationQuickFixTest.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/BeanValidationQuickFixTest.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -19,7 +19,6 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -47,7 +46,7 @@
String className = "ManagedBean";
- wizard.createComponent(CDIWizardType.BEAN, className, getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, className, getPackageName(), null);
editResourceUtil.replaceClassContentByResource( BeanValidationQuickFixTest.class
.getResourceAsStream("/resources/quickfix/SerializableBean.java.cdi"), false);
editResourceUtil.replaceInEditor("BeanComponent", className);
@@ -64,13 +63,13 @@
String brokenFarmClassName = "BrokenFarm";
- wizard.createComponent(CDIWizardType.BEAN, brokenFarmClassName, getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, brokenFarmClassName, getPackageName(), null);
- wizard.createComponent(CDIWizardType.QUALIFIER, "Q1", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Q1", getPackageName(), null);
- wizard.createComponent(CDIWizardType.BEAN, animalClassName, getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, animalClassName, getPackageName(), null);
- wizard.createComponent(CDIWizardType.BEAN, dogClassName, getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, dogClassName, getPackageName(), null);
editResourceUtil.replaceClassContentByResource(BeanValidationQuickFixTest.class
.getResourceAsStream("/resources/quickfix/Dog.java.cdi"), false);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3Test.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3Test.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3Test.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -73,9 +73,9 @@
String className = "Bean1";
- wizard.createComponent(CDIWizardType.BEANS_XML, "beans.xml", getProjectName() + "/WebContent/WEB-INF", null);
+ wizard.createCDIComponent(CDIWizardType.BEANS_XML, "beans.xml", getProjectName() + "/WebContent/WEB-INF", null);
- wizard.createComponent(CDIWizardType.BEAN, className, getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, className, getPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/seam3/Bean.java.cdi"), false);
editResourceUtil.replaceInEditor("BeanComponent", className);
@@ -138,38 +138,38 @@
/**
* injectable beans + qualifiers + generic configuration components
*/
- wizard.createComponent(CDIWizardType.BEAN, "MyBean", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyBean.java.cdi"), false);
editResourceUtil.replaceInEditor("MyBeanX", "MyBean");
- wizard.createComponent(CDIWizardType.BEAN, "MyBean2", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean2", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyBean.java.cdi"), false);
editResourceUtil.replaceInEditor("MyBeanX", "MyBean2");
- wizard.createComponent(CDIWizardType.BEAN, "MyBean3", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBean3", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyBean.java.cdi"), false);
editResourceUtil.replaceInEditor("MyBeanX", "MyBean3");
- wizard.createComponent(CDIWizardType.BEAN, "MyConfiguration", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyConfiguration", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyBean.java.cdi"), false);
editResourceUtil.replaceInEditor("MyBeanX", "MyConfiguration");
- wizard.createComponent(CDIWizardType.BEAN, "MyGenericType", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyGenericType", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyGenericType.java.cdi"), false);
- wizard.createComponent(CDIWizardType.QUALIFIER, "Qualifier1", getGenericPackageName(), null);
- wizard.createComponent(CDIWizardType.QUALIFIER, "Qualifier2", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Qualifier1", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Qualifier2", getGenericPackageName(), null);
- wizard.createComponent(CDIWizardType.BEAN, "MyExtendedConfiguration", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyExtendedConfiguration", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyExtendConfig.java.cdi"), false);
- wizard.createComponent(CDIWizardType.BEAN, "MyConfigurationProducer", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyConfigurationProducer", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyConfigProd.java.cdi"), false);
@@ -178,15 +178,15 @@
* generic configurations
*/
- wizard.createComponent(CDIWizardType.BEAN, "MyBeanInjections", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyBeanInjections", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyBeanInjections.java.cdi"), false);
- wizard.createComponent(CDIWizardType.BEAN, "MyGenericBean", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyGenericBean", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyGenericBean.java.cdi"), false);
- wizard.createComponent(CDIWizardType.BEAN, "MyGenericBean2", getGenericPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.BEAN, "MyGenericBean2", getGenericPackageName(), null);
editResourceUtil.replaceClassContentByResource(Seam3Test.class
.getResourceAsStream("/resources/generic/MyGenericBean2.java.cdi"), false);
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/BeansXMLValidationHelper.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/BeansXMLValidationHelper.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/BeansXMLValidationHelper.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * 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.cdi.bot.test.uiutils;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.cdi.bot.test.CDITestBase;
+import org.jboss.tools.cdi.bot.test.annotations.BeansXMLValidationErrors;
+import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
+import org.jboss.tools.cdi.bot.test.openon.OpenOnTest;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+
+/**
+ * Test operates on code completion in beans.xml
+ *
+ * @author Jaroslav Jankovic
+ *
+ */
+
+public class BeansXMLValidationHelper extends CDITestBase {
+
+ /**
+ *
+ * @param validationError
+ * @return
+ */
+ public boolean checkValidationErrorInBeansXML(String projectName,
+ BeansXMLValidationErrors validationError) {
+ SWTBotTreeItem[] validationErrors = getBeansXMLValidationErrors(projectName);
+ String error = null;
+ switch (validationError) {
+ case NO_SUCH_CLASS:
+ error = "There is no class with the specified name";
+ break;
+ case ALTERNATIVE:
+ error = "must specify the name of an alternative bean class";
+ break;
+ case DECORATOR:
+ error = "must specify the name of a decorator bean class";
+ break;
+ case INTERCEPTOR:
+ error = "must specify the name of an interceptor class";
+ break;
+ }
+ return ((validationErrors.length == 1) &&
+ (validationErrors[0].getText().contains(error)));
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param packageName
+ * @param className
+ * @return
+ */
+ public boolean checkInterceptorInBeansXML(String projectName,
+ String packageName, String className) {
+ createBeansXMLWithInterceptor(projectName, packageName, className);
+ return getBeansXMLValidationErrors(projectName).length == 0;
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param packageName
+ * @param className
+ * @return
+ */
+ public boolean checkDecoratorInBeansXML(String projectName,
+ String packageName, String className) {
+ createBeansXMLWithDecorator(projectName, packageName, className);
+ return getBeansXMLValidationErrors(projectName).length == 0;
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param packageName
+ * @param className
+ * @return
+ */
+ public boolean checkAlternativeInBeansXML(String projectName,
+ String packageName, String className) {
+ createBeansXMLWithAlternative(projectName, packageName, className);
+ return getBeansXMLValidationErrors(projectName).length == 0;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public SWTBotTreeItem[] getBeansXMLValidationErrors(String projectName) {
+ return ProblemsView.getFilteredErrorsTreeItems(bot, null, "/"
+ + projectName + "/WebContent/WEB-INF", "beans.xml", "CDI Problem");
+ }
+
+ /**
+ * Methods creates beans.xml with no tags. Location is provided by parameter.
+ * If beans.xml already exists, its content is replaced by pure beans.xml with no
+ * tags in it.
+ * @param projectName
+ */
+ public void createClearBeansXML(String projectName) {
+
+ createBeansXMLWithContent(projectName, "/resources/beansXML/beans.xml.cdi");
+
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param packageName
+ * @param className
+ */
+ public void createBeansXMLWithInterceptor(String projectName, String packageName,
+ String className) {
+
+ createBeansXMLWithContent(projectName, "/resources/beansXML/" +
+ "beansXmlWithInterceptor.xml.cdi");
+ editResourceUtil.replaceInEditor("Component", packageName + "." + className);
+
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param packageName
+ * @param className
+ */
+ public void createBeansXMLWithDecorator(String projectName, String packageName,
+ String className) {
+
+ createBeansXMLWithContent(projectName, "/resources/beansXML/" +
+ "beansXmlWithDecorator.xml.cdi");
+ editResourceUtil.replaceInEditor("Component", packageName + "." + className);
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param packageName
+ * @param className
+ */
+ public void createBeansXMLWithAlternative(String projectName, String packageName,
+ String className) {
+
+ createBeansXMLWithContent(projectName, "/resources/beansXML/" +
+ "beansXmlWithAlternative.xml.cdi");
+ editResourceUtil.replaceInEditor("Component", packageName + "." + className);
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param path
+ */
+ private void createBeansXMLWithContent(String projectName, String path) {
+
+ if (!projectExplorer.isFilePresent(projectName,
+ "WebContent/META-INF/beans.xml".split("/")) &&
+ !projectExplorer.isFilePresent(projectName,
+ "WebContent/WEB-INF/beans.xml".split("/"))) {
+ wizard.createCDIComponent(CDIWizardType.BEANS_XML, null, projectName + "/WebContent/WEB-INF", null);
+ }
+ if (!projectExplorer.isFilePresent(projectName,
+ "WebContent/META-INF/beans.xml".split("/"))) {
+ projectExplorer.openFile(projectName, "WebContent/WEB-INF/beans.xml".split("/"));
+ }else {
+ projectExplorer.openFile(projectName, "WebContent/META-INF/beans.xml".split("/"));
+ }
+ bot.cTabItem("Source").activate();
+ setEd(bot.activeEditor().toTextEditor());
+ editResourceUtil.replaceClassContentByResource(OpenOnTest.class
+ .getResourceAsStream(path),
+ false);
+ }
+
+}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -90,8 +90,7 @@
getEd().setText(getEd().getText().replace(
target + (replacement.equals("") ? System
.getProperty("line.separator") : ""),
- replacement));
- bot.sleep(Timing.time1S());
+ replacement));
getEd().save();
}
@@ -121,6 +120,7 @@
NodeContextUtil.nodeContextMenu(tree, item, "Move...").click();
+ bot.sleep(Timing.time2S());
tree = bot.tree();
tree.collapseNode(destFolder.split("/")[0]);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java 2011-11-21 17:21:57 UTC (rev 36508)
@@ -13,19 +13,31 @@
import org.jboss.tools.cdi.bot.test.CDITestBase;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
-import org.jboss.tools.cdi.bot.test.openon.OpenOnTest;
public class CDIWizard extends CDITestBase{
private CDIWizardBaseExt wizardExt = new CDIWizardBaseExt();
+ /**
+ * Method creates Java Annotation with selected name and package
+ * @param name
+ * @param packageName
+ */
public void createAnnotation(String name, String packageName) {
wizardExt.annotation(open, util, packageName, name);
}
- public void createComponent(CDIWizardType component, String name,
+ /**
+ * Method creates CDI component with workaround for beans.xml -
+ * if component is beans.xml, editor is not set
+ * @param component
+ * @param name
+ * @param packageName
+ * @param necessaryParam
+ */
+ public void createCDIComponent(CDIWizardType component, String name,
String packageName, String necessaryParam) {
- createCDIComponent(component, name, packageName, necessaryParam);
+ createComponent(component, name, packageName, necessaryParam);
util.waitForNonIgnoredJobs();
/**
* if beans.xml is created as first component in project,
@@ -36,7 +48,33 @@
}
}
- public void createCDIComponent(CDIWizardType component, String name,
+ /**
+ * Method creates larger number("amount") of the same component.
+ * @param component
+ * @param amount
+ * @param baseName
+ * @param packageBaseName
+ * @param necessaryParam
+ * @param differentPackages
+ */
+ public void createCDIComponents(CDIWizardType component, int amount, String baseName,
+ String packageBaseName, String necessaryParam, boolean differentPackages) {
+
+ for (int i = 1; i <= amount; i++) {
+ String packageName = (differentPackages) ? packageBaseName + i : packageBaseName;
+ createCDIComponent(component, baseName + i, packageName, necessaryParam);
+ }
+
+ }
+
+ /**
+ * Method that actually creates CDI component according to parameter
+ * @param component
+ * @param name
+ * @param packageName
+ * @param necessaryParam
+ */
+ private void createComponent(CDIWizardType component, String name,
String packageName, String necessaryParam) {
switch (component) {
case STEREOTYPE:
@@ -89,26 +127,7 @@
case BEANS_XML:
wizardExt.beansXML(packageName).finish();
break;
- }
- util.waitForNonIgnoredJobs();
- if (component != CDIWizardType.BEANS_XML) {
- setEd(bot.activeEditor().toTextEditor());
- }
+ }
}
- public void createClearBeansXML(String projectName) {
- if (!projectExplorer.isFilePresent(projectName,
- "WebContent/META-INF/beans.xml".split("/")) &&
- !projectExplorer.isFilePresent(projectName,
- "WebContent/WEB-INF/beans.xml".split("/"))) {
- createComponent(CDIWizardType.BEANS_XML, null, projectName + "/WebContent/WEB-INF", null);
- }
- projectExplorer.openFile(projectName, "WebContent/WEB-INF/beans.xml".split("/"));
- bot.cTabItem("Source").activate();
- setEd(bot.activeEditor().toTextEditor());
- editResourceUtil.replaceClassContentByResource(OpenOnTest.class
- .getResourceAsStream("/resources/codeCompletion/beans.xml.cdi"), false);
-
- }
-
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/todo.txt
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/todo.txt 2011-11-21 17:21:41 UTC (rev 36507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/todo.txt 2011-11-21 17:21:57 UTC (rev 36508)
@@ -2,13 +2,12 @@
* what tests have to be done(JBDS50_0010):
* 1. Validations works good for Inconsistent specialization,
Ambiguous EL names, Unproxyable bean types, Decorator resolution
- * 3. Code completion works in beans.xml
- * 4. Classes in beans.xml are validated
- * 5. Complex test from Weld is working in JBDS and CDI functionality works without errors
- * 6. CDI @Named beans are renamed via refactoring and shows up correctly
+ * 2. Code completion works in beans.xml
+ * 3. Complex test from Weld is working in JBDS and CDI functionality works without errors
+ * 4. CDI @Named beans are renamed via refactoring and shows up correctly
* when using Find References for EL Expressions
- * 8. Create new decorator from existing Web Bean
- * 9. EL refactoring for @Named beans works
+ * 5. Create new decorator from existing Web Bean
+ * 6. EL refactoring for @Named beans works
*
*
* what tests have to be done(JBDS50_0015):
13 years, 1 month
JBoss Tools SVN: r36507 - in trunk/forge/plugins/org.jboss.tools.forge.ui: icons and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-11-21 12:21:41 -0500 (Mon, 21 Nov 2011)
New Revision: 36507
Added:
trunk/forge/plugins/org.jboss.tools.forge.ui/icons/jbossforge_icon_16px.png
Modified:
trunk/forge/plugins/org.jboss.tools.forge.ui/plugin.xml
Log:
JBIDE-10204: Use Forge Icon for Forge Console View
Added: trunk/forge/plugins/org.jboss.tools.forge.ui/icons/jbossforge_icon_16px.png
===================================================================
(Binary files differ)
Property changes on: trunk/forge/plugins/org.jboss.tools.forge.ui/icons/jbossforge_icon_16px.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/plugin.xml
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/plugin.xml 2011-11-21 17:17:07 UTC (rev 36506)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/plugin.xml 2011-11-21 17:21:41 UTC (rev 36507)
@@ -10,6 +10,7 @@
<view
category="org.jboss.tools.forge"
class="org.jboss.tools.forge.ui.part.ForgeView"
+ icon="icons/jbossforge_icon_16px.png"
id="org.jboss.tools.forge.console"
name="Forge Console"
restorable="true">
13 years, 1 month
JBoss Tools SVN: r36506 - in trunk/forge/plugins: org.jboss.tools.forge.ui/META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-11-21 12:17:07 -0500 (Mon, 21 Nov 2011)
New Revision: 36506
Added:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/OpenPostProcessor.java
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java
trunk/forge/plugins/org.jboss.tools.forge.ui/META-INF/MANIFEST.MF
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandProcessor.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java
Log:
JBIDE-10203: File opens in Editor
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java 2011-11-21 17:01:28 UTC (rev 36505)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java 2011-11-21 17:17:07 UTC (rev 36506)
@@ -21,6 +21,11 @@
str = project.getProjectRoot().getName();
}
sendEscaped("Intercepted Command: " + line + " Current Project Directory: " + str);
+ if (line.startsWith("open ")) {
+ str = shell.getCurrentResource().getFullyQualifiedName();
+ sendEscaped("Execute Command: " + line + " Current Resource: " + str);
+ return null;
+ }
return line;
}
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/META-INF/MANIFEST.MF 2011-11-21 17:01:28 UTC (rev 36505)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/META-INF/MANIFEST.MF 2011-11-21 17:17:07 UTC (rev 36506)
@@ -15,7 +15,8 @@
org.eclipse.m2e.maven.runtime;bundle-version="[1.0,2.0)",
org.eclipse.jdt.core,
org.eclipse.ui.views,
- org.jboss.tools.forge.core;bundle-version="1.0.0"
+ org.jboss.tools.forge.core;bundle-version="1.0.0",
+ org.eclipse.core.filesystem;bundle-version="1.3.100"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.jboss.tools.forge.ui.ForgeUIPlugin
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandProcessor.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandProcessor.java 2011-11-21 17:01:28 UTC (rev 36505)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandProcessor.java 2011-11-21 17:17:07 UTC (rev 36506)
@@ -52,6 +52,15 @@
currentCommand = null;
}
+ public void executeCommand(final String line, final String resourcePath) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ new OpenPostProcessor().postProcess(line, resourcePath);
+ }
+ });
+ }
+
public void log(String str) {
if (currentCommand != null) {
buffer.append(str);
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java 2011-11-21 17:01:28 UTC (rev 36505)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java 2011-11-21 17:17:07 UTC (rev 36506)
@@ -186,6 +186,16 @@
commandProcessor.startCommand(str.substring(21));
} else if (str.startsWith("Executed Command: ")) {
commandProcessor.stopCurrentCommand();
+ } else if (str.startsWith("Execute Command: ")) {
+ str = str.substring(17);
+ int index = str.indexOf("Current Resource: ");
+ String line = "";
+ String resource = "";
+ if (index != -1) {
+ line = str.substring(0, index);
+ resource = str.substring(index + 18);
+ commandProcessor.executeCommand(line, resource);
+ }
} else if (str.startsWith("POM File Modified: ")) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(str.substring(19));
if (project != null) {
Added: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/OpenPostProcessor.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/OpenPostProcessor.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/OpenPostProcessor.java 2011-11-21 17:17:07 UTC (rev 36506)
@@ -0,0 +1,48 @@
+package org.jboss.tools.forge.ui.console;
+
+import java.io.File;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.forge.ui.ForgeUIPlugin;
+
+public class OpenPostProcessor {
+
+ public void postProcess(String line, String currentResourcePath) {
+ try {
+ String resourceToOpen = currentResourcePath + File.separator + line.substring(5).trim();
+ IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(resourceToOpen));
+ if (fileStore.fetchInfo().isDirectory()) {
+ expandDirectoryInExplorer(resourceToOpen);
+ } else {
+ openFileInEditor(fileStore);
+ }
+ IWorkbenchPage workbenchPage = ForgeCommandPostProcessorHelper.getActiveWorkbenchPage();
+ if (workbenchPage != null) {
+ IDE.openEditorOnFileStore(workbenchPage, fileStore);
+ }
+ } catch (PartInitException e) {
+ ForgeUIPlugin.log(e);
+ }
+ }
+
+ private void openFileInEditor(IFileStore fileStore) {
+ try {
+ IWorkbenchPage workbenchPage = ForgeCommandPostProcessorHelper.getActiveWorkbenchPage();
+ if (workbenchPage != null) {
+ IDE.openEditorOnFileStore(workbenchPage, fileStore);
+ }
+ } catch (PartInitException e) {
+ ForgeUIPlugin.log(e);
+ }
+ }
+
+ private void expandDirectoryInExplorer(String resourceToOpen) {
+
+ }
+
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/OpenPostProcessor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 1 month
JBoss Tools SVN: r36505 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 12:01:28 -0500 (Mon, 21 Nov 2011)
New Revision: 36505
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/
Log:
ignoring screenshots
Property changes on: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test
___________________________________________________________________
Added: svn:ignore
+ screenshots
13 years, 1 month
JBoss Tools SVN: r36504 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 12:00:33 -0500 (Mon, 21 Nov 2011)
New Revision: 36504
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java
Log:
added new matcher
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java 2011-11-21 17:00:16 UTC (rev 36503)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java 2011-11-21 17:00:33 UTC (rev 36504)
@@ -1,6 +1,9 @@
package org.jboss.tools.portlet.ui.bot.test.matcher.workspace;
import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
+import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.ExistingFileMatcher;
+import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.xml.XMLFileNodeContentMatcher;
+import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.xml.XMLNode;
import org.jboss.tools.portlet.ui.bot.test.task.facet.FacetDefinition;
/**
@@ -26,4 +29,8 @@
public static SWTMatcher<String> hasFacets(FacetDefinition... facets){
return new ProjectFacetsMatcher(facets);
}
+
+ public static SWTMatcher<XMLNode[]> areInFile(String project, String file){
+ return new XMLFileNodeContentMatcher(project, file);
+ }
}
13 years, 1 month
JBoss Tools SVN: r36503 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace: file and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 12:00:16 -0500 (Mon, 21 Nov 2011)
New Revision: 36503
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/ExistingFileMatcher.java
Removed:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java
Log:
changed the package
Deleted: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java 2011-11-21 16:59:56 UTC (rev 36502)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java 2011-11-21 17:00:16 UTC (rev 36503)
@@ -1,34 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.matcher.workspace;
-
-import org.hamcrest.Description;
-import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem;
-
-/**
- * Checks if the file exists in the project.
- *
- * @author Lucia Jelinkova
- *
- */
-public class ExistingFileMatcher extends AbstractSWTMatcher<String> {
-
- private static final String FILE_SEPARATOR = "/";
-
- private String project;
-
- public ExistingFileMatcher(String project) {
- this.project = project;
- }
-
- @Override
- public boolean matchesSafely(String path) {
- SWTBotFactory.getOpen().perspective(ActionItem.Perspective.JAVA.LABEL);
- return SWTBotFactory.getPackageexplorer().isFilePresent(project, path.split(FILE_SEPARATOR));
- }
-
- @Override
- public void describeTo(Description description) {
- description.appendValue("existing file");
- }
-}
Copied: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/ExistingFileMatcher.java (from rev 36487, trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ExistingFileMatcher.java)
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/ExistingFileMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/ExistingFileMatcher.java 2011-11-21 17:00:16 UTC (rev 36503)
@@ -0,0 +1,34 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file;
+
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+
+/**
+ * Checks if the file exists in the project.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class ExistingFileMatcher extends AbstractSWTMatcher<String> {
+
+ private static final String FILE_SEPARATOR = "/";
+
+ private String project;
+
+ public ExistingFileMatcher(String project) {
+ this.project = project;
+ }
+
+ @Override
+ public boolean matchesSafely(String path) {
+ SWTBotFactory.getOpen().perspective(ActionItem.Perspective.JAVA.LABEL);
+ return SWTBotFactory.getPackageexplorer().isFilePresent(project, path.split(FILE_SEPARATOR));
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendValue("existing file");
+ }
+}
13 years, 1 month
JBoss Tools SVN: r36502 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 11:59:56 -0500 (Mon, 21 Nov 2011)
New Revision: 36502
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java
Log:
added assert for the content of XML file
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java 2011-11-21 16:52:40 UTC (rev 36501)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java 2011-11-21 16:59:56 UTC (rev 36502)
@@ -2,8 +2,10 @@
import static org.jboss.tools.portlet.ui.bot.test.create.CreateJavaPortletProject.PROJECT_NAME;
import static org.jboss.tools.portlet.ui.bot.test.matcher.problems.ProblemViewMatchersFactory.isNumberOfErrors;
+import static org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.areInFile;
import static org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.existsInProject;
+import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.xml.XMLNode;
import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
import org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss.PortletCreationTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
@@ -23,14 +25,19 @@
private static final String SOURCE_FILE_NAME = "src";
+ private static final String CLASS_FILE = SOURCE_FILE_NAME + "/" + PACKAGE_NAME + "/" + CLASS_NAME + ".java";
+
+ private static final String FULL_CLASS_NAME = PACKAGE_NAME + "." + CLASS_NAME;
+
@Test
public void testCreate(){
doPerform(getCreatePortletTask());
doAssertThat(0, isNumberOfErrors());
- doAssertThat(SOURCE_FILE_NAME + "/" + PACKAGE_NAME + "/" + CLASS_NAME + ".java", existsInProject(PROJECT_NAME));
+ doAssertThat(CLASS_FILE, existsInProject(PROJECT_NAME));
doAssertThat("WebContent/WEB-INF/default-object.xml", existsInProject(PROJECT_NAME));
doAssertThat("WebContent/WEB-INF/portlet-instances.xml", existsInProject(PROJECT_NAME));
+ doAssertThat(nodes(new XMLNode("portlet-app/portlet/portlet-class", FULL_CLASS_NAME)), areInFile(PROJECT_NAME, "WebContent/WEB-INF/portlet.xml"));
System.out.println("");
}
@@ -41,4 +48,8 @@
task.setClassName(CLASS_NAME);
return task;
}
+
+ private XMLNode[] nodes(XMLNode... nodes){
+ return nodes;
+ }
}
13 years, 1 month
JBoss Tools SVN: r36501 - in trunk/build/aggregate: site and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-21 11:52:40 -0500 (Mon, 21 Nov 2011)
New Revision: 36501
Modified:
trunk/build/aggregate/bottests-site/site/build.xml
trunk/build/aggregate/site/build.xml
trunk/build/aggregate/soa-site/build.xml
trunk/build/aggregate/webtools-site/build.xml
Log:
refactor associate sites properties file and fix refs to that file in build.xml for soa site (JBIDE-10201)
Modified: trunk/build/aggregate/bottests-site/site/build.xml
===================================================================
--- trunk/build/aggregate/bottests-site/site/build.xml 2011-11-21 16:51:12 UTC (rev 36500)
+++ trunk/build/aggregate/bottests-site/site/build.xml 2011-11-21 16:52:40 UTC (rev 36501)
@@ -28,8 +28,8 @@
<property name="update.site.source.dir" value="${output.dir}/target/site" />
<!-- load properties from default (or alternate) properties file -->
- <property name="associate.sites" value="associate.sites.properties" />
- <property file="${associate.sites}" />
+ <property name="associate.sites.properties" value="associate.sites.properties" />
+ <property file="${associate.sites.properties}" />
<property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml" />
Modified: trunk/build/aggregate/site/build.xml
===================================================================
--- trunk/build/aggregate/site/build.xml 2011-11-21 16:51:12 UTC (rev 36500)
+++ trunk/build/aggregate/site/build.xml 2011-11-21 16:52:40 UTC (rev 36501)
@@ -28,8 +28,8 @@
<property name="update.site.source.dir" value="${output.dir}/target/site" />
<!-- load properties from default (or alternate) properties file -->
- <property name="associate.sites" value="associate.sites.properties" />
- <property file="${associate.sites}" />
+ <property name="associate.sites.properties" value="associate.sites.properties" />
+ <property file="${associate.sites.properties}" />
<property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml" />
Modified: trunk/build/aggregate/soa-site/build.xml
===================================================================
--- trunk/build/aggregate/soa-site/build.xml 2011-11-21 16:51:12 UTC (rev 36500)
+++ trunk/build/aggregate/soa-site/build.xml 2011-11-21 16:52:40 UTC (rev 36501)
@@ -28,8 +28,8 @@
<property name="update.site.source.dir" value="${output.dir}/target/site" />
<!-- load properties from default (or alternate) properties file -->
- <property name="associate.sites" value="associate.sites.properties" />
- <property file="${associate.sites}" />
+ <property name="associate.sites.properties" value="associate.sites.properties" />
+ <property file="${associate.sites.properties}" />
<property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml" />
Modified: trunk/build/aggregate/webtools-site/build.xml
===================================================================
--- trunk/build/aggregate/webtools-site/build.xml 2011-11-21 16:51:12 UTC (rev 36500)
+++ trunk/build/aggregate/webtools-site/build.xml 2011-11-21 16:52:40 UTC (rev 36501)
@@ -28,8 +28,8 @@
<property name="update.site.source.dir" value="${output.dir}/target/site" />
<!-- load properties from default (or alternate) properties file -->
- <property name="associate.sites" value="associate.sites.properties" />
- <property file="${associate.sites}" />
+ <property name="associate.sites.properties" value="associate.sites.properties" />
+ <property file="${associate.sites.properties}" />
<property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml" />
13 years, 1 month
JBoss Tools SVN: r36500 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace: file and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-21 11:51:12 -0500 (Mon, 21 Nov 2011)
New Revision: 36500
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/XMLFileNodeContentMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/XMLNode.java
Log:
created new matcher
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/XMLFileNodeContentMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/XMLFileNodeContentMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/XMLFileNodeContentMatcher.java 2011-11-21 16:51:12 UTC (rev 36500)
@@ -0,0 +1,74 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.xml;
+
+import java.util.Arrays;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+
+/**
+ * Checks if the file contains specified nodes.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class XMLFileNodeContentMatcher extends AbstractSWTMatcher<XMLNode[]> {
+
+ private String project;
+
+ private String file;
+
+ public XMLFileNodeContentMatcher(String project, String file) {
+ super();
+ this.project = project;
+ this.file = file;
+ }
+
+ @Override
+ public boolean matchesSafely(XMLNode[] nodes) {
+ String[] filePath = file.split("/");
+ SWTBotFactory.getPackageexplorer().openFile(project, filePath);
+ SWTBotEditorExt editor = SWTBotFactory.getBot().swtBotEditorExtByTitle(filePath[filePath.length - 1]);
+ SWTBotTree tree = editor.bot().tree();
+
+ for (XMLNode node : nodes){
+ if (!containsNode(editor.bot(), tree, node)){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private boolean containsNode(SWTBot bot, SWTBotTree tree, XMLNode node) {
+ for (String s : getNodePath(node)){
+ System.out.println("Path element: " + s);
+ }
+ System.out.println("Name: " + getNodeName(node));
+ SWTBotTreeItem item = SWTEclipseExt.getTreeItemOnPathStartsWith(bot, tree, 0, getNodeName(node), getNodePath(node));
+ return item.cell(1).contains(node.getContent());
+ }
+
+ private String[] getNodePath(XMLNode node) {
+ String[] path = node.getPath().split("/");
+ if (path.length <= 1){
+ return new String[0];
+ }
+ return Arrays.copyOfRange(path, 0, path.length - 1);
+ }
+
+ private String getNodeName(XMLNode node) {
+ String[] path = node.getPath().split("/");
+ return path[path.length - 1];
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendText("file " + project + "/" + file + " contains the node(s)");
+ }
+}
+
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/XMLNode.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/XMLNode.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/file/xml/XMLNode.java 2011-11-21 16:51:12 UTC (rev 36500)
@@ -0,0 +1,36 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.xml;
+
+
+public class XMLNode {
+
+ private String path;
+
+ private String content;
+
+ public XMLNode(String path, String content) {
+ super();
+ this.path = path;
+ this.content = content;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ @Override
+ public String toString() {
+ return "XML path = " + getPath() + ", content = " + getContent();
+ }
+}
13 years, 1 month