Advertisement
Guest User

Junit testclass

a guest
Oct 25th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. /**
  2.  *
  3.  */
  4. package com.metacube.questionbank.service.impl;
  5.  
  6. import static org.junit.Assert.*;
  7.  
  8. import org.junit.Before;
  9. import org.junit.Test;
  10. import org.junit.runner.RunWith;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.context.ApplicationContext;
  13. import org.springframework.context.support.FileSystemXmlApplicationContext;
  14. import org.springframework.test.context.ContextConfiguration;
  15. import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
  16.  
  17. @RunWith(SpringJUnit4ClassRunner.class)
  18.  
  19. /**
  20.  * @author pc
  21.  *
  22.  */
  23. @ContextConfiguration(locations="file:WebContent/WEB-INF/dispatcher-servlet.xml")
  24. public class UserServiceImplTest {
  25.    
  26.     ApplicationContext ac;
  27.  
  28.     @Before
  29.     public void setUp()
  30.     {
  31.     ac = new FileSystemXmlApplicationContext("../../WebContent/WEB-INF/dispatcher-servlet.xml");
  32.     System.out.println(ac);
  33.     }  
  34.  
  35.     @Test
  36.     public void test() {
  37.     System.out.println("hello");
  38.     assertEquals(1, 1);
  39.     }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement