package test.spot;
import java.net.URL;
import org.apache.log4j.PropertyConfigurator;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.skyline.base.type.Activity;
import com.skyline.base.type.Position;
import com.skyline.base.type.SpotType;
import com.skyline.common.bean.Page;
import com.skyline.spot.service.SpotService;
public class SpotTest {
static SpotService spotservice = null;
static {
URL url = SpotService.class.getClassLoader().getResource(
"config/logger/log4j.properties");
PropertyConfigurator.configure(url);
}
@BeforeClass
public static void before() {
ApplicationContext ctx = new ClassPathXmlApplicationContext(
"config/context/applicationContext.xml");
spotservice = (SpotService) ctx.getBean("spotService");
}
@Test
public void votes() {
try {
spotservice.votes(Long.valueOf(1), 5);
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void view() {
try {
spotservice.view(Long.valueOf(1));
} catch (Exception e) {
e.printStackTrace();
}
}
public void add() {
try {
// attentionservice.payAttention(Long.valueOf(1), "testAttention",
// "default", Long.valueOf(0), "attention", "default",
// IdolType.USER);
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void findBySiteId()
{
Page page=new Page();
page.setSize(5);
System.out.println(spotservice.findByCountry("0011", SpotType.VIEWPOINT,page,Activity.NORMAL).size());
}
@Test
public void testIsExit()
{
boolean status=spotservice.isExist("test");
System.out.println(status);
}
}