openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r791628 [2/2] - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/writebehind/ openjpa-persistence-jdbc/src/test/...
Date Mon, 06 Jul 2009 22:09:33 GMT
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractDeleteTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractDeleteTest.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractDeleteTest.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractDeleteTest.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+public abstract class AbstractDeleteTest extends AbstractCrudTest {
+
+    // Commenting out the timed tests to keep build time down. 
+    // public void testTimedDeletesAfterCommit() throws InterruptedException {
+    // cleanup();
+    // populate();
+    // assertEntitiesExist();
+    // deleteEntities(false);
+    // assertEntitiesExist();
+    // Thread.sleep(SLEEP_TIME);
+    // assertEntitiesDeleted();
+    // }
+    //
+    // public void testTimedDeletesAfterCommitWithFlush()
+    // throws InterruptedException {
+    // cleanup();
+    // populate();
+    // assertEntitiesExist();
+    // deleteEntities(true);
+    // assertEntitiesExist();
+    // Thread.sleep(SLEEP_TIME);
+    // assertEntitiesDeleted();
+    // }
+    
+    public void testTriggeredDeletesAfterCommit() throws InterruptedException {
+        cleanup();
+        populate();
+        assertEntitiesExist();
+        deleteEntities(false);
+        assertEntitiesExist();
+        getWBCallback().flush();
+        assertEntitiesDeleted();
+    }
+
+    public void testTriggeredDeletesAfterCommitWithFlush()
+        throws InterruptedException {
+        cleanup();
+        populate();
+        assertEntitiesExist();
+        deleteEntities(true);
+        assertEntitiesExist();
+        getWBCallback().flush();
+        assertEntitiesDeleted();
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractDeleteTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractInsertTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractInsertTest.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractInsertTest.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractInsertTest.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+public abstract class AbstractInsertTest extends AbstractCrudTest {
+
+    // Commenting out the timed tests to keep build time down. 
+    // public void testTimedInsertsAfterCommit() throws InterruptedException {
+    // cleanup();
+    // insertEntities(false);
+    // assertEntitiesDeleted();
+    // Thread.sleep(SLEEP_TIME);
+    // assertEntitiesExist();
+    // }
+    //
+    // public void testTimedInsertsAfterCommitWithFlush()
+    // throws InterruptedException {
+    // cleanup();
+    // insertEntities(true);
+    // assertEntitiesDeleted();
+    // Thread.sleep(SLEEP_TIME);
+    // assertEntitiesExist();
+    // }
+
+    public void testTriggeredInsertsAfterCommit() throws InterruptedException {
+        cleanup();
+        insertEntities(false);
+        assertEntitiesDeleted();
+        getWBCallback().flush();
+        assertEntitiesExist();
+    }
+
+    public void testTriggeredInsertsAfterCommitWithFlush()
+        throws InterruptedException {
+        cleanup();
+        insertEntities(true);
+        assertEntitiesDeleted();
+        getWBCallback().flush();
+        assertEntitiesExist();
+    }
+
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractInsertTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractUpdateTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractUpdateTest.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractUpdateTest.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractUpdateTest.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+public abstract class AbstractUpdateTest extends AbstractCrudTest {
+    // Commenting out the timed tests to keep build time down. 
+    // public void testTimedUpdatesAfterCommit() throws InterruptedException {
+    // cleanup();
+    // populate();
+    // assertEntitiesUnmodified();
+    // updateEntities(false);
+    // assertEntitiesUnmodified();
+    // Thread.sleep(SLEEP_TIME);
+    // assertEntitiesUpdated();
+    // }
+    //
+    // public void testTimedUpdatesAfterCommitWithFlush()
+    // throws InterruptedException {
+    // cleanup();
+    // populate();
+    // assertEntitiesUnmodified();
+    // updateEntities(true);
+    // assertEntitiesUnmodified();
+    // Thread.sleep(SLEEP_TIME);
+    // assertEntitiesUpdated();
+    // }
+    
+    public void testTriggeredUpdatesAfterCommit() throws InterruptedException {
+        cleanup();
+        populate();
+        assertEntitiesUnmodified();
+        updateEntities(false);
+        assertEntitiesUnmodified();
+        getWBCallback().flush();
+        assertEntitiesUpdated();
+    }
+
+    public void testTriggeredUpdatesAfterCommitWithFlush()
+        throws InterruptedException {
+        cleanup();
+        populate();
+        assertEntitiesUnmodified();
+        updateEntities(true);
+        assertEntitiesUnmodified();
+        getWBCallback().flush();
+        assertEntitiesUpdated();
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/AbstractUpdateTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdDelete.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdDelete.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdDelete.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdDelete.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleEntity;
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleNonGeneratedIdEntity;
+
+public class TestNonGeneratedIdDelete extends AbstractDeleteTest {
+
+    @Override
+    protected Class<? extends SimpleEntity> getEntityType() {
+        return SimpleNonGeneratedIdEntity.class;
+    }
+
+    @Override
+    protected boolean idIsGenerated() {
+        return false;
+    }
+
+    @Override
+    protected SimpleEntity newEntityInstance() {
+        return new SimpleNonGeneratedIdEntity();
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdDelete.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdInsert.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdInsert.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdInsert.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdInsert.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleEntity;
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleNonGeneratedIdEntity;
+
+public class TestNonGeneratedIdInsert extends AbstractInsertTest {
+
+    @Override
+    protected final Class<? extends SimpleEntity> getEntityType() {
+        return SimpleNonGeneratedIdEntity.class;
+    }
+
+    @Override
+    protected boolean idIsGenerated() {
+        return false;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdInsert.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdUpdate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdUpdate.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdUpdate.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdUpdate.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleEntity;
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleNonGeneratedIdEntity;
+
+public class TestNonGeneratedIdUpdate extends AbstractUpdateTest {
+
+    @Override
+    protected Class<? extends SimpleEntity> getEntityType() {
+        return SimpleNonGeneratedIdEntity.class;
+    }
+
+    @Override
+    protected boolean idIsGenerated() {
+        return false;
+    }
+
+    @Override
+    protected SimpleEntity newEntityInstance() {
+        return new SimpleNonGeneratedIdEntity();
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestNonGeneratedIdUpdate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdDelete.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdDelete.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdDelete.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdDelete.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleEntity;
+import org.apache.openjpa.jdbc.writebehind.entities.
+    SimpleTableGeneratedIdEntity;
+
+public class TestTableGeneratedIdDelete extends AbstractDeleteTest {
+
+    @Override
+    protected Class<? extends SimpleEntity> getEntityType() {
+        return SimpleTableGeneratedIdEntity.class;
+    }
+
+    @Override
+    protected boolean idIsGenerated() {
+        return true;
+    }
+
+    @Override
+    protected SimpleEntity newEntityInstance() {
+        return new SimpleTableGeneratedIdEntity();
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdDelete.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdUpdate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdUpdate.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdUpdate.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdUpdate.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleEntity;
+import org.apache.openjpa.jdbc.writebehind.entities.
+    SimpleTableGeneratedIdEntity;
+
+public class TestTableGeneratedIdUpdate extends AbstractUpdateTest {
+    @Override
+    protected Class<? extends SimpleEntity> getEntityType() {
+        return SimpleTableGeneratedIdEntity.class;
+    }
+
+    @Override
+    protected boolean idIsGenerated() {
+        return true;
+    }
+
+    @Override
+    protected SimpleEntity newEntityInstance() {
+        return new SimpleTableGeneratedIdEntity();
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedIdUpdate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedInsert.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedInsert.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedInsert.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedInsert.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.crud;
+
+import org.apache.openjpa.jdbc.writebehind.entities.SimpleEntity;
+import org.apache.openjpa.jdbc.writebehind.entities.
+    SimpleTableGeneratedIdEntity;
+
+public class TestTableGeneratedInsert extends AbstractInsertTest {
+
+    @Override
+    protected final Class<? extends SimpleEntity> getEntityType() {
+        return SimpleTableGeneratedIdEntity.class;
+    }
+
+    @Override
+    protected boolean idIsGenerated() {
+        return true;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/crud/TestTableGeneratedInsert.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/AbstractSimpleEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/AbstractSimpleEntity.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/AbstractSimpleEntity.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/AbstractSimpleEntity.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.entities;
+
+import javax.persistence.MappedSuperclass;
+import javax.persistence.Version;
+
+
+@MappedSuperclass
+public abstract class AbstractSimpleEntity implements SimpleEntity {
+    @Version
+    private int version;
+    private String forename;
+    private String surname;
+
+    public int getVersion() {
+        return version;
+    }
+
+    public void setVersion(int version) {
+        this.version = version;
+    }
+
+    public String getSurname() {
+        return surname;
+    }
+
+    public void setSurname(String surname) {
+        this.surname = surname;
+    }
+
+    public String getForename() {
+        return forename;
+    }
+
+    public void setForename(String name) {
+        this.forename = name;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/AbstractSimpleEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleDatabaseGeneratedIdEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleDatabaseGeneratedIdEntity.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleDatabaseGeneratedIdEntity.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleDatabaseGeneratedIdEntity.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.entities;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+
+@Entity
+public class SimpleDatabaseGeneratedIdEntity extends AbstractSimpleEntity
+    implements SimpleEntity {
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private int id;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleDatabaseGeneratedIdEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleEntity.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleEntity.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleEntity.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.entities;
+
+public interface SimpleEntity {
+    public int getId();
+
+    public void setId(int id);
+
+    public int getVersion();
+
+    public void setVersion(int version);
+
+    public String getForename();
+
+    public void setForename(String name);
+    
+    public String getSurname();
+
+    public void setSurname(String name);
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleNonGeneratedIdEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleNonGeneratedIdEntity.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleNonGeneratedIdEntity.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleNonGeneratedIdEntity.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.entities;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+
+@Entity
+public class SimpleNonGeneratedIdEntity extends AbstractSimpleEntity implements
+    SimpleEntity {
+    @Id
+    private int id;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleNonGeneratedIdEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleTableGeneratedIdEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleTableGeneratedIdEntity.java?rev=791628&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleTableGeneratedIdEntity.java
(added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleTableGeneratedIdEntity.java
Mon Jul  6 22:09:32 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.openjpa.jdbc.writebehind.entities;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+
+@Entity
+public class SimpleTableGeneratedIdEntity extends AbstractSimpleEntity
+    implements SimpleEntity {
+    @Id
+    @GeneratedValue
+    private int id;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+}

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/writebehind/entities/SimpleTableGeneratedIdEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message