-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Revert incorrect move of test (#4029)
- Loading branch information
1 parent
6cdcf2e
commit 21dd0c8
Showing
3 changed files
with
56 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/test/java/spoon/test/template/testclasses/SimpleTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package spoon.test.template.testclasses; | ||
|
||
import spoon.reflect.declaration.CtClass; | ||
import spoon.reflect.declaration.CtType; | ||
import spoon.template.Local; | ||
import spoon.template.Parameter; | ||
import spoon.template.StatementTemplate; | ||
import spoon.template.Substitution; | ||
import spoon.template.Template; | ||
|
||
import java.sql.Statement; | ||
|
||
/** | ||
* Created by urli on 31/05/2017. | ||
*/ | ||
public class SimpleTemplate extends StatementTemplate { | ||
// template parameter fields | ||
@Parameter | ||
String _parameter_; | ||
|
||
// parameters binding | ||
@Local | ||
public SimpleTemplate(String parameter) { | ||
_parameter_ = parameter; | ||
} | ||
|
||
@Override | ||
public CtClass apply(CtType targetType) { | ||
Substitution.insertAll(targetType, this); | ||
|
||
return (CtClass) targetType; | ||
} | ||
|
||
@Override | ||
public void statement() throws Throwable { | ||
System.out.println(_parameter_); | ||
} | ||
} |