当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionDataStore类代码示例

本文整理汇总了Java中org.jacoco.core.data.ExecutionDataStore的典型用法代码示例。如果您正苦于以下问题:Java ExecutionDataStore类的具体用法?Java ExecutionDataStore怎么用?Java ExecutionDataStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExecutionDataStore类属于org.jacoco.core.data包,在下文中一共展示了ExecutionDataStore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testNewFile

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
@Test
public void testNewFile() throws Exception {
  files.newFile(source());

  final File[] execfiles = new File(folder.getRoot(), ".execdata")
      .listFiles();
  assertEquals(1, execfiles.length);
  final File execfile = execfiles[0];
  assertTrue(execfile.exists());
  assertTrue(execfile.isFile());

  final ExecutionDataReader reader = new ExecutionDataReader(
      new FileInputStream(execfile));
  final SessionInfoStore sessionInfoStore = new SessionInfoStore();
  final ExecutionDataStore executionDataStore = new ExecutionDataStore();
  reader.setSessionInfoVisitor(sessionInfoStore);
  reader.setExecutionDataVisitor(executionDataStore);
  reader.read();

  assertEquals("id", sessionInfoStore.getInfos().get(0).getId());
  assertEquals("MyClass", executionDataStore.get(123).getName());
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:23,代码来源:ExecutionDataFilesTest.java

示例2: execute

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
public void execute() throws IOException {
    if (destfile == null) {
        throw new RuntimeException("Destination file must be supplied");
    }

    final SessionInfoStore infoStore = new SessionInfoStore();
    final ExecutionDataStore dataStore = new ExecutionDataStore();

    loadSourceFiles(infoStore, dataStore);

    OutputStream outputStream = null;
    try {

        outputStream = new BufferedOutputStream(new FileOutputStream(
                destfile));
        final ExecutionDataWriter dataWriter = new ExecutionDataWriter(
                outputStream);
        infoStore.accept(dataWriter);
        dataStore.accept(dataWriter);
    } finally {
        if (outputStream != null) {
            outputStream.close();
        }
    }

}
 
开发者ID:GITNE,项目名称:icedtea-web,代码行数:27,代码来源:MergeTask.java

示例3: loadSourceFiles

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
private void loadSourceFiles(final SessionInfoStore infoStore, final ExecutionDataStore dataStore) throws IOException {
    if (files == null || files.isEmpty()) {
        throw new RuntimeException("No input files");
    }
    final Iterator<?> resourceIterator = files.iterator();
    while (resourceIterator.hasNext()) {
        final File resource = (File) resourceIterator.next();

        if (resource.isDirectory()) {
            continue;
        }
        InputStream resourceStream = null;
        try {
            resourceStream = new FileInputStream(resource);
            final ExecutionDataReader reader = new ExecutionDataReader(
                    resourceStream);
            reader.setSessionInfoVisitor(infoStore);
            reader.setExecutionDataVisitor(dataStore);
            reader.read();
        } finally {
            if (resourceStream != null) {
                resourceStream.close();
            }
        }
    }
}
 
开发者ID:GITNE,项目名称:icedtea-web,代码行数:27,代码来源:MergeTask.java

示例4: loadExecutionData

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
private void loadExecutionData() throws IOException {
    final FileInputStream fis = new FileInputStream(executionDataFile);
    try {
        final ExecutionDataReader executionDataReader = new ExecutionDataReader(
                fis);
        executionDataStore = new ExecutionDataStore();
        sessionInfoStore = new SessionInfoStore();

        executionDataReader.setExecutionDataVisitor(executionDataStore);
        executionDataReader.setSessionInfoVisitor(sessionInfoStore);

        while (executionDataReader.read()) {
        }
    } finally {
        if (fis != null) {
            fis.close();
        }
    }
}
 
开发者ID:GITNE,项目名称:icedtea-web,代码行数:20,代码来源:ReportGenerator.java

示例5: testAccept

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
@Test
public void testAccept() throws Exception {
  SessionInfo info = new SessionInfo("id1", 1, 2);
  source.visitSessionInfo(info);
  source.visitClassExecution(new ExecutionData(123, "MyClass", new boolean[] {
      true, false }));

  SessionInfoStore sessionStore = new SessionInfoStore();
  ExecutionDataStore execStore = new ExecutionDataStore();
  source.accept(execStore, sessionStore);

  assertEquals(Collections.singletonList(info), sessionStore.getInfos());
  assertEquals("MyClass", execStore.get(123).getName());
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:15,代码来源:MemoryExecutionDataSourceTest.java

示例6: testReadFrom

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
@Test
public void testReadFrom() throws Exception {
  ExecutionDataReader reader = new ExecutionDataReader(
      new ByteArrayInputStream(createSessionData()));
  source.readFrom(reader);

  SessionInfoStore sessionStore = new SessionInfoStore();
  ExecutionDataStore execStore = new ExecutionDataStore();
  source.accept(execStore, sessionStore);

  assertEquals(1, sessionStore.getInfos().size());
  assertEquals("MyClass", execStore.get(123).getName());
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:14,代码来源:MemoryExecutionDataSourceTest.java

示例7: testReadExecutionData

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
@Test
public void testReadExecutionData() throws IOException, CoreException {
  final CoverageSession session = new CoverageSession("Description",
      Arrays.asList(root1), source(), configuration);

  SessionInfoStore sessionStore = new SessionInfoStore();
  ExecutionDataStore execStore = new ExecutionDataStore();
  session.accept(execStore, sessionStore);

  assertEquals(1, sessionStore.getInfos().size());
  assertEquals("MyClass", execStore.get(123).getName());
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:13,代码来源:CoverageSessionTest.java

示例8: testAccept

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
@Test
public void testAccept() throws IOException, CoreException {
  final IExecutionDataSource source = createValidSource();

  SessionInfoStore sessionStore = new SessionInfoStore();
  ExecutionDataStore execStore = new ExecutionDataStore();
  source.accept(execStore, sessionStore);

  assertEquals(1, sessionStore.getInfos().size());
  assertEquals("MyClass", execStore.get(123).getName());
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:12,代码来源:URLExecutionDataSourceTest.java

示例9: testAcceptWithError

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
@Test
public void testAcceptWithError() throws IOException, CoreException {
  exception.expect(CoreException.class);
  exception.expectMessage("Error while reading execution data file");

  final IExecutionDataSource source = creatInvalidSource();

  SessionInfoStore sessionStore = new SessionInfoStore();
  ExecutionDataStore execStore = new ExecutionDataStore();
  source.accept(execStore, sessionStore);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:12,代码来源:URLExecutionDataSourceTest.java

示例10: processSession

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
public IJavaModelCoverage processSession(ICoverageSession session,
    IProgressMonitor monitor) throws CoreException {
  PERFORMANCE.startTimer();
  PERFORMANCE.startMemoryUsage();
  modelcoverage = new JavaModelCoverage();
  final Collection<IPackageFragmentRoot> roots = session.getScope();
  monitor.beginTask(
      NLS.bind(CoreMessages.AnalyzingCoverageSession_task,
          session.getDescription()), 1 + roots.size());
  executiondatastore = new ExecutionDataStore();
  sessioninfostore = new SessionInfoStore();
  session.accept(executiondatastore, sessioninfostore);
  monitor.worked(1);

  final PackageFragementRootAnalyzer analyzer = new PackageFragementRootAnalyzer(
      executiondatastore);

  for (final IPackageFragmentRoot root : roots) {
    if (monitor.isCanceled()) {
      break;
    }
    processPackageFragmentRoot(root, analyzer, new SubProgressMonitor(
        monitor, 1));
  }
  monitor.done();
  PERFORMANCE.stopTimer("loading " + session.getDescription()); //$NON-NLS-1$
  PERFORMANCE.stopMemoryUsage("loading " + session.getDescription()); //$NON-NLS-1$
  return modelcoverage;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:30,代码来源:SessionAnalyzer.java

示例11: testStarted

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
@Override
public void testStarted(Description description) throws Exception {
	this.executionData = new ExecutionDataStore();
	this.sessionInfos = new SessionInfoStore();
	data.setSessionId(description.getMethodName());
	data.collect(executionData, sessionInfos, true);
}
 
开发者ID:STAMP-project,项目名称:dspot,代码行数:8,代码来源:JacocoListener.java

示例12: coverageResults

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
private CoverageResults coverageResults(ExecutionDataStore executionData) {
	final CoverageBuilder coverageBuilder = new CoverageBuilder();
	final Analyzer analyzer = new Analyzer(executionData, coverageBuilder);

	try {
		analyzer.analyzeAll(new File(classesDirectory));
	} catch (IOException e) {
		throw new RuntimeException(e);
	}
	return new CoverageResults(coverageBuilder);
}
 
开发者ID:STAMP-project,项目名称:dspot,代码行数:12,代码来源:JacocoListener.java

示例13: coverageResults

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
private CoverageResults coverageResults(ExecutionDataStore executionData) {
    final String classesDirectory = this.program.getProgramDir() + "/" + this.program.getClassesDir();
    final CoverageBuilder coverageBuilder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionData, coverageBuilder);

    try {
        analyzer.analyzeAll(new File(classesDirectory));
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    return new CoverageResults(coverageBuilder);
}
 
开发者ID:STAMP-project,项目名称:dspot,代码行数:13,代码来源:JacocoExecutor.java

示例14: startSession

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
private void startSession(SessionInfo sessionInfo) {
	if (currentSession != null) {
		finishSession();
	}
	currentSession = sessionInfo;
	currentDataStore = new ExecutionDataStore();
}
 
开发者ID:bugminer,项目名称:bugminer,代码行数:8,代码来源:JacocoImporter.java

示例15: analyzeStructure

import org.jacoco.core.data.ExecutionDataStore; //导入依赖的package包/类
private IBundleCoverage analyzeStructure(final ExecutionDataStore data) 
		throws IOException {
	final CoverageBuilder coverageBuilder = new CoverageBuilder();
	final Analyzer analyzer = new Analyzer(data, coverageBuilder);
	analyzer.analyzeAll(classesDirectory);
	return coverageBuilder.getBundle(coverageTitle);
}
 
开发者ID:spideruci,项目名称:tacoco,代码行数:8,代码来源:ExecutionDataParser.java


注:本文中的org.jacoco.core.data.ExecutionDataStore类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。