本文整理汇总了Java中org.springframework.boot.groovy.DependencyManagementBom类的典型用法代码示例。如果您正苦于以下问题:Java DependencyManagementBom类的具体用法?Java DependencyManagementBom怎么用?Java DependencyManagementBom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DependencyManagementBom类属于org.springframework.boot.groovy包,在下文中一共展示了DependencyManagementBom类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transformationOfClassWithExistingManagedDependencies
import org.springframework.boot.groovy.DependencyManagementBom; //导入依赖的package包/类
@Test
public void transformationOfClassWithExistingManagedDependencies() {
this.moduleNode.setPackage(new PackageNode("foo"));
ClassNode cls = ClassHelper.make("MyClass");
this.moduleNode.addClass(cls);
AnnotationNode annotation = new AnnotationNode(
ClassHelper.make(DependencyManagementBom.class));
annotation.addMember("value", new ConstantExpression("test:parent:1.0.0"));
cls.addAnnotation(annotation);
this.transformation.visit(new ASTNode[] { this.moduleNode }, this.sourceUnit);
assertThat(getValue().toString())
.isEqualTo("[test:parent:1.0.0, test:child:1.0.0]");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:GenericBomAstTransformationTests.java
示例2: findAnnotation
import org.springframework.boot.groovy.DependencyManagementBom; //导入依赖的package包/类
private AnnotationNode findAnnotation() {
PackageNode packageNode = this.moduleNode.getPackage();
ClassNode bom = ClassHelper.make(DependencyManagementBom.class);
if (packageNode != null) {
if (!packageNode.getAnnotations(bom).isEmpty()) {
return packageNode.getAnnotations(bom).get(0);
}
}
if (!this.moduleNode.getClasses().isEmpty()) {
return this.moduleNode.getClasses().get(0).getAnnotations(bom).get(0);
}
throw new IllegalStateException("No package or class node found");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:GenericBomAstTransformationTests.java
示例3: transformationOfClassWithExistingManagedDependencies
import org.springframework.boot.groovy.DependencyManagementBom; //导入依赖的package包/类
@Test
public void transformationOfClassWithExistingManagedDependencies() {
this.moduleNode.setPackage(new PackageNode("foo"));
ClassNode cls = ClassHelper.make("MyClass");
this.moduleNode.addClass(cls);
AnnotationNode annotation = new AnnotationNode(
ClassHelper.make(DependencyManagementBom.class));
annotation.addMember("value", new ConstantExpression("test:parent:1.0.0"));
cls.addAnnotation(annotation);
this.transformation.visit(new ASTNode[] { this.moduleNode }, this.sourceUnit);
assertEquals("[test:parent:1.0.0, test:child:1.0.0]", getValue().toString());
}