mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-01-10 20:30:11 +08:00
refactor naming
This commit is contained in:
parent
67eeb52513
commit
3d98eb4c8a
@ -50,7 +50,7 @@ public class TestableProcessor extends BaseProcessor {
|
||||
private void createStaticNewClass() {
|
||||
if (!isStaticNewClassExist()) {
|
||||
try {
|
||||
writeSourceFile(ConstPool.SN_PKG + "." + ConstPool.SN_CLS, new StaticNewClassGenerator().fetch());
|
||||
writeSourceFile(ConstPool.SN_PKG_CLS, new StaticNewClassGenerator().fetch());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -59,8 +59,9 @@ public class TestableProcessor extends BaseProcessor {
|
||||
|
||||
private boolean isStaticNewClassExist() {
|
||||
try {
|
||||
FileObject staticNewClassFile = filter.getResource(SOURCE_OUTPUT, ConstPool.SN_PKG, ConstPool.SN_CLS + JAVA_POSTFIX);
|
||||
return staticNewClassFile.getName().contains(GENERATED_TEST_SOURCES) || staticNewClassFile.getLastModified() > 0;
|
||||
FileObject staticNewClassFile = filter.getResource(SOURCE_OUTPUT, ConstPool.SN_PKG,
|
||||
ConstPool.SN_CLS + JAVA_POSTFIX);
|
||||
return isCompilingTestClass(staticNewClassFile) || staticNewClassFile.getLastModified() > 0;
|
||||
} catch (FilerException e) {
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
@ -68,6 +69,10 @@ public class TestableProcessor extends BaseProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isCompilingTestClass(FileObject staticNewClassFile) {
|
||||
return staticNewClassFile.getName().contains(GENERATED_TEST_SOURCES);
|
||||
}
|
||||
|
||||
private void processFieldElement(Element field) {
|
||||
JCTree tree = trees.getTree(field);
|
||||
tree.accept(new TestableFieldTranslator(treeMaker));
|
||||
|
Loading…
Reference in New Issue
Block a user