isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098941 [4/8] - in /incubator/isis/trunk/runtimes/dflt/objectstores: nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/ nosql/src/main/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/ nosql/src/main/java/org/a...
Date Tue, 03 May 2011 06:52:55 GMT
Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommandTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommandTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommandTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/WriteObjectCommandTest.java Tue May  3 06:52:51 2011
@@ -17,27 +17,20 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.nosql;
 
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.version.SerialNumberVersion;
+import org.apache.isis.core.metamodel.adapter.version.Version;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.objectstores.dflt.testsystem.TestProxySystemII;
+import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SerialOid;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.junit.Before;
 import org.junit.Test;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.KeyCreator;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.NoSqlCommandContext;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.StateWriter;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.VersionCreator;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.WriteObjectCommand;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.version.SerialNumberVersion;
-import org.apache.isis.core.metamodel.adapter.version.Version;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SerialOid;
-import org.apache.isis.runtimes.dflt.objectstores.dflt.testsystem.TestProxySystemII;
-
 
 public class WriteObjectCommandTest {
     private TrialObjects testObjects;
@@ -55,146 +48,147 @@ public class WriteObjectCommandTest {
     @Before
     public void setup() {
         Logger.getRootLogger().setLevel(Level.OFF);
-        TestProxySystemII system = new TestProxySystemII();
+        final TestProxySystemII system = new TestProxySystemII();
         system.init();
 
         testObjects = new TrialObjects();
-        
-        ExampleValuePojo pojo1 = new ExampleValuePojo();
+
+        final ExampleValuePojo pojo1 = new ExampleValuePojo();
         pojo1.setName("Fred Smith");
         pojo1.setSize(108);
         SerialOid oid = SerialOid.createPersistent(3);
         object1 = testObjects.createAdapter(pojo1, oid);
         specification = object1.getSpecification();
-        
-        ExampleValuePojo pojo2 = new ExampleValuePojo();
+
+        final ExampleValuePojo pojo2 = new ExampleValuePojo();
         pojo2.setName("John Brown");
         oid = SerialOid.createPersistent(4);
         object2 = testObjects.createAdapter(pojo2, oid);
-        
-        ExampleReferencePojo pojo3 = new ExampleReferencePojo();
+
+        final ExampleReferencePojo pojo3 = new ExampleReferencePojo();
         pojo3.setReference1(pojo1);
         oid = SerialOid.createPersistent(5);
         object3 = testObjects.createAdapter(pojo3, oid);
-        
-        ExampleCollectionPojo pojo4 = new ExampleCollectionPojo();
+
+        final ExampleCollectionPojo pojo4 = new ExampleCollectionPojo();
         pojo4.getHomogenousCollection().add(pojo1);
         pojo4.getHomogenousCollection().add(pojo2);
         oid = SerialOid.createPersistent(6);
         object4 = testObjects.createAdapter(pojo4, oid);
-        
+
         context = new Mockery();
         writer = context.mock(StateWriter.class);
         commandContext = context.mock(NoSqlCommandContext.class);
         keyCreator = context.mock(KeyCreator.class);
-        versionCreator = context.mock(VersionCreator.class);;
+        versionCreator = context.mock(VersionCreator.class);
+        ;
 
-        
         final Version version = new SerialNumberVersion(2, "username", null);
-       
-        context.checking(new Expectations(){{
-            one(versionCreator).newVersion("tester");
-            will(returnValue(version));
-            one(versionCreator).versionString(version);
-            will(returnValue("2"));
-            one(versionCreator).timeString(version);
-            will(returnValue("1057"));
-        }});
+
+        context.checking(new Expectations() {
+            {
+                one(versionCreator).newVersion("tester");
+                will(returnValue(version));
+                one(versionCreator).versionString(version);
+                will(returnValue("2"));
+                one(versionCreator).timeString(version);
+                will(returnValue("1057"));
+            }
+        });
 
     }
-    
+
     @Test
     public void objectWithValues() throws Exception {
-        
-        
-        context.checking(new Expectations(){{
-            one(commandContext).createStateWriter(specification.getFullIdentifier());
-            will(returnValue(writer));
-            
-            one(keyCreator).key(SerialOid.createPersistent(3));
-            will(returnValue("3"));
-
-            one(writer).writeId("3");
-            one(writer).writeType(specification.getFullIdentifier());
-            one(writer).writeField("name", "Fred Smith");
-            one(writer).writeField("size", "108");
-            one(writer).writeField("nullable", null);
-            one(writer).writeVersion(null, "2");
-            one(writer).writeUser("username");
-            one(writer).writeTime("1057");
-            
-            one(commandContext).insert(writer);
-            
-        }});
-        
+
+        context.checking(new Expectations() {
+            {
+                one(commandContext).createStateWriter(specification.getFullIdentifier());
+                will(returnValue(writer));
+
+                one(keyCreator).key(SerialOid.createPersistent(3));
+                will(returnValue("3"));
+
+                one(writer).writeId("3");
+                one(writer).writeType(specification.getFullIdentifier());
+                one(writer).writeField("name", "Fred Smith");
+                one(writer).writeField("size", "108");
+                one(writer).writeField("nullable", null);
+                one(writer).writeVersion(null, "2");
+                one(writer).writeUser("username");
+                one(writer).writeTime("1057");
+
+                one(commandContext).insert(writer);
+
+            }
+        });
+
         new WriteObjectCommand(false, keyCreator, versionCreator, object1).execute(commandContext);
-        
+
         context.assertIsSatisfied();
     }
-    
-  
+
     @Test
     public void objectWithReferences() throws Exception {
-     
-        context.checking(new Expectations(){{
-            one(commandContext).createStateWriter(object3.getSpecification().getFullIdentifier());
-            will(returnValue(writer));
-            
-            one(keyCreator).key(SerialOid.createPersistent(5));
-            will(returnValue("5"));
-            one(keyCreator).reference(object1);
-            will(returnValue("ref@3"));
-            
-            one(writer).writeId("5");
-            one(writer).writeType(object3.getSpecification().getFullIdentifier());
-            one(writer).writeField("reference1", "ref@3");
-            one(writer).writeField("reference2", null);
-            one(writer).writeVersion(null, "2");
-            one(writer).writeUser("username");
-            one(writer).writeTime("1057");
-            
-            one(commandContext).insert(writer);
-        }});
-        
+
+        context.checking(new Expectations() {
+            {
+                one(commandContext).createStateWriter(object3.getSpecification().getFullIdentifier());
+                will(returnValue(writer));
+
+                one(keyCreator).key(SerialOid.createPersistent(5));
+                will(returnValue("5"));
+                one(keyCreator).reference(object1);
+                will(returnValue("ref@3"));
+
+                one(writer).writeId("5");
+                one(writer).writeType(object3.getSpecification().getFullIdentifier());
+                one(writer).writeField("reference1", "ref@3");
+                one(writer).writeField("reference2", null);
+                one(writer).writeVersion(null, "2");
+                one(writer).writeUser("username");
+                one(writer).writeTime("1057");
+
+                one(commandContext).insert(writer);
+            }
+        });
+
         new WriteObjectCommand(false, keyCreator, versionCreator, object3).execute(commandContext);
-        
+
         context.assertIsSatisfied();
     }
 
-
-
     @Test
     public void objectWithCollections() throws Exception {
-        
-        context.checking(new Expectations(){{
-            one(commandContext).createStateWriter(object4.getSpecification().getFullIdentifier());
-            will(returnValue(writer));
-
-            one(keyCreator).key(SerialOid.createPersistent(6));
-            will(returnValue("6"));
-            one(writer).writeId("6");
-            one(writer).writeType(object4.getSpecification().getFullIdentifier());
-
-            one(keyCreator).reference(object1);
-            will(returnValue("ref@3"));
-            one(keyCreator).reference(object2);
-            will(returnValue("ref@4"));
-            
-            one(writer).writeField("homogenousCollection", "ref@3|ref@4|");
-
-            one(writer).writeVersion(null, "2");
-            one(writer).writeUser("username");
-            one(writer).writeTime("1057");
-            
-            one(commandContext).insert(writer);
-        }});
-        
+
+        context.checking(new Expectations() {
+            {
+                one(commandContext).createStateWriter(object4.getSpecification().getFullIdentifier());
+                will(returnValue(writer));
+
+                one(keyCreator).key(SerialOid.createPersistent(6));
+                will(returnValue("6"));
+                one(writer).writeId("6");
+                one(writer).writeType(object4.getSpecification().getFullIdentifier());
+
+                one(keyCreator).reference(object1);
+                will(returnValue("ref@3"));
+                one(keyCreator).reference(object2);
+                will(returnValue("ref@4"));
+
+                one(writer).writeField("homogenousCollection", "ref@3|ref@4|");
+
+                one(writer).writeVersion(null, "2");
+                one(writer).writeUser("username");
+                one(writer).writeTime("1057");
+
+                one(commandContext).insert(writer);
+            }
+        });
+
         new WriteObjectCommand(false, keyCreator, versionCreator, object4).execute(commandContext);
-        
+
         context.assertIsSatisfied();
     }
 
-    
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/DataReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/DataReaderTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/DataReaderTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/DataReaderTest.java Tue May  3 06:52:51 2011
@@ -17,25 +17,20 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.nosql.file.server;
 
+import static org.hamcrest.Matchers.startsWith;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileWriter;
 
-import org.apache.isis.runtimes.dflt.objectstores.nosql.file.server.DataReader;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.file.server.FileServerException;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.file.server.Util;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import static org.hamcrest.Matchers.startsWith;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-
 public class DataReaderTest {
 
     private DataReader reader;
@@ -46,46 +41,44 @@ public class DataReaderTest {
         Util.ensureDirectoryExists();
         new File("target/test/type").mkdir();
     }
-    
+
     @Test
     public void noFileCausesException() throws Exception {
         try {
             new DataReader("type", "noexistant");
             fail();
-        } catch (FileNotFoundException expected) {
+        } catch (final FileNotFoundException expected) {
         }
     }
 
     @Test
     public void noDataRead() throws Exception {
-        FileWriter writer = new FileWriter("target/test/type/0013.data");
+        final FileWriter writer = new FileWriter("target/test/type/0013.data");
         writer.write("");
         writer.close();
-        
+
         try {
             reader = new DataReader("type", "0013");
             fail();
-        } catch (FileServerException expected) {
+        } catch (final FileServerException expected) {
             assertThat(expected.getMessage(), startsWith("No data in file:"));
         }
 
     }
-    
+
     @Test
     public void readIdAndVersion() throws Exception {
-        FileWriter writer = new FileWriter("target/test/type/0012.data");
+        final FileWriter writer = new FileWriter("target/test/type/0012.data");
         writer.write("class.type 0012 17\n{data}");
         writer.close();
-        
+
         reader = new DataReader("type", "0012");
-        
+
         assertEquals("0012", reader.getId());
         assertEquals("17", reader.getVersion());
-        
-        String data = reader.getData();
+
+        final String data = reader.getData();
         assertEquals("{data}", data);
         reader.close();
     }
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/DataWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/DataWriterTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/DataWriterTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/DataWriterTest.java Tue May  3 06:52:51 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.nosql.file.server;
 
 import java.io.BufferedReader;
@@ -39,7 +38,6 @@ public class DataWriterTest {
     private static final String FULLY_QUALIFIED_CLASSNAME_2 = "org.domain.Class2";
     private DataWriter writer;
 
-
     @Before
     public void setUp() throws Exception {
         Util.setDirectory(TARGET_DIRECTORY, "services", "logs");
@@ -52,68 +50,57 @@ public class DataWriterTest {
             writer.close();
         }
     }
-    
+
     @Test
     public void testWriteData() throws Exception {
-        File file = new File(TARGET_DIRECTORY +
-        		FULLY_QUALIFIED_CLASSNAME +
-        		"/1030.data");
+        final File file = new File(TARGET_DIRECTORY + FULLY_QUALIFIED_CLASSNAME + "/1030.data");
         file.mkdirs();
         file.createNewFile();
         Assert.assertTrue(file.exists());
-        
-        List<FileContent> files = new ArrayList<FileContent>();
-        files.add(new FileContent('I', "1023", "1", "2",  FULLY_QUALIFIED_CLASSNAME, "{data1}"));
+
+        final List<FileContent> files = new ArrayList<FileContent>();
+        files.add(new FileContent('I', "1023", "1", "2", FULLY_QUALIFIED_CLASSNAME, "{data1}"));
         files.add(new FileContent('U', "1024", "21", "22", FULLY_QUALIFIED_CLASSNAME, "{data2}"));
         files.add(new FileContent('D', "1030", "66", "", FULLY_QUALIFIED_CLASSNAME, ""));
-        DataWriter writer = new DataWriter(files);
+        final DataWriter writer = new DataWriter(files);
         writer.writeData();
-        
-        BufferedReader reader = new BufferedReader(new FileReader(TARGET_DIRECTORY +
-        		FULLY_QUALIFIED_CLASSNAME +
-        		"/1023.data"));
+
+        BufferedReader reader =
+            new BufferedReader(new FileReader(TARGET_DIRECTORY + FULLY_QUALIFIED_CLASSNAME + "/1023.data"));
         Assert.assertEquals("org.domain.Class 1023 2", reader.readLine());
         Assert.assertEquals("{data1}", reader.readLine());
 
-        reader = new BufferedReader(new FileReader(TARGET_DIRECTORY +
-        		FULLY_QUALIFIED_CLASSNAME +
-        		"/1024.data"));
-        Assert.assertEquals(FULLY_QUALIFIED_CLASSNAME +
-        		" 1024 22", reader.readLine());
+        reader = new BufferedReader(new FileReader(TARGET_DIRECTORY + FULLY_QUALIFIED_CLASSNAME + "/1024.data"));
+        Assert.assertEquals(FULLY_QUALIFIED_CLASSNAME + " 1024 22", reader.readLine());
         Assert.assertEquals("{data2}", reader.readLine());
-        
+
         Assert.assertFalse("file still exists", file.exists());
     }
 
-
     @Test
     public void createsTypeDirectory() throws Exception {
-        String dir = TARGET_DIRECTORY +
-        		FULLY_QUALIFIED_CLASSNAME_2;
-        File file = deleteDirectory(dir);
+        final String dir = TARGET_DIRECTORY + FULLY_QUALIFIED_CLASSNAME_2;
+        final File file = deleteDirectory(dir);
         Assert.assertFalse(file.exists());
-        
 
-        List<FileContent> files = new ArrayList<FileContent>();
-        files.add(new FileContent('I', "1023", "1", "2",  FULLY_QUALIFIED_CLASSNAME_2, "{data1}"));
+        final List<FileContent> files = new ArrayList<FileContent>();
+        files.add(new FileContent('I', "1023", "1", "2", FULLY_QUALIFIED_CLASSNAME_2, "{data1}"));
         writer = new DataWriter(files);
         writer.writeData();
-        
+
         Assert.assertTrue(file.exists());
     }
 
-    protected File deleteDirectory(String dir) {
-        File file = new File(dir);
-        if(file.exists()) {
-            for( File f: file.listFiles()) {
+    protected File deleteDirectory(final String dir) {
+        final File file = new File(dir);
+        if (file.exists()) {
+            for (final File f : file.listFiles()) {
                 f.delete();
             }
             file.delete();
-            
+
         }
         return file;
     }
 
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/FileServerTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/FileServerTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/FileServerTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/FileServerTest.java Tue May  3 06:52:51 2011
@@ -19,17 +19,6 @@
 
 package org.apache.isis.runtimes.dflt.objectstores.nosql.file.server;
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.InputStream;
-
-import org.apache.isis.core.commons.lang.IoUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
 import static org.apache.isis.core.commons.lang.StringUtils.lineSeparated;
 import static org.apache.isis.core.commons.matchers.IsisMatchers.existsAndNotEmpty;
 import static org.hamcrest.Matchers.containsString;
@@ -43,6 +32,17 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.InputStream;
+
+import org.apache.isis.core.commons.lang.IoUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
 public class FileServerTest {
     private FileServerProcessor server;
     private File logFile1;
@@ -67,8 +67,8 @@ public class FileServerTest {
         out = new ByteArrayOutputStream();
     }
 
-    private static File recreateFile(String parent, String child) {
-        File file = new File(parent, child);
+    private static File recreateFile(final String parent, final String child) {
+        final File file = new File(parent, child);
         file.delete();
         assertFalse(file.exists());
         return file;
@@ -83,9 +83,9 @@ public class FileServerTest {
 
     @Test
     public void cantReadOrWriteAfterShutdown() throws Exception {
-        InputStream in =  IoUtils.asUtf8ByteStream("R[org.domain.Class 1025]\n");
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        ServerConnection connection = new ServerConnection(in, out);
+        final InputStream in = IoUtils.asUtf8ByteStream("R[org.domain.Class 1025]\n");
+        final ByteArrayOutputStream out = new ByteArrayOutputStream();
+        final ServerConnection connection = new ServerConnection(in, out);
 
         server.shutdown();
         server.process(connection);
@@ -94,8 +94,8 @@ public class FileServerTest {
 
     @Test
     public void writeAbortedAsDataNotComplete() throws Exception {
-        InputStream in = IoUtils.asUtf8ByteStream("W\nIorg.domain.Class 1025 null 1  \n{da");
-        ServerConnection connection = new ServerConnection(in, out);
+        final InputStream in = IoUtils.asUtf8ByteStream("W\nIorg.domain.Class 1025 null 1  \n{da");
+        final ServerConnection connection = new ServerConnection(in, out);
         server.process(connection);
 
         assertThat(out.toString(), is(containsString("stream ended prematurely while reading data, aborting request")));
@@ -103,17 +103,18 @@ public class FileServerTest {
 
     @Test
     public void writeAbortsIfMissingNextDataBlock() throws Exception {
-        InputStream in = IoUtils.asUtf8ByteStream("W\nIorg.domain.Class 1025 null 1  \n{data1}\n\n");
-        ServerConnection connection = new ServerConnection(in, out);
+        final InputStream in = IoUtils.asUtf8ByteStream("W\nIorg.domain.Class 1025 null 1  \n{data1}\n\n");
+        final ServerConnection connection = new ServerConnection(in, out);
         server.process(connection);
-        
-        assertThat(out.toString(), is(containsString("stream ended prematurely while reading header, aborting request")));
+
+        assertThat(out.toString(),
+            is(containsString("stream ended prematurely while reading header, aborting request")));
     }
 
     @Test
     public void writeAbortedAsHeaderNotComplete() throws Exception {
-        InputStream in = IoUtils.asUtf8ByteStream("W\nIorg.domain.Class 1025");
-        ServerConnection connection = new ServerConnection(in, out);
+        final InputStream in = IoUtils.asUtf8ByteStream("W\nIorg.domain.Class 1025");
+        final ServerConnection connection = new ServerConnection(in, out);
         server.process(connection);
 
         assertThat(out.toString(), is(containsString("invalid header string, aborting request")));
@@ -121,18 +122,19 @@ public class FileServerTest {
 
     @Test
     public void writeCreatesFilesUsingDataWriter() throws Exception {
-        File file1 = new File("target/test/org.domain.Class", "1025.data");
-        File file2 = new File("target/test/org.domain.Class", "1026.data");
+        final File file1 = new File("target/test/org.domain.Class", "1025.data");
+        final File file2 = new File("target/test/org.domain.Class", "1026.data");
         file1.delete();
         file2.delete();
         assertFalse(file1.exists());
         assertFalse(file2.exists());
 
-        InputStream in =
-            IoUtils.asUtf8ByteStream("W\nIorg.domain.Class 1025 null 1  \n{data1}\n\nIorg.domain.Class 1026 null 1\n{data2}\n\n\n");
-        ServerConnection connection = new ServerConnection(in, out);
+        final InputStream in =
+            IoUtils
+                .asUtf8ByteStream("W\nIorg.domain.Class 1025 null 1  \n{data1}\n\nIorg.domain.Class 1026 null 1\n{data2}\n\n\n");
+        final ServerConnection connection = new ServerConnection(in, out);
         server.process(connection);
-        
+
         assertThat(out.toString(), is(equalTo(lineSeparated("ok\n"))));
         assertThat(file1, existsAndNotEmpty());
         assertThat(file2, existsAndNotEmpty());
@@ -140,69 +142,71 @@ public class FileServerTest {
 
     @Test
     public void writeUpdatesFilesUsingDataWriter() throws Exception {
-        File file2 = new File("target/test/org.domain.Class", "1026.data");
-        FileWriter fileWriter = new FileWriter(file2);
-        String originalData = "org.domain.Class 1026 21 {}";
+        final File file2 = new File("target/test/org.domain.Class", "1026.data");
+        final FileWriter fileWriter = new FileWriter(file2);
+        final String originalData = "org.domain.Class 1026 21 {}";
         fileWriter.write(originalData);
         fileWriter.close();
 
-        ServerConnection connection =
+        final ServerConnection connection =
             new ServerConnection(IoUtils.asUtf8ByteStream("W\nUorg.domain.Class 1026 21 22 \n{data2}\n\n\n"), out);
         server.process(connection);
-        
+
         assertThat(out.toString(), is(equalTo(lineSeparated("ok\n"))));
-        assertThat(file2.length(), is(greaterThan((long)originalData.length())));
+        assertThat(file2.length(), is(greaterThan((long) originalData.length())));
     }
 
     @Test
     public void writeUpdateFailsWhenVersionsDontMatch() throws Exception {
-        File file2 = new File("target/test/org.domain.Class", "1026.data");
-        FileWriter fileWriter = new FileWriter(file2);
-        String originalData = "org.domain.Class 1026 21\n{datax}\n\n\n***";
+        final File file2 = new File("target/test/org.domain.Class", "1026.data");
+        final FileWriter fileWriter = new FileWriter(file2);
+        final String originalData = "org.domain.Class 1026 21\n{datax}\n\n\n***";
         fileWriter.write(originalData);
         fileWriter.close();
 
-        ServerConnection connection =
+        final ServerConnection connection =
             new ServerConnection(IoUtils.asUtf8ByteStream("W\nUorg.domain.Class 1026 19 21 \n{data2}\n\n\n"), out);
         server.process(connection);
-        
-        assertThat(out.toString(), is(equalTo(lineSeparated("error\nmismatch between FileContent version (19) and DataReader version (21)\n"))));
+
+        assertThat(
+            out.toString(),
+            is(equalTo(lineSeparated("error\nmismatch between FileContent version (19) and DataReader version (21)\n"))));
     }
 
     @Test
     public void writeCreatesLogFile() throws Exception {
-        ServerConnection connection =
+        final ServerConnection connection =
             new ServerConnection(IoUtils.asUtf8ByteStream("W\nIorg.domain.Class 1025 6 7\n{data1}\n\n\n"), out);
         server.process(connection);
 
         assertThat(out.toString(), is(equalTo(lineSeparated("ok\n"))));
-        
+
         assertThat(logFile1, existsAndNotEmpty());
         assertThat(logFile2, not(existsAndNotEmpty()));
     }
 
     @Test
     public void readNonExistingFileThrowsException() throws Exception {
-        File file1 = new File("target/test/org.domain.Class", "2020.data");
+        final File file1 = new File("target/test/org.domain.Class", "2020.data");
         file1.delete();
-        ServerConnection connection = new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2020\n\n"), out);
+        final ServerConnection connection =
+            new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2020\n\n"), out);
         server.process(connection);
 
-        String string = out.toString();
+        final String string = out.toString();
         assertThat(string, startsWith("not-found"));
         assertThat(string, containsString("File not found for org.domain.Class/2020"));
     }
 
-
     @Test
     public void aTestTheTests() throws Exception {
-        File dir = new File("target/test/org.domain.Class");
+        final File dir = new File("target/test/org.domain.Class");
         assertTrue(dir.exists());
-        
-        File file1 = new File("target/test/org.domain.Class", "2025.data");
+
+        final File file1 = new File("target/test/org.domain.Class", "2025.data");
         assertTrue(file1.getParentFile().exists());
-        
-        FileWriter fileWriter = new FileWriter(file1);
+
+        final FileWriter fileWriter = new FileWriter(file1);
         assertNotNull(fileWriter);
         fileWriter.write("data");
         fileWriter.close();
@@ -210,49 +214,53 @@ public class FileServerTest {
 
     @Test
     public void copyOfReadTest() throws Exception {
-        File file1 = new File("target/test/org.domain.Class", "2025.data");
-        FileWriter fileWriter = new FileWriter(file1);
+        final File file1 = new File("target/test/org.domain.Class", "2025.data");
+        final FileWriter fileWriter = new FileWriter(file1);
         fileWriter.write("type 1025 1\n{data1}");
         fileWriter.close();
 
-        ServerConnection connection = new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2025\n\n"), out);
+        final ServerConnection connection =
+            new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2025\n\n"), out);
         server.process(connection);
-        
+
         assertThat(out.toString(), is(equalTo(lineSeparated("ok\n{data1}\n"))));
     }
 
     @Test
     public void ReadFailIfEndsEarly() throws Exception {
-        ServerConnection connection = new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2025\n"), out);
+        final ServerConnection connection =
+            new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2025\n"), out);
         server.process(connection);
-        
-        assertThat(out.toString(), is(containsString("stream ended prematurely while reading end of command, aborting request")));
+
+        assertThat(out.toString(),
+            is(containsString("stream ended prematurely while reading end of command, aborting request")));
     }
 
     @Test
     public void LookReadRenamed() throws Exception {
-        File file1 = new File("target/test/org.domain.Class", "2025.data");
-        FileWriter fileWriter = new FileWriter(file1);
+        final File file1 = new File("target/test/org.domain.Class", "2025.data");
+        final FileWriter fileWriter = new FileWriter(file1);
         fileWriter.write("type 1025 1\n{data1}");
         fileWriter.close();
 
-        ServerConnection connection = new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2025\n\n"), out);
+        final ServerConnection connection =
+            new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2025\n\n"), out);
         server.process(connection);
-        
+
         assertThat(out.toString(), is(equalTo(lineSeparated("ok\n{data1}\n"))));
     }
 
-
     @Test
     public void read2() throws Exception {
-        File file1 = new File("target/test/org.domain.Class", "2025.data");
-        FileWriter fileWriter = new FileWriter(file1);
+        final File file1 = new File("target/test/org.domain.Class", "2025.data");
+        final FileWriter fileWriter = new FileWriter(file1);
         fileWriter.write("type 1025 1\n{data1}");
         fileWriter.close();
 
-        ServerConnection connection = new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2025\n\n"), out);
+        final ServerConnection connection =
+            new ServerConnection(IoUtils.asUtf8ByteStream("Rorg.domain.Class 2025\n\n"), out);
         server.process(connection);
-        
+
         assertThat(out.toString(), is(equalTo(lineSeparated("ok\n{data1}\n"))));
     }
 

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/LockManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/LockManagerTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/LockManagerTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/LockManagerTest.java Tue May  3 06:52:51 2011
@@ -17,16 +17,14 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.nosql.file.server;
 
-import org.apache.isis.runtimes.dflt.objectstores.nosql.file.server.LockManager;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.junit.Assert.*;
-
-
 public class LockManagerTest {
 
     private LockManager manager;
@@ -35,11 +33,11 @@ public class LockManagerTest {
     public void setUp() throws Exception {
         manager = new LockManager();
     }
-    
+
     @Test
     public void readDoesNotBlockReads() throws Exception {
-        Thread tx1 = new Thread();
-        Thread tx2 = new Thread();
+        final Thread tx1 = new Thread();
+        final Thread tx2 = new Thread();
         manager.acquireRead("2", tx1);
         manager.acquireRead("2", tx2);
         manager.release("2", tx1);
@@ -48,13 +46,10 @@ public class LockManagerTest {
 
     @Test
     public void writeAbortsSecondWrite() throws Exception {
-        Thread tx1 = new Thread();
-        Thread tx2 = new Thread();
+        final Thread tx1 = new Thread();
+        final Thread tx2 = new Thread();
         assertTrue(manager.acquireWrite("2", tx1));
         assertFalse(manager.acquireWrite("2", tx2));
     }
-    
 
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/LogWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/LogWriterTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/LogWriterTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/file/server/LogWriterTest.java Tue May  3 06:52:51 2011
@@ -66,8 +66,9 @@ public class LogWriterTest {
 
     @After
     public void tearDown() throws Exception {
-        if (logger != null)
+        if (logger != null) {
             logger.shutdown();
+        }
     }
 
     @Test
@@ -80,7 +81,7 @@ public class LogWriterTest {
     public void logsData() throws Exception {
         logger.log(items);
 
-        BufferedReader reader = new BufferedReader(new FileReader(logFile1));
+        final BufferedReader reader = new BufferedReader(new FileReader(logFile1));
         String line = reader.readLine();
         line = reader.readLine();
         reader.close();

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/DemoMongo.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/DemoMongo.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/DemoMongo.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/DemoMongo.java Tue May  3 06:52:51 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.nosql.mongo;
 
 import java.util.Set;
@@ -28,46 +27,39 @@ import com.mongodb.DBCollection;
 import com.mongodb.Mongo;
 
 public class DemoMongo {
-  //  @Test
+    // @Test
     public void installed() throws Exception {
 
-        Mongo m = new Mongo();
+        final Mongo m = new Mongo();
 
-        for (String s : m.getDatabaseNames()) {
+        for (final String s : m.getDatabaseNames()) {
             System.out.println(s);
         }
 
-        
         /*
-        Mongo m = new Mongo( "localhost" );
-        Mongo m = new Mongo( "localhost" , 27017 );
-*/
+         * Mongo m = new Mongo( "localhost" ); Mongo m = new Mongo( "localhost" , 27017 );
+         */
         m.dropDatabase("mydb");
 
-
         System.out.println("\n...");
-        for (String s : m.getDatabaseNames()) {
+        for (final String s : m.getDatabaseNames()) {
             System.out.println(s);
         }
 
-        
-        DB db = m.getDB( "mydb" );
-/*
-        DBCollection coll = db.getCollection("testCollection1");
-        coll = db.getCollection("testCollection2");
-*/
-          
-        
-        DBCollection coll = db.getCollection("testCollection1");
-        
-        
-        BasicDBObject doc = new BasicDBObject();
+        final DB db = m.getDB("mydb");
+        /*
+         * DBCollection coll = db.getCollection("testCollection1"); coll = db.getCollection("testCollection2");
+         */
+
+        final DBCollection coll = db.getCollection("testCollection1");
+
+        final BasicDBObject doc = new BasicDBObject();
 
         doc.put("name", "MongoDB");
         doc.put("type", "database");
         doc.put("count", 1);
 
-        BasicDBObject info = new BasicDBObject();
+        final BasicDBObject info = new BasicDBObject();
 
         info.put("x", 203);
         info.put("y", 102);
@@ -76,19 +68,11 @@ public class DemoMongo {
 
         coll.insert(doc);
 
-        
-        
-        
-        
-        
-        Set<String> colls = db.getCollectionNames();
+        final Set<String> colls = db.getCollectionNames();
 
-        for (String s : colls) {
+        for (final String s : colls) {
             System.out.println(s);
         }
 
-
     }
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoDbTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoDbTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoDbTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoDbTest.java Tue May  3 06:52:51 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.nosql.mongo;
 
 import static org.hamcrest.Matchers.is;
@@ -27,11 +26,11 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeThat;
 
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.ExampleValuePojo;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.SerialKeyCreator;
 import org.apache.isis.runtimes.dflt.objectstores.nosql.TrialObjects;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SerialOid;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
@@ -43,7 +42,6 @@ import com.mongodb.DB;
 import com.mongodb.DBCollection;
 import com.mongodb.Mongo;
 
-
 public class MongoDbTest {
     private MongoDb db;
     private TrialObjects testObjects;
@@ -51,25 +49,25 @@ public class MongoDbTest {
     private ObjectAdapter object;
     private SerialOid oid;
     private DB testDb;
-    
+
     @Before
     public void setup() throws Exception {
         Logger.getRootLogger().setLevel(Level.OFF);
         testObjects = new TrialObjects();
-        
+
         try {
-            Mongo m = new Mongo();
+            final Mongo m = new Mongo();
             m.dropDatabase("testdb");
             testDb = m.getDB("testdb");
-        } catch (Exception e) {
+        } catch (final Exception e) {
             assumeThat(true, is(false)); // ignore if no MongoDB instance to connect to
             return;
         }
-        
+
         db = new MongoDb("localhost", 0, "testdb", new SerialKeyCreator());
         db.open();
-        
-        ExampleValuePojo pojo = new ExampleValuePojo();
+
+        final ExampleValuePojo pojo = new ExampleValuePojo();
         pojo.setName("Fred Smith");
         oid = SerialOid.createTransient(3);
         object = testObjects.createAdapter(pojo, oid);
@@ -81,24 +79,23 @@ public class MongoDbTest {
     public void newDatabaseContainsNothing() throws Exception {
         assertFalse(db.containsData());
     }
-    
+
     @Test
     public void serialNumberSaved() throws Exception {
         assertEquals(0, db.readSerialNumber());
-       db.writeSerialNumber(1023);
-       assertEquals(1023, db.readSerialNumber());
+        db.writeSerialNumber(1023);
+        assertEquals(1023, db.readSerialNumber());
     }
 
     @Test
     public void hasInstances() throws Exception {
-        String specificationName = specification.getFullIdentifier();
+        final String specificationName = specification.getFullIdentifier();
         assertFalse(db.hasInstances(specificationName));
         db.close();
-        
-        
-        DBCollection instances = testDb.getCollection(specificationName);
+
+        final DBCollection instances = testDb.getCollection(specificationName);
         instances.insert(new BasicDBObject().append("test", "test"));
-        
+
         db.open();
         assertTrue(db.hasInstances(specificationName));
         assertFalse(db.hasInstances("org.xxx.unknown"));
@@ -108,26 +105,24 @@ public class MongoDbTest {
     public void destroyInstance() throws Exception {
         db.close();
 
-        String specificationName = specification.getFullIdentifier();      
-        DBCollection instances = testDb.getCollection(specificationName);
-        BasicDBObject dbObject = new BasicDBObject().append("test", "test");
+        final String specificationName = specification.getFullIdentifier();
+        final DBCollection instances = testDb.getCollection(specificationName);
+        final BasicDBObject dbObject = new BasicDBObject().append("test", "test");
         instances.insert(dbObject);
-        
+
         db.open();
         db.delete(specificationName, dbObject.getString("_id"));
         assertFalse(db.hasInstances(specificationName));
     }
-    
+
     @Test
     public void serviceIds() throws Exception {
         db.addService("one", "123");
         assertEquals("123", db.getService("one"));
     }
-    
+
     @Test
     public void unknownServiceIds() throws Exception {
         assertNull(db.getService("two"));
     }
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoStateReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoStateReaderTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoStateReaderTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoStateReaderTest.java Tue May  3 06:52:51 2011
@@ -45,17 +45,17 @@ public class MongoStateReaderTest {
     public void setup() throws Exception {
         Logger.getRootLogger().setLevel(Level.OFF);
 
-        Mongo m = new Mongo();
+        final Mongo m = new Mongo();
         try {
             m.dropDatabase("mydb");
-        } catch (Exception e) {
+        } catch (final Exception e) {
             assumeThat(true, is(false));// ie ignore test because we've had an exception
             return;
         }
 
         testDb = m.getDB("mydb");
 
-        BasicDBObject object = new BasicDBObject();
+        final BasicDBObject object = new BasicDBObject();
         object.put("_id", "1023");
         object.put("_type", "org.xxx.Class");
         object.put("name", "Fred Smith");
@@ -63,7 +63,7 @@ public class MongoStateReaderTest {
         object.put("null name 2", null);
         object.put("number", "102");
         object.put("null number", "null");
-        DBCollection instances = testDb.getCollection(SPEC_NAME);
+        final DBCollection instances = testDb.getCollection(SPEC_NAME);
         instances.insert(object);
 
         reader = new MongoStateReader(testDb, SPEC_NAME, "1023");

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoStateWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoStateWriterTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoStateWriterTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/MongoStateWriterTest.java Tue May  3 06:52:51 2011
@@ -46,10 +46,10 @@ public class MongoStateWriterTest {
 
         try {
 
-            Mongo m = new Mongo();
+            final Mongo m = new Mongo();
             m.dropDatabase("mydb");
             testDb = m.getDB("mydb");
-        } catch (Exception e) {
+        } catch (final Exception e) {
             assumeThat(true, is(false)); // ie no exceptions
             return;
         }
@@ -61,7 +61,7 @@ public class MongoStateWriterTest {
     public void flushSavesObject() throws Exception {
         writer.flush();
 
-        DBCollection instances = testDb.getCollection(SPEC_NAME);
+        final DBCollection instances = testDb.getCollection(SPEC_NAME);
         assertEquals(1, instances.getCount());
     }
 
@@ -70,7 +70,7 @@ public class MongoStateWriterTest {
         writer.writeField("number", 1023);
         writer.writeField("string", "testing");
 
-        DBCollection instances = testDb.getCollection(SPEC_NAME);
+        final DBCollection instances = testDb.getCollection(SPEC_NAME);
         assertEquals(0, instances.getCount());
     }
 
@@ -79,9 +79,9 @@ public class MongoStateWriterTest {
         writer.writeId("D01");
         writer.flush();
 
-        DBCollection instances = testDb.getCollection(SPEC_NAME);
+        final DBCollection instances = testDb.getCollection(SPEC_NAME);
         assertEquals(1, instances.getCount());
-        DBObject object = instances.findOne();
+        final DBObject object = instances.findOne();
         assertNotNull(object.get("_id"));
         assertEquals("D01", object.get("_id"));
         assertEquals(1, object.keySet().size());
@@ -94,9 +94,9 @@ public class MongoStateWriterTest {
         writer.writeField("string", "testing");
         writer.flush();
 
-        DBCollection instances = testDb.getCollection(SPEC_NAME);
+        final DBCollection instances = testDb.getCollection(SPEC_NAME);
         assertEquals(1, instances.getCount());
-        DBObject object = instances.findOne();
+        final DBObject object = instances.findOne();
         assertEquals(SPEC_NAME, object.get("_type"));
         assertEquals("1023", object.get("number"));
         assertEquals("testing", object.get("string"));
@@ -112,9 +112,9 @@ public class MongoStateWriterTest {
         writer.writeField("string", "testing");
         writer.flush();
 
-        DBCollection instances = testDb.getCollection(SPEC_NAME);
+        final DBCollection instances = testDb.getCollection(SPEC_NAME);
         assertEquals(1, instances.getCount());
-        DBObject object = instances.findOne();
+        final DBObject object = instances.findOne();
         assertEquals(SPEC_NAME, object.get("_type"));
         assertEquals("1023", object.get("number"));
         assertEquals("testing", object.get("string"));

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/ObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/ObjectTest.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/ObjectTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/nosql/src/test/java/org/apache/isis/runtimes/dflt/objectstores/nosql/mongo/ObjectTest.java Tue May  3 06:52:51 2011
@@ -17,22 +17,19 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.nosql.mongo;
 
+import static org.junit.Assert.assertEquals;
 
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.junit.Test;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.ExampleValuePojo;
-import org.apache.isis.runtimes.dflt.objectstores.nosql.TrialObjects;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ResolveState;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.objectstores.nosql.ExampleValuePojo;
+import org.apache.isis.runtimes.dflt.objectstores.nosql.TrialObjects;
 import org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SerialOid;
-
-import static org.junit.Assert.assertEquals;
-
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Test;
 
 public class ObjectTest {
 
@@ -40,16 +37,14 @@ public class ObjectTest {
     public void hasInstances() throws Exception {
         Logger.getRootLogger().setLevel(Level.OFF);
 
-        TrialObjects testObjects = new TrialObjects();
-        
-        SerialOid oid = SerialOid.createTransient(1);
-        ExampleValuePojo pojo = new ExampleValuePojo();
-        
-        ObjectAdapter adapter = testObjects.createAdapter(pojo, oid);
-        
-        
-        ObjectSpecification loadSpecification = testObjects.loadSpecification(ExampleValuePojo.class);
-        
+        final TrialObjects testObjects = new TrialObjects();
+
+        final SerialOid oid = SerialOid.createTransient(1);
+        final ExampleValuePojo pojo = new ExampleValuePojo();
+
+        final ObjectAdapter adapter = testObjects.createAdapter(pojo, oid);
+
+        final ObjectSpecification loadSpecification = testObjects.loadSpecification(ExampleValuePojo.class);
 
         assertEquals(loadSpecification, adapter.getSpecification());
         assertEquals(oid, adapter.getOid());
@@ -57,6 +52,4 @@ public class ObjectTest {
         assertEquals(ResolveState.TRANSIENT, adapter.getResolveState());
     }
 
- }
-
-
+}

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractDatabaseConnector.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractDatabaseConnector.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractDatabaseConnector.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractDatabaseConnector.java Tue May  3 06:52:51 2011
@@ -17,26 +17,29 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 public abstract class AbstractDatabaseConnector implements DatabaseConnector {
     private boolean isUsed;
 
-    public final void setUsed(boolean isUsed) {
+    @Override
+    public final void setUsed(final boolean isUsed) {
         this.isUsed = isUsed;
     }
 
+    @Override
     public final boolean isUsed() {
         return isUsed;
     }
 
     private DatabaseConnectorPool pool;
 
-    public final void setConnectionPool(DatabaseConnectorPool pool) {
+    @Override
+    public final void setConnectionPool(final DatabaseConnectorPool pool) {
         this.pool = pool;
     }
 
+    @Override
     public final DatabaseConnectorPool getConnectionPool() {
         return pool;
     }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractFieldMappingFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractFieldMappingFactory.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractFieldMappingFactory.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractFieldMappingFactory.java Tue May  3 06:52:51 2011
@@ -17,13 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.FieldMappingFactory;
 
-
-
 public abstract class AbstractFieldMappingFactory implements FieldMappingFactory {
     final String type;
 
@@ -31,4 +28,3 @@ public abstract class AbstractFieldMappi
         this.type = type;
     }
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractMapper.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractMapper.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/AbstractMapper.java Tue May  3 06:52:51 2011
@@ -17,21 +17,19 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 import java.util.Date;
 import java.util.Hashtable;
 
-import org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid.State;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.version.SerialNumberVersion;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-
+import org.apache.isis.runtimes.dflt.objectstores.sql.SqlOid.State;
 
 public abstract class AbstractMapper {
     private FieldMappingLookup objectMapperLookup;
-    private Hashtable<String, PrimaryKeyMapper> keyMapping = new Hashtable<String, PrimaryKeyMapper>();
+    private final Hashtable<String, PrimaryKeyMapper> keyMapping = new Hashtable<String, PrimaryKeyMapper>();
 
     public abstract void createTables(final DatabaseConnector connector);
 
@@ -39,7 +37,8 @@ public abstract class AbstractMapper {
         return false;
     }
 
-    public final void shutdown() {}
+    public final void shutdown() {
+    }
 
     public void startup(final DatabaseConnector connector, final FieldMappingLookup objectMapperLookup) {
         this.objectMapperLookup = objectMapperLookup;
@@ -58,15 +57,15 @@ public abstract class AbstractMapper {
         if (keyMapping.containsKey(column)) {
             key = keyMapping.get(column).generateKey(rs, column);
         } else {
-            Object object = rs.getObject(column);
+            final Object object = rs.getObject(column);
             if (object == null) {
                 return null;
             } else {
-                int id = ((Integer) object).intValue();
+                final int id = ((Integer) object).intValue();
                 key = new IntegerPrimaryKey(id);
             }
         }
-        Oid oid = new SqlOid(cls.getFullIdentifier(), key, State.PERSISTENT);
+        final Oid oid = new SqlOid(cls.getFullIdentifier(), key, State.PERSISTENT);
         return oid;
     }
 

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/CollectionMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/CollectionMapper.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/CollectionMapper.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/CollectionMapper.java Tue May  3 06:52:51 2011
@@ -17,13 +17,11 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 
-
 public interface CollectionMapper {
 
     public void loadInternalCollection(final DatabaseConnector connector, final ObjectAdapter parent);

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnector.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnector.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnector.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnector.java Tue May  3 06:52:51 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 import org.apache.isis.core.commons.debug.DebugBuilder;
@@ -66,11 +65,12 @@ public interface DatabaseConnector {
     void debug(DebugBuilder debug);
 
     SqlMetaData getMetaData();
-    
+
     // Full PreparedStatement support
     public String addToQueryValues(int i);
+
     public String addToQueryValues(String s);
 
-	public String addToQueryValues(Object object);
-    
+    public String addToQueryValues(Object object);
+
 }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnectorFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnectorFactory.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnectorFactory.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnectorFactory.java Tue May  3 06:52:51 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 public interface DatabaseConnectorFactory {

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnectorPool.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnectorPool.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnectorPool.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/DatabaseConnectorPool.java Tue May  3 06:52:51 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 import java.util.Vector;
@@ -25,7 +24,6 @@ import java.util.Vector;
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.log4j.Logger;
 
-
 public class DatabaseConnectorPool {
     private static final Logger LOG = Logger.getLogger(DatabaseConnectorPool.class);
     private static final int AVERAGE_POOL_SIZE = 5;
@@ -44,14 +42,14 @@ public class DatabaseConnectorPool {
             newConnector();
         }
         LOG.info("Created an intial pool of " + size + " database connections");
-        
-        DatabaseConnector connection = acquire();
+
+        final DatabaseConnector connection = acquire();
         Sql.setMetaData(connection.getMetaData());
         release(connection);
     }
 
     private DatabaseConnector newConnector() {
-        DatabaseConnector connector = factory.createConnector();
+        final DatabaseConnector connector = factory.createConnector();
         connector.setConnectionPool(this);
         connectorPool.addElement(connector);
         return connector;
@@ -70,7 +68,7 @@ public class DatabaseConnectorPool {
 
     private DatabaseConnector findFreeConnector() {
         for (int i = 0, no = connectorPool.size(); i < no; i++) {
-            DatabaseConnector connector = (DatabaseConnector) connectorPool.elementAt(i);
+            final DatabaseConnector connector = connectorPool.elementAt(i);
             if (!connector.isUsed()) {
                 connector.setUsed(true);
                 return connector;
@@ -86,21 +84,21 @@ public class DatabaseConnectorPool {
 
     public void shutdown() {
         for (int i = 0, no = connectorPool.size(); i < no; i++) {
-            DatabaseConnector connector = (DatabaseConnector) connectorPool.elementAt(i);
+            final DatabaseConnector connector = connectorPool.elementAt(i);
             try {
                 connector.close();
-            } catch (SqlObjectStoreException e) {
+            } catch (final SqlObjectStoreException e) {
                 LOG.error("Failed to release connectuion", e);
             }
         }
         connectorPool.removeAllElements();
     }
 
-    public void debug(DebugBuilder debug) {
-        DatabaseConnector connection = acquire();
+    public void debug(final DebugBuilder debug) {
+        final DatabaseConnector connection = acquire();
         connection.debug(debug);
         release(connection);
-        
+
     }
 
     public SqlMetaData getMetaData() {

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/Defaults.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/Defaults.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/Defaults.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/Defaults.java Tue May  3 06:52:51 2011
@@ -47,7 +47,7 @@ public class Defaults {
         return dateTimeZone;
     }
 
-    public static void setTimeZone(DateTimeZone timezone) {
+    public static void setTimeZone(final DateTimeZone timezone) {
         dateTimeZone = timezone;
         calendar = Calendar.getInstance(timezone.toTimeZone());
     }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/FieldMappingFactoryInstaller.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/FieldMappingFactoryInstaller.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/FieldMappingFactoryInstaller.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/FieldMappingFactoryInstaller.java Tue May  3 06:52:51 2011
@@ -17,10 +17,8 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 public interface FieldMappingFactoryInstaller {
     void load(FieldMappingLookup lookup);
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/FieldMappingLookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/FieldMappingLookup.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/FieldMappingLookup.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/FieldMappingLookup.java Tue May  3 06:52:51 2011
@@ -22,8 +22,6 @@ package org.apache.isis.runtimes.dflt.ob
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.core.commons.exceptions.NotYetImplementedException;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
@@ -34,6 +32,7 @@ import org.apache.isis.runtimes.dflt.obj
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.ObjectReferenceMapping;
 import org.apache.isis.runtimes.dflt.objectstores.sql.mapping.ObjectReferenceMappingFactory;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.log4j.Logger;
 
 public class FieldMappingLookup {
     private static final Logger LOG = Logger.getLogger(FieldMappingLookup.class);
@@ -44,8 +43,8 @@ public class FieldMappingLookup {
     private FieldMappingFactory referenceFieldMappingfactory;
     private ObjectReferenceMappingFactory objectReferenceMappingfactory;
 
-    public FieldMapping createMapping(ObjectAssociation field) {
-        ObjectSpecification spec = field.getSpecification();
+    public FieldMapping createMapping(final ObjectAssociation field) {
+        final ObjectSpecification spec = field.getSpecification();
         FieldMappingFactory factory = fieldMappings.get(spec);
         if (factory != null) {
             return factory.createFieldMapping(field);
@@ -62,11 +61,11 @@ public class FieldMappingLookup {
         }
     }
 
-    public ObjectReferenceMapping createMapping(ObjectSpecification spec) {
+    public ObjectReferenceMapping createMapping(final ObjectSpecification spec) {
         return createMapping(spec.getShortIdentifier(), spec);
     }
 
-    public ObjectReferenceMapping createMapping(String columnName, ObjectSpecification spec) {
+    public ObjectReferenceMapping createMapping(final String columnName, final ObjectSpecification spec) {
         ObjectReferenceMappingFactory factory = referenceMappings.get(spec);
         if (factory != null) {
             return factory.createReferenceMapping(columnName, spec);
@@ -83,7 +82,7 @@ public class FieldMappingLookup {
     }
 
     public void addFieldMappingFactory(final Class<?> valueType, final FieldMappingFactory mapper) {
-        ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(valueType);
+        final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(valueType);
         addFieldMappingFactory(spec, mapper);
     }
 
@@ -104,23 +103,23 @@ public class FieldMappingLookup {
 
     public IdMapping createIdMapping() {
         // TODO inject and use external factory
-        IdMapping idMapping = new IdMapping();
+        final IdMapping idMapping = new IdMapping();
         idMapping.init();
         return idMapping;
     }
 
     public VersionMapping createVersionMapping() {
         // TODO inject and use external factory
-        VersionMapping versionMapping = new VersionMapping();
+        final VersionMapping versionMapping = new VersionMapping();
         versionMapping.init();
         return versionMapping;
     }
 
-    public void setReferenceFieldMappingFactory(FieldMappingFactory referenceMappingfactory) {
+    public void setReferenceFieldMappingFactory(final FieldMappingFactory referenceMappingfactory) {
         this.referenceFieldMappingfactory = referenceMappingfactory;
     }
 
-    public void setObjectReferenceMappingfactory(ObjectReferenceMappingFactory objectReferenceMappingfactory) {
+    public void setObjectReferenceMappingfactory(final ObjectReferenceMappingFactory objectReferenceMappingfactory) {
         this.objectReferenceMappingfactory = objectReferenceMappingfactory;
     }
 

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMapping.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMapping.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMapping.java Tue May  3 06:52:51 2011
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 
-
 public class IdMapping extends IdMappingAbstract {
 
     public void init() {
@@ -34,8 +32,9 @@ public class IdMapping extends IdMapping
         setColumn(idColumn);
     }
 
-    public void appendUpdateValues(StringBuffer sql, ObjectAdapter object) {}
+    public void appendUpdateValues(final StringBuffer sql, final ObjectAdapter object) {
+    }
 
-    public void initializeField(ObjectAdapter object, Results rs) {}
+    public void initializeField(final ObjectAdapter object, final Results rs) {
+    }
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMappingAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMappingAbstract.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMappingAbstract.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IdMappingAbstract.java Tue May  3 06:52:51 2011
@@ -31,7 +31,7 @@ import org.apache.isis.runtimes.dflt.run
 public class IdMappingAbstract {
     private String column;
 
-    protected void setColumn(String column) {
+    protected void setColumn(final String column) {
         this.column = Sql.identifier(column);
     }
 
@@ -39,29 +39,29 @@ public class IdMappingAbstract {
         return column;
     }
 
-    public void appendWhereClause(DatabaseConnector connector, StringBuffer sql, Oid oid) {
+    public void appendWhereClause(final DatabaseConnector connector, final StringBuffer sql, final Oid oid) {
         sql.append(column);
         connector.addToQueryValues(primaryKeyAsObject(oid));
         sql.append(" = ?");
     }
 
-    public void appendCreateColumnDefinitions(StringBuffer sql) {
+    public void appendCreateColumnDefinitions(final StringBuffer sql) {
         sql.append(column);
         sql.append(" ");
         sql.append(JdbcConnector.TYPE_PK() + " NOT NULL PRIMARY KEY");
     }
 
-    public void appendColumnDefinitions(StringBuffer sql) {
+    public void appendColumnDefinitions(final StringBuffer sql) {
         sql.append(column);
         sql.append(" ");
         sql.append(JdbcConnector.TYPE_PK());
     }
 
-    public void appendColumnNames(StringBuffer sql) {
+    public void appendColumnNames(final StringBuffer sql) {
         sql.append(column);
     }
 
-    public void appendInsertValues(DatabaseConnector connector, StringBuffer sql, ObjectAdapter object) {
+    public void appendInsertValues(final DatabaseConnector connector, final StringBuffer sql, final ObjectAdapter object) {
         if (object == null) {
             sql.append("NULL");
         } else {
@@ -74,35 +74,37 @@ public class IdMappingAbstract {
      */
     public Object primaryKeyAsObject(final Oid oid) {
         if (oid instanceof SqlOid) {
-            PrimaryKey pk = ((SqlOid) oid).getPrimaryKey();
+            final PrimaryKey pk = ((SqlOid) oid).getPrimaryKey();
             return pk.naturalValue();
-        } else
+        } else {
             return ((SerialOid) oid).getSerialNo();
+        }
     }
 
     public String primaryKey(final Oid oid) {
-        if (oid instanceof SqlOid)
+        if (oid instanceof SqlOid) {
             return "" + ((SqlOid) oid).getPrimaryKey().stringValue() + "";
-        else
+        } else {
             return "" + ((SerialOid) oid).getSerialNo();
+        }
     }
 
     public Oid recreateOid(final Results rs, final ObjectSpecification specification) {
         PrimaryKey key;
-        Object object = rs.getObject(column);
+        final Object object = rs.getObject(column);
         if (object == null) {
             return null;
         } else {
-            int id = ((Integer) object).intValue();
+            final int id = ((Integer) object).intValue();
             key = new IntegerPrimaryKey(id);
         }
-        Oid oid = new SqlOid(specification.getFullIdentifier(), key, State.PERSISTENT);
+        final Oid oid = new SqlOid(specification.getFullIdentifier(), key, State.PERSISTENT);
         return oid;
     }
 
     protected ObjectAdapter getAdapter(final ObjectSpecification specification, final Oid oid) {
-        AdapterManager objectLoader = IsisContext.getPersistenceSession().getAdapterManager();
-        ObjectAdapter adapter = objectLoader.getAdapterFor(oid);
+        final AdapterManager objectLoader = IsisContext.getPersistenceSession().getAdapterManager();
+        final ObjectAdapter adapter = objectLoader.getAdapterFor(oid);
         if (adapter != null) {
             return adapter;
         } else {

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IntegerPrimaryKey.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IntegerPrimaryKey.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IntegerPrimaryKey.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/IntegerPrimaryKey.java Tue May  3 06:52:51 2011
@@ -20,49 +20,49 @@
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 public class IntegerPrimaryKey implements PrimaryKey {
-	private static final long serialVersionUID = 1L;
-	private final int primaryKey;
+    private static final long serialVersionUID = 1L;
+    private final int primaryKey;
 
-	public IntegerPrimaryKey(final int primaryKey) {
-		this.primaryKey = primaryKey;
-	}
-
-	@Override
-	public boolean equals(final Object obj) {
-		if (obj == this) {
-			return true;
-		}
-		if (obj instanceof IntegerPrimaryKey) {
-			IntegerPrimaryKey o = ((IntegerPrimaryKey) obj);
-			return primaryKey == o.primaryKey;
-		}
-		return false;
-	}
-
-	@Override
-	public String stringValue() {
-		return "" + primaryKey;
-	}
-
-	@Override
-	public int hashCode() {
-		int hash = 17;
-		hash = 37 * hash + primaryKey;
-		return hash;
-	}
-
-	@Override
-	public String toString() {
-		return "" + primaryKey;
-	}
-
-	public int intValue() {
-		return primaryKey;
-	}
-
-	@Override
-	public Object naturalValue() {
-		return intValue();
-	}
+    public IntegerPrimaryKey(final int primaryKey) {
+        this.primaryKey = primaryKey;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof IntegerPrimaryKey) {
+            final IntegerPrimaryKey o = ((IntegerPrimaryKey) obj);
+            return primaryKey == o.primaryKey;
+        }
+        return false;
+    }
+
+    @Override
+    public String stringValue() {
+        return "" + primaryKey;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 17;
+        hash = 37 * hash + primaryKey;
+        return hash;
+    }
+
+    @Override
+    public String toString() {
+        return "" + primaryKey;
+    }
+
+    public int intValue() {
+        return primaryKey;
+    }
+
+    @Override
+    public Object naturalValue() {
+        return intValue();
+    }
 
 }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/MappingLookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/MappingLookup.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/MappingLookup.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/MappingLookup.java Tue May  3 06:52:51 2011
@@ -17,13 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 public class MappingLookup {
-   // private ObjectMappingLookup classMappingLookup;
-   // private FieldMappingLookup fieldMappingLookup;
+    // private ObjectMappingLookup classMappingLookup;
+    // private FieldMappingLookup fieldMappingLookup;
 
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/MultipleResults.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/MultipleResults.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/MultipleResults.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/MultipleResults.java Tue May  3 06:52:51 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 public interface MultipleResults {

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMapping.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMapping.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMapping.java Tue May  3 06:52:51 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -26,7 +25,6 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 import org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryFindByPattern;
 
-
 public interface ObjectMapping {
     void createObject(DatabaseConnector connector, ObjectAdapter object);
 
@@ -36,7 +34,8 @@ public interface ObjectMapping {
 
     ObjectAdapter[] getInstances(DatabaseConnector connector, ObjectSpecification spec, String title);
 
-    ObjectAdapter[] getInstances(DatabaseConnector connector, ObjectSpecification spec, PersistenceQueryFindByPattern query);
+    ObjectAdapter[] getInstances(DatabaseConnector connector, ObjectSpecification spec,
+        PersistenceQueryFindByPattern query);
 
     ObjectAdapter getObject(DatabaseConnector connector, Oid oid, ObjectSpecification hint);
 
@@ -49,7 +48,7 @@ public interface ObjectMapping {
     void save(DatabaseConnector connector, ObjectAdapter object);
 
     void shutdown();
-    
+
     void startup(DatabaseConnector connection, ObjectMappingLookup objectMapperLookup);
 
 }

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMappingFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMappingFactory.java?rev=1098941&r1=1098940&r2=1098941&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMappingFactory.java (original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/ObjectMappingFactory.java Tue May  3 06:52:51 2011
@@ -17,9 +17,9 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.objectstores.sql;
 
 public interface ObjectMappingFactory {
-    ObjectMapping createMapper(String className, String propertiesBase, FieldMappingLookup fieldMapperLookup, ObjectMappingLookup objectMapperLookup );
+    ObjectMapping createMapper(String className, String propertiesBase, FieldMappingLookup fieldMapperLookup,
+        ObjectMappingLookup objectMapperLookup);
 }



Mime
View raw message