/* * Copyright (c) 2010-2015 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.evolveum.midpoint.model.intest.sync; import com.evolveum.icf.dummy.resource.DummySyncStyle; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.springframework.test.context.ContextConfiguration; import java.io.FileNotFoundException; /** * @author semancik * @author mederly * */ @ContextConfiguration(locations = {"classpath:ctx-model-intest-test-main.xml"}) @DirtiesContext(classMode = ClassMode.AFTER_CLASS) public class TestObjTemplateLiveSyncTask extends AbstractObjTemplateSyncTest { @Override public void initSystem(Task initTask, OperationResult initResult) throws Exception { super.initSystem(initTask, initResult); dummyResourceByzantine.setSyncStyle(DummySyncStyle.SMART); } @Override protected void importSyncTask(PrismObject<ResourceType> resource) throws FileNotFoundException { if (resource == resourceDummyByzantine) { importObjectFromFile(TASK_LIVE_SYNC_DUMMY_BYZANTINE_FILE); } else { throw new IllegalArgumentException("Unknown resource "+resource); } } @Override protected String getSyncTaskOid(PrismObject<ResourceType> resource) { if (resource == resourceDummyByzantine) { return TASK_LIVE_SYNC_DUMMY_BYZANTINE_OID; } else { throw new IllegalArgumentException("Unknown resource "+resource); } } }