1 19 20 21 22 package org.apache.james.remotemanager; 23 24 import org.apache.avalon.cornerstone.services.sockets.SocketManager; 25 import org.apache.avalon.cornerstone.services.threads.ThreadManager; 26 import org.apache.avalon.framework.container.ContainerUtil; 27 import org.apache.avalon.framework.service.ServiceException; 28 import org.apache.commons.net.telnet.TelnetClient; 29 import org.apache.james.domain.XMLDomainList; 30 import org.apache.james.management.DomainListManagement; 31 import org.apache.james.management.VirtualUserTableManagement; 32 import org.apache.james.services.AbstractDNSServer; 33 import org.apache.james.services.DNSServer; 34 import org.apache.james.services.DomainListManagementService; 35 import org.apache.james.services.JamesConnectionManager; 36 import org.apache.james.services.MailServer; 37 import org.apache.james.services.UsersRepository; 38 import org.apache.james.services.UsersStore; 39 import org.apache.james.services.VirtualUserTableManagementService; 40 import org.apache.james.test.mock.avalon.MockLogger; 41 import org.apache.james.test.mock.avalon.MockServiceManager; 42 import org.apache.james.test.mock.avalon.MockSocketManager; 43 import org.apache.james.test.mock.avalon.MockThreadManager; 44 import org.apache.james.test.mock.james.MockMailServer; 45 import org.apache.james.test.mock.james.MockUsersStore; 46 import org.apache.james.test.mock.james.MockVirtualUserTableManagementImpl; 47 import org.apache.james.test.mock.james.MockVirtualUserTableStore; 48 import org.apache.james.test.util.Util; 49 import org.apache.james.userrepository.MockUsersRepository; 50 import org.apache.james.util.InternetPrintWriter; 51 import org.apache.james.util.connection.SimpleConnectionManager; 52 53 import java.io.BufferedInputStream ; 54 import java.io.BufferedOutputStream ; 55 import java.io.BufferedReader ; 56 import java.io.IOException ; 57 import java.io.InputStreamReader ; 58 import java.net.InetAddress ; 59 import java.net.UnknownHostException ; 60 import java.util.ArrayList ; 61 import java.util.Iterator ; 62 import java.util.List ; 63 64 import junit.framework.TestCase; 65 66 72 73 public class RemoteManagerTest extends TestCase { 74 75 protected int m_remoteManagerListenerPort = Util.getNonPrivilegedPort(); 76 protected RemoteManager m_remoteManager; 77 protected RemoteManagerTestConfiguration m_testConfiguration; 78 protected String m_host = "127.0.0.1"; 79 protected BufferedReader m_reader; 80 protected InternetPrintWriter m_writer; 81 protected TelnetClient m_telnetClient; 82 private MockUsersRepository m_mockUsersRepository; 83 private MockMailServer mailServer; 84 85 protected void setUp() throws Exception { 86 m_remoteManager = new RemoteManager(); 87 ContainerUtil.enableLogging(m_remoteManager, new MockLogger()); 88 ContainerUtil.service(m_remoteManager, setUpServiceManager()); 89 m_testConfiguration = new RemoteManagerTestConfiguration(m_remoteManagerListenerPort); 90 } 91 92 protected void tearDown() throws Exception { 93 ContainerUtil.dispose(mailServer); 94 super.tearDown(); 95 } 96 97 protected void finishSetUp(RemoteManagerTestConfiguration testConfiguration) { 98 testConfiguration.init(); 99 try { 100 ContainerUtil.configure(m_remoteManager, testConfiguration); 101 ContainerUtil.initialize(m_remoteManager); 102 } catch (Exception e) { 103 throw new RuntimeException (e); 104 } 105 } 106 107 protected void login() throws IOException { 108 login(m_testConfiguration.getLoginName(), m_testConfiguration.getLoginPassword()); 109 } 110 111 protected void login(String name, String password) throws IOException { 112 sendCommand(name); 113 List answers = readAnswer(); 114 String last = getLastLine(answers); 115 assertTrue("Last line does not start with Password: "+last,last.startsWith("Password:")); 116 sendCommand(password); 117 answers = readAnswer(); 118 last = getLastLine(answers); 119 assertTrue("Last line does not start with Welcome: "+last,last.startsWith("Welcome")); 120 } 121 122 protected String getLastLine(List list) { 123 if (list == null || list.isEmpty()) return null; 124 return (String )list.get(list.size()-1); 125 } 126 127 protected List readAnswer() { 128 return readAnswer(1); 129 } 130 131 protected List readAnswer(int numLines) { 132 List allAnswerLines = new ArrayList (); 133 try { 134 if (numLines > 0) { 135 for (int i = 0; i < numLines; i++) { 136 allAnswerLines.add(m_reader.readLine()); 137 } 138 } else { 139 String line = m_reader.readLine(); 140 allAnswerLines.add(line); 141 142 while (m_reader.ready()) { 143 allAnswerLines.add(m_reader.readLine()); 144 } 145 } 146 return allAnswerLines; 147 } catch (IOException e) { 148 return null; 149 } 150 } 151 152 protected void sendCommand(String command) throws IOException { 153 m_writer.println(command); 154 m_writer.flush(); 155 } 156 157 protected void connect() throws IOException { 158 m_telnetClient = new TelnetClient(); 159 m_telnetClient.connect(m_host, m_remoteManagerListenerPort); 160 161 m_reader = new BufferedReader (new InputStreamReader (new BufferedInputStream (m_telnetClient.getInputStream(), 1024), "ASCII")); 162 m_writer = new InternetPrintWriter(new BufferedOutputStream (m_telnetClient.getOutputStream(), 1024), true); 163 164 readAnswer(3); 165 } 166 167 private MockServiceManager setUpServiceManager() throws ServiceException { 168 MockServiceManager serviceManager = new MockServiceManager(); 169 SimpleConnectionManager connectionManager = new SimpleConnectionManager(); 170 ContainerUtil.enableLogging(connectionManager, new MockLogger()); 171 serviceManager.put(JamesConnectionManager.ROLE, connectionManager); 172 mailServer = new MockMailServer(); 173 serviceManager.put(MailServer.ROLE, mailServer); 174 m_mockUsersRepository = mailServer.getUsersRepository(); 175 serviceManager.put(UsersRepository.ROLE, m_mockUsersRepository); 176 serviceManager.put(UsersStore.ROLE, new MockUsersStore(m_mockUsersRepository)); 177 serviceManager.put(SocketManager.ROLE, new MockSocketManager(m_remoteManagerListenerPort)); 178 serviceManager.put(ThreadManager.ROLE, new MockThreadManager()); 179 serviceManager.put(DNSServer.ROLE, setUpDNSServer()); 180 181 MockVirtualUserTableStore vutStore = new MockVirtualUserTableStore(); 182 VirtualUserTableManagement vutManagement = new VirtualUserTableManagement(); 183 vutManagement.setVirtualUserTableStore(vutStore); 184 vutManagement.setDefaultVirtualUserTable(new MockVirtualUserTableManagementImpl()); 185 serviceManager.put(VirtualUserTableManagementService.ROLE, vutManagement); 186 187 XMLDomainList xml = new XMLDomainList(); 188 ContainerUtil.enableLogging(xml, new MockLogger()); 189 ContainerUtil.service(xml, serviceManager); 190 191 DomainListManagement domManagement = new DomainListManagement(); 192 domManagement.setDomainList(xml); 193 194 serviceManager.put(DomainListManagementService.ROLE, domManagement); 195 return serviceManager; 196 } 197 198 private DNSServer setUpDNSServer() { 199 DNSServer dns = new AbstractDNSServer() { 200 public String getHostName(InetAddress addr) { 201 return "localhost"; 202 } 203 204 public InetAddress getLocalHost() throws UnknownHostException { 205 return InetAddress.getLocalHost(); 206 } 207 208 public InetAddress [] getAllByName(String name) throws UnknownHostException { 209 return new InetAddress []{InetAddress.getLocalHost()}; 210 } 211 }; 212 213 return dns; 214 } 215 216 public void testCustomCommand() throws Exception { 217 finishSetUp(m_testConfiguration); 218 connect(); 219 login(); 220 221 sendCommand("echo hsif eht lla rof sknaht"); 222 String lastLine = getLastLine(readAnswer()); 223 assertEquals("Arguments echoed", "hsif eht lla rof sknaht", lastLine); 224 } 225 226 public void testLogin() throws IOException { 227 finishSetUp(m_testConfiguration); 228 connect(); 229 230 login(); 231 } 232 233 public void testWrongLoginUser() throws IOException { 234 finishSetUp(m_testConfiguration); 235 connect(); 236 237 sendCommand("sindbad"); 238 List answers = readAnswer(); 239 sendCommand(m_testConfiguration.getLoginPassword()); 240 241 answers = readAnswer(2); 243 String last = getLastLine(answers); 244 assertTrue("Last line does not start with 'Login id:' but with '"+last+"'",last.startsWith("Login id:")); } 246 247 public void testWrongLoginPassword() throws IOException { 248 finishSetUp(m_testConfiguration); 249 connect(); 250 251 sendCommand(m_testConfiguration.getLoginName()); 252 List answers = readAnswer(); 253 sendCommand("getmethru"); 254 255 answers = readAnswer(2); 256 String last = getLastLine(answers); 257 assertTrue("Line does not start with 'Login id:' but with '"+last+"'", last.startsWith("Login id:")); } 259 260 public void testUserCount() throws IOException { 261 finishSetUp(m_testConfiguration); 262 connect(); 263 login(); 264 265 sendCommand("countusers"); 266 assertTrue(getLastLine(readAnswer()).endsWith(" 0")); 268 sendCommand("adduser testCount1 testCount"); 269 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 271 sendCommand("countusers"); 272 assertTrue(getLastLine(readAnswer()).endsWith(" 1")); 274 sendCommand("adduser testCount2 testCount"); 275 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 277 sendCommand("countusers"); 278 assertTrue(getLastLine(readAnswer()).endsWith(" 2")); 280 m_mockUsersRepository.removeUser("testCount1"); 281 282 sendCommand("countusers"); 283 assertTrue(getLastLine(readAnswer()).endsWith(" 1")); } 285 286 public void testAddUserAndVerify() throws IOException { 287 finishSetUp(m_testConfiguration); 288 connect(); 289 login(); 290 291 sendCommand("adduser testAdd test"); 292 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 294 sendCommand("verify testNotAdded"); 295 assertTrue(getLastLine(readAnswer()).endsWith(" does not exist")); 296 297 sendCommand("verify testAdd"); 298 assertTrue(getLastLine(readAnswer()).endsWith(" exists")); 299 300 sendCommand("deluser testAdd"); 301 readAnswer(); 302 303 sendCommand("verify testAdd"); 304 assertTrue(getLastLine(readAnswer()).endsWith(" does not exist")); 305 } 306 307 public void testDelUser() throws IOException { 308 finishSetUp(m_testConfiguration); 309 connect(); 310 login(); 311 312 sendCommand("adduser testDel test"); 313 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 315 sendCommand("deluser testNotDeletable"); 316 assertTrue(getLastLine(readAnswer()).endsWith(" doesn't exist")); 317 318 sendCommand("verify testDel"); 319 assertTrue(getLastLine(readAnswer()).endsWith(" exists")); 320 321 sendCommand("deluser testDel"); 322 assertTrue(getLastLine(readAnswer()).endsWith(" deleted")); 323 324 sendCommand("verify testDel"); 325 assertTrue(getLastLine(readAnswer()).endsWith(" does not exist")); 326 } 327 328 public void testQuit() throws IOException { 329 int helpLines = 38; 330 331 finishSetUp(m_testConfiguration); 332 connect(); 333 login(); 334 335 sendCommand("help"); 336 delay(); 337 assertTrue("command line is effective", readAnswer().size() > 0); 338 readAnswer(helpLines); 339 340 sendCommand("quit"); 341 delay(); 342 assertTrue("",readAnswer(1).contains("Bye")); 343 344 sendCommand("help"); 345 delay(); 346 assertNull("connection is closed", m_reader.readLine()); 347 } 348 349 public void testListUsers() throws IOException { 350 finishSetUp(m_testConfiguration); 351 connect(); 352 login(); 353 354 String [] users = new String [] {"ccc", "aaa", "dddd", "bbbbb"}; 355 356 for (int i = 0; i < users.length; i++) { 357 String user = users[i]; 358 sendCommand("adduser " + user + " test"); 359 readAnswer(1); 360 } 361 362 delay(); 363 364 sendCommand("listusers"); 365 List list = readAnswer(5); 366 367 assertEquals("user count line", "Existing accounts " + users.length, list.get(0)); 368 369 List readUserNames = new ArrayList (); 370 for (Iterator iterator = list.iterator(); iterator.hasNext();) { 371 String answerLine = (String ) iterator.next(); 372 if (!answerLine.startsWith("user: ")) continue; 373 readUserNames.add(answerLine.substring(6)); 374 } 375 assertEquals("user count", users.length, readUserNames.size()); 376 377 for (int i = 0; i < users.length; i++) { 378 String user = users[i]; 379 assertTrue("name found", readUserNames.contains(user)); 380 } 381 } 382 383 private void delay() { 384 try { 385 Thread.sleep(100); 386 } catch (InterruptedException e) { 387 ; } 389 } 390 391 public void testCommandCaseInsensitive() throws IOException { 392 finishSetUp(m_testConfiguration); 393 connect(); 394 login(); 395 396 sendCommand("adduser testDel test"); 397 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 399 sendCommand("verify testDel"); 400 assertTrue(getLastLine(readAnswer()).endsWith(" exists")); 401 402 sendCommand("VERIFY testDel"); 403 assertTrue(getLastLine(readAnswer()).endsWith(" exists")); 404 405 sendCommand("vErIfY testDel"); 406 assertTrue(getLastLine(readAnswer()).endsWith(" exists")); 407 } 408 409 public void testParameterCaseSensitive() throws IOException { 410 finishSetUp(m_testConfiguration); 411 connect(); 412 login(); 413 414 sendCommand("adduser testDel test"); 415 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 417 sendCommand("verify testDel"); 418 assertTrue(getLastLine(readAnswer()).endsWith(" exists")); 419 420 sendCommand("verify TESTDEL"); 421 assertTrue(getLastLine(readAnswer()).endsWith(" does not exist")); 422 423 sendCommand("verify testdel"); 424 assertTrue(getLastLine(readAnswer()).endsWith(" does not exist")); 425 } 426 427 public void testAlias() throws IOException { 428 m_mockUsersRepository.setForceUseJamesUser(); 429 finishSetUp(m_testConfiguration); 430 connect(); 431 login(); 432 433 sendCommand("setalias testNonExist1 testNonExist2"); 435 assertTrue(getLastLine(readAnswer()).equals("No such user testNonExist1")); 436 437 sendCommand("adduser testAlias1 test"); 438 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 439 440 sendCommand("showalias testAlias1"); 441 assertTrue(getLastLine(readAnswer()).equals("User testAlias1 does not currently have an alias")); 442 443 sendCommand("setalias testAlias1 testNonExist2"); 444 assertTrue(getLastLine(readAnswer()).equals("Alias unknown to server - create that user first.")); 445 446 sendCommand("setalias testNonExist1 testAlias"); 447 assertTrue(getLastLine(readAnswer()).equals("No such user testNonExist1")); 448 449 sendCommand("adduser testAlias2 test"); 450 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 451 452 sendCommand("setalias testAlias1 testAlias2"); 454 assertTrue(getLastLine(readAnswer()).equals("Alias for testAlias1 set to:testAlias2")); 455 456 sendCommand("setalias testAlias2 testAlias1"); 458 assertTrue(getLastLine(readAnswer()).equals("Alias for testAlias2 set to:testAlias1")); 459 460 sendCommand("showalias testAlias1"); 462 assertTrue(getLastLine(readAnswer()).equals("Current alias for testAlias1 is: testAlias2")); 463 464 sendCommand("setalias testAlias1 testAlias1"); 466 assertTrue(getLastLine(readAnswer()).equals("Alias for testAlias1 set to:testAlias1")); 467 468 sendCommand("adduser testAlias3 test"); 469 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 470 471 sendCommand("setalias testAlias1 testAlias3"); 473 assertTrue(getLastLine(readAnswer()).equals("Alias for testAlias1 set to:testAlias3")); 474 475 sendCommand("showalias testAlias1"); 477 assertTrue(getLastLine(readAnswer()).equals("Current alias for testAlias1 is: testAlias3")); 478 479 sendCommand("unsetalias testAlias1"); 481 assertTrue(getLastLine(readAnswer()).equals("Alias for testAlias1 unset")); 482 483 sendCommand("showalias testAlias1"); 485 assertTrue(getLastLine(readAnswer()).equals("User testAlias1 does not currently have an alias")); 486 487 } 488 489 public void testForward() throws IOException { 490 m_mockUsersRepository.setForceUseJamesUser(); 491 finishSetUp(m_testConfiguration); 492 connect(); 493 login(); 494 495 sendCommand("setforwarding testNonExist1 testForward1@locahost"); 497 assertTrue(getLastLine(readAnswer()).equals("No such user testNonExist1")); 498 499 sendCommand("adduser testForwardUser test"); 500 assertTrue(getLastLine(readAnswer()).endsWith(" added")); 501 502 sendCommand("showforwarding testForwardUser"); 503 assertTrue(getLastLine(readAnswer()).equals("User testForwardUser is not currently being forwarded")); 504 505 sendCommand("setforwarding testForwardUser testForward1@locahost"); 506 assertTrue(getLastLine(readAnswer()).equals("Forwarding destination for testForwardUser set to:testForward1@locahost")); 507 508 sendCommand("showforwarding testForwardUser"); 510 assertTrue(getLastLine(readAnswer()).equals("Current forwarding destination for testForwardUser is: testForward1@locahost")); 511 512 sendCommand("setforwarding testForwardUser testForward2@locahost"); 514 assertTrue(getLastLine(readAnswer()).equals("Forwarding destination for testForwardUser set to:testForward2@locahost")); 515 516 sendCommand("showforwarding testForwardUser"); 518 assertTrue(getLastLine(readAnswer()).equals("Current forwarding destination for testForwardUser is: testForward2@locahost")); 519 520 sendCommand("unsetforwarding testForwardUser"); 522 assertTrue(getLastLine(readAnswer()).equals("Forward for testForwardUser unset")); 523 524 sendCommand("showforwarding testForwardUser"); 526 assertTrue(getLastLine(readAnswer()).equals("User testForwardUser is not currently being forwarded")); 527 528 } 529 530 public void testSetPassword() throws IOException { 531 finishSetUp(m_testConfiguration); 532 connect(); 533 login(); 534 535 String lastLine; 536 537 sendCommand("adduser testPwdUser pwd1"); 538 lastLine = getLastLine(readAnswer()); 539 assertTrue(lastLine.endsWith(" added")); 540 541 assertTrue("initial password", m_mockUsersRepository.test("testPwdUser", "pwd1")); 542 543 sendCommand("setpassword testPwdUser "); 544 lastLine = getLastLine(readAnswer()); 545 assertTrue("password changed to empty: "+lastLine, m_mockUsersRepository.test("testPwdUser", "pwd1")); 546 547 sendCommand("setpassword testPwdUser pwd2"); 549 lastLine = getLastLine(readAnswer()); 550 assertTrue("password not changed to pwd2: "+lastLine, m_mockUsersRepository.test("testPwdUser", "pwd2")); 551 552 sendCommand("setpassword testPwdUser pWD2"); 554 lastLine = getLastLine(readAnswer()); 555 assertFalse("password not changed to pWD2: "+lastLine, m_mockUsersRepository.test("testPwdUser", "pwd2")); 556 assertTrue("password not changed to pWD2: "+lastLine, m_mockUsersRepository.test("testPwdUser", "pWD2")); 557 558 } 559 560 public void testAddMapping() throws IOException { 561 String lastLine; 562 finishSetUp(m_testConfiguration); 563 connect(); 564 login(); 565 566 sendCommand("addmapping test@test junit"); 567 lastLine = getLastLine(readAnswer()); 568 assertTrue("Add mapping", lastLine.endsWith("true")); 569 570 sendCommand("addmapping test@test junit"); 571 lastLine = getLastLine(readAnswer()); 572 assertTrue("Not add mapping... allready exists",lastLine.endsWith("false")); 573 } 574 575 public void testRemoveMapping() throws IOException { 576 String lastLine; 577 finishSetUp(m_testConfiguration); 578 connect(); 579 login(); 580 581 sendCommand("addmapping test@test junit"); 582 lastLine = getLastLine(readAnswer()); 583 assertTrue("Add mapping", lastLine.endsWith("true")); 584 585 sendCommand("removemapping test@test junit"); 586 lastLine = getLastLine(readAnswer()); 587 assertTrue("remove mapping",lastLine.endsWith("true")); 588 589 sendCommand("removemapping test@test junit"); 590 lastLine = getLastLine(readAnswer()); 591 assertTrue("Not remove mapping... mapping not exists",lastLine.endsWith("false")); 592 } 593 594 public void testListAllMappings() throws IOException { 595 String lastLine; 596 finishSetUp(m_testConfiguration); 597 connect(); 598 login(); 599 600 sendCommand("addmapping test@test junit"); 601 lastLine = getLastLine(readAnswer()); 602 assertTrue("Add mapping", lastLine.endsWith("true")); 603 604 sendCommand("addmapping test2@test junit2"); 605 lastLine = getLastLine(readAnswer()); 606 assertTrue("Add mapping", lastLine.endsWith("true")); 607 608 sendCommand("listallmappings"); 609 List answer = readAnswer(3); 610 assertTrue("Read first mapping", answer.get(1).toString().endsWith("junit")); 611 assertTrue("Read second mapping line", answer.get(2).toString().endsWith("junit2")); 612 } 613 614 public void testListMapping() throws IOException { 615 String lastLine; 616 finishSetUp(m_testConfiguration); 617 connect(); 618 login(); 619 620 sendCommand("addmapping test@test junit"); 621 lastLine = getLastLine(readAnswer()); 622 assertTrue("Add mapping", lastLine.endsWith("true")); 623 624 sendCommand("addmapping test2@test junit2"); 625 lastLine = getLastLine(readAnswer()); 626 assertTrue("Add mapping", lastLine.endsWith("true")); 627 628 sendCommand("listmapping test@test"); 629 lastLine = readAnswer(2).get(1).toString(); 630 assertTrue("list mapping", lastLine.endsWith("junit")); 631 } 632 633 public void testaddDomain() throws IOException { 634 String lastLine; 635 finishSetUp(m_testConfiguration); 636 connect(); 637 login(); 638 639 sendCommand("adddomain domain"); 640 lastLine = getLastLine(readAnswer()); 641 assertTrue("Add domain", lastLine.endsWith("successful")); 642 643 sendCommand("adddomain domain"); 644 lastLine = getLastLine(readAnswer()); 645 assertTrue("Add domain which exists", lastLine.endsWith("fail")); 646 647 sendCommand("listdomains"); 648 649 lastLine = readAnswer(2).get(1).toString(); 650 assertTrue("list domain", lastLine.endsWith("domain")); 651 } 652 653 public void testremoveDomain() throws IOException { 654 String lastLine; 655 finishSetUp(m_testConfiguration); 656 connect(); 657 login(); 658 659 sendCommand("adddomain domain"); 660 lastLine = getLastLine(readAnswer()); 661 assertTrue("Add domain", lastLine.endsWith("successful")); 662 663 sendCommand("removedomain domain"); 664 lastLine = getLastLine(readAnswer()); 665 assertTrue("Remove domain", lastLine.endsWith("successful")); 666 667 sendCommand("removedomain domain"); 668 lastLine = getLastLine(readAnswer()); 669 assertTrue("Remove domain which not exist", lastLine.endsWith("fail")); 670 } 671 672 public void testListDomains() throws IOException { 673 String lastLine; 674 finishSetUp(m_testConfiguration); 675 connect(); 676 login(); 677 678 sendCommand("adddomain domain"); 679 lastLine = getLastLine(readAnswer()); 680 assertTrue("Add domain", lastLine.endsWith("successful")); 681 682 sendCommand("adddomain domain2"); 683 lastLine = getLastLine(readAnswer()); 684 assertTrue("Add domain", lastLine.endsWith("successful")); 685 686 sendCommand("listdomains"); 687 List answer = readAnswer(3); 688 assertTrue("list domain 1", answer.get(1).toString().endsWith("domain")); 689 assertTrue("list domain 2", answer.get(2).toString().endsWith("domain2")); 690 } 691 } 692 | Popular Tags |