Test
This commit is contained in:
parent
572571fe16
commit
5176e6b2fb
|
@ -1,19 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/richfaces/ui/richfaces-components-ui/4.1.0.Final/richfaces-components-ui-4.1.0.Final.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/richfaces/ui/richfaces-components-api/4.1.0.Final/richfaces-components-api-4.1.0.Final.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/richfaces/core/richfaces-core-api/4.1.0.Final/richfaces-core-api-4.1.0.Final.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r08/guava-r08.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/richfaces/core/richfaces-core-impl/4.1.0.Final/richfaces-core-impl-4.1.0.Final.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
<classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
|
||||
<classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
|
||||
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
|
||||
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
<classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="var" path="M2_REPO/com/sun/faces/jsf-api/2.1.7/jsf-api-2.1.7.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/com/sun/faces/jsf-impl/2.1.7/jsf-impl-2.1.7.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/richfaces/ui/richfaces-components-ui/4.1.0.Final/richfaces-components-ui-4.1.0.Final.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/richfaces/ui/richfaces-components-api/4.1.0.Final/richfaces-components-api-4.1.0.Final.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/richfaces/core/richfaces-core-api/4.1.0.Final/richfaces-core-api-4.1.0.Final.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r08/guava-r08.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/richfaces/core/richfaces-core-impl/4.1.0.Final/richfaces-core-impl-4.1.0.Final.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-entitymanager/3.4.0.GA/hibernate-entitymanager-3.4.0.GA.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-core/3.3.1.GA/hibernate-core-3.3.1.GA.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/javassist/javassist/3.4.GA/javassist-3.4.GA.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
|
||||
</classpath>
|
|
@ -28,5 +28,7 @@
|
|||
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
|
|
|
@ -53,9 +53,66 @@
|
|||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>4.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>ejb3-persistence</artifactId>
|
||||
<version>1.0.2.GA</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-entitymanager</artifactId>
|
||||
<version>3.4.0.GA</version>
|
||||
<exclusions>
|
||||
<!-- use jboss-javaee.jar instead -->
|
||||
<exclusion>
|
||||
<groupId>javax.transaction</groupId>
|
||||
<artifactId>jta</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-commons-annotations</artifactId>
|
||||
<version>3.1.0.GA</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-annotations</artifactId>
|
||||
<version>3.4.0.GA</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>3.3.1.GA</version>
|
||||
<exclusions>
|
||||
<!-- use jboss-javaee.jar instead -->
|
||||
<exclusion>
|
||||
<groupId>javax.transaction</groupId>
|
||||
<artifactId>jta</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.5.10</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.5.10</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<org.richfaces.bom.version>4.1.0.Final</org.richfaces.bom.version>
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package de.wazong.ironblogger.persistence;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name="feed")
|
||||
public class Feed {
|
||||
|
||||
private long id;
|
||||
private String name;
|
||||
private String feedURL;
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package de.wazong.ironblogger;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import javax.persistence.Persistence;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
public class TestTest {
|
||||
|
||||
private static EntityManager em;
|
||||
private static final Logger log = Logger.getLogger(TestTest.class);
|
||||
|
||||
@Test
|
||||
public void testNothing() throws Exception {
|
||||
|
||||
if (em == null)setUp();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an {@link EntityManager} for this test.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@BeforeClass
|
||||
public static void setUp() throws Exception {
|
||||
if (em == null) {
|
||||
final EntityManagerFactory emf = Persistence
|
||||
.createEntityManagerFactory("gwmTest");
|
||||
em = emf.createEntityManager();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up after this test has run.
|
||||
*/
|
||||
@AfterClass
|
||||
public static void cleanUp() {
|
||||
em.clear();
|
||||
em.getTransaction().begin();
|
||||
// for (Record r : ids) {
|
||||
// Object o = em.find(r.getClazz(), r.getId());
|
||||
// if (o != null)
|
||||
// em.remove(o);
|
||||
// }
|
||||
em.getTransaction().commit();
|
||||
em.close();
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue