Skip to content

Commit

Permalink
Cleaning up model Util, refined schema tests in model-impl
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Mar 10, 2016
1 parent d344356 commit c8edcd5
Show file tree
Hide file tree
Showing 11 changed files with 515 additions and 46 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2013 Evolveum
* Copyright (c) 2010-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -66,6 +66,10 @@ private LayerRefinedResourceSchema(RefinedResourceSchema refinedResourceSchema,
this.layer = layer;
}

public LayerType getLayer() {
return layer;
}

static LayerRefinedResourceSchema wrap(RefinedResourceSchema rSchema, LayerType layer) {
return new LayerRefinedResourceSchema(rSchema, layer);
}
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2015 Evolveum
* Copyright (c) 2010-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -81,6 +81,7 @@

/**
* @author lazyman
* @author semancik
*/
public final class Utils {

Expand All @@ -91,37 +92,6 @@ public final class Utils {
private Utils() {
}

// inefficient (does not make use of LensContext resource cache)
// and seemingly not used at all => commenting out before deleting forever
// public static void resolveResource(ShadowType shadow, ProvisioningService provisioning,
// OperationResult result) throws CommunicationException, SchemaException, ObjectNotFoundException, ConfigurationException,
// SecurityViolationException {
//
// Validate.notNull(shadow, "Resource object shadow must not be null.");
// Validate.notNull(provisioning, "Provisioning service must not be null.");
//
// ResourceType resource = getResource(shadow, provisioning, result);
// shadow.setResourceRef(null);
// shadow.setResource(resource);
// }
//
// public static ResourceType getResource(ShadowType shadow, ProvisioningService provisioning,
// OperationResult result) throws CommunicationException, SchemaException, ObjectNotFoundException, ConfigurationException,
// SecurityViolationException {
//
// if (shadow.getResource() != null) {
// return shadow.getResource();
// }
//
// if (shadow.getResourceRef() == null) {
// throw new IllegalArgumentException("Couldn't resolve resource. Resource object shadow doesn't" +
// " contain resource nor resource ref.");
// }
//
// ObjectReferenceType resourceRef = shadow.getResourceRef();
// return provisioning.getObject(ResourceType.class, resourceRef.getOid(), null, null, result).asObjectable();
// }

@Deprecated // use RepositoryService.objectSearchIterative instead
public static <T extends ObjectType> void searchIterative(RepositoryService repositoryService, Class<T> type, ObjectQuery query,
Handler<PrismObject<T>> handler, int blockSize, OperationResult opResult) throws SchemaException {
Expand Down Expand Up @@ -367,8 +337,8 @@ public static ObjectClassComplexTypeDefinition determineObjectClass(RefinedResou
return determineObjectClassInternal(refinedSchema, objectclass, kind, intent, task);
}

public static ObjectClassComplexTypeDefinition determineObjectClass(RefinedResourceSchema refinedSchema, PrismObject<ShadowType> shadowToImport) throws SchemaException {
ShadowType s = shadowToImport.asObjectable();
public static ObjectClassComplexTypeDefinition determineObjectClass(RefinedResourceSchema refinedSchema, PrismObject<ShadowType> shadow) throws SchemaException {
ShadowType s = shadow.asObjectable();
return determineObjectClassInternal(refinedSchema, s.getObjectClass(), s.getKind(), s.getIntent(), s);
}

Expand Down
Expand Up @@ -143,7 +143,9 @@ public class AbstractInternalModelIntegrationTest extends AbstractModelIntegrati

public static final File RESOURCE_DUMMY_FILE = new File(COMMON_DIR, "resource-dummy.xml");
public static final String RESOURCE_DUMMY_OID = "10000000-0000-0000-0000-000000000004";
public static final String RESOURCE_DUMMY_NAMESPACE = "http://midpoint.evolveum.com/xml/ns/public/resource/instance/10000000-0000-0000-0000-000000000004";
public static final String RESOURCE_DUMMY_NAMESPACE = MidPointConstants.NS_RI;
public static final QName RESOURCE_DUMMY_ACCOUNT_OBJECTCLASS_QNAME = new QName(RESOURCE_DUMMY_NAMESPACE, "AccountObjectClass");
public static final QName RESOURCE_DUMMY_PRIVILEGE_OBJECTCLASS_QNAME = new QName(RESOURCE_DUMMY_NAMESPACE, "CustomprivilegeObjectClass");

public static final File USER_TEMPLATE_FILE = new File(COMMON_DIR, "user-template.xml");
public static final String USER_TEMPLATE_OID = "10000000-0000-0000-0000-000000000002";
Expand Down

0 comments on commit c8edcd5

Please sign in to comment.