Package mockit

Examples of mockit.NonStrictExpectations


    private MailToHostTransmitter sender;

    @Before
    public void initialize() throws UnknownHostException, SMTPException,
            IOException {
        new NonStrictExpectations() {
            {
                clientFactory.create((InetAddress) any);
                result = smartClient;
            }
        };
View Full Code Here


    }

    @Test
    public void testSendAllAddressRejected() throws IllegalArgumentException,
            SendException, SMTPException, IOException, PostponeException {
        new NonStrictExpectations() {
            {
                smartClient.to(anyString);
                result = SMTP_EXCEPTION;

            }
View Full Code Here

    @Test
    public void testSendFirstAddressRejectedFromTwo()
            throws IllegalArgumentException, SendException, SMTPException,
            IOException, PostponeException {

        new NonStrictExpectations() {
            {
                smartClient.to(anyString);
                result = SMTP_EXCEPTION;
                result = null;
            }
View Full Code Here

    }

    @Test
    public void testSendIoExceptionIsTransient() throws SMTPException,
            IOException, RecipientsWereRejectedException, PostponeException {
        new NonStrictExpectations() {
            {
                smartClient.to(anyString);
                result = new IOException();
            }
        };
View Full Code Here

    }

    @Test(expected = RemoteMtaErrorResponseException.class)
    public void testSendSmtpErrorResponse() throws SMTPException, IOException,
            RecipientsWereRejectedException, SendException, PostponeException {
        new NonStrictExpectations() {
            {
                smartClient.dataEnd();
                result = SMTP_EXCEPTION;
            }
        };
View Full Code Here

                Arrays.asList(JANE_AS_RECIPIENT, JOHN_AS_RECIPIENT);
        sender =
                new ImmediateSender(mxLookupFactory, addressLookupFactory,
                        mailToHostTransmitterFactory);

        new NonStrictExpectations() {
            {
                mailToHostTransmitterFactory.create((RemoteMta) any);
                result = mailToHostTransmitter;

                mxLookupFactory.create((Domain) any);
View Full Code Here

        sender.send(mail);

    }

    private void twoMxDnsExpectation() throws SendException {
        new NonStrictExpectations() {
            {
                mxLookup.queryMxTargets();
                result =
                        new Name[] { HOST1_EXAMPLE_COM_NAME,
                                HOST2_EXAMPLE_COM_NAME };
View Full Code Here

  @Test
  public void testFilter(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Throwable{
//    System.out.println(System.getProperty("java.class.path"));

   
    new NonStrictExpectations(){{
      bitContext.getMetrics(); result = new MetricRegistry("test");
      bitContext.getAllocator(); result = BufferAllocator.getAllocator(c);
    }};
   
   
View Full Code Here

  @Test
  public void testSpecial(final @Injectable RecordBatch batch, @Injectable ValueVector vector) throws Exception {
    final TypedFieldId tfid = new TypedFieldId(Types.optional(MinorType.INT),0, false);
   
    new NonStrictExpectations() {
      @NonStrict VectorWrapper<?> wrapper;
      {
        batch.getValueVectorId(new SchemaPath("alpha", ExpressionPosition.UNKNOWN));
        result = tfid;
        batch.getValueAccessorById(tfid.getFieldId(), IntVector.class);
View Full Code Here

  @Test
  public void testRepeated(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Throwable{
//    System.out.println(System.getProperty("java.class.path"));

   
    new NonStrictExpectations(){{
      bitContext.getMetrics(); result = new MetricRegistry("test");
      bitContext.getAllocator(); result = BufferAllocator.getAllocator(c);
    }};
   
   
View Full Code Here

TOP

Related Classes of mockit.NonStrictExpectations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.