play.test
类 Fixtures

java.lang.Object
  继承者 play.test.Fixtures

public class Fixtures
extends java.lang.Object


构造方法摘要
Fixtures()
           
 
方法摘要
static void delete(java.lang.Class<? extends Model>... types)
          Delete all Model instances for the given types using the underlying persistence mechanisms
static void delete(java.util.List<java.lang.Class<? extends Model>> classes)
          Delete all Model instances for the given types using the underlying persistence mechanisms
static void deleteAll()
          已过时。 use deleteDatabase() instead
static void deleteAllModels()
          Delete all Model instances for the all available types using the underlying persistence mechanisms
static void deleteDatabase()
          Flush the entire JDBC database for all configured databases.
static void deleteDatabase(java.lang.String dbConfigName)
          Flush the entire specified JDBC database
static void deleteDirectory(java.lang.String path)
          Delete a directory recursively
static void executeSQL(java.io.File sqlScript)
           
static void executeSQL(java.lang.String sqlScript)
           
static void load(java.util.List<java.lang.String> names)
          已过时。 use loadModels(String...) instead
static void load(java.lang.String... names)
          已过时。 use loadModels(String...) instead
static void load(java.lang.String name)
          已过时。 use loadModels(String...) instead
static void loadModels(java.util.List<java.lang.String> names)
           
static void loadModels(java.lang.String... names)
           
static void loadModels(java.lang.String name)
           
protected static void loadModels(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> idCache)
          Load Model instances from a YAML file and persist them using the underlying persistence mechanism.
static java.lang.Object loadYaml(java.lang.String name)
          Load and parse a plain YAML file and returns the corresponding Java objects.
static
<T> T
loadYaml(java.lang.String name, java.lang.Class<T> clazz)
          Load and parse a plain YAML file and returns the corresponding Java Map.
static
<T> T
loadYaml(java.lang.String name, org.yaml.snakeyaml.Yaml yaml)
           
static java.util.List<?> loadYamlAsList(java.lang.String name)
          Load and parse a plain YAML file and returns the corresponding Java List.
static java.util.Map<?,?> loadYamlAsMap(java.lang.String name)
          Load and parse a plain YAML file and returns the corresponding Java Map.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

Fixtures

public Fixtures()
方法详细信息

executeSQL

public static void executeSQL(java.lang.String sqlScript)

executeSQL

public static void executeSQL(java.io.File sqlScript)

delete

public static void delete(java.lang.Class<? extends Model>... types)
Delete all Model instances for the given types using the underlying persistence mechanisms

参数:
types - Types to delete

delete

public static void delete(java.util.List<java.lang.Class<? extends Model>> classes)
Delete all Model instances for the given types using the underlying persistence mechanisms

参数:
types - Types to delete

deleteAllModels

public static void deleteAllModels()
Delete all Model instances for the all available types using the underlying persistence mechanisms


deleteAll

@Deprecated
public static void deleteAll()
已过时。 use deleteDatabase() instead

Use deleteDatabase() instead


deleteDatabase

public static void deleteDatabase()
Flush the entire JDBC database for all configured databases.


deleteDatabase

public static void deleteDatabase(java.lang.String dbConfigName)
Flush the entire specified JDBC database

参数:
dbConfigName - specifies which configured database to delete - use null to delete the default database

load

@Deprecated
public static void load(java.lang.String name)
已过时。 use loadModels(String...) instead

参数:
name -

loadModels

public static void loadModels(java.lang.String name)

loadModels

protected static void loadModels(java.lang.String name,
                                 java.util.Map<java.lang.String,java.lang.Object> idCache)
Load Model instances from a YAML file and persist them using the underlying persistence mechanism. The format of the YAML file is constrained, see the Fixtures manual page

参数:
name - Name of a YAML file somewhere in the classpath (or conf/)

load

@Deprecated
public static void load(java.lang.String... names)
已过时。 use loadModels(String...) instead


loadModels

public static void loadModels(java.lang.String... names)
另请参见:
loadModels(String name)

load

public static void load(java.util.List<java.lang.String> names)
已过时。 use loadModels(String...) instead


loadModels

public static void loadModels(java.util.List<java.lang.String> names)
另请参见:
loadModels(String name)

loadYaml

public static java.lang.Object loadYaml(java.lang.String name)
Load and parse a plain YAML file and returns the corresponding Java objects. The YAML parser used is SnakeYAML (http://code.google.com/p/snakeyaml/)

参数:
name - Name of a YAML file somewhere in the classpath (or conf/)me
返回:
Java objects

loadYamlAsList

public static java.util.List<?> loadYamlAsList(java.lang.String name)
Load and parse a plain YAML file and returns the corresponding Java List. The YAML parser used is SnakeYAML (http://code.google.com/p/snakeyaml/)

参数:
name - Name of a YAML file somewhere in the classpath (or conf/)me
返回:
Java List representing the YAML data

loadYamlAsMap

public static java.util.Map<?,?> loadYamlAsMap(java.lang.String name)
Load and parse a plain YAML file and returns the corresponding Java Map. The YAML parser used is SnakeYAML (http://code.google.com/p/snakeyaml/)

参数:
name - Name of a YAML file somewhere in the classpath (or conf/)me
返回:
Java Map representing the YAML data

loadYaml

public static <T> T loadYaml(java.lang.String name,
                             java.lang.Class<T> clazz)
Load and parse a plain YAML file and returns the corresponding Java Map. The YAML parser used is SnakeYAML (http://code.google.com/p/snakeyaml/)

参数:
name - Name of a YAML file somewhere in the classpath (or conf/)me
clazz - the expected class
返回:
Object representing the YAML data

loadYaml

public static <T> T loadYaml(java.lang.String name,
                             org.yaml.snakeyaml.Yaml yaml)

deleteDirectory

public static void deleteDirectory(java.lang.String path)
Delete a directory recursively

参数:
path - relative path of the directory to delete


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly