1 /* Reattore HTTP Server 2 3 Copyright (C) 2002 Michael Hope <michaelh@juju.net.nz> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 $Id: TestRoundRobinChooser.java,v 1.4 2003/02/09 02:28:42 michaelh Exp $ 20 */ 21 22 package test.juju.reattore.loadtest.controller.impl; 23 24 import junit.framework.*; 25 import java.net.URL; 26 import juju.reattore.loadtest.controller.impl.*; 27 28 public class TestRoundRobinChooser 29 extends TestCase { 30 31 private RoundRobinChooser ch = new RoundRobinChooser(); 32 33 public void testOrder() 34 throws Exception { 35 36 URL u1 = new URL("http://127.0.0.1:8080/"); 37 URL u2 = new URL("http://127.0.0.2:8080/"); 38 URL u3 = new URL("http://127.0.0.3:8080/"); 39 40 ch.addTarget(u1); 41 ch.addTarget(u2); 42 ch.addTarget(u3); 43 44 45 assertEquals(u1, ch.getNext()); 46 assertEquals(u2, ch.getNext()); 47 assertEquals(u3, ch.getNext()); 48 assertEquals(u1, ch.getNext()); 49 assertEquals(u2, ch.getNext()); 50 } 51 52 public void testEmpty() { 53 assertNull(ch.getNext()); 54 } 55 56 public static Test suite() { 57 return new TestSuite(TestRoundRobinChooser.class); 58 } 59 }

This page was automatically generated by Maven