view m-toolbox/test/test_collection.m @ 22:b11e88004fca database-connection-manager

Update collection.fromRepository
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

mc

%% Empty

c1 = collection

%% With some objects

c2 = collection(ao(1), plist('key', 'value'), ssm)

c2r = c2.rebuild

eq(c2r,c2, 'created', 'proctime', 'UUID')


%% Vector

c1 = collection(ao(1), ssm)
c2 = collection(ao(1), pzmodel)

cvc = collection([c1 c2])


%% With plist

c3 = collection()

c3.addObjects(ao(2))

c3.addObjects(ao(2), plist('key', 'value'))


c3.addObjects(plist('objs', {ao(3), ssm}))

c3.addObjects(plist('objs', [ao(4) ao(5)]))

%% Save/load

save(c3, 'c3.xml')

c3l = collection('c3.xml')

eq(c3, c3l)


save(c3, 'c3.mat')

c3l = collection('c3.mat')

eq(c3, c3l)