/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package com.github.sleroy.junit.mail.server.test;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;

import com.github.sleroy.fakesmtp.core.ServerConfiguration;
import com.github.sleroy.junit.mail.server.test.FakeSmtpRule;

public class FakeSmtpRuleTest {

	@Rule
	public FakeSmtpRule smtpServer = new FakeSmtpRule(ServerConfiguration.create().port(2525).charset("UTF-8"));

	/**
	 * Tests that the server is launching
	 */
	@Test
	public void testFakeSmtpRule() {
		Assert.assertTrue(smtpServer.isRunning());
	}

}

@@ -1048,16 +1048,97 @@
 mtpRule;
+%0Aimport org.junit.rules.ErrorCollector;%0Aimport org.junit.rules.ExpectedException;
 %0A%0Apublic
@@ -1282,16 +1282,85 @@
 -8%22));%0A%0A
+%09@Rule%0A%09public ExpectedException thrown = ExpectedException.none();%0A%0A
 %09/**%0A%09 *
@@ -1490,10 +1490,354 @@
 ));%0A%09%7D%0A%0A
+%09@Test%0A%09public void forceShutdown() %7B%0A%09%09smtpServer.forceShutdown();%0A%09%09Assert.assertFalse(smtpServer.isRunning());%0A%09%7D%0A%09@Test%0A%09public void forceShutdown_twice_throwsFakeSmtpRuleException() %7B%0A%09%09smtpServer.forceShutdown();%0A%09%09Assert.assertFalse(smtpServer.isRunning());%0A%09%09thrown.expect(FakeSmtpRuleException.class);%0A%09%09smtpServer.forceShutdown();%0A%09%7D%0A
 %7D%0A

add test for forceShutdown()