/* EmailCellMakerTest.java * * Copyright (c) 2002, Nico Lehmann * * You may use and distribute under the terms of either the GNU Lesser * General Public License, either version 2 of the license or, * at your choice, any later version. Alternatively, you may use and * distribute under the terms of the XPL. * * See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of * the licenses. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the README * file for more details. * */ /* * Written by Nico Lehmann */ package gzz.modules.email; import gzz.*; import gzz.zzutil.*; public class EmailCellMakerTest { public void test(Space s){ MockEmailInStorm mail = new MockEmailInStorm( "me@example.com", "osk@gzz.info", "1.1.01", "Hallo", "Hi" ); EmailCellMaker test = new EmailCellMaker(); test.makeCells(mail, s); Dim d_email =s.getDim(Ids.d_email); Dim d_contain = s.getDim(Ids.d_contain); Dim d_contain_list = s.getDim(Ids.d_contain_list); Cell home = s.getHomeCell(); Cell c =home.s(d_email,1); Cell fromCell = c.s(d_contain,1); Cell toCell = fromCell.s(d_contain_list,1); Cell dateCell = toCell.s(d_contain_list,1); Cell subCell = dateCell.s(d_contain_list,1); Cell bodyCell = subCell.s(d_contain_list,1); if(!"me@example.com".equals(fromCell.t())) throw new Error(); if(!"osk@gzz.info".equals(toCell.t())) throw new Error(); if(!"1.1.01".equals(dateCell.t())) throw new Error(); if(!"Hallo".equals(subCell.t())) throw new Error(); if(!"Hi".equals(bodyCell.t())) throw new Error(); } }