use of de.dagere.peass.dependency.analysis.data.ChangedEntity in project peass by DaGeRe.
the class TestMethodChangeLongMethodName method testSourceWriting.
@Test
public void testSourceWriting() throws FileNotFoundException, IOException {
ChangedEntity smallEntity = writeSmallMethod(new File("."), methodSourceFolder);
ChangedEntity longEntity = writeLongMethod(new File("."), methodSourceFolder);
ChangedEntity tooLongEntity = writeTooLongMethod(new File("."), methodSourceFolder);
ChangedEntity otherTooLongEntity = writeOtherTooLongMethod(new File("."), methodSourceFolder);
checkSmallMethod(methodSourceFolder, smallEntity);
checkLongMethod(methodSourceFolder, longEntity);
checkTooLongMethod(methodSourceFolder, tooLongEntity);
checkOtherTooLongMethod(methodSourceFolder, otherTooLongEntity);
}
use of de.dagere.peass.dependency.analysis.data.ChangedEntity in project peass by DaGeRe.
the class TestMethodChangeReader method writeConstructor.
public static ChangedEntity writeConstructor(final File sourceFolder, final File methodSourceFolder) throws FileNotFoundException, IOException {
ChangedEntity constructorEntity = new ChangedEntity("de.dagere.peass.analysis.properties.TestMethodChangeReader", "", "<init>");
MethodChangeReader reader = new MethodChangeReader(methodSourceFolder, sourceFolder, new File("."), constructorEntity, VERSION, TEST_CONFIG);
reader.readMethodChangeData();
return constructorEntity;
}
use of de.dagere.peass.dependency.analysis.data.ChangedEntity in project peass by DaGeRe.
the class TestPropertyReadHelper method testDetermineEntityModuleless.
@Test
public void testDetermineEntityModuleless() {
ChangedEntity entity = EntityUtil.determineEntity("clazz" + ChangedEntity.METHOD_SEPARATOR + "method");
Assert.assertEquals("", entity.getModule());
Assert.assertEquals("clazz", entity.getClazz());
Assert.assertEquals("method", entity.getMethod());
}
use of de.dagere.peass.dependency.analysis.data.ChangedEntity in project peass by DaGeRe.
the class TestPropertyReadHelper method testNullVersion.
@Test
public void testNullVersion() throws IOException {
Change changeMock = Mockito.mock(Change.class);
Mockito.when(changeMock.getMethod()).thenReturn("myTestMethod");
ExecutionConfig config = new ExecutionConfig();
config.setVersion("000001");
File projectFolder = new File("target/current");
Files.touch(new File(projectFolder, "pom.xml"));
PropertyReadHelper helper = new PropertyReadHelper(config, new ChangedEntity("Test"), changeMock, projectFolder, null, null, null);
ChangeProperty emptyProperty = helper.read();
MatcherAssert.assertThat(emptyProperty, IsNull.notNullValue());
Assert.assertEquals("myTestMethod", emptyProperty.getMethod());
}
use of de.dagere.peass.dependency.analysis.data.ChangedEntity in project peass by DaGeRe.
the class TestPropertyReadHelper method testDetermineEntity.
@Test
public void testDetermineEntity() {
ChangedEntity entity = EntityUtil.determineEntity("module" + ChangedEntity.MODULE_SEPARATOR + "clazz" + ChangedEntity.METHOD_SEPARATOR + "method");
Assert.assertEquals("module", entity.getModule());
Assert.assertEquals("clazz", entity.getClazz());
Assert.assertEquals("method", entity.getMethod());
}
Aggregations