[jboss-svn-commits] JBL Code SVN: r18595 - in labs/jbosslabs/labs-3.0-build: services/credential and 14 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Feb 26 11:43:32 EST 2008
Author: szimano
Date: 2008-02-26 11:43:32 -0500 (Tue, 26 Feb 2008)
New Revision: 18595
Added:
labs/jbosslabs/labs-3.0-build/views/labs-test/
labs/jbosslabs/labs-3.0-build/views/labs-test/pom.xml
labs/jbosslabs/labs-3.0-build/views/labs-test/src/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/LabsTest.java
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/credential/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/credential/UserTest.java
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/resources/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/WEB-INF/
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/WEB-INF/web.xml
labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/index.jsp
Removed:
labs/jbosslabs/labs-3.0-build/services/credential/src/test/java/org/jboss/labs/test/auth/UserTest.java
labs/jbosslabs/labs-3.0-build/services/credential/src/test/resources/
Modified:
labs/jbosslabs/labs-3.0-build/pom.xml
labs/jbosslabs/labs-3.0-build/services/credential/pom.xml
labs/jbosslabs/labs-3.0-build/views/pom.xml
Log:
testing framework for labs
Modified: labs/jbosslabs/labs-3.0-build/pom.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/pom.xml 2008-02-26 16:06:57 UTC (rev 18594)
+++ labs/jbosslabs/labs-3.0-build/pom.xml 2008-02-26 16:43:32 UTC (rev 18595)
@@ -84,6 +84,11 @@
<name>ejb3unit repository</name>
<url>http://ejb3unit.sourceforge.net/maven2</url>
</repository>
+ <repository>
+ <id>sf</id>
+ <name>sourceforge repo</name>
+ <url>http://junitee.sourceforge.net/repository/</url>
+ </repository>
</repositories>
<dependencies>
<dependency>
Modified: labs/jbosslabs/labs-3.0-build/services/credential/pom.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/services/credential/pom.xml 2008-02-26 16:06:57 UTC (rev 18594)
+++ labs/jbosslabs/labs-3.0-build/services/credential/pom.xml 2008-02-26 16:43:32 UTC (rev 18595)
@@ -84,6 +84,12 @@
<version>1.0.0.Alpha9</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>hibernate-commons-annotations</groupId>
+ <artifactId>hibernate-commons-annotations</artifactId>
+ <version>3.0.0.GA</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
Deleted: labs/jbosslabs/labs-3.0-build/services/credential/src/test/java/org/jboss/labs/test/auth/UserTest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/services/credential/src/test/java/org/jboss/labs/test/auth/UserTest.java 2008-02-26 16:06:57 UTC (rev 18594)
+++ labs/jbosslabs/labs-3.0-build/services/credential/src/test/java/org/jboss/labs/test/auth/UserTest.java 2008-02-26 16:43:32 UTC (rev 18595)
@@ -1,130 +0,0 @@
-/**
- *
- */
-package org.jboss.labs.test.auth;
-
-import java.util.Hashtable;
-
-import javax.naming.InitialContext;
-import javax.persistence.EntityManager;
-import javax.transaction.TransactionManager;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;
-import org.jboss.labs.auth.UserService;
-import org.jboss.labs.core.model.auth.User;
-import org.jboss.labs.exception.auth.NoSuchUserException;
-import org.jboss.labs.exception.auth.UserExistsException;
-
-import com.google.inject.Inject;
-
-/*
- * JBoss Labs. http://labs.jboss.com/jbosslabs
- *
- * Copyright © 2008 Red Hat Middleware, LLC. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, v. 2.1.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
- *
- * Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik, Tomasz
- * Szymanski, Adam Warski, Pawel Wrzeszcz
- */
-
-/**
- * @author tomaszszymanski
- *
- */
-public class UserTest extends TestCase {
-
- public static final Logger log = Logger.getLogger(UserTest.class);
-
- public UserTest() {
- super("UserTest");
- }
-
- public static Test suite() throws Exception {
- TestSuite suite = new TestSuite();
- suite.addTestSuite(UserTest.class);
-
- // setup test so that embedded JBoss is started/stopped once for all
- // tests here.
- TestSetup wrapper = new TestSetup(suite) {
- protected void setUp() {
- startupEmbeddedJboss();
- }
-
- protected void tearDown() {
- shutdownEmbeddedJboss();
- }
- };
-
- return wrapper;
- }
-
- public static void startupEmbeddedJboss() {
- EJB3StandaloneBootstrap.boot(null);
- EJB3StandaloneBootstrap.scanClasspath();
- }
-
- public static void shutdownEmbeddedJboss() {
- EJB3StandaloneBootstrap.shutdown();
- }
-
- public void testEJBs() throws Exception {
-
- InitialContext ctx = getInitialContext();
-
- }
-
- public void testEntityManager() throws Exception {
- // This is a transactionally aware EntityManager and must be accessed
- // within a JTA transaction
- // Why aren't we using javax.persistence.Persistence? Well, our
- // persistence.xml file uses
- // jta-datasource which means that it is created by the EJB
- // container/embedded JBoss.
- // using javax.persistence.Persistence will just cause us an error
- //EntityManager em = (EntityManager) getInitialContext().lookup(
- // "java:/EntityManagers/auth_model");
-
- //UserService us = (UserService) getInitialContext().lookup(
- // "UserServiceImpl/local");
-
- //System.out.println(us);
-
- // Obtain JBoss transaction
- TransactionManager tm = (TransactionManager) getInitialContext()
- .lookup("java:/TransactionManager");
-
- }
-
- public static InitialContext getInitialContext() throws Exception {
- Hashtable props = getInitialContextProperties();
- return new InitialContext(props);
- }
-
- private static Hashtable getInitialContextProperties() {
- Hashtable props = new Hashtable();
- props.put("java.naming.factory.initial",
- "org.jnp.interfaces.LocalOnlyContextFactory");
- props.put("java.naming.factory.url.pkgs",
- "org.jboss.naming:org.jnp.interfaces");
- return props;
- }
-}
Property changes on: labs/jbosslabs/labs-3.0-build/views/labs-test
___________________________________________________________________
Name: svn:ignore
+ target
.classpath
.project
.settings
Added: labs/jbosslabs/labs-3.0-build/views/labs-test/pom.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/labs-test/pom.xml (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/labs-test/pom.xml 2008-02-26 16:43:32 UTC (rev 18595)
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<project>
+ <parent>
+ <artifactId>views</artifactId>
+ <groupId>org.jboss.labs</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.labs</groupId>
+ <artifactId>labs-test</artifactId>
+ <packaging>war</packaging>
+ <name>labs-test Maven Webapp</name>
+ <version>1.0-SNAPSHOT</version>
+ <url>http://maven.apache.org</url>
+ <build>
+ <finalName>labs-test</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <copy file="target/labs-test.jar" toFile="target/labs-test/WEB-INF/lib/labs-test.jar" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.junitee</groupId>
+ <artifactId>junite2</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/LabsTest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/LabsTest.java (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/LabsTest.java 2008-02-26 16:43:32 UTC (rev 18595)
@@ -0,0 +1,50 @@
+/**
+ *
+ */
+package org.jboss.labs.test;
+
+import org.apache.log4j.Logger;
+import org.jboss.labs.injection.LabsInjection;
+
+import junit.framework.TestCase;
+
+/*
+ * JBoss Labs. http://labs.jboss.com/jbosslabs
+ *
+ * Copyright © 2008 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT A 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, v.2.1 along with this distribution; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ * Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+ * Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+ */
+
+/**
+ * @author tomaszszymanski
+ *
+ */
+public class LabsTest extends TestCase {
+
+ public Logger log = Logger.getLogger(this.getClass());
+
+ protected void setUp() throws Exception {
+ LabsInjection.getInjector().injectMembers(this);
+ }
+
+ public void testNothing() {
+ // do nothing
+ }
+
+}
Added: labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/credential/UserTest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/credential/UserTest.java (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/java/org/jboss/labs/test/credential/UserTest.java 2008-02-26 16:43:32 UTC (rev 18595)
@@ -0,0 +1,47 @@
+/**
+ *
+ */
+package org.jboss.labs.test.credential;
+
+import org.jboss.labs.auth.UserService;
+import org.jboss.labs.test.LabsTest;
+
+import com.google.inject.Inject;
+
+/*
+ * JBoss Labs. http://labs.jboss.com/jbosslabs
+ *
+ * Copyright © 2008 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT A 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, v.2.1 along with this distribution; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ * Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+ * Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+ */
+
+/**
+ * @author tomaszszymanski
+ *
+ */
+public class UserTest extends LabsTest {
+
+ @Inject
+ UserService service;
+
+ public void testUser() {
+ log.info(service);
+ }
+
+}
Added: labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/WEB-INF/web.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/WEB-INF/web.xml 2008-02-26 16:43:32 UTC (rev 18595)
@@ -0,0 +1,24 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+ <display-name>Labs Test Servlet</display-name>
+
+ <servlet>
+ <servlet-name>JUnitEETestServlet</servlet-name>
+ <description>JUnitEE test framework</description>
+ <servlet-class>
+ org.junitee.servlet.JUnitEEServlet
+ </servlet-class>
+ <init-param>
+ <param-name>searchResources</param-name>
+ <param-value>labs-test.jar</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>JUnitEETestServlet</servlet-name>
+ <url-pattern>/Test/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Added: labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/index.jsp
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/index.jsp (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/labs-test/src/main/webapp/index.jsp 2008-02-26 16:43:32 UTC (rev 18595)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>
Modified: labs/jbosslabs/labs-3.0-build/views/pom.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/pom.xml 2008-02-26 16:06:57 UTC (rev 18594)
+++ labs/jbosslabs/labs-3.0-build/views/pom.xml 2008-02-26 16:43:32 UTC (rev 18595)
@@ -55,5 +55,6 @@
<module>project-test-view</module>
<module>login</module>
<module>admin</module>
+ <module>labs-test</module>
</modules>
</project>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list