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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.vci.test.bof.event;
 
import junit.framework.Assert;
 
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
 
import com.vci.corba.common.VCIError;
import com.vci.corba.omd.data.AttributeValue;
import com.vci.corba.omd.data.BusinessObject;
import com.vci.corba.omd.data.LinkObject;
import com.vci.server.bof.BOFactoryServiceImpl;
 
 
public class LOFactoryTest {
 
    public static BOFactoryServiceImpl impl = null;
    
    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
    }
 
    @AfterClass
    public static void tearDownAfterClass() throws Exception {
    }
 
    @Before
    public void setUp() throws Exception {
        impl = new BOFactoryServiceImpl();
    }
 
    @After
    public void tearDown() throws Exception {
    }
 
    @Test
    public void createLinkObject() throws VCIError {
        LinkObject lo = new LinkObject();
        lo.oid = "lo001";
        lo.creator = "liucq";
        lo.modifier = "liucq2";
        lo.fromOid = "fOID";
        lo.fromRevOid = "froid";
        lo.fromNameOid = "fnoid";
        lo.fromBTName = "fbtwname";
        lo.toOid = "toid";
        lo.toRevOid = "troid";
        lo.toNameOid = "tnoid";
        lo.toBTName = "tbtwname";
        lo.ts = 11;
        lo.ltName = "FILETYPERELATION";
        AttributeValue[] attrValArray = new AttributeValue[2];
        AttributeValue name = new AttributeValue();
        name.attrName = "LINKONW";
        name.attrVal = "ONE";
        attrValArray[0] = name;
        
        AttributeValue filePath = new AttributeValue();
        filePath.attrName = "LINKTWO";
        filePath.attrVal = "TWO";
        attrValArray[1] = filePath;
        lo.newAttrValList = attrValArray;
//        LinkObject rs = impl.createLinkObject(lo);
//        Assert.assertTrue(rs == null);
    }
    
    @Test
    public void testUpdateLinkObeject() throws VCIError {
        LinkObject lo = new LinkObject();
        lo.oid = "lo001";
        lo.creator = "liucq";
        lo.modifier = "liucq2";
        lo.fromOid = "fOID";
        lo.fromRevOid = "froid";
        lo.fromNameOid = "fnoid";
        lo.fromBTName = "fbtwname";
        lo.toOid = "toid";
        lo.toRevOid = "troid";
        lo.toNameOid = "tnoid";
        lo.toBTName = "tbtwname";
        lo.ts = 11;
        lo.ltName = "FILETYPERELATION";
        AttributeValue[] attrValArray = new AttributeValue[2];
        AttributeValue name = new AttributeValue();
        name.attrName = "LINKONW";
        name.attrVal = "ONE1";
        attrValArray[0] = name;
        
        AttributeValue filePath = new AttributeValue();
        filePath.attrName = "LINKTWO";
        filePath.attrVal = "TWO2";
        attrValArray[1] = filePath;
        lo.newAttrValList = attrValArray;
        
//        LinkObjectHolder holder = new LinkObjectHolder();
//        holder.value = lo;
//        boolean rs = impl.updateLinkObject(holder);
//        Assert.assertTrue(rs);
    }
    
    @Test
    public void testSelectLinkObject() throws VCIError {
        LinkObject lo = new LinkObject();
        lo.oid = "lo001";
        lo.ltName = "FILETYPERELATION";
        BusinessObject bo = new BusinessObject();
        bo.oid = "";
//        LinkObject[] los = impl.readLinkObjectByFromBO(bo, lo.linkTypeName);
//        System.out.println(los.length);
    }
    
    @Test
    public void testDeleteLinkObject() throws VCIError {
        LinkObject lo = new LinkObject();
        lo.oid = "lo001";
        lo.ltName = "FILETYPERELATION";
//        boolean rs = impl.deleteLinkObject(lo);
//        Assert.assertTrue(rs);
    }
}