Esempio n. 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;
    }
  }
Esempio n. 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));
  }
Esempio n. 3
0
 @Test
 public void testConfigurationFileWithInvalidFormat() throws Exception {
   invalidConfig.addConfigurationFile();
   invalidConfig.assertFileMovedToFailedDirectory();
 }
Esempio n. 4
0
 @Test
 public void testConfigurationFileWithNoFactoryOrServicePid() throws IOException {
   configWithNoPid.addConfigurationFile();
   configWithNoPid.assertFileMovedToFailedDirectory();
 }
Esempio n. 5
0
 @Test
 public void testCreateNewManagedServiceFactoryConfigurationFile() throws Exception {
   managedServiceFactoryNewConfig.addConfigurationFileAndWait(configAdmin);
   managedServiceFactoryNewConfig.assertFileMovedToProcessedDirectory();
 }
Esempio n. 6
0
 @Test
 public void aRunFirstTestStartUpWithInvalidFile() {
   invalidStartupConfigFile.assertFileMovedToFailedDirectory();
 }
Esempio n. 7
0
 @Test
 public void aRunFirstTestStartUpWithExistingManagedServiceFactoryConfigurationFile()
     throws Exception {
   managedServiceFactoryStartupConfig.assertConfigurationPropertiesSet(configAdmin);
   managedServiceFactoryStartupConfig.assertFileMovedToProcessedDirectory();
 }