<commit_before>package org.inject;

import org.inject.Injector;

import junit.framework.TestCase;

public class TestInjector extends TestCase
{
	public void testDirectClassMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		builder.addClassMapping(String.class, String.class);
		Injector i = builder.build();
		assertTrue(i.createObject(String.class) instanceof String);
	}
	
	public void testNoExistantMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		Injector i = builder.build();
		try
		{
			i.createObject(String.class);
			fail();
		}
		catch(RuntimeException e)
		{}
	}
	
	public void testSubClassClassMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		builder.addClassMapping(Exception.class, RuntimeException.class);
		Injector i = builder.build();
		assertTrue(i.createObject(Exception.class) instanceof RuntimeException);
	}
	
	public void testSingletonClassMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		builder.addSingletonMapping(Exception.class, RuntimeException.class);
		Injector i = builder.build();
		Object o = i.createObject(Exception.class);
		assertTrue(o instanceof RuntimeException);
		Object o2 = i.createObject(Exception.class);
		assertTrue(o == o2);
	}
	
	public void testObjectClassMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		RuntimeException ex = new RuntimeException();
		builder.addObjectMapping(Exception.class, ex);
		Injector i = builder.build();
		Object o = i.createObject(Exception.class);
		assertTrue(o instanceof RuntimeException);
		assertTrue(o == ex);
	}

}
<commit_msg>added todos for more test cases to implement<commit_after>package org.inject;

import org.inject.Injector;

import junit.framework.TestCase;

public class TestInjector extends TestCase
{
	public void testDirectClassMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		builder.addClassMapping(String.class, String.class);
		Injector i = builder.build();
		assertTrue(i.createObject(String.class) instanceof String);
	}
	
	public void testNoExistantMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		Injector i = builder.build();
		try
		{
			i.createObject(String.class);
			fail();
		}
		catch(RuntimeException e)
		{}
	}
	
	public void testSubClassClassMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		builder.addClassMapping(Exception.class, RuntimeException.class);
		Injector i = builder.build();
		assertTrue(i.createObject(Exception.class) instanceof RuntimeException);
	}
	
	public void testSingletonClassMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		builder.addSingletonMapping(Exception.class, RuntimeException.class);
		Injector i = builder.build();
		Object o = i.createObject(Exception.class);
		assertTrue(o instanceof RuntimeException);
		Object o2 = i.createObject(Exception.class);
		assertTrue(o == o2);
	}
	
	public void testObjectClassMapping() throws Exception
	{
		Injector.Builder builder = new Injector.Builder();
		
		RuntimeException ex = new RuntimeException();
		builder.addObjectMapping(Exception.class, ex);
		Injector i = builder.build();
		Object o = i.createObject(Exception.class);
		assertTrue(o instanceof RuntimeException);
		assertTrue(o == ex);
	}
	
	//TODO test no default constructor
	//TODO test with Inject annotation on constructor
	//TODO test with dependencies
	//TODO test with setters with Inject annotation

}

{'fraction_non_alphanumeric': 0.10215350635008283, 'fraction_numerical': 0.0011043622308117063, 'mean_word_length': 4.741679873217116, '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': '6324834', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1047, 'n_words': 256}