Search in sources :

Example 6 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class DependencyDetectorMultimoduleIT method testTwoChanges.

@Test
public void testTwoChanges() throws IOException, XmlPullParserException, InterruptedException, ParseException, ViewNotFoundException {
    final File thirdVersion = new File(VERSIONS_FOLDER, "another_change");
    final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(thirdVersion));
    ChangeManager changeManager = mockChangeManager();
    final DependencyReader reader = new DependencyReader(DependencyTestConstants.DEFAULT_CONFIG_NO_VIEWS, new PeassFolders(DependencyTestConstants.CURRENT), DependencyTestConstants.NULL_RESULTS_FOLDERS, null, fakeIterator, changeManager, new ExecutionConfig(5), new KiekerConfig(true), new EnvironmentVariables());
    final boolean success = reader.readInitialVersion();
    Assert.assertTrue(success);
    StaticTestSelection dependencies = reader.getDependencies();
    checkInitialVersion(dependencies);
    fakeIterator.goToNextCommit();
    reader.analyseVersion(changeManager);
    testFirstChange(dependencies);
    testSecondChange(dependencies);
}
Also used : ChangeManager(de.dagere.peass.dependency.ChangeManager) FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) VersionIterator(de.dagere.peass.vcs.VersionIterator) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) Test(org.junit.jupiter.api.Test)

Example 7 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class TestExecutorCreation method testMavenExecutorCreation.

@Test
public void testMavenExecutorCreation() {
    ExecutionConfig config = new ExecutionConfig();
    TestTransformer testTransformer = ExecutorCreator.createTestTransformer(Mockito.mock(PeassFolders.class), config, new KiekerConfig(true));
    Assert.assertNotNull(testTransformer);
}
Also used : TestTransformer(de.dagere.peass.testtransformation.TestTransformer) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 8 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class TestKiekerEnvironmentPreparer method testAOPXMLGeneration.

@Test
public void testAOPXMLGeneration() throws IOException, InterruptedException {
    Set<String> includedMethodPatterns = new HashSet<String>();
    includedMethodPatterns.add("public void defaultpackage.NormalDependency.methodA(java.lang.String,int)");
    includedMethodPatterns.add("private int defaultpackage.NormalDependency.methodB()");
    List<File> modules = new LinkedList<File>();
    modules.add(DependencyTestConstants.CURRENT);
    KiekerConfig kiekerConfig = new KiekerConfig(true);
    kiekerConfig.setUseSourceInstrumentation(false);
    KiekerEnvironmentPreparer kiekerEnvironmentPreparer = new KiekerEnvironmentPreparer(includedMethodPatterns, new LinkedList<>(), new PeassFolders(DependencyTestConstants.CURRENT), new JUnitTestTransformer(DependencyTestConstants.CURRENT, new ExecutionConfig(10), kiekerConfig), modules);
    kiekerEnvironmentPreparer.prepareKieker();
    checkAopCorrectness();
}
Also used : KiekerEnvironmentPreparer(de.dagere.peass.execution.kieker.KiekerEnvironmentPreparer) JUnitTestTransformer(de.dagere.peass.testtransformation.JUnitTestTransformer) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) LinkedList(java.util.LinkedList) HashSet(java.util.HashSet) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 9 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class AOPXMLHelper method writeKiekerMonitoringProperties.

public static void writeKiekerMonitoringProperties(final File goalFile, final TestTransformer transformer, final PeassFolders folders) throws IOException {
    try (BufferedWriter writer = new BufferedWriter(new FileWriter(goalFile))) {
        writer.write("kieker.monitoring.name=KIEKER-KoPeMe\n");
        KiekerConfig kiekerConfig = transformer.getConfig().getKiekerConfig();
        if (kiekerConfig.isUseCircularQueue()) {
            writer.write("kieker.monitoring.core.controller.WriterController.RecordQueueFQN=de.dagere.kopeme.collections.SynchronizedCircularFifoQueue\n");
            writer.write("kieker.monitoring.core.controller.WriterController.QueuePutStrategy=kieker.monitoring.queue.putstrategy.YieldPutStrategy\n");
            writer.write("kieker.monitoring.core.controller.WriterController.QueueTakeStrategy=kieker.monitoring.queue.takestrategy.YieldTakeStrategy\n");
        } else {
            writer.write("kieker.monitoring.core.controller.WriterController.RecordQueueFQN=java.util.concurrent.LinkedBlockingQueue\n");
        }
        if (kiekerConfig.isOnlyOneCallRecording()) {
            writer.write("kieker.monitoring.writer=" + ONE_CALL_WRITER + "\n");
        } else if (kiekerConfig.isUseAggregation()) {
            writer.write("kieker.monitoring.writer=" + AGGREGATED_WRITER + "\n");
            writer.write(AggregatedTreeWriter.CONFIG_WRITE_INTERVAL + "=" + kiekerConfig.getKiekerAggregationInterval() + "\n");
        } else {
            writer.write("kieker.monitoring.writer=" + CHANGEABLE_WRITER + "\n");
            writer.write(CHANGEABLE_WRITER + ".realwriter=FileWriter\n");
        }
        if (transformer.isIgnoreEOIs()) {
            writer.write(AggregatedTreeWriter.CONFIG_IGNORE_EOIS + "=true\n");
        }
        if (kiekerConfig.isEnableAdaptiveMonitoring()) {
            writer.write("kieker.monitoring.adaptiveMonitoring.enabled=true\n");
            writer.write("kieker.monitoring.adaptiveMonitoring.configFile=" + MavenTestExecutor.KIEKER_ADAPTIVE_FILENAME + "\n");
            writer.write("kieker.monitoring.adaptiveMonitoring.readInterval=15\n");
        }
        if (kiekerConfig.isUseAggregation()) {
            String tempFolderPath = folders.getTempMeasurementFolder().getAbsolutePath();
            if (EnvironmentVariables.isWindows()) {
                // To avoid problems with escape signs on windows, also use / on windows for the path
                tempFolderPath = tempFolderPath.replace('\\', '/');
            }
            writer.write(AggregatedTreeWriter.CONFIG_PATH + "=" + tempFolderPath + "\n");
        }
        writer.write("kieker.monitoring.core.controller.WriterController.RecordQueueSize=" + kiekerConfig.getKiekerQueueSize() + "\n");
        writer.write(CHANGEABLE_WRITER + ".flush=false\n");
        if (!kiekerConfig.isUseAggregation()) {
            writer.write("kieker.monitoring.writer.filesystem.FileWriter.logStreamHandler=kieker.monitoring.writer.filesystem.BinaryLogStreamHandler\n");
        }
        writer.flush();
    }
}
Also used : FileWriter(java.io.FileWriter) KiekerConfig(de.dagere.peass.config.KiekerConfig) BufferedWriter(java.io.BufferedWriter)

Example 10 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class CalledMethodLoader method main.

public static void main(final String[] args) {
    final File kiekerTraceFile = new File(args[0]);
    KiekerConfig kiekerConfig = new KiekerConfig();
    kiekerConfig.setTraceSizeInMb(10000);
    final List<TraceElement> trace = new CalledMethodLoader(kiekerTraceFile, null, kiekerConfig).getShortTrace("");
    System.out.println("Trace-Size: " + trace.size());
}
Also used : TraceElement(de.dagere.peass.dependency.analysis.data.TraceElement) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig)

Aggregations

KiekerConfig (de.dagere.peass.config.KiekerConfig)34 PeassFolders (de.dagere.peass.folders.PeassFolders)22 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)21 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)21 File (java.io.File)21 Test (org.junit.jupiter.api.Test)18 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)9 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)7 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)7 ChangeManager (de.dagere.peass.dependency.ChangeManager)5 CalledMethodLoader (de.dagere.peass.dependency.analysis.CalledMethodLoader)5 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)5 TraceElement (de.dagere.peass.dependency.analysis.data.TraceElement)5 ResultsFolders (de.dagere.peass.folders.ResultsFolders)5 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)5 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)4 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)4 ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)4 ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)4 VersionIterator (de.dagere.peass.vcs.VersionIterator)4