<commit_before>package net.zephyrizing.http_server_test;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.SocketAddress;

import net.zephyrizing.http_server.HttpServerSocket;
import net.zephyrizing.http_server.HttpServerSocketImpl;

import org.junit.Test;

import static org.junit.Assert.*;

public class HttpServerSocketImplTest {

    public class TestServerSocket extends ServerSocket {
        public TestServerSocket() throws IOException {
            super();
        }

        int port;

        @Override
        public void bind(SocketAddress sockAddr) {
            InetSocketAddress iSockAddr = (InetSocketAddress)sockAddr;
            port = iSockAddr.getPort();
        }

        public int bindCalledWith() {
            return port;
        }
    }

    @Test
    public void testBindSocket() throws Exception {
        TestServerSocket testServerSocket = new TestServerSocket();
        HttpServerSocket socket = new HttpServerSocketImpl(testServerSocket);
        int port = 1000;
        socket.bind(port);
        assertEquals(port, testServerSocket.bindCalledWith());
    }
}
<commit_msg>Add a test to motivate the development of the HttpServerSocketImpl<commit_after>package net.zephyrizing.http_server_test;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.SocketAddress;

import net.zephyrizing.http_server.HttpRequest;
import net.zephyrizing.http_server.HttpServerSocket;
import net.zephyrizing.http_server.HttpServerSocketImpl;

import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.*;

public class HttpServerSocketImplTest {

    public class TestServerSocket extends ServerSocket {
        public TestServerSocket() throws IOException {
            super();
        }

        int port;

        @Override
        public void bind(SocketAddress sockAddr) {
            InetSocketAddress iSockAddr = (InetSocketAddress)sockAddr;
            port = iSockAddr.getPort();
        }

        public int bindCalledWith() {
            return port;
        }
    }

    @Test
    public void testBindSocket() throws Exception {
        TestServerSocket testServerSocket = new TestServerSocket();
        HttpServerSocket socket = new HttpServerSocketImpl(testServerSocket);
        int port = 10000;
        socket.bind(port);
        assertEquals(port, testServerSocket.bindCalledWith());
    }

    @Ignore
    @Test
    public void testSocketAccept() throws Exception {
        TestServerSocket testServerSocket = new TestServerSocket();
        HttpServerSocket socket = new HttpServerSocketImpl(testServerSocket);
        socket.bind(10000);
        HttpRequest request = socket.accept();
        assertNotNull(request);
    }
}

{'fraction_non_alphanumeric': 0.0766488413547237, 'fraction_numerical': 0.004991087344028521, 'mean_word_length': 3.084425036390102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1115987', 'n_tokens_mistral': 767, 'n_tokens_neox': 734, 'n_words': 171}