incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1042671 - in /incubator/isis/trunk: alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/ alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/s...
Date Mon, 06 Dec 2010 15:02:51 GMT
Author: danhaywood
Date: Mon Dec  6 15:02:50 2010
New Revision: 1042671

URL: http://svn.apache.org/viewvc?rev=1042671&view=rev
Log:
fixing NoSQL tests that were failing on Windows

Added:
    incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java
      - copied, changed from r1042594, incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/NofMatchers.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/lang/StringUtils_toLineSeparated.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_ContainsStripNewLinesTest.java
      - copied, changed from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_ContainsStripNewLinesTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EndsWithStripNewLinesTest.java
      - copied, changed from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EndsWithStripNewLinesTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EqualToStripNewLinesTest.java
      - copied, changed from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EqualToStripNewLinesTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringOrNullTest.java
      - copied, changed from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringOrNullTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringTest.java
      - copied, changed from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_StartsWithStripNewLinesTest.java
      - copied, changed from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_StartsWithStripNewLinesTest.java
Removed:
    incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/CarriageReturnTest.java
    incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/NofMatchers.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_ContainsStripNewLinesTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EndsWithStripNewLinesTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EqualToStripNewLinesTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringOrNullTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringTest.java
    incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_StartsWithStripNewLinesTest.java
Modified:
    incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriter.java
    incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/ServerConnection.java
    incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriterTest.java
    incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/FileServerTest.java
    incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/mongo/MongoDbTest.java
    incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/io/IoUtils.java
    incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/ConsentAbstract.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/Veto.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetAbstract.java
    incubator/isis/trunk/core/metamodel/src/test/java/org/apache/isis/core/metamodel/java5/ImperativeFacetUtilsTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessParameterTest.java
    incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessPropertyTest.java
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/oidgenerator/simple/SimpleOidGenerator.java
    incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodReturnTest.java
    incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodsParametersTest.java
    incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryProcessTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberHiddenTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberInvalidTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ObjectImmutableTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java

Modified: incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriter.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriter.java (original)
+++ incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriter.java Mon Dec  6 15:02:50 2010
@@ -28,8 +28,11 @@ import java.util.List;
 
 public class DataWriter {
 
- //   private static final Logger LOG = Logger.getLogger(DataWriter.class);
-    private List<FileContent> files;
+    //   private static final Logger LOG = Logger.getLogger(DataWriter.class);
+    
+    private static final String ENCODING = "utf-8";
+ 
+    private final List<FileContent> files;
 
     public DataWriter(List<FileContent> files) {
         this.files = files;
@@ -55,23 +58,33 @@ public class DataWriter {
         }
         try {
             output = new FileOutputStream(file);
-            output.write(content.type.getBytes("utf-8"));
+            output.write(content.type.getBytes(ENCODING));
             output.write(' ');
-            output.write(content.id.getBytes("utf-8"));
+            output.write(content.id.getBytes(ENCODING));
             output.write(' ');
-            output.write(content.newVersion.getBytes("utf-8"));
+            output.write(content.newVersion.getBytes(ENCODING));
             output.write('\n');
-            output.write(content.data.getBytes("utf-8"));
+            output.write(content.data.getBytes(ENCODING));
         } finally {
-            if (output != null) {
-                try {
-                    output.close();
-                } catch (IOException e) {
-                    // throw new ObjectAdapterRuntimeException(e);
-                }
+            closeSafely(output);
+        }
+    }
+
+    private static void closeSafely(FileOutputStream output) {
+        if (output != null) {
+            try {
+                output.flush();
+                output.close();
+            } catch (IOException e) {
+                // throw new ObjectAdapterRuntimeException(e);
             }
         }
     }
 
+    public void close() {
+        // TODO Auto-generated method stub
+        
+    }
+
 }
 

Modified: incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/ServerConnection.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/ServerConnection.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/ServerConnection.java (original)
+++ incubator/isis/trunk/alternatives/objectstore/nosql/src/main/java/org/apache/isis/alternatives/objectstore/nosql/file/server/ServerConnection.java Mon Dec  6 15:02:50 2010
@@ -110,13 +110,13 @@ public class ServerConnection {
     }
 
     public void error(String message) {
-        String result = "error\n" + message;
-        write(result);
+        writer.println("error");
+        writer.println(message);
+        writer.flush();
     }
 
     public void error(String message, Exception exception) {
-        String result = "error\n" + message;
-        writer.println(result);
+        error(message);
         exception.printStackTrace(writer);
         writer.println();
         writer.println();

Modified: incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriterTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriterTest.java (original)
+++ incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/DataWriterTest.java Mon Dec  6 15:02:50 2010
@@ -28,40 +28,58 @@ import java.util.List;
 
 import junit.framework.Assert;
 
-import org.apache.isis.alternatives.objectstore.nosql.file.server.DataWriter;
-import org.apache.isis.alternatives.objectstore.nosql.file.server.FileContent;
-import org.apache.isis.alternatives.objectstore.nosql.file.server.Util;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
 public class DataWriterTest {
 
+    private static final String TARGET_DIRECTORY = "target/test/";
+    private static final String FULLY_QUALIFIED_CLASSNAME = "org.domain.Class";
+    private static final String FULLY_QUALIFIED_CLASSNAME_2 = "org.domain.Class2";
+    private DataWriter writer;
+
+
     @Before
     public void setUp() throws Exception {
-        Util.setDirectory("target/test", "services", "logs");
+        Util.setDirectory(TARGET_DIRECTORY, "services", "logs");
         Util.ensureDirectoryExists();
     }
 
+    @After
+    public void tearDown() throws Exception {
+        if (writer != null) {
+            writer.close();
+        }
+    }
+    
     @Test
     public void testWriteData() throws Exception {
-        File file = new File("target/test/org.domain.Class/1030.data");
+        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",  "org.domain.Class", "{data1}"));
-        files.add(new FileContent('U', "1024", "21", "22", "org.domain.Class", "{data2}"));
-        files.add(new FileContent('D', "1030", "66", "", "org.domain.Class", ""));
+        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);
         writer.writeData();
         
-        BufferedReader reader = new BufferedReader(new FileReader("target/test/org.domain.Class/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/test/org.domain.Class/1024.data"));
-        Assert.assertEquals("org.domain.Class 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());
@@ -70,22 +88,32 @@ public class DataWriterTest {
 
     @Test
     public void createsTypeDirectory() throws Exception {
-        File file = new File("target/test/org.domain.Class");
-        for( File f: file.listFiles()) {
-            f.delete();
-        }
-        file.delete();
+        String dir = TARGET_DIRECTORY +
+        		FULLY_QUALIFIED_CLASSNAME_2;
+        File file = deleteDirectory(dir);
         Assert.assertFalse(file.exists());
         
 
         List<FileContent> files = new ArrayList<FileContent>();
-        files.add(new FileContent('I', "1023", "1", "2",  "org.domain.Class", "{data1}"));
-        DataWriter writer = new DataWriter(files);
+        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()) {
+                f.delete();
+            }
+            file.delete();
+            
+        }
+        return file;
+    }
+
 }
 
 

Modified: incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/FileServerTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/FileServerTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/FileServerTest.java (original)
+++ incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/file/server/FileServerTest.java Mon Dec  6 15:02:50 2010
@@ -19,22 +19,24 @@
 
 package org.apache.isis.alternatives.objectstore.nosql.file.server;
 
+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;
 import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.startsWith;
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
 
+import org.apache.isis.core.commons.io.IoUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -55,13 +57,8 @@ public class FileServerTest {
 
     @Before
     public void startup() {
-        logFile1 = new File("target/test/logs", "recovery0.log");
-        String absolutePath = logFile1.getAbsolutePath();
-        boolean delete = logFile1.delete();
-        assertFalse(logFile1.exists());
-        logFile2 = new File("target/test/logs", "recovery1.log");
-        logFile2.delete();
-        assertFalse(logFile2.exists());
+        logFile1 = recreateFile("target/test/logs", "recovery0.log");
+        logFile2 = recreateFile("target/test/logs", "recovery1.log");
 
         server = new FileServerProcessor();
         server.startup();
@@ -69,10 +66,18 @@ public class FileServerTest {
         out = new ByteArrayOutputStream();
     }
 
+    private static File recreateFile(String parent, String child) {
+        File file = new File(parent, child);
+        file.delete();
+        assertFalse(file.exists());
+        return file;
+    }
+
     @After
     public void tearDown() throws Exception {
-        if (server != null)
+        if (server != null) {
             server.shutdown();
+        }
     }
 
     @Test
@@ -83,7 +88,7 @@ public class FileServerTest {
 
         server.shutdown();
         server.process(connection);
-        assertEquals("abort\n", new String(out.toByteArray(), "utf-8"));
+        assertThat(new String(out.toByteArray(), "utf-8"), is(equalTo(lineSeparated("abort\n"))));
     }
 
     @Test
@@ -96,18 +101,13 @@ public class FileServerTest {
         assertFalse(file2.exists());
 
         InputStream in =
-            inputStream("W\nIorg.domain.Class 1025 null 1  \n{data1}\n\nIorg.domain.Class 1026 null 1\n{data2}\n");
+            IoUtils.asInputStream("W\nIorg.domain.Class 1025 null 1  \n{data1}\n\nIorg.domain.Class 1026 null 1\n{data2}\n");
         ServerConnection connection = new ServerConnection(in, out);
         server.process(connection);
-        assertEquals("ok\n", out.toString());
-        assertTrue(file1.exists() && file1.length() > 0);
-        assertTrue(file2.exists() && file2.length() > 0);
-    }
-
-    public InputStream inputStream(String string) throws UnsupportedEncodingException {
-        byte[] data = string.getBytes("utf-8");
-        InputStream in = new ByteArrayInputStream(data);
-        return in;
+        
+        assertThat(out.toString(), is(equalTo(lineSeparated("ok\n"))));
+        assertThat(file1, existsAndNotEmpty());
+        assertThat(file2, existsAndNotEmpty());
     }
 
     @Test
@@ -119,10 +119,11 @@ public class FileServerTest {
         fileWriter.close();
 
         ServerConnection connection =
-            new ServerConnection(inputStream("W\nUorg.domain.Class 1026 21 22 \n{data2}\n"), out);
+            new ServerConnection(IoUtils.asInputStream("W\nUorg.domain.Class 1026 21 22 \n{data2}\n"), out);
         server.process(connection);
-        assertEquals("ok\n", out.toString());
-        assertTrue(file2.length() > originalData.length());
+        
+        assertThat(out.toString(), is(equalTo(lineSeparated("ok\n"))));
+        assertThat(file2.length(), is(greaterThan((long)originalData.length())));
     }
 
     @Test
@@ -134,31 +135,34 @@ public class FileServerTest {
         fileWriter.close();
 
         ServerConnection connection =
-            new ServerConnection(inputStream("W\nUorg.domain.Class 1026 19 21 \n{data2}\n"), out);
+            new ServerConnection(IoUtils.asInputStream("W\nUorg.domain.Class 1026 19 21 \n{data2}\n"), out);
         server.process(connection);
-        assertEquals("error\n{datax}\n", out.toString());
+        
+        assertThat(out.toString(), is(equalTo(lineSeparated("error\n{datax}\n"))));
     }
 
     @Test
     public void writeCreatesLogFile() throws Exception {
         ServerConnection connection =
-            new ServerConnection(inputStream("W\nIorg.domain.Class 1025 6 7\n{data1}\n"), out);
+            new ServerConnection(IoUtils.asInputStream("W\nIorg.domain.Class 1025 6 7\n{data1}\n"), out);
         server.process(connection);
 
-        assertEquals("ok\n", out.toString());
-        assertTrue("log file should be created", logFile1.exists() && logFile1.length() > 0);
-        assertFalse("only one log file should be created", logFile2.exists() && logFile2.length() > 0);
+        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");
         file1.delete();
-        ServerConnection connection = new ServerConnection(inputStream("Rorg.domain.Class 2020"), out);
+        ServerConnection connection = new ServerConnection(IoUtils.asInputStream("Rorg.domain.Class 2020"), out);
         server.process(connection);
 
-        assertThat(out.toString(), startsWith("error\n"));
-        assertThat(out.toString(), containsString("File not found for org.domain.Class & 2020"));
+        String string = out.toString();
+        assertThat(string, startsWith("error"));
+        assertThat(string, containsString("File not found for org.domain.Class & 2020"));
     }
 
     @Test
@@ -168,9 +172,11 @@ public class FileServerTest {
         fileWriter.write("type 1025 1\n{data1}");
         fileWriter.close();
 
-        ServerConnection connection = new ServerConnection(inputStream("Rorg.domain.Class 2025"), out);
+        ServerConnection connection = new ServerConnection(IoUtils.asInputStream("Rorg.domain.Class 2025"), out);
         server.process(connection);
-        assertThat("ok\n{data1}\n".toCharArray(), is(equalTo(new String(out.toString()).toCharArray())));
+        
+        assertThat(out.toString(), is(equalTo(lineSeparated("ok\n{data1}\n"))));
     }
 
+
 }

Modified: incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/mongo/MongoDbTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/mongo/MongoDbTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/mongo/MongoDbTest.java (original)
+++ incubator/isis/trunk/alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/mongo/MongoDbTest.java Mon Dec  6 15:02:50 2010
@@ -20,28 +20,29 @@
 
 package org.apache.isis.alternatives.objectstore.nosql.mongo;
 
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.junit.Before;
-import org.junit.Test;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeThat;
+
 import org.apache.isis.alternatives.objectstore.nosql.ExampleValuePojo;
 import org.apache.isis.alternatives.objectstore.nosql.SerialKeyCreator;
 import org.apache.isis.alternatives.objectstore.nosql.TrialObjects;
-import org.apache.isis.alternatives.objectstore.nosql.mongo.MongoDb;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.runtime.persistence.oidgenerator.simple.SerialOid;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Test;
 
 import com.mongodb.BasicDBObject;
 import com.mongodb.DB;
 import com.mongodb.DBCollection;
 import com.mongodb.Mongo;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
 
 public class MongoDbTest {
     private MongoDb db;
@@ -56,10 +57,14 @@ public class MongoDbTest {
         Logger.getRootLogger().setLevel(Level.OFF);
         testObjects = new TrialObjects();
         
-
-        Mongo m = new Mongo();
-        m.dropDatabase("testdb");
-        testDb = m.getDB("testdb");
+        try {
+            Mongo m = new Mongo();
+            m.dropDatabase("testdb");
+            testDb = m.getDB("testdb");
+        } catch (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();

Modified: incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/io/IoUtils.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/io/IoUtils.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/io/IoUtils.java (original)
+++ incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/io/IoUtils.java Mon Dec  6 15:02:50 2010
@@ -21,9 +21,11 @@
 package org.apache.isis.core.commons.io;
 
 import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
 
 
 public final class IoUtils {
@@ -81,7 +83,13 @@ public final class IoUtils {
                 reader.close();
             } catch (final IOException ignore) {}
         }
-	}
+	}
+
+    public static InputStream asInputStream(String string) throws UnsupportedEncodingException {
+        byte[] data = string.getBytes("utf-8");
+        InputStream in = new ByteArrayInputStream(data);
+        return in;
+    }
 
 }
 

Modified: incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java (original)
+++ incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java Mon Dec  6 15:02:50 2010
@@ -20,7 +20,7 @@
 
 package org.apache.isis.core.commons.lang;
 
-import java.util.List;
+import java.util.List;
 
 
 public final class StringUtils {
@@ -164,5 +164,46 @@ public final class StringUtils {
 	    }
 	    return buf.toString();
 	}
+
+	
+    private static final char CARRIAGE_RETURN = '\n';
+    private static final char LINE_FEED = '\r';
+
+
+    /**
+     * Converts any <tt>\n</tt> to <tt>line.separator</tt>
+     * @param string
+     * @return
+     */
+    public static String lineSeparated(String string) {
+        StringBuilder buf = new StringBuilder();
+        String lineSeparator = System.getProperty("line.separator");
+        boolean lastWasLineFeed = false;
+        for(char c: string.toCharArray()) {
+            boolean isLineFeed = c == LINE_FEED;
+            boolean isCarriageReturn = c == CARRIAGE_RETURN;
+            if (isCarriageReturn) {
+                buf.append(lineSeparator);
+                lastWasLineFeed = false;
+            } else {
+                if(lastWasLineFeed) {
+                    buf.append(LINE_FEED);
+                }
+                if(isLineFeed) {
+                    lastWasLineFeed = true;
+                } else {
+                    buf.append(c);
+                    lastWasLineFeed = false;    
+                }
+            }
+        }
+        if(lastWasLineFeed) {
+            buf.append(LINE_FEED);
+        }
+        return buf.toString();
+    }
+
+
+
 
 }

Copied: incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java (from r1042594, incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/NofMatchers.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java?p2=incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java&p1=incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/NofMatchers.java&r1=1042594&r2=1042671&rev=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/NofMatchers.java (original)
+++ incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java Mon Dec  6 15:02:50 2010
@@ -22,6 +22,7 @@ package org.apache.isis.core.commons.mat
 
 import static org.hamcrest.CoreMatchers.nullValue;
 
+import java.io.File;
 import java.util.List;
 
 import org.hamcrest.CoreMatchers;
@@ -41,9 +42,9 @@ import org.apache.isis.core.commons.lang
  * Hamcrest {@link Matcher} implementations.
  * 
  */
-public final class NofMatchers {
+public final class IsisMatchers {
 
-    private NofMatchers() {}
+    private IsisMatchers() {}
 
     @Factory
     public static Matcher<String> containsStripNewLines(final String expected) {
@@ -189,6 +190,22 @@ public final class NofMatchers {
         }
 
         return new ClassEqualsMatcher(operand);
+    }
+
+    public static Matcher<File> existsAndNotEmpty() {
+        
+        return new TypeSafeMatcher<File>() {
+    
+            @Override
+            public void describeTo(Description arg0) {
+                arg0.appendText("exists and is not empty");
+            }
+    
+            @Override
+            public boolean matchesSafely(File f) {
+                return f.exists() && f.length() > 0;
+            }
+        };
     }
     
 }

Added: incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/lang/StringUtils_toLineSeparated.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/lang/StringUtils_toLineSeparated.java?rev=1042671&view=auto
==============================================================================
--- incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/lang/StringUtils_toLineSeparated.java (added)
+++ incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/lang/StringUtils_toLineSeparated.java Mon Dec  6 15:02:50 2010
@@ -0,0 +1,54 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.commons.lang;
+
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assume.assumeThat;
+
+import org.apache.isis.core.commons.lang.StringUtils;
+import org.junit.Test;
+
+public class StringUtils_toLineSeparated {
+
+    @Test
+    public void convertsCarriageReturnToLineSeparator() throws Exception {
+        assertThat(StringUtils.lineSeparated("ok\n"), is("ok" + System.getProperty("line.separator")));
+    }
+
+    @Test
+    public void windowsStyleCarriageReturnLeftUnchanged() throws Exception {
+        assumeThatRunningOnWindows(); // ie windows
+        assertThat(StringUtils.lineSeparated("ok\r\n"), is("ok" + System.getProperty("line.separator")));
+    }
+
+    @Test
+    public void macStyleCarriageReturnLeftUnchanged() throws Exception {
+        assumeThatRunningOnWindows(); // ie windows
+        assertThat(StringUtils.lineSeparated("ok\r"), is("ok\r"));
+    }
+
+    private static void assumeThatRunningOnWindows() {
+        assumeThat(System.getProperty("file.separator"), is(equalTo("\\")));
+    }
+
+    
+}

Copied: incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_ContainsStripNewLinesTest.java (from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_ContainsStripNewLinesTest.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_ContainsStripNewLinesTest.java?p2=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_ContainsStripNewLinesTest.java&p1=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_ContainsStripNewLinesTest.java&r1=1042594&r2=1042671&rev=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_ContainsStripNewLinesTest.java (original)
+++ incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_ContainsStripNewLinesTest.java Mon Dec  6 15:02:50 2010
@@ -26,16 +26,16 @@ import static org.junit.Assert.assertTha
 import org.hamcrest.Matcher;
 import org.junit.Before;
 import org.junit.Test;
-import org.apache.isis.core.commons.matchers.NofMatchers;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
 
 
-public class NofMatcher_ContainsStripNewLinesTest {
+public class IsisMatchers_ContainsStripNewLinesTest {
 
     private Matcher<String> fooMatcher;
 
     @Before
     public void setUp() {
-        fooMatcher = NofMatchers.containsStripNewLines("foo");
+        fooMatcher = IsisMatchers.containsStripNewLines("foo");
     }
 
     @Test

Copied: incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EndsWithStripNewLinesTest.java (from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EndsWithStripNewLinesTest.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EndsWithStripNewLinesTest.java?p2=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EndsWithStripNewLinesTest.java&p1=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EndsWithStripNewLinesTest.java&r1=1042594&r2=1042671&rev=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EndsWithStripNewLinesTest.java (original)
+++ incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EndsWithStripNewLinesTest.java Mon Dec  6 15:02:50 2010
@@ -26,16 +26,16 @@ import static org.junit.Assert.assertTha
 import org.hamcrest.Matcher;
 import org.junit.Before;
 import org.junit.Test;
-import org.apache.isis.core.commons.matchers.NofMatchers;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
 
 
-public class NofMatcher_EndsWithStripNewLinesTest {
+public class IsisMatchers_EndsWithStripNewLinesTest {
 
     private Matcher<String> fooMatcher;
 
     @Before
     public void setUp() {
-        fooMatcher = NofMatchers.endsWithStripNewLines("foo");
+        fooMatcher = IsisMatchers.endsWithStripNewLines("foo");
     }
 
     @Test

Copied: incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EqualToStripNewLinesTest.java (from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EqualToStripNewLinesTest.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EqualToStripNewLinesTest.java?p2=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EqualToStripNewLinesTest.java&p1=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EqualToStripNewLinesTest.java&r1=1042594&r2=1042671&rev=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_EqualToStripNewLinesTest.java (original)
+++ incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_EqualToStripNewLinesTest.java Mon Dec  6 15:02:50 2010
@@ -26,16 +26,16 @@ import static org.junit.Assert.assertTha
 import org.hamcrest.Matcher;
 import org.junit.Before;
 import org.junit.Test;
-import org.apache.isis.core.commons.matchers.NofMatchers;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
 
 
-public class NofMatcher_EqualToStripNewLinesTest {
+public class IsisMatchers_EqualToStripNewLinesTest {
 
     private Matcher<String> fooMatcher;
 
     @Before
     public void setUp() {
-        fooMatcher = NofMatchers.equalToStripNewLines("foo");
+        fooMatcher = IsisMatchers.equalToStripNewLines("foo");
     }
 
     @Test

Copied: incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringOrNullTest.java (from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringOrNullTest.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringOrNullTest.java?p2=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringOrNullTest.java&p1=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringOrNullTest.java&r1=1042594&r2=1042671&rev=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringOrNullTest.java (original)
+++ incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringOrNullTest.java Mon Dec  6 15:02:50 2010
@@ -26,16 +26,16 @@ import static org.junit.Assert.assertTha
 import org.hamcrest.Matcher;
 import org.junit.Before;
 import org.junit.Test;
-import org.apache.isis.core.commons.matchers.NofMatchers;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
 
 
-public class NofMatcher_NonEmptyStringOrNullTest {
+public class IsisMatchers_NonEmptyStringOrNullTest {
 
     private Matcher<String> fooMatcher;
 
     @Before
     public void setUp() {
-        fooMatcher = NofMatchers.nonEmptyStringOrNull();
+        fooMatcher = IsisMatchers.nonEmptyStringOrNull();
     }
 
     @Test

Copied: incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringTest.java (from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringTest.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringTest.java?p2=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringTest.java&p1=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringTest.java&r1=1042594&r2=1042671&rev=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_NonEmptyStringTest.java (original)
+++ incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_NonEmptyStringTest.java Mon Dec  6 15:02:50 2010
@@ -26,16 +26,16 @@ import static org.junit.Assert.assertTha
 import org.hamcrest.Matcher;
 import org.junit.Before;
 import org.junit.Test;
-import org.apache.isis.core.commons.matchers.NofMatchers;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
 
 
-public class NofMatcher_NonEmptyStringTest {
+public class IsisMatchers_NonEmptyStringTest {
 
     private Matcher<String> fooMatcher;
 
     @Before
     public void setUp() {
-        fooMatcher = NofMatchers.nonEmptyString();
+        fooMatcher = IsisMatchers.nonEmptyString();
     }
 
     @Test

Copied: incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_StartsWithStripNewLinesTest.java (from r1042594, incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_StartsWithStripNewLinesTest.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_StartsWithStripNewLinesTest.java?p2=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_StartsWithStripNewLinesTest.java&p1=incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_StartsWithStripNewLinesTest.java&r1=1042594&r2=1042671&rev=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/NofMatcher_StartsWithStripNewLinesTest.java (original)
+++ incubator/isis/trunk/core/commons/src/test/java/org/apache/isis/core/commons/matchers/IsisMatchers_StartsWithStripNewLinesTest.java Mon Dec  6 15:02:50 2010
@@ -26,16 +26,16 @@ import static org.junit.Assert.assertTha
 import org.hamcrest.Matcher;
 import org.junit.Before;
 import org.junit.Test;
-import org.apache.isis.core.commons.matchers.NofMatchers;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
 
 
-public class NofMatcher_StartsWithStripNewLinesTest {
+public class IsisMatchers_StartsWithStripNewLinesTest {
 
     private Matcher<String> fooMatcher;
 
     @Before
     public void setUp() {
-        fooMatcher = NofMatchers.startsWithStripNewLines("foo");
+        fooMatcher = IsisMatchers.startsWithStripNewLines("foo");
     }
 
     @Test

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/ConsentAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/ConsentAbstract.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/ConsentAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/ConsentAbstract.java Mon Dec  6 15:02:50 2010
@@ -21,7 +21,7 @@
 package org.apache.isis.core.metamodel.consent;
 
 import static org.hamcrest.CoreMatchers.is;
-import static org.apache.isis.core.commons.matchers.NofMatchers.nonEmptyStringOrNull;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.nonEmptyStringOrNull;
 
 import java.io.Serializable;
 

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/Veto.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/Veto.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/Veto.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/consent/Veto.java Mon Dec  6 15:02:50 2010
@@ -21,7 +21,7 @@
 package org.apache.isis.core.metamodel.consent;
 
 import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
-import static org.apache.isis.core.commons.matchers.NofMatchers.nonEmptyString;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.nonEmptyString;
 
 import org.apache.isis.core.metamodel.facets.Facet;
 

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetAbstract.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/FacetAbstract.java Mon Dec  6 15:02:50 2010
@@ -26,7 +26,7 @@ import static org.hamcrest.CoreMatchers.
 import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
 
 import org.apache.isis.core.commons.ensure.Ensure;
-import org.apache.isis.core.commons.matchers.NofMatchers;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.interactions.DisablingInteractionAdvisor;
 import org.apache.isis.core.metamodel.interactions.HidingInteractionAdvisor;
@@ -86,7 +86,7 @@ public abstract class FacetAbstract impl
 		return underlyingFacet;
 	}
 	public void setUnderlyingFacet(Facet underlyingFacet) {
-		Ensure.ensureThatArg(underlyingFacet.facetType(), NofMatchers.classEqualTo(facetType));
+		Ensure.ensureThatArg(underlyingFacet.facetType(), IsisMatchers.classEqualTo(facetType));
 		this.underlyingFacet = underlyingFacet;
 	}
 

Modified: incubator/isis/trunk/core/metamodel/src/test/java/org/apache/isis/core/metamodel/java5/ImperativeFacetUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/test/java/org/apache/isis/core/metamodel/java5/ImperativeFacetUtilsTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/test/java/org/apache/isis/core/metamodel/java5/ImperativeFacetUtilsTest.java (original)
+++ incubator/isis/trunk/core/metamodel/src/test/java/org/apache/isis/core/metamodel/java5/ImperativeFacetUtilsTest.java Mon Dec  6 15:02:50 2010
@@ -22,7 +22,7 @@ package org.apache.isis.core.metamodel.j
 
 import static org.hamcrest.CoreMatchers.*;
 import static org.junit.Assert.assertThat;
-import static org.apache.isis.core.commons.matchers.NofMatchers.*;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.*;
 
 import java.lang.reflect.Method;
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessParameterTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessParameterTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessParameterTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessParameterTest.java Mon Dec  6 15:02:50 2010
@@ -20,7 +20,7 @@
 
 package org.apache.isis.core.progmodel.facets.propparam.specification;
 
-import static org.apache.isis.core.commons.matchers.NofMatchers.anInstanceOf;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.anInstanceOf;
 
 import java.lang.reflect.Method;
 

Modified: incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessPropertyTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessPropertyTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessPropertyTest.java (original)
+++ incubator/isis/trunk/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactoryProcessPropertyTest.java Mon Dec  6 15:02:50 2010
@@ -20,7 +20,7 @@
 
 package org.apache.isis.core.progmodel.facets.propparam.specification;
 
-import static org.apache.isis.core.commons.matchers.NofMatchers.anInstanceOf;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.anInstanceOf;
 
 import java.lang.reflect.Method;
 

Modified: incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/oidgenerator/simple/SimpleOidGenerator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/oidgenerator/simple/SimpleOidGenerator.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/oidgenerator/simple/SimpleOidGenerator.java (original)
+++ incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/oidgenerator/simple/SimpleOidGenerator.java Mon Dec  6 15:02:50 2010
@@ -22,7 +22,7 @@ package org.apache.isis.core.runtime.per
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
-import static org.apache.isis.core.commons.matchers.NofMatchers.greaterThan;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.greaterThan;
 
 import org.apache.isis.core.commons.debug.DebugString;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;

Modified: incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodReturnTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodReturnTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodReturnTest.java (original)
+++ incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodReturnTest.java Mon Dec  6 15:02:50 2010
@@ -23,7 +23,7 @@ package org.apache.isis.core.runtime.sys
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
-import static org.apache.isis.core.commons.matchers.NofMatchers.containsElementThat;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.containsElementThat;
 
 import java.lang.reflect.Method;
 import java.util.List;

Modified: incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodsParametersTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodsParametersTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodsParametersTest.java (original)
+++ incubator/isis/trunk/core/runtime/src/test/java/org/apache/isis/core/runtime/system/TypeExtractorMethodsParametersTest.java Mon Dec  6 15:02:50 2010
@@ -28,7 +28,7 @@ import java.lang.reflect.Method;
 import java.util.List;
 
 import org.junit.Test;
-import org.apache.isis.core.commons.matchers.NofMatchers;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
 import org.apache.isis.core.metamodel.specloader.internal.TypeExtractorMethodParameters;
 
 public class TypeExtractorMethodsParametersTest {
@@ -49,8 +49,8 @@ public class TypeExtractorMethodsParamet
         TypeExtractorMethodParameters extractor = new TypeExtractorMethodParameters(method);
 
         assertThat(extractor.getClasses().size(), is(2));
-        assertThat(extractor.getClasses(), NofMatchers.containsElementThat(equalTo(java.util.List.class)));
-        assertThat(extractor.getClasses(), NofMatchers.containsElementThat(equalTo(Customer.class)));
+        assertThat(extractor.getClasses(), IsisMatchers.containsElementThat(equalTo(java.util.List.class)));
+        assertThat(extractor.getClasses(), IsisMatchers.containsElementThat(equalTo(Customer.class)));
     }
 
 

Modified: incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryProcessTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryProcessTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryProcessTest.java (original)
+++ incubator/isis/trunk/examples/metamodel-examples/namefile/src/test/java/org/apache/isis/metamodel/examples/facets/namefile/NameFileFacetFactoryProcessTest.java Mon Dec  6 15:02:50 2010
@@ -36,7 +36,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 import org.apache.isis.core.metamodel.spec.identifier.Identified;
 
-import static org.apache.isis.core.commons.matchers.NofMatchers.anInstanceOf;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.anInstanceOf;
 
 
 

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java (original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java Mon Dec  6 15:02:50 2010
@@ -20,7 +20,7 @@
 
 package org.apache.isis.viewer.junit;
 
-import static org.apache.isis.core.commons.matchers.NofMatchers.classEqualTo;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.classEqualTo;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberHiddenTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberHiddenTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberHiddenTest.java (original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberHiddenTest.java Mon Dec  6 15:02:50 2010
@@ -20,7 +20,7 @@
 
 package org.apache.isis.viewer.junit;
 
-import static org.apache.isis.core.commons.matchers.NofMatchers.classEqualTo;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.classEqualTo;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberInvalidTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberInvalidTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberInvalidTest.java (original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberInvalidTest.java Mon Dec  6 15:02:50 2010
@@ -20,7 +20,7 @@
 
 package org.apache.isis.viewer.junit;
 
-import static org.apache.isis.core.commons.matchers.NofMatchers.classEqualTo;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.classEqualTo;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ObjectImmutableTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ObjectImmutableTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ObjectImmutableTest.java (original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ObjectImmutableTest.java Mon Dec  6 15:02:50 2010
@@ -20,7 +20,7 @@
 
 package org.apache.isis.viewer.junit;
 
-import static org.apache.isis.core.commons.matchers.NofMatchers.classEqualTo;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.classEqualTo;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java?rev=1042671&r1=1042670&r2=1042671&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java (original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java Mon Dec  6 15:02:50 2010
@@ -20,7 +20,7 @@
 
 package org.apache.isis.viewer.junit;
 
-import static org.apache.isis.core.commons.matchers.NofMatchers.classEqualTo;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.classEqualTo;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;



Mime
View raw message