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


Java WebConnector.setLogStream方法代码示例

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


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

示例1: startServer

import i5.las2peer.connectors.webConnector.WebConnector; //导入方法依赖的package包/类
/**
 * Called before the tests start.
 * 
 * Sets up the node and initializes connector and users that can be used throughout the tests.
 * 
 * @throws Exception
 */
@Before
public void startServer() throws Exception {
	// start node
	node = new LocalNodeManager().newNode();
	testAgent = MockAgentFactory.getAdam();
	testAgent.unlock(testPass);
	node.storeAgent(testAgent);
	node.launch();

	ServiceAgentImpl testService = ServiceAgentImpl.createServiceAgent(testServiceClass, "a pass");
	testService.unlock("a pass");

	node.registerReceiver(testService);

	// start connector
	logStream = new ByteArrayOutputStream();

	connector = new WebConnector(true, 0, false, 0);
	connector.setLogStream(new PrintStream(logStream));
	connector.start(node);

	client = new MiniClient();
	client.setConnectorEndpoint(connector.getHttpEndpoint());
	client.setLogin(testAgent.getIdentifier(), testPass);
}
 
开发者ID:rwth-acis,项目名称:mobsos-query-visualization,代码行数:33,代码来源:ServiceTest.java

示例2: startServer

import i5.las2peer.connectors.webConnector.WebConnector; //导入方法依赖的package包/类
@Before
public void startServer() throws Exception {
	// start Node
	node = TestSuite.launchNetwork(1).get(0);

	user1 = MockAgentFactory.getAdam();
	user1.unlock(adamsPass);
	node.storeAgent(user1);

	ServiceAgentImpl testService = ServiceAgentImpl.createServiceAgent(testServiceClass, "a pass");
	testService.unlock("a pass");

	node.registerReceiver(testService);

	// start connector
	logStream = new ByteArrayOutputStream();
	connector = new WebConnector(true, HTTP_PORT, false, 1000);
	connector.setLogStream(new PrintStream(logStream));
	connector.start(node);
	Thread.sleep(1000); // wait a second for the connector to become ready

	c1 = new MiniClient();
	c1.setConnectorEndpoint(connector.getHttpEndpoint());
	c1.setLogin(user1.getIdentifier(), "adamspass");
}
 
开发者ID:rwth-acis,项目名称:mobsos-success-modeling,代码行数:26,代码来源:MonitoringDataProvisionServiceTest.java

示例3: startServer

import i5.las2peer.connectors.webConnector.WebConnector; //导入方法依赖的package包/类
/**
 * Called before the tests start.
 * 
 * Sets up the node and initializes connector and users that can be used throughout the tests.
 * 
 * @throws Exception
 */
@BeforeClass
public static void startServer() throws Exception {

	// start node
	node = new LocalNodeManager().newNode();

	user1 = MockAgentFactory.getAdam();
	user2 = MockAgentFactory.getAbel();
	user3 = MockAgentFactory.getEve();
	user1.unlock("adamspass");
	user2.unlock("abelspass");
	user3.unlock("evespass");

	Agent[] as;
	as = new Agent[] { user1, user2 };
	group1 = GroupAgentImpl.createGroupAgent(as);
	group1.unlock(user1);
	as = new Agent[] { user2, user3 };
	group2 = GroupAgentImpl.createGroupAgent(as);
	group2.unlock(user2);

	node.storeAgent(user1);
	node.storeAgent(user2);
	node.storeAgent(user3);

	node.storeAgent(group1);
	node.storeAgent(group2);

	node.launch();

	ServiceAgentImpl testService = ServiceAgentImpl.createServiceAgent(testServiceClass, "a pass");
	testService.unlock("a pass");
	node.registerReceiver(testService);

	// start connector
	logStream = new ByteArrayOutputStream();

	connector = new WebConnector(true, 0, false, 0);
	connector.setLogStream(new PrintStream(logStream));
	connector.start(node);
	Thread.sleep(1000); // wait a second for the connector to become ready

	c1 = new MiniClient();
	c1.setConnectorEndpoint(connector.getHttpEndpoint());
	c1.setLogin(user1.getIdentifier(), "adamspass");

	c2 = new MiniClient();
	c2.setConnectorEndpoint(connector.getHttpEndpoint());
	c2.setLogin(user2.getIdentifier(), "abelspass");

	c3 = new MiniClient();
	c3.setConnectorEndpoint(connector.getHttpEndpoint());
	c3.setLogin(user3.getIdentifier(), "evespass");

}
 
开发者ID:rwth-acis,项目名称:mobsos-surveys,代码行数:63,代码来源:SurveyServiceTest.java

示例4: startServer

import i5.las2peer.connectors.webConnector.WebConnector; //导入方法依赖的package包/类
/**
 * Called before the tests start.
 * 
 * Sets up the node and initializes connector and users that can be used throughout the tests.
 * 
 * @throws Exception
 */
@BeforeClass
public static void startServer() throws Exception {

	// start node
	node = new LocalNodeManager().newNode();

	user = MockAgentFactory.getAdam();

	node.storeAgent(user);

	node.launch();

	ServiceAgentImpl testService = ServiceAgentImpl.createServiceAgent(testServiceClass, "a pass");
	testService.unlock("a pass");

	node.registerReceiver(testService);

	// start connector
	logStream = new ByteArrayOutputStream();

	// connector = new WebConnector(true,HTTP_PORT,false,1000,"./etc/xmlc");
	connector = new WebConnector(true, 0, false, 0);

	connector.setLogStream(new PrintStream(logStream));

	connector.start(node);
	Thread.sleep(1000); // wait a second for the connector to become ready

	c1 = new MiniClient();
	c1.setConnectorEndpoint(connector.getHttpEndpoint());
	c1.setLogin(user.getIdentifier(), "adamspass");

	// String xml=RESTMapper.mergeXMLs(new String[]{RESTMapper.getMethodsAsXML(SurveyService.class)});
	// System.out.println(xml);

	// first delete all surveys & questionnaires
	c1.sendRequest("DELETE", "mobsos/surveys", "");
	c1.sendRequest("DELETE", "mobsos/questionnaires", "");
}
 
开发者ID:rwth-acis,项目名称:mobsos-surveys,代码行数:47,代码来源:SurveyDataFill.java


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