// Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
// 
// 	protected Mockery context = new JUnit4Mockery();
// 
// 	@Before
// 	public void setupMockery() {
// 		context.setImposteriser(ClassImposteriser.INSTANCE);
// 	}
// 	
// 	@After
// 	public void mockeryAssertIsSatisfied(){
// 		context.assertIsSatisfied();
// 	}
// 
// 	protected void checking(Expectations expectations) {
// 		context.checking(expectations);
// 	}
// 
// }
// 
// Path: src/main/java/com/asolutions/asynchrony/customizations/AsynchronyPathToProjectNameConverter.java
// public class AsynchronyPathToProjectNameConverter extends AMatchingGroupPathToProjectNameConverter {
// 
// 	private static Pattern pattern = Pattern.compile("(proj-\\d+)");
// 	
// 	public AsynchronyPathToProjectNameConverter() {
// 	}
// 	
// 	@Override
// 	public Pattern getPattern() {
// 		return pattern;
// 	}
// 
// }
// 
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectException.java
// public class UnparsableProjectException extends Exception {
// 
// 	private static final long serialVersionUID = 643951700141491862L;
// 
// 	public UnparsableProjectException(String reason) {
// 		super(reason);
// 	}
// 
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.asynchrony.customizations.AsynchronyPathToProjectNameConverter;
import com.asolutions.scmsshd.sshd.UnparsableProjectException;
package com.asolutions.scmsshd.converters.path.regexp;



public class ConfigurablePathToProjectConverterTest extends MockTestCase{
	
	@Test
	public void testMatchReturnsTrue() throws Exception {
		ConfigurablePathToProjectConverter converter = new ConfigurablePathToProjectConverter();
		converter.setProjectPattern("(\\d)");
		assertEquals("2", converter.convert("'/proj-2/git.git'"));
	}
	
	@Test
	public void testNoMatchThrowsException() throws Exception {
		ConfigurablePathToProjectConverter converter = new ConfigurablePathToProjectConverter();
		converter.setProjectPattern("(\\d)");
		try{
			new AsynchronyPathToProjectNameConverter().convert("");
			fail("Did not throw");
		}
// Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
// 
// 	protected Mockery context = new JUnit4Mockery();
// 
// 	@Before
// 	public void setupMockery() {
// 		context.setImposteriser(ClassImposteriser.INSTANCE);
// 	}
// 	
// 	@After
// 	public void mockeryAssertIsSatisfied(){
// 		context.assertIsSatisfied();
// 	}
// 
// 	protected void checking(Expectations expectations) {
// 		context.checking(expectations);
// 	}
// 
// }
// 
// Path: src/main/java/com/asolutions/asynchrony/customizations/AsynchronyPathToProjectNameConverter.java
// public class AsynchronyPathToProjectNameConverter extends AMatchingGroupPathToProjectNameConverter {
// 
// 	private static Pattern pattern = Pattern.compile("(proj-\\d+)");
// 	
// 	public AsynchronyPathToProjectNameConverter() {
// 	}
// 	
// 	@Override
// 	public Pattern getPattern() {
// 		return pattern;
// 	}
// 
// }
// 
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectException.java
// public class UnparsableProjectException extends Exception {
// 
// 	private static final long serialVersionUID = 643951700141491862L;
// 
// 	public UnparsableProjectException(String reason) {
// 		super(reason);
// 	}
// 
// }


// Path: src/test/java/com/asolutions/scmsshd/converters/path/regexp/ConfigurablePathToProjectConverterTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.asynchrony.customizations.AsynchronyPathToProjectNameConverter;
import com.asolutions.scmsshd.sshd.UnparsableProjectException;

package com.asolutions.scmsshd.converters.path.regexp;



public class ConfigurablePathToProjectConverterTest extends MockTestCase{
	
	@Test
	public void testMatchReturnsTrue() throws Exception {
		ConfigurablePathToProjectConverter converter = new ConfigurablePathToProjectConverter();
		converter.setProjectPattern("(\\d)");
		assertEquals("2", converter.convert("'/proj-2/git.git'"));
	}
	
	@Test
	public void testNoMatchThrowsException() throws Exception {
		ConfigurablePathToProjectConverter converter = new ConfigurablePathToProjectConverter();
		converter.setProjectPattern("(\\d)");
		try{
			new AsynchronyPathToProjectNameConverter().convert("");
			fail("Did not throw");
		}
		catch (UnparsableProjectException e){