本文整理汇总了Java中org.jacoco.core.data.ISessionInfoVisitor类的典型用法代码示例。如果您正苦于以下问题:Java ISessionInfoVisitor类的具体用法?Java ISessionInfoVisitor怎么用?Java ISessionInfoVisitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISessionInfoVisitor类属于org.jacoco.core.data包,在下文中一共展示了ISessionInfoVisitor类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: source
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
private IExecutionDataSource source() {
return new IExecutionDataSource() {
public void accept(IExecutionDataVisitor executionDataVisitor,
ISessionInfoVisitor sessionInfoVisitor) throws CoreException {
sessionInfoVisitor.visitSessionInfo(new SessionInfo("id", 1, 2));
executionDataVisitor.visitClassExecution(new ExecutionData(123,
"MyClass", 15));
}
};
}
开发者ID:eclipse,项目名称:eclemma,代码行数:11,代码来源:CoverageSessionTest.java
示例2: accept
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
public void accept(IExecutionDataVisitor executionDataVisitor,
ISessionInfoVisitor sessionInfoVisitor) throws CoreException {
try {
final Socket socket = new Socket(address, port);
final RemoteControlWriter writer = new RemoteControlWriter(
socket.getOutputStream());
final RemoteControlReader reader = new RemoteControlReader(
socket.getInputStream());
reader.setExecutionDataVisitor(executionDataVisitor);
reader.setSessionInfoVisitor(sessionInfoVisitor);
writer.visitDumpCommand(true, reset);
reader.read();
socket.close();
} catch (IOException e) {
throw new CoreException(EclEmmaStatus.AGENT_CONNECT_ERROR.getStatus(
address, Integer.valueOf(port), e));
}
}
开发者ID:eclipse,项目名称:eclemma,代码行数:19,代码来源:AgentExecutionDataSource.java
示例3: dumpContent
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
public void dumpContent() throws IOException {
System.out.printf("exec:%s%n", execFile);
final FileInputStream in = new FileInputStream(execFile);
final ExecutionDataReader reader = new ExecutionDataReader(in);
reader.setSessionInfoVisitor(new ISessionInfoVisitor() {
public void visitSessionInfo(final SessionInfo info) {
String nextSessionName = info.getId();
parser.resetExecDataStore(nextSessionName);
System.out.println("\n" + nextSessionName);
}
});
reader.setExecutionDataVisitor(parser);
while(reader.read()) {};
parser.resetExecDataStore(parser.getCoverageTitle());
parser.forcePrintEnd();
in.close();
parser.close();
}
开发者ID:spideruci,项目名称:tacoco,代码行数:23,代码来源:ExecAnalyzer.java
示例4: dump
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
private void dump(final String file) throws IOException {
out.printf("exec file: %s%n", file);
out.println("CLASS ID HITS/PROBES CLASS NAME");
final FileInputStream in = new FileInputStream(file);
final ExecutionDataReader reader = new ExecutionDataReader(in);
reader.setSessionInfoVisitor(new ISessionInfoVisitor() {
public void visitSessionInfo(final SessionInfo info) {
out.printf("Session \"%s\": %s - %s%n", info.getId(), new Date(
info.getStartTimeStamp()),
new Date(info.getDumpTimeStamp()));
}
});
reader.setExecutionDataVisitor(new IExecutionDataVisitor() {
public void visitClassExecution(final ExecutionData data) {
out.printf("%016x %3d of %3d %s%n",
Long.valueOf(data.getId()),
Integer.valueOf(getHitCount(data.getProbes())),
Integer.valueOf(data.getProbes().length),
data.getName());
}
});
reader.read();
in.close();
out.println();
}
开发者ID:spideruci,项目名称:tacoco,代码行数:27,代码来源:ExecDump.java
示例5: source
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
private IExecutionDataSource source() {
return new IExecutionDataSource() {
public void accept(IExecutionDataVisitor executionDataVisitor,
ISessionInfoVisitor sessionInfoVisitor) throws CoreException {
sessionInfoVisitor.visitSessionInfo(new SessionInfo("id", 1, 2));
ExecutionData executionData = new ExecutionData(123, "MyClass", 15);
executionData.getProbes()[0] = true;
executionDataVisitor.visitClassExecution(executionData);
}
};
}
开发者ID:eclipse,项目名称:eclemma,代码行数:12,代码来源:ExecutionDataFilesTest.java
示例6: accept
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
public void accept(IExecutionDataVisitor executionDataVisitor,
ISessionInfoVisitor sessionInfoVisitor) throws CoreException {
try {
final InputStream in = new BufferedInputStream(url.openStream());
final ExecutionDataReader reader = new ExecutionDataReader(in);
reader.setExecutionDataVisitor(executionDataVisitor);
reader.setSessionInfoVisitor(sessionInfoVisitor);
reader.read();
in.close();
} catch (IOException e) {
throw new CoreException(EclEmmaStatus.EXEC_FILE_READ_ERROR.getStatus(url,
e));
}
}
开发者ID:eclipse,项目名称:eclemma,代码行数:15,代码来源:URLExecutionDataSource.java
示例7: dumpContent
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
private static void dumpContent(final String file) throws IOException {
System.out.printf("exec file: %s%n", file);
System.out.println("CLASS ID HITS/PROBES CLASS NAME");
final FileInputStream in = new FileInputStream(file);
final ExecutionDataReader reader = new ExecutionDataReader(in);
reader.setSessionInfoVisitor(new ISessionInfoVisitor() {
public void visitSessionInfo(final SessionInfo info) {
System.out.printf("Session \"%s\": %s - %s%n", info.getId(),
new Date(info.getStartTimeStamp()),
new Date(info.getDumpTimeStamp()));
}
});
reader.setExecutionDataVisitor(new IExecutionDataVisitor() {
public void visitClassExecution(final ExecutionData data) {
System.out.printf("%016x %3d of %3d %s%n",
Long.valueOf(data.getId()),
Integer.valueOf(getHitCount(data.getProbes())),
Integer.valueOf(data.getProbes().length), data.getName());
}
});
reader.read();
in.close();
System.out.println();
}
开发者ID:spideruci,项目名称:tacoco,代码行数:28,代码来源:ExecDump.java
示例8: dump
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
public static void dump(String dbFile, String sut, String exec) throws Exception{
File projectRoot = new File(sut);
File execFile = new File(exec);
final FileInputStream in = new FileInputStream(execFile);
final ExecutionDataReader reader = new ExecutionDataReader(in);
AbstractBuildProbe probe = AbstractBuildProbe.getInstance(sut);
final String projectFQN = probe.getId();
final DBUtil db = DBUtil.getInstance(dbFile);
db.prepareDBFor(projectFQN, probe.getBuilderType().toString());
DBDumper dumper = createDBDumper(db);
final DataParser parser = new DataParser(probe, dumper, db.getProjectID(projectFQN));
reader.setSessionInfoVisitor(new ISessionInfoVisitor() {
public void visitSessionInfo(final SessionInfo info) {
String nextSessionName = info.getId();
parser.resetExecDataStore(nextSessionName);
System.out.println("\n" + nextSessionName);
boolean pass = nextSessionName.endsWith("_F")?false:true;
String FQN = pass?nextSessionName:nextSessionName.replace("_F","");
db.insertTest(FQN,pass,db.getProjectID(projectFQN));
}
});
reader.setExecutionDataVisitor(parser);
db.setAutoCommit(false);
while(reader.read()) {};
db.setAutoCommit(true);
parser.resetExecDataStore(parser.getCoverageTitle());
parser.forcePrintEnd();
in.close();
parser.close();
db.close();
}
开发者ID:spideruci,项目名称:tacoco,代码行数:37,代码来源:CreateSQLiteDB.java
示例9: accept
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
public void accept(IExecutionDataVisitor executionDataVisitor,
ISessionInfoVisitor sessionInfoVisitor) {
}
开发者ID:eclipse,项目名称:eclemma,代码行数:4,代码来源:SessionManagerTest.java
示例10: accept
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
public void accept(IExecutionDataVisitor executionDataVisitor,
ISessionInfoVisitor sessionInfoVisitor) throws CoreException {
executionDataSource.accept(executionDataVisitor,
sessionInfoVisitor);
}
开发者ID:eclipse,项目名称:eclemma,代码行数:6,代码来源:CoverageSession.java
示例11: accept
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
public void accept(IExecutionDataVisitor executionDataVisitor,
ISessionInfoVisitor sessionInfoVisitor) throws CoreException {
sessionInfoStore.accept(sessionInfoVisitor);
executionDataStore.accept(executionDataVisitor);
}
开发者ID:eclipse,项目名称:eclemma,代码行数:6,代码来源:MemoryExecutionDataSource.java
示例12: loadExecutionData
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
private static void loadExecutionData(@NotNull final File sessionDataFile, ProjectData data, @NotNull Project project) throws IOException {
final ExecutionDataStore executionDataStore = new ExecutionDataStore();
FileInputStream fis = null;
try {
fis = new FileInputStream(sessionDataFile);
final ExecutionDataReader executionDataReader = new ExecutionDataReader(fis);
executionDataReader.setExecutionDataVisitor(executionDataStore);
executionDataReader.setSessionInfoVisitor(new ISessionInfoVisitor() {
public void visitSessionInfo(SessionInfo info) {
System.out.println(info.toString());
}
});
while (executionDataReader.read()) {
}
}
finally {
if (fis != null) {
fis.close();
}
}
final CoverageBuilder coverageBuilder = new CoverageBuilder();
final Analyzer analyzer = new Analyzer(executionDataStore, coverageBuilder);
final Module[] modules = ModuleManager.getInstance(project).getModules();
for (Module module : modules) {
final CompilerModuleExtension compilerModuleExtension = CompilerModuleExtension.getInstance(module);
if (compilerModuleExtension != null) {
final VirtualFile[] roots = compilerModuleExtension.getOutputRoots(true);
for (VirtualFile root : roots) {
analyzer.analyzeAll(VfsUtil.virtualToIoFile(root));
}
}
}
for (IClassCoverage classCoverage : coverageBuilder.getClasses()) {
String className = classCoverage.getName();
className = className.replace('\\', '.').replace('/', '.');
final ClassData classData = data.getOrCreateClassData(className);
final Collection<IMethodCoverage> methods = classCoverage.getMethods();
LineData[] lines = new LineData[classCoverage.getLastLine() + 1];
for (IMethodCoverage method : methods) {
final String desc = method.getName() + method.getDesc();
// Line numbers are 1-based here.
final int firstLine = method.getFirstLine();
final int lastLine = method.getLastLine();
for (int i = firstLine; i <= lastLine; i++) {
final ILine methodLine = method.getLine(i);
final int methodLineStatus = methodLine.getStatus();
if (methodLineStatus == ICounter.EMPTY) continue;
final LineData lineData = new LineData(i , desc) {
@Override
public int getStatus() {
switch (methodLineStatus) {
case ICounter.FULLY_COVERED:
return LineCoverage.FULL;
case ICounter.PARTLY_COVERED:
return LineCoverage.PARTIAL;
default:
return LineCoverage.NONE;
}
}
};
lineData.setHits(methodLineStatus == ICounter.FULLY_COVERED || methodLineStatus == ICounter.PARTLY_COVERED ? 1 : 0);
lines[i] = lineData;
}
}
classData.setLines(lines);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:73,代码来源:JaCoCoCoverageRunner.java
示例13: accept
import org.jacoco.core.data.ISessionInfoVisitor; //导入依赖的package包/类
/**
* Emits all stored execution data in the given visitors.
*
* @param executionDataVisitor
* visitor for execution data
* @param visitor
* for session information
*/
public abstract void accept(IExecutionDataVisitor executionDataVisitor,
ISessionInfoVisitor sessionInfoVisitor) throws CoreException;
开发者ID:eclipse,项目名称:eclemma,代码行数:11,代码来源:IExecutionDataSource.java
注:本文中的org.jacoco.core.data.ISessionInfoVisitor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论