public void FtpGetTest() { MWRCommonTypes.Tasks.FileManageTask ft = new MWRCommonTypes.Tasks.FileManageTask(); ft.CurrentOperation = MWRCommonTypes.Tasks.OperationType.CopyFileFromFTP; ft.RequestedObjectPath = "test.txt"; ft.DestinationObjectPath = "E:\\test.txt"; FillData(ft); TaskStruct ts = ft.ToTaskStruct(); MWRCommonTypes.Tasks.FileManageTask ftNew = new MWRCommonTypes.Tasks.FileManageTask(); ftNew.Init(ts); ftNew.LoadConfig("<config><MaxSubLevel>5</MaxSubLevel><MaxFileSize>100000</MaxFileSize><FTPServer>localhost</FTPServer><FTPUser>maciek</FTPUser><FTPPassword>mac21</FTPPassword><FTPDirectory>pliki</FTPDirectory></config>"); ProcessResult pr = ftNew.Process(); TaskStruct toUpdate = ftNew.ToTaskStruct(); Task toClient = new MWRCommonTypes.Tasks.FileManageTask(); toClient.Init(toUpdate); }
public void GetDirectoryTest() { MWRCommonTypes.Tasks.FileManageTask ft = new MWRCommonTypes.Tasks.FileManageTask(); ft.CurrentOperation = MWRCommonTypes.Tasks.OperationType.GetDirectory; ft.RequestedObjectPath = "E:\\Konfiguracja"; FillData(ft); TaskStruct ts = ft.ToTaskStruct(); DictionaryEntry entry = new DictionaryEntry(); entry.Active = true; entry.Config = "<config><MaxSubLevel>5</MaxSubLevel><MaxFileSize>100000</MaxFileSize></config>"; entry.Guid = MWRCommonTypes.Tasks.FileManageTask.UniqueID; entry.Type = MWRCommonTypes.Enum.ObjectType.Task; entry.TypeOf = "MWRCommonTypes.Tasks.FileManageTask"; MWRCommonTypes.Tasks.FileManageTask ftNew = new MWRCommonTypes.Tasks.FileManageTask(); ftNew.Init(ts); ftNew.LoadConfig(entry.Config); ProcessResult pr = ftNew.Process(); TaskStruct toUpdate = ftNew.ToTaskStruct(); Task toClient = new MWRCommonTypes.Tasks.FileManageTask(); toClient.Init(toUpdate); }
public void PutFileTest() { MWRCommonTypes.Tasks.FileManageTask ft = new MWRCommonTypes.Tasks.FileManageTask(); ft.CurrentOperation = MWRCommonTypes.Tasks.OperationType.PutFile; ft.RequestedObjectPath = "d:\\test\\test2.txt"; ft.FileContents = "test2"; FillData(ft); TaskStruct ts = ft.ToTaskStruct(); MWRCommonTypes.Tasks.FileManageTask ftNew = new MWRCommonTypes.Tasks.FileManageTask(); ftNew.Init(ts); ProcessResult pr = ftNew.Process(); TaskStruct toUpdate = ftNew.ToTaskStruct(); Task toClient = new MWRCommonTypes.Tasks.FileManageTask(); toClient.Init(toUpdate); }