[webbeans-commits] Webbeans SVN: r3522 - in ri/trunk: spi and 10 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sun Aug 16 11:31:10 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-08-16 11:31:10 -0400 (Sun, 16 Aug 2009)
New Revision: 3522

Added:
   ri/trunk/spi/src/main/java/org/jboss/webbeans/security/
   ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/
   ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/
   ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/
   ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java
   ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java
   ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java
Modified:
   ri/trunk/jboss-as/build.properties
   ri/trunk/jboss-as/build.xml
   ri/trunk/spi/pom.xml
   ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/transaction/spi/TransactionServices.java
   ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
   ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java
   ri/trunk/version-matrix/pom.xml
Log:
add SPI for UT, BV and Principal

Modified: ri/trunk/jboss-as/build.properties
===================================================================
--- ri/trunk/jboss-as/build.properties	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/jboss-as/build.properties	2009-08-16 15:31:10 UTC (rev 3522)
@@ -11,3 +11,4 @@
 webbeans.version=1.0.0-SNAPSHOT
 jboss-ejb3.version=1.0.0
 javassist.version=3.11.0.GA
+validation.version=1.0.CR3

Modified: ri/trunk/jboss-as/build.xml
===================================================================
--- ri/trunk/jboss-as/build.xml	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/jboss-as/build.xml	2009-08-16 15:31:10 UTC (rev 3522)
@@ -13,7 +13,7 @@
 		<delete dir="target" failonerror="false" />
 	</target>
 
-	<target name="update" depends="install-webbeans.deployer, install-javassist-update" description="Update JBoss 5.x or 6.x for Web Beans" />
+	<target name="update" depends="install-webbeans.deployer, install-javassist-update, install-validation-update" description="Update JBoss 5.x or 6.x for Web Beans" />
 
 	<target name="install-webbeans.deployer">
 		<echo message="Installing Web Beans ${webbeans.version} to ${jboss.home}" />
@@ -85,6 +85,32 @@
 			</fileset>
 		</copy>
 	</target>
+	
+   <target name="install-validation-update">
+      <echo message="Upgrading Bean Validation API to ${validation.version} for ${jboss.home}" />
+      <fail unless="jboss.home" message="Please pass in -Djboss.home=..." />
+   
+      <artifact:dependencies filesetId="validation.fileset" versionsId="validation.versions">
+         <dependency groupId="javax.validation" artifactId="validation-api" version="${validation.version}" />
+         <remoteRepository id="repository.jboss.org" url="http://repository.jboss.org/maven2" />
+         <remoteRepository id="snapshots.jboss.org" url="http://snapshots.jboss.org/maven2" />
+      </artifact:dependencies>
+   
+      <mkdir dir="target/dependency/lib" />
+      <copy todir="target/dependency/lib">
+         <fileset refid="validation.fileset" />
+         <chainedmapper>
+            <flattenmapper />
+            <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" from="${validation.versions}" to="flatten" />
+         </chainedmapper>
+      </copy>
+   
+      <copy todir="${jboss.home}/common/lib">
+         <fileset dir="target/dependency/lib">
+            <include name="validation-api.jar" />
+         </fileset>
+      </copy>
+   </target>
 
 	<target name="install-jboss-ejb3-update">
 

Modified: ri/trunk/spi/pom.xml
===================================================================
--- ri/trunk/spi/pom.xml	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/pom.xml	2009-08-16 15:31:10 UTC (rev 3522)
@@ -57,6 +57,11 @@
       	<groupId>javax.jms</groupId>
       	<artifactId>jms</artifactId>
     	</dependency>
+      
+      <dependency>
+         <groupId>javax.validation</groupId>
+         <artifactId>validation-api</artifactId>
+      </dependency>
 
    </dependencies>
 

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -25,10 +25,12 @@
 import org.jboss.webbeans.persistence.spi.JpaServices;
 import org.jboss.webbeans.resources.spi.ResourceLoader;
 import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.security.spi.SecurityServices;
 import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.validation.spi.ValidationServices;
 
 /**
- * Various well known environments.
+ * Requirements for various well known environments.
  * 
  * @author Pete Muir
  *
@@ -39,12 +41,12 @@
    /**
     * Java EE5 or Java EE6
     */
-   EE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class),
+   EE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class, SecurityServices.class, ValidationServices.class),
    
    /**
     * Java EE6 Web Profile
     */
-   EE_WEB_PROFILE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class),
+   EE_WEB_PROFILE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class, SecurityServices.class, ValidationServices.class),
    
    /**
     * Servlet container such as Tomcat

Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java	                        (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.security.spi;
+
+import java.security.Principal;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * Responsible for accessing security related functionality the environment can 
+ * provide.
+ * 
+ * Required in a Java EE environment.
+ * 
+ * @author pmuir
+ *
+ */
+public interface SecurityServices extends Service
+{
+   
+   /**
+    * Obtain the Principal representing the current caller identity
+    * 
+    * @return the Principal representing the current caller identity
+    */
+   public Principal getPrincipal();
+
+}


Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/transaction/spi/TransactionServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/transaction/spi/TransactionServices.java	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/transaction/spi/TransactionServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -1,6 +1,7 @@
 package org.jboss.webbeans.transaction.spi;
 
 import javax.transaction.Synchronization;
+import javax.transaction.UserTransaction;
 
 import org.jboss.webbeans.bootstrap.api.Service;
 
@@ -11,13 +12,15 @@
  * </p>
  * 
  * <p>
- * The event framework specified by JSR-299 includes the ability to create
- * observer methods which are activated based on the phase and status of a
- * currently active transaction. In order to use these abilities, the container
- * must provide these intermediary services which in turn may interact with an
+ * The event framework specified by CDI includes the ability to create observer 
+ * methods which are activated based on the phase and status of a currently 
+ * active transaction. In order to use these abilities, the container must 
+ * provide these intermediary services which in turn may interact with an 
  * application server and JTA.
  * </p>
  * 
+ * <p>Required in a Java EE environment</p>
+ * 
  * @author David Allen
  * 
  */
@@ -39,4 +42,11 @@
     * @return true if a transaction is active
     */
    public boolean isTransactionActive();
+   
+   /**
+    * Obtain a reference to the JTA UserTransaction
+    * 
+    * @return a reference to the JTA UserTransaction
+    */
+   public UserTransaction getUserTransaction();
 }

Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java	                        (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.validation.spi;
+
+import javax.validation.ValidatorFactory;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * <p>
+ * Responsible for accessing Bean Validation functionality the environment may
+ * provide.
+ * </p>
+ * 
+ * <p>
+ * Required in a Java EE environment.
+ * </p>
+ * 
+ * @author pmuir
+ *
+ */
+public interface ValidationServices extends Service
+{
+
+   /**
+    * Obtain a reference to the default ValidatorFactory
+    * @return
+    */
+   public ValidatorFactory getDefaultValidatorFactory();
+   
+}


Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -8,7 +8,9 @@
 import org.jboss.webbeans.persistence.spi.JpaServices;
 import org.jboss.webbeans.resources.spi.ResourceLoader;
 import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.security.spi.SecurityServices;
 import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.validation.spi.ValidationServices;
 import org.testng.annotations.Test;
 
 public class BootstrapTest
@@ -35,6 +37,8 @@
       bootstrap.getServices().add(Deployment.class, new MockDeployment());
       bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
       bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+      bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+      bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
       bootstrap.startContainer();
    }
    
@@ -49,9 +53,43 @@
       bootstrap.getServices().add(Deployment.class, new MockDeployment());
       bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
       bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+      bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+      bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
       bootstrap.startContainer();
    }
    
+   @Test(expectedExceptions=IllegalStateException.class)
+   public void testMissingSecurityServices()
+   {
+      AbstractBootstrap bootstrap = new MockBootstrap();
+      bootstrap.setEnvironment(Environments.EE);
+      bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+      bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+      bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+      bootstrap.getServices().add(Deployment.class, new MockDeployment());
+      bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+      bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+      bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+      bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
+      bootstrap.startContainer();
+   }
+   
+   @Test(expectedExceptions=IllegalStateException.class)
+   public void testMissingValidationServices()
+   {
+      AbstractBootstrap bootstrap = new MockBootstrap();
+      bootstrap.setEnvironment(Environments.EE);
+      bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+      bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+      bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+      bootstrap.getServices().add(Deployment.class, new MockDeployment());
+      bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+      bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+      bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+      bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+      bootstrap.startContainer();
+   }
+   
    @Test
    public void testEEEnv()
    {
@@ -64,6 +102,8 @@
       bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
       bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
       bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+      bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+      bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
       bootstrap.startContainer();
    }
    
@@ -79,6 +119,8 @@
       bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
       bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
       bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+      bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+      bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
       bootstrap.startContainer();
    }
    
@@ -93,6 +135,8 @@
       bootstrap.getServices().add(Deployment.class, new MockDeployment());
       bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
       bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+      bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+      bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
       bootstrap.startContainer();
    }
    
@@ -107,6 +151,8 @@
       bootstrap.getServices().add(Deployment.class, new MockDeployment());
       bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
       bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+      bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+      bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
       bootstrap.startContainer();
    }
    

Added: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java	                        (rev 0)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.bootstrap.api.test;
+
+import java.security.Principal;
+
+import org.jboss.webbeans.security.spi.SecurityServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockSecurityServices implements SecurityServices
+{
+
+   /* (non-Javadoc)
+    * @see org.jboss.webbeans.security.spi.SecurityServices#getPrincipal()
+    */
+   public Principal getPrincipal()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+}


Property changes on: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -1,6 +1,7 @@
 package org.jboss.webbeans.bootstrap.api.test;
 
 import javax.transaction.Synchronization;
+import javax.transaction.UserTransaction;
 
 import org.jboss.webbeans.transaction.spi.TransactionServices;
 
@@ -16,4 +17,9 @@
    {
    }
    
+   public UserTransaction getUserTransaction()
+   {
+      return null;
+   }
+   
 }

Added: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java	                        (rev 0)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.bootstrap.api.test;
+
+import javax.validation.ValidatorFactory;
+
+import org.jboss.webbeans.validation.spi.ValidationServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockValidationServices implements ValidationServices
+{
+
+   public ValidatorFactory getDefaultValidatorFactory()
+   {
+      return null;
+   }
+
+}


Property changes on: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -20,7 +20,9 @@
 import org.jboss.webbeans.ejb.spi.EjbServices;
 import org.jboss.webbeans.persistence.spi.JpaServices;
 import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.security.spi.SecurityServices;
 import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.validation.spi.ValidationServices;
 
 public class MockEELifecycle extends MockServletLifecycle
 {
@@ -34,6 +36,8 @@
       getBootstrap().getServices().add(EjbServices.class, new MockEjBServices());
       getBootstrap().getServices().add(JpaServices.class, new MockJpaServices(getDeployment()));
       getBootstrap().getServices().add(ResourceServices.class, new MockResourceServices());
+      getBootstrap().getServices().add(SecurityServices.class, new MockSecurityServices());
+      getBootstrap().getServices().add(ValidationServices.class, new MockValidationServices());
       getBootstrap().setEnvironment(Environments.EE);
    }
    

Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.mock;
+
+import java.security.Principal;
+
+import org.jboss.webbeans.security.spi.SecurityServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockSecurityServices implements SecurityServices
+{
+
+   /* (non-Javadoc)
+    * @see org.jboss.webbeans.security.spi.SecurityServices#getPrincipal()
+    */
+   public Principal getPrincipal()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -18,6 +18,7 @@
 package org.jboss.webbeans.mock;
 
 import javax.transaction.Synchronization;
+import javax.transaction.UserTransaction;
 
 import org.jboss.webbeans.transaction.spi.TransactionServices;
 
@@ -40,5 +41,10 @@
    public void registerSynchronization(Synchronization synchronizedObserver)
    {
    }
+   
+   public UserTransaction getUserTransaction()
+   {
+      return null;
+   }
 
 }

Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java	2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.mock;
+
+import javax.validation.ValidatorFactory;
+
+import org.jboss.webbeans.validation.spi.ValidationServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockValidationServices implements ValidationServices
+{
+
+   public ValidatorFactory getDefaultValidatorFactory()
+   {
+      return null;
+   }
+
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml	2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/version-matrix/pom.xml	2009-08-16 15:31:10 UTC (rev 3522)
@@ -93,6 +93,12 @@
             <artifactId>scannotation</artifactId>
             <version>1.0.2</version>
          </dependency>
+         
+         <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+            <version>1.0.CR3</version>
+         </dependency>
   
          <dependency>
             <groupId>com.google.collections</groupId>




More information about the weld-commits mailing list