<commit_before>/*
 * Cacheonix systems licenses this file to You under the LGPL 2.1
 * (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.cacheonix.org/products/cacheonix/license-lgpl-2.1.htm
 *
 * 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.
 */
package org.cacheonix.impl.cache.distributed.partitioned;

import java.util.ArrayList;
import java.util.List;

import org.cacheonix.CacheonixTestCase;
import org.cacheonix.TestUtils;
import org.cacheonix.impl.net.ClusterNodeAddress;
import org.cacheonix.impl.util.logging.Logger;

/**
 * ChangeBucketOwnershipMessageTest
 * <p/>
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @noinspection ConstantNamingConvention
 * @since Aug 14, 2009 3:10:23 PM
 */
public final class FinishBucketTransferMessageTest extends CacheonixTestCase {

   /**
    * Logger.
    *
    * @noinspection UNUSED_SYMBOL, UnusedDeclaration
    */
   private static final Logger LOG = Logger.getLogger(FinishBucketTransferMessageTest.class); // NOPMD

   private static final ClusterNodeAddress ADDR_1 = TestUtils.createTestAddress(1);

   private static final ClusterNodeAddress ADDR_2 = TestUtils.createTestAddress(2);

   private static final ClusterNodeAddress ADDR_3 = TestUtils.createTestAddress(3);

   private static final String CACHE_NAME = "my.cache";

   private static final int BUCKET_NUMBER = 1;

   private static final byte SOURCE_STORAGE_NUMBER = 2;

   private static final byte DESTINATION_STORAGE_NUMBER = 2;

   private FinishBucketTransferMessage message;


   public void testSetGetBucketNumber() {

      final List bucketNumbers = new ArrayList(11);
      bucketNumbers.add(Integer.valueOf(BUCKET_NUMBER));
      message.setBucketNumbers(bucketNumbers);
      assertEquals(bucketNumbers, message.getBucketNumbers());
   }


   public void testSetGetNewOwner() {

      final ClusterNodeAddress newOwner = ADDR_1;
      message.setNewOwner(newOwner);
      assertEquals(newOwner, message.getNewOwner());
   }
<commit_msg>Code quality: fixed error 'Unchecked call to 'add(E)' as a member of raw type 'java.util.List''<commit_after>/*
 * Cacheonix systems licenses this file to You under the LGPL 2.1
 * (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.cacheonix.org/products/cacheonix/license-lgpl-2.1.htm
 *
 * 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.
 */
package org.cacheonix.impl.cache.distributed.partitioned;

import java.util.ArrayList;
import java.util.List;

import org.cacheonix.CacheonixTestCase;
import org.cacheonix.TestUtils;
import org.cacheonix.impl.net.ClusterNodeAddress;
import org.cacheonix.impl.util.logging.Logger;

/**
 * ChangeBucketOwnershipMessageTest
 * <p/>
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @noinspection ConstantNamingConvention
 * @since Aug 14, 2009 3:10:23 PM
 */
public final class FinishBucketTransferMessageTest extends CacheonixTestCase {

   /**
    * Logger.
    *
    * @noinspection UNUSED_SYMBOL, UnusedDeclaration
    */
   private static final Logger LOG = Logger.getLogger(FinishBucketTransferMessageTest.class); // NOPMD

   private static final ClusterNodeAddress ADDR_1 = TestUtils.createTestAddress(1);

   private static final ClusterNodeAddress ADDR_2 = TestUtils.createTestAddress(2);

   private static final ClusterNodeAddress ADDR_3 = TestUtils.createTestAddress(3);

   private static final String CACHE_NAME = "my.cache";

   private static final int BUCKET_NUMBER = 1;

   private static final byte SOURCE_STORAGE_NUMBER = 2;

   private static final byte DESTINATION_STORAGE_NUMBER = 2;

   private FinishBucketTransferMessage message;


   public void testSetGetBucketNumber() {

      final List<Integer> bucketNumbers = new ArrayList<Integer>(11);
      bucketNumbers.add(Integer.valueOf(BUCKET_NUMBER));
      message.setBucketNumbers(bucketNumbers);
      assertEquals(bucketNumbers, message.getBucketNumbers());
   }


   public void testSetGetNewOwner() {

      final ClusterNodeAddress newOwner = ADDR_1;
      message.setNewOwner(newOwner);
      assertEquals(newOwner, message.getNewOwner());
   }

{'fraction_non_alphanumeric': 0.08511083228774571, 'fraction_numerical': 0.011292346298619825, 'mean_word_length': 4.356103023516237, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2658916', 'n_tokens_mistral': 1407, 'n_tokens_neox': 1324, 'n_words': 402}