1/*
2 *  Licensed to the Apache Software Foundation (ASF) under one or more
3 *  contributor license agreements.  See the NOTICE file distributed with
4 *  this work for additional information regarding copyright ownership.
5 *  The ASF licenses this file to You under the Apache License, Version 2.0
6 *  (the "License"); you may not use this file except in compliance with
7 *  the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 */
17
18package org.apache.harmony.tests.java.nio.channels;
19
20import java.io.IOException;
21import java.net.DatagramSocket;
22import java.net.InetAddress;
23import java.net.NetworkInterface;
24import java.net.SocketAddress;
25import java.net.SocketOption;
26import java.nio.ByteBuffer;
27import java.nio.channels.DatagramChannel;
28import java.nio.channels.MembershipKey;
29import java.nio.channels.ServerSocketChannel;
30import java.nio.channels.spi.SelectorProvider;
31import java.util.Set;
32
33class MockDatagramChannel extends DatagramChannel {
34
35    public MockDatagramChannel(SelectorProvider arg0) {
36        super(arg0);
37    }
38
39    @Override
40    public DatagramSocket socket() {
41        return null;
42    }
43
44    @Override
45    public boolean isConnected() {
46        return false;
47    }
48
49    @Override
50    public DatagramChannel connect(SocketAddress arg0) throws IOException {
51        return null;
52    }
53
54    @Override
55    public DatagramChannel disconnect() throws IOException {
56        return null;
57    }
58
59    @Override
60    public SocketAddress receive(ByteBuffer arg0) throws IOException {
61        return null;
62    }
63
64    @Override
65    public int send(ByteBuffer arg0, SocketAddress arg1) throws IOException {
66        return 0;
67    }
68
69    @Override
70    public int read(ByteBuffer arg0) throws IOException {
71        return 0;
72    }
73
74    @Override
75    public long read(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
76        return 0;
77    }
78
79    @Override
80    public int write(ByteBuffer arg0) throws IOException {
81        return 0;
82    }
83
84    @Override
85    public long write(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
86        return 0;
87    }
88
89    @Override
90    protected void implCloseSelectableChannel() throws IOException {
91        // empty
92    }
93
94    @Override
95    protected void implConfigureBlocking(boolean arg0) throws IOException {
96        // empty
97    }
98
99    @Override
100    public SocketAddress getRemoteAddress() throws IOException {
101        return null;
102    }
103
104    @Override
105    public <T> DatagramChannel setOption(SocketOption<T> name, T value)
106        throws IOException {
107        return null;
108    }
109
110    @Override
111    public <T> T getOption(SocketOption<T> name) throws IOException {
112        return null;
113    }
114
115    public DatagramChannel bind(SocketAddress local) throws IOException {
116        return null;
117    }
118
119    @Override
120    public MembershipKey join(InetAddress group, NetworkInterface interf) {
121        return null;
122    }
123
124    @Override
125    public MembershipKey join(InetAddress group, NetworkInterface interf, InetAddress source)
126            throws IOException {
127        return null;
128    }
129
130    @Override
131    public Set<SocketOption<?>> supportedOptions() {
132        return null;
133    }
134
135    @Override
136    public SocketAddress getLocalAddress() throws IOException {
137        return null;
138    }
139}
140