use of com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType in project midpoint by Evolveum.
the class TestBrokenResources method test221GetResourceNotFoundResolveConnector.
@Test
public void test221GetResourceNotFoundResolveConnector() throws Exception {
final String TEST_NAME = "test221GetResourceNotFoundResolveConnector";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestBrokenResources.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(ResourceType.F_CONNECTOR_REF, GetOperationOptions.createResolve());
// WHEN
PrismObject<ResourceType> resource = modelService.getObject(ResourceType.class, RESOURCE_CSVFILE_NOTFOUND_OID, options, task, result);
// THEN
display("getObject resource", resource);
result.computeStatus();
display("getObject result", result);
assertEquals("Expected partial errror in result", OperationResultStatus.PARTIAL_ERROR, result.getStatus());
OperationResultType fetchResult = resource.asObjectable().getFetchResult();
display("resource.fetchResult", fetchResult);
assertEquals("Expected partial errror in fetchResult", OperationResultStatusType.PARTIAL_ERROR, fetchResult.getStatus());
// TODO: better asserts
assertNotNull("Null resource", resource);
assertNotNull("Connector was not resolved", resource.asObjectable().getConnector());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType in project midpoint by Evolveum.
the class TestBrokenResources method test355AddResourceWrongConnectorOidRepo.
/**
* Store directly to repo. This is not really a test, it is more like a hack to prepare
* environment for next tests.
*/
@Test
public void test355AddResourceWrongConnectorOidRepo() throws Exception {
final String TEST_NAME = "test355AddResourceWrongConnectorOidRepo";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestBrokenResources.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<ResourceType> resource = PrismTestUtil.parseObject(RESOURCE_DUMMY_WRONG_CONNECTOR_OID_FILE);
// WHEN
repositoryService.addObject(resource, null, result);
// THEN
result.computeStatus();
TestUtil.assertSuccess(result);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType in project midpoint by Evolveum.
the class TestBrokenResources method test020GetResourceBroken.
@Test
public void test020GetResourceBroken() throws Exception {
final String TEST_NAME = "test020GetResourceBroken";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = createTask(TEST_NAME);
OperationResult result = task.getResult();
// WHEN
PrismObject<ResourceType> resource = modelService.getObject(ResourceType.class, RESOURCE_CSVFILE_BROKEN_OID, null, task, result);
// THEN
display("getObject resource", resource);
result.computeStatus();
display("getObject result", result);
TestUtil.assertSuccess("getObject result", result);
OperationResultType fetchResult = resource.asObjectable().getFetchResult();
TestUtil.assertSuccess("resource.fetchResult", fetchResult);
// TODO: better asserts
assertNotNull("Null resource", resource);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType in project midpoint by Evolveum.
the class TestBrokenResources method test320GetResourceNoJars.
@Test
public void test320GetResourceNoJars() throws Exception {
final String TEST_NAME = "test320GetResourceNoJars";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestBrokenResources.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
PrismObject<ResourceType> resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_NOJARS_OID, null, task, result);
// THEN
display("getObject resource", resource);
result.computeStatus();
display("getObject result", result);
assertEquals("Expected partial errror in result", OperationResultStatus.PARTIAL_ERROR, result.getStatus());
OperationResultType fetchResult = resource.asObjectable().getFetchResult();
display("resource.fetchResult", fetchResult);
assertEquals("Expected partial errror in fetchResult", OperationResultStatusType.PARTIAL_ERROR, fetchResult.getStatus());
// TODO: better asserts
assertNotNull("Null resource", resource);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType in project midpoint by Evolveum.
the class TestBrokenResources method test358GetResourceWrongConnectorOid.
@Test
public void test358GetResourceWrongConnectorOid() throws Exception {
final String TEST_NAME = "test358GetResourceWrongConnectorOid";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestBrokenResources.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
PrismObject<ResourceType> resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_WRONG_CONNECTOR_OID_OID, null, task, result);
// THEN
display("getObject resource", resource);
result.computeStatus();
display("getObject result", result);
assertEquals("Expected partial errror in result", OperationResultStatus.PARTIAL_ERROR, result.getStatus());
OperationResultType fetchResult = resource.asObjectable().getFetchResult();
display("resource.fetchResult", fetchResult);
assertEquals("Expected partial errror in fetchResult", OperationResultStatusType.PARTIAL_ERROR, fetchResult.getStatus());
// TODO: better asserts
assertNotNull("Null resource", resource);
}
Aggregations