Remove LayoutItemPortal.get/setNavigationTable().
[online-glom:gwt-glom.git] / src / test / java / org / glom / web / server / libglom / LayoutItemPortalDeepCloneTest.java
1 /*
2  * Copyright (C) 2012 Openismus GmbH
3  *
4  * This file is part of GWT-Glom.
5  *
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.
10  *
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
14  * for more details.
15  *
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/>.
18  */
19
20 package org.glom.web.server.libglom;
21
22 import static org.junit.Assert.assertEquals;
23 import static org.junit.Assert.assertTrue;
24
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;
30
31 /**
32  * @author Murray Cumming <murrayc@openismus.com>
33  * 
34  */
35 public class LayoutItemPortalDeepCloneTest {
36
37         @Test
38         public void test() {
39                 // This seems to fail when we use it in OnlineGlomServiceImpl,
40                 // but it works here:
41                 final LayoutItemPortal portal = new LayoutItemPortal();
42                 final TableToViewDetails viewDetails = new TableToViewDetails();
43                 final String testTableName = "sometable";
44                 
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);
49
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);
56                 */
57         }
58 }