This list is closed, nobody may subscribe to it.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(99) |
Feb
(163) |
Mar
(3) |
Apr
(33) |
May
(8) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
|
Jun
(16) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Choy R. <ch...@us...> - 2005-02-18 06:37:43
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13400/DotNetMock.Tests Modified Files: DotNetMock.Tests.csproj Log Message: Started adding one of Roman's ideas to the codebase. A modified version of his MethodCall class that doesn't use MethodSignature (yet). Unclear whether we'll need MethodSignature. Index: DotNetMock.Tests.csproj =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/DotNetMock.Tests.csproj,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DotNetMock.Tests.csproj 16 Feb 2005 10:39:25 -0000 1.17 --- DotNetMock.Tests.csproj 18 Feb 2005 06:37:34 -0000 1.18 *************** *** 186,189 **** --- 186,194 ---- /> <File + RelPath = "Dynamic\MethodCallTests.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Dynamic\PredicateTests.cs" SubType = "Code" |
From: Choy R. <ch...@us...> - 2005-02-18 02:16:17
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16061/DotNetMock/Dynamic Modified Files: ExpectationMethod.cs Log Message: Provide name of argument that did not satisfy predicate in AssertionException. Index: ExpectationMethod.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/ExpectationMethod.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ExpectationMethod.cs 18 Feb 2005 00:41:52 -0000 1.15 --- ExpectationMethod.cs 18 Feb 2005 02:16:08 -0000 1.16 *************** *** 190,193 **** --- 190,218 ---- )); } + // check if the actual argument count is correct + // TODO: ideally this would be done in the constructor if possible + ParameterInfo[] pis = ActualMethod.GetParameters(); + if ( pis.Length!=_actualMethodArguments.Length ) + { + throw new InvalidOperationException(String.Format( + "Method {0} takes {1} arguments but received {2}.", + ActualMethodName, + pis.Length, + _actualMethodArguments.Length + )); + } + /* cannot check that actual args size matches expected + * because we want to be able to expect using just method name + if ( _actualMethodArguments.Length!=_expectedMethodArguments.Length) + { + Assertion.Fail(String.Format( + "Expected {0} arguments but received {1} "+ + "in method call {2}({3}).", + _expectedMethodArguments.Length, + _actualMethodArguments.Length, + ActualMethodName, argsToString(_actualMethodArguments) + )); + } + */ // assert that each passed in arg is validated by the appropriate predicate. *************** *** 195,212 **** { object argumentExpectation = _expectedMethodArguments[i]; ! object actualArg = _actualMethodArguments[i]; // evaluate whether input expectations have been met IPredicate predicate = PredicateUtils.ConvertFrom(argumentExpectation); ! // wasteful but good as a first cut at better error messages ! string failureMessage = String.Format( ! "Failed to satisfy '{0}' on argument {1} of method call {2}({3})", ! predicate, ! i, ! ExpectedMethodName, ! argsToString(_actualMethodArguments) ! ); ! Assertion.Assert(failureMessage, predicate.Eval(actualArg)); // return output expectations if specified IArgumentMutator mutator = --- 220,243 ---- { object argumentExpectation = _expectedMethodArguments[i]; ! object actualArgument = _actualMethodArguments[i]; // evaluate whether input expectations have been met IPredicate predicate = PredicateUtils.ConvertFrom(argumentExpectation); ! bool isPredicateSatisfied = ! predicate.Eval(actualArgument); ! if ( ! isPredicateSatisfied ) ! { ! ParameterInfo pi = pis[i]; ! Assertion.Fail(String.Format( ! "Failed to satisfy '{0}' on argument {2} ({1}) "+ ! "of method call {3}({4})", ! predicate, ! pi.Name, ! i, ! ExpectedMethodName, ! argsToString(_actualMethodArguments) ! )); ! } // return output expectations if specified IArgumentMutator mutator = |
From: Choy R. <ch...@us...> - 2005-02-18 02:16:16
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16061/DotNetMock.Tests/Dynamic Modified Files: AbstractDynamicMockTests.cs ExpectationMethodTests.cs Log Message: Provide name of argument that did not satisfy predicate in AssertionException. Index: ExpectationMethodTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/ExpectationMethodTests.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ExpectationMethodTests.cs 17 Feb 2005 05:29:38 -0000 1.9 --- ExpectationMethodTests.cs 18 Feb 2005 02:16:08 -0000 1.10 *************** *** 55,59 **** } [Test] ! [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (1)' on argument 0 of method call Method2(3, 2, 1)")] public void DecentErrorMessageWhenPredicateFails() { --- 55,59 ---- } [Test] ! [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (1)' on argument 0 (x) of method call Method2(3, 2, 1)")] public void DecentErrorMessageWhenPredicateFails() { *************** *** 63,67 **** } [Test] ! [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (2)' on argument 1 of method call Method2(1, 3, 2)")] public void DecentErrorMessageWhenPredicateFailsOnSecondArgument() { --- 63,67 ---- } [Test] ! [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (2)' on argument 1 (y) of method call Method2(1, 3, 2)")] public void DecentErrorMessageWhenPredicateFailsOnSecondArgument() { *************** *** 85,88 **** --- 85,112 ---- _expectedMethod.Verify(); } + [Test] + [ExpectedException( + typeof(InvalidOperationException), + "Method Method2 takes 3 arguments but received 2." + )] + public void ArgumentCountontMatchMethodSignature() + { + _expectedMethod = new ExpectationMethod(method2.Name, null, new object[] { 1, 2, 3 }); + _expectedMethod.SetActualMethodCall(method2, 1, 3); + _expectedMethod.Verify(); + } + /* + [Test] + [ExpectedException( + typeof(AssertionException), + "Expected 2 arguments but received 3 in method call Method2(1, 2, 3)." + )] + public void ActualArgumentLengthDoesntMatchExpected() + { + _expectedMethod = new ExpectationMethod(method2.Name, null, new object[] { 1, 2 }); + _expectedMethod.SetActualMethodCall(method2, 1, 2, 3); + _expectedMethod.Verify(); + } + */ } } Index: AbstractDynamicMockTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/AbstractDynamicMockTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractDynamicMockTests.cs 12 Feb 2005 18:10:36 -0000 1.2 --- AbstractDynamicMockTests.cs 18 Feb 2005 02:16:08 -0000 1.3 *************** *** 22,25 **** --- 22,27 ---- protected MethodInfo myMethod3; protected MethodInfo anotherMethod; + protected MethodInfo method0; + protected MethodInfo method1; /// <summary> *************** *** 43,46 **** --- 45,50 ---- void myMethod3(); void anotherMethod(); + void Method0(object p0, object p1); + object Method1(object p0); } *************** *** 53,56 **** --- 57,62 ---- myMethod3 = typeof(IBlah).GetMethod("myMethod3", new Type[0]); anotherMethod = typeof(IBlah).GetMethod("anotherMethod", new Type[0]); + method0 = typeof(IBlah).GetMethod("Method0"); + method1 = typeof(IBlah).GetMethod("Method1"); } *************** *** 189,194 **** public void CallToMethodWithParams() { ! mock.Expect("myMethod", new IsEqual("hello"), new IsAnything()); ! mock.Call(myMethod, "hello", null); mock.Verify(); } --- 195,200 ---- public void CallToMethodWithParams() { ! mock.Expect("Method0", new IsEqual("hello"), new IsAnything()); ! mock.Call(method0, "hello", null); mock.Verify(); } *************** *** 197,202 **** public void CallToMethodWithInvalidParams() { ! mock.Expect("myMethod", new IsEqual("hello"), new IsAnything()); ! mock.Call(myMethod, "world", null); } --- 203,208 ---- public void CallToMethodWithInvalidParams() { ! mock.Expect("Method0", new IsEqual("hello"), new IsAnything()); ! mock.Call(method0, "world", null); } *************** *** 204,209 **** public void CallToMethodWithParamsButNotCheckingValues() { ! mock.Expect("myMethod"); ! mock.Call(myMethod, "world", null); mock.Verify(); } --- 210,215 ---- public void CallToMethodWithParamsButNotCheckingValues() { ! mock.Expect("Method0"); ! mock.Call(method0, "world", null); mock.Verify(); } *************** *** 235,240 **** { object something = new object(); ! mock.ExpectAndReturn("myMethod", something, new IsEqual("hello")); ! object result = mock.Call(myMethod, "hello"); mock.Verify(); Assert.AreEqual(something, result); --- 241,246 ---- { object something = new object(); ! mock.ExpectAndReturn("Method1", something, new IsEqual("hello")); ! object result = mock.Call(method1, "hello"); mock.Verify(); Assert.AreEqual(something, result); *************** *** 246,251 **** { object something = new object(); ! mock.ExpectAndReturn("myMethod", something, new IsEqual("hello")); ! object result = mock.Call(myMethod, "bye"); mock.Verify(); Assert.AreEqual(something, result); --- 252,257 ---- { object something = new object(); ! mock.ExpectAndReturn("Method1", something, new IsEqual("hello")); ! object result = mock.Call(method1, "bye"); mock.Verify(); Assert.AreEqual(something, result); *************** *** 279,284 **** { object o = new object(); ! mock.Expect("myMethod", o); ! mock.Call(myMethod, o); } --- 285,290 ---- { object o = new object(); ! mock.Expect("Method1", o); ! mock.Call(method1, o); } *************** *** 287,292 **** public void DefaultEqualsPredicatesFailure() { ! mock.Expect("myMethod", new object()); ! mock.Call(myMethod, new object()); } --- 293,298 ---- public void DefaultEqualsPredicatesFailure() { ! mock.Expect("Method1", new object()); ! mock.Call(method1, new object()); } *************** *** 294,303 **** public void DefaultAnythingPredicates() { ! mock.Expect("myMethod", null, null); ! mock.Expect("myMethod", null, "zzz"); ! mock.Expect("myMethod", "zzz", null); ! mock.Call(myMethod, "???", "???"); ! mock.Call(myMethod, "???", "zzz"); ! mock.Call(myMethod, "zzz", "???"); } --- 300,309 ---- public void DefaultAnythingPredicates() { ! mock.Expect("Method0", null, null); ! mock.Expect("Method0", null, "zzz"); ! mock.Expect("Method0", "zzz", null); ! mock.Call(method0, "???", "???"); ! mock.Call(method0, "???", "zzz"); ! mock.Call(method0, "zzz", "???"); } |
From: Choy R. <ch...@us...> - 2005-02-18 00:42:01
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22271/DotNetMock/Dynamic Modified Files: ExpectationMethod.cs Log Message: Refactor: rename couple members to clarify the separation between expected values and actual values. Index: ExpectationMethod.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/ExpectationMethod.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ExpectationMethod.cs 17 Feb 2005 05:29:38 -0000 1.14 --- ExpectationMethod.cs 18 Feb 2005 00:41:52 -0000 1.15 *************** *** 27,35 **** /// Arguments to the method that was called /// </summary> ! private object[] _methodArguments; /// <summary> ! /// Possible return value for this method call /// </summary> ! private object _returnValue; /// <summary> /// Exception to throw when the method is called --- 27,35 ---- /// Arguments to the method that was called /// </summary> ! private object[] _actualMethodArguments; /// <summary> ! /// Expected return value for this method call if any. /// </summary> ! private object _expectedReturnValue; /// <summary> /// Exception to throw when the method is called *************** *** 77,81 **** } ! _returnValue = returnValue; _expectedException = expectedException; } --- 77,81 ---- } ! _expectedReturnValue = returnValue; _expectedException = expectedException; } *************** *** 92,96 **** public object ReturnValue { ! get { return _returnValue; } } /// <summary> --- 92,96 ---- public object ReturnValue { ! get { return _expectedReturnValue; } } /// <summary> *************** *** 141,145 **** { _actualMethod = actualMethod; ! _methodArguments = actualArguments; } //TODO: Refactor methods --- 141,145 ---- { _actualMethod = actualMethod; ! _actualMethodArguments = actualArguments; } //TODO: Refactor methods *************** *** 187,191 **** "{0}({1}) expected, but {2}({3}) called.", ExpectedMethodName, argsToString(_expectedMethodArguments), ! ActualMethodName, argsToString(_methodArguments) )); } --- 187,191 ---- "{0}({1}) expected, but {2}({3}) called.", ExpectedMethodName, argsToString(_expectedMethodArguments), ! ActualMethodName, argsToString(_actualMethodArguments) )); } *************** *** 195,199 **** { object argumentExpectation = _expectedMethodArguments[i]; ! object actualArg = _methodArguments[i]; // evaluate whether input expectations have been met --- 195,199 ---- { object argumentExpectation = _expectedMethodArguments[i]; ! object actualArg = _actualMethodArguments[i]; // evaluate whether input expectations have been met *************** *** 206,210 **** i, ExpectedMethodName, ! argsToString(_methodArguments) ); Assertion.Assert(failureMessage, predicate.Eval(actualArg)); --- 206,210 ---- i, ExpectedMethodName, ! argsToString(_actualMethodArguments) ); Assertion.Assert(failureMessage, predicate.Eval(actualArg)); *************** *** 214,218 **** if ( mutator!=null ) { ! mutator.Mutate(ref _methodArguments[i]); } } --- 214,218 ---- if ( mutator!=null ) { ! mutator.Mutate(ref _actualMethodArguments[i]); } } |
From: Choy R. <ch...@us...> - 2005-02-17 05:29:46
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3352/DotNetMock/Dynamic Modified Files: DynamicMock.cs DynamicOrderedMock.cs ExpectationMethod.cs Log Message: Record MethodInfo of actual method call instead of just method name. This will allow us to have even better assertion failure messages. And probably other benefits I can't think of right now. Index: DynamicOrderedMock.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/DynamicOrderedMock.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DynamicOrderedMock.cs 17 Feb 2005 04:44:17 -0000 1.6 --- DynamicOrderedMock.cs 17 Feb 2005 05:29:38 -0000 1.7 *************** *** 62,66 **** ExpectationMethod e = (ExpectationMethod)expectations[0]; expectations.RemoveAt(0); ! e.SetActualMethodCall(methodName, args); e.Verify(); return e.ReturnValue; --- 62,66 ---- ExpectationMethod e = (ExpectationMethod)expectations[0]; expectations.RemoveAt(0); ! e.SetActualMethodCall(mi, args); e.Verify(); return e.ReturnValue; Index: DynamicMock.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/DynamicMock.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DynamicMock.cs 17 Feb 2005 04:44:17 -0000 1.14 --- DynamicMock.cs 17 Feb 2005 05:29:38 -0000 1.15 *************** *** 205,209 **** ExpectationMethod e = (ExpectationMethod)list[0]; list.RemoveAt(0); ! e.SetActualMethodCall(methodName, args); e.Verify(); return e.ReturnValue; --- 205,209 ---- ExpectationMethod e = (ExpectationMethod)list[0]; list.RemoveAt(0); ! e.SetActualMethodCall(mi, args); e.Verify(); return e.ReturnValue; Index: ExpectationMethod.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/ExpectationMethod.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ExpectationMethod.cs 17 Feb 2005 04:44:17 -0000 1.13 --- ExpectationMethod.cs 17 Feb 2005 05:29:38 -0000 1.14 *************** *** 1,4 **** --- 1,11 ---- + #region License + // Copyright (c) 2004 Griffin Caprio & Choy Rim. All rights reserved. + #endregion + #region Imports using System; + using System.Reflection; + using DotNetMock.Dynamic.Predicates; + #endregion namespace DotNetMock.Dynamic *************** *** 14,21 **** private string _expectedMethodName; /// <summary> - /// Method Name of the called method - /// </summary> - private string _methodName; - /// <summary> /// Any expected arguments for the expected method call /// </summary> --- 21,24 ---- *************** *** 34,37 **** --- 37,44 ---- private Exception _expectedException; /// <summary> + /// <see cref="MethodInfo"/> of actual method call. + /// </summary> + private MethodInfo _actualMethod = null; + /// <summary> /// Default Constructor /// </summary> *************** *** 88,99 **** } /// <summary> ! /// Sets this expectations actual method name and method arguments /// </summary> ! /// <param name="methodName">Method Name</param> ! /// <param name="methodArguments">Arguments</param> ! public void SetActualMethodCall( string methodName, params object[] methodArguments ) { ! _methodName = methodName; ! _methodArguments = methodArguments; } //TODO: Refactor methods --- 95,145 ---- } /// <summary> ! /// True if actual method call was set. ! /// <seealso cref="SetActualMethodCall"/> /// </summary> ! public bool ActualMethodCallWasSet { ! get { return _actualMethod!=null; } ! } ! /// <summary> ! /// <see cref="MethodInfo"/> of actual method called. ! /// </summary> ! public MethodInfo ActualMethod ! { ! get ! { ! if ( ! ActualMethodCallWasSet ) ! { ! throw new InvalidOperationException( ! "Cannot access ActualMethod property "+ ! "before SetActualMethodCall" ! ); ! } ! return _actualMethod; ! } ! } ! /// <summary> ! /// Name of actual method called. ! /// </summary> ! public string ActualMethodName ! { ! get { ! string name = ActualMethod.Name; ! if ( name.StartsWith("get_") || name.StartsWith("set_") ) ! { ! name = name.Substring(4); ! } ! return name; ! } ! } ! /// <summary> ! /// Set actual method call <see cref="MethodInfo"/> and arguments. ! /// </summary> ! /// <param name="actualMethod">actual method</param> ! /// <param name="actualArguments">actual arguments</param> ! public void SetActualMethodCall( MethodInfo actualMethod, params object[] actualArguments ) ! { ! _actualMethod = actualMethod; ! _methodArguments = actualArguments; } //TODO: Refactor methods *************** *** 128,134 **** public override void Verify() { ! if( ExpectedMethodName != _methodName ) { ! Assertion.Fail( ExpectedMethodName + "(" + argsToString(_expectedMethodArguments) + ") expected, but " + _methodName + "(" + argsToString(_methodArguments) + ") called" ); } --- 174,192 ---- public override void Verify() { ! if ( ! ActualMethodCallWasSet ) { ! Assertion.Fail(String.Format( ! "{0}({1}) expected but never called.", ! ExpectedMethodName, ! argsToString(_expectedMethodArguments) ! )); ! } ! if( ExpectedMethodName != ActualMethodName ) ! { ! Assertion.Fail(String.Format( ! "{0}({1}) expected, but {2}({3}) called.", ! ExpectedMethodName, argsToString(_expectedMethodArguments), ! ActualMethodName, argsToString(_methodArguments) ! )); } |
From: Choy R. <ch...@us...> - 2005-02-17 05:29:46
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3352/DotNetMock.Tests/Dynamic Modified Files: ExpectationMethodTests.cs Log Message: Record MethodInfo of actual method call instead of just method name. This will allow us to have even better assertion failure messages. And probably other benefits I can't think of right now. Index: ExpectationMethodTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/ExpectationMethodTests.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExpectationMethodTests.cs 17 Feb 2005 04:44:17 -0000 1.8 --- ExpectationMethodTests.cs 17 Feb 2005 05:29:38 -0000 1.9 *************** *** 1,4 **** --- 1,13 ---- + #region License + // Copyright (c) 2004 Griffin Caprio & Choy Rim. All rights reserved. + #endregion + #region Imports + using System; + using System.Reflection; + using NUnit.Framework; + using DotNetMock.Dynamic; + #endregion namespace DotNetMock.Tests.Dynamic *************** *** 9,12 **** --- 18,30 ---- private ExpectationMethod _expectedMethod = null; + private interface IMethods + { + void Method1(); + void Method2(int x, int y, int z); + } + + static readonly MethodInfo method1 = typeof(IMethods).GetMethod("Method1"); + static readonly MethodInfo method2 = typeof(IMethods).GetMethod("Method2"); + [TearDown] public void Destroy() *************** *** 17,22 **** public void ExpectationMethodVoid() { ! _expectedMethod = new ExpectationMethod( "myMethod" ); ! _expectedMethod.SetActualMethodCall( "myMethod" ); _expectedMethod.Verify(); } --- 35,40 ---- public void ExpectationMethodVoid() { ! _expectedMethod = new ExpectationMethod(method1.Name); ! _expectedMethod.SetActualMethodCall(method1); _expectedMethod.Verify(); } *************** *** 25,29 **** public void ExpectationMethodVoidNoCall() { ! _expectedMethod = new ExpectationMethod( "myMethod" ); _expectedMethod.Verify(); } --- 43,47 ---- public void ExpectationMethodVoidNoCall() { ! _expectedMethod = new ExpectationMethod(method1.Name); _expectedMethod.Verify(); } *************** *** 31,53 **** public void ExpectedMethodReturnValue() { ! _expectedMethod = new ExpectationMethod( "myMethod", true ); ! _expectedMethod.SetActualMethodCall("myMethod"); Assert.IsTrue((bool)_expectedMethod.ReturnValue); _expectedMethod.Verify(); } [Test] ! [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (1)' on argument 0 of method call myMethod(3, 2, 1)")] public void DecentErrorMessageWhenPredicateFails() { ! _expectedMethod = new ExpectationMethod("myMethod", null, new object[] { 1, 2, 3 }); ! _expectedMethod.SetActualMethodCall("myMethod", new object[] { 3, 2, 1 }); _expectedMethod.Verify(); } [Test] ! [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (2)' on argument 1 of method call myMethod(1, 3, 2)")] public void DecentErrorMessageWhenPredicateFailsOnSecondArgument() { ! _expectedMethod = new ExpectationMethod("myMethod", null, new object[] { 1, 2, 3 }); ! _expectedMethod.SetActualMethodCall("myMethod", new object[] { 1, 3, 2 }); _expectedMethod.Verify(); } --- 49,86 ---- public void ExpectedMethodReturnValue() { ! _expectedMethod = new ExpectationMethod(method1.Name, true ); ! _expectedMethod.SetActualMethodCall(method1); Assert.IsTrue((bool)_expectedMethod.ReturnValue); _expectedMethod.Verify(); } [Test] ! [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (1)' on argument 0 of method call Method2(3, 2, 1)")] public void DecentErrorMessageWhenPredicateFails() { ! _expectedMethod = new ExpectationMethod(method2.Name, null, new object[] { 1, 2, 3 }); ! _expectedMethod.SetActualMethodCall(method2, 3, 2, 1); _expectedMethod.Verify(); } [Test] ! [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (2)' on argument 1 of method call Method2(1, 3, 2)")] public void DecentErrorMessageWhenPredicateFailsOnSecondArgument() { ! _expectedMethod = new ExpectationMethod(method2.Name, null, new object[] { 1, 2, 3 }); ! _expectedMethod.SetActualMethodCall(method2, 1, 3, 2); ! _expectedMethod.Verify(); ! } ! [Test] ! [ExpectedException(typeof(InvalidOperationException))] ! public void AccessingActualMethodPropertyBeforeSetting() ! { ! _expectedMethod = new ExpectationMethod(method1.Name); ! MethodInfo mi = _expectedMethod.ActualMethod; ! } ! [Test] ! [ExpectedException(typeof(AssertionException), "Method1() expected, but Method2() called.")] ! public void WrongMethodCalled() ! { ! _expectedMethod = new ExpectationMethod(method1.Name); ! _expectedMethod.SetActualMethodCall(method2); _expectedMethod.Verify(); } |
From: Choy R. <ch...@us...> - 2005-02-17 04:44:25
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26909/DotNetMock/Dynamic Modified Files: DynamicMock.cs DynamicOrderedMock.cs ExpectationMethod.cs Log Message: Refactor: rename method for more clarity. it impliies more refactoring is necessary. like being able to set an Actual property which is of type MethodCall. Index: DynamicOrderedMock.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/DynamicOrderedMock.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DynamicOrderedMock.cs 1 Jan 2005 22:58:07 -0000 1.5 --- DynamicOrderedMock.cs 17 Feb 2005 04:44:17 -0000 1.6 *************** *** 62,66 **** ExpectationMethod e = (ExpectationMethod)expectations[0]; expectations.RemoveAt(0); ! e.Call(methodName, args); e.Verify(); return e.ReturnValue; --- 62,66 ---- ExpectationMethod e = (ExpectationMethod)expectations[0]; expectations.RemoveAt(0); ! e.SetActualMethodCall(methodName, args); e.Verify(); return e.ReturnValue; Index: DynamicMock.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/DynamicMock.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DynamicMock.cs 1 Jan 2005 22:58:07 -0000 1.13 --- DynamicMock.cs 17 Feb 2005 04:44:17 -0000 1.14 *************** *** 205,209 **** ExpectationMethod e = (ExpectationMethod)list[0]; list.RemoveAt(0); ! e.Call(methodName, args); e.Verify(); return e.ReturnValue; --- 205,209 ---- ExpectationMethod e = (ExpectationMethod)list[0]; list.RemoveAt(0); ! e.SetActualMethodCall(methodName, args); e.Verify(); return e.ReturnValue; Index: ExpectationMethod.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/ExpectationMethod.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ExpectationMethod.cs 17 Feb 2005 04:34:02 -0000 1.12 --- ExpectationMethod.cs 17 Feb 2005 04:44:17 -0000 1.13 *************** *** 92,96 **** /// <param name="methodName">Method Name</param> /// <param name="methodArguments">Arguments</param> ! public void Call( string methodName, params object[] methodArguments ) { _methodName = methodName; --- 92,96 ---- /// <param name="methodName">Method Name</param> /// <param name="methodArguments">Arguments</param> ! public void SetActualMethodCall( string methodName, params object[] methodArguments ) { _methodName = methodName; |
From: Choy R. <ch...@us...> - 2005-02-17 04:44:25
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26909/DotNetMock.Tests/Dynamic Modified Files: ExpectationMethodTests.cs Log Message: Refactor: rename method for more clarity. it impliies more refactoring is necessary. like being able to set an Actual property which is of type MethodCall. Index: ExpectationMethodTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/ExpectationMethodTests.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ExpectationMethodTests.cs 16 Feb 2005 10:39:25 -0000 1.7 --- ExpectationMethodTests.cs 17 Feb 2005 04:44:17 -0000 1.8 *************** *** 18,22 **** { _expectedMethod = new ExpectationMethod( "myMethod" ); ! _expectedMethod.Call( "myMethod" ); _expectedMethod.Verify(); } --- 18,22 ---- { _expectedMethod = new ExpectationMethod( "myMethod" ); ! _expectedMethod.SetActualMethodCall( "myMethod" ); _expectedMethod.Verify(); } *************** *** 32,36 **** { _expectedMethod = new ExpectationMethod( "myMethod", true ); ! _expectedMethod.Call("myMethod"); Assert.IsTrue((bool)_expectedMethod.ReturnValue); _expectedMethod.Verify(); --- 32,36 ---- { _expectedMethod = new ExpectationMethod( "myMethod", true ); ! _expectedMethod.SetActualMethodCall("myMethod"); Assert.IsTrue((bool)_expectedMethod.ReturnValue); _expectedMethod.Verify(); *************** *** 41,45 **** { _expectedMethod = new ExpectationMethod("myMethod", null, new object[] { 1, 2, 3 }); ! _expectedMethod.Call("myMethod", new object[] { 3, 2, 1 }); _expectedMethod.Verify(); } --- 41,45 ---- { _expectedMethod = new ExpectationMethod("myMethod", null, new object[] { 1, 2, 3 }); ! _expectedMethod.SetActualMethodCall("myMethod", new object[] { 3, 2, 1 }); _expectedMethod.Verify(); } *************** *** 49,53 **** { _expectedMethod = new ExpectationMethod("myMethod", null, new object[] { 1, 2, 3 }); ! _expectedMethod.Call("myMethod", new object[] { 1, 3, 2 }); _expectedMethod.Verify(); } --- 49,53 ---- { _expectedMethod = new ExpectationMethod("myMethod", null, new object[] { 1, 2, 3 }); ! _expectedMethod.SetActualMethodCall("myMethod", new object[] { 1, 3, 2 }); _expectedMethod.Verify(); } |
From: Choy R. <ch...@us...> - 2005-02-17 04:34:11
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24779/DotNetMock/Dynamic Modified Files: ExpectationMethod.cs Log Message: Refactor: combined two overloads of Call() Index: ExpectationMethod.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/ExpectationMethod.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ExpectationMethod.cs 16 Feb 2005 10:39:26 -0000 1.11 --- ExpectationMethod.cs 17 Feb 2005 04:34:02 -0000 1.12 *************** *** 92,108 **** /// <param name="methodName">Method Name</param> /// <param name="methodArguments">Arguments</param> ! public void Call( string methodName, object[] methodArguments ) { _methodName = methodName; _methodArguments = methodArguments; } - /// <summary> - /// Calls the input method on this expectation - /// </summary> - /// <param name="methodName">Method name to call</param> - public void Call( string methodName ) - { - Call( methodName, null ); - } //TODO: Refactor methods private string argsToString( object[] args ) --- 92,100 ---- /// <param name="methodName">Method Name</param> /// <param name="methodArguments">Arguments</param> ! public void Call( string methodName, params object[] methodArguments ) { _methodName = methodName; _methodArguments = methodArguments; } //TODO: Refactor methods private string argsToString( object[] args ) |
From: Choy R. <ch...@us...> - 2005-02-16 10:59:33
|
Update of /cvsroot/dotnetmock/dotnetmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21554 Modified Files: DotNetMock.build Log Message: Only need MbUnit NAnt task now that we're using NAnt 0.85 rc2 Index: DotNetMock.build =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.build,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** DotNetMock.build 12 Feb 2005 18:54:07 -0000 1.22 --- DotNetMock.build 16 Feb 2005 10:59:23 -0000 1.23 *************** *** 49,53 **** </target> <target name="mbunit" depends="build"> - <!-- cannot use MbUnit.Tasks because it requires NAnt 0.85 --> <loadtasks assembly="${mbunit.dir}/MbUnit.Tasks.dll"/> <mbunit --- 49,52 ---- *************** *** 60,67 **** </assemblies> </mbunit> - <exec program="${mbunit.dir}/MbUnit.Cons.exe" workingdir="${build.dir}"> - <arg value="/report-type:Text" /> - <arg value="DotNetMock.Examples.MbUnitTests.dll" /> - </exec> </target> <target name="build" description="Builds .NET Mock Object modules" depends="init"> --- 59,62 ---- |
From: Choy R. <ch...@us...> - 2005-02-16 10:39:42
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16618/DotNetMock.Tests/Dynamic Modified Files: ExpectationMethodTests.cs PredicateTests.cs Log Message: RFE 1108902 - The cheapest way to make the error messages nicer. - Identify the method call that failed and the argument index that failed. - For a couple predicates (IsNull & IsEqual) provide more info through the ToString() method. - Need to add more ToString implementations for the rest of the predicates. - Roman's MethodCall abstraction is useful here. stringification of method calls could be done there. Index: ExpectationMethodTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/ExpectationMethodTests.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExpectationMethodTests.cs 12 Feb 2005 18:10:36 -0000 1.6 --- ExpectationMethodTests.cs 16 Feb 2005 10:39:25 -0000 1.7 *************** *** 36,39 **** --- 36,55 ---- _expectedMethod.Verify(); } + [Test] + [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (1)' on argument 0 of method call myMethod(3, 2, 1)")] + public void DecentErrorMessageWhenPredicateFails() + { + _expectedMethod = new ExpectationMethod("myMethod", null, new object[] { 1, 2, 3 }); + _expectedMethod.Call("myMethod", new object[] { 3, 2, 1 }); + _expectedMethod.Verify(); + } + [Test] + [ExpectedException(typeof(AssertionException), "Failed to satisfy 'value equals (2)' on argument 1 of method call myMethod(1, 3, 2)")] + public void DecentErrorMessageWhenPredicateFailsOnSecondArgument() + { + _expectedMethod = new ExpectationMethod("myMethod", null, new object[] { 1, 2, 3 }); + _expectedMethod.Call("myMethod", new object[] { 1, 3, 2 }); + _expectedMethod.Verify(); + } } } Index: PredicateTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/PredicateTests.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PredicateTests.cs 12 Feb 2005 18:10:36 -0000 1.12 --- PredicateTests.cs 16 Feb 2005 10:39:25 -0000 1.13 *************** *** 11,15 **** { private IPredicate p; ! [Test] public void IsNull() --- 11,24 ---- { private IPredicate p; ! ! [Test] public void IsNullToString() ! { ! Assert.AreEqual("value is null", new IsNull().ToString()); ! } ! [Test] public void IsEqualToString() ! { ! Assert.AreEqual("value equals (3)", new IsEqual(3).ToString()); ! Assert.AreEqual("value equals (whatever it is)", new IsEqual("whatever it is").ToString()); ! } [Test] public void IsNull() |
From: Choy R. <ch...@us...> - 2005-02-16 10:39:42
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16618/DotNetMock/Dynamic Modified Files: ExpectationMethod.cs Log Message: RFE 1108902 - The cheapest way to make the error messages nicer. - Identify the method call that failed and the argument index that failed. - For a couple predicates (IsNull & IsEqual) provide more info through the ToString() method. - Need to add more ToString implementations for the rest of the predicates. - Roman's MethodCall abstraction is useful here. stringification of method calls could be done there. Index: ExpectationMethod.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/ExpectationMethod.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ExpectationMethod.cs 5 Jan 2005 00:29:36 -0000 1.10 --- ExpectationMethod.cs 16 Feb 2005 10:39:26 -0000 1.11 *************** *** 110,123 **** if ( args != null && args.Length > 0 ) { ! string argStr = ""; ! foreach( object o in args ) { ! if( o is System.String ) ! argStr = argStr + ", \"" + o.ToString() + "\""; ! else ! argStr = argStr + ", " + o.ToString(); ! } ! return argStr.Substring(2); } return String.Empty; --- 110,131 ---- if ( args != null && args.Length > 0 ) { ! string[] argText = new string[args.Length]; ! for (int i=0; i<args.Length; ++i) { ! object arg = args[i]; ! if ( object.ReferenceEquals(arg, null) ) ! { ! argText[i] = "null"; ! } ! else if( arg is string ) ! { ! argText[i] = "\"" + arg.ToString() + "\""; ! } ! else ! { ! argText[i] = arg.ToString(); ! } } ! return String.Join(", ", argText); } return String.Empty; *************** *** 142,146 **** IPredicate predicate = PredicateUtils.ConvertFrom(argumentExpectation); ! Assertion.Assert(predicate.Eval(actualArg)); // return output expectations if specified IArgumentMutator mutator = --- 150,162 ---- IPredicate predicate = PredicateUtils.ConvertFrom(argumentExpectation); ! // wasteful but good as a first cut at better error messages ! string failureMessage = String.Format( ! "Failed to satisfy '{0}' on argument {1} of method call {2}({3})", ! predicate, ! i, ! ExpectedMethodName, ! argsToString(_methodArguments) ! ); ! Assertion.Assert(failureMessage, predicate.Eval(actualArg)); // return output expectations if specified IArgumentMutator mutator = |
From: Choy R. <ch...@us...> - 2005-02-16 10:39:41
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/Predicates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16618/DotNetMock/Dynamic/Predicates Modified Files: IsEqual.cs IsNull.cs Log Message: RFE 1108902 - The cheapest way to make the error messages nicer. - Identify the method call that failed and the argument index that failed. - For a couple predicates (IsNull & IsEqual) provide more info through the ToString() method. - Need to add more ToString implementations for the rest of the predicates. - Roman's MethodCall abstraction is useful here. stringification of method calls could be done there. Index: IsEqual.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/Predicates/IsEqual.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IsEqual.cs 1 Jan 2005 21:13:54 -0000 1.5 --- IsEqual.cs 16 Feb 2005 10:39:26 -0000 1.6 *************** *** 17,20 **** --- 17,30 ---- _compare = compare; } + + /// <summary> + /// The condition this evaluates as text. + /// </summary> + /// <returns>"value equals (xxx)"</returns> + public override string ToString() + { + return String.Format("value equals ({0})", _compare); + } + /// <summary> /// Evaluates input value against original value for equality Index: IsNull.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/Predicates/IsNull.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IsNull.cs 1 Jan 2005 21:13:54 -0000 1.3 --- IsNull.cs 16 Feb 2005 10:39:26 -0000 1.4 *************** *** 7,10 **** --- 7,19 ---- { /// <summary> + /// The condition this evaluates as text. + /// </summary> + /// <returns>"value is null"</returns> + public override string ToString() + { + return "value is null"; + } + + /// <summary> /// Evaluates the input value against null /// </summary> |
From: Choy R. <ch...@us...> - 2005-02-16 10:39:41
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16618/DotNetMock.Tests Modified Files: DotNetMock.Tests.csproj Log Message: RFE 1108902 - The cheapest way to make the error messages nicer. - Identify the method call that failed and the argument index that failed. - For a couple predicates (IsNull & IsEqual) provide more info through the ToString() method. - Need to add more ToString implementations for the rest of the predicates. - Roman's MethodCall abstraction is useful here. stringification of method calls could be done there. Index: DotNetMock.Tests.csproj =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/DotNetMock.Tests.csproj,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DotNetMock.Tests.csproj 29 Jan 2005 09:13:31 -0000 1.16 --- DotNetMock.Tests.csproj 16 Feb 2005 10:39:25 -0000 1.17 *************** *** 89,93 **** AssemblyName = "nunit.framework" HintPath = "..\lib\nunit.framework.dll" ! Private = "False" /> </References> --- 89,93 ---- AssemblyName = "nunit.framework" HintPath = "..\lib\nunit.framework.dll" ! Private = "True" /> </References> |
From: Choy R. <ch...@us...> - 2005-02-13 10:50:06
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/reference/src/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4090/doc/reference/src/images Added Files: logo.jpg Log Message: Initial skeleton for DotNetMock DocBook documentation. --- NEW FILE: logo.jpg --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/dotnetmock/dotnetmock/doc/images/callouts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4090/doc/images/callouts Added Files: 1.gif 1.png 10.gif 10.png 11.gif 11.png 12.gif 12.png 13.gif 13.png 14.gif 14.png 15.gif 15.png 2.gif 2.png 3.gif 3.png 4.gif 4.png 5.gif 5.png 6.gif 6.png 7.gif 7.png 8.gif 8.png 9.gif 9.png Log Message: Initial skeleton for DotNetMock DocBook documentation. --- NEW FILE: 8.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 6.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 14.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 14.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 13.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 4.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 13.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 7.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 11.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 6.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 9.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 11.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 10.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 12.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 9.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 10.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 12.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 15.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 1.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 3.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 2.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 15.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 7.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 4.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 5.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 8.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 5.gif --- (This appears to be a binary file; contents omitted.) |
From: Choy R. <ch...@us...> - 2005-02-13 10:50:06
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/reference/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4090/doc/reference/styles Added Files: fopdf.xsl html.css html.xsl html_chunk.xsl Log Message: Initial skeleton for DotNetMock DocBook documentation. --- NEW FILE: html_chunk.xsl --- <?xml version="1.0"?> <!-- This is the XSL HTML configuration file for the Hibernate Reference Documentation. It took me days to figure out this stuff and fix most of the obvious bugs in the DocBook XSL distribution, so if you use this stylesheet, give some credit back to the Hibernate project. chr...@bl... --> <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../../docbook/lib/docbook-xsl/"> <!ENTITY callout_gfx_path "../../../images/callouts/"> <!ENTITY admon_gfx_path "../../../images/admons/"> ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default"> <xsl:import href="&db_xsl_path;/html/chunk.xsl"/> <!--################################################### HTML Settings ################################################### --> <xsl:param name="chunk.section.depth">'5'</xsl:param> <xsl:param name="use.id.as.filename">'1'</xsl:param> <xsl:param name="html.stylesheet">../styles/html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> <xsl:param name="use.extensions">1</xsl:param> <xsl:param name="tablecolumns.extension">0</xsl:param> <xsl:param name="callout.extensions">1</xsl:param> <xsl:param name="graphicsize.extension">0</xsl:param> <!--################################################### Table Of Contents ################################################### --> <!-- Generate the TOCs for named components only --> <xsl:param name="generate.toc"> book toc </xsl:param> <!-- Show only Sections up to level 3 in the TOCs --> <xsl:param name="toc.section.depth">3</xsl:param> <!--################################################### Labels ################################################### --> <!-- Label Chapters and Sections (numbering) --> <xsl:param name="chapter.autolabel">1</xsl:param> <xsl:param name="section.autolabel" select="1"/> <xsl:param name="section.label.includes.component.label" select="1"/> <!--################################################### Callouts ################################################### --> <!-- Use images for callouts instead of (1) (2) (3) --> <xsl:param name="callout.graphics">1</xsl:param> <xsl:param name="callout.graphics.path">&callout_gfx_path;</xsl:param> <!-- Place callout marks at this column in annotated areas --> <xsl:param name="callout.defaultcolumn">90</xsl:param> <!--################################################### Admonitions ################################################### --> <!-- Use nice graphics for admonitions --> <xsl:param name="admon.graphics">'1'</xsl:param> <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> <!--################################################### Misc ################################################### --> <!-- Placement of titles --> <xsl:param name="formal.title.placement"> figure after example before equation before table before procedure before </xsl:param> </xsl:stylesheet> --- NEW FILE: html.css --- A { color: #003399; } A:active { color: #003399; } A:visited { color: #888888; } P, DL, DT, DD, BLOCKQUOTE { color: #000000; margin-bottom: 3px; margin-top: 3px; padding-top: 0px; text-align: justify; /*border: 1px solid black;*/ } OL, UL, P { margin-top: 6px; margin-bottom: 6px; } P, BLOCKQUOTE { font-size: 90%; } P.releaseinfo { font-size: 120%; font-weight: bold; font-family: Arial, helvetica, sans-serif; padding-top: 10px; } P.pubdate { font-size: 120%; font-weight: bold; font-family: Arial, helvetica, sans-serif; } td { font-size: 80%; } TD, TH, SPAN { color: #000000; } BLOCKQUOTE { margin-right: 0px; } H1, H2, H3, H4, H5, H6 { color: #000000; font-weight:500; margin-top:0px; padding-top:14px; font-family: Arial, helvetica, sans-serif; margin-bottom: 0px; } H2.title { font-weight:800; margin-bottom: 8px; } H2.subtitle { font-weight:800; margin-bottom: 20px; } H3.author { color: #000000; font-weight:500; margin-top:0px; padding-top:0px; font-family: Arial, helvetica, sans-serif; margin-bottom: 0px; } TABLE { border-collapse: collapse; border-spacing:0; border: 1px thin black; empty-cells: hide; } TD { padding: 4pt; } H1 { font-size: 150%; } H2 { font-size: 110%; } H3 { font-size: 100%; font-weight: bold; } H4 { font-size: 90%; font-weight: bold; } H5 { font-size: 90%; font-style: italic; } H6 { font-size: 100%; font-style: italic; } TT { font-size: 90%; font-family: "Courier New", Courier, monospace; color: #000000; } .navheader, .navfooter { background-color: #e4eff3; } PRE { font-size: 90%; padding: 5px; border-style: solid; border-width: 1px; border-color: #CCCCCC; background-color: #F4F4F4; } UL, OL, LI { list-style: disc; } HR { width: 100%; height: 1px; background-color: #CCCCCC; border-width: 0px; padding: 0px; color: #CCCCCC; } .variablelist { padding-top: 10; padding-bottom:10; margin:0; } /*(.itemizedlist, UL { padding-top: 0; padding-bottom:0; margin:0; }*/ .term { font-weight:bold; } .mediaobject { padding-top: 30px; padding-bottom: 30px; } .legalnotice { font-size: 70%; } --- NEW FILE: fopdf.xsl --- <?xml version="1.0"?> <!-- This is the XSL FO configuration file for the Hibernate Reference Documentation. It defines a custom titlepage and the parameters for the A4 sized PDF printable output. It took me days to figure out this stuff and fix most of the obvious bugs in the DocBook XSL distribution, so if you use this stylesheet, give some credit back to the Hibernate project. chr...@bl... --> <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../../docbook/lib/docbook-xsl/"> <!ENTITY admon_gfx_path "../../../images/admons/"> ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="#default"> <xsl:import href="&db_xsl_path;/fo/docbook.xsl"/> <!--################################################### Custom Title Page ################################################### --> <xsl:template name="book.titlepage.recto"> <fo:block> <fo:table table-layout="fixed" width="175mm"> <fo:table-column column-width="175mm"/> <fo:table-body> <fo:table-row> <fo:table-cell text-align="center"> <fo:block> <fo:external-graphic src="file:images/logo.jpg"/> </fo:block> <fo:block font-family="Helvetica" font-size="22pt" padding-before="10mm"> <xsl:value-of select="bookinfo/subtitle"/> </fo:block> <fo:block font-family="Helvetica" font-size="12pt" padding="10mm"> <xsl:value-of select="bookinfo/releaseinfo"/> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell text-align="center"> <fo:block font-family="Helvetica" font-size="14pt" padding="10mm"> <xsl:value-of select="bookinfo/pubdate"/> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell text-align="center"> <fo:block font-family="Helvetica" font-size="12pt" padding="10mm"> <xsl:text>Copyright (c) 2004, 2005 - </xsl:text> <xsl:for-each select="bookinfo/authorgroup/author"> <xsl:if test="position() > 1"> <xsl:text>, </xsl:text> </xsl:if> <xsl:value-of select="firstname"/> <xsl:text> </xsl:text> <xsl:value-of select="surname"/> </xsl:for-each> </fo:block> <fo:block font-family="Helvetica" font-size="10pt" padding="1mm"> <xsl:value-of select="bookinfo/legalnotice"/> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:block> </xsl:template> <!-- Prevent blank pages in output --> <xsl:template name="book.titlepage.before.verso"> </xsl:template> <xsl:template name="book.titlepage.verso"> </xsl:template> <xsl:template name="book.titlepage.separator"> </xsl:template> <!--################################################### Header ################################################### --> <!-- More space in the center header for long text --> <xsl:attribute-set name="header.content.properties"> <xsl:attribute name="font-family"> <xsl:value-of select="$body.font.family"/> </xsl:attribute> <xsl:attribute name="margin-left">-5em</xsl:attribute> <xsl:attribute name="margin-right">-5em</xsl:attribute> </xsl:attribute-set> <!--################################################### Custom Footer ################################################### --> <!-- This footer prints the Spring Framework version number on the left side --> <xsl:template name="footer.content"> <xsl:param name="pageclass" select="''"/> <xsl:param name="sequence" select="''"/> <xsl:param name="position" select="''"/> <xsl:param name="gentext-key" select="''"/> <xsl:variable name="Version"> <xsl:choose> <xsl:when test="//releaseinfo"> <xsl:text>Spring Framework </xsl:text><xsl:value-of select="//releaseinfo"/> </xsl:when> <xsl:otherwise> <!-- nop --> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:choose> <xsl:when test="$sequence='blank'"> <xsl:choose> <xsl:when test="$double.sided != 0 and $position = 'left'"> <xsl:value-of select="$Version"/> </xsl:when> <xsl:when test="$double.sided = 0 and $position = 'center'"> <!-- nop --> </xsl:when> <xsl:otherwise> <fo:page-number/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="$pageclass='titlepage'"> <!-- nop: other titlepage sequences have no footer --> </xsl:when> <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'"> <fo:page-number/> </xsl:when> <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'"> <fo:page-number/> </xsl:when> <xsl:when test="$double.sided = 0 and $position='right'"> <fo:page-number/> </xsl:when> <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'"> <xsl:value-of select="$Version"/> </xsl:when> <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'"> <xsl:value-of select="$Version"/> </xsl:when> <xsl:when test="$double.sided = 0 and $position='left'"> <xsl:value-of select="$Version"/> </xsl:when> <xsl:otherwise> <!-- nop --> </xsl:otherwise> </xsl:choose> </xsl:template> <!--################################################### Custom Toc Line ################################################### --> <!-- The default DocBook XSL TOC printing is seriously broken... --> <xsl:template name="toc.line"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="label"> <xsl:apply-templates select="." mode="label.markup"/> </xsl:variable> <!-- justify-end removed from block attributes (space problem in title.markup) --> <fo:block end-indent="{$toc.indent.width}pt" last-line-end-indent="-{$toc.indent.width}pt" white-space-treatment="preserve" text-align="left" white-space-collapse="false"> <fo:inline keep-with-next.within-line="always"> <!-- print Chapters in bold style --> <xsl:choose> <xsl:when test="local-name(.) = 'chapter'"> <xsl:attribute name="font-weight">bold</xsl:attribute> </xsl:when> </xsl:choose> <fo:basic-link internal-destination="{$id}"> <xsl:if test="$label != ''"> <xsl:copy-of select="$label"/> <fo:inline white-space-treatment="preserve" white-space-collapse="false"> <xsl:value-of select="$autotoc.label.separator"/> </fo:inline> </xsl:if> <xsl:apply-templates select="." mode="title.markup"/> </fo:basic-link> </fo:inline> <fo:inline keep-together.within-line="always"> <xsl:text> </xsl:text> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <xsl:text> </xsl:text> <fo:basic-link internal-destination="{$id}"> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> </fo:inline> </fo:block> </xsl:template> <!--################################################### Extensions ################################################### --> <!-- These extensions are required for table printing and other stuff --> <xsl:param name="use.extensions">1</xsl:param> <xsl:param name="tablecolumns.extension">0</xsl:param> <xsl:param name="callout.extensions">1</xsl:param> <!-- FOP provide only PDF Bookmarks at the moment --> <xsl:param name="fop.extensions">1</xsl:param> <!--################################################### Table Of Contents ################################################### --> <!-- Generate the TOCs for named components only --> <xsl:param name="generate.toc"> book toc </xsl:param> <!-- Show only Sections up to level 3 in the TOCs --> <xsl:param name="toc.section.depth">2</xsl:param> <!-- Dot and Whitespace as separator in TOC between Label and Title--> <xsl:param name="autotoc.label.separator" select="'. '"/> <!--################################################### Paper & Page Size ################################################### --> <!-- Paper type, no headers on blank pages, no double sided printing --> <xsl:param name="paper.type" select="'A4'"/> <xsl:param name="double.sided">0</xsl:param> <xsl:param name="headers.on.blank.pages">0</xsl:param> <xsl:param name="footers.on.blank.pages">0</xsl:param> <!-- Space between paper border and content (chaotic stuff, don't touch) --> <xsl:param name="page.margin.top">5mm</xsl:param> <xsl:param name="region.before.extent">10mm</xsl:param> <xsl:param name="body.margin.top">10mm</xsl:param> <xsl:param name="body.margin.bottom">15mm</xsl:param> <xsl:param name="region.after.extent">10mm</xsl:param> <xsl:param name="page.margin.bottom">0mm</xsl:param> <xsl:param name="page.margin.outer">18mm</xsl:param> <xsl:param name="page.margin.inner">18mm</xsl:param> <!-- No intendation of Titles --> <xsl:param name="title.margin.left">0pc</xsl:param> <!--################################################### Fonts & Styles ################################################### --> <!-- Justified text and no hyphenation --> <xsl:param name="alignment">justify</xsl:param> <xsl:param name="hyphenate">false</xsl:param> <!-- Default Font size --> <xsl:param name="body.font.master">11</xsl:param> <xsl:param name="body.font.small">8</xsl:param> <!-- Line height in body text --> <xsl:param name="line-height">1.4</xsl:param> <!-- Monospaced fonts are smaller than regular text --> <xsl:attribute-set name="monospace.properties"> <xsl:attribute name="font-family"> <xsl:value-of select="$monospace.font.family"/> </xsl:attribute> <xsl:attribute name="font-size">0.8em</xsl:attribute> </xsl:attribute-set> <!--################################################### Tables ################################################### --> <!-- The table width should be adapted to the paper size --> <xsl:param name="default.table.width">17.4cm</xsl:param> <!-- Some padding inside tables --> <xsl:attribute-set name="table.cell.padding"> <xsl:attribute name="padding-left">4pt</xsl:attribute> <xsl:attribute name="padding-right">4pt</xsl:attribute> <xsl:attribute name="padding-top">4pt</xsl:attribute> <xsl:attribute name="padding-bottom">4pt</xsl:attribute> </xsl:attribute-set> <!-- Only hairlines as frame and cell borders in tables --> <xsl:param name="table.frame.border.thickness">0.1pt</xsl:param> <xsl:param name="table.cell.border.thickness">0.1pt</xsl:param> <!--################################################### Labels ################################################### --> <!-- Label Chapters and Sections (numbering) --> <xsl:param name="chapter.autolabel">1</xsl:param> <xsl:param name="section.autolabel" select="1"/> <xsl:param name="section.label.includes.component.label" select="1"/> <!--################################################### Titles ################################################### --> <!-- Chapter title size --> <xsl:attribute-set name="chapter.titlepage.recto.style"> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="font-size"> <xsl:value-of select="$body.font.master * 1.8"/> <xsl:text>pt</xsl:text> </xsl:attribute> </xsl:attribute-set> <!-- Why is the font-size for chapters hardcoded in the XSL FO templates? Let's remove it, so this sucker can use our attribute-set only... --> <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode"> <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style"> <xsl:call-template name="component.title"> <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/> </xsl:call-template> </fo:block> </xsl:template> <!-- Sections 1, 2 and 3 titles have a small bump factor and padding --> <xsl:attribute-set name="section.title.level1.properties"> <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute> <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute> <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute> <xsl:attribute name="font-size"> <xsl:value-of select="$body.font.master * 1.5"/> <xsl:text>pt</xsl:text> </xsl:attribute> <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="section.title.level2.properties"> <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute> <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute> <xsl:attribute name="space-before.maximum">0.6em</xsl:attribute> <xsl:attribute name="font-size"> <xsl:value-of select="$body.font.master * 1.25"/> <xsl:text>pt</xsl:text> </xsl:attribute> <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="section.title.level3.properties"> <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute> <xsl:attribute name="space-before.maximum">0.4em</xsl:attribute> <xsl:attribute name="font-size"> <xsl:value-of select="$body.font.master * 1.0"/> <xsl:text>pt</xsl:text> </xsl:attribute> <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> </xsl:attribute-set> <!-- Titles of formal objects (tables, examples, ...) --> <xsl:attribute-set name="formal.title.properties" use-attribute-sets="normal.para.spacing"> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="font-size"> <xsl:value-of select="$body.font.master"/> <xsl:text>pt</xsl:text> </xsl:attribute> <xsl:attribute name="hyphenate">false</xsl:attribute> <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute> <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute> <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute> </xsl:attribute-set> <!--################################################### Programlistings ################################################### --> <!-- Verbatim text formatting (programlistings) --> <xsl:attribute-set name="monospace.verbatim.properties"> <xsl:attribute name="font-size"> <xsl:value-of select="$body.font.small * 1.0"/> <xsl:text>pt</xsl:text> </xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="verbatim.properties"> <xsl:attribute name="space-before.minimum">1em</xsl:attribute> <xsl:attribute name="space-before.optimum">1em</xsl:attribute> <xsl:attribute name="space-before.maximum">1em</xsl:attribute> <!-- alef: commented out because footnotes were screwed because of it --> <!--<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>--> <xsl:attribute name="border-color">#444444</xsl:attribute> <xsl:attribute name="border-style">solid</xsl:attribute> <xsl:attribute name="border-width">0.1pt</xsl:attribute> <xsl:attribute name="padding-top">0.5em</xsl:attribute> <xsl:attribute name="padding-left">0.5em</xsl:attribute> <xsl:attribute name="padding-right">0.5em</xsl:attribute> <xsl:attribute name="padding-bottom">0.5em</xsl:attribute> <xsl:attribute name="margin-left">0.5em</xsl:attribute> <xsl:attribute name="margin-right">0.5em</xsl:attribute> </xsl:attribute-set> <!-- Shade (background) programlistings --> <xsl:param name="shade.verbatim">1</xsl:param> <xsl:attribute-set name="shade.verbatim.style"> <xsl:attribute name="background-color">#F0F0F0</xsl:attribute> </xsl:attribute-set> <!--################################################### Callouts ################################################### --> <!-- Use images for callouts instead of (1) (2) (3) --> <xsl:param name="callout.graphics">0</xsl:param> <xsl:param name="callout.unicode">1</xsl:param> <!-- Place callout marks at this column in annotated areas --> <xsl:param name="callout.defaultcolumn">90</xsl:param> <!--################################################### Admonitions ################################################### --> <!-- Use nice graphics for admonitions --> <xsl:param name="admon.graphics">'1'</xsl:param> <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> <!--################################################### Misc ################################################### --> <!-- Placement of titles --> <xsl:param name="formal.title.placement"> figure after example before equation before table before procedure before </xsl:param> <!-- Format Variable Lists as Blocks (prevents horizontal overflow) --> <xsl:param name="variablelist.as.blocks">1</xsl:param> <!-- The horrible list spacing problems --> <xsl:attribute-set name="list.block.spacing"> <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute> <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute> <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute> <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> </xsl:attribute-set> </xsl:stylesheet> --- NEW FILE: html.xsl --- <?xml version="1.0"?> <!-- This is the XSL HTML configuration file for the Hibernate Reference Documentation. It took me days to figure out this stuff and fix most of the obvious bugs in the DocBook XSL distribution, so if you use this stylesheet, give some credit back to the Hibernate project. chr...@bl... --> <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../../docbook/lib/docbook-xsl/"> <!ENTITY callout_gfx_path "../../../images/callouts/"> <!ENTITY admon_gfx_path "../../../images/admons/"> ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default"> <xsl:import href="&db_xsl_path;/html/docbook.xsl"/> <!--################################################### HTML Settings ################################################### --> <xsl:param name="html.stylesheet">../styles/html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> <xsl:param name="use.extensions">1</xsl:param> <xsl:param name="tablecolumns.extension">0</xsl:param> <xsl:param name="callout.extensions">1</xsl:param> <xsl:param name="graphicsize.extension">0</xsl:param> <!--################################################### Table Of Contents ################################################### --> <!-- Generate the TOCs for named components only --> <xsl:param name="generate.toc"> book toc </xsl:param> <!-- Show only Sections up to level 3 in the TOCs --> <xsl:param name="toc.section.depth">3</xsl:param> <!--################################################### Labels ################################################### --> <!-- Label Chapters and Sections (numbering) --> <xsl:param name="chapter.autolabel">1</xsl:param> <xsl:param name="section.autolabel" select="1"/> <xsl:param name="section.label.includes.component.label" select="1"/> <!--################################################### Callouts ################################################### --> <!-- Use images for callouts instead of (1) (2) (3) --> <xsl:param name="callout.graphics">1</xsl:param> <xsl:param name="callout.graphics.path">&callout_gfx_path;</xsl:param> <!-- Place callout marks at this column in annotated areas --> <xsl:param name="callout.defaultcolumn">90</xsl:param> <!--################################################### Admonitions ################################################### --> <!-- Use nice graphics for admonitions --> <xsl:param name="admon.graphics">'1'</xsl:param> <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> <!--################################################### Misc ################################################### --> <!-- Placement of titles --> <xsl:param name="formal.title.placement"> figure after example before equation before table before procedure before </xsl:param> </xsl:stylesheet> |
From: Choy R. <ch...@us...> - 2005-02-13 10:50:05
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4090/doc/reference/src Added Files: dynamic.xml faq.xml index.xml start.xml static.xml xunit.xml Log Message: Initial skeleton for DotNetMock DocBook documentation. --- NEW FILE: start.xml --- <chapter id="start"> <title>Getting Started</title> <section id="start-install"> <title>Installation</title> <para> Installation is simple. Just download the release zip and unzip into the directory of your choice. If you have InfoZip, the command could look something like: <screen>c:\temp> unzip DotNetMock-0.7.4.zip -d c:\sw\dotnet\dotnetmock-0.7.4</screen> Afterwards, you could register the assemblies with the GAC. </para> </section> <section id="start-using"> <title>Using DotNetMock in Your Projects</title> <para> To use <classname>DynamicMock</classname>s or create your own custom mocks, you only need to add a reference to <literal>DotNetMock.dll</literal>. </para> </section> </chapter> --- NEW FILE: static.xml --- <chapter id="static"> <title>Static Mocks</title> <section id="static-introduction"> <title>Introduction</title> <para> Static mocks are mock objects that are pre-defined ... </para> </section> </chapter> --- NEW FILE: xunit.xml --- <appendix id="xunit-support"> <title>Support for xUnit Testing Frameworks</title> <para> DotNetMock supports three xUnit testing frameworks ... </para> </appendix> --- NEW FILE: dynamic.xml --- <chapter id="dynamic"> <title>Dynamically Generated Mocks</title> <section id="dynamic-introduction"> <title>Introduction</title> <para> Dynamic mocks are mock objects created by dynamically implementing ... </para> </section> </chapter> --- NEW FILE: faq.xml --- <appendix id="faq"> <title>FAQ</title> <qandaset defaultlabel="qanda"> <qandadiv id="faq-xunit"> <title>Supported xUnit Testing Frameworks</title> <qandaentry id="other-xunit"> <question> <para> I don't use either of the supported frameworks, so can I provide my own testing framework implementation? </para> </question> <answer> <para> Not at this time. The only frameworks supported are the three above. If you would like to use your own framework, drop the developers a line at <literal>dot...@li...</literal> and we will see what we can do. </para> </answer> </qandaentry> </qandadiv> </qandaset> </appendix> --- NEW FILE: index.xml --- <?xml version='1.0' encoding="iso-8859-1"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "../../docbook/lib/docbook-dtd/docbookx.dtd" [ <!ENTITY preface SYSTEM "preface.xml"> <!ENTITY start SYSTEM "start.xml"> <!ENTITY dynamic SYSTEM "dynamic.xml"> <!ENTITY static SYSTEM "static.xml"> <!ENTITY xunit SYSTEM "xunit.xml"> <!ENTITY faq SYSTEM "faq.xml"> ]> <book> <bookinfo> <title>DotNetMock - Mock Objects for .NET</title> <subtitle>Reference Documentation</subtitle> <releaseinfo>Version 0.7.4</releaseinfo> <pubdate>February 12, 2005 - (Work in progress)</pubdate> <authorgroup> <author> <firstname>Griffin</firstname> <surname>Caprio</surname> </author> <author> <firstname>Choy</firstname> <surname>Rim</surname> </author> </authorgroup> <legalnotice> <para> Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. </para> </legalnotice> </bookinfo> <toc/> <preface id="preface-ack"> <title>Acknowledgements</title> <para> This project and many others owe a debt of gratitude to Chris Bauer (of the <ulink url="http://www.hibernate.org/">Hibernate</ulink> project team), who prepared and adapted the DocBook-XSL software used to create Hibernate's reference guide, allowing us to create this guide. </para> </preface> <preface id="preface-intro"> <title>Introduction</title> <para> DotNetMock is a framework and library which facilitates the use of mock objects for unit testing on the .NET platform. It supports the dynamic creation of mock objects and the development of custom mock objects. It also contains a library of pre-built mock objects for typical purposes. It integrates with the NUnit, MbUnit and csUnit testing frameworks. </para> </preface> &start; &dynamic; &static; &xunit; &faq; </book> |
From: Choy R. <ch...@us...> - 2005-02-13 10:50:05
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/docbook In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4090/doc/docbook Added Files: .cvsignore readme.txt Log Message: Initial skeleton for DotNetMock DocBook documentation. --- NEW FILE: .cvsignore --- # $Id: .cvsignore,v 1.1 2005/02/13 10:49:42 choyrim Exp $ lib docbook-xsl-1.67.0 --- NEW FILE: readme.txt --- This directory is where we'll hold the Docbook reference libraries. Just unzip them here. You can download them from: http://sourceforge.net/project/showfiles.php?group_id=106751 the toolchain link has a file called "doc-reference-libraries.zip" --Choy Rim |
From: Choy R. <ch...@us...> - 2005-02-13 10:50:04
|
Update of /cvsroot/dotnetmock/dotnetmock/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4090/doc Added Files: .cvsignore build.xml project.properties readme.txt Log Message: Initial skeleton for DotNetMock DocBook documentation. --- NEW FILE: .cvsignore --- # $Id: .cvsignore,v 1.1 2005/02/13 10:49:42 choyrim Exp $ output schema --- NEW FILE: project.properties --- # $Id: project.properties,v 1.1 2005/02/13 10:49:42 choyrim Exp $ # Ant properties for building DocBook documentation # Values in this file will be overriden by any values with the same name # in the user-created build.properties file. # ------------------------------------------------------------------------ # docbook reference documentation # ------------------------------------------------------------------------ doc.output.dir=output # reference docbook source base directory doc.ref.dir=reference # reference docbook output base directory doc.ref.output.dir=${doc.output.dir}/reference # docbook libraries and dependencies docbook.lib.dir=docbook/lib # the main source code directory for the Spring.NET codebase src.dir=../src --- NEW FILE: build.xml --- <?xml version="1.0"?> <!-- Build file for Docbook Documentation $Id: build.xml,v 1.1 2005/02/13 10:49:42 choyrim Exp $ Build file based on build.xml from original Spring Framework, which originated from the Hibernate documentation. Building the documentation requires you to download reference/lib from the sourceforge download area. --> <project name="DotNetMock DocBook" default="refdoc" basedir="."> <property file="build.properties" /> <property file="project.properties" /> <target name="clean" description="Delete output and temporary directories."> <delete dir="${basedir}/${doc.output.dir}" /> </target> <target name="preparedocs" description="Extra preparation for the documentation (common to all formats)"> <!-- no special prep --> </target> <!-- Extra preparation for HTML documentation --> <target name="preparedocshtml"> <mkdir dir="${basedir}/${doc.ref.output.dir}/styles"/> <copy file="${doc.ref.dir}/styles/html.css" todir="${basedir}/${doc.ref.output.dir}/styles"/> </target> <target name="docpdf" depends="preparedocs" description="Compile reference documentation to pdf"> <antcall target="copycommoncontent"> <param name="doc.type.output.dir" value="${basedir}/${doc.ref.output.dir}/pdf/images"/> </antcall> <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${doc.ref.dir}"> <classpath> <fileset dir="${basedir}/${docbook.lib.dir}"> <include name="**/*.jar" /> </fileset> </classpath> <arg value="-o" /> <arg value="${basedir}/${doc.ref.output.dir}/pdf/docbook_fop.tmp" /> <arg value="${basedir}/${doc.ref.dir}/src/index.xml" /> <arg value="${basedir}/${doc.ref.dir}/styles/fopdf.xsl" /> </java> <java classname="org.apache.fop.apps.Fop" fork="true" dir="${doc.ref.dir}"> <classpath> <fileset dir="${basedir}/${docbook.lib.dir}"> <include name="**/*.jar" /> </fileset> </classpath> <arg value="-d" /> <arg value="${basedir}/${doc.ref.output.dir}/pdf/docbook_fop.tmp" /> <arg value="${basedir}/${doc.ref.output.dir}/pdf/dotnetmock-reference.pdf" /> </java> <delete file="${doc.ref.output.dir}/pdf/docbook_fop.tmp" /> </target> <target name="dochtml" depends="preparedocs,preparedocshtml" description="Compile reference documentation to chunked html"> <antcall target="copycommoncontent"> <param name="doc.type.output.dir" value="${basedir}/${doc.ref.output.dir}/html/images"/> </antcall> <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${doc.ref.output.dir}/html"> <classpath> <fileset dir="${basedir}/${docbook.lib.dir}"> <include name="**/*.jar" /> </fileset> </classpath> <arg value="${basedir}/${doc.ref.dir}/src/index.xml" /> <arg value="${basedir}/${doc.ref.dir}/styles/html_chunk.xsl" /> </java> </target> <target name="dochtmlsingle" depends="preparedocs,preparedocshtml" description="Compile reference documentation to single html"> <antcall target="copycommoncontent"> <param name="doc.type.output.dir" value="${basedir}/${doc.ref.output.dir}/html_single/images"/> </antcall> <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${doc.ref.dir}"> <classpath> <fileset dir="${basedir}/${docbook.lib.dir}"> <include name="**/*.jar" /> </fileset> </classpath> <arg value="-o" /> <arg value="${basedir}/${doc.ref.output.dir}/html_single/index.html" /> <arg value="${basedir}/${doc.ref.dir}/src/index.xml" /> <arg value="${basedir}/${doc.ref.dir}/styles/html.xsl" /> </java> </target> <target name="htmlhelp" depends="preparedocs,preparedocshtml" description="Compile reference documentation to MS HTML-HELP"> <antcall target="copycommoncontent"> <param name="doc.type.output.dir" value="${basedir}/${doc.ref.output.dir}/htmlhelp/images"/> </antcall> <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${doc.ref.output.dir}/htmlhelp"> <classpath> <fileset dir="${basedir}/${docbook.lib.dir}"> <include name="**/*.jar" /> </fileset> </classpath> <arg value="${basedir}/${doc.ref.dir}/src/index.xml" /> <arg value="${basedir}/docbook/docbook-xsl-1.67.0/htmlhelp/htmlhelp.xsl" /> </java> <exec dir="${doc.ref.output.dir}/htmlhelp" executable="cmd.exe"> <arg line="/c hhc htmlhelp.hhp"/> </exec> <delete includeEmptyDirs="true"> <fileset dir="${doc.ref.output.dir}/htmlhelp"> <include name="**/*"/> <exclude name="htmlhelp.chm"/> </fileset> </delete> </target> <!-- copies content common to all docs to the dir in the ${doc.type.output.dir} property --> <target name="copycommoncontent"> <mkdir dir="${doc.type.output.dir}"/> <copy todir="${doc.type.output.dir}"> <fileset dir="${basedir}/${doc.ref.dir}/src/images"> <include name="*.gif"/> <include name="*.svg"/> <include name="*.jpg"/> <include name="*.png"/> </fileset> </copy> </target> <!-- this is the target to call for generating docs for the release --> <target name="refdoc" depends="clean,dochtml,htmlhelp,docpdf" description="Generate reference documentation"/> </project> --- NEW FILE: readme.txt --- This Docbook documentation was taken from the Spring.Java project. The documentation can be generated using Java Ant. The targets are: * docpdf - generates the PDF documentation * dochtml - generates the HTML documentation * dochtmlsingle - generates single page HTML documentation * clean - clean any output directories for docs To generate documentation, you need to include a lot of libraries, which haven't been added to CVS because they're simply too big. The libraries can be downloaded from sourceforge or from http://www.jteam.nl/spring/reference-libraries.zip. Download them, and unzip the zip into docbook/lib. Then, the targets should work. Thanks to Spring.Java and Hibernate, for providing the skeleton for DocBook documentation! ch...@us... |
Update of /cvsroot/dotnetmock/dotnetmock/doc/images/admons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4090/doc/images/admons Added Files: blank.png caution.gif caution.png caution.tif draft.png home.gif home.png important.gif important.png important.tif next.gif next.png note.gif note.png note.tif prev.gif prev.png tip.gif tip.png tip.tif toc-blank.png toc-minus.png toc-plus.png up.gif up.png warning.gif warning.png warning.tif Log Message: Initial skeleton for DotNetMock DocBook documentation. --- NEW FILE: note.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: caution.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: note.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: home.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: up.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tip.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: home.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: caution.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: important.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: warning.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toc-minus.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: important.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: warning.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: important.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: warning.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: next.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tip.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: up.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: next.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: draft.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: prev.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tip.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toc-blank.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: prev.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toc-plus.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: note.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: blank.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: caution.png --- (This appears to be a binary file; contents omitted.) |
From: Choy R. <ch...@us...> - 2005-02-13 10:46:56
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/reference/src/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2930/images Log Message: Directory /cvsroot/dotnetmock/dotnetmock/doc/reference/src/images added to the repository |
From: Choy R. <ch...@us...> - 2005-02-13 10:46:53
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2759/src Log Message: Directory /cvsroot/dotnetmock/dotnetmock/doc/reference/src added to the repository |
From: Choy R. <ch...@us...> - 2005-02-13 10:46:53
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/reference/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2759/styles Log Message: Directory /cvsroot/dotnetmock/dotnetmock/doc/reference/styles added to the repository |
From: Choy R. <ch...@us...> - 2005-02-13 10:46:13
|
Update of /cvsroot/dotnetmock/dotnetmock/doc/images/callouts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2559/callouts Log Message: Directory /cvsroot/dotnetmock/dotnetmock/doc/images/callouts added to the repository |