<commit_before>import java.util.List;
import java.util.Map;

import models.Comment;
import models.Post;
import models.Tag;
import models.User;

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

import play.test.Fixtures;
import play.test.MorphiaFixtures;
import play.test.UnitTest;
 
public class BasicTest extends UnitTest {
    
    @Before
    public void setup() {
        MorphiaFixtures.deleteAllModels();
    }
 
    @Test
    public void createAndRetrieveUser() {
        // Create a new user and save it
        new User("<EMAIL>", "secret", "Bob").save();

        // Retrieve the user with bob username
        User bob = User.find("byEmail", "<EMAIL>").first();

        // Test 
        assertNotNull(bob);
        assertEquals("Bob", bob.fullname);
    }
    
    @Test
    public void tryConnectAsUser() {
        // Create a new user and save it
        new User("<EMAIL>", "secret", "Bob").save();

        // Test 
        assertNotNull(User.connect("<EMAIL>", "secret"));
        assertNull(User.connect("<EMAIL>", "badpassword"));
        assertNull(User.connect("<EMAIL>", "secret"));<commit_msg>Add unit test case to verify bug #46<commit_after>import java.util.List;
import java.util.Map;

import models.Comment;
import models.Post;
import models.Tag;
import models.User;

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

import play.modules.morphia.MorphiaPlugin;
import play.modules.morphia.MorphiaPlugin.IdType;
import play.test.Fixtures;
import play.test.MorphiaFixtures;
import play.test.UnitTest;
 
public class BasicTest extends UnitTest {
    
    @Before
    public void setup() {
        MorphiaFixtures.deleteAllModels();
    }
    
    @Test
    public void testBug46() {
        assertEquals(IdType.Long, MorphiaPlugin.getIdType());
    }
 
    @Test
    public void createAndRetrieveUser() {
        // Create a new user and save it
        new User("<EMAIL>", "secret", "Bob").save();

        // Retrieve the user with bob username
        User bob = User.find("byEmail", "<EMAIL>").first();

        // Test 
        assertNotNull(bob);
        assertEquals("Bob", bob.fullname);
    }
    
    @Test
    public void tryConnectAsUser() {
        // Create a new user and save it
        new User("<EMAIL>", "secret", "Bob").save();

        // Test 
        assertNotNull(User.connect("<EMAIL>", "secret"));
        assertNull(User.connect("<EMAIL>", "badpassword"));
        assertNull(User.connect("<EMAIL>", "secret"));
{'fraction_non_alphanumeric': 0.13693620479479887, 'fraction_numerical': 0.0016253555465258025, 'mean_word_length': 2.799382716049383, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6529314', 'n_tokens_mistral': 746, 'n_tokens_neox': 718, 'n_words': 182}