Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
58 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 32 additions & 3 deletions
35
symmetric/src/test/java/org/jumpmind/symmetric/service/impl/ParameterServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,44 @@ | ||
package org.jumpmind.symmetric.service.impl; | ||
|
||
import org.jumpmind.symmetric.AbstractDatabaseTest; | ||
import org.jumpmind.symmetric.common.PropertiesConstants; | ||
import org.jumpmind.symmetric.common.ParameterConstants; | ||
import org.jumpmind.symmetric.common.TestConstants; | ||
import org.jumpmind.symmetric.service.IParameterService; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
public class ParameterServiceTest extends AbstractDatabaseTest { | ||
|
||
|
||
@Test(groups="continuous") | ||
public void testParameterGetFromDefaults() { | ||
Assert.assertEquals(getParameterService().getString(PropertiesConstants.RUNTIME_CONFIG_TABLE_PREFIX), "sym", "Unexpected default table prefix found."); | ||
Assert.assertEquals(getParameterService().getString(ParameterConstants.RUNTIME_CONFIG_TABLE_PREFIX), "sym", "Unexpected default table prefix found."); | ||
} | ||
|
||
|
||
@Test(groups="continuous") | ||
public void testParameterGetFromDatabase() { | ||
Assert.assertEquals(getParameterService().getInt(ParameterConstants.CONCURRENT_WORKERS), 20); | ||
getParameterService().saveParameter(TestConstants.TEST_CLIENT_EXTERNAL_ID, TestConstants.TEST_CLIENT_NODE_GROUP, ParameterConstants.CONCURRENT_WORKERS, 10); | ||
getParameterService().rereadParameters(); | ||
|
||
// make sure we are not picking up someone else's parameter | ||
Assert.assertEquals(getParameterService().getInt(ParameterConstants.CONCURRENT_WORKERS), 20); | ||
|
||
getParameterService().saveParameter(IParameterService.ALL, TestConstants.TEST_ROOT_NODE_GROUP, ParameterConstants.CONCURRENT_WORKERS, 5); | ||
|
||
// make sure the parameters are cached | ||
Assert.assertEquals(getParameterService().getInt(ParameterConstants.CONCURRENT_WORKERS), 20); | ||
|
||
// make sure we pick up the new parameter for us | ||
getParameterService().rereadParameters(); | ||
Assert.assertEquals(getParameterService().getInt(ParameterConstants.CONCURRENT_WORKERS), 5); | ||
|
||
getParameterService().saveParameter(TestConstants.TEST_ROOT_EXTERNAL_ID, TestConstants.TEST_ROOT_NODE_GROUP, ParameterConstants.CONCURRENT_WORKERS, 10); | ||
|
||
// make sure we pick up the new parameter for us | ||
getParameterService().rereadParameters(); | ||
Assert.assertEquals(getParameterService().getInt(ParameterConstants.CONCURRENT_WORKERS), 10); | ||
} | ||
|
||
|
||
} |