http://developers.itextpdf.com上的iText7示例使用com.itextpdf.test.annotations.WrapToTest
等类
(参见例如http://developers.itextpdf.com/content/itext-7-jump-start-tutorial/examples/chapter-1)。
/*
* This example is part of the iText 7 tutorial.
*/
package tutorial.chapter01;
***SNIP IMPORTS***
/**
* Simple Hello World example.
*/
@WrapToTest
public class C01E01_HelloWorld {
***SNIP CODE***
}
另请参阅http://developers.itextpdf.com/examples/actions-and-annotations/clone-adding-links-existing-documents中的类com.itextpdf.test.annotations.type.SampleTest
的导入。
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2016 iText Group NV
*/
/**
* This example was written by Bruno Lowagie in answer to the following question:
* http://stackoverflow.com/questions/26983703/itext-how-to-stamp-image-on-existing-pdf-and-create-an-anchor
*/
package com.itextpdf.samples.sandbox.annotations;
***SNIP IMPORTS***
@Category(SampleTest.class)
public class AddImageLink extends GenericTest {
***SNIP CODE***
}
com.itextpdf.test.**
- 用于什么类?
答案 0 :(得分:3)
WrapToTest
注释的JavaDoc:
https://github.com/itext/itext7/blob/develop/pdftest/src/main/java/com/itextpdf/test/annotations/WrapToTest.java /**
* This annotation can be used to run a class that contains a public
* static void main
method as a test in the JUnit test runner.
*/
com.itextpdf.test.annotations.type.*
。它们仅用于告诉Maven哪些类型的测试是单元测试,哪些是集成测试。基于名称的单元测试分离和集成测试是我正在研究的问题。没有计划这个改变的时间框架。你肯定不会因为你的生产代码而需要它们。所有iText源代码都可以在GitHub上找到,因此您可以自行检查它的用途:https://github.com/itext