public class ConfigTestUtils
extends junit.framework.Assert
Constructor and Description |
---|
ConfigTestUtils() |
Modifier and Type | Method and Description |
---|---|
static ConfigChannel |
createConfigChannel(Org org)
See createConfigChannel(Org,String,String,ConfigChannelType)
|
static ConfigChannel |
createConfigChannel(Org org,
ConfigChannelType type)
See createConfigChannel(Org,String,String,ConfigChannelType)
|
static ConfigChannel |
createConfigChannel(Org org,
java.lang.String name,
java.lang.String label)
See createConfigChannel(Org,String,String,ConfigChannelType)
|
static ConfigChannel |
createConfigChannel(Org org,
java.lang.String name,
java.lang.String label,
ConfigChannelType type)
Creates a test configuration channel and saves it to the database
with the given information.
|
static ConfigContent |
createConfigContent()
See createConfigContent(Long, boolean)
|
static ConfigContent |
createConfigContent(java.lang.Long fileSize,
boolean isBinary)
Creates a test ConfigContent with the given information.
|
static ConfigFile |
createConfigFile(ConfigChannel channel)
See createConfigFile(ConfigChannel, ConfigFileState, ConfigFileName).
|
static ConfigFile |
createConfigFile(ConfigChannel channel,
ConfigFileState state)
See createConfigFile(ConfigChannel, ConfigFileState, ConfigFileName).
|
static ConfigFile |
createConfigFile(Org org)
See createConfigFile(ConfigChannel, ConfigFileState, ConfigFileName).
|
static ConfigFile |
createConfigFile(Org org,
ConfigFileState state)
See createConfigFile(ConfigChannel, ConfigFileState, ConfigFileName).
|
static ConfigFile |
createConfigFile(Org org,
java.lang.String path)
See createConfigFile(ConfigChannel, ConfigFileState, ConfigFileName).
|
static ConfigInfo |
createConfigInfo()
See createConfigInfo(String, String, Long)
|
static ConfigInfo |
createConfigInfo(java.lang.Long fileMode)
See createConfigInfo(String, String, Long)
|
static ConfigInfo |
createConfigInfo(java.lang.String user,
java.lang.String group,
java.lang.Long fileMode)
Creates a test ConfigInfo with the given information.
|
static ConfigRevision |
createConfigRevision(ConfigFile file)
See createConfigRevision(ConfigFile, ConfigContent, ConfigInfo, Long).
|
static ConfigRevision |
createConfigRevision(ConfigFile file,
ConfigContent content,
ConfigInfo info,
java.lang.Long revision)
Creates a test configuration revision and saves it to the database
with the given information.
|
static ConfigRevision |
createConfigRevision(ConfigFile file,
ConfigContent content,
ConfigInfo info,
java.lang.Long revision,
ConfigFileType type)
Creates a test configuration revision and saves it to the database
with the given information.
|
static ConfigRevision |
createConfigRevision(ConfigFile file,
ConfigFileType type)
See createConfigRevision(ConfigFile, ConfigContent, ConfigInfo, Long).
|
static ConfigRevision |
createConfigRevision(ConfigFile file,
java.lang.Long revision)
See createConfigRevision(ConfigFile, ConfigContent, ConfigInfo, Long).
|
static ConfigRevision |
createConfigRevision(Org org)
See createConfigRevision(ConfigFile, ConfigContent, ConfigInfo, Long).
|
static void |
giveConfigCapabilities(Server server)
Gives all the config capabilites to a server
|
static Server |
giveUserChanAccess(User user,
ConfigChannel channel)
This method will give a user access to a channel (as dictated by the database
function rhn_config_channel.get_user_chan_access).
|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
public static ConfigChannel createConfigChannel(Org org, java.lang.String name, java.lang.String label, ConfigChannelType type)
org
- The orgname
- The channel namelabel
- The channel labeltype
- The channel type (from ConfigurationFactory constant types)public static ConfigChannel createConfigChannel(Org org, java.lang.String name, java.lang.String label)
org
- The orgname
- The channel namelabel
- The channel labelpublic static ConfigChannel createConfigChannel(Org org)
org
- The orgpublic static ConfigChannel createConfigChannel(Org org, ConfigChannelType type)
org
- The orgtype
- The channel type (from ConfigurationFactory constant types)public static ConfigFile createConfigFile(Org org)
org
- The org that this file will belong to.public static ConfigFile createConfigFile(ConfigChannel channel)
channel
- The channel that this file belongs to.public static ConfigFile createConfigFile(Org org, java.lang.String path)
org
- The org that this file will belong to.path
- The path on the system for this config file.public static ConfigFile createConfigFile(Org org, ConfigFileState state)
org
- The org that this file will belong to.state
- The state of the file (dead or alive)public static ConfigFile createConfigFile(ConfigChannel channel, ConfigFileState state)
channel
- The channel for this file to live instate
- The state of the file (dead or alive)public static ConfigRevision createConfigRevision(ConfigFile file, ConfigContent content, ConfigInfo info, java.lang.Long revision)
file
- The file for this revision to belong to.content
- The content of this revision.info
- Permissions and file information.revision
- The revision number.public static ConfigRevision createConfigRevision(ConfigFile file, ConfigContent content, ConfigInfo info, java.lang.Long revision, ConfigFileType type)
file
- The file for this revision to belong to.content
- The content of this revision.info
- Permissions and file information.revision
- The revision number.type
- the desired fileType for this revisionpublic static ConfigRevision createConfigRevision(ConfigFile file, java.lang.Long revision)
file
- The file for this revision to belong to.revision
- The revision number.public static ConfigRevision createConfigRevision(ConfigFile file, ConfigFileType type)
file
- The file for this revision to belong to.type
- the desired fileType for this revisionpublic static ConfigRevision createConfigRevision(ConfigFile file)
file
- The file for this revision to belong to.public static ConfigRevision createConfigRevision(Org org)
org
- The org for this file to belong to.public static ConfigContent createConfigContent(java.lang.Long fileSize, boolean isBinary)
fileSize
- The supposed size of the contents.isBinary
- Whether the contents are binary.public static ConfigContent createConfigContent()
public static ConfigInfo createConfigInfo(java.lang.String user, java.lang.String group, java.lang.Long fileMode)
user
- The owner of the file.group
- The group for the file.fileMode
- The three-digit permissions for the file.public static ConfigInfo createConfigInfo(java.lang.Long fileMode)
fileMode
- The three-digit permissions for the file.public static ConfigInfo createConfigInfo()
public static Server giveUserChanAccess(User user, ConfigChannel channel) throws java.lang.Exception
user
- The user to be given access.channel
- The channel for which to give access.java.lang.Exception
- yep.public static void giveConfigCapabilities(Server server) throws java.lang.Exception
server
- the server that you want to be config enabledjava.lang.Exception
- In the case of DB errors or sql exceptions.