TestMailService.java 640 B

12345678910111213141516171819202122
  1. package com.uas.platform.b2c;
  2. import java.io.IOException;
  3. import org.springframework.context.support.ClassPathXmlApplicationContext;
  4. import com.uas.message.mail.service.MailService;
  5. public class TestMailService {
  6. // @Test
  7. public void testSend() throws IOException {
  8. String config = TestMailService.class.getPackage().getName().replace('.', '/') + "/dubbo-consumer.xml";
  9. @SuppressWarnings("resource")
  10. ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
  11. context.start();
  12. MailService service = (MailService) context.getBean("mailService");
  13. service.findLogs(1, 20);
  14. System.in.read();
  15. }
  16. }