Search in sources :

Example 1 with Before

use of org.junit.Before in project jetty.project by eclipse.

the class GZIPContentDecoderTest method beforeClass.

@Before
public void beforeClass() throws Exception {
    buffers.set(0);
    pool = new ArrayByteBufferPool() {

        @Override
        public ByteBuffer acquire(int size, boolean direct) {
            buffers.incrementAndGet();
            return super.acquire(size, direct);
        }

        @Override
        public void release(ByteBuffer buffer) {
            buffers.decrementAndGet();
            super.release(buffer);
        }
    };
}
Also used : ArrayByteBufferPool(org.eclipse.jetty.io.ArrayByteBufferPool) ByteBuffer(java.nio.ByteBuffer) Before(org.junit.Before)

Example 2 with Before

use of org.junit.Before in project jetty.project by eclipse.

the class SelectChannelEndPointTest method startManager.

@Before
public void startManager() throws Exception {
    _writeCount = 1;
    _lastEndPoint = null;
    _lastEndPointLatch = new CountDownLatch(1);
    _connector = ServerSocketChannel.open();
    _connector.socket().bind(null);
    _scheduler.start();
    _threadPool.start();
    _manager.start();
}
Also used : CountDownLatch(java.util.concurrent.CountDownLatch) Before(org.junit.Before)

Example 3 with Before

use of org.junit.Before in project jetty.project by eclipse.

the class IdleTimeoutTest method setUp.

@Before
public void setUp() throws Exception {
    _open = true;
    _expired = null;
    _timer = new TimerScheduler();
    _timer.start();
    _timeout = new IdleTimeout(_timer) {

        @Override
        protected void onIdleExpired(TimeoutException timeout) {
            _expired = timeout;
        }

        @Override
        public boolean isOpen() {
            return _open;
        }
    };
    _timeout.setIdleTimeout(1000);
}
Also used : TimerScheduler(org.eclipse.jetty.util.thread.TimerScheduler) TimeoutException(java.util.concurrent.TimeoutException) Before(org.junit.Before)

Example 4 with Before

use of org.junit.Before in project jetty.project by eclipse.

the class BalancerServletTest method prepare.

@Before
public void prepare() throws Exception {
    client = new HttpClient();
    client.start();
}
Also used : HttpClient(org.eclipse.jetty.client.HttpClient) Before(org.junit.Before)

Example 5 with Before

use of org.junit.Before in project jetty.project by eclipse.

the class ConnectHandlerTest method prepare.

@Before
public void prepare() throws Exception {
    server = new Server();
    serverConnector = new ServerConnector(server);
    server.addConnector(serverConnector);
    server.setHandler(new ServerHandler());
    server.start();
    prepareProxy();
}
Also used : ServerConnector(org.eclipse.jetty.server.ServerConnector) Server(org.eclipse.jetty.server.Server) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)25427 File (java.io.File)1801 ArrayList (java.util.ArrayList)864 Properties (java.util.Properties)749 HashMap (java.util.HashMap)709 TreeMap (java.util.TreeMap)521 Configuration (org.apache.hadoop.conf.Configuration)438 IOException (java.io.IOException)420 InputStream (java.io.InputStream)320 List (java.util.List)304 URL (java.net.URL)295 Test (org.junit.Test)286 Date (java.util.Date)274 InvocationOnMock (org.mockito.invocation.InvocationOnMock)272 HashSet (java.util.HashSet)248 Config (com.hazelcast.config.Config)239 Context (android.content.Context)237 ByteArrayOutputStream (java.io.ByteArrayOutputStream)229 Path (java.nio.file.Path)212 URI (java.net.URI)210