@@ -0,0 +1,2980 @@
+%0A/*%0A * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.%0A */%0A%0Apackage org.jsimpledb.kv.spanner;%0A%0Aimport com.google.cloud.spanner.SpannerOptions;%0A%0Aimport org.jsimpledb.kv.KVDatabase;%0Aimport org.jsimpledb.kv.KVTransaction;%0Aimport org.jsimpledb.kv.test.KVTestSupport;%0Aimport org.jsimpledb.util.ByteUtil;%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.BeforeClass;%0Aimport org.testng.annotations.Optional;%0Aimport org.testng.annotations.Parameters;%0Aimport org.testng.annotations.Test;%0A%0Apublic class DeleteTest extends KVTestSupport %7B%0A%0A    private SpannerKVDatabase db;%0A%0A    @BeforeClass(groups = %22configure%22)%0A    @Parameters(%7B %22spannerProject%22, %22spannerInstance%22 %7D)%0A    public void setSpannerConfig(@Optional String project, String instance) throws Exception %7B%0A        if (instance != null) %7B%0A            this.db = new SpannerKVDatabase();%0A            final SpannerOptions.Builder builder = SpannerOptions.newBuilder();%0A            if (project != null)%0A                builder.setProjectId(project);%0A            this.db.setSpannerOptions(builder.build());%0A            this.db.setInstanceId(instance);%0A        %7D%0A    %7D%0A%0A    @Test%0A    protected void testDeleteToInfinity() throws Exception %7B%0A        this.db.start();%0A        try %7B%0A%0A            final byte%5B%5D key1 = new byte%5B%5D %7B (byte)0x11 %7D;%0A            final byte%5B%5D val1 = new byte%5B%5D %7B (byte)0xaa %7D;%0A            final byte%5B%5D key2 = new byte%5B%5D %7B (byte)0x22 %7D;%0A            final byte%5B%5D val2 = new byte%5B%5D %7B (byte)0xbb %7D;%0A%0A            // Populate DB%0A            KVTransaction tx = this.db.createTransaction();%0A            try %7B%0A                tx.removeRange(new byte%5B0%5D, null);%0A                tx.put(key1, val1);%0A                tx.put(key2, val2);%0A                tx.commit();%0A            %7D finally %7B%0A                tx.rollback();%0A            %7D%0A%0A            // Display db%0A            this.show(%22initial content%22);%0A%0A            // Delete to infinity%0A            tx = this.db.createTransaction();%0A            try %7B%0A                tx.removeRange(ByteUtil.getNextKey(key1), null);%0A                tx.commit();%0A            %7D finally %7B%0A                tx.rollback();%0A            %7D%0A%0A            // Verify second key is gone%0A            tx = this.db.createTransaction();%0A            try %7B%0A                this.show(%22after remove%22);%0A                Assert.assertNull(tx.get(key2));%0A                tx.commit();%0A            %7D finally %7B%0A                tx.rollback();%0A            %7D%0A%0A        %7D finally %7B%0A            this.db.stop();%0A        %7D%0A    %7D%0A%0A    private void show(String label) throws Exception %7B%0A        this.log.info(%22Spanner content (%22 + label + %22):%22);%0A        KVTransaction tx = this.db.createTransaction();%0A        try %7B%0A            this.show(tx, label);%0A            tx.commit();%0A        %7D finally %7B%0A            tx.rollback();%0A        %7D%0A    %7D%0A%0A    private void show(KVTransaction tx, String label) throws Exception %7B%0A        final Exception e = this.showKV(tx, label);%0A        if (e != null)%0A            throw e;%0A    %7D%0A%7D%0A%0A

Add Google Spanner unit test.