当前位置: 首页>>代码示例>>Java>>正文


Java Helpers.fakeApplication方法代码示例

本文整理汇总了Java中play.test.Helpers.fakeApplication方法的典型用法代码示例。如果您正苦于以下问题:Java Helpers.fakeApplication方法的具体用法?Java Helpers.fakeApplication怎么用?Java Helpers.fakeApplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在play.test.Helpers的用法示例。


在下文中一共展示了Helpers.fakeApplication方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
  //createtableList();
  Util.checkCassandraDbConnections(JsonKey.SUNBIRD_PLUGIN);
  entityName = "announcement";
  app = Helpers.fakeApplication();
  Helpers.start(app);
  headerMap = new HashMap<String, String[]>();
  headerMap.put(HeaderParam.X_Consumer_ID.getName(), new String[]{"Service test consumer"});
  headerMap.put(HeaderParam.X_Device_ID.getName(), new String[]{"Some Device Id"});
  headerMap.put(HeaderParam.X_Authenticated_Userid.getName(), new String[]{"Authenticated user id"});
  headerMap.put(JsonKey.MESSAGE_ID, new String[]{"Unique Message id"});

  system = ActorSystem.create("system");
  ActorRef subject = system.actorOf(props);
  BaseController.setActorRef(subject);
}
 
开发者ID:project-sunbird,项目名称:sunbird-lms-service,代码行数:18,代码来源:DbOperationControllerTest.java

示例2: setUp

import play.test.Helpers; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    // Unfortunately we need to restart for each test because there is some weird issue with question id sequence.
    // Ebean allocates us duplicate PKs eventually unless server is recreated in between. This is either a bug with
    // Ebean (batching) or an issue with our question entity JPA mappings.
    app = Helpers.fakeApplication();
    Helpers.start(app);
    cleanDB();
    Database db = getDB();
    Evolutions.applyEvolutions(db);
    cleanEvolvedTables(db);
    db.shutdown();

    addTestData();

    onBeforeLogin();

    Method testMethod = getClass().getDeclaredMethod(currentTest.getMethodName());
    if (testMethod.isAnnotationPresent(RunAsStudent.class)) {
        loginAsStudent();
    } else if (testMethod.isAnnotationPresent(RunAsTeacher.class)) {
        loginAsTeacher();
    } else if (testMethod.isAnnotationPresent(RunAsAdmin.class)) {
        loginAsAdmin();
    }
}
 
开发者ID:CSCfi,项目名称:exam,代码行数:27,代码来源:IntegrationTestCase.java

示例3: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
    app = Helpers.fakeApplication();
    Helpers.start(app);
       headerMap = new HashMap<String, String[]>();
       headerMap.put(HeaderParam.X_Consumer_ID.getName(), new String[]{"Service test consumer"});
       headerMap.put(HeaderParam.X_Device_ID.getName(), new String[]{"Some Device Id"});
       headerMap.put(HeaderParam.X_Authenticated_Userid.getName(), new String[]{"Authenticated user id"});
       headerMap.put(JsonKey.MESSAGE_ID, new String[]{"Unique Message id"});
}
 
开发者ID:project-sunbird,项目名称:sunbird-lms-service,代码行数:11,代码来源:IntegrationTest.java

示例4: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
  app = Helpers.fakeApplication();
  Helpers.start(app);
  headerMap = new HashMap<String, String[]>();
  headerMap.put(HeaderParam.X_Consumer_ID.getName(), new String[]{"Service test consumer"});
  headerMap.put(HeaderParam.X_Device_ID.getName(), new String[]{"Some Device Id"});
  headerMap.put(HeaderParam.X_Authenticated_Userid.getName(), new String[]{"Authenticated user id"});
  headerMap.put(JsonKey.MESSAGE_ID, new String[]{"Unique Message id"});

  system = ActorSystem.create("system");
  ActorRef subject = system.actorOf(props);
  BaseController.setActorRef(subject);
}
 
开发者ID:project-sunbird,项目名称:sunbird-lms-service,代码行数:15,代码来源:OrganisationControllerTest.java

示例5: initializeRedisModule

import play.test.Helpers; //导入方法依赖的package包/类
/**
 * Initialize Redis module.
 *
 * @since 17.06.26
 */
@Before
public void initializeRedisModule() {
    if (this.playRedis == null) {
        this.application = Helpers.
            fakeApplication(new HashMap<String, Object>() {{
                put(
                    "play.modules.disabled",
                    Collections.singletonList(
                        "com.zero_x_baadf00d.play.module.redis.PlayRedisModule"
                    )
                );
                put("redis.host", "127.0.0.1");
                put("redis.port", 6379);
                put("redis.password", "false-password");
            }});
        Assert.assertEquals(
            "false-password",
            this.application.config().getString("redis.password")
        );
        this.playRedis = new PlayRedisImpl(
            mock(ApplicationLifecycle.class),
            this.application.config()
        );
        Assert.assertNotEquals(null, this.playRedis);
    }
}
 
开发者ID:0xbaadf00d,项目名称:play-redis-module,代码行数:32,代码来源:RedisConnFailTest.java

示例6: start

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void start() {
    app = Helpers.fakeApplication();

    Helpers.start(app);
    transactionTestService = TestUtils.instanceOf(app, TransactionTestService.class);
}
 
开发者ID:XenonAbe,项目名称:dbflute-play-guice-java-example,代码行数:8,代码来源:TransactionTest.java

示例7: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
    try {
        app = Helpers.fakeApplication(inMemoryDatabase());
        start(app);
    } catch (Exception e) {
        Logger.error("Unable to start app: {}", e.getMessage());
        e.printStackTrace();
    }
}
 
开发者ID:fmaturel,项目名称:PlayTraining,代码行数:11,代码来源:PersistenceTest.java

示例8: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
    try {
        app = Helpers.fakeApplication(inMemoryDatabase("IntegrationTest"));
        start(app);
    } catch (Exception e) {
        Logger.error("Unable to start app: {}", e.getMessage());
        e.printStackTrace();
    }
}
 
开发者ID:fmaturel,项目名称:PlayTraining,代码行数:11,代码来源:IntegrationTest.java

示例9: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
    try {
        app = Helpers.fakeApplication(inMemoryDatabase("ControllerTest"));
        start(app);
    } catch (Exception e) {
        Logger.error("Unable to start app: {}", e.getMessage());
        e.printStackTrace();
    }
}
 
开发者ID:fmaturel,项目名称:PlayTraining,代码行数:11,代码来源:ControllerTest.java

示例10: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
    try {
        app = Helpers.fakeApplication();
    } catch (Exception e) {
        Logger.error("Unable to start app: {}", e.getMessage());
        e.printStackTrace();
    }
}
 
开发者ID:fmaturel,项目名称:PlayTraining,代码行数:10,代码来源:StockTest.java

示例11: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
	
	System.out.println("=========================================================");
	System.out.println("                -------------------------");
	System.out.println("                    APPLICATION TEST");
	System.out.println("                -------------------------");
	
    app = Helpers.fakeApplication();
    Helpers.start(app);
}
 
开发者ID:IDgis,项目名称:geo-publisher,代码行数:12,代码来源:ApplicationTest.java

示例12: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {

	Config additionalConfig = ConfigFactory.parseFile(new File("conf/testes.conf"));
	additionalConfigurations = new Configuration(additionalConfig);
	System.out.println(additionalConfigurations.asMap());

	app = Helpers.fakeApplication(additionalConfigurations.asMap());

	Helpers.start(app);
}
 
开发者ID:boaglio,项目名称:play2-casadocodigo,代码行数:12,代码来源:DatabaseTest.java

示例13: startFakeApplication

import play.test.Helpers; //导入方法依赖的package包/类
/**
 * Initialisiert eine {@link FakeApplication} mit InMemory-DB.
 */
@BeforeClass
public static void startFakeApplication() {

	fakeApplication = Helpers.fakeApplication(Helpers.inMemoryDatabase());
	Helpers.start(fakeApplication);
}
 
开发者ID:stefanil,项目名称:play2-prototypen,代码行数:10,代码来源:BaseModelTest.java

示例14: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@Before
public void startApp() throws Exception {
  app = Helpers.fakeApplication(Helpers.inMemoryDatabase());
  Helpers.start(app);
}
 
开发者ID:linkedin,项目名称:dr-elephant,代码行数:6,代码来源:InfoExtractorTest.java

示例15: startApp

import play.test.Helpers; //导入方法依赖的package包/类
@BeforeClass
public static void startApp() {
  app = Helpers.fakeApplication(Helpers.inMemoryDatabase());
  Helpers.start(app);
}
 
开发者ID:linkedin,项目名称:dr-elephant,代码行数:6,代码来源:ApplicationTest.java


注:本文中的play.test.Helpers.fakeApplication方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。