Source Code Cross Referenced for SocketImplTest.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » luni » tests » java » net » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » org package » org.apache.harmony.luni.tests.java.net 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:
018:        package org.apache.harmony.luni.tests.java.net;
019:
020:        import java.io.FileDescriptor;
021:        import java.io.IOException;
022:        import java.io.InputStream;
023:        import java.io.OutputStream;
024:        import java.net.InetAddress;
025:        import java.net.SocketAddress;
026:        import java.net.SocketException;
027:        import java.net.SocketImpl;
028:
029:        public class SocketImplTest extends junit.framework.TestCase {
030:
031:            /**
032:             * @tests java.net.SocketImpl#SocketImpl()
033:             */
034:            public void test_Constructor_fd() {
035:                // Regression test for HARMONY-1117
036:                MockSocketImpl mockSocketImpl = new MockSocketImpl();
037:                assertNull(mockSocketImpl.getFileDescriptor());
038:            }
039:
040:            /**
041:             * @tests java.net.SocketImpl#setPerformancePreference()
042:             */
043:            public void test_setPerformancePreference_Int_Int_Int() {
044:                MockSocketImpl theSocket = new MockSocketImpl();
045:                theSocket.setPerformancePreference(1, 1, 1);
046:            }
047:
048:            /**
049:             * @tests java.net.SocketImpl#shutdownOutput()
050:             */
051:            public void test_shutdownOutput() {
052:                MockSocketImpl s = new MockSocketImpl();
053:                try {
054:                    s.shutdownOutput();
055:                    fail("This method is still not implemented yet,It should throw IOException.");
056:                } catch (IOException e) {
057:                    // expected
058:                }
059:            }
060:
061:            /**
062:             * @tests java.net.SocketImpl#shutdownOutput()
063:             */
064:            public void test_supportsUrgentData() {
065:                MockSocketImpl s = new MockSocketImpl();
066:                assertFalse(s.testSupportsUrgentData());
067:            }
068:
069:            // the mock class for test, leave all methods empty
070:            class MockSocketImpl extends SocketImpl {
071:
072:                protected void accept(SocketImpl newSocket) throws IOException {
073:                }
074:
075:                protected int available() throws IOException {
076:                    return 0;
077:                }
078:
079:                protected void bind(InetAddress address, int port)
080:                        throws IOException {
081:                }
082:
083:                protected void close() throws IOException {
084:                }
085:
086:                protected void connect(String host, int port)
087:                        throws IOException {
088:                }
089:
090:                protected void connect(InetAddress address, int port)
091:                        throws IOException {
092:                }
093:
094:                protected void create(boolean isStreaming) throws IOException {
095:                }
096:
097:                protected InputStream getInputStream() throws IOException {
098:                    return null;
099:                }
100:
101:                public Object getOption(int optID) throws SocketException {
102:                    return null;
103:                }
104:
105:                protected OutputStream getOutputStream() throws IOException {
106:                    return null;
107:                }
108:
109:                protected void listen(int backlog) throws IOException {
110:                }
111:
112:                public void setOption(int optID, Object val)
113:                        throws SocketException {
114:                }
115:
116:                protected void connect(SocketAddress remoteAddr, int timeout)
117:                        throws IOException {
118:                }
119:
120:                protected void sendUrgentData(int value) throws IOException {
121:                }
122:
123:                public void setPerformancePreference(int connectionTime,
124:                        int latency, int bandwidth) {
125:                    super .setPerformancePreferences(connectionTime, latency,
126:                            bandwidth);
127:                }
128:
129:                public FileDescriptor getFileDescriptor() {
130:                    return super .getFileDescriptor();
131:                }
132:
133:                public void shutdownOutput() throws IOException {
134:                    super .shutdownOutput();
135:                }
136:
137:                public boolean testSupportsUrgentData() {
138:                    return super.supportsUrgentData();
139:                }
140:
141:            }
142:        }
w___w__w__._j__a__v__a___2__s_.c__o__m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.