Files
allwpilib/networktables/java/lib/jmock/jmock-junit3-2.6.0-RC2.jar

363 lines
16 KiB
Plaintext
Raw Normal View History

PK
<00><><EFBFBD>< META-INF/<2F><>PK
<00><><EFBFBD><:<3A><>WffMETA-INF/MANIFEST.MFManifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 14.2-b01 (Sun Microsystems Inc.)
PK
<00><><EFBFBD><org/PK
<00><><EFBFBD><
org/jmock/PK
<00><><EFBFBD><org/jmock/integration/PK
<00><><EFBFBD><org/jmock/integration/junit3/PK
<00><><EFBFBD><<3C><19><>XX8org/jmock/integration/junit3/JUnit3ErrorTranslator.class<73><73><EFBFBD><EFBFBD>1&



  !INSTANCE4Lorg/jmock/integration/junit3/JUnit3ErrorTranslator; translate3(Lorg/jmock/api/ExpectationError;)Ljava/lang/Error;CodeLineNumberTableLocalVariableTablethise Lorg/jmock/api/ExpectationError;<init>()V<clinit>
SourceFileJUnit3ErrorTranslator.java$junit/framework/AssertionFailedError" #$ % 2org/jmock/integration/junit3/JUnit3ErrorTranslator
java/lang/Object(org/jmock/api/ExpectationErrorTranslatororg/hamcrest/StringDescriptiontoString1(Lorg/hamcrest/SelfDescribing;)Ljava/lang/String;(Ljava/lang/String;)V! 
 @ <0C>Y+<2B><02><03>  /*<2A><04>  # <0B>Y<><06><07>PK
<00><><EFBFBD><<3C><v<>000org/jmock/integration/junit3/JUnit3Mockery.class<73><73><EFBFBD><EFBFBD>1
 
<init>()VCodeLineNumberTableLocalVariableTablethis,Lorg/jmock/integration/junit3/JUnit3Mockery;
SourceFileJUnit3Mockery.java   *org/jmock/integration/junit3/JUnit3Mockeryorg/jmock/Mockery2org/jmock/integration/junit3/JUnit3ErrorTranslatorINSTANCE4Lorg/jmock/integration/junit3/JUnit3ErrorTranslator;setExpectationErrorTranslator-(Lorg/jmock/api/ExpectationErrorTranslator;)V!> *<2A>*<2A><02><03>  
  PK
<00><><EFBFBD><<3C><>R<EFBFBD>aa7org/jmock/integration/junit3/MockObjectTestCase$1.class<73><73><EFBFBD><EFBFBD>1( 


 !this$01Lorg/jmock/integration/junit3/MockObjectTestCase;<init>4(Lorg/jmock/integration/junit3/MockObjectTestCase;)VCodeLineNumberTableLocalVariableTablethis InnerClasses3Lorg/jmock/integration/junit3/MockObjectTestCase$1;run()V
SourceFileMockObjectTestCase.javaEnclosingMethod" # 
 $%& '1org/jmock/integration/junit3/MockObjectTestCase$1java/lang/Objectjava/lang/Runnable/org/jmock/integration/junit3/MockObjectTestCase
initialise
access$000F(Lorg/jmock/integration/junit3/MockObjectTestCase;)Lorg/jmock/Mockery;org/jmock/MockeryassertIsSatisfied  
 4
*+<2B>*<2A><02> # 
 9 *<2A><01><03><04>
%
&  
PK
<00><><EFBFBD><̰o<CCB0>  5org/jmock/integration/junit3/MockObjectTestCase.class<73><73><EFBFBD><EFBFBD>1t O
PQ
P
R
S TU
VW
Z
[\
]
^
_
`
a
b
c
d
e
fghcontextLorg/jmock/Mockery;<init>()VCodeLineNumberTableLocalVariableTablethis1Lorg/jmock/integration/junit3/MockObjectTestCase;(Ljava/lang/String;)VnameLjava/lang/String;
initialise
mockomatic$Lorg/jmock/auto/internal/Mockomatic;()Lorg/jmock/Mockery;setDefaultResultForType&(Ljava/lang/Class;Ljava/lang/Object;)VtypeLjava/lang/Class;resultLjava/lang/Object;LocalVariableTypeTableLjava/lang/Class<*>; Signature)(Ljava/lang/Class<*>;Ljava/lang/Object;)VsetImposteriser(Lorg/jmock/api/Imposteriser;)V imposteriserLorg/jmock/api/Imposteriser;setNamingScheme)(Lorg/jmock/api/MockObjectNamingScheme;)V namingScheme&Lorg/jmock/api/MockObjectNamingScheme;checking*(Lorg/jmock/internal/ExpectationBuilder;)V expectations'Lorg/jmock/internal/ExpectationBuilder;mock7(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
typeToMockLjava/lang/Class<TT;>;C<T:Ljava/lang/Object;>(Ljava/lang/Class<TT;>;Ljava/lang/String;)TT;%(Ljava/lang/Class;)Ljava/lang/Object;1<T:Ljava/lang/Object;>(Ljava/lang/Class<TT;>;)TT;sequence((Ljava/lang/String;)Lorg/jmock/Sequence;states&(Ljava/lang/String;)Lorg/jmock/States;
access$000F(Lorg/jmock/integration/junit3/MockObjectTestCase;)Lorg/jmock/Mockery;x0
SourceFileMockObjectTestCase.java  org/jmock/Mockery % "i jk lm1org/jmock/integration/junit3/MockObjectTestCase$1 InnerClasses n op"org/jmock/auto/internal/Mockomatic q rs )* 34 78 ;< ?@ ?D FG HI/org/jmock/integration/junit3/MockObjectTestCase.org/jmock/integration/junit3/VerifyingTestCase2org/jmock/integration/junit3/JUnit3ErrorTranslatorINSTANCE4Lorg/jmock/integration/junit3/JUnit3ErrorTranslator;setExpectationErrorTranslator-(Lorg/jmock/api/ExpectationErrorTranslator;)V4(Lorg/jmock/integration/junit3/MockObjectTestCase;)V addVerifier(Ljava/lang/Runnable;)V(Lorg/jmock/Mockery;)VfillIn(Ljava/lang/Object;)V! J*<2A>*<2A>Y<><04>*<2A><05>  !"U*+<2B>*<2A>Y<><04>*<2A><05> !#$%l(*<2A><01><07>*<2A> Y*<2A>
<EFBFBD> <0B> Y*<2A><01> L+*<2A><0E>!
#)"*'+( !"&'(/*<2A><01>.  !)*^
*<2A>+,<2C><0F>
< = 
!
+,
-./ 
+01234A *<2A>+<2B><10>
GH ! 5678A *<2A>+<2B><11>
ST ! 9:;<A *<2A>+<2B><12>
[\ ! =>?@Z
*<2A>+,<2C><13>j 
!
A,
#$/ 
AB1C?DO *<2A>+<2B><14>v ! A,/  AB1EFG= *<2A>+<2B><15><00> ! #$HI= *<2A>+<2B><16><00> ! #$JK/*<2A><01> L!MNY
 PK
<00><><EFBFBD><<3C>Hb<48><62><00>4org/jmock/integration/junit3/VerifyingTestCase.class<73><73><EFBFBD><EFBFBD>1Q
01
0 2
3
4
5
6
78 9: ;< ;=> ? 9@AB verifiersLjava/util/List; Signature&Ljava/util/List<Ljava/lang/Runnable;>;<init>()VCodeLineNumberTableLocalVariableTablethis0Lorg/jmock/integration/junit3/VerifyingTestCase;(Ljava/lang/String;)VnameLjava/lang/String;runBare tearingDownLjava/lang/Throwable;running exception
ExceptionsverifyverifierLjava/lang/Runnable;i$Ljava/util/Iterator; addVerifier(Ljava/lang/Runnable;)V
SourceFileVerifyingTestCase.java java/util/ArrayList   C D ' Ejava/lang/ThrowableF GHI JK LMjava/lang/Runnable N OP.org/jmock/integration/junit3/VerifyingTestCasejunit/framework/TestCasesetUprunTesttearDownjava/util/Listiterator()Ljava/util/Iterator;java/util/IteratorhasNext()Znext()Ljava/lang/Object;runadd(Ljava/lang/Object;)Z!B*<2A>*<2A>Y<><03><04> M*+<2B>*<2A>Y<><03><04> !=ML*<2A>*<2A>*<2A>*<2A> <09>4M+<2B>,L<>*M,L*<2A> <09> M+<2B>,L<>N*<2A> <09> :+<2B>L-<2D>+<2B>+<2B><>

"&)
3"348;
343b#$&
'-0./1( )"-&0).*/013,4-80;.=/D0F2L3>"# $#*"#="#MK%#&
'm'*<2A><04> L+<2B> <00>+<2B> <00>M,<2C><00><><EFBFBD><EFBFBD>67&9 ()
*+',-D *<2A>+<2B>W<>
< =  ()./PK
<00>^y5^<5E>*<2A><><00>7org/jmock/integration/junit3/JUnit3ErrorTranslator.javapackage org.jmock.integration.junit3;
import junit.framework.AssertionFailedError;
import org.hamcrest.StringDescription;
import org.jmock.api.ExpectationError;
import org.jmock.api.ExpectationErrorTranslator;
/**
* Translates {@link org.jmock.api.ExpectationError}s into JUnit's
* {@link junit.framework.AssertionFailedError}s.
*
* @author npryce
*
*/
public class JUnit3ErrorTranslator implements ExpectationErrorTranslator {
public static final JUnit3ErrorTranslator INSTANCE = new JUnit3ErrorTranslator();
public Error translate(ExpectationError e) {
return new AssertionFailedError(StringDescription.toString(e));
}
private JUnit3ErrorTranslator() {}
}
PK
5~<7E>6<EFBFBD>!<21>*FF/org/jmock/integration/junit3/JUnit3Mockery.javapackage org.jmock.integration.junit3;
import org.jmock.Mockery;
/**
* A {@link Mockery} that reports expectation errors as JUnit 3 test failures.
*
* @author nat
*/
public class JUnit3Mockery extends Mockery {
public JUnit3Mockery() {
setExpectationErrorTranslator(JUnit3ErrorTranslator.INSTANCE);
}
}
PK
a<><61>;Y<>*2??4org/jmock/integration/junit3/MockObjectTestCase.javapackage org.jmock.integration.junit3;
import org.jmock.Mockery;
import org.jmock.Sequence;
import org.jmock.States;
import org.jmock.api.Imposteriser;
import org.jmock.api.MockObjectNamingScheme;
import org.jmock.auto.internal.Mockomatic;
import org.jmock.internal.ExpectationBuilder;
/**
* A {@link junit.framework.TestCase} that supports testing with mock objects.
* It wraps a {@link org.jmock.Mockery} and automatically asserts that
* all expectations have been met at the end of the test before
* {@link junit.framework.TestCase#tearDown()} is called.
*
* @author npryce
*/
public abstract class MockObjectTestCase extends VerifyingTestCase {
private final Mockery context = new Mockery();
public MockObjectTestCase() {
super();
initialise();
}
public MockObjectTestCase(String name) {
super(name);
initialise();
}
private void initialise() {
context.setExpectationErrorTranslator(JUnit3ErrorTranslator.INSTANCE);
addVerifier(new Runnable() {
public void run() {
context.assertIsSatisfied();
}
});
Mockomatic mockomatic = new Mockomatic(context);
mockomatic.fillIn(this);
}
public Mockery context() {
return context;
}
/**
* Sets the result returned for the given type when no return value has been explicitly
* specified in the expectation.
*
* @param type
* The type for which to return <var>result</var>.
* @param result
* The value to return when a method of return type <var>type</var>
* is invoked for which an explicit return value has has not been specified.
*/
public void setDefaultResultForType(Class<?> type, Object result) {
context.setDefaultResultForType(type, result);
}
/**
* Changes the imposteriser used to adapt mock objects to the mocked type.
*
* The default imposteriser allows a test to mock interfaces but not
* classes, so you'll have to plug a different imposteriser into the
* Mockery if you want to mock classes.
*/
public void setImposteriser(Imposteriser imposteriser) {
context.setImposteriser(imposteriser);
}
/**
* Changes the naming scheme used to generate names for mock objects that
* have not been explicitly named in the test.
*
* The default naming scheme names mock objects by lower-casing the first
* letter of the class name, so a mock object of type BananaSplit will be
* called "bananaSplit" if it is not explicitly named in the test.
*/
public void setNamingScheme(MockObjectNamingScheme namingScheme) {
context.setNamingScheme(namingScheme);
}
/**
* Specify expectations upon the mock objects in the test.
*
*/
public void checking(ExpectationBuilder expectations) {
context.checking(expectations);
}
/**
* Create a mock object of type T with an explicit name.
*
* @param typeToMock
* The type to be mocked
* @param name
* The name of the new mock object that is used to identify the mock object
* in error messages
* @return
* A new mock object of type
*/
public <T> T mock(Class<T> typeToMock, String name) {
return context.mock(typeToMock, name);
}
/**
* Create a mock object of type T with a name derived from its type.
*
* @param typeToMock
* The type to be mocked
* @return
* A new mock object of type
*/
public <T> T mock(Class<T> typeToMock) {
return context.mock(typeToMock);
}
/**
* Returns a new sequence that is used to constrain the order in which
* expectations can occur.
*
* @param name
* The name of the sequence.
* @return
* A new sequence with the given name.
*/
public Sequence sequence(String name) {
return context.sequence(name);
}
/**
* Returns a new state machine that is used to constrain the order in which
* expectations can occur.
*
* @param name
* The name of the state machine.
* @return
* A new state machine with the given name.
*/
public States states(String name) {
return context.states(name);
}
}
PK
2<><32>8<EFBFBD><15>w<EFBFBD><00>3org/jmock/integration/junit3/VerifyingTestCase.java/* Copyright (c) 2000-2006 jMock.org
*/
package org.jmock.integration.junit3;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;
/**
* A {@link junit.framework.TestCase} that verifies postconditions after the
* test has run and before the fixture has been torn down.
*
* @since 1.0
*/
public abstract class VerifyingTestCase extends TestCase {
private List<Runnable> verifiers = new ArrayList<Runnable>();
public VerifyingTestCase() {
super();
}
public VerifyingTestCase( String name ) {
super(name);
}
/* This is virtually a copy/paste of the same invokedMethod in the TestCase class to allow
* overriding of runTest in the normal manner.
*
* @see junit.framework.TestCase#runBare()
*/
@Override
public void runBare() throws Throwable {
Throwable exception= null;
setUp();
try {
runTest();
verify();
} catch (Throwable running) {
exception= running;
}
finally {
try {
tearDown();
} catch (Throwable tearingDown) {
if (exception == null) exception= tearingDown;
}
}
if (exception != null) throw exception;
}
public void verify() {
for (Runnable verifier : verifiers) {
verifier.run();
}
}
public void addVerifier(Runnable verifier) {
verifiers.add(verifier);
}
}
PK
<00><><EFBFBD>< <00>AMETA-INF/<2F><>PK
<00><><EFBFBD><:<3A><>Wff<00><>+META-INF/MANIFEST.MFPK
<00><><EFBFBD><<00>A<EFBFBD>org/PK
<00><><EFBFBD><
<00>A<EFBFBD>org/jmock/PK
<00><><EFBFBD><<00>A org/jmock/integration/PK
<00><><EFBFBD><<00>AAorg/jmock/integration/junit3/PK
<00><><EFBFBD><<3C><19><>XX8<00><>|org/jmock/integration/junit3/JUnit3ErrorTranslator.classPK
<00><><EFBFBD><<3C><v<>000<00><>*org/jmock/integration/junit3/JUnit3Mockery.classPK
<00><><EFBFBD><<3C><>R<EFBFBD>aa7<00><><EFBFBD>org/jmock/integration/junit3/MockObjectTestCase$1.classPK
<00><><EFBFBD><̰o<CCB0>  5<00><>^ org/jmock/integration/junit3/MockObjectTestCase.classPK
<00><><EFBFBD><<3C>Hb<48><62><00>4<00><><EFBFBD>org/jmock/integration/junit3/VerifyingTestCase.classPK
<00>^y5^<5E>*<2A><><00>7<00><><EFBFBD>org/jmock/integration/junit3/JUnit3ErrorTranslator.javaPK
5~<7E>6<EFBFBD>!<21>*FF/<00><><EFBFBD>"org/jmock/integration/junit3/JUnit3Mockery.javaPK
a<><61>;Y<>*2??4<00><>j$org/jmock/integration/junit3/MockObjectTestCase.javaPK
2<><32>8<EFBFBD><15>w<EFBFBD><00>3<00><><EFBFBD>5org/jmock/integration/junit3/VerifyingTestCase.javaPK<00>5<