Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The implementation is still very fragile/incomplete: provisioning tests are failing. Moreover, RAssignment-RAssignmentExtension relation is artificially made 1:N (instead of 1:1); until appropriate hibernate annotations are found.
- Loading branch information
Showing
10 changed files
with
246 additions
and
80 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/DeleteTestSimple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2010-2018 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.repo.sql; | ||
|
||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.schema.result.OperationResult; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; | ||
import org.springframework.test.annotation.DirtiesContext; | ||
import org.springframework.test.context.ContextConfiguration; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* @author mederly | ||
*/ | ||
@ContextConfiguration(locations = {"../../../../../ctx-test.xml"}) | ||
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) | ||
public class DeleteTestSimple extends BaseSQLRepoTest { | ||
|
||
private static final Trace LOGGER = TraceManager.getTrace(DeleteTestSimple.class); | ||
|
||
@Test | ||
public void delete001() throws Exception { | ||
PrismObject<UserType> user = prismContext.parseObject(new File(FOLDER_BASIC, "user0.xml")); | ||
|
||
OperationResult result = new OperationResult("Delete Test"); | ||
String oid = repositoryService.addObject(user, null, result); | ||
LOGGER.info("*** deleteObject ***"); | ||
|
||
// Session session = open(); | ||
// CriteriaQuery<RAssignment> aQ = session.getCriteriaBuilder().createQuery(RAssignment.class); | ||
// aQ.select(aQ.from(RAssignment.class)); | ||
// List<RAssignment> aList = session.createQuery(aQ).getResultList(); | ||
// System.out.println("RAssignment: " + aList); | ||
// | ||
// CriteriaQuery<RAssignmentExtension> aeQ = session.getCriteriaBuilder().createQuery(RAssignmentExtension.class); | ||
// aeQ.select(aeQ.from(RAssignmentExtension.class)); | ||
// List<RAssignmentExtension> aeList = session.createQuery(aeQ).getResultList(); | ||
// System.out.println("RAssignmentExtension: " + aeList); | ||
// | ||
// CriteriaQuery<RAExtBoolean> aebQ = session.getCriteriaBuilder().createQuery(RAExtBoolean.class); | ||
// aebQ.select(aebQ.from(RAExtBoolean.class)); | ||
// List<RAExtBoolean> aebList = session.createQuery(aebQ).getResultList(); | ||
// System.out.println("RAExtBoolean: " + aebList); | ||
// | ||
// session.getTransaction().commit(); | ||
|
||
repositoryService.deleteObject(UserType.class, oid, result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
repo/repo-sql-impl-test/src/test/resources/basic/user0.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
~ Copyright (c) 2010-2018 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. | ||
--> | ||
|
||
<user> | ||
<name>user0</name> | ||
<assignment id="1"> | ||
<extension> | ||
<skipAutogeneration>true</skipAutogeneration> | ||
</extension> | ||
</assignment> | ||
</user> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.