|
From: <ian...@us...> - 2007-08-02 17:49:57
|
Revision: 233
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=233&view=rev
Author: iansmith
Date: 2007-08-02 10:49:59 -0700 (Thu, 02 Aug 2007)
Log Message:
-----------
Minor changes to support cleaner testing in other modules.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/persist/HibernateBase.java
spaces/trunk/src/com/ogoglio/templatesync/SyncToolSpec.java
Added Paths:
-----------
spaces/trunk/src/com/ogoglio/templatesync/OgoglioSpecBase.java
Modified: spaces/trunk/src/com/ogoglio/persist/HibernateBase.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/HibernateBase.java 2007-08-02 03:59:30 UTC (rev 232)
+++ spaces/trunk/src/com/ogoglio/persist/HibernateBase.java 2007-08-02 17:49:59 UTC (rev 233)
@@ -19,15 +19,14 @@
config.setProperty("hibernate.hbm2ddl.auto", autoDDL);
}
- /*
config.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
config.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
- config.setProperty("hibernate.connection.url", "jdbc:mysql://127.0.0.1/space?autoReconnect=true");
- config.setProperty("hibernate.connection.username", "trevor");
- config.setProperty("hibernate.connection.password", "1234");
+ config.setProperty("hibernate.connection.url", "jdbc:mysql://127.0.0.1/og?autoReconnect=true");
+ config.setProperty("hibernate.connection.username", "oguser");
+ config.setProperty("hibernate.connection.password", "sssh");
config.setProperty("hibernate.connection.pool_size", "5");
- */
+ /*
config.setProperty("hibernate.dialect", dialect);
config.setProperty("hibernate.connection.driver_class", driver);
config.setProperty("hibernate.connection.url", URL);
@@ -35,7 +34,7 @@
config.setProperty("hibernate.connection.password", pw);
config.setProperty("hibernate.connection.pool_size", poolSize);
config.setProperty("hibernate.connection.shutdown","true");
-
+ */
sessionFactory = config.buildSessionFactory();
}
Added: spaces/trunk/src/com/ogoglio/templatesync/OgoglioSpecBase.java
===================================================================
--- spaces/trunk/src/com/ogoglio/templatesync/OgoglioSpecBase.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/templatesync/OgoglioSpecBase.java 2007-08-02 17:49:59 UTC (rev 233)
@@ -0,0 +1,25 @@
+package com.ogoglio.templatesync;
+
+import com.agical.rmock.extension.junit.RMockTestCase;
+
+public class OgoglioSpecBase extends RMockTestCase {
+
+ public Object mock_ignoreEqualsAndToString(Class clazz) {
+ return mock_ignoreEqualsAndToString(clazz,new Object[0], "mockOf:"+clazz.getName());
+ }
+ public Object mock_ignoreEqualsAndToString(Class clazz, Object[] constructorParams, String name) {
+ Object result = mock(clazz,constructorParams,name);
+
+ result.equals(null);//RMock uses this internally during comparisons for checking param args!
+ modify().args(is.instanceOf(clazz));
+ modify().multiplicity(expect.atLeast(0)); //thus, it's ignored
+ modify().returnValue(true);
+
+ result.toString(); //RMock uses this for printing error reports
+ modify().multiplicity(expect.atLeast(0)); //thus, ignored
+ modify().returnValue("MOCK:"+name+"");
+
+ return result;
+ }
+
+}
Modified: spaces/trunk/src/com/ogoglio/templatesync/SyncToolSpec.java
===================================================================
--- spaces/trunk/src/com/ogoglio/templatesync/SyncToolSpec.java 2007-08-02 03:59:30 UTC (rev 232)
+++ spaces/trunk/src/com/ogoglio/templatesync/SyncToolSpec.java 2007-08-02 17:49:59 UTC (rev 233)
@@ -20,7 +20,7 @@
import com.ogoglio.xml.AuthDocument;
import com.ogoglio.xml.TemplateDocument;
-public class SyncToolSpec extends RMockTestCase {
+public class SyncToolSpec extends OgoglioSpecBase {
public SyncTool mockSyncTool;
public WebAPIClient client;
@@ -474,20 +474,6 @@
modify().forward();
}
- private Object mock_ignoreEqualsAndToString(Class clazz, Object[] constructorParams, String name) {
- Object result = mock(clazz,constructorParams,name);
-
- result.equals(null);//RMock uses this internally during comparisons for checking param args!
- modify().args(is.instanceOf(clazz));
- modify().multiplicity(expect.atLeast(0)); //thus, it's ignored
- modify().returnValue(true);
-
- result.toString(); //RMock uses this for printing error reports
- modify().multiplicity(expect.atLeast(0)); //thus, ignored
- modify().returnValue("MOCK:"+name+"");
-
- return result;
- }
private void threeCallsOfFileOk(File mockOne, File mockTwo, File mockThree, TypedFileComparator c, boolean fwd,
boolean ok) {
//THIS IS HIDEOUS REPETITION
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|