1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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();
//            }
            
        }
    }