1 22 package org.jboss.test.iiopperf.test; 23 24 25 import javax.ejb.*; 26 import javax.naming.*; 27 import javax.rmi.PortableRemoteObject ; 28 29 import org.jboss.test.iiopperf.interfaces.*; 30 31 import junit.framework.Test; 32 import junit.framework.TestCase; 33 import junit.framework.TestSuite; 34 import org.jboss.test.JBossTestCase; 35 36 37 41 public class T0PassBasicTypesTestCase 42 extends JBossTestCase 43 { 44 46 private java.util.Properties cosnamingJndiProps; 48 49 51 public T0PassBasicTypesTestCase(String name) 53 throws java.io.IOException 54 { 55 super(name); 56 java.net.URL url; 57 58 url = ClassLoader.getSystemResource("cosnaming.jndi.properties"); 59 cosnamingJndiProps = new java.util.Properties (); 60 cosnamingJndiProps.load(url.openStream()); 61 } 62 63 65 InitialContext getInitialContext(java.util.Properties jndiProps) 66 throws Exception 67 { 68 return new InitialContext(jndiProps); 69 } 70 71 73 78 public void testJRMPSendReceiveNothing() 79 throws Exception 80 { 81 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 82 getInitialContext().lookup(SessionHome.JNDI_NAME), 83 SessionHome.class); 84 Session session = home.create(); 85 int n = getIterationCount(); 86 long start = System.currentTimeMillis(); 87 for (int i = 0 ; i < n; i++) 88 { 89 session.sendReceiveNothing(); 90 } 91 long end = System.currentTimeMillis(); 92 getLog().info("JRMP sendReceiveNothing: " + 93 ((end - start) / (double)n) + " ms/call"); 94 } 95 96 101 public void testIIOPSendReceiveNothing() 102 throws Exception 103 { 104 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 105 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 106 SessionHome.class); 107 Session session = home.create(); 108 int n = getIterationCount(); 109 long start = System.currentTimeMillis(); 110 for (int i = 0 ; i < n; i++) 111 { 112 session.sendReceiveNothing(); 113 } 114 long end = System.currentTimeMillis(); 115 getLog().info("IIOP sendReceiveNothing: " + 116 ((end - start) / (double)n) + " ms/call"); 117 } 118 119 124 public void testJRMPSendBoolean() 125 throws Exception 126 { 127 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 128 getInitialContext().lookup(SessionHome.JNDI_NAME), 129 SessionHome.class); 130 Session session = home.create(); 131 int n = getIterationCount(); 132 long start = System.currentTimeMillis(); 133 for (int i = 0 ; i < n; i++) 134 { 135 session.sendBoolean(true); 136 } 137 long end = System.currentTimeMillis(); 138 getLog().info("JRMP sendBoolean: " + 139 ((end - start) / (double)n) + " ms/call"); 140 } 141 142 147 public void testIIOPSendBoolean() 148 throws Exception 149 { 150 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 151 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 152 SessionHome.class); 153 Session session = home.create(); 154 int n = getIterationCount(); 155 long start = System.currentTimeMillis(); 156 for (int i = 0 ; i < n; i++) 157 { 158 session.sendBoolean(true); 159 } 160 long end = System.currentTimeMillis(); 161 getLog().info("IIOP sendBoolean: " + 162 ((end - start) / (double)n) + " ms/call"); 163 } 164 165 170 public void testJRMPReceiveBoolean() 171 throws Exception 172 { 173 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 174 getInitialContext().lookup(SessionHome.JNDI_NAME), 175 SessionHome.class); 176 Session session = home.create(); 177 int n = getIterationCount(); 178 long start = System.currentTimeMillis(); 179 for (int i = 0 ; i < n; i++) 180 { 181 session.receiveBoolean(); 182 } 183 long end = System.currentTimeMillis(); 184 getLog().info("JRMP receiveBoolean: " + 185 ((end - start) / (double)n) + " ms/call"); 186 } 187 188 193 public void testIIOPReceiveBoolean() 194 throws Exception 195 { 196 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 197 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 198 SessionHome.class); 199 Session session = home.create(); 200 int n = getIterationCount(); 201 long start = System.currentTimeMillis(); 202 for (int i = 0 ; i < n; i++) 203 { 204 session.receiveBoolean(); 205 } 206 long end = System.currentTimeMillis(); 207 getLog().info("IIOP receiveBoolean: " + 208 ((end - start) / (double)n) + " ms/call"); 209 } 210 211 216 public void testJRMPSendReceiveBoolean() 217 throws Exception 218 { 219 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 220 getInitialContext().lookup(SessionHome.JNDI_NAME), 221 SessionHome.class); 222 Session session = home.create(); 223 int n = getIterationCount(); 224 long start = System.currentTimeMillis(); 225 for (int i = 0 ; i < n; i++) 226 { 227 session.sendReceiveBoolean(true); 228 } 229 long end = System.currentTimeMillis(); 230 getLog().info("JRMP sendReceiveBoolean: " + 231 ((end - start) / (double)n) + " ms/call"); 232 } 233 234 239 public void testIIOPSendReceiveBoolean() 240 throws Exception 241 { 242 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 243 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 244 SessionHome.class); 245 Session session = home.create(); 246 int n = getIterationCount(); 247 long start = System.currentTimeMillis(); 248 for (int i = 0 ; i < n; i++) 249 { 250 session.sendReceiveBoolean(true); 251 } 252 long end = System.currentTimeMillis(); 253 getLog().info("IIOP sendReceiveBoolean: " + 254 ((end - start) / (double)n) + " ms/call"); 255 } 256 257 262 public void testJRMPSendChar() 263 throws Exception 264 { 265 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 266 getInitialContext().lookup(SessionHome.JNDI_NAME), 267 SessionHome.class); 268 Session session = home.create(); 269 int n = getIterationCount(); 270 long start = System.currentTimeMillis(); 271 for (int i = 0 ; i < n; i++) 272 { 273 session.sendChar(Character.MAX_VALUE); 274 } 275 long end = System.currentTimeMillis(); 276 getLog().info("JRMP sendChar: " + 277 ((end - start) / (double)n) + " ms/call"); 278 } 279 280 285 public void testIIOPSendChar() 286 throws Exception 287 { 288 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 289 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 290 SessionHome.class); 291 Session session = home.create(); 292 int n = getIterationCount(); 293 long start = System.currentTimeMillis(); 294 for (int i = 0 ; i < n; i++) 295 { 296 session.sendChar(Character.MAX_VALUE); 297 } 298 long end = System.currentTimeMillis(); 299 getLog().info("IIOP sendChar: " + 300 ((end - start) / (double)n) + " ms/call"); 301 } 302 303 308 public void testJRMPReceiveChar() 309 throws Exception 310 { 311 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 312 getInitialContext().lookup(SessionHome.JNDI_NAME), 313 SessionHome.class); 314 Session session = home.create(); 315 int n = getIterationCount(); 316 long start = System.currentTimeMillis(); 317 for (int i = 0 ; i < n; i++) 318 { 319 session.receiveChar(); 320 } 321 long end = System.currentTimeMillis(); 322 getLog().info("JRMP receiveChar: " + 323 ((end - start) / (double)n) + " ms/call"); 324 } 325 326 331 public void testIIOPReceiveChar() 332 throws Exception 333 { 334 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 335 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 336 SessionHome.class); 337 Session session = home.create(); 338 int n = getIterationCount(); 339 long start = System.currentTimeMillis(); 340 for (int i = 0 ; i < n; i++) 341 { 342 session.receiveChar(); 343 } 344 long end = System.currentTimeMillis(); 345 getLog().info("IIOP receiveChar: " + 346 ((end - start) / (double)n) + " ms/call"); 347 } 348 349 354 public void testJRMPSendReceiveChar() 355 throws Exception 356 { 357 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 358 getInitialContext().lookup(SessionHome.JNDI_NAME), 359 SessionHome.class); 360 Session session = home.create(); 361 int n = getIterationCount(); 362 long start = System.currentTimeMillis(); 363 for (int i = 0 ; i < n; i++) 364 { 365 session.sendReceiveChar(Character.MAX_VALUE); 366 } 367 long end = System.currentTimeMillis(); 368 getLog().info("JRMP sendReceiveChar: " + 369 ((end - start) / (double)n) + " ms/call"); 370 } 371 372 377 public void testIIOPSendReceiveChar() 378 throws Exception 379 { 380 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 381 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 382 SessionHome.class); 383 Session session = home.create(); 384 int n = getIterationCount(); 385 long start = System.currentTimeMillis(); 386 for (int i = 0 ; i < n; i++) 387 { 388 session.sendReceiveChar(Character.MAX_VALUE); 389 } 390 long end = System.currentTimeMillis(); 391 getLog().info("IIOP sendReceiveChar: " + 392 ((end - start) / (double)n) + " ms/call"); 393 } 394 395 400 public void testJRMPSendByte() 401 throws Exception 402 { 403 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 404 getInitialContext().lookup(SessionHome.JNDI_NAME), 405 SessionHome.class); 406 Session session = home.create(); 407 int n = getIterationCount(); 408 long start = System.currentTimeMillis(); 409 for (int i = 0 ; i < n; i++) 410 { 411 session.sendByte(Byte.MAX_VALUE); 412 } 413 long end = System.currentTimeMillis(); 414 getLog().info("JRMP sendByte: " + 415 ((end - start) / (double)n) + " ms/call"); 416 } 417 418 423 public void testIIOPSendByte() 424 throws Exception 425 { 426 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 427 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 428 SessionHome.class); 429 Session session = home.create(); 430 int n = getIterationCount(); 431 long start = System.currentTimeMillis(); 432 for (int i = 0 ; i < n; i++) 433 { 434 session.sendByte(Byte.MAX_VALUE); 435 } 436 long end = System.currentTimeMillis(); 437 getLog().info("IIOP sendByte: " + 438 ((end - start) / (double)n) + " ms/call"); 439 } 440 441 446 public void testJRMPReceiveByte() 447 throws Exception 448 { 449 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 450 getInitialContext().lookup(SessionHome.JNDI_NAME), 451 SessionHome.class); 452 Session session = home.create(); 453 int n = getIterationCount(); 454 long start = System.currentTimeMillis(); 455 for (int i = 0 ; i < n; i++) 456 { 457 session.receiveByte(); 458 } 459 long end = System.currentTimeMillis(); 460 getLog().info("JRMP receiveByte: " + 461 ((end - start) / (double)n) + " ms/call"); 462 } 463 464 469 public void testIIOPReceiveByte() 470 throws Exception 471 { 472 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 473 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 474 SessionHome.class); 475 Session session = home.create(); 476 int n = getIterationCount(); 477 long start = System.currentTimeMillis(); 478 for (int i = 0 ; i < n; i++) 479 { 480 session.receiveByte(); 481 } 482 long end = System.currentTimeMillis(); 483 getLog().info("IIOP receiveByte: " + 484 ((end - start) / (double)n) + " ms/call"); 485 } 486 487 492 public void testJRMPSendReceiveByte() 493 throws Exception 494 { 495 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 496 getInitialContext().lookup(SessionHome.JNDI_NAME), 497 SessionHome.class); 498 Session session = home.create(); 499 int n = getIterationCount(); 500 long start = System.currentTimeMillis(); 501 for (int i = 0 ; i < n; i++) 502 { 503 session.sendReceiveByte(Byte.MAX_VALUE); 504 } 505 long end = System.currentTimeMillis(); 506 getLog().info("JRMP sendReceiveByte: " + 507 ((end - start) / (double)n) + " ms/call"); 508 } 509 510 515 public void testIIOPSendReceiveByte() 516 throws Exception 517 { 518 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 519 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 520 SessionHome.class); 521 Session session = home.create(); 522 int n = getIterationCount(); 523 long start = System.currentTimeMillis(); 524 for (int i = 0 ; i < n; i++) 525 { 526 session.sendReceiveByte(Byte.MAX_VALUE); 527 } 528 long end = System.currentTimeMillis(); 529 getLog().info("IIOP sendReceiveByte: " + 530 ((end - start) / (double)n) + " ms/call"); 531 } 532 533 538 public void testJRMPSendShort() 539 throws Exception 540 { 541 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 542 getInitialContext().lookup(SessionHome.JNDI_NAME), 543 SessionHome.class); 544 Session session = home.create(); 545 int n = getIterationCount(); 546 long start = System.currentTimeMillis(); 547 for (int i = 0 ; i < n; i++) 548 { 549 session.sendShort(Short.MAX_VALUE); 550 } 551 long end = System.currentTimeMillis(); 552 getLog().info("JRMP sendShort: " + 553 ((end - start) / (double)n) + " ms/call"); 554 } 555 556 561 public void testIIOPSendShort() 562 throws Exception 563 { 564 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 565 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 566 SessionHome.class); 567 Session session = home.create(); 568 int n = getIterationCount(); 569 long start = System.currentTimeMillis(); 570 for (int i = 0 ; i < n; i++) 571 { 572 session.sendShort(Short.MAX_VALUE); 573 } 574 long end = System.currentTimeMillis(); 575 getLog().info("IIOP sendShort: " + 576 ((end - start) / (double)n) + " ms/call"); 577 } 578 579 584 public void testJRMPReceiveShort() 585 throws Exception 586 { 587 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 588 getInitialContext().lookup(SessionHome.JNDI_NAME), 589 SessionHome.class); 590 Session session = home.create(); 591 int n = getIterationCount(); 592 long start = System.currentTimeMillis(); 593 for (int i = 0 ; i < n; i++) 594 { 595 session.receiveShort(); 596 } 597 long end = System.currentTimeMillis(); 598 getLog().info("JRMP receiveShort: " + 599 ((end - start) / (double)n) + " ms/call"); 600 } 601 602 607 public void testIIOPReceiveShort() 608 throws Exception 609 { 610 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 611 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 612 SessionHome.class); 613 Session session = home.create(); 614 int n = getIterationCount(); 615 long start = System.currentTimeMillis(); 616 for (int i = 0 ; i < n; i++) 617 { 618 session.receiveShort(); 619 } 620 long end = System.currentTimeMillis(); 621 getLog().info("IIOP receiveShort: " + 622 ((end - start) / (double)n) + " ms/call"); 623 } 624 625 630 public void testJRMPSendReceiveShort() 631 throws Exception 632 { 633 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 634 getInitialContext().lookup(SessionHome.JNDI_NAME), 635 SessionHome.class); 636 Session session = home.create(); 637 int n = getIterationCount(); 638 long start = System.currentTimeMillis(); 639 for (int i = 0 ; i < n; i++) 640 { 641 session.sendReceiveShort(Short.MAX_VALUE); 642 } 643 long end = System.currentTimeMillis(); 644 getLog().info("JRMP sendReceiveShort: " + 645 ((end - start) / (double)n) + " ms/call"); 646 } 647 648 653 public void testIIOPSendReceiveShort() 654 throws Exception 655 { 656 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 657 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 658 SessionHome.class); 659 Session session = home.create(); 660 int n = getIterationCount(); 661 long start = System.currentTimeMillis(); 662 for (int i = 0 ; i < n; i++) 663 { 664 session.sendReceiveShort(Short.MAX_VALUE); 665 } 666 long end = System.currentTimeMillis(); 667 getLog().info("IIOP sendReceiveShort: " + 668 ((end - start) / (double)n) + " ms/call"); 669 } 670 671 676 public void testJRMPSendInt() 677 throws Exception 678 { 679 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 680 getInitialContext().lookup(SessionHome.JNDI_NAME), 681 SessionHome.class); 682 Session session = home.create(); 683 int n = getIterationCount(); 684 long start = System.currentTimeMillis(); 685 for (int i = 0 ; i < n; i++) 686 { 687 session.sendInt(Integer.MAX_VALUE); 688 } 689 long end = System.currentTimeMillis(); 690 getLog().info("JRMP sendInt: " + 691 ((end - start) / (double)n) + " ms/call"); 692 } 693 694 699 public void testIIOPSendInt() 700 throws Exception 701 { 702 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 703 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 704 SessionHome.class); 705 Session session = home.create(); 706 int n = getIterationCount(); 707 long start = System.currentTimeMillis(); 708 for (int i = 0 ; i < n; i++) 709 { 710 session.sendInt(Integer.MAX_VALUE); 711 } 712 long end = System.currentTimeMillis(); 713 getLog().info("IIOP sendInt: " + 714 ((end - start) / (double)n) + " ms/call"); 715 } 716 717 722 public void testJRMPReceiveInt() 723 throws Exception 724 { 725 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 726 getInitialContext().lookup(SessionHome.JNDI_NAME), 727 SessionHome.class); 728 Session session = home.create(); 729 int n = getIterationCount(); 730 long start = System.currentTimeMillis(); 731 for (int i = 0 ; i < n; i++) 732 { 733 session.receiveInt(); 734 } 735 long end = System.currentTimeMillis(); 736 getLog().info("JRMP receiveInt: " + 737 ((end - start) / (double)n) + " ms/call"); 738 } 739 740 745 public void testIIOPReceiveInt() 746 throws Exception 747 { 748 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 749 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 750 SessionHome.class); 751 Session session = home.create(); 752 int n = getIterationCount(); 753 long start = System.currentTimeMillis(); 754 for (int i = 0 ; i < n; i++) 755 { 756 session.receiveInt(); 757 } 758 long end = System.currentTimeMillis(); 759 getLog().info("IIOP receiveInt: " + 760 ((end - start) / (double)n) + " ms/call"); 761 } 762 763 768 public void testJRMPSendReceiveInt() 769 throws Exception 770 { 771 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 772 getInitialContext().lookup(SessionHome.JNDI_NAME), 773 SessionHome.class); 774 Session session = home.create(); 775 int n = getIterationCount(); 776 long start = System.currentTimeMillis(); 777 for (int i = 0 ; i < n; i++) 778 { 779 session.sendReceiveInt(Integer.MAX_VALUE); 780 } 781 long end = System.currentTimeMillis(); 782 getLog().info("JRMP sendReceiveInt: " + 783 ((end - start) / (double)n) + " ms/call"); 784 } 785 786 791 public void testIIOPSendReceiveInt() 792 throws Exception 793 { 794 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 795 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 796 SessionHome.class); 797 Session session = home.create(); 798 int n = getIterationCount(); 799 long start = System.currentTimeMillis(); 800 for (int i = 0 ; i < n; i++) 801 { 802 session.sendReceiveInt(Integer.MAX_VALUE); 803 } 804 long end = System.currentTimeMillis(); 805 getLog().info("IIOP sendReceiveInt: " + 806 ((end - start) / (double)n) + " ms/call"); 807 } 808 809 814 public void testJRMPSendLong() 815 throws Exception 816 { 817 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 818 getInitialContext().lookup(SessionHome.JNDI_NAME), 819 SessionHome.class); 820 Session session = home.create(); 821 int n = getIterationCount(); 822 long start = System.currentTimeMillis(); 823 for (int i = 0 ; i < n; i++) 824 { 825 session.sendLong(Long.MAX_VALUE); 826 } 827 long end = System.currentTimeMillis(); 828 getLog().info("JRMP sendLong: " + 829 ((end - start) / (double)n) + " ms/call"); 830 } 831 832 837 public void testIIOPSendLong() 838 throws Exception 839 { 840 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 841 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 842 SessionHome.class); 843 Session session = home.create(); 844 int n = getIterationCount(); 845 long start = System.currentTimeMillis(); 846 for (int i = 0 ; i < n; i++) 847 { 848 session.sendLong(Long.MAX_VALUE); 849 } 850 long end = System.currentTimeMillis(); 851 getLog().info("IIOP sendLong: " + 852 ((end - start) / (double)n) + " ms/call"); 853 } 854 855 860 public void testJRMPReceiveLong() 861 throws Exception 862 { 863 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 864 getInitialContext().lookup(SessionHome.JNDI_NAME), 865 SessionHome.class); 866 Session session = home.create(); 867 int n = getIterationCount(); 868 long start = System.currentTimeMillis(); 869 for (int i = 0 ; i < n; i++) 870 { 871 session.receiveLong(); 872 } 873 long end = System.currentTimeMillis(); 874 getLog().info("JRMP receiveLong: " + 875 ((end - start) / (double)n) + " ms/call"); 876 } 877 878 883 public void testIIOPReceiveLong() 884 throws Exception 885 { 886 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 887 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 888 SessionHome.class); 889 Session session = home.create(); 890 int n = getIterationCount(); 891 long start = System.currentTimeMillis(); 892 for (int i = 0 ; i < n; i++) 893 { 894 session.receiveLong(); 895 } 896 long end = System.currentTimeMillis(); 897 getLog().info("IIOP receiveLong: " + 898 ((end - start) / (double)n) + " ms/call"); 899 } 900 901 906 public void testJRMPSendReceiveLong() 907 throws Exception 908 { 909 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 910 getInitialContext().lookup(SessionHome.JNDI_NAME), 911 SessionHome.class); 912 Session session = home.create(); 913 int n = getIterationCount(); 914 long start = System.currentTimeMillis(); 915 for (int i = 0 ; i < n; i++) 916 { 917 session.sendReceiveLong(Long.MAX_VALUE); 918 } 919 long end = System.currentTimeMillis(); 920 getLog().info("JRMP sendReceiveLong: " + 921 ((end - start) / (double)n) + " ms/call"); 922 } 923 924 929 public void testIIOPSendReceiveLong() 930 throws Exception 931 { 932 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 933 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 934 SessionHome.class); 935 Session session = home.create(); 936 int n = getIterationCount(); 937 long start = System.currentTimeMillis(); 938 for (int i = 0 ; i < n; i++) 939 { 940 session.sendReceiveLong(Long.MAX_VALUE); 941 } 942 long end = System.currentTimeMillis(); 943 getLog().info("IIOP sendReceiveLong: " + 944 ((end - start) / (double)n) + " ms/call"); 945 } 946 947 952 public void testJRMPSendFloat() 953 throws Exception 954 { 955 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 956 getInitialContext().lookup(SessionHome.JNDI_NAME), 957 SessionHome.class); 958 Session session = home.create(); 959 int n = getIterationCount(); 960 long start = System.currentTimeMillis(); 961 for (int i = 0 ; i < n; i++) 962 { 963 session.sendFloat(Float.MAX_VALUE); 964 } 965 long end = System.currentTimeMillis(); 966 getLog().info("JRMP sendFloat: " + 967 ((end - start) / (double)n) + " ms/call"); 968 } 969 970 975 public void testIIOPSendFloat() 976 throws Exception 977 { 978 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 979 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 980 SessionHome.class); 981 Session session = home.create(); 982 int n = getIterationCount(); 983 long start = System.currentTimeMillis(); 984 for (int i = 0 ; i < n; i++) 985 { 986 session.sendFloat(Float.MAX_VALUE); 987 } 988 long end = System.currentTimeMillis(); 989 getLog().info("IIOP sendFloat: " + 990 ((end - start) / (double)n) + " ms/call"); 991 } 992 993 998 public void testJRMPReceiveFloat() 999 throws Exception 1000 { 1001 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1002 getInitialContext().lookup(SessionHome.JNDI_NAME), 1003 SessionHome.class); 1004 Session session = home.create(); 1005 int n = getIterationCount(); 1006 long start = System.currentTimeMillis(); 1007 for (int i = 0 ; i < n; i++) 1008 { 1009 session.receiveFloat(); 1010 } 1011 long end = System.currentTimeMillis(); 1012 getLog().info("JRMP receiveFloat: " + 1013 ((end - start) / (double)n) + " ms/call"); 1014 } 1015 1016 1021 public void testIIOPReceiveFloat() 1022 throws Exception 1023 { 1024 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1025 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 1026 SessionHome.class); 1027 Session session = home.create(); 1028 int n = getIterationCount(); 1029 long start = System.currentTimeMillis(); 1030 for (int i = 0 ; i < n; i++) 1031 { 1032 session.receiveFloat(); 1033 } 1034 long end = System.currentTimeMillis(); 1035 getLog().info("IIOP receiveFloat: " + 1036 ((end - start) / (double)n) + " ms/call"); 1037 } 1038 1039 1044 public void testJRMPSendReceiveFloat() 1045 throws Exception 1046 { 1047 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1048 getInitialContext().lookup(SessionHome.JNDI_NAME), 1049 SessionHome.class); 1050 Session session = home.create(); 1051 int n = getIterationCount(); 1052 long start = System.currentTimeMillis(); 1053 for (int i = 0 ; i < n; i++) 1054 { 1055 session.sendReceiveFloat(Float.MAX_VALUE); 1056 } 1057 long end = System.currentTimeMillis(); 1058 getLog().info("JRMP sendReceiveFloat: " + 1059 ((end - start) / (double)n) + " ms/call"); 1060 } 1061 1062 1067 public void testIIOPSendReceiveFloat() 1068 throws Exception 1069 { 1070 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1071 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 1072 SessionHome.class); 1073 Session session = home.create(); 1074 int n = getIterationCount(); 1075 long start = System.currentTimeMillis(); 1076 for (int i = 0 ; i < n; i++) 1077 { 1078 session.sendReceiveFloat(Float.MAX_VALUE); 1079 } 1080 long end = System.currentTimeMillis(); 1081 getLog().info("IIOP sendReceiveFloat: " + 1082 ((end - start) / (double)n) + " ms/call"); 1083 } 1084 1085 1090 public void testJRMPSendDouble() 1091 throws Exception 1092 { 1093 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1094 getInitialContext().lookup(SessionHome.JNDI_NAME), 1095 SessionHome.class); 1096 Session session = home.create(); 1097 int n = getIterationCount(); 1098 long start = System.currentTimeMillis(); 1099 for (int i = 0 ; i < n; i++) 1100 { 1101 session.sendDouble(Double.MAX_VALUE); 1102 } 1103 long end = System.currentTimeMillis(); 1104 getLog().info("JRMP sendDouble: " + 1105 ((end - start) / (double)n) + " ms/call"); 1106 } 1107 1108 1113 public void testIIOPSendDouble() 1114 throws Exception 1115 { 1116 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1117 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 1118 SessionHome.class); 1119 Session session = home.create(); 1120 int n = getIterationCount(); 1121 long start = System.currentTimeMillis(); 1122 for (int i = 0 ; i < n; i++) 1123 { 1124 session.sendDouble(Double.MAX_VALUE); 1125 } 1126 long end = System.currentTimeMillis(); 1127 getLog().info("IIOP sendDouble: " + 1128 ((end - start) / (double)n) + " ms/call"); 1129 } 1130 1131 1136 public void testJRMPReceiveDouble() 1137 throws Exception 1138 { 1139 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1140 getInitialContext().lookup(SessionHome.JNDI_NAME), 1141 SessionHome.class); 1142 Session session = home.create(); 1143 int n = getIterationCount(); 1144 long start = System.currentTimeMillis(); 1145 for (int i = 0 ; i < n; i++) 1146 { 1147 session.receiveDouble(); 1148 } 1149 long end = System.currentTimeMillis(); 1150 getLog().info("JRMP receiveDouble: " + 1151 ((end - start) / (double)n) + " ms/call"); 1152 } 1153 1154 1159 public void testIIOPReceiveDouble() 1160 throws Exception 1161 { 1162 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1163 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 1164 SessionHome.class); 1165 Session session = home.create(); 1166 int n = getIterationCount(); 1167 long start = System.currentTimeMillis(); 1168 for (int i = 0 ; i < n; i++) 1169 { 1170 session.receiveDouble(); 1171 } 1172 long end = System.currentTimeMillis(); 1173 getLog().info("IIOP receiveDouble: " + 1174 ((end - start) / (double)n) + " ms/call"); 1175 } 1176 1177 1182 public void testJRMPSendReceiveDouble() 1183 throws Exception 1184 { 1185 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1186 getInitialContext().lookup(SessionHome.JNDI_NAME), 1187 SessionHome.class); 1188 Session session = home.create(); 1189 int n = getIterationCount(); 1190 long start = System.currentTimeMillis(); 1191 for (int i = 0 ; i < n; i++) 1192 { 1193 session.sendReceiveDouble(Double.MAX_VALUE); 1194 } 1195 long end = System.currentTimeMillis(); 1196 getLog().info("JRMP sendReceiveDouble: " + 1197 ((end - start) / (double)n) + " ms/call"); 1198 } 1199 1200 1205 public void testIIOPSendReceiveDouble() 1206 throws Exception 1207 { 1208 SessionHome home = (SessionHome)PortableRemoteObject.narrow( 1209 getInitialContext(cosnamingJndiProps).lookup(SessionHome.JNDI_NAME), 1210 SessionHome.class); 1211 Session session = home.create(); 1212 int n = getIterationCount(); 1213 long start = System.currentTimeMillis(); 1214 for (int i = 0 ; i < n; i++) 1215 { 1216 session.sendReceiveDouble(Double.MAX_VALUE); 1217 } 1218 long end = System.currentTimeMillis(); 1219 getLog().info("IIOP sendReceiveDouble: " + 1220 ((end - start) / (double)n) + " ms/call"); 1221 } 1222 1223 public static Test suite() throws Exception 1224 { 1225 return getDeploySetup(T0PassBasicTypesTestCase.class, "iiopperf.jar"); 1226 } 1227 1228} 1229 | Popular Tags |