<commit_before>package com.emc.ecs.managementClient;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.emc.ecs.common.EcsActionTest;
import com.emc.ecs.serviceBroker.EcsManagementClientException;
import com.emc.ecs.serviceBroker.EcsManagementResourceNotFoundException;

public class BucketActionTest extends EcsActionTest {
	private String bucket = "testbucket2";

	@Before
	public void setUp() throws EcsManagementClientException {
		connection.login();
	}
	
	@After
	public void cleanup() throws EcsManagementClientException {
		connection.logout();
	}

	@Test
	public void testBucketDoesNotExist() throws EcsManagementClientException {
		assertFalse(BucketAction.exists(connection, bucket, namespace));
	}
	
	@Test
	public void createExistsAndDeleteBucket() throws EcsManagementClientException, EcsManagementResourceNotFoundException {
		BucketAction.create(connection, bucket, namespace, replicationGroup);
		assertTrue(BucketAction.exists(connection, bucket, namespace));
		BucketAction.delete(connection, bucket, namespace);
		assertFalse(BucketAction.exists(connection, bucket, namespace));
	}
	
	@Test
	public void testGetBucket() throws EcsManagementClientException, EcsManagementResourceNotFoundException {
		BucketAction.create(connection, bucket, namespace, replicationGroup);
		assertTrue(BucketAction.get(connection, bucket, namespace).getName().equals(bucket));
		BucketAction.delete(connection, bucket, namespace);
	}

}<commit_msg>Should test for existence prior to creating<commit_after>package com.emc.ecs.managementClient;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.emc.ecs.common.EcsActionTest;
import com.emc.ecs.serviceBroker.EcsManagementClientException;
import com.emc.ecs.serviceBroker.EcsManagementResourceNotFoundException;

public class BucketActionTest extends EcsActionTest {
	private String bucket = "testbucket2";

	@Before
	public void setUp() throws EcsManagementClientException {
		connection.login();
	}
	
	@After
	public void cleanup() throws EcsManagementClientException {
		connection.logout();
	}

	@Test
	public void testBucketDoesNotExist() throws EcsManagementClientException {
		assertFalse(BucketAction.exists(connection, bucket, namespace));
	}
	
	@Test
	public void createExistsAndDeleteBucket() throws EcsManagementClientException, EcsManagementResourceNotFoundException {
		assertFalse(BucketAction.exists(connection, bucket, namespace));
		BucketAction.create(connection, bucket, namespace, replicationGroup);
		assertTrue(BucketAction.exists(connection, bucket, namespace));
		BucketAction.delete(connection, bucket, namespace);
		assertFalse(BucketAction.exists(connection, bucket, namespace));
	}
	
	@Test
	public void testGetBucket() throws EcsManagementClientException, EcsManagementResourceNotFoundException {
		BucketAction.create(connection, bucket, namespace, replicationGroup);
		assertTrue(BucketAction.get(connection, bucket, namespace).getName().equals(bucket));
		BucketAction.delete(connection, bucket, namespace);
	}

}
{'fraction_non_alphanumeric': 0.09138623031799938, 'fraction_numerical': 0.0006174745291756715, 'mean_word_length': 7.286445012787723, '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': '5325128', 'n_tokens_mistral': 906, 'n_tokens_neox': 869, 'n_words': 187}