<commit_before>/*
 * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
//
// Created by <NAME> on 9/13/13.

#include "hazelcast/client/exception/ProtocolExceptions.h"
#include "hazelcast/client/HazelcastClient.h"
#include "hazelcast/client/ClientConfig.h"

#include "serialization/Employee.h"
#include "ClientTestSupport.h"
#include "HazelcastServer.h"
#include "hazelcast/client/Ringbuffer.h"
#include "HazelcastServerFactory.h"

namespace hazelcast {
    namespace client {
        namespace test {
            class RingbufferTest : public ClientTestSupport {
            protected:
                virtual void TearDown() {
                }

                static void SetUpTestCase() {
                    instance = new HazelcastServer(*g_srvFactory);
                    clientConfig = new ClientConfig();
                    clientConfig->addAddress(Address(g_srvFactory->getServerAddress(), 5701));
                    client = new HazelcastClient(*clientConfig);
                    rb = client->getRingbuffer<Employee>("rb-1").release();
                }

                static void TearDownTestCase() {
                    delete rb;
                    delete client;
                    delete clientConfig;
                    delete instance;

                    rb = NULL;
                    client = NULL;
                    clientConfig = NULL;
                    instance = NULL;
                }

                static HazelcastServer *instance;
                static ClientConfig *clientConfig;
                static HazelcastClient *client;
                static Ringbuffer<Employee> *rb;

                static const int64_t CAPACITY = 10;
            };

            HazelcastServer *RingbufferTest::instance = NULL;
            ClientConfig *RingbufferTest::clientConfig = NULL;
            HazelcastClient *RingbufferTest::client = NULL;
            Ringbuffer<Employee> *RingbufferTest::rb = NULL;

            TEST_F(RingbufferTest, testAPI) {
                ASSERT_EQ(CAPACITY, rb->capacity());
                ASSERT_EQ(0, rb->headSequence());<commit_msg>Corrected the static variable initialization. Also fixed the include paths for the ringbuffer test. (#141)<commit_after>/*
 * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
//
// Created by <NAME> on 9/13/13.

#include "hazelcast/client/exception/ProtocolExceptions.h"
#include "hazelcast/client/HazelcastClient.h"

#include "../HazelcastServerFactory.h"
#include "../ClientTestSupport.h"
#include "../HazelcastServer.h"
#include "../serialization/Employee.h"

namespace hazelcast {
    namespace client {
        namespace test {
            class RingbufferTest : public ClientTestSupport {
            protected:
                virtual void TearDown() {
                }

                static void SetUpTestCase() {
                    instance = new HazelcastServer(*g_srvFactory);
                    clientConfig = new ClientConfig();
                    clientConfig->addAddress(Address(g_srvFactory->getServerAddress(), 5701));
                    client = new HazelcastClient(*clientConfig);
                    rb = client->getRingbuffer<Employee>("rb-1").release();
                }

                static void TearDownTestCase() {
                    delete rb;
                    delete client;
                    delete clientConfig;
                    delete instance;

                    rb = NULL;
                    client = NULL;
                    clientConfig = NULL;
                    instance = NULL;
                }

                static HazelcastServer *instance;
                static ClientConfig *clientConfig;
                static HazelcastClient *client;
                static Ringbuffer<Employee> *rb;

                static const int64_t CAPACITY;
            };

            const int64_t RingbufferTest::CAPACITY = 10;

            HazelcastServer *RingbufferTest::instance = NULL;
            ClientConfig *RingbufferTest::clientConfig = NULL;
            HazelcastClient *RingbufferTest::client = NULL;
            Ringbuffer<Employee> *RingbufferTest::rb = NULL;

            TEST_F(RingbufferTest, testAPI) {
                ASSERT_EQ(CAPACITY, rb->capacity());
                ASSERT_EQ(0, rb->headSequence());
{'fraction_non_alphanumeric': 0.08567208271787297, 'fraction_numerical': 0.010893648449039882, 'mean_word_length': 2.011117287381879, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5904228', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1304, 'n_words': 396}