Search in sources :

Example 31 with ChangedEntity

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);
}
Also used : ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 32 with ChangedEntity

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;
}
Also used : ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File)

Example 33 with ChangedEntity

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());
}
Also used : ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) Test(org.junit.jupiter.api.Test)

Example 34 with ChangedEntity

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());
}
Also used : PropertyReadHelper(de.dagere.peass.analysis.properties.PropertyReadHelper) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) ChangeProperty(de.dagere.peass.analysis.properties.ChangeProperty) Change(de.dagere.peass.analysis.changes.Change) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 35 with ChangedEntity

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());
}
Also used : ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) Test(org.junit.jupiter.api.Test)

Aggregations

ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)138 Test (org.junit.jupiter.api.Test)58 File (java.io.File)57 ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)41 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)25 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)21 ChangeManager (de.dagere.peass.dependency.ChangeManager)18 Set (java.util.Set)17 HashSet (java.util.HashSet)16 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)14 HashMap (java.util.HashMap)14 Map (java.util.Map)13 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)11 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)11 VersionIterator (de.dagere.peass.vcs.VersionIterator)10 TreeMap (java.util.TreeMap)9 VersionStaticSelection (de.dagere.peass.dependency.persistence.VersionStaticSelection)8 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)6 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)6 LinkedList (java.util.LinkedList)6