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


Java ServerRuntime.shutdown方法代码示例

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


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

示例1: testCreateCayenneRuntime_NoName

import org.apache.cayenne.configuration.server.ServerRuntime; //导入方法依赖的package包/类
@Test
public void testCreateCayenneRuntime_NoName() {
	ServerRuntimeFactory factory = new ServerRuntimeFactory();
	factory.setDatasource("ds1");

	ServerRuntime runtime = factory.createCayenneRuntime(mockDSFactory, Collections.emptyList());
	try {
		DataDomain domain = runtime.getDataDomain();
		assertEquals("cayenne", domain.getName());

		assertEquals(1, domain.getDataNodes().size());
		assertNotNull(domain.getDefaultNode());
		assertEquals("cayenne", domain.getDefaultNode().getName());

	} finally {
		runtime.shutdown();
	}
}
 
开发者ID:bootique,项目名称:bootique-cayenne,代码行数:19,代码来源:ServerRuntimeFactoryTest.java

示例2: testCreateCayenneRuntime_Name

import org.apache.cayenne.configuration.server.ServerRuntime; //导入方法依赖的package包/类
@Test
public void testCreateCayenneRuntime_Name() {
	ServerRuntimeFactory factory = new ServerRuntimeFactory();
	factory.setConfigs(asList("cayenne-project1.xml"));
	factory.setDatasource("ds1");
	factory.setName("me");

	ServerRuntime runtime = factory.createCayenneRuntime(mockDSFactory, Collections.emptyList());
	try {

		DataDomain domain = runtime.getDataDomain();
		assertEquals("me", domain.getName());

		assertEquals(1, domain.getDataNodes().size());
		assertNotNull(domain.getDefaultNode());
		assertEquals("me", domain.getDefaultNode().getName());

	} finally {
		runtime.shutdown();
	}
}
 
开发者ID:bootique,项目名称:bootique-cayenne,代码行数:22,代码来源:ServerRuntimeFactoryTest.java

示例3: testCreateCayenneRuntime_Configs

import org.apache.cayenne.configuration.server.ServerRuntime; //导入方法依赖的package包/类
@Test
public void testCreateCayenneRuntime_Configs() {
	ServerRuntimeFactory factory = new ServerRuntimeFactory();
	factory.setDatasource("ds1");
	factory.setConfigs(asList("cayenne-project2.xml", "cayenne-project1.xml"));

	ServerRuntime runtime = factory.createCayenneRuntime(mockDSFactory, Collections.emptyList());
	try {

		DataDomain domain = runtime.getDataDomain();
		assertNotNull(domain.getEntityResolver().getDbEntity("db_entity"));
		assertNotNull(domain.getEntityResolver().getDbEntity("db_entity2"));

	} finally {
		runtime.shutdown();
	}
}
 
开发者ID:bootique,项目名称:bootique-cayenne,代码行数:18,代码来源:ServerRuntimeFactoryTest.java

示例4: testCreateCayenneRuntime_NoConfig

import org.apache.cayenne.configuration.server.ServerRuntime; //导入方法依赖的package包/类
@Test
public void testCreateCayenneRuntime_NoConfig() {
	ServerRuntimeFactory factory = new ServerRuntimeFactory();
	factory.setDatasource("ds1");

	ServerRuntime runtime = factory.createCayenneRuntime(mockDSFactory, Collections.emptyList());
	try {

		DataDomain domain = runtime.getDataDomain();
		assertTrue(domain.getEntityResolver().getDbEntities().isEmpty());

	} finally {
		runtime.shutdown();
	}
}
 
开发者ID:bootique,项目名称:bootique-cayenne,代码行数:16,代码来源:ServerRuntimeFactoryTest.java

示例5: testListeners

import org.apache.cayenne.configuration.server.ServerRuntime; //导入方法依赖的package包/类
@Test
public void testListeners() {

    L1 l1 = new L1();

    CayenneDataObject o1 = new CayenneDataObject();
    o1.setObjectId(new ObjectId("T1"));
    o1.writeProperty("name", "n" + 1);

    CayenneDataObject o2 = new CayenneDataObject();
    o2.setObjectId(new ObjectId("T1"));
    o2.writeProperty("name", "n" + 2);

    ServerRuntime runtime = runtimeWithListeners(l1);
    try {
        ObjectContext c = runtime.newContext();
        c.registerNewObject(o1);
        c.registerNewObject(o2);
        c.commitChanges();

    } finally {
        runtime.shutdown();
    }

    assertEquals(2, l1.postPersisted.size());
    assertTrue(l1.postPersisted.contains(o1));
    assertTrue(l1.postPersisted.contains(o2));
}
 
开发者ID:bootique,项目名称:bootique-cayenne,代码行数:29,代码来源:CayenneModule_ListenersIT.java

示例6: testFilters

import org.apache.cayenne.configuration.server.ServerRuntime; //导入方法依赖的package包/类
@Test
public void testFilters() {

    DataChannelFilter f = mock(DataChannelFilter.class);
    when(f.onSync(any(), any(), anyInt(), any())).thenReturn(mock(GraphDiff.class));

    CayenneDataObject o1 = new CayenneDataObject();
    o1.setObjectId(new ObjectId("T1"));
    o1.writeProperty("name", "n" + 1);

    CayenneDataObject o2 = new CayenneDataObject();
    o2.setObjectId(new ObjectId("T1"));
    o2.writeProperty("name", "n" + 2);

    ServerRuntime runtime = runtimeWithFilters(f);
    try {
        ObjectContext c = runtime.newContext();
        c.registerNewObject(o1);
        c.registerNewObject(o2);
        c.commitChanges();

    } finally {
        runtime.shutdown();
    }

    verify(f).onSync(any(), any(), anyInt(), any());
}
 
开发者ID:bootique,项目名称:bootique-cayenne,代码行数:28,代码来源:CayenneModule_ListenersIT.java


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