Exemple #1
0
  /** Installs the configuration files needed at startup. */
  @Override
  protected Option[] configureCustom() {
    String managedServiceConfigPath = managedServiceStartupConfig.getResourcePath();
    String managedServiceFactoryConfigPath = managedServiceFactoryStartupConfig.getResourcePath();
    String invalidConfigPath = invalidStartupConfigFile.getResourcePath();

    try {
      return options(
          installStartupFile(
              getClass().getResourceAsStream(managedServiceConfigPath),
              "/etc" + managedServiceConfigPath),
          installStartupFile(
              getClass().getResourceAsStream(managedServiceFactoryConfigPath),
              "/etc" + managedServiceFactoryConfigPath),
          installStartupFile(
              getClass().getResourceAsStream(invalidConfigPath), "/etc" + invalidConfigPath));
    } catch (Exception e) {
      LOGGER.error(
          "Could not copy config files {}, {} and {} to /etc directory",
          managedServiceConfigPath,
          managedServiceFactoryConfigPath,
          invalidConfigPath);
      return null;
    }
  }
Exemple #2
0
  /**
   * Tests that a saved configuration will be exported
   *
   * @throws Exception
   */
  @Test
  public void testExportAfterSavingAConfiguration() throws Exception {
    closeFileHandlesInEtc();
    resetInitialState();

    managedServiceNewConfig1.addConfigurationFileAndWait(configAdmin);

    console.runCommand(EXPORT_COMMAND);

    assertThat(
        "Saved configuration should be exported.",
        getPathToExportedConfig(getDefaultExportDirectory(), managedServiceNewConfig1.pid)
            .toFile()
            .isFile(),
        is(true));
  }
Exemple #3
0
 @Test
 public void testConfigurationFileWithInvalidFormat() throws Exception {
   invalidConfig.addConfigurationFile();
   invalidConfig.assertFileMovedToFailedDirectory();
 }
Exemple #4
0
 @Test
 public void testConfigurationFileWithNoFactoryOrServicePid() throws IOException {
   configWithNoPid.addConfigurationFile();
   configWithNoPid.assertFileMovedToFailedDirectory();
 }
Exemple #5
0
 @Test
 public void testCreateNewManagedServiceFactoryConfigurationFile() throws Exception {
   managedServiceFactoryNewConfig.addConfigurationFileAndWait(configAdmin);
   managedServiceFactoryNewConfig.assertFileMovedToProcessedDirectory();
 }
Exemple #6
0
 @Test
 public void aRunFirstTestStartUpWithInvalidFile() {
   invalidStartupConfigFile.assertFileMovedToFailedDirectory();
 }
Exemple #7
0
 @Test
 public void aRunFirstTestStartUpWithExistingManagedServiceFactoryConfigurationFile()
     throws Exception {
   managedServiceFactoryStartupConfig.assertConfigurationPropertiesSet(configAdmin);
   managedServiceFactoryStartupConfig.assertFileMovedToProcessedDirectory();
 }