package com.vci.test.fm;
|
|
import org.junit.After;
|
import org.junit.AfterClass;
|
import org.junit.Before;
|
import org.junit.BeforeClass;
|
import org.junit.Test;
|
|
import com.vci.client.LogonApplication;
|
import com.vci.client.common.objects.UserEntityObject;
|
import com.vci.client.fm.ClientFOOperationInterface;
|
import com.vci.client.fm.ClientFileObjectOperation;
|
import com.vci.client.fm.FileObject;
|
|
public class FMTest {
|
|
@BeforeClass
|
public static void setUpBeforeClass() throws Exception {
|
}
|
|
@AfterClass
|
public static void tearDownAfterClass() throws Exception {
|
}
|
|
@Before
|
public void setUp() throws Exception {
|
UserEntityObject ueo = new UserEntityObject();
|
ueo.setIp("192.168.0.50");
|
ueo.setUserName("eddieliu");
|
LogonApplication.userEntityObject = ueo;
|
}
|
|
@After
|
public void tearDown() throws Exception {
|
}
|
|
@Test
|
public void testSaveNewFile() {
|
FMOperration fmOperration = new FMOperration();
|
new Thread(fmOperration).start();
|
new Thread(fmOperration).start();
|
new Thread(fmOperration).start();
|
new Thread(fmOperration).start();
|
new Thread(fmOperration).start();
|
new Thread(fmOperration).start();
|
}
|
}
|
|
class FMOperration implements Runnable{
|
static ClientFOOperationInterface operation = new ClientFileObjectOperation();
|
String localfilePath = "C:/workspace.rar";
|
FileObject fileObject = null;
|
@Override
|
public void run() {
|
//System.out.println("----------run invoked------------------");
|
fileOpertion();
|
//System.out.println("=========run invoked===========");
|
}
|
|
public synchronized void fileOpertion(){
|
// try {
|
// fileObject = operation.saveNewFile(localfilePath);
|
// System.out.println(fileObject.getOid() + ":"
|
// + fileObject.getFilePath());
|
// } catch (VCIError e) {
|
// // TODO Auto-generated catch block
|
// e.printStackTrace();
|
// }
|
|
}
|
}
|