package com.alexanderlogistics;


import java.util.Optional;
import java.util.logging.Logger;

import org.imixs.workflow.FileData;
import org.imixs.workflow.exceptions.PluginException;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import junit.framework.Assert;

/**
 * This test generates random test data
 * 
 * @author rsoika
 * 
 */
public class TestFTP {

	
	final static String FILE = "/DTVF_SKBeschrift_21010.csv";

	private final static Logger logger = Logger.getLogger(TestFTP.class.getName());

	@Before
	public void setUp() throws Exception {
		
	}

	/**
	 * Test Kreditoren import
	 */
	@Ignore
	@Test
	public void testPutFileToFTP() {
	    
	    FTPConnector ftpc=new FTPConnector();
	    
	    ftpc.ftpServer=Optional.ofNullable("u248962.your-storagebox.de");
	    ftpc.ftpPort=Optional.ofNullable(21);
        ftpc.ftpUser=Optional.ofNullable("u248962-sub2");
        ftpc.ftpPassword=Optional.ofNullable("aXa61n9Un3jDNQlL");
        ftpc.ftpPath=Optional.ofNullable("/");
        
	    
	    
		
		FileData fileData=new FileData("test.txt","some data...".getBytes(),"text",null);
		try {
		    ftpc.put(fileData);
			logger.info("test finished...");
		} catch ( PluginException e) {
			
			e.printStackTrace();
			Assert.fail();
		}

	}
	
	

}
