本文整理汇总了Java中org.opends.server.util.EmbeddedUtils类的典型用法代码示例。如果您正苦于以下问题:Java EmbeddedUtils类的具体用法?Java EmbeddedUtils怎么用?Java EmbeddedUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EmbeddedUtils类属于org.opends.server.util包,在下文中一共展示了EmbeddedUtils类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stop
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
/**
* Stop the embedded OpenDS server.
*
*/
public void stop() {
if (EmbeddedUtils.isRunning()) {
LOGGER.debug("Stopping OpenDJ server");
EmbeddedUtils.stopServer(this.getClass().getName(), Message.EMPTY);
LOGGER.info("OpenDJ server is stopped");
} else {
LOGGER.warn("Attempt to stop OpenDJ server that is already stopped.");
}
}
示例2: test200StopOpenDj
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
@Test
public void test200StopOpenDj() throws Exception {
final String TEST_NAME = "test200StopOpenDj";
TestUtil.displayTestTile(TEST_NAME);
openDJController.stop();
assertEquals("Resource is running", false, EmbeddedUtils.isRunning());
}
示例3: stop
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
/**
* Stop the embedded OpenDS server.
*
*/
public void stop() {
if (EmbeddedUtils.isRunning()) {
LOGGER.debug("Stopping OpenDJ server");
EmbeddedUtils.stopServer(this.getClass().getName(), Message.EMPTY);
LOGGER.info("OpenDJ server is stopped");
} else {
LOGGER.warn("Attempt to stop OpenDJ server that is already stopped.");
}
}
示例4: test200StopOpenDj
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
@Test
public void test200StopOpenDj() throws Exception {
final String TEST_NAME = "test200StopOpenDj";
TestUtil.displayTestTitle(TEST_NAME);
openDJController.stop();
assertEquals("Resource is running", false, EmbeddedUtils.isRunning());
}
示例5: startServer
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
public void startServer() throws Exception
{
DirectoryEnvironmentConfig config = new DirectoryEnvironmentConfig();
config.setServerRoot(new File(serverRoot));
config.setForceDaemonThreads(true);
EmbeddedUtils.startServer(config );
}
示例6: isRunning
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
public boolean isRunning() {
return EmbeddedUtils.isRunning();
}
示例7: test400GetDiscoveryAddCommunicationProblemAlreadyExists
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
@Test(enabled = false)
public void test400GetDiscoveryAddCommunicationProblemAlreadyExists() throws Exception{
final String TEST_NAME = "test400GetDiscoveryAddCommunicationProblemAlreadyExists";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
openDJController.assumeStopped();
OperationResult parentResult = new OperationResult(TEST_NAME);
repoAddObjectFromFile(USER_DISCOVERY_FILENAME, parentResult);
assertUserNoAccountRef(USER_DISCOVERY_OID, parentResult);
Task task = taskManager.createTaskInstance();
//REQUEST_USER_MODIFY_ADD_ACCOUNT_COMMUNICATION_PROBLEM
requestToExecuteChanges(REQUEST_USER_MODIFY_ASSIGN_ACCOUNT, USER_DISCOVERY_OID, UserType.class, task, null, parentResult);
parentResult.computeStatus();
display("add object communication problem result: ", parentResult);
assertEquals("Expected success but got: " + parentResult.getStatus(), OperationResultStatus.HANDLED_ERROR, parentResult.getStatus());
String accountOid = assertUserOneAccountRef(USER_DISCOVERY_OID);
openDJController.start();
assertTrue(EmbeddedUtils.isRunning());
Entry entry = openDJController.addEntryFromLdifFile(LDIF_DISCOVERY_FILENAME);
Entry searchResult = openDJController.searchByUid("discovery");
OpenDJController.assertAttribute(searchResult, "l", "Caribbean");
OpenDJController.assertAttribute(searchResult, "givenName", "discovery");
OpenDJController.assertAttribute(searchResult, "sn", "discovery");
OpenDJController.assertAttribute(searchResult, "cn", "discovery");
OpenDJController.assertAttribute(searchResult, "mail", "[email protected]");
String dn = searchResult.getDN().toString();
assertEquals("DN attribute " + dn + " not equals", dn, "uid=discovery,ou=people,dc=example,dc=com");
modifyResourceAvailabilityStatus(AvailabilityStatusType.UP, parentResult);
modelService.getObject(ShadowType.class, accountOid, null, task, parentResult);
}
示例8: test800Reconciliation
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
@Test
public void test800Reconciliation() throws Exception {
final String TEST_NAME = "test800Reconciliation";
displayTestTile(TEST_NAME);
openDJController.assumeRunning();
final OperationResult result = new OperationResult(ConsistencyTest.class.getName() + "." + TEST_NAME);
// TODO: remove this if the previous test is enabled
// openDJController.start();
// rename eobject dirrectly on resource before the recon start ..it tests the rename + recon situation (MID-1594)
// precondition
assertTrue(EmbeddedUtils.isRunning());
UserType userJack = repositoryService.getObject(UserType.class, USER_JACK_OID, null, result).asObjectable();
display("Jack before", userJack);
LOGGER.info("start running task");
// WHEN
repoAddObjectFromFile(TASK_OPENDJ_RECONCILIATION_FILENAME, result);
verbose = true;
long started = System.currentTimeMillis();
waitForTaskNextRunAssertSuccess(TASK_OPENDJ_RECONCILIATION_OID, false, 120000);
LOGGER.info("Reconciliation task run took {} seconds", (System.currentTimeMillis()-started)/1000L);
// THEN
// STOP the task. We don't need it any more. Even if it's non-recurrent its safer to delete it
taskManager.deleteTask(TASK_OPENDJ_RECONCILIATION_OID, result);
// check if the account was added after reconciliation
UserType userE = repositoryService.getObject(UserType.class, USER_E_OID, null, result).asObjectable();
String accountOid = assertUserOneAccountRef(USER_E_OID);
ShadowType eAccount = checkNormalizedShadowWithAttributes(accountOid, "e", "Jackkk", "e", "e", true, null, result);
assertAttribute(eAccount, "employeeNumber", "emp4321");
ResourceAttributeContainer attributeContainer = ShadowUtil
.getAttributesContainer(eAccount);
Collection<ResourceAttribute<?>> identifiers = attributeContainer.getPrimaryIdentifiers();
assertNotNull(identifiers);
assertFalse(identifiers.isEmpty());
assertEquals(1, identifiers.size());
// check if the account was modified during reconciliation process
String jackAccountOid = assertUserOneAccountRef(USER_JACK_OID);
ShadowType modifiedAccount = checkNormalizedShadowBasic(jackAccountOid, "jack", true, SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), null, result);
assertAttribute(modifiedAccount, "givenName", "Jackkk");
assertAttribute(modifiedAccount, "employeeNumber", "emp4321");
// check if the account was deleted during the reconciliation process
try {
modelService.getObject(ShadowType.class, ACCOUNT_DENIELS_OID, null, null, result);
fail("Expected ObjectNotFoundException but haven't got one.");
} catch (Exception ex) {
if (!(ex instanceof ObjectNotFoundException)) {
fail("Expected ObjectNotFoundException but got " + ex);
}
}
String elaineAccountOid = assertUserOneAccountRef(USER_ELAINE_OID);
modifiedAccount = checkNormalizedShadowBasic(elaineAccountOid, "elaine", true, SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), null, result);
assertAttribute(modifiedAccount, getOpenDjSecondaryIdentifierQName(), "uid=elaine,ou=people,dc=example,dc=com");
accountOid = assertUserOneAccountRef(USER_JACK2_OID);
ShadowType jack2Shadow = checkNormalizedShadowBasic(accountOid, "jack2", true, SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), null, result);
assertAttribute(jack2Shadow, "givenName", "jackNew2a");
assertAttribute(jack2Shadow, "cn", "jackNew2a");
}
示例9: test400GetDiscoveryAddCommunicationProblemAlreadyExists
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
@Test(enabled = false)
public void test400GetDiscoveryAddCommunicationProblemAlreadyExists() throws Exception{
final String TEST_NAME = "test400GetDiscoveryAddCommunicationProblemAlreadyExists";
TestUtil.displayTestTitle(TEST_NAME);
// GIVEN
openDJController.assumeStopped();
OperationResult parentResult = new OperationResult(TEST_NAME);
repoAddObjectFromFile(USER_DISCOVERY_FILENAME, parentResult);
assertUserNoAccountRef(USER_DISCOVERY_OID, parentResult);
Task task = taskManager.createTaskInstance();
//REQUEST_USER_MODIFY_ADD_ACCOUNT_COMMUNICATION_PROBLEM
requestToExecuteChanges(REQUEST_USER_MODIFY_ASSIGN_ACCOUNT, USER_DISCOVERY_OID, UserType.class, task, null, parentResult);
parentResult.computeStatus();
display("add object communication problem result: ", parentResult);
assertEquals("Expected success but got: " + parentResult.getStatus(), OperationResultStatus.HANDLED_ERROR, parentResult.getStatus());
String accountOid = assertUserOneAccountRef(USER_DISCOVERY_OID);
openDJController.start();
assertTrue(EmbeddedUtils.isRunning());
Entry entry = openDJController.addEntryFromLdifFile(LDIF_DISCOVERY_FILENAME);
Entry searchResult = openDJController.searchByUid("discovery");
OpenDJController.assertAttribute(searchResult, "l", "Caribbean");
OpenDJController.assertAttribute(searchResult, "givenName", "discovery");
OpenDJController.assertAttribute(searchResult, "sn", "discovery");
OpenDJController.assertAttribute(searchResult, "cn", "discovery");
OpenDJController.assertAttribute(searchResult, "mail", "[email protected]");
String dn = searchResult.getDN().toString();
assertEquals("DN attribute " + dn + " not equals", dn, "uid=discovery,ou=people,dc=example,dc=com");
modifyResourceAvailabilityStatus(AvailabilityStatusType.UP, parentResult);
modelService.getObject(ShadowType.class, accountOid, null, task, parentResult);
}
示例10: test800Reconciliation
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
@Test
public void test800Reconciliation() throws Exception {
final String TEST_NAME = "test800Reconciliation";
displayTestTitle(TEST_NAME);
openDJController.assumeRunning();
final OperationResult result = new OperationResult(ConsistencyTest.class.getName() + "." + TEST_NAME);
// TODO: remove this if the previous test is enabled
// openDJController.start();
// rename eobject dirrectly on resource before the recon start ..it tests the rename + recon situation (MID-1594)
// precondition
assertTrue(EmbeddedUtils.isRunning());
UserType userJack = repositoryService.getObject(UserType.class, USER_JACK_OID, null, result).asObjectable();
display("Jack before", userJack);
LOGGER.info("start running task");
// WHEN
repoAddObjectFromFile(TASK_OPENDJ_RECONCILIATION_FILENAME, result);
verbose = true;
long started = System.currentTimeMillis();
waitForTaskNextRunAssertSuccess(TASK_OPENDJ_RECONCILIATION_OID, false, 120000);
LOGGER.info("Reconciliation task run took {} seconds", (System.currentTimeMillis()-started)/1000L);
// THEN
// STOP the task. We don't need it any more. Even if it's non-recurrent its safer to delete it
taskManager.deleteTask(TASK_OPENDJ_RECONCILIATION_OID, result);
// check if the account was added after reconciliation
UserType userE = repositoryService.getObject(UserType.class, USER_E_OID, null, result).asObjectable();
String accountOid = assertUserOneAccountRef(USER_E_OID);
ShadowType eAccount = checkNormalizedShadowWithAttributes(accountOid, "e", "Jackkk", "e", "e", true, null, result);
assertAttribute(eAccount, "employeeNumber", "emp4321");
ResourceAttributeContainer attributeContainer = ShadowUtil
.getAttributesContainer(eAccount);
Collection<ResourceAttribute<?>> identifiers = attributeContainer.getPrimaryIdentifiers();
assertNotNull(identifiers);
assertFalse(identifiers.isEmpty());
assertEquals(1, identifiers.size());
// check if the account was modified during reconciliation process
String jackAccountOid = assertUserOneAccountRef(USER_JACK_OID);
ShadowType modifiedAccount = checkNormalizedShadowBasic(jackAccountOid, "jack", true, SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), null, result);
assertAttribute(modifiedAccount, "givenName", "Jackkk");
assertAttribute(modifiedAccount, "employeeNumber", "emp4321");
// check if the account was deleted during the reconciliation process
try {
modelService.getObject(ShadowType.class, ACCOUNT_DENIELS_OID, null, null, result);
fail("Expected ObjectNotFoundException but haven't got one.");
} catch (Exception ex) {
if (!(ex instanceof ObjectNotFoundException)) {
fail("Expected ObjectNotFoundException but got " + ex);
}
}
String elaineAccountOid = assertUserOneAccountRef(USER_ELAINE_OID);
modifiedAccount = checkNormalizedShadowBasic(elaineAccountOid, "elaine", true, SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), null, result);
assertAttribute(modifiedAccount, getOpenDjSecondaryIdentifierQName(), "uid=elaine,ou=people,dc=example,dc=com");
accountOid = assertUserOneAccountRef(USER_JACK2_OID);
ShadowType jack2Shadow = checkNormalizedShadowBasic(accountOid, "jack2", true, SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), null, result);
assertAttribute(jack2Shadow, "givenName", "jackNew2a");
assertAttribute(jack2Shadow, "cn", "jackNew2a");
}
示例11: stopServer
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
public void stopServer() throws Exception
{
if(EmbeddedUtils.isRunning())
EmbeddedUtils.stopServer(getClass().getName(), Message.EMPTY);
}
示例12: isRunning
import org.opends.server.util.EmbeddedUtils; //导入依赖的package包/类
public boolean isRunning()
{
return EmbeddedUtils.isRunning();
}