ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.vci.client.portal.test;
 
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
 
import com.vci.client.portal.utility.PLDefination;
import com.vci.client.portal.utility.UITools;
import com.vci.common.utility.ObjectUtility;
import com.vci.corba.common.VCIError;
import com.vci.corba.portal.data.PLPageDefination;
 
public class TestPLPageDefination {
    PLDefination obj = new PLDefination();
    @Before
    public void initPLDefination(){
        obj.setType(3);
        obj.setTemplateType("1");
        obj.setSearchTarger("3");
//        obj.setControlPath("/vci/VciDocumentFile.jsp");
        obj.setShowType("StandardManagement");
        obj.setTemplateId("StandardManagementList");
    }
    
    //test保存PLPageDefination
    @org.junit.Test
    public void testSavePLPageDefination() throws Throwable{
        PLPageDefination plPageDefination = new PLPageDefination();
        plPageDefination.plOId = ObjectUtility.getNewObjectID36();
        plPageDefination.plTabPageOId = "6D71ECB2-5E4C-6F74-858A-FE6A14E42091";
        plPageDefination.plType = 3;
        plPageDefination.plDefination = UITools.getPLDefinationText(obj);
        try {
            boolean flag = UITools.getService().savePLPageDefination(plPageDefination);
            Assert.assertTrue(flag);
        } catch (VCIError e) {
            e.printStackTrace();
        }
    }
    
    @Test
    public void testGetPLPageDefination() throws Throwable{
        PLPageDefination obj = UITools.getService().getPLPageDefinationById("8ECF5669-BE93-555C-9CA3-E3705B325996");
        PLDefination p = UITools.getPLDefination(obj.plDefination);
        System.out.println();
    }
    
    // test更新PLPageDefination
//    @org.junit.Test
//    public void testUpdatePLPageDefination() {
//        PLPageDefination plPageDefination = new PLPageDefination();
//        plPageDefination.plOId = "AE930DCA-4E79-5537-0FF5-F7D861C7124F";
//        plPageDefination.plPageContextOId = "update";
//        plPageDefination.plType = 2;
//        plPageDefination.plDefination = "plDefination";
//        try {
//            boolean flag = Tool.getService().updatePLPageDefination(plPageDefination);
//            Assert.assertTrue(flag);
//        } catch (PLMError e) {
//            e.printStackTrace();
//        }
//    }
    
    // test删除PLPageDefination
//    @org.junit.Test
//    public void testDeletePLPageDefination() {
//        PLPageDefination plPageDefination = new PLPageDefination();
//        plPageDefination.plOId = "AE930DCA-4E79-5537-0FF5-F7D861C7124F";
//        try {
//            boolean flag = Tool.getService().deletePLPageDefination(plPageDefination);
//            Assert.assertTrue(flag);
//        } catch (PLMError e) {
//            e.printStackTrace();
//        }
//    }
    
    // test删除PLPageDefination
//    @org.junit.Test
//    public void testDeletePLPageDefinationById() {
//        PLPageDefination plPageDefination = new PLPageDefination();
//        plPageDefination.plOId = ObjectUtility.getNewObjectID36();
//        plPageDefination.plPageContextOId = "plPageContextOId";
//        plPageDefination.plType = 2;
//        plPageDefination.plDefination = "plDefination";
//        try {
//            boolean flag = Tool.getService().deletePLPageDefinationByID("C492143C-F652-9A26-EF2E-4BC97D23C464");
//            Assert.assertTrue(flag);
//        } catch (PLMError e) {
//            e.printStackTrace();
//        }
//    }
}