@@ -0,0 +1,2472 @@
+/*%0A * Copyright 2013 Google Inc. All Rights Reserved.%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.appengine.tck.datastore;%0A%0Aimport java.util.Collections;%0A%0Aimport com.google.appengine.api.datastore.DatastoreService;%0Aimport com.google.appengine.api.datastore.DatastoreServiceConfig;%0Aimport com.google.appengine.api.datastore.DatastoreServiceFactory;%0Aimport com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.api.datastore.ImplicitTransactionManagementPolicy;%0Aimport com.google.appengine.api.datastore.Key;%0Aimport com.google.appengine.api.datastore.Transaction;%0Aimport org.jboss.arquillian.junit.Arquillian;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0A/**%0A * Test AUTO tx policy.%0A *%0A * @author %3Ca href=%22mailto:ales.justin@jboss.org%22%3EAles Justin%3C/a%3E%0A */%0A@RunWith(Arquillian.class)%0Apublic class TxPolicyTest extends DatastoreTestBase %7B%0A    @Test%0A    public void testAutoPolicy() throws Exception %7B%0A        DatastoreServiceConfig config = DatastoreServiceConfig.Builder.withImplicitTransactionManagementPolicy(ImplicitTransactionManagementPolicy.AUTO);%0A        DatastoreService ds = DatastoreServiceFactory.getDatastoreService(config);%0A%0A        Key k1 = null;%0A        Transaction tx = ds.beginTransaction();%0A        try %7B%0A            // this one should be part of auto Tx%0A            k1 = ds.put(new Entity(%22PutAutoTx%22));%0A        %7D finally %7B%0A            tx.rollback();%0A        %7D%0A%0A        Assert.assertTrue(ds.get(Collections.singleton(k1)).isEmpty());%0A%0A        k1 = ds.put(new Entity(%22DeleteAutoTx%22));%0A        try %7B%0A            Assert.assertNotNull(ds.get(k1));%0A%0A            tx = ds.beginTransaction();%0A            try %7B%0A                // this one should be part of auto Tx%0A                ds.delete(k1);%0A            %7D finally %7B%0A                tx.rollback();%0A            %7D%0A%0A            Assert.assertNotNull(ds.get(k1));%0A        %7D finally %7B%0A            ds.delete(k1);%0A        %7D%0A    %7D%0A%7D%0A

Add AUTO tx policy test.