1 package org.apache.maven.archiva.configuration;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.codehaus.plexus.PlexusTestCase;
23 import org.codehaus.plexus.registry.Registry;
24 import org.codehaus.plexus.registry.RegistryException;
25 import org.codehaus.plexus.util.FileUtils;
26 import org.easymock.MockControl;
29 import java.util.List;
33 * Test the configuration store.
35 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
37 public class ArchivaConfigurationTest
38 extends PlexusTestCase
40 @SuppressWarnings("unused")
41 private Registry registry;
43 protected void setUp()
48 registry = (Registry) lookup( Registry.ROLE, "commons-configuration" );
51 public void testGetConfigurationFromRegistryWithASingleNamedConfigurationResource()
54 ArchivaConfiguration archivaConfiguration =
55 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-configuration" );
57 Configuration configuration = archivaConfiguration.getConfiguration();
58 assertConfiguration( configuration );
59 assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() );
61 ManagedRepositoryConfiguration repository =
62 (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 );
64 assertEquals( "check managed repositories", "${appserver.base}/repositories/internal",
65 repository.getLocation() );
66 assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
67 assertEquals( "check managed repositories", "internal", repository.getId() );
68 assertEquals( "check managed repositories", "default", repository.getLayout() );
69 assertTrue( "check managed repositories", repository.isScanned() );
72 public void testGetConfigurationFromDefaults()
75 ArchivaConfiguration archivaConfiguration =
76 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-defaults" );
78 Configuration configuration = archivaConfiguration.getConfiguration();
79 assertConfiguration( configuration );
80 assertEquals( "check network proxies", 0, configuration.getNetworkProxies().size() );
82 ManagedRepositoryConfiguration repository =
83 (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 );
85 assertEquals( "check managed repositories", "${appserver.base}/data/repositories/internal",
86 repository.getLocation() );
87 assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
88 assertEquals( "check managed repositories", "internal", repository.getId() );
89 assertEquals( "check managed repositories", "default", repository.getLayout() );
90 assertTrue( "check managed repositories", repository.isScanned() );
94 * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
96 private void assertConfiguration( Configuration configuration )
99 FileTypes filetypes = (FileTypes) lookup( FileTypes.class.getName() );
101 assertEquals( "check repositories", 2, configuration.getManagedRepositories().size() );
102 assertEquals( "check repositories", 2, configuration.getRemoteRepositories().size() );
103 assertEquals( "check proxy connectors", 2, configuration.getProxyConnectors().size() );
105 RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning();
106 assertNotNull( "check repository scanning", repoScanning );
107 assertEquals( "check file types", 4, repoScanning.getFileTypes().size() );
108 assertEquals( "check known consumers", 9, repoScanning.getKnownContentConsumers().size() );
109 assertEquals( "check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size() );
111 List<String> patterns = filetypes.getFileTypePatterns( "artifacts" );
112 assertNotNull( "check 'artifacts' file type", patterns );
113 assertEquals( "check 'artifacts' patterns", 13, patterns.size() );
115 DatabaseScanningConfiguration dbScanning = configuration.getDatabaseScanning();
116 assertNotNull( "check database scanning", dbScanning );
117 assertEquals( "check unprocessed consumers", 6, dbScanning.getUnprocessedConsumers().size() );
118 assertEquals( "check cleanup consumers", 3, dbScanning.getCleanupConsumers().size() );
120 WebappConfiguration webapp = configuration.getWebapp();
121 assertNotNull( "check webapp", webapp );
123 UserInterfaceOptions ui = webapp.getUi();
124 assertNotNull( "check webapp ui", ui );
125 assertTrue( "check showFindArtifacts", ui.isShowFindArtifacts() );
126 assertTrue( "check appletFindEnabled", ui.isAppletFindEnabled() );
129 public void testGetConfigurationFromRegistryWithTwoConfigurationResources()
132 ArchivaConfiguration archivaConfiguration =
133 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-configuration-both" );
135 Configuration configuration = archivaConfiguration.getConfiguration();
138 assertEquals( "check repositories", 2, configuration.getManagedRepositories().size() );
139 assertEquals( "check repositories", 2, configuration.getRemoteRepositories().size() );
141 assertEquals( "check proxy connectors", 2, configuration.getProxyConnectors().size() );
143 WebappConfiguration webapp = configuration.getWebapp();
144 assertNotNull( "check webapp", webapp );
146 UserInterfaceOptions ui = webapp.getUi();
147 assertNotNull( "check webapp ui", ui );
149 assertFalse( "check showFindArtifacts", ui.isShowFindArtifacts() );
151 assertFalse( "check appletFindEnabled", ui.isAppletFindEnabled() );
154 public void testGetConfigurationSystemOverride()
157 ArchivaConfiguration archivaConfiguration =
158 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-configuration" );
160 System.setProperty( "org.apache.maven.archiva.webapp.ui.appletFindEnabled", "false" );
164 Configuration configuration = archivaConfiguration.getConfiguration();
166 assertFalse( "check boolean", configuration.getWebapp().getUi().isAppletFindEnabled() );
170 System.getProperties().remove( "org.apache.maven.archiva.webapp.ui.appletFindEnabled" );
174 public void testStoreConfiguration()
177 File file = getTestFile( "target/test/test-file.xml" );
179 assertFalse( file.exists() );
181 // TODO: remove with commons-configuration 1.4
182 file.getParentFile().mkdirs();
183 FileUtils.fileWrite( file.getAbsolutePath(), "<configuration/>" );
185 DefaultArchivaConfiguration archivaConfiguration =
186 (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save" );
188 Configuration configuration = new Configuration();
189 configuration.setVersion( "1" );
190 configuration.setWebapp( new WebappConfiguration() );
191 configuration.getWebapp().setUi( new UserInterfaceOptions() );
192 configuration.getWebapp().getUi().setAppletFindEnabled( false );
194 // add a change listener
195 MockControl control = createConfigurationListenerMockControl();
196 ConfigurationListener listener = (ConfigurationListener) control.getMock();
197 archivaConfiguration.addListener( listener );
199 listener.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED ) );
200 control.setVoidCallable();
204 archivaConfiguration.save( configuration );
208 assertTrue( "Check file exists", file.exists() );
211 configuration = archivaConfiguration.getConfiguration();
212 assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
215 archivaConfiguration =
216 (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-read-saved" );
217 configuration = archivaConfiguration.getConfiguration();
218 assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
221 private static MockControl createConfigurationListenerMockControl()
223 MockControl control = MockControl.createControl( ConfigurationListener.class );
227 public void testStoreConfigurationUser()
230 File baseFile = getTestFile( "target/test/test-file.xml" );
232 assertFalse( baseFile.exists() );
234 File userFile = getTestFile( "target/test/test-file-user.xml" );
236 assertFalse( userFile.exists() );
238 userFile.getParentFile().mkdirs();
239 FileUtils.fileWrite( userFile.getAbsolutePath(), "<configuration/>" );
241 ArchivaConfiguration archivaConfiguration =
242 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" );
244 Configuration configuration = new Configuration();
245 configuration.setWebapp( new WebappConfiguration() );
246 configuration.getWebapp().setUi( new UserInterfaceOptions() );
247 configuration.getWebapp().getUi().setAppletFindEnabled( false );
249 archivaConfiguration.save( configuration );
251 assertTrue( "Check file exists", userFile.exists() );
252 assertFalse( "Check file not created", baseFile.exists() );
255 configuration = archivaConfiguration.getConfiguration();
256 assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
259 public void testStoreConfigurationLoadedFromDefaults()
262 File baseFile = getTestFile( "target/test/test-file.xml" );
264 assertFalse( baseFile.exists() );
266 File userFile = getTestFile( "target/test/test-file-user.xml" );
268 assertFalse( userFile.exists() );
270 ArchivaConfiguration archivaConfiguration =
271 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" );
273 Configuration configuration = new Configuration();
274 configuration.setWebapp( new WebappConfiguration() );
275 configuration.getWebapp().setUi( new UserInterfaceOptions() );
276 configuration.getWebapp().getUi().setAppletFindEnabled( false );
278 // add a change listener
279 MockControl control = createConfigurationListenerMockControl();
280 ConfigurationListener listener = (ConfigurationListener) control.getMock();
281 archivaConfiguration.addListener( listener );
283 listener.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED ) );
284 // once from default creation, and again from manual call to save
285 control.setVoidCallable( 2 );
289 archivaConfiguration.save( configuration );
293 assertTrue( "Check file exists", userFile.exists() );
294 assertFalse( "Check file not created", baseFile.exists() );
297 configuration = archivaConfiguration.getConfiguration();
298 assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
301 public void testDefaultUserConfigFilename()
304 DefaultArchivaConfiguration archivaConfiguration =
305 (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class.getName() );
307 assertEquals( System.getProperty( "user.home" ) + "/.m2/archiva.xml",
308 archivaConfiguration.getUserConfigFilename() );
309 assertEquals( System.getProperty( "appserver.base", "${appserver.base}" ) + "/conf/archiva.xml",
310 archivaConfiguration.getAltConfigFilename() );
313 public void testStoreConfigurationFallback()
316 File baseFile = getTestFile( "target/test/test-file.xml" );
318 assertFalse( baseFile.exists() );
320 File userFile = getTestFile( "target/test/test-file-user.xml" );
322 assertFalse( userFile.exists() );
324 baseFile.getParentFile().mkdirs();
325 FileUtils.fileWrite( baseFile.getAbsolutePath(), "<configuration/>" );
327 ArchivaConfiguration archivaConfiguration =
328 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" );
330 Configuration configuration = new Configuration();
331 configuration.setWebapp( new WebappConfiguration() );
332 configuration.getWebapp().setUi( new UserInterfaceOptions() );
333 configuration.getWebapp().getUi().setAppletFindEnabled( false );
335 archivaConfiguration.save( configuration );
337 assertTrue( "Check file exists", baseFile.exists() );
338 assertFalse( "Check file not created", userFile.exists() );
341 configuration = archivaConfiguration.getConfiguration();
342 assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
345 public void testStoreConfigurationFailsWhenReadFromBothLocationsNoLists()
348 File baseFile = getTestFile( "target/test/test-file.xml" );
350 assertFalse( baseFile.exists() );
352 File userFile = getTestFile( "target/test/test-file-user.xml" );
354 assertFalse( userFile.exists() );
356 baseFile.getParentFile().mkdirs();
357 FileUtils.fileWrite( baseFile.getAbsolutePath(), "<configuration/>" );
359 userFile.getParentFile().mkdirs();
360 FileUtils.fileWrite( userFile.getAbsolutePath(), "<configuration/>" );
362 ArchivaConfiguration archivaConfiguration =
363 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" );
365 Configuration configuration = archivaConfiguration.getConfiguration();
366 assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
368 configuration.getWebapp().getUi().setAppletFindEnabled( false );
370 archivaConfiguration.save( configuration );
372 assertTrue( "Check file exists", baseFile.exists() );
373 assertEquals( "Check base file is unchanged", "<configuration/>",
374 FileUtils.fileRead( baseFile.getAbsolutePath() ) );
375 assertTrue( "Check file exists", userFile.exists() );
376 assertFalse( "Check base file is changed",
377 "<configuration/>".equals( FileUtils.fileRead( userFile.getAbsolutePath() ) ) );
380 configuration = archivaConfiguration.getConfiguration();
381 assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
384 public void testStoreConfigurationFailsWhenReadFromBothLocationsUserHasLists()
387 File baseFile = getTestFile( "target/test/test-file.xml" );
389 assertFalse( baseFile.exists() );
391 File userFile = getTestFile( "target/test/test-file-user.xml" );
393 assertFalse( userFile.exists() );
395 userFile.getParentFile().mkdirs();
396 FileUtils.copyFile( getTestFile( "src/test/conf/conf-user.xml" ), userFile );
398 baseFile.getParentFile().mkdirs();
399 FileUtils.fileWrite( baseFile.getAbsolutePath(), "<configuration/>" );
401 ArchivaConfiguration archivaConfiguration =
402 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" );
404 Configuration configuration = archivaConfiguration.getConfiguration();
405 assertTrue( "check value", configuration.getWebapp().getUi().isShowFindArtifacts() );
407 configuration.getWebapp().getUi().setShowFindArtifacts( false );
409 archivaConfiguration.save( configuration );
411 assertTrue( "Check file exists", baseFile.exists() );
412 assertEquals( "Check base file is unchanged", "<configuration/>",
413 FileUtils.fileRead( baseFile.getAbsolutePath() ) );
414 assertTrue( "Check file exists", userFile.exists() );
415 assertFalse( "Check base file is changed",
416 "<configuration/>".equals( FileUtils.fileRead( userFile.getAbsolutePath() ) ) );
419 configuration = archivaConfiguration.getConfiguration();
420 assertFalse( "check value", configuration.getWebapp().getUi().isShowFindArtifacts() );
423 public void testStoreConfigurationFailsWhenReadFromBothLocationsAppserverHasLists()
426 File baseFile = getTestFile( "target/test/test-file.xml" );
428 assertFalse( baseFile.exists() );
430 File userFile = getTestFile( "target/test/test-file-user.xml" );
432 assertFalse( userFile.exists() );
434 baseFile.getParentFile().mkdirs();
435 FileUtils.copyFile( getTestFile( "src/test/conf/conf-base.xml" ), baseFile );
437 userFile.getParentFile().mkdirs();
438 FileUtils.fileWrite( userFile.getAbsolutePath(), "<configuration/>" );
440 ArchivaConfiguration archivaConfiguration =
441 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" );
443 Configuration configuration = archivaConfiguration.getConfiguration();
444 assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
446 configuration.getWebapp().getUi().setAppletFindEnabled( false );
450 archivaConfiguration.save( configuration );
451 fail( "Configuration saving should not succeed if it was loaded from two locations" );
453 catch ( IndeterminateConfigurationException e )
455 // check it was reverted
456 configuration = archivaConfiguration.getConfiguration();
457 assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
461 public void testLoadConfigurationFromInvalidBothLocationsOnDisk() throws Exception
463 ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(),
464 "test-not-allowed-to-write-to-both" );
465 Configuration config = archivaConfiguration.getConfiguration();
469 archivaConfiguration.save( config );
470 fail( "Should have thrown a RegistryException because the configuration can't be saved." );
472 catch ( RegistryException e )
474 /* expected exception */
478 public void testLoadConfigurationFromInvalidUserLocationOnDisk() throws Exception
480 File testConfDir = getTestFile( "target/test-appserver-base/conf/" );
481 testConfDir.mkdirs();
483 ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(),
484 "test-not-allowed-to-write-to-user" );
485 Configuration config = archivaConfiguration.getConfiguration();
486 archivaConfiguration.save( config );
487 // No Exception == test passes.
488 // Expected Path is: Should not have thrown an exception.
491 public void testConfigurationUpgradeFrom09()
494 ArchivaConfiguration archivaConfiguration =
495 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-upgrade-09" );
497 // we just use the defaults when upgrading from 0.9 at this point.
498 Configuration configuration = archivaConfiguration.getConfiguration();
499 assertConfiguration( configuration );
500 assertEquals( "check network proxies", 0, configuration.getNetworkProxies().size() );
502 ManagedRepositoryConfiguration repository =
503 (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 );
505 assertEquals( "check managed repositories", "${appserver.base}/data/repositories/internal",
506 repository.getLocation() );
507 assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
508 assertEquals( "check managed repositories", "internal", repository.getId() );
509 assertEquals( "check managed repositories", "default", repository.getLayout() );
510 assertTrue( "check managed repositories", repository.isScanned() );
513 public void testAutoDetectV1()
516 // Setup the autodetect-v1.xml file in the target directory (so we can save/load it)
517 File userFile = getTestFile( "target/test-autodetect-v1/archiva-user.xml" );
519 assertFalse( userFile.exists() );
521 userFile.getParentFile().mkdirs();
522 FileUtils.copyFile( getTestFile( "src/test/conf/autodetect-v1.xml" ), userFile );
524 // Load the original (unconverted) archiva.xml
525 ArchivaConfiguration archivaConfiguration =
526 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-autodetect-v1" );
528 Configuration configuration = archivaConfiguration.getConfiguration();
529 assertConfiguration( configuration );
530 assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() );
532 ManagedRepositoryConfiguration repository =
533 (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 );
535 assertEquals( "check managed repositories", "${appserver.base}/repositories/internal",
536 repository.getLocation() );
537 assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
538 assertEquals( "check managed repositories", "internal", repository.getId() );
539 assertEquals( "check managed repositories", "default", repository.getLayout() );
540 assertTrue( "check managed repositories", repository.isScanned() );
542 // Test that only 1 set of repositories exist.
543 assertEquals( "check managed repositories size.", 2, configuration.getManagedRepositories().size() );
544 assertEquals( "check remote repositories size.", 2, configuration.getRemoteRepositories().size() );
545 assertEquals( "check v1 repositories size.", 0, configuration.getRepositories().size() );
548 archivaConfiguration.save( configuration );
551 release( archivaConfiguration );
554 archivaConfiguration =
555 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-autodetect-v1" );
557 // Test that only 1 set of repositories exist.
558 assertEquals( "check managed repositories size.", 2, configuration.getManagedRepositories().size() );
559 assertEquals( "check managed repositories size.", 2, configuration.getManagedRepositoriesAsMap().size() );
560 assertEquals( "check remote repositories size.", 2, configuration.getRemoteRepositories().size() );
561 assertEquals( "check remote repositories size.", 2, configuration.getRemoteRepositoriesAsMap().size() );
562 assertEquals( "check v1 repositories size.", 0, configuration.getRepositories().size() );
564 /* FIXME: can't get rid of old v1 <repositories> section programatically.
565 String actualXML = FileUtils.fileRead( userFile );
566 XMLAssert.assertXpathNotExists( "//configuration/repositories/repository", actualXML );
567 XMLAssert.assertXpathNotExists( "//configuration/repositories", actualXML );
571 public void testArchivaV1()
574 ArchivaConfiguration archivaConfiguration =
575 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-archiva-v1" );
577 Configuration configuration = archivaConfiguration.getConfiguration();
578 assertConfiguration( configuration );
579 assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() );
581 assertEquals( "check managed repositories", 2, configuration.getManagedRepositories().size() );
583 Map<String, ManagedRepositoryConfiguration> map = configuration.getManagedRepositoriesAsMap();
585 ManagedRepositoryConfiguration repository = map.get( "internal" );
586 assertEquals( "check managed repositories", "${appserver.base}/repositories/internal",
587 repository.getLocation() );
588 assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
589 assertEquals( "check managed repositories", "internal", repository.getId() );
590 assertEquals( "check managed repositories", "default", repository.getLayout() );
591 assertTrue( "check managed repositories", repository.isScanned() );
592 assertFalse( "check managed repositories", repository.isSnapshots() );
594 repository = map.get( "snapshots" );
595 assertEquals( "check managed repositories", "${appserver.base}/repositories/snapshots",
596 repository.getLocation() );
597 assertEquals( "check managed repositories", "Archiva Managed Snapshot Repository", repository.getName() );
598 assertEquals( "check managed repositories", "snapshots", repository.getId() );
599 assertEquals( "check managed repositories", "default", repository.getLayout() );
600 assertFalse( "check managed repositories", repository.isScanned() );
601 assertTrue( "check managed repositories", repository.isSnapshots() );
604 public void testCronExpressionsWithComma()
607 File baseFile = getTestFile( "target/test/test-file.xml" );
609 assertFalse( baseFile.exists() );
611 File userFile = getTestFile( "target/test/test-file-user.xml" );
613 assertFalse( userFile.exists() );
615 baseFile.getParentFile().mkdirs();
616 FileUtils.copyFile( getTestFile( "src/test/conf/escape-cron-expressions.xml" ), baseFile );
618 userFile.getParentFile().mkdirs();
619 FileUtils.fileWrite( userFile.getAbsolutePath(), "<configuration/>" );
621 ArchivaConfiguration archivaConfiguration =
622 (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-cron-expressions" );
624 Configuration configuration = archivaConfiguration.getConfiguration();
626 ManagedRepositoryConfiguration repository =
627 (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 );
629 assertEquals( "check cron expression", "0 0,30 * * ?", repository.getRefreshCronExpression().trim() );
631 configuration.getDatabaseScanning().setCronExpression( "0 0,15 0 * * ?" );
633 archivaConfiguration.save( configuration );
635 configuration = archivaConfiguration.getConfiguration();
637 assertEquals( "check cron expression", "0 0,15 0 * * ?",
638 configuration.getDatabaseScanning().getCronExpression() );
640 // test for the escape character '\' showing up on repositories.jsp
641 repository.setRefreshCronExpression( "0 0,20 0 * * ?" );
643 archivaConfiguration.save( configuration );
645 repository = archivaConfiguration.getConfiguration().findManagedRepositoryById( "snapshots" );
647 assertEquals( "check cron expression", "0 0,20 0 * * ?", repository.getRefreshCronExpression() );