package org.jerrymouse.cc.site.store.file;

import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jerrymouse.cc.site.store.ftp.FtpStoreConfig;
import org.jerrymouse.cc.site.store.ftp.FtpStoreManager;
import org.jerrymouse.cc.site.test.BaseTest;
import org.jerrymouse.cc.utils.ResourceBuilder;
import org.junit.Before;
import org.junit.Test;

public class FileStoreManagerTest extends BaseTest {

	FileStoreManager fileStoreManager;

	private Log log = LogFactory.getLog(getClass());

	@Override
	@Before
	protected void onSetUp() throws Exception {
		super.onSetUp();
		fileStoreManager = new FileStoreManager("yankai");
	}

	@Test
	public void testSave() throws Exception {
		byte[] bytes = IOUtils.toByteArray(ResourceBuilder
				.getResourcesBuilder().load("store/open_3d.mp4"));
		fileStoreManager.putBytes("xx.mp4", bytes);
		// log.debug(bytes);
	}

	@Test
	public void testGetInputStream() throws Exception {
		// InputStream inputStream = ftpStoreManager.getInputStream("a.txt");
		// String s = IOUtils.toString(inputStream);
		// log.debug(s);
	}
}
