package org.jerrymouse.cc.site.web.upload;

import static org.junit.Assert.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jerrymouse.cc.site.bean.Resource;
import org.jerrymouse.cc.site.bean.Storage;
import org.jerrymouse.cc.site.database.UserDao;
import org.jerrymouse.cc.site.test.BaseTest;
import org.jerrymouse.cc.site.web.upload.UploadToFtp;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

public class UploadToFtpTest extends BaseTest {
	Resource resource;

	@Autowired
	UserDao userDao;

	Log log = LogFactory.getLog(UploadToFtpTest.class);

	@Override
	protected void onSetUp() throws Exception {
		Storage storage = userDao.getUserByName("yankai").getStorage();
		resource = storage.getResourceByName("1");
		super.onSetUp();
	}

	@Test
	public void testPutResource() {
		UploadToFtp uploadToFtp = new UploadToFtp();
		String s = uploadToFtp.putResource(resource);
		log.debug(s);
	}

}
