2 * Copyright (C) 2012 Openismus GmbH
4 * This file is part of GWT-Glom.
6 * GWT-Glom is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
11 * GWT-Glom is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with GWT-Glom. If not, see <http://www.gnu.org/licenses/>.
20 package org.glom.web.server.libglom;
22 import static org.junit.Assert.assertEquals;
23 import static org.junit.Assert.assertTrue;
25 import org.glom.web.server.Utils;
26 import org.glom.web.shared.libglom.layout.LayoutItemPortal;
27 import org.glom.web.shared.libglom.layout.TableToViewDetails;
28 import org.glom.web.shared.libglom.layout.UsesRelationshipImpl;
29 import org.junit.Test;
32 * @author Murray Cumming <murrayc@openismus.com>
35 public class LayoutItemPortalDeepCloneTest {
39 // This seems to fail when we use it in OnlineGlomServiceImpl,
41 final LayoutItemPortal portal = new LayoutItemPortal();
42 final TableToViewDetails viewDetails = new TableToViewDetails();
43 final String testTableName = "sometable";
45 /* TODO: Test something else instead now that we have removed this API:
46 viewDetails.tableName = testTableName;
47 viewDetails.usesRelationship = new UsesRelationshipImpl();
48 portal.setNavigationTable(viewDetails);
50 final LayoutItemPortal clone = (LayoutItemPortal) Utils.deepCopy(portal);
51 assertTrue(clone != null);
52 final TableToViewDetails cloneViewDetails = clone.getNavigationTable();
53 assertTrue(cloneViewDetails != null);
54 assertEquals(cloneViewDetails.tableName, testTableName);
55 assertTrue(cloneViewDetails.usesRelationship != null);