本文整理汇总了Java中de.espirit.firstspirit.agency.BrokerAgent类的典型用法代码示例。如果您正苦于以下问题:Java BrokerAgent类的具体用法?Java BrokerAgent怎么用?Java BrokerAgent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BrokerAgent类属于de.espirit.firstspirit.agency包,在下文中一共展示了BrokerAgent类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: requireProjectSpecificBroker
import de.espirit.firstspirit.agency.BrokerAgent; //导入依赖的package包/类
private void requireProjectSpecificBroker() {
LOGGER.debug("Require project specific specialist broker for project '{}'...", clientConfig.getProject());
String name;
try {
final Project project = getProject();
name = project != null ? project.getName() : null;
} catch (Exception e) { //NOSONAR
throw new IllegalStateException(
"Project '" + clientConfig.getProject() + "' not found on server. Correct project name or omit --dont-create-project option.", e);
}
if (StringUtils.isNotBlank(name)) {
final SpecialistsBroker broker = connection.getBroker();
final BrokerAgent brokerAgent = broker.requireSpecialist(BrokerAgent.TYPE);
projectBroker = brokerAgent.getBrokerByProjectName(name);
}
if (projectBroker == null) {
throw new IllegalStateException("ProjectBroker cannot be retrieved for project " + name + ". Wrong project name?");
}
}
示例2: setUp
import de.espirit.firstspirit.agency.BrokerAgent; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
final Connection connection = testling.getConnection();
when(connection.getBroker()).thenReturn(broker);
when(broker.requireSpecialist(BrokerAgent.TYPE)).thenReturn(brokerAgent);
}
示例3: setUp
import de.espirit.firstspirit.agency.BrokerAgent; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
clientConfig = mock(ImportConfig.class);
when(clientConfig.getHost()).thenReturn("host");
when(clientConfig.getPort()).thenReturn(1234);
when(clientConfig.getUser()).thenReturn("horst");
when(clientConfig.getProject()).thenReturn("myProject");
when(clientConfig.getSynchronizationDirectoryString()).thenReturn("dir");
when(clientConfig.getConnectionMode()).thenReturn(FsConnectionMode.HTTP);
final List<UidIdentifier> uidList = new ArrayList<>();
uidList.add(new UidIdentifier(UidMapping.PAGE, "yourUID"));
uidList.add(new UidIdentifier(UidMapping.PAGE, "yourSecondUID"));
when(clientConfig.isCreatingProjectIfMissing()).thenReturn(true);
connection = mock(Connection.class);
specialistsBroker = mock(SpecialistsBroker.class);
when(connection.getBroker()).thenReturn(specialistsBroker);
final AdminService adminService = mock(AdminService.class);
when(connection.getService(AdminService.class)).thenReturn(adminService);
final ProjectStorage projectStorage = mock(ProjectStorage.class);
when(adminService.getProjectStorage()).thenReturn(projectStorage);
final Project project = mock(Project.class);
final String projectName = clientConfig.getProject();
when(connection.getProjectByName(projectName)).thenReturn(project);
when(project.getName()).thenReturn(projectName);
when(projectStorage.createProject(projectName, projectName + " created by fs-filesync")).thenReturn(project);
final BrokerAgent brokerAgent = mock(BrokerAgent.class);
when(specialistsBroker.requireSpecialist(BrokerAgent.TYPE)).thenReturn(brokerAgent);
when(brokerAgent.getBrokerByProjectName(any())).thenReturn(specialistsBroker);
final LanguageAgent agent = mock(LanguageAgent.class);
when(specialistsBroker.requireSpecialist(LanguageAgent.TYPE)).thenReturn(agent);
when(specialistsBroker.requestSpecialist(LanguageAgent.TYPE)).thenReturn(agent);
testling = new TestContext(clientConfig);
assertAppender = new AssertAppender();
}
示例4: getBaseContextForCurrentProject
import de.espirit.firstspirit.agency.BrokerAgent; //导入依赖的package包/类
/**
* Gets base context for the current project.
*
* @param projectName the project name
* @return the base context for the current project
*/
public BaseContext getBaseContextForCurrentProject(final String projectName) {
final BrokerAgent brokerAgent = requireSpecialist(BrokerAgent.TYPE);
final SpecialistsBroker specialistsBrokerByProject = brokerAgent.getBrokerByProjectName(projectName);
return new TestContext(specialistsBrokerByProject);
}
示例5: getGenerationContextForCurrentProject
import de.espirit.firstspirit.agency.BrokerAgent; //导入依赖的package包/类
/**
* Gets generation context for current project.
*
* @param projectName the project name
* @return the generation context for current project
*/
public GenerationContext getGenerationContextForCurrentProject(final String projectName) {
final BrokerAgent brokerAgent = requireSpecialist(BrokerAgent.TYPE);
final SpecialistsBroker specialistsBrokerByProject = brokerAgent.getBrokerByProjectName(projectName);
return new TestGenerationContext(specialistsBrokerByProject);
}