Seam SVN: r13601 - in branches/community/Seam_2_2: build and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-08-11 10:01:08 -0400 (Wed, 11 Aug 2010)
New Revision: 13601
Modified:
branches/community/Seam_2_2/build/build.properties
branches/community/Seam_2_2/build/docs.pom.xml
branches/community/Seam_2_2/build/readme.txt
branches/community/Seam_2_2/build/root.pom.xml
branches/community/Seam_2_2/release-process.txt
Log:
JBSEAM-4692
Modified: branches/community/Seam_2_2/build/build.properties
===================================================================
--- branches/community/Seam_2_2/build/build.properties 2010-08-11 12:42:33 UTC (rev 13600)
+++ branches/community/Seam_2_2/build/build.properties 2010-08-11 14:01:08 UTC (rev 13601)
@@ -1,4 +1,5 @@
offline.repository.jboss.org /home/mnovotny/projects/jboss-maven-repository/maven2
+jboss-releases-repository https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/
embedded.poms.dir /home/mnovotny/workspaces/jboss/jboss-seam_2_2/build/embedded
embedded.dir /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded
#embedded.jars.dir /Users/pmuir/tmp/embedded-jboss-beta3/lib
Modified: branches/community/Seam_2_2/build/docs.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/docs.pom.xml 2010-08-11 12:42:33 UTC (rev 13600)
+++ branches/community/Seam_2_2/build/docs.pom.xml 2010-08-11 14:01:08 UTC (rev 13601)
@@ -10,21 +10,6 @@
<packaging>jdocbook</packaging>
<name>Seam Reference Guide</name>
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- </pluginRepository>
- </pluginRepositories>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- </repositories>
-
<build>
<plugins>
<plugin>
Modified: branches/community/Seam_2_2/build/readme.txt
===================================================================
--- branches/community/Seam_2_2/build/readme.txt 2010-08-11 12:42:33 UTC (rev 13600)
+++ branches/community/Seam_2_2/build/readme.txt 2010-08-11 14:01:08 UTC (rev 13601)
@@ -42,20 +42,6 @@
* Bear in mind that a released Seam shouldn't depend on a SNAPSHOT version
-* When we release Seam we have to add all it's dependencies to
- repository.jboss.org (no thirdparty repositories should be used for released
- versions) - so if you are adding a dependency which is stable, and you aren't
- planning to change the dependency before the next release you should add it
- straight to repository.jboss.org. To do this:
- 1) Checkout repository.jboss.org/maven2 from svn (https://svn.jboss.org/repos/repository.jboss.org)
- 2) Set the offline.repository.jboss.org property in build/build.properties to
- the directory you checked out to.
- 3) Run ant -Dpom=foo.pom -Djar=foo.jar deployRelease
- - if the new dependency also has a source and javadoc jar you can run:
- - "ant -Dpom=foo.pom -Djar=foo.jar -Dsrcjar=foo-src.jar -Ddocjar=foo-doc.jar deployReleaseWithSourcesAndJavaDoc"
- 4) Check in the changed files to SVN (they'll be under a path of
- artifactId/groupId/version)
-
To add a unreleased dependency of Seam:
-----------------------------------------
@@ -63,26 +49,10 @@
* If you need a dependency which isn't available in Maven, and don't want to add
it straight to repository.jboss.org or want to depend on a CVS/snapshot of a
project which you're planning to upgrade before the next Seam release you
- can add it to snapshots.jboss.org.
+ can add it to repository.jboss.org.
+ Check the http://community.jboss.org/wiki/UploadingaThirdpartyArtifact.
-* To add a jar to the local repository, you can, if you have a pom (that you
- copied from an earlier version or have written) run:
- ant deploySnapshot -Dpom=foo.pom -Djar=foo.jar
-
- If you want maven to create a basic pom for you:
-
- ant deploySnapshot -Djar=foo.jar
-
- You will be prompted for your jboss.org username and pasword (WARNING your
- password is echoed back to you!)
-
-* If you need to alter the pom or jar in a repository but don't change
- the version number, you should delete the old copy from maven's cache
-
- rm -rf ~/.m2/repository/group/id/artifactId/version
-
-
Release Instructions
--------------------
@@ -95,15 +65,19 @@
* Check that all dependencies of Seam are present in repository.jboss.org
- Check that snapshots.jboss.org is not active
- Check that no other maven repositorys are enabled
-* Follow the proceedure outlined above to add jars to repository.jboss.org
+* Follow the procedure outlined above to add jars to repository.jboss.org
Add Seam to repository.jboss.org:
-* Checkout repository.jboss.org/maven2 from svn (https://svn.jboss.org/repos/repository.jboss.org)
-* Set the offline.repository.jboss.org property in build/build.properties to the
- directory you checked out to.
-* Run ant releaseSeam
-* Commit the release to repository.jboss.org
+* Run ant -Drepository.username=<your_username> -Drepository.password=<your_password> stageReleaseSeam
+* Login to https://repository.jboss.org/nexus and close the staging repository, which was created by previous
+ step.
+* Click on the link "Staging Repositories" on the left side under the section called "Build Promotion".
+ Next, select the checkbox next to the staging repository which contains your jboss.org userid.
+ Then click on the "Close" button at the top of the repository list.
+ More at http://community.jboss.org/wiki/MavenDeployingaRelease page
+* Verify your upload by using staging repo https://repository.jboss.org/nexus/content/groups/staging/
+*
Examples
Modified: branches/community/Seam_2_2/build/root.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/root.pom.xml 2010-08-11 12:42:33 UTC (rev 13600)
+++ branches/community/Seam_2_2/build/root.pom.xml 2010-08-11 14:01:08 UTC (rev 13601)
@@ -9,32 +9,6 @@
<version>@seam.version@</version>
<name>JBoss Seam</name>
<packaging>pom</packaging>
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- </pluginRepository>
- <pluginRepository>
- <snapshots />
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshot Repository</name>
- <url>http://snapshots.jboss.org/maven2</url>
- </pluginRepository>
- </pluginRepositories>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- <repository>
- <snapshots />
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshot Repository</name>
- <url>http://snapshots.jboss.org/maven2</url>
- </repository>
- </repositories>
<!-- Externalize some version numbers here -->
<properties>
Modified: branches/community/Seam_2_2/release-process.txt
===================================================================
--- branches/community/Seam_2_2/release-process.txt 2010-08-11 12:42:33 UTC (rev 13600)
+++ branches/community/Seam_2_2/release-process.txt 2010-08-11 14:01:08 UTC (rev 13601)
@@ -28,7 +28,8 @@
Maven repository settings
-------------------------
* A released version of seam should not reference any repositories other than
- "repository.jboss.org". See "build/readme.txt" for details.
+ "http://repository.jboss.org/nexus/content/groups/public/" or for older things "https://repository.jboss.org/nexus/content/repositories/deprecated/".
+ See "build/readme.txt" for details.
- Search "$SEAM/build" for "repositories".
- Comment out any repository entry not "http://repository.jboss.org/maven2"
- Should only be entries in "root.pom.xml" and "docs.pom.xml"
@@ -593,19 +594,8 @@
- Note: this can take a long time.
* Maven release procedure.(see build/readme.txt for details)
- - Checkout/update JBoss repository
- - checkout "svn co https://svn.jboss.org/repos/repository.jboss.org/maven2"
- - Note this can take a very long time
- - update (if already local) "svn update ." in the "maven2" directory.
- - Adding this to an eclipse project with svn plugin can make it much easier.
- - Set the "offline.repository.jboss.org" property in "build/build.properties"
- - to the directory you checked out to.
- - Run "ant releaseSeam" in the build directory
- - Review and Commit the release changes to repository.jboss.org
- - simple script to add new files to SVN
- - svn status | grep "^\?" | awk '{print $2}' | xargs svn add
- - note if you've added this to eclipse you may need to revert ".project"
- - they still need to be reviewed and commited.
+ - Run "ant -Drepository.username=<your_username> -Drepository.password=<your_password> stageReleaseSeam" in the build directory
+ - Then follow http://community.jboss.org/wiki/MavenDeployingaRelease section Closing the Staging Respository
* Create draft of the documentation and download pages on seamframework.org
- documentation points to "docs.jboss.com"
13 years, 9 months
Seam SVN: r13600 - dist/trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-08-11 08:42:33 -0400 (Wed, 11 Aug 2010)
New Revision: 13600
Modified:
dist/trunk/pom.xml
Log:
use jboss repo
Modified: dist/trunk/pom.xml
===================================================================
--- dist/trunk/pom.xml 2010-08-11 12:29:52 UTC (rev 13599)
+++ dist/trunk/pom.xml 2010-08-11 12:42:33 UTC (rev 13600)
@@ -11,55 +11,13 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
- <version>12</version>
+ <version>13</version>
</parent>
<description>
The Seam "Bill of Materials", specifying the Seam stack for runtime use
</description>
- <repositories>
- <repository>
- <id>oss.sonatype.org/jboss-snapshots</id>
- <url>http://oss.sonatype.org/content/repositories/jboss-snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </repository>
- <repository>
- <id>jboss-public-repository-group</id>
- <name>JBoss Public Repository Group</name>
- <url>http://repository.jboss.org/nexus/content/groups/public/</url>
- <layout>default</layout>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>oss.sonatype.org/jboss-snapshots</id>
- <url>http://oss.sonatype.org/content/repositories/jboss-snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
<url>http://www.seamframework.org</url>
<modules>
@@ -288,6 +246,45 @@
<module>docs</module>
</modules>
</profile>
+ <profile>
+ <id>jboss-public-repository</id>
+ <activation>
+ <property>
+ <name>jboss-public-repository</name>
+ <value>!false</value>
+ </property>
+ </activation>
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
</profiles>
<scm>
13 years, 9 months
Seam SVN: r13599 - dist/trunk.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-08-11 08:29:52 -0400 (Wed, 11 Aug 2010)
New Revision: 13599
Modified:
dist/trunk/pom.xml
Log:
updated picketlink version
Modified: dist/trunk/pom.xml
===================================================================
--- dist/trunk/pom.xml 2010-08-11 11:49:39 UTC (rev 13598)
+++ dist/trunk/pom.xml 2010-08-11 12:29:52 UTC (rev 13599)
@@ -86,7 +86,7 @@
<hibernate.version>3.5.1-Final</hibernate.version>
<drools.version>5.1.0.M2</drools.version>
<jbpm.version>4.2</jbpm.version>
- <picketlink.idm.version>1.1.5.CR01</picketlink.idm.version>
+ <picketlink.idm.version>1.5.0.Alpha01</picketlink.idm.version>
<joda.time.version>1.6</joda.time.version>
<pretty.time.version>1.0.6</pretty.time.version>
13 years, 9 months
Seam SVN: r13598 - in modules/persistence/trunk: impl/src/main/java/org/jboss/seam/persistence and 3 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-08-11 07:49:39 -0400 (Wed, 11 Aug 2010)
New Revision: 13598
Added:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamPersistenceProvider.java
Removed:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java
Modified:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/AbstractManagedPersistenceContextBeanLifecycle.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextProxyHandler.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EntityTransaction.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java
modules/persistence/trunk/pom.xml
Log:
bug fix and refactoring
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/AbstractManagedPersistenceContextBeanLifecycle.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/AbstractManagedPersistenceContextBeanLifecycle.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/AbstractManagedPersistenceContextBeanLifecycle.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -26,6 +26,7 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
+import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
@@ -33,6 +34,9 @@
import javax.persistence.EntityManagerFactory;
import org.jboss.weld.extensions.bean.BeanLifecycle;
+import org.jboss.weld.extensions.literal.DefaultLiteral;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Class that is responsible for creating and destroying the seam managed
@@ -50,6 +54,10 @@
private final BeanManager manager;
+ private static final Logger log = LoggerFactory.getLogger(AbstractManagedPersistenceContextBeanLifecycle.class);
+
+ private PersistenceContexts persistenceContexts;
+
protected AbstractManagedPersistenceContextBeanLifecycle(BeanManager manager)
{
this.manager = manager;
@@ -76,7 +84,7 @@
{
EntityManagerFactory emf = getEntityManagerFactory();
EntityManager entityManager = emf.createEntityManager();
- ManagedPersistenceContextProxyHandler handler = new ManagedPersistenceContextProxyHandler(entityManager, manager, bean.getQualifiers());
+ ManagedPersistenceContextProxyHandler handler = new ManagedPersistenceContextProxyHandler(entityManager, manager, bean.getQualifiers(), getPersistenceContexts());
EntityManager proxy = (EntityManager) proxyConstructor.newInstance(handler);
return proxy;
}
@@ -90,8 +98,27 @@
{
em.close();
arg1.release();
+ try
+ {
+ getPersistenceContexts().untouch((PersistenceContext) em);
+ }
+ catch (ContextNotActiveException e)
+ {
+ log.debug("Could not untouch PersistenceContext as conversation scope not active");
+ }
}
protected abstract EntityManagerFactory getEntityManagerFactory();
+ private PersistenceContexts getPersistenceContexts()
+ {
+ if (persistenceContexts == null)
+ {
+ Bean<PersistenceContexts> bean = (Bean) manager.resolve(manager.getBeans(PersistenceContexts.class, DefaultLiteral.INSTANCE));
+ CreationalContext<PersistenceContexts> ctx = manager.createCreationalContext(bean);
+ persistenceContexts = (PersistenceContexts) manager.getReference(bean, PersistenceContexts.class, ctx);
+ }
+ return persistenceContexts;
+ }
+
}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -29,7 +29,7 @@
* @author Stuart Douglas
*
*/
-public class HibernatePersistenceProvider extends PersistenceProvider
+public class HibernatePersistenceProvider extends SeamPersistenceProvider
{
@Inject
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -28,6 +28,7 @@
import java.util.HashSet;
import java.util.Set;
+import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.spi.BeanManager;
import javax.persistence.EntityManager;
@@ -61,14 +62,19 @@
private transient boolean synchronizationRegistered;
+ private final PersistenceContexts persistenceContexts;
+
+ private boolean persistenceContextsTouched = false;
+
static final Logger log = LoggerFactory.getLogger(ManagedPersistenceContextProxyHandler.class);
- public ManagedPersistenceContextProxyHandler(EntityManager delegate, BeanManager beanManager, Set<Annotation> qualifiers)
+ public ManagedPersistenceContextProxyHandler(EntityManager delegate, BeanManager beanManager, Set<Annotation> qualifiers, PersistenceContexts persistenceContexts)
{
super(delegate, beanManager, qualifiers);
this.delegate = delegate;
this.userTransactionInstance = InstanceResolver.getInstance(SeamTransaction.class, beanManager, DefaultTransactionLiteral.INSTANCE);
this.qualifiers = new HashSet<Annotation>(qualifiers);
+ this.persistenceContexts = persistenceContexts;
}
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
@@ -77,6 +83,7 @@
{
joinTransaction();
}
+ touch((PersistenceContext) proxy);
return super.invoke(proxy, method, args);
}
@@ -101,6 +108,22 @@
}
}
+ void touch(PersistenceContext delegate)
+ {
+ if (!persistenceContextsTouched)
+ {
+ try
+ {
+ persistenceContexts.touch(delegate);
+ persistenceContextsTouched = true;
+ }
+ catch (ContextNotActiveException e)
+ {
+ log.debug("Not touching pc " + this + "as conversation scope not active");
+ }
+ }
+ }
+
public void afterCompletion(int status)
{
synchronizationRegistered = false;
@@ -110,4 +133,5 @@
{
}
+
}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextProxyHandler.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextProxyHandler.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextProxyHandler.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -55,7 +55,7 @@
private final Instance<Expressions> expressionsInstance;
- private final Instance<PersistenceProvider> persistenceProvider;
+ private final Instance<SeamPersistenceProvider> persistenceProvider;
private final Set<Annotation> qualifiers;
@@ -65,7 +65,7 @@
{
this.delegate = delegate;
expressionsInstance = InstanceResolver.getInstance(Expressions.class, beanManager);
- persistenceProvider = InstanceResolver.getInstance(PersistenceProvider.class, beanManager);
+ persistenceProvider = InstanceResolver.getInstance(SeamPersistenceProvider.class, beanManager);
this.qualifiers = new HashSet<Annotation>(qualifiers);
}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -47,7 +47,7 @@
Instance<PersistenceContext> persistenceContexts;
@Inject
- Instance<PersistenceProvider> persistenceProvider;
+ Instance<SeamPersistenceProvider> persistenceProvider;
@Inject
public void create(FlushModeManager manager)
Deleted: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -1,267 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.persistence;
-
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.persistence.EntityManager;
-import javax.persistence.OptimisticLockException;
-import javax.persistence.PersistenceContexts;
-import javax.transaction.Synchronization;
-
-import org.jboss.seam.persistence.transaction.FlushModeType;
-
-/**
- * Abstraction layer for persistence providers (JPA implementations). This class
- * provides a working base implementation that can be optimized for performance
- * and non-standardized features by extending and overriding the methods.
- *
- * The methods on this class are a great todo list for the next rev of the JPA
- * spec ;-)
- *
- * @author Gavin King
- * @author Pete Muir
- * @author Stuart Douglas
- *
- */
-public class PersistenceProvider
-{
- public enum Feature
- {
- /**
- * Identifies whether this JPA provider supports using a wildcard as the
- * subject of a count query.
- *
- * <p>
- * Here's a count query that uses a wildcard as the subject.
- * </p>
- *
- * <pre>
- * select count(*) from Vehicle v
- * </pre>
- * <p>
- * Per the JPA 1.0 spec, using a wildcard as a subject of a count query is
- * not permitted. Instead, the subject must be the entity or the alias, as
- * in this count query:
- * </p>
- *
- * <pre>
- * select count(v) from Vehicle v
- * </pre>
- * <p>
- * Hibernate supports the wildcard syntax as an vendor extension.
- * Furthermore, Hibernate produces an invalid SQL query when using the
- * compliant subject if the entity has a composite primary key. Therefore,
- * we prefer to use the wildcard syntax if it is supported.
- * </p>
- */
- WILDCARD_AS_COUNT_QUERY_SUBJECT
- }
-
- protected Set<Feature> featureSet = new HashSet<Feature>();
-
- /**
- * Indicate whether this JPA provider supports the feature defined by the
- * provided Feature enum value.
- */
- public boolean supportsFeature(Feature feature)
- {
- return featureSet.contains(feature);
- }
-
- /**
- * sets the flush mode
- */
- public void setFlushMode(EntityManager entityManager, FlushModeType type)
- {
- switch (type)
- {
- case AUTO:
- entityManager.setFlushMode(javax.persistence.FlushModeType.AUTO);
- break;
- case COMMIT:
- entityManager.setFlushMode(javax.persistence.FlushModeType.COMMIT);
- case MANUAL:
- setFlushModeManual(entityManager);
- default:
- throw new RuntimeException("Unkown flush mode: " + type);
- }
- }
-
- /**
- * Set the flush mode to manual-only flushing. Called when an atomic
- * persistence context is required.
- */
- public void setFlushModeManual(EntityManager entityManager)
- {
- throw new UnsupportedOperationException("Use of FlushMode.MANUAL requires Hibernate as the persistence provider. Please use Hibernate, a custom persistenceProvider, or remove the MANUAL flush mode setting.");
- }
-
- /**
- * <p>
- * Set the FlushMode the persistence contexts should use during rendering by
- * calling {@link PersistenceContexts#changeFlushMode(FlushModeType, true)}.
- * The actual changing of the flush mode is handled by the
- * {@link PersistenceContexts} instance. The boolean argument should be true
- * to indicate that this is a temporary change and that the old flush mode
- * should be restored after render.
- * </p>
- * <p>
- * Ideally, this should be MANUAL since changes should never flush to the
- * database while in render response and the cost of a dirty check can be
- * avoided. However, since the MANUAL mode is not officially part of the JPA
- * specification, the default implementation will perform no operation.
- * </p>
- */
- public void setRenderFlushMode()
- {
- // no-op in default implementation
- }
-
- /**
- * Does the persistence context have unflushed changes? If it does not,
- * persistence context replication can be optimized.
- *
- * @return true to indicate that there are unflushed changes
- */
- public boolean isDirty(EntityManager entityManager)
- {
- return true; // best we can do!
- }
-
- /**
- * Get the value of the entity identifier attribute.
- *
- * @param bean a managed entity instance
- */
- public Object getId(Object bean, EntityManager entityManager)
- {
- // return Entity.forBean(bean).getIdentifier(bean);
- return null;
- }
-
- /**
- * Get the name of the entity
- *
- * @param bean
- * @param entityManager
- *
- * @throws IllegalArgumentException if the passed object is not an entity
- */
- public String getName(Object bean, EntityManager entityManager) throws IllegalArgumentException
- {
- return null;
- // return Entity.forBean(bean).getName();
- }
-
- /**
- * Get the value of the entity version attribute.
- *
- * @param bean a managed entity instance
- */
- public Object getVersion(Object bean, EntityManager entityManager)
- {
- return null;
- // return Entity.forBean(bean).getVersion(bean);
- }
-
- public void checkVersion(Object bean, EntityManager entityManager, Object oldVersion, Object version)
- {
- boolean equal;
- if (oldVersion instanceof Date)
- {
- equal = ((Date) oldVersion).getTime() == ((Date) version).getTime();
- }
- else
- {
- equal = oldVersion.equals(version);
- }
- if (!equal)
- {
- throw new OptimisticLockException("Current database version number does not match passivated version number");
- }
- }
-
- /**
- * Enable a Filter. This is here just especially for Hibernate, since we well
- * know that other products don't have such cool features.
- *
- * public void enableFilter(Filter filter, EntityManager entityManager) {
- * throw new UnsupportedOperationException("Use of filters requires Hibernate as the persistence provider. Please use Hibernate or remove the filters configuration."
- * ); }
- */
- /**
- * Register a Synchronization with the current transaction.
- */
- public boolean registerSynchronization(Synchronization sync, EntityManager entityManager)
- {
- return false; // best we can do!
- }
-
- /**
- * Wrap the delegate before returning it to the application
- */
- public Object proxyDelegate(Object delegate)
- {
- return delegate;
- }
-
- /**
- * Returns the class of an entity bean instance
- *
- * @param bean The entity bean instance
- * @return The class of the entity bean
- */
- public Class getBeanClass(Object bean)
- {
- return null;
- // return Entity.forBean(bean).getBeanClass();
- }
-
- public Method getPostLoadMethod(Object bean, EntityManager entityManager)
- {
- return null;
- // return Entity.forBean(bean).getPostLoadMethod();
- }
-
- public Method getPrePersistMethod(Object bean, EntityManager entityManager)
- {
- return null;
- // return Entity.forBean(bean).getPrePersistMethod();
- }
-
- public Method getPreUpdateMethod(Object bean, EntityManager entityManager)
- {
- return null;
- // return Entity.forBean(bean).getPreUpdateMethod();
- }
-
- public Method getPreRemoveMethod(Object bean, EntityManager entityManager)
- {
- return null;
- // return Entity.forBean(bean).getPreRemoveMethod();
- }
-
-}
Copied: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamPersistenceProvider.java (from rev 13576, modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java)
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamPersistenceProvider.java (rev 0)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamPersistenceProvider.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -0,0 +1,267 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence;
+
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+import javax.persistence.OptimisticLockException;
+import javax.persistence.PersistenceContexts;
+import javax.transaction.Synchronization;
+
+import org.jboss.seam.persistence.transaction.FlushModeType;
+
+/**
+ * Abstraction layer for persistence providers (JPA implementations). This class
+ * provides a working base implementation that can be optimized for performance
+ * and non-standardized features by extending and overriding the methods.
+ *
+ * The methods on this class are a great todo list for the next rev of the JPA
+ * spec ;-)
+ *
+ * @author Gavin King
+ * @author Pete Muir
+ * @author Stuart Douglas
+ *
+ */
+public class SeamPersistenceProvider
+{
+ public enum Feature
+ {
+ /**
+ * Identifies whether this JPA provider supports using a wildcard as the
+ * subject of a count query.
+ *
+ * <p>
+ * Here's a count query that uses a wildcard as the subject.
+ * </p>
+ *
+ * <pre>
+ * select count(*) from Vehicle v
+ * </pre>
+ * <p>
+ * Per the JPA 1.0 spec, using a wildcard as a subject of a count query is
+ * not permitted. Instead, the subject must be the entity or the alias, as
+ * in this count query:
+ * </p>
+ *
+ * <pre>
+ * select count(v) from Vehicle v
+ * </pre>
+ * <p>
+ * Hibernate supports the wildcard syntax as an vendor extension.
+ * Furthermore, Hibernate produces an invalid SQL query when using the
+ * compliant subject if the entity has a composite primary key. Therefore,
+ * we prefer to use the wildcard syntax if it is supported.
+ * </p>
+ */
+ WILDCARD_AS_COUNT_QUERY_SUBJECT
+ }
+
+ protected Set<Feature> featureSet = new HashSet<Feature>();
+
+ /**
+ * Indicate whether this JPA provider supports the feature defined by the
+ * provided Feature enum value.
+ */
+ public boolean supportsFeature(Feature feature)
+ {
+ return featureSet.contains(feature);
+ }
+
+ /**
+ * sets the flush mode
+ */
+ public void setFlushMode(EntityManager entityManager, FlushModeType type)
+ {
+ switch (type)
+ {
+ case AUTO:
+ entityManager.setFlushMode(javax.persistence.FlushModeType.AUTO);
+ break;
+ case COMMIT:
+ entityManager.setFlushMode(javax.persistence.FlushModeType.COMMIT);
+ case MANUAL:
+ setFlushModeManual(entityManager);
+ default:
+ throw new RuntimeException("Unkown flush mode: " + type);
+ }
+ }
+
+ /**
+ * Set the flush mode to manual-only flushing. Called when an atomic
+ * persistence context is required.
+ */
+ public void setFlushModeManual(EntityManager entityManager)
+ {
+ throw new UnsupportedOperationException("Use of FlushMode.MANUAL requires Hibernate as the persistence provider. Please use Hibernate, a custom persistenceProvider, or remove the MANUAL flush mode setting.");
+ }
+
+ /**
+ * <p>
+ * Set the FlushMode the persistence contexts should use during rendering by
+ * calling {@link PersistenceContexts#changeFlushMode(FlushModeType, true)}.
+ * The actual changing of the flush mode is handled by the
+ * {@link PersistenceContexts} instance. The boolean argument should be true
+ * to indicate that this is a temporary change and that the old flush mode
+ * should be restored after render.
+ * </p>
+ * <p>
+ * Ideally, this should be MANUAL since changes should never flush to the
+ * database while in render response and the cost of a dirty check can be
+ * avoided. However, since the MANUAL mode is not officially part of the JPA
+ * specification, the default implementation will perform no operation.
+ * </p>
+ */
+ public void setRenderFlushMode()
+ {
+ // no-op in default implementation
+ }
+
+ /**
+ * Does the persistence context have unflushed changes? If it does not,
+ * persistence context replication can be optimized.
+ *
+ * @return true to indicate that there are unflushed changes
+ */
+ public boolean isDirty(EntityManager entityManager)
+ {
+ return true; // best we can do!
+ }
+
+ /**
+ * Get the value of the entity identifier attribute.
+ *
+ * @param bean a managed entity instance
+ */
+ public Object getId(Object bean, EntityManager entityManager)
+ {
+ // return Entity.forBean(bean).getIdentifier(bean);
+ return null;
+ }
+
+ /**
+ * Get the name of the entity
+ *
+ * @param bean
+ * @param entityManager
+ *
+ * @throws IllegalArgumentException if the passed object is not an entity
+ */
+ public String getName(Object bean, EntityManager entityManager) throws IllegalArgumentException
+ {
+ return null;
+ // return Entity.forBean(bean).getName();
+ }
+
+ /**
+ * Get the value of the entity version attribute.
+ *
+ * @param bean a managed entity instance
+ */
+ public Object getVersion(Object bean, EntityManager entityManager)
+ {
+ return null;
+ // return Entity.forBean(bean).getVersion(bean);
+ }
+
+ public void checkVersion(Object bean, EntityManager entityManager, Object oldVersion, Object version)
+ {
+ boolean equal;
+ if (oldVersion instanceof Date)
+ {
+ equal = ((Date) oldVersion).getTime() == ((Date) version).getTime();
+ }
+ else
+ {
+ equal = oldVersion.equals(version);
+ }
+ if (!equal)
+ {
+ throw new OptimisticLockException("Current database version number does not match passivated version number");
+ }
+ }
+
+ /**
+ * Enable a Filter. This is here just especially for Hibernate, since we well
+ * know that other products don't have such cool features.
+ *
+ * public void enableFilter(Filter filter, EntityManager entityManager) {
+ * throw new UnsupportedOperationException("Use of filters requires Hibernate as the persistence provider. Please use Hibernate or remove the filters configuration."
+ * ); }
+ */
+ /**
+ * Register a Synchronization with the current transaction.
+ */
+ public boolean registerSynchronization(Synchronization sync, EntityManager entityManager)
+ {
+ return false; // best we can do!
+ }
+
+ /**
+ * Wrap the delegate before returning it to the application
+ */
+ public Object proxyDelegate(Object delegate)
+ {
+ return delegate;
+ }
+
+ /**
+ * Returns the class of an entity bean instance
+ *
+ * @param bean The entity bean instance
+ * @return The class of the entity bean
+ */
+ public Class getBeanClass(Object bean)
+ {
+ return null;
+ // return Entity.forBean(bean).getBeanClass();
+ }
+
+ public Method getPostLoadMethod(Object bean, EntityManager entityManager)
+ {
+ return null;
+ // return Entity.forBean(bean).getPostLoadMethod();
+ }
+
+ public Method getPrePersistMethod(Object bean, EntityManager entityManager)
+ {
+ return null;
+ // return Entity.forBean(bean).getPrePersistMethod();
+ }
+
+ public Method getPreUpdateMethod(Object bean, EntityManager entityManager)
+ {
+ return null;
+ // return Entity.forBean(bean).getPreUpdateMethod();
+ }
+
+ public Method getPreRemoveMethod(Object bean, EntityManager entityManager)
+ {
+ return null;
+ // return Entity.forBean(bean).getPreRemoveMethod();
+ }
+
+}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EntityTransaction.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EntityTransaction.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EntityTransaction.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -33,7 +33,7 @@
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
-import org.jboss.seam.persistence.PersistenceProvider;
+import org.jboss.seam.persistence.SeamPersistenceProvider;
import org.jboss.weld.extensions.core.Veto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -57,7 +57,7 @@
private EntityManager entityManager;
@Inject
- private Instance<PersistenceProvider> persistenceProvider;
+ private Instance<SeamPersistenceProvider> persistenceProvider;
@Inject
public EntityTransaction(Synchronizations sync)
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTest.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTest.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -35,7 +35,6 @@
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
import org.jboss.seam.persistence.transaction.TransactionExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.HelloService;
import org.jboss.seam.transactions.test.util.Hotel;
@@ -60,7 +59,6 @@
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
war.addPackage(TransactionExtension.class.getPackage());
war.addPackage(PersistenceContextExtension.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
war.addClasses(ManagedPersistenceContextELTest.class, Hotel.class, ManagedPersistenceContextProvider.class, HotelNameProducer.class, HelloService.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTest.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTest.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -37,7 +37,7 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.PersistenceProvider;
+import org.jboss.seam.persistence.SeamPersistenceProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
import org.jboss.seam.persistence.transaction.TransactionExtension;
@@ -75,7 +75,7 @@
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(PersistenceProvider.class.getPackage());
+ war.addPackage(SeamPersistenceProvider.class.getPackage());
war.addPackage(NamingUtils.class.getPackage());
war.addClasses(TransactionAttributeInterceptorTest.class, TransactionAttributeManagedBean.class, HelloService.class, Hotel.class, EntityManagerProvider.class, DontRollBackException.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -37,7 +37,7 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.PersistenceProvider;
+import org.jboss.seam.persistence.SeamPersistenceProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
import org.jboss.seam.persistence.transaction.TransactionExtension;
@@ -76,7 +76,7 @@
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
war.addPackage(TransactionExtension.class.getPackage());
war.addPackage(NamingUtils.class.getPackage());
- war.addPackage(PersistenceProvider.class.getPackage());
+ war.addPackage(SeamPersistenceProvider.class.getPackage());
war.addClasses(TransactionInterceptorTest.class, TransactionManagedBean.class, HelloService.class, Hotel.class, EntityManagerProvider.class, DontRollBackException.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(("<beans><interceptors><class>" + TransactionInterceptor.class.getName() + "</class></interceptors></beans>").getBytes()), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -13,7 +13,7 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.PersistenceProvider;
+import org.jboss.seam.persistence.SeamPersistenceProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
import org.jboss.seam.persistence.transaction.TransactionExtension;
@@ -41,7 +41,7 @@
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
war.addPackage(TransactionExtension.class.getPackage());
war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(PersistenceProvider.class.getPackage());
+ war.addPackage(SeamPersistenceProvider.class.getPackage());
war.addPackage(NamingUtils.class.getPackage());
war.addClasses(TransactionScopedTest.class, Hotel.class, HelloService.class, TransactionScopedObject.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java 2010-08-11 11:49:39 UTC (rev 13598)
@@ -16,6 +16,7 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.SeamPersistenceProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
import org.jboss.seam.persistence.transaction.TransactionExtension;
@@ -43,6 +44,7 @@
war.addPackage(TransactionExtension.class.getPackage());
war.addPackage(PersistenceException.class.getPackage());
war.addClasses(UserTransactionTest.class, Hotel.class, HelloService.class);
+ war.addClass(SeamPersistenceProvider.class);
war.addPackage(NamingUtils.class.getPackage());
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
Modified: modules/persistence/trunk/pom.xml
===================================================================
--- modules/persistence/trunk/pom.xml 2010-08-11 09:17:10 UTC (rev 13597)
+++ modules/persistence/trunk/pom.xml 2010-08-11 11:49:39 UTC (rev 13598)
@@ -66,12 +66,6 @@
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.5.1-Final</version>
- </dependency>
-
</dependencies>
</dependencyManagement>
13 years, 9 months
Seam SVN: r13597 - in branches/community/Seam_2_2/examples/wiki: view and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-08-11 05:17:10 -0400 (Wed, 11 Aug 2010)
New Revision: 13597
Modified:
branches/community/Seam_2_2/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiSpamReport.java
branches/community/Seam_2_2/examples/wiki/view/docDisplay_d.xhtml
Log:
fix 400 error when creating regular document
Modified: branches/community/Seam_2_2/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiSpamReport.java
===================================================================
--- branches/community/Seam_2_2/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiSpamReport.java 2010-08-11 07:53:38 UTC (rev 13596)
+++ branches/community/Seam_2_2/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiSpamReport.java 2010-08-11 09:17:10 UTC (rev 13597)
@@ -12,7 +12,7 @@
import javax.persistence.ManyToOne;
import javax.persistence.Table;
-/**
+/**
* Stores user reports of comment spam
*
* @author Shane Bryzak
Modified: branches/community/Seam_2_2/examples/wiki/view/docDisplay_d.xhtml
===================================================================
--- branches/community/Seam_2_2/examples/wiki/view/docDisplay_d.xhtml 2010-08-11 07:53:38 UTC (rev 13596)
+++ branches/community/Seam_2_2/examples/wiki/view/docDisplay_d.xhtml 2010-08-11 09:17:10 UTC (rev 13597)
@@ -42,7 +42,6 @@
<h:outputText escape="false" value="#{messages['lacewiki.label.template.RegularWikiDocument']}"/>
<f:param name="documentId" value=""/>
<f:param name="parentDirectoryId" value="#{documentHome.instance.parent.id}"/>
- <f:param name="templateType" value=""/>
</s:link>
</li>
<ui:repeat var="templateType" value="#{templateRegistry.templateTypes}">
13 years, 9 months
Seam SVN: r13596 - branches/community/Seam_2_2/examples/wiki/src/test/org/jboss/seam/wiki/test/editing.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2010-08-11 03:53:38 -0400 (Wed, 11 Aug 2010)
New Revision: 13596
Modified:
branches/community/Seam_2_2/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/Commenting.java
Log:
Fix failing tests (Editing.postComment, Editing.replyToComment)
Modified: branches/community/Seam_2_2/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/Commenting.java
===================================================================
--- branches/community/Seam_2_2/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/Commenting.java 2010-08-10 20:43:37 UTC (rev 13595)
+++ branches/community/Seam_2_2/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/Commenting.java 2010-08-11 07:53:38 UTC (rev 13596)
@@ -11,11 +11,13 @@
import org.jboss.seam.wiki.core.action.CommentHome;
import org.jboss.seam.wiki.core.action.CommentQuery;
import org.jboss.seam.wiki.core.dao.WikiNodeDAO;
-import org.jboss.seam.wiki.core.model.User;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
public class Commenting extends DBUnitSeamTest {
+
+ public static final String MEMBER_USERNAME = "member";
+ public static final String MEMBER_PASSWORD = "member";
protected void prepareDBUnitOperations() {
beforeTestOperations.add(
@@ -26,6 +28,8 @@
@Test
public void postComment() throws Exception {
+ loginMember();
+
new FacesRequest("/docDisplay_d.xhtml") {
protected void beforeRequest() {
@@ -60,7 +64,7 @@
assert commentQuery.getComments().get(4).getId().equals(14l);
assert commentQuery.getComments().get(5).getId().equals(15l);
- assert commentQuery.getComments().get(6).getCreatedBy().getUsername().equals(User.GUEST_USERNAME);
+ assert commentQuery.getComments().get(6).getCreatedBy().getUsername().equals(MEMBER_USERNAME);
assert commentQuery.getComments().get(6).getFromUserName().equals("Foo");
assert commentQuery.getComments().get(6).getFromUserHomepage().equals("http://foo.bar");
assert commentQuery.getComments().get(6).getFromUserEmail().equals("foo(a)bar.tld");
@@ -77,6 +81,8 @@
@Test
public void replyToComment() throws Exception {
+ loginMember();
+
new FacesRequest("/docDisplay_d.xhtml") {
protected void beforeRequest() {
@@ -112,7 +118,7 @@
assert commentQuery.getComments().get(4).getId().equals(14l);
assert commentQuery.getComments().get(5).getId().equals(15l);
- assert commentQuery.getComments().get(6).getCreatedBy().getUsername().equals(User.GUEST_USERNAME);
+ assert commentQuery.getComments().get(6).getCreatedBy().getUsername().equals(MEMBER_USERNAME);
assert commentQuery.getComments().get(6).getFromUserName().equals("Foo");
assert commentQuery.getComments().get(6).getFromUserHomepage().equals("http://foo.bar");
assert commentQuery.getComments().get(6).getFromUserEmail().equals("foo(a)bar.tld");
@@ -207,8 +213,8 @@
private void loginMember() throws Exception {
new FacesRequest() {
protected void invokeApplication() throws Exception {
- setValue("#{identity.username}", "member");
- setValue("#{identity.password}", "member");
+ setValue("#{identity.username}", MEMBER_USERNAME);
+ setValue("#{identity.password}", MEMBER_PASSWORD);
invokeAction("#{identity.login}");
assert getValue("#{identity.loggedIn}").equals(true);
}
13 years, 9 months
Seam SVN: r13595 - sandbox/encore/plugin-api.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-08-10 16:43:37 -0400 (Tue, 10 Aug 2010)
New Revision: 13595
Modified:
sandbox/encore/plugin-api/
Log:
svn ignores
Property changes on: sandbox/encore/plugin-api
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.classpath
.project
13 years, 9 months
Seam SVN: r13594 - in sandbox/encore: core/src/main/java/org/jboss/encore/grammar/java and 22 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-08-10 15:33:32 -0400 (Tue, 10 Aug 2010)
New Revision: 13594
Added:
sandbox/encore/model/src/main/java/org/jboss/encore/model/events/FileModified.java
sandbox/encore/model/src/main/java/org/jboss/encore/model/project/
sandbox/encore/model/src/main/java/org/jboss/encore/model/project/AbstractProject.java
sandbox/encore/model/src/main/java/org/jboss/encore/model/project/MavenProject.java
sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenProjectTest.java
sandbox/encore/plugin-api/
sandbox/encore/plugin-api/pom.xml
sandbox/encore/plugin-api/src/
sandbox/encore/plugin-api/src/main/
sandbox/encore/plugin-api/src/main/java/
sandbox/encore/plugin-api/src/main/java/org/
sandbox/encore/plugin-api/src/main/java/org/jboss/
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/AcceptUserInput.java
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/Shutdown.java
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/Startup.java
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Command.java
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Default.java
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Help.java
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Option.java
sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Plugin.java
sandbox/encore/plugin-api/src/main/resources/
sandbox/encore/plugin-api/src/test/
sandbox/encore/plugin-api/src/test/java/
sandbox/encore/plugin-api/src/test/resources/
Removed:
sandbox/encore/model/src/main/java/org/jboss/encore/model/AbstractProject.java
sandbox/encore/model/src/main/java/org/jboss/encore/model/MavenJavaProject.java
sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenJavaProjectTest.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/events/
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/plugins/
Modified:
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Annotation.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/AnnotationTarget.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Field.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Import.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaClass.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Method.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationImpl.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/FieldImpl.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/ImportImpl.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/MethodImpl.java
sandbox/encore/model/pom.xml
sandbox/encore/pom.xml
sandbox/encore/shell/pom.xml
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Main.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Shell.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/CommandLibraryExtension.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/Execution.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/PluginMetadata.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ClearPlugin.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/Echo.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ExitShell.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/HelpPlugin.java
sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/PwdPlugin.java
Log:
Began Maven POM Project Model API. Began separating plugin-api from shell.
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Annotation.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Annotation.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Annotation.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -31,7 +31,7 @@
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
*/
-public interface Annotation extends Internal, Mutable
+public interface Annotation extends Internal, Mutable<JavaClass>
{
boolean isSingleValue();
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/AnnotationTarget.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/AnnotationTarget.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/AnnotationTarget.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -31,7 +31,7 @@
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
*/
-public interface AnnotationTarget<T> extends Internal, Mutable<T>
+public interface AnnotationTarget<T> extends Internal, Mutable<JavaClass>
{
public abstract Annotation addAnnotation();
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Field.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Field.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Field.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -22,14 +22,12 @@
package org.jboss.encore.grammar.java;
-import org.jboss.encore.grammar.Internal;
-import org.jboss.encore.grammar.Mutable;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
*/
-public interface Field extends Mutable<Field>, Internal, VisibilityScoped<Field>, AnnotationTarget<Field>
+public interface Field extends VisibilityScoped<Field>, AnnotationTarget<Field>
{
String getName();
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Import.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Import.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Import.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -29,7 +29,7 @@
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
*/
-public interface Import extends Internal, Mutable
+public interface Import extends Internal, Mutable<JavaClass>
{
public String getName();
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaClass.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaClass.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaClass.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -24,14 +24,11 @@
import java.util.List;
-import org.jboss.encore.grammar.Internal;
-import org.jboss.encore.grammar.Mutable;
-
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
*/
-public interface JavaClass extends Internal, Mutable<JavaClass>, Abstractable<JavaClass>, VisibilityScoped<JavaClass>, AnnotationTarget<JavaClass>
+public interface JavaClass extends Abstractable<JavaClass>, VisibilityScoped<JavaClass>, AnnotationTarget<JavaClass>
{
/*
* Annotation modifiers
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Method.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Method.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Method.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -22,14 +22,12 @@
package org.jboss.encore.grammar.java;
-import org.jboss.encore.grammar.Internal;
-import org.jboss.encore.grammar.Mutable;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
*/
-public interface Method extends Internal, Mutable<Method>, Abstractable<Method>, VisibilityScoped<Method>, AnnotationTarget<Method>
+public interface Method extends Abstractable<Method>, VisibilityScoped<Method>, AnnotationTarget<Method>
{
public String getBody();
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationImpl.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationImpl.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -32,7 +32,6 @@
import org.eclipse.jdt.core.dom.MemberValuePair;
import org.eclipse.jdt.core.dom.NormalAnnotation;
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.jboss.encore.grammar.Mutable;
import org.jboss.encore.grammar.java.Annotation;
import org.jboss.encore.grammar.java.AnnotationTarget;
import org.jboss.encore.grammar.java.JavaClass;
@@ -329,13 +328,9 @@
}
@Override
- public Annotation applyChanges()
+ public JavaClass applyChanges()
{
- if (parent instanceof Mutable)
- {
- ((Mutable) parent).applyChanges();
- }
- return this;
+ return parent.applyChanges();
}
@Override
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/FieldImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/FieldImpl.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/FieldImpl.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -84,10 +84,9 @@
}
@Override
- public Field applyChanges()
+ public JavaClass applyChanges()
{
- parent.applyChanges();
- return this;
+ return parent.applyChanges();
}
@Override
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/ImportImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/ImportImpl.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/ImportImpl.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -86,10 +86,9 @@
}
@Override
- public Import applyChanges()
+ public JavaClass applyChanges()
{
- parent.applyChanges();
- return this;
+ return parent.applyChanges();
}
@Override
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/MethodImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/MethodImpl.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/MethodImpl.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -328,10 +328,9 @@
}
@Override
- public Method applyChanges()
+ public JavaClass applyChanges()
{
- parent.applyChanges();
- return this;
+ return parent.applyChanges();
}
@Override
Modified: sandbox/encore/model/pom.xml
===================================================================
--- sandbox/encore/model/pom.xml 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/model/pom.xml 2010-08-10 19:33:32 UTC (rev 13594)
@@ -17,22 +17,43 @@
<description>Simplified project bootstrapping and incremental enhancement framework</description>
<dependencies>
- <!-- Resource manipulation dependencies -->
<dependency>
- <groupId>org.jboss.encore</groupId>
- <artifactId>encore-core</artifactId>
- <version>${project.version}</version>
+ <groupId>org.jboss.encore</groupId>
+ <artifactId>encore-core</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
- <version>1.0.0-alpha-9</version>
+ <version>1.0.0-alpha-11</version>
</dependency>
+ <!--
<dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <version>1.0.0-alpha-11</version>
+ <scope>test</scope> Don't rely upon internals for compilation
+ </dependency>
+ -->
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-descriptors</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <!-- Requires checkout & Manual 'mvn install': http://github.com/shrinkwrap/descriptors -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ <version>3.0-beta-1</version>
+ </dependency>
+ <dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.0</version>
</dependency>
+
+
</dependencies>
</project>
Deleted: sandbox/encore/model/src/main/java/org/jboss/encore/model/AbstractProject.java
===================================================================
--- sandbox/encore/model/src/main/java/org/jboss/encore/model/AbstractProject.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/model/src/main/java/org/jboss/encore/model/AbstractProject.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.encore.model;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import javax.enterprise.event.Event;
-import javax.inject.Inject;
-
-import org.jboss.encore.grammar.java.JavaClass;
-import org.jboss.encore.model.events.JavaFileCreated;
-
-/**
- * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
- *
- */
-public abstract class AbstractProject implements Project
-{
- @Inject
- Event<JavaFileCreated> event;
-
- private File createJavaFile(File sourceFolder, final String classPackage, final String className, final char[] data)
- {
- BufferedWriter writer = null;
- try
- {
- String pkg = getDefaultSourceFolder() + File.separator + classPackage.replaceAll("\\.", File.separator);
-
- File file = new File(pkg + File.separator + className + ".java");
-
- if (!file.mkdirs())
- {
- throw new IOException("Failed to create required directory structure for file: " + file);
- }
-
- file.delete();
-
- if (!file.createNewFile())
- {
- throw new IOException("Failed to create file because it already exists: " + file);
- }
-
- writer = new BufferedWriter(new FileWriter(file));
- writer.write(data);
- writer.close();
-
- // event.fire(new JavaFileCreated(file));
- return file;
- }
- catch (IOException e)
- {
- throw new ProjectModelException(e);
- }
- }
-
- private File createJavaFile(final String classPackage, final String className, String data)
- {
- return createJavaFile(getDefaultSourceFolder(), classPackage, className, data.toCharArray());
- }
-
- @Override
- public File createJavaFile(JavaClass clazz)
- {
- return createJavaFile(clazz.getPackage(), clazz.getName(), clazz.toString());
- }
-
- @Override
- public boolean delete(File file)
- {
- if (file.isDirectory())
- {
- for (File c : file.listFiles())
- {
- if (!delete(c))
- {
- throw new ProjectModelException("Could not delete file or folder: " + file);
- }
- }
- }
- return file.delete();
- }
-
-}
Deleted: sandbox/encore/model/src/main/java/org/jboss/encore/model/MavenJavaProject.java
===================================================================
--- sandbox/encore/model/src/main/java/org/jboss/encore/model/MavenJavaProject.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/model/src/main/java/org/jboss/encore/model/MavenJavaProject.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.encore.model;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
- *
- */
-public class MavenJavaProject extends AbstractProject
-{
- private File projectRoot = null;
-
- public MavenJavaProject(File directory)
- {
- if (!directory.isDirectory())
- {
- throw new ProjectModelException("Cannot load project from directory that does not exist.");
- }
- projectRoot = directory;
- }
-
- @Override
- public List<File> getSourceFolders()
- {
- List<File> result = new ArrayList<File>();
- result.add(getDefaultSourceFolder());
- result.add(new File(getProjectRoot().getAbsolutePath() + "/src/test/java"));
- return result;
- }
-
- @Override
- public File getDefaultSourceFolder()
- {
- return new File(getProjectRoot().getAbsolutePath() + "/src/main/java");
- }
-
- @Override
- public File getProjectRoot()
- {
- return projectRoot;
- }
-
-}
Added: sandbox/encore/model/src/main/java/org/jboss/encore/model/events/FileModified.java
===================================================================
--- sandbox/encore/model/src/main/java/org/jboss/encore/model/events/FileModified.java (rev 0)
+++ sandbox/encore/model/src/main/java/org/jboss/encore/model/events/FileModified.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.model.events;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class FileModified extends FileEvent
+{
+ public FileModified(final File file)
+ {
+ super(file);
+ }
+
+}
Copied: sandbox/encore/model/src/main/java/org/jboss/encore/model/project/AbstractProject.java (from rev 13585, sandbox/encore/model/src/main/java/org/jboss/encore/model/AbstractProject.java)
===================================================================
--- sandbox/encore/model/src/main/java/org/jboss/encore/model/project/AbstractProject.java (rev 0)
+++ sandbox/encore/model/src/main/java/org/jboss/encore/model/project/AbstractProject.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.model.project;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+
+import org.jboss.encore.grammar.java.JavaClass;
+import org.jboss.encore.model.Project;
+import org.jboss.encore.model.ProjectModelException;
+import org.jboss.encore.model.events.JavaFileCreated;
+
+/**
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public abstract class AbstractProject implements Project
+{
+ @Inject
+ Event<JavaFileCreated> event;
+
+ private File createJavaFile(File sourceFolder, final String classPackage, final String className, final char[] data)
+ {
+ BufferedWriter writer = null;
+ try
+ {
+ String pkg = getDefaultSourceFolder() + File.separator + classPackage.replaceAll("\\.", File.separator);
+
+ File file = new File(pkg + File.separator + className + ".java");
+
+ if (!file.mkdirs())
+ {
+ throw new IOException("Failed to create required directory structure for file: " + file);
+ }
+
+ file.delete();
+
+ if (!file.createNewFile())
+ {
+ throw new IOException("Failed to create file because it already exists: " + file);
+ }
+
+ writer = new BufferedWriter(new FileWriter(file));
+ writer.write(data);
+ writer.close();
+
+ // event.fire(new JavaFileCreated(file));
+ return file;
+ }
+ catch (IOException e)
+ {
+ throw new ProjectModelException(e);
+ }
+ }
+
+ private File createJavaFile(final String classPackage, final String className, String data)
+ {
+ return createJavaFile(getDefaultSourceFolder(), classPackage, className, data.toCharArray());
+ }
+
+ @Override
+ public File createJavaFile(JavaClass clazz)
+ {
+ return createJavaFile(clazz.getPackage(), clazz.getName(), clazz.toString());
+ }
+
+ @Override
+ public boolean delete(File file)
+ {
+ if (file.isDirectory())
+ {
+ for (File c : file.listFiles())
+ {
+ if (!delete(c))
+ {
+ throw new ProjectModelException("Could not delete file or folder: " + file);
+ }
+ }
+ }
+ return file.delete();
+ }
+
+}
Copied: sandbox/encore/model/src/main/java/org/jboss/encore/model/project/MavenProject.java (from rev 13585, sandbox/encore/model/src/main/java/org/jboss/encore/model/MavenJavaProject.java)
===================================================================
--- sandbox/encore/model/src/main/java/org/jboss/encore/model/project/MavenProject.java (rev 0)
+++ sandbox/encore/model/src/main/java/org/jboss/encore/model/project/MavenProject.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.model.project;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.jboss.encore.model.ProjectModelException;
+
+/**
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class MavenProject extends AbstractProject
+{
+ private File projectRoot = null;
+
+ public MavenProject(File directory)
+ {
+ if (!directory.isDirectory())
+ {
+ throw new ProjectModelException("Cannot load project from directory that does not exist.");
+ }
+ projectRoot = directory;
+ }
+
+ @Override
+ public List<File> getSourceFolders()
+ {
+ List<File> result = new ArrayList<File>();
+ result.add(getDefaultSourceFolder());
+ result.add(new File(getProjectRoot().getAbsolutePath() + "/src/test/java"));
+ return result;
+ }
+
+ @Override
+ public File getDefaultSourceFolder()
+ {
+ return new File(getProjectRoot().getAbsolutePath() + "/src/main/java");
+ }
+
+ @Override
+ public File getProjectRoot()
+ {
+ return projectRoot;
+ }
+
+ public Model getPOM()
+ {
+ try
+ {
+ Model result = new Model();
+ result.setPomFile(getPOMFile());
+
+ MavenXpp3Reader reader = new MavenXpp3Reader();
+ FileInputStream stream = new FileInputStream(getPOMFile());
+ if (stream.available() > 0)
+ {
+ result = reader.read(stream);
+ }
+ stream.close();
+
+ return result;
+ }
+ catch (IOException e)
+ {
+ throw new ProjectModelException("Could not open POM file: " + getPOMFile(), e);
+ }
+ catch (XmlPullParserException e)
+ {
+ throw new ProjectModelException("Could not parse POM file: " + getPOMFile(), e);
+ }
+ }
+
+ public void setPOM(Model pom)
+ {
+ try
+ {
+ MavenXpp3Writer writer = new MavenXpp3Writer();
+ FileWriter fw = new FileWriter(getPOMFile());
+ writer.write(fw, pom);
+ fw.close();
+ }
+ catch (IOException e)
+ {
+ throw new ProjectModelException("Could not write POM file: " + getPOMFile(), e);
+ }
+ }
+
+ private File getPOMFile()
+ {
+ File file = new File(getProjectRoot() + "/pom.xml");
+ if (!file.exists())
+ {
+ try
+ {
+ if (!file.createNewFile())
+ {
+ throw new ProjectModelException("Could not create POM file because it already exists: " + file);
+ }
+ }
+ catch (IOException e)
+ {
+ throw new ProjectModelException("Could not create POM file: " + file, e);
+ }
+ }
+ return file;
+ }
+}
Deleted: sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenJavaProjectTest.java
===================================================================
--- sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenJavaProjectTest.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenJavaProjectTest.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.encore.model.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.jboss.encore.grammar.java.JavaClass;
-import org.jboss.encore.grammar.java.JavaParser;
-import org.jboss.encore.model.MavenJavaProject;
-import org.jboss.encore.model.Project;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
- *
- */
-public class MavenJavaProjectTest
-{
- private static final String PKG = MavenJavaProjectTest.class.getSimpleName().toLowerCase();
- private static File tempFolder;
- private static Project project;
-
- @BeforeClass
- public static void before() throws IOException
- {
- tempFolder = File.createTempFile(PKG, null);
- tempFolder.delete();
- tempFolder.mkdirs();
- project = new MavenJavaProject(tempFolder);
- }
-
- @AfterClass
- public static void after()
- {
- if (tempFolder.exists())
- {
- assertTrue(project.delete(tempFolder));
- }
- }
-
- @Test
- public void testGetDefaultSourceDir() throws Exception
- {
- assertEquals(new File(project.getProjectRoot() + "/src/main/java/"), project.getDefaultSourceFolder());
- }
-
- @Test
- public void testCreateJavaFile() throws Exception
- {
- String name = "JustCreated";
- JavaClass clazz = JavaParser.createClass().setName(name).setPackage(PKG);
- clazz.applyChanges();
- File file = project.createJavaFile(clazz);
- assertEquals(name + ".java", file.getName());
-
- JavaClass result = JavaParser.parse(file);
- assertEquals(name, result.getName());
- assertEquals(PKG, result.getPackage());
- assertTrue(project.delete(file));
- assertEquals(clazz, result);
- }
-}
Copied: sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenProjectTest.java (from rev 13585, sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenJavaProjectTest.java)
===================================================================
--- sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenProjectTest.java (rev 0)
+++ sandbox/encore/model/src/test/java/org/jboss/encore/model/test/MavenProjectTest.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.encore.model.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.jboss.encore.grammar.java.JavaClass;
+import org.jboss.encore.grammar.java.JavaParser;
+import org.jboss.encore.model.project.MavenProject;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class MavenProjectTest
+{
+ private static final String PKG = MavenProjectTest.class.getSimpleName().toLowerCase();
+ private static File tempFolder;
+ private static MavenProject project;
+
+ @BeforeClass
+ public static void before() throws IOException
+ {
+ tempFolder = File.createTempFile(PKG, null);
+ tempFolder.delete();
+ tempFolder.mkdirs();
+ project = new MavenProject(tempFolder);
+ }
+
+ @AfterClass
+ public static void after()
+ {
+ if (tempFolder.exists())
+ {
+ assertTrue(project.delete(tempFolder));
+ }
+ }
+
+ @Test
+ public void testGetDefaultSourceDir() throws Exception
+ {
+ assertEquals(new File(project.getProjectRoot() + "/src/main/java/"), project.getDefaultSourceFolder());
+ }
+
+ @Test
+ public void testCreateJavaFile() throws Exception
+ {
+ String name = "JustCreated";
+ JavaClass clazz = JavaParser.createClass().setName(name).setPackage(PKG);
+ clazz.applyChanges();
+ File file = project.createJavaFile(clazz);
+ assertEquals(name + ".java", file.getName());
+
+ JavaClass result = JavaParser.parse(file);
+ assertEquals(name, result.getName());
+ assertEquals(PKG, result.getPackage());
+ assertTrue(project.delete(file));
+ assertEquals(clazz, result);
+ }
+
+ @Test
+ public void testCreatePOM() throws Exception
+ {
+ Model pom = project.getPOM();
+ pom.setGroupId("org.jboss.seam");
+ pom.setArtifactId("seam-scaffolding");
+ pom.setVersion("X-SNAPSHOT");
+ project.setPOM(pom);
+ File file = pom.getPomFile();
+ assertTrue(file.exists());
+
+ MavenXpp3Reader reader = new MavenXpp3Reader();
+ Model result = reader.read(new FileInputStream(file));
+ assertEquals(pom.getArtifactId(), result.getArtifactId());
+ }
+}
Added: sandbox/encore/plugin-api/pom.xml
===================================================================
--- sandbox/encore/plugin-api/pom.xml (rev 0)
+++ sandbox/encore/plugin-api/pom.xml 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,27 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>encore</artifactId>
+ <groupId>org.jboss.encore</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.jboss.encore</groupId>
+ <artifactId>encore-plugin-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>Encore Shell Plugin API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-se</artifactId>
+ <version>1.0.1-Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-extensions</artifactId>
+ <version>1.0.0.Alpha2</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/AcceptUserInput.java
===================================================================
--- sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/AcceptUserInput.java (rev 0)
+++ sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/AcceptUserInput.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.api.events;
+
+/**
+ * Informs the Shell that it should begin accepting User Input
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class AcceptUserInput
+{
+
+}
Added: sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/Shutdown.java
===================================================================
--- sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/Shutdown.java (rev 0)
+++ sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/Shutdown.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.api.events;
+
+/**
+ * The shell shutdown event.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public enum Shutdown
+{
+ NORMAL, ERROR
+}
Added: sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/Startup.java
===================================================================
--- sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/Startup.java (rev 0)
+++ sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/events/Startup.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.api.events;
+
+/**
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class Startup
+{
+
+}
Added: sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Command.java
===================================================================
--- sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Command.java (rev 0)
+++ sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Command.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.api.plugins;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * Represents a single command to be run on a Shell.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+@Qualifier
+@Target({ METHOD, PARAMETER, TYPE, FIELD })
+@Retention(RUNTIME)
+@Documented
+public @interface Command
+{
+ /**
+ * One or more names for this command.
+ */
+ String[] value() default {};
+
+ /**
+ * Help text for this command.
+ */
+ String help() default "";
+}
Added: sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Default.java
===================================================================
--- sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Default.java (rev 0)
+++ sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Default.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.api.plugins;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Defines a @{@link Command} as the plugin default. It will be run if no other
+ * command matches the input line.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+@Target({ TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+public @interface Default
+{
+
+}
Added: sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Help.java
===================================================================
--- sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Help.java (rev 0)
+++ sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Help.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.api.plugins;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Describes help text for a plug-in.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+@Target({ TYPE })
+@Retention(RUNTIME)
+@Documented
+public @interface Help
+{
+ /**
+ * The help text.
+ */
+ String value();
+}
Added: sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Option.java
===================================================================
--- sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Option.java (rev 0)
+++ sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Option.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.api.plugins;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * A command option.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+@Qualifier
+@Target({ METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Documented
+public @interface Option
+{
+ /**
+ * The name of this option.
+ */
+ String value() default "";
+
+ /**
+ * Specify whether or not this option is required.
+ */
+ boolean required() default false;
+
+ /**
+ * The default value for this option, if not provided in user input.
+ */
+ String defaultValue() default "";
+
+ /**
+ * Help text for this option.
+ */
+ String help() default "";
+}
Added: sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Plugin.java
===================================================================
--- sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Plugin.java (rev 0)
+++ sandbox/encore/plugin-api/src/main/java/org/jboss/encore/shell/api/plugins/Plugin.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.api.plugins;
+
+
+/**
+ * A custom {@link Plugin} must implement this interface in order to be detected and installed at framework boot-time.
+ * In order to create plugin shell-commands, one must create a method annotated with @{@link Command}. Any command
+ * method parameters to be provided as input through the shell must be individually annotated with the @{@link Option}
+ * annotation; other (non-annotated) command parameters are ignored.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public interface Plugin
+{
+
+}
Modified: sandbox/encore/pom.xml
===================================================================
--- sandbox/encore/pom.xml 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/pom.xml 2010-08-10 19:33:32 UTC (rev 13594)
@@ -15,6 +15,7 @@
<module>core</module>
<module>model</module>
<module>shell</module>
+ <module>plugin-api</module>
</modules>
<properties>
Modified: sandbox/encore/shell/pom.xml
===================================================================
--- sandbox/encore/shell/pom.xml 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/pom.xml 2010-08-10 19:33:32 UTC (rev 13594)
@@ -23,6 +23,12 @@
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
+ <groupId>org.jboss.encore</groupId>
+ <artifactId>encore-plugin-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-se</artifactId>
<version>1.0.1-Final</version>
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Main.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Main.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Main.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -21,8 +21,8 @@
*/
package org.jboss.encore.shell;
-import org.jboss.encore.shell.events.AcceptUserInput;
-import org.jboss.encore.shell.events.Startup;
+import org.jboss.encore.shell.api.events.AcceptUserInput;
+import org.jboss.encore.shell.api.events.Startup;
import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Shell.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Shell.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Shell.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -31,11 +31,11 @@
import jline.console.ConsoleReader;
import jline.console.completer.Completer;
+import org.jboss.encore.shell.api.events.AcceptUserInput;
+import org.jboss.encore.shell.api.events.Shutdown;
+import org.jboss.encore.shell.api.events.Startup;
import org.jboss.encore.shell.cli.Execution;
import org.jboss.encore.shell.cli.ExecutionParser;
-import org.jboss.encore.shell.events.AcceptUserInput;
-import org.jboss.encore.shell.events.Shutdown;
-import org.jboss.encore.shell.events.Startup;
import org.jboss.weld.environment.se.bindings.Parameters;
import org.slf4j.Logger;
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/CommandLibraryExtension.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/CommandLibraryExtension.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/CommandLibraryExtension.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -34,11 +34,11 @@
import javax.enterprise.inject.spi.ProcessBean;
import javax.inject.Named;
-import org.jboss.encore.shell.plugins.Command;
-import org.jboss.encore.shell.plugins.Default;
-import org.jboss.encore.shell.plugins.Help;
-import org.jboss.encore.shell.plugins.Option;
-import org.jboss.encore.shell.plugins.Plugin;
+import org.jboss.encore.shell.api.plugins.Command;
+import org.jboss.encore.shell.api.plugins.Default;
+import org.jboss.encore.shell.api.plugins.Help;
+import org.jboss.encore.shell.api.plugins.Option;
+import org.jboss.encore.shell.api.plugins.Plugin;
import org.jboss.encore.shell.util.Annotations;
/**
@@ -101,7 +101,8 @@
commandMeta.setDefault(true);
}
- // Default commands are invoked via the name of the plug-in, not by plug-in + command
+ // Default commands are invoked via the name of the plug-in, not by
+ // plug-in + command
if (!commandMeta.isDefault())
{
if (command.value().length == 0)
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/Execution.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/Execution.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/Execution.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -28,7 +28,7 @@
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
-import org.jboss.encore.shell.plugins.Plugin;
+import org.jboss.encore.shell.api.plugins.Plugin;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
@@ -57,8 +57,7 @@
Plugin plugin = null;
if (bean != null)
{
- CreationalContext<? extends Plugin> context = (CreationalContext<? extends Plugin>) manager
- .createCreationalContext(bean);
+ CreationalContext<? extends Plugin> context = (CreationalContext<? extends Plugin>) manager.createCreationalContext(bean);
if (context != null)
{
plugin = (Plugin) manager.getReference(bean, pluginType, context);
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/PluginMetadata.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/PluginMetadata.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/PluginMetadata.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -24,7 +24,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.encore.shell.plugins.Plugin;
+import org.jboss.encore.shell.api.plugins.Plugin;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ClearPlugin.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ClearPlugin.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ClearPlugin.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -25,10 +25,10 @@
import javax.inject.Named;
import org.jboss.encore.shell.Shell;
-import org.jboss.encore.shell.plugins.Command;
-import org.jboss.encore.shell.plugins.Default;
-import org.jboss.encore.shell.plugins.Help;
-import org.jboss.encore.shell.plugins.Plugin;
+import org.jboss.encore.shell.api.plugins.Command;
+import org.jboss.encore.shell.api.plugins.Default;
+import org.jboss.encore.shell.api.plugins.Help;
+import org.jboss.encore.shell.api.plugins.Plugin;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/Echo.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/Echo.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/Echo.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -24,11 +24,11 @@
import javax.inject.Inject;
import org.jboss.encore.shell.Shell;
-import org.jboss.encore.shell.plugins.Command;
-import org.jboss.encore.shell.plugins.Default;
-import org.jboss.encore.shell.plugins.Help;
-import org.jboss.encore.shell.plugins.Option;
-import org.jboss.encore.shell.plugins.Plugin;
+import org.jboss.encore.shell.api.plugins.Command;
+import org.jboss.encore.shell.api.plugins.Default;
+import org.jboss.encore.shell.api.plugins.Help;
+import org.jboss.encore.shell.api.plugins.Option;
+import org.jboss.encore.shell.api.plugins.Plugin;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ExitShell.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ExitShell.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ExitShell.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -25,14 +25,15 @@
import javax.inject.Inject;
import javax.inject.Named;
-import org.jboss.encore.shell.events.Shutdown;
-import org.jboss.encore.shell.plugins.Command;
-import org.jboss.encore.shell.plugins.Default;
-import org.jboss.encore.shell.plugins.Help;
-import org.jboss.encore.shell.plugins.Plugin;
+import org.jboss.encore.shell.api.events.Shutdown;
+import org.jboss.encore.shell.api.plugins.Command;
+import org.jboss.encore.shell.api.plugins.Default;
+import org.jboss.encore.shell.api.plugins.Help;
+import org.jboss.encore.shell.api.plugins.Plugin;
/**
- * Implements a {@link Plugin} that fires the shell {@link Shutdown#NORMAL} event.
+ * Implements a {@link Plugin} that fires the shell {@link Shutdown#NORMAL}
+ * event.
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/HelpPlugin.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/HelpPlugin.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/HelpPlugin.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -25,12 +25,12 @@
import javax.inject.Named;
import org.jboss.encore.shell.Shell;
+import org.jboss.encore.shell.api.plugins.Command;
+import org.jboss.encore.shell.api.plugins.Default;
+import org.jboss.encore.shell.api.plugins.Help;
+import org.jboss.encore.shell.api.plugins.Option;
+import org.jboss.encore.shell.api.plugins.Plugin;
import org.jboss.encore.shell.cli.PluginRegistry;
-import org.jboss.encore.shell.plugins.Command;
-import org.jboss.encore.shell.plugins.Default;
-import org.jboss.encore.shell.plugins.Help;
-import org.jboss.encore.shell.plugins.Option;
-import org.jboss.encore.shell.plugins.Plugin;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
Modified: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/PwdPlugin.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/PwdPlugin.java 2010-08-10 14:52:18 UTC (rev 13593)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/PwdPlugin.java 2010-08-10 19:33:32 UTC (rev 13594)
@@ -27,10 +27,10 @@
import javax.inject.Named;
import org.jboss.encore.shell.Shell;
-import org.jboss.encore.shell.plugins.Command;
-import org.jboss.encore.shell.plugins.Default;
-import org.jboss.encore.shell.plugins.Help;
-import org.jboss.encore.shell.plugins.Plugin;
+import org.jboss.encore.shell.api.plugins.Command;
+import org.jboss.encore.shell.api.plugins.Default;
+import org.jboss.encore.shell.api.plugins.Help;
+import org.jboss.encore.shell.api.plugins.Plugin;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
13 years, 9 months
Seam SVN: r13593 - branches/enterprise/JBPAPP_4_2_CP01/src/main/org/jboss/seam/core.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-08-10 10:52:18 -0400 (Tue, 10 Aug 2010)
New Revision: 13593
Modified:
branches/enterprise/JBPAPP_4_2_CP01/src/main/org/jboss/seam/core/Pages.java
Log:
JBPAPP-4803
Modified: branches/enterprise/JBPAPP_4_2_CP01/src/main/org/jboss/seam/core/Pages.java
===================================================================
--- branches/enterprise/JBPAPP_4_2_CP01/src/main/org/jboss/seam/core/Pages.java 2010-08-10 14:36:12 UTC (rev 13592)
+++ branches/enterprise/JBPAPP_4_2_CP01/src/main/org/jboss/seam/core/Pages.java 2010-08-10 14:52:18 UTC (rev 13593)
@@ -5,6 +5,7 @@
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -480,14 +481,24 @@
boolean result = false;
- String outcome = (String) facesContext.getExternalContext()
+ String outcome = facesContext.getExternalContext()
.getRequestParameterMap()
.get("actionOutcome");
String fromAction = outcome;
+ String decodedOutcome = null;
+ if (outcome != null)
+ {
+ decodedOutcome = URLDecoder.decode(outcome);
+ }
+
+ if (decodedOutcome != null && (decodedOutcome.indexOf('#') >= 0 || decodedOutcome.indexOf('{') >= 0) ){
+ throw new IllegalArgumentException("EL expressions are not allowed in actionOutcome parameter");
+ }
+
if (outcome==null)
{
- String actionId = (String) facesContext.getExternalContext()
+ String actionId = facesContext.getExternalContext()
.getRequestParameterMap()
.get("actionMethod");
if (actionId!=null)
13 years, 9 months
Seam SVN: r13592 - branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-08-10 10:36:12 -0400 (Tue, 10 Aug 2010)
New Revision: 13592
Modified:
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/ConversationTest.java
Log:
conversationTest for icefaces fixed
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/ConversationTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/ConversationTest.java 2010-08-10 13:54:57 UTC (rev 13591)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/ConversationTest.java 2010-08-10 14:36:12 UTC (rev 13592)
@@ -43,7 +43,7 @@
*/
public class ConversationTest extends AjaxWebDriverTest
{
- public int timeout = 16000;
+ public int timeout = 5000;
private final String DEFAULT_USERNAME = "demo";
private final String DEFAULT_PASSWORD = "demo";
@@ -106,22 +106,25 @@
}
enterSearchQueryUsingAJAX(driver, HOTEL1);
+ pause(timeout);
driver.findElement(SEARCH_RESULT_TABLE_FIRST_ROW_LINK).clickAndWait();
driver.findElement(BOOKING_BOOK).click();
driver.switchTo().window(windows.get(W2));
driver.navigate().refresh();
-
+ pause(timeout);
+
if (!isLoggedIn(driver))
{
login(driver);
}
-
+ pause(timeout);
enterSearchQueryUsingAJAX(driver, HOTEL2);
driver.findElement(SEARCH_RESULT_TABLE_FIRST_ROW_LINK).clickAndWait();
driver.switchTo().window(windows.get(W1));
driver.navigate().refresh();
+ pause(timeout);
assertEquals("#1 workspace not present in workspace table", WORKSPACE_BOOKING_TEXT_HOTEL1, driver.findElement(WORKSPACE_LINK_0).getText());
assertEquals("#2 workspace not present in workspace table", WORKSPACE_VIEW_TEXT_HOTEL2, driver.findElement(WORKSPACE_LINK_1).getText());
@@ -171,7 +174,7 @@
fail("User already logged in.");
}*/
driver.get(serverURL + contextPath + HOME_PAGE);
-
+ pause(timeout);
if (!driver.getTitle().equals(PAGE_TITLE))
{
return false;
@@ -179,6 +182,7 @@
driver.findElement(LOGIN_USERNAME_FIELD).sendKeys(username);
driver.findElement(LOGIN_PASSWORD_FIELD).sendKeys(password);
driver.findElement(LOGIN_SUBMIT).clickAndWait();
+ pause(timeout);
return isLoggedIn(driver);
}
@@ -200,4 +204,16 @@
driver.close();
}
}
+
+ private void pause(int millis)
+ {
+ try
+ {
+ Thread.sleep(millis);
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ }
}
13 years, 9 months