geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [1/8] incubator-geode git commit: GEODE-14: Add Hibernate module
Date Mon, 28 Dec 2015 15:24:30 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-14 b98a7adb2 -> ed3be77de


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibe.inc
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibe.inc b/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibe.inc
deleted file mode 100644
index e724405..0000000
--- a/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibe.inc
+++ /dev/null
@@ -1,128 +0,0 @@
-hydra.Prms-testRequirement = "Starts a locator and p2p clients in a single DS";
-hydra.Prms-testDescription = " TBD ";
-
-INCLUDE $JTESTS/hydraconfig/hydraparams1.inc;
-INCLUDE $JTESTS/hydraconfig/topology_p2p_2_locator.inc;
-
-/**
- * Start the locators and connect them to distributed system.
- */
-INITTASK     taskClass = hydra.DistributedSystemHelper taskMethod = createLocator
-             threadGroups = locator;
-
-INITTASK     taskClass = hydra.DistributedSystemHelper taskMethod = startLocatorAndDS
-             threadGroups = locator;
-
-INITTASK     taskClass   = hibe.HibernateTest taskMethod  = HydraTask_initialize
-             threadGroups = hibernate
-             ;
-
-INITTASK     taskClass   = hibe.HibernateTest taskMethod  = createPeerCache
-             threadGroups = locator,clients
-             ;
-
-TASK         taskClass   = hibe.HibernateTest taskMethod  = doNothing
-	     threadGroups = clients,locator
-	     maxTimesToRun = 1
-             ;
-
-
-CLOSETASK    taskClass   = hibe.HibernateTest taskMethod  = validateEventPersonRegions 
-             threadGroups = hibernate
-             ;
-             
-CLOSETASK    taskClass   = hibe.HibernateTest taskMethod  = validateEventPersonRegionsOnPeers

-             threadGroups = clients
-             ;
-
-CLOSETASK    taskClass   = hibe.HibernateTest taskMethod  = validateQueryCacheRegion 
-             threadGroups = hibernate
-             ;       
-             
-             
-             
-CLOSETASK    taskClass   = hibe.HibernateTest taskMethod  = HydraTask_closeTask 
-             threadGroups = clients
-             ;
-
-CLOSETASK    taskClass   = hydra.DistributedSystemHelper taskMethod  = stopLocator
-             threadGroups = locator;
-             ;
-
-
-hydra.Prms-totalTaskTimeSec = 600;
-hydra.Prms-maxResultWaitSec = 180;
-
-// test controls the locator (create/start/stop)
-hydra.Prms-manageLocatorAgents = false; // turn off master-managed locators
-
-// define a cache (no regions)
-hydra.ConfigPrms-cacheConfig = gemfireCache;
-hydra.CachePrms-names        = gemfireCache;
-
-// all are peers in a single DS
-hydra.GemFirePrms-distributedSystem = ds;
-
-THREADGROUP locator
-    totalThreads = fcn ${locatorHosts} * ${locatorVMsPerHost}
-                                       * ${locatorThreadsPerVM}
-                   ncf     
-    clientNames  = fcn "hydra.TestConfigFcns.generateNames
-                        (\"locator\", ${locatorHosts}, true)"
-                   ncf;    
-THREADGROUP clients
-    totalThreads = fcn ${clientHosts} * ${clientVMsPerHost}
-                                    * ${clientThreadsPerVM}
-                   ncf     
-    clientNames  = fcn "hydra.TestConfigFcns.generateNames
-                        (\"client\", ${clientHosts}, true)"
-                   ncf;
-
-THREADGROUP hibernate
-    totalThreads = fcn ${hibernateHosts} * ${hibernateVMsPerHost}
-                                    * ${hibernateThreadsPerVM}
-                   ncf
-    clientNames  = fcn "hydra.TestConfigFcns.generateNames
-                        (\"hibernate\", ${hibernateHosts}, true)"
-                   ncf;
-
-
-
-
-// Control logging in hydra controlled portion of test
-//hydra.log.LogPrms-file_logLevel = fine;
-hydra.GemFirePrms-logLevel = fine;
-//hydra.VmPrms-extraVMArgs += "-DDistributionManager.VERBOSE=true";
-//hydra.VmPrms-extraVMArgs += "-DDistributionManager.DEBUG_JAVAGROUPS=true";
-
-
-// need same jars as the jpab (jpa benchmark) 
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/antlr-2.7.6.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/c3p0-0.9.1.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/cglib-2.2.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/commons-collections-3.1.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/dom4j-1.6.1.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/ehcache-core-2.2.0.jar;
-hydra.VmPrms-extraClassPaths += /export/mclaren1/users/sbawaska/gemfireModules/gemfire-modules/target/gemfire-modules-2.1.jar;
-hydra.VmPrms-extraClassPaths += /home/sbawaska/.m2/repository/org/hibernate/hibernate-core/3.5.0-Final/hibernate-core-3.5.0-Final.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/hibernate-index-annotation.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/hibernate-jpa-2.0-api-1.0.0.Final.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/infinispan-core-4.0.0.FINAL.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/javassist-3.9.0.GA.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/jbosscache-core-3.2.1.GA.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/jdo2-index.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/jpa2.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/jta-1.1.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/openjpa-index-annotation.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/oscache-2.1.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/proxool-0.8.3.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/slf4j-api-1.5.8.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/slf4j-jdk14-1.5.8.jar;
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/lib/swarmcache-1.0RC2.jar;
-
-// jpa test classes
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/jpab.jar;
-
-// hibernate jar from jpa/Hibernate/lib
-hydra.VmPrms-extraClassPaths += /export/java/users/java_share/jpa/jpab/jpa/Hibernate/lib/hibernate3.jar;
-hydra.VmPrms-extraClassPaths += /export/gcm/where/java/derby/derby-10.4.2.0/jars/insane/derby.jar;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibe1.conf
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibe1.conf b/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibe1.conf
deleted file mode 100644
index 5467a4e..0000000
--- a/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibe1.conf
+++ /dev/null
@@ -1,12 +0,0 @@
-hydra.Prms-testRequirement = "Basic setup for a concurrent hibernate test";
-hydra.Prms-testDescription = " TBD ";
-
-INCLUDE $JTESTS/hibe/hibe.inc;
-
-hibe.HibernatePrms-cachingStrategy = ${region};
-
-INITTASK         taskClass   = hibe.HibernateTest taskMethod  = testBasic
-             threadGroups = hibernate
-             ;
-
-             
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibernate.bt
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibernate.bt b/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibernate.bt
deleted file mode 100644
index 11c510e..0000000
--- a/modules/gemfire-modules-hibernate/src/test/hydra/hibe/hibernate.bt
+++ /dev/null
@@ -1,8 +0,0 @@
-gemfirePlugins/p2pJPAB.conf 
-   locatorHosts=1 locatorVMsPerHost=1 locatorThreadsPerVM=1
-
-gemfirePlugins/hctJPAB.conf 
-   locatorHosts=1 locatorVMsPerHost=1 locatorThreadsPerVM=1
-   A=client clientHosts=1 clientVMsPerHost=4 clientThreadsPerVM=1
-   B=hibernate hibernateHosts=1 hibernateVMsPerHost=1 hibernateThreadsPerVM=1
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/hydra/readme.txt
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/hydra/readme.txt b/modules/gemfire-modules-hibernate/src/test/hydra/readme.txt
deleted file mode 100644
index 7a12e6b..0000000
--- a/modules/gemfire-modules-hibernate/src/test/hydra/readme.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-To run and compile these tests, you need a gemfire checkout 6.5+
-In that gemfire checkout, cd to the tests directory, and create a symbolic link to the "hibe"
directory in here. eg: ln -s /Users/gregp/plugins/gemfire-plugins/src/test/hydra/hibe
-
-Then apply the following patch to build.xml:
-Index: build.xml
-===================================================================
---- build.xml	(revision 34744)
-+++ build.xml	(working copy)
-@@ -866,6 +866,7 @@
-         <pathelement location="${jetty.dir}/jsp-2.1.jar"/>
-         <pathelement location="${bcel.dir}/bcel.jar"/>
-       	<pathelement location="${osgi.core.jar}"/>
-+	<pathelement
-location="/home/sbawaska/.m2/repository/org/hibernate/hibernate-core/3.5.0-Final/hibernate-core-3.5.0-Final.jar"/>
-       </classpath>
-     </javac>
- 
-@@ -936,6 +937,7 @@
-         <pathelement location="${ant.home}/lib/ant.jar"/>
-         <pathelement location="${jetty.dir}/core-3.1.1.jar"/>
-         <pathelement location="${jetty.dir}/jsp-2.1.jar"/>
-+        <pathelement
-location="/home/sbawaska/.m2/repository/org/hibernate/hibernate-core/3.5.0-Final/hibernate-core-3.5.0-Final.jar"/>
-       </classpath>
-     </javac>
- 
-@@ -996,6 +998,7 @@
-       	<include name="hyperictest/lib/*.jar"/>
-       	<include name="hyperictest/config/*.properties"/>
-         <include name="jta/*.xml"/>
-+        <include name="hibe/*.xml"/>
-         <include name="junit/runner/excluded.properties"/>
-         <include name="**/*.bt"/>
-         <include name="**/*.conf"/>
-@@ -2901,6 +2904,7 @@
-           <pathelement location="${jetty.dir}/core-3.1.1.jar"/>
-           <pathelement location="${jetty.dir}/jsp-2.1.jar"/>
- 	        <pathelement location="cobertura.jar"/>
-+          <pathelement
-location="/home/sbawaska/.m2/repository/org/hibernate/hibernate-core/3.5.0-Final/hibernate-core-3.5.0-Final.jar"/>
-         </classpath>
- 
-         <env key="GEMFIRE" value="${product.dir}"/>
-
-
-
-In hibe/hibe.inc , there are references to the modules jar in /Users/gregp that need to be
changed, also, there are also references to /export/monaco1 , so those need to be reachable.

-In gemfire checkout main dir, run ./build.sh compile-tests execute-battery -Dbt.file=`pwd`/tests/hibe/hibe.bt

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Event.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Event.java
b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Event.java
deleted file mode 100644
index ed80f08..0000000
--- a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Event.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules;
-
-import java.util.Date;
-
-public class Event {
-    private Long id;
-
-    private String title;
-    private Date date;
-    private int i;
-
-    public Event() {}
-
-    public Long getId() {
-        return id;
-    }
-
-    private void setId(Long id) {
-        this.id = id;
-    }
-
-    public Date getDate() {
-        return date;
-    }
-
-    public Integer getVersion() {
-    	return i;
-    }
-    
-    public void setVersion(int i) {
-    	this.i = i;
-    }
-    
-    public void setDate(Date date) {
-        this.date = date;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-    @Override
-    public String toString() {
-    	StringBuilder b = new StringBuilder();
-    	b.append("Event:id:"+id+" title:"+title+" date:"+date);
-    	return b.toString();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/HibernateTestCase.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/HibernateTestCase.java
b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/HibernateTestCase.java
deleted file mode 100644
index 1c7954c..0000000
--- a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/HibernateTestCase.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules;
-
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.Region.Entry;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.modules.Owner.Status;
-import junit.framework.TestCase;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.AnnotationConfiguration;
-import org.hibernate.cfg.Configuration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.logging.Level;
-
-public class HibernateTestCase extends TestCase {
-
-  private Logger log = LoggerFactory.getLogger(getClass());
-
-  //private static final String jdbcURL = "jdbc:hsqldb:hsql://localhost/test";
-  private static final String jdbcURL = "jdbc:hsqldb:mem:test";
-
-  static File tmpDir;
-
-  static String gemfireLog;
-
-  @Override
-  protected void setUp() throws Exception {
-    super.setUp();
-
-    // Create a per-user scratch directory
-    tmpDir = new File(System.getProperty("java.io.tmpdir"),
-            "gemfire_modules-" + System.getProperty("user.name"));
-    tmpDir.mkdirs();
-    tmpDir.deleteOnExit();
-
-    gemfireLog = tmpDir.getPath() +
-            System.getProperty("file.separator") + "gemfire_modules.log";
-  }
-
-  public static SessionFactory getSessionFactory(Properties overrideProps) {
-    System.setProperty("gemfire.home", "GEMFIREHOME");
-    Configuration cfg = new Configuration();
-    cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
-    cfg.setProperty("hibernate.connection.driver_class",
-        "org.hsqldb.jdbcDriver");
-    // cfg.setProperty("hibernate.connection.url", "jdbc:hsqldb:mem:test");
-    cfg.setProperty("hibernate.connection.url", jdbcURL);
-    cfg.setProperty("hibernate.connection.username", "sa");
-    cfg.setProperty("hibernate.connection.password", "");
-    cfg.setProperty("hibernate.connection.pool_size", "1");
-    cfg.setProperty("hibernate.connection.autocommit", "true");
-    cfg.setProperty("hibernate.hbm2ddl.auto", "update");
-
-    cfg.setProperty("hibernate.cache.region.factory_class",
-        "com.gemstone.gemfire.modules.hibernate.GemFireRegionFactory");
-    cfg.setProperty("hibernate.show_sql", "true");
-    cfg.setProperty("hibernate.cache.use_query_cache", "true");
-    //cfg.setProperty("gemfire.mcast-port", AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS)+"");
-    cfg.setProperty("gemfire.mcast-port", "5555");
-    cfg.setProperty("gemfire.statistic-sampling-enabled", "true");
-    cfg.setProperty("gemfire.log-file", gemfireLog);
-    cfg.setProperty("gemfire.writable-working-dir", tmpDir.getPath());
-    //cfg.setProperty("gemfire.statistic-archive-file", "plugin-stats-file.gfs");
-    //cfg.setProperty("gemfire.default-client-region-attributes-id", "CACHING_PROXY");
-    //cfg.setProperty("gemfire.cache-topology", "client-server");
-    //cfg.setProperty("gemfire.locators", "localhost[5432]");
-    //cfg.setProperty("gemfire.log-level", "fine");
-    // cfg.setProperty("", "");
-    cfg.addClass(Person.class);
-    cfg.addClass(Event.class);
-    if (overrideProps != null) {
-      Iterator it = overrideProps.keySet().iterator();
-      while (it.hasNext()) {
-        String key = (String)it.next();
-        cfg.setProperty(key, overrideProps.getProperty(key));
-      }
-    }
-    return cfg.buildSessionFactory();
-  }
-
-  public void testpreload() {
-    log.info("SWAP:creating session factory In hibernateTestCase");
-
-    Session session = getSessionFactory(null).openSession();
-    log.info("SWAP:session opened");
-    session.beginTransaction();
-    Event theEvent = new Event();
-    theEvent.setTitle("title");
-    theEvent.setDate(new Date());
-    session.save(theEvent);
-    Long id = theEvent.getId();
-    session.getTransaction().commit();
-    session.beginTransaction();
-    Event ev = (Event)session.get(Event.class, id);
-    log.info("SWAP:load complete: " + ev);
-    session.getTransaction().commit();
-  }
-  
-  public void testNothing() throws Exception {
-    java.util.logging.Logger.getLogger("org.hibernate").setLevel(Level.ALL);
-    log.info("SWAP:creating session factory In hibernateTestCase");
-
-    Session session = getSessionFactory(null).openSession();
-    log.info("SWAP:session opened");
-    // session.setFlushMode(FlushMode.COMMIT);
-    session.beginTransaction();
-    Event theEvent = new Event();
-    theEvent.setTitle("title");
-    theEvent.setDate(new Date());
-    //session.save(theEvent);
-    session.persist(theEvent);
-    Long id = theEvent.getId();
-    session.getTransaction().commit();
-    log.info("commit complete...doing load");
-    session.beginTransaction();
-    Event ev = (Event)session.load(Event.class, id);
-    log.info("load complete: " + ev);
-    log.trace("SWAP");
-    ev.setTitle("newTitle");
-    session.save(ev);
-    log.info("commit");
-    session.getTransaction().commit();
-    log.info("save complete " + ev);
-
-    session.beginTransaction();
-    ev = (Event)session.load(Event.class, id);
-    log.info("load complete: " + ev);
-    ev.setTitle("newTitle2");
-    session.save(ev);
-    log.info("commit");
-    session.getTransaction().commit();
-    log.info("save complete " + ev);
-
-    ev = (Event)session.load(Event.class, id);
-    log.info("second load " + ev);
-    session.flush();
-    session.close();
-    log.info("flush complete session:" + session);
-
-    for (int i=0; i<5; i++) {
-      session = getSessionFactory(null).openSession();
-      log.info("doing get "+id);
-      // ev = (Event) session.load(Event.class, id);
-      ev = (Event)session.get(Event.class, id);
-      log.info("third load " + ev);
-    }
-    printExistingDB();
-    Iterator it = GemFireCacheImpl.getInstance().rootRegions().iterator();
-    while (it.hasNext()) {
-      Region r = (Region)it.next();
-      System.out.println("Region:"+r);
-      Iterator enIt = r.entrySet().iterator();
-      while (enIt.hasNext()) {
-        Region.Entry re = (Entry)enIt.next();
-        System.out.println("key:"+re.getKey()+" value:"+re.getValue());
-      }
-    }
-    Thread.sleep(3000);
-     //System.in.read();
-    // try direct data
-
-  }
-
-  public void _testInvalidation() {
-    Session s = getSessionFactory(null).openSession();
-  }
-
-  static Long personId;
-  public void testRelationship() throws Exception {
-    //java.util.logging.Logger.getLogger("org.hibernate").setLevel(Level.ALL);
-    Properties props = new Properties();
-    props.put("gemfire.topology", "client-server");
-    Session session = getSessionFactory(null).openSession();
-    session.beginTransaction();
-
-    Person thePerson = new Person();
-    thePerson.setFirstname("foo");
-    thePerson.setLastname("bar");
-    thePerson.setAge(1);
-    thePerson.setId(99L);
-    session.save(thePerson);
-    personId = thePerson.getId();
-    log.info("person saved");
-    
-    Event theEvent = new Event();
-    theEvent.setTitle("title");
-    theEvent.setDate(new Date());
-    session.save(theEvent);
-    Long eventId = theEvent.getId();
-    log.info("event saved");
-    
-    Event theEvent2 = new Event();
-    theEvent2.setTitle("title2");
-    theEvent2.setDate(new Date());
-    session.save(theEvent2);
-    Long eventId2 = theEvent2.getId();
-    log.info("event2 saved");
-    session.getTransaction().commit();
-    
-    session.beginTransaction();
-    Person aPerson = (Person) session.load(Person.class, personId);
-    Event anEvent = (Event) session.load(Event.class, eventId);
-    Event anEvent2 = (Event) session.load(Event.class, eventId2);
-    log.info("adding event to person");
-    aPerson.getE().add(anEvent);
-    aPerson.getE().add(anEvent2);
-    log.info("calling commit");
-
-    session.getTransaction().commit();
-    log.info("commit complete");
-    session.close();
-    log.info("opening new session");
-    session = getSessionFactory(null).openSession();
-    log.info("SWAP:loading person");
-    aPerson = (Person)session.load(Person.class, personId);
-    log.info("loading events");
-    Iterator<Event> e = aPerson.getE().iterator();
-    while (e.hasNext()) {
-      e.next();
-    }
-    session.close();
-    log.info("opening new session");
-    session = getSessionFactory(null).openSession();
-    log.info("SWAP:loading person");
-    aPerson = (Person)session.load(Person.class, personId);
-    log.info("loading events");
-    e = aPerson.getE().iterator();
-    while (e.hasNext()) {
-      e.next();
-    }
-
-    log.info(aPerson.getE()+"");
-    session.close();
-    //System.in.read();
-//    log.info("opening third session");
-//    session = getSessionFactory().openSession();
-//    log.info("loading person");
-//    aPerson = (Person)session.load(Person.class, personId);
-//    log.info("loading events");
-//    log.info(aPerson.getEvents()+"");
-  }
-  
-  public void _testQueryCache() throws Exception {
-    Session session = getSessionFactory(null).openSession();
-    Query q = session.createQuery("from Event");
-    q.setCacheable(true);
-    List l = q.list();
-    log.info("list:"+l);
-//    log.info("Sleeping for 10 seconds");
-//    Thread.sleep(10000);
-    l = q.list();
-    log.info("list2:"+l);
-    log.info("updating an event");
-    session.beginTransaction();
-    Event e = (Event)l.get(0);
-    e.setDate(new Date());
-    session.saveOrUpdate(e);
-    session.getTransaction().commit();
-    l = q.list();
-    log.info("list3:"+l);
-  }
-  
-  public void testInsert() {
-    Session session = getSessionFactory(null).openSession();
-    Region r = GemFireCacheImpl.getExisting().getRegion(Person.class.getCanonicalName());
-    int initSize = r.size();
-    session.beginTransaction();
-    log.info("SWAP: Saving Person");
-    Person p = new Person();
-    p.setId(10L);
-    p.setFirstname("foo");
-    p.setLastname("bar");
-    session.saveOrUpdate("Person", p);
-    session.getTransaction().commit();
-    assertEquals(1, session.getStatistics().getEntityCount());
-    assertEquals(initSize+1, r.size());
-
-    session.beginTransaction();
-    p.setAge(1);
-    session.saveOrUpdate(p);
-    session.getTransaction().commit();
-    assertEquals(1, session.getStatistics().getEntityCount());
-}
-  
-  public void testNormalRegion() {
-    Properties props = new Properties();
-    props.setProperty("gemfire.default-region-attributes-id", "LOCAL");
-    Session session = getSessionFactory(props).openSession();
-    session.beginTransaction();
-    Event theEvent = new Event();
-    theEvent.setTitle("title");
-    theEvent.setDate(new Date());
-    session.save(theEvent);
-    Long id = theEvent.getId();
-    session.getTransaction().commit();
-    session.beginTransaction();
-    Event ev = (Event)session.load(Event.class, id);
-    ev.setTitle("newTitle");
-    session.save(ev);
-    session.getTransaction().commit();
-  }
-  
-  private void printExistingDB() throws SQLException {
-    try {
-      Class.forName("org.hsqldb.jdbc.JDBCDriver");
-    }
-    catch (Exception e) {
-      System.err.println("ERROR: failed to load HSQLDB JDBC driver.");
-      e.printStackTrace();
-      return;
-    }
-
-    Connection c = DriverManager.getConnection(jdbcURL, "SA", "");
-    log.info("issuing query...");
-    ResultSet rs = c.createStatement().executeQuery("select * from events");
-    int col = rs.getMetaData().getColumnCount();
-    while (rs.next()) {
-      StringBuilder b = new StringBuilder();
-      for (int i = 1; i <= col; i++) {
-        b.append(" col:" + i + ":" + rs.getString(i));
-      }
-      log.info("Query result:" + b.toString());
-    }
-  }
-  
-  public void testEnum() {
-    AnnotationConfiguration cfg = new AnnotationConfiguration();
-    cfg.addAnnotatedClass(Owner.class);
-    cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
-    cfg.setProperty("hibernate.connection.driver_class",
-        "org.hsqldb.jdbcDriver");
-    cfg.setProperty("hibernate.connection.url", jdbcURL);
-    cfg.setProperty("hibernate.connection.username", "sa");
-    cfg.setProperty("hibernate.connection.password", "");
-    cfg.setProperty("hibernate.connection.pool_size", "1");
-    cfg.setProperty("hibernate.connection.autocommit", "true");
-    cfg.setProperty("hibernate.hbm2ddl.auto", "update");
-
-    cfg.setProperty("hibernate.cache.region.factory_class",
-        "com.gemstone.gemfire.modules.hibernate.GemFireRegionFactory");
-    cfg.setProperty("hibernate.show_sql", "true");
-    cfg.setProperty("hibernate.cache.use_query_cache", "true");
-    cfg.setProperty("gemfire.statistic-sampling-enabled", "true");
-    cfg.setProperty("gemfire.log-file", gemfireLog);
-    cfg.setProperty("gemfire.writable-working-dir", tmpDir.getPath());
-    cfg.setProperty("gemfire.mcast-port", "5555");
-    //cfg.setProperty("gemfire.cache-topology", "client-server");
-
-    SessionFactory sf = cfg.buildSessionFactory();
-    Session session = sf.openSession();
-    session.beginTransaction();
-    Owner o = new Owner();
-    o.setAddress("addr");
-    o.setCity("pdx");
-    o.setStatus(Status.PREMIUM);
-    session.save(o);
-    long id = o.getId();
-    log.info("testEnum:commiting tx");
-    session.getTransaction().commit();
-    session.close();
-    
-    session = sf.openSession();
-    Owner o1 = (Owner) session.load(Owner.class, id);
-    log.info("loaded:"+o);
-    assertEquals(o.getAddress(), o1.getAddress());
-    assertEquals(o.getCity(), o1.getCity());
-    assertEquals(o.getStatus(), o1.getStatus());
-    o1.setAddress("address2");
-    session.save(o1);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Owner.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Owner.java
b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Owner.java
deleted file mode 100644
index 3701711..0000000
--- a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Owner.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.Column;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
-import org.hibernate.annotations.Entity;
-
-
-/**
- * Simple JavaBean domain object representing an owner.
- * 
- * @author Ken Krebs
- * @author Juergen Hoeller
- * @author Sam Brannen
- */
-@javax.persistence.Entity
-@Entity
-public class Owner {
-	private static final long serialVersionUID = 4315791692556052565L;
-
-	@Column(name="address")
-	private String address;
-
-	private String city;
-
-	private String telephone;
-
-//	private Set<Pet> pets;
-	@Id
-	@GeneratedValue
-	private Long id;
-	
-	private long versionNum = -1;
-
-	public enum Status {
-		NORMAL, PREMIUM
-	};
-
-	@Enumerated
-	private Status status = Status.NORMAL;
-
-	  private void setId(Long id) {
-	    this.id = id;
-	  }
-
-	  public Long getId() {
-	    return id;
-	  }
-	  
-	public String getAddress() {
-		return this.address;
-	}
-
-	public void setAddress(String address) {
-		this.address = address;
-	}
-
-	public String getCity() {
-		return this.city;
-	}
-
-	public void setCity(String city) {
-		this.city = city;
-	}
-
-	public String getTelephone() {
-		return this.telephone;
-	}
-
-	public void setTelephone(String telephone) {
-		this.telephone = telephone;
-	}
-
-	public long getVersionNum() {
-		return versionNum;
-	}
-
-	public void setVersionNum(long versionNum) {
-		this.versionNum = versionNum;
-	}
-
-	public Status getStatus() {
-		return this.status;
-	}
-
-	public void setStatus(Status state) {
-		if (state != null) {
-			this.status = state;
-		}
-	}
-
-//	protected void setPetsInternal(Set<Pet> pets) {
-//		this.pets = pets;
-//	}
-//
-//	protected Set<Pet> getPetsInternal() {
-//		if (this.pets == null) {
-//			this.pets = new HashSet<Pet>();
-//		}
-//		return this.pets;
-//	}
-//
-//	public List<Pet> getPets() {
-//		List<Pet> sortedPets = new ArrayList<Pet>(getPetsInternal());
-//		PropertyComparator.sort(sortedPets, new MutableSortDefinition("name",
-//				true, true));
-//		return Collections.unmodifiableList(sortedPets);
-//	}
-//
-//	public void addPet(Pet pet) {
-//		getPetsInternal().add(pet);
-//		pet.setOwner(this);
-//	}
-//
-//	/**
-//	 * Return the Pet with the given name, or null if none found for this Owner.
-//	 * 
-//	 * @param name
-//	 *            to test
-//	 * @return true if pet name is already in use
-//	 */
-//	public Pet getPet(String name) {
-//		return getPet(name, false);
-//	}
-//
-//	/**
-//	 * Return the Pet with the given name, or null if none found for this Owner.
-//	 * 
-//	 * @param name
-//	 *            to test
-//	 * @return true if pet name is already in use
-//	 */
-//	public Pet getPet(String name, boolean ignoreNew) {
-//		name = name.toLowerCase();
-//		for (Pet pet : getPetsInternal()) {
-//			if (!ignoreNew || !pet.isNew()) {
-//				String compName = pet.getName();
-//				compName = compName.toLowerCase();
-//				if (compName.equals(name)) {
-//					return pet;
-//				}
-//			}
-//		}
-//		return null;
-//	}
-//
-//	@Override
-//	public String toString() {
-//		return new ToStringCreator(this).append("id", this.getId())
-//				.append("new", this.isNew())
-//				.append("lastName", this.getLastName())
-//				.append("firstName", this.getFirstName())
-//				.append("address", this.address).append("city", this.city)
-//				.append("telephone", this.telephone)
-//				.append("version", this.versionNum)
-//				.append("status", this.status)
-//
-//				.toString();
-//	}
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Person.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Person.java
b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Person.java
deleted file mode 100644
index 14e6294..0000000
--- a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/Person.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class Person {
-  private Long id;
-  private int age;
-  private String firstname;
-  private String lastname;
-
-  private Set<Event> e = new HashSet<Event>();
-  
-  public Person() {}
-
-  public void setId(Long id) {
-    this.id = id;
-  }
-
-  public Long getId() {
-    return id;
-  }
-
-  public void setAge(int age) {
-    this.age = age;
-  }
-
-  public int getAge() {
-    return age;
-  }
-
-  public void setFirstname(String firstname) {
-    this.firstname = firstname;
-  }
-
-  public String getFirstname() {
-    return firstname;
-  }
-
-  public void setLastname(String lastname) {
-    this.lastname = lastname;
-  }
-
-  public String getLastname() {
-    return lastname;
-  }
-
-  public void setE(Set<Event> events) {
-    this.e = events;
-  }
-
-  public Set<Event> getE() {
-    return e;
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java
b/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java
deleted file mode 100644
index a0e6229..0000000
--- a/modules/gemfire-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-import java.util.logging.Level;
-
-import junit.framework.TestCase;
-
-import org.hibernate.Session;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.GemFireCache;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.Region.Entry;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-
-public class SecondVMTest extends TestCase {
-
-  private Logger log = LoggerFactory.getLogger(getClass());
-  
-  public void testNoop() {
-    
-  }
-  public void _testStartEmptyVM() throws IOException {
-    Properties gemfireProperties = new Properties();
-    gemfireProperties.setProperty("mcast-port", "5555");
-    gemfireProperties.setProperty("log-level", "fine");
-    Cache cache = new CacheFactory(gemfireProperties).create();
-    System.in.read();
-    Iterator it = cache.rootRegions().iterator();
-    while (it.hasNext()) {
-      Region r = (Region)it.next();
-      System.out.println("Region:"+r);
-      Iterator enIt = r.entrySet().iterator();
-      while (enIt.hasNext()) {
-        Region.Entry re = (Entry)enIt.next();
-        System.out.println("key:"+re.getKey()+" value:"+re.getValue());
-      }
-    }
-  }
-  
-  public void _testStartVM() throws Exception {
-    java.util.logging.Logger.getLogger("org.hibernate").setLevel(Level.ALL);
-    Session session = HibernateTestCase.getSessionFactory(null).openSession();
-    log.info("SWAP:new session open");
-    long id = 1;
-    log.info("loading new person:"+(id));
-    GemFireCache cache = GemFireCacheImpl.getInstance();
-    Iterator<Region<?, ?>> rSet = cache.rootRegions().iterator();
-    while (rSet.hasNext()) {
-      Region<?, ?> r = rSet.next();
-      log.info("SWAP:Region "+r);
-      Iterator<?> keySet = r.keySet().iterator();
-      while (keySet.hasNext()) {
-        log.info("key:"+keySet.next());
-      }
-    }
-    log.info("loading new person:"+(id));
-    session.beginTransaction();
-    Person p = (Person)session.load(Person.class, id);
-    p.setFirstname("SecondVMfirstname"+id);
-    log.info("loading events");
-    log.info(p.getE()+"");
-    session.getTransaction().commit();
-    //System.in.read();
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/resources/com/gemstone/gemfire/modules/Event.hbm.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/resources/com/gemstone/gemfire/modules/Event.hbm.xml
b/modules/gemfire-modules-hibernate/src/test/resources/com/gemstone/gemfire/modules/Event.hbm.xml
deleted file mode 100644
index 17faf29..0000000
--- a/modules/gemfire-modules-hibernate/src/test/resources/com/gemstone/gemfire/modules/Event.hbm.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
-        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping package="com.gemstone.gemfire.modules">
-	<class name="Event" table="EVENTS">
-		<cache usage="read-write"/>
-		<id name="id" column="EVENT_ID">
-			<generator class="native"/>
-		</id>
-		<version name="version"/>
-		<property name="date" type="timestamp" column="EVENT_DATE"/>
-        <property name="title"/>
-	</class>
-</hibernate-mapping>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/resources/com/gemstone/gemfire/modules/Person.hbm.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/resources/com/gemstone/gemfire/modules/Person.hbm.xml
b/modules/gemfire-modules-hibernate/src/test/resources/com/gemstone/gemfire/modules/Person.hbm.xml
deleted file mode 100644
index a4810d7..0000000
--- a/modules/gemfire-modules-hibernate/src/test/resources/com/gemstone/gemfire/modules/Person.hbm.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
-        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping package="com.gemstone.gemfire.modules">
-    <class name="Person" table="PERSON">
-        <cache usage="read-write"/>
-        <id name="id" column="PERSON_ID">
-        </id>
-        <property name="age"/>
-        <property name="firstname"/>
-        <property name="lastname"/>
-        <set name="e" table="PERSON_EVENT">
-          <cache usage="read-write"/>
-          <key column="PERSON_ID"/>
-          <many-to-many column="EVENT_ID" class="Event"/>
-        </set>
-    </class>
-</hibernate-mapping>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/test/resources/log4j.properties b/modules/gemfire-modules-hibernate/src/test/resources/log4j.properties
deleted file mode 100644
index c136990..0000000
--- a/modules/gemfire-modules-hibernate/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml!
-# For all other servers: Comment out the Log4J listener in web.xml to activate Log4J.
-#log4j.rootLogger=DEBUG, stdout, logfile
-log4j.rootLogger=DEBUG, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
-
-#log4j.appender.logfile=org.apache.log4j.RollingFileAppender
-#log4j.appender.logfile.MaxFileSize=512KB
-## Keep three backup files.
-#log4j.appender.logfile.MaxBackupIndex=3
-## Pattern to output: date priority [category] - message
-#log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
-#log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/modules/gemfire-modules-hibernate/tomcat/conf/tomcat-users.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/tomcat/conf/tomcat-users.xml b/modules/gemfire-modules-hibernate/tomcat/conf/tomcat-users.xml
deleted file mode 100644
index 6c9f217..0000000
--- a/modules/gemfire-modules-hibernate/tomcat/conf/tomcat-users.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<tomcat-users>
-</tomcat-users>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0c89797b/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 2882657..a5df712 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -28,6 +28,7 @@ include 'gemfire-rebalancer'
 include 'gemfire-lucene'
 include 'extensions/gemfire-modules'
 include 'extensions/gemfire-modules-tomcat7'
+include 'extensions/gemfire-modules-hibernate'
 
 def minimumGradleVersion = '2.3'
 if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) {



Mime
View raw message