@@ -0,0 +1,2348 @@
+/**%0A * Copyright (c) 2002-2012 %22Neo Technology,%22%0A * Network Engine for Objects in Lund AB %5Bhttp://neotechnology.com%5D%0A *%0A * This file is part of Neo4j.%0A *%0A * Neo4j is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU General Public License for more details.%0A *%0A * You should have received a copy of the GNU General Public License%0A * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0Apackage org.neo4j.server;%0A%0Aimport com.sun.jersey.api.client.ClientResponse;%0Aimport org.junit.After;%0Aimport org.junit.Test;%0Aimport org.neo4j.server.statistic.StatisticRecord;%0Aimport org.neo4j.test.server.ExclusiveServerTestBase;%0A%0Aimport static com.sun.jersey.api.client.Client.create;%0Aimport static org.hamcrest.Matchers.greaterThan;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.neo4j.server.configuration.Configurator.WEBSERVER_ENABLE_STATISTICS_COLLECTION;%0Aimport static org.neo4j.server.helpers.ServerBuilder.server;%0A%0Apublic class StatisticsCollectionEnabledTest extends ExclusiveServerTestBase%0A%7B%0A%0A    private CommunityNeoServer server;%0A%0A    @After%0A    public void stopTheServer()%0A    %7B%0A        server.stop();%0A    %7D%0A%0A    @Test%0A    public void statisticsShouldBeDisabledByDefault() throws Exception%0A    %7B%0A        server = server().build();%0A        server.start();%0A%0A        create().resource(server.baseUri()).get(ClientResponse.class);%0A%0A        StatisticRecord snapshot = server.statisticsCollector.createSnapshot();%0A        assertThat(snapshot.getRequests(), is(0L));%0A    %7D%0A%0A    @Test%0A    public void statisticsCouldBeEnabled() throws Exception%0A    %7B%0A        server = server().withProperty(WEBSERVER_ENABLE_STATISTICS_COLLECTION, %22true%22).build();%0A        server.start();%0A%0A        create().resource(server.baseUri()).get(ClientResponse.class);%0A%0A        StatisticRecord snapshot = server.statisticsCollector.createSnapshot();%0A        assertThat(snapshot.getRequests(), greaterThan(0L));%0A    %7D%0A%7D%0A

add tests