本文整理汇总了Java中org.sonar.api.ce.measure.test.TestSettings类的典型用法代码示例。如果您正苦于以下问题:Java TestSettings类的具体用法?Java TestSettings怎么用?Java TestSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TestSettings类属于org.sonar.api.ce.measure.test包,在下文中一共展示了TestSettings类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.sonar.api.ce.measure.test.TestSettings; //导入依赖的package包/类
@Before
public void setup() {
definitionContext = new TestMeasureComputerDefinitionContext();
definition = subject.define(definitionContext);
settings = new TestSettings();
component = new TestComponent("test", Type.DIRECTORY, null);
context = new TestMeasureComputerContext(component, settings, definition);
}
示例2: setup
import org.sonar.api.ce.measure.test.TestSettings; //导入依赖的package包/类
@Before
public void setup() {
definitionContext = new TestMeasureComputerDefinitionContext();
definition = subject.define(definitionContext);
settings = new TestSettings();
component = new TestComponent("test", testComponentType, null);
context = new TestMeasureComputerContext(component, settings, definition);
}
示例3: setup
import org.sonar.api.ce.measure.test.TestSettings; //导入依赖的package包/类
@Before
public void setup() {
definitionContext = new TestMeasureComputerDefinitionContext();
definition = subject.define(definitionContext);
settings = new TestSettings();
component = new TestComponent("test", Type.PROJECT, null);
context = new TestMeasureComputerContext(component, settings, definition);
}
示例4: testWeigths
import org.sonar.api.ce.measure.test.TestSettings; //导入依赖的package包/类
@Test
public void testWeigths() {
final TestSettings settings = new TestSettings();
settings.setValue(RciProperties.WEIGTHS_KEY, "40,30,20,10,5,3");
RciWeights weights = RciProperties.getWeights(settings);
Assert.assertEquals(40, weights.getBlocker());
Assert.assertEquals(30, weights.getCritical());
Assert.assertEquals(20, weights.getMajor());
Assert.assertEquals(10, weights.getMinor());
Assert.assertEquals(5, weights.getInfo());
settings.setValue(RciProperties.WEIGTHS_KEY, "40,30");
weights = RciProperties.getWeights(settings);
Assert.assertEquals(40, weights.getBlocker());
Assert.assertEquals(30, weights.getCritical());
Assert.assertEquals(0, weights.getMajor());
Assert.assertEquals(0, weights.getMinor());
Assert.assertEquals(0, weights.getInfo());
settings.setValue(RciProperties.WEIGTHS_KEY, "");
weights = RciProperties.getWeights(settings);
Assert.assertEquals(0, weights.getBlocker());
Assert.assertEquals(0, weights.getCritical());
Assert.assertEquals(0, weights.getMajor());
Assert.assertEquals(0, weights.getMinor());
Assert.assertEquals(0, weights.getInfo());
settings.setValue(RciProperties.WEIGTHS_KEY, null);
weights = RciProperties.getWeights(settings);
Assert.assertEquals(0, weights.getBlocker());
Assert.assertEquals(0, weights.getCritical());
Assert.assertEquals(0, weights.getMajor());
Assert.assertEquals(0, weights.getMinor());
Assert.assertEquals(0, weights.getInfo());
}
示例5: testRatings
import org.sonar.api.ce.measure.test.TestSettings; //导入依赖的package包/类
@Test
public void testRatings() {
final TestSettings settings = new TestSettings();
settings.setValue(RciProperties.RATINGS_KEY, "40,30,20,10,5,3");
RciRating rating = RciProperties.getRating(settings);
Assert.assertEquals(1, rating.getRating(45));
Assert.assertEquals(2, rating.getRating(35));
Assert.assertEquals(3, rating.getRating(25));
Assert.assertEquals(4, rating.getRating(15));
Assert.assertEquals(5, rating.getRating(5));
settings.setValue(RciProperties.RATINGS_KEY, "40,30");
rating = RciProperties.getRating(settings);
Assert.assertEquals(1, rating.getRating(45));
Assert.assertEquals(2, rating.getRating(35));
Assert.assertEquals(3, rating.getRating(25));
Assert.assertEquals(3, rating.getRating(15));
Assert.assertEquals(3, rating.getRating(5));
settings.setValue(RciProperties.RATINGS_KEY, "");
rating = RciProperties.getRating(settings);
Assert.assertEquals(1, rating.getRating(45));
Assert.assertEquals(1, rating.getRating(35));
Assert.assertEquals(1, rating.getRating(25));
Assert.assertEquals(1, rating.getRating(15));
Assert.assertEquals(1, rating.getRating(5));
settings.setValue(RciProperties.RATINGS_KEY, null);
rating = RciProperties.getRating(settings);
Assert.assertEquals(1, rating.getRating(45));
Assert.assertEquals(1, rating.getRating(35));
Assert.assertEquals(1, rating.getRating(25));
Assert.assertEquals(1, rating.getRating(15));
Assert.assertEquals(1, rating.getRating(5));
}