List of usage examples for org.apache.commons.configuration BaseConfiguration BaseConfiguration
BaseConfiguration
From source file:org.sonar.plugins.email.EmailPublisherTest.java
@Before public void setUp() { context = mock(SensorContext.class); Server server = mock(Server.class); when(server.getURL()).thenReturn("http://localhost:9000"); publisher = spy(new EmailPublisher(server)); email = mock(SonarEmail.class); doReturn(email).when(publisher).newEmail(); project = new Project("org.example:foo", "", "Foo"); configuration = new BaseConfiguration(); configuration.setProperty(EmailPublisher.FROM_PROPERTY, "sonar@domain"); // TODO it's mandatory property now - see SONARPLUGINS-968 project.setConfiguration(configuration); }
From source file:org.sonar.plugins.email.EmailSendingTest.java
@Before public void start() { server = SimpleSmtpServer.start(port); Configuration configuration = new BaseConfiguration(); configuration.setProperty(EmailPublisher.ENABLED_PROPERTY, true); configuration.setProperty(EmailPublisher.PORT_PROPERTY, Integer.toString(port)); configuration.setProperty(EmailPublisher.FROM_PROPERTY, "sonar@domain"); configuration.setProperty(EmailPublisher.TO_PROPERTY, "user@domain"); project = new Project("org.example:foo", "", "Foo"); project.setConfiguration(configuration); Server server = mock(Server.class); when(server.getURL()).thenReturn("http://localhost:9000"); publisher = new EmailPublisher(server); context = mock(SensorContext.class); }
From source file:org.sonar.plugins.emailnotifications.EmailConfigurationTest.java
@Before public void setUp() { Configuration configuration = new BaseConfiguration(); emailConfiguration = new EmailConfiguration(configuration); }
From source file:org.sonar.plugins.findbugs.FindbugsConfigurationTest.java
@Test public void shouldReturnExcludesFilters() { Configuration projectConfiguration = new BaseConfiguration(); when(project.getConfiguration()).thenReturn(projectConfiguration); FindbugsConfiguration conf = new FindbugsConfiguration(project, RulesProfile.create(), new FindbugsProfileExporter(), null); assertThat(conf.getExcludesFilters().size(), is(0)); projectConfiguration.setProperty(FindbugsConstants.EXCLUDES_FILTERS_PROPERTY, " foo.xml , bar.xml,"); assertThat(conf.getExcludesFilters().size(), is(2)); }
From source file:org.sonar.plugins.googleanalytics.GoogleAnalyticsWebFooterTest.java
@Before public void setUp() { conf = new BaseConfiguration(); footer = new GoogleAnalyticsWebFooter(conf); }
From source file:org.sonar.plugins.googlecalendar.GoogleCalendarPublisherTest.java
@Before public final void setUp() { Server server = mock(Server.class); when(server.getURL()).thenReturn("http://localhost:9000"); publisher = new GoogleCalendarPublisher(server); project = new Project("com.ots.ejustice.example:dummy", "", "Dummy"); configuration = new BaseConfiguration(); configuration.setProperty(GoogleCalendarPublisher.CALENDAR_ID_PROP, "123@group.calendar.google.com"); configuration.setProperty(GoogleCalendarPublisher.ENABLED_PROP, "true"); configuration.setProperty(GoogleCalendarPublisher.ACCOUNT_PROP, "user@gmail.com"); configuration.setProperty(GoogleCalendarPublisher.PASSWORD_PROP, "password"); project.setConfiguration(configuration); }
From source file:org.sonar.plugins.ideainspections.IdeaProfileExporter.java
/** * for unit tests */ IdeaProfileExporter() { this(new BaseConfiguration()); }
From source file:org.sonar.plugins.jacoco.JacocoConfigurationTest.java
@Before public void setUp() { JaCoCoAgentDownloader downloader = mock(JaCoCoAgentDownloader.class); when(downloader.getAgentJarFile()).thenReturn(new File("jacocoagent.jar")); configuration = new BaseConfiguration(); jacocoConfiguration = new JacocoConfiguration(configuration, downloader); }
From source file:org.sonar.plugins.multibuildstability.BuildStabilitySensorTest.java
@Test public void urlInConfigurationTakesPrecedence() throws Exception { MavenProject mavenProject = new MavenProject(); CiManagement ciManagement = new CiManagement(); ciManagement.setSystem("Hudson"); ciManagement.setUrl("pom"); mavenProject.setCiManagement(ciManagement); Configuration configuration = new BaseConfiguration(); configuration.setProperty(BuildStabilitySensor.CI_URL_PROPERTY, "Hudson:conf"); Project project = mock(Project.class); when(project.getPom()).thenReturn(mavenProject); when(project.getConfiguration()).thenReturn(configuration); CiConfiguration config = sensor.getCiConfigurations(project).get(0); assertThat(config.getSystem(), is("hudson")); assertThat(config.getUrl(), is("conf")); }
From source file:org.sonar.plugins.php.core.AbstractPhpPluginConfigurationTest.java
@Test public void shouldNotSkipWhenShouldRunAndSkipNotSet() { Project project = MockUtils.createMockProject(new BaseConfiguration()); FakeConfiguration conf = new FakeConfiguration(project); assertEquals(false, conf.isSkip());/* www. ja v a2 s .c om*/ }