Skip to content

Commit

Permalink
old-ws partial removal, required class shuffling, currently not working
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed May 21, 2020
1 parent 70888e8 commit c11693f
Show file tree
Hide file tree
Showing 31 changed files with 133 additions and 256 deletions.
19 changes: 0 additions & 19 deletions infra/common/pom.xml
Expand Up @@ -111,25 +111,6 @@
<artifactId>javax.annotation-api</artifactId>
</dependency>

<!-- rest providers -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>

<!-- Testing dependencies -->
<dependency>
<groupId>org.testng</groupId>
Expand Down

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions infra/common/src/main/resources/ctx-common.xml
Expand Up @@ -45,8 +45,4 @@
<ref bean="midpointConfiguration"/>
</property>
</bean>

<bean id="jaxbProvider" class="com.evolveum.midpoint.common.rest.MidpointXmlProvider"/>
<bean id="yamlProvider" class="com.evolveum.midpoint.common.rest.MidpointYamlProvider"/>
<bean id="jsonProvider" class="com.evolveum.midpoint.common.rest.MidpointJsonProvider"/>
</beans>
Expand Up @@ -7,6 +7,7 @@

package com.evolveum.midpoint.validator.test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.testng.AssertJUnit.*;

import java.io.File;
Expand Down Expand Up @@ -146,10 +147,9 @@ public void notWellFormed() throws Exception {
System.out.println(result.debugDump());
AssertJUnit.assertFalse(result.isSuccess());
String message = result.getMessage();
AssertJUnit.assertTrue(message.contains("Unexpected close tag"));
assertThat(message).contains("The element type \"resource\" must be terminated by the matching end-tag");
// Check if line number is in the error
AssertJUnit.assertTrue("Line number not found in error message: " + message, message.contains("26"));

AssertJUnit.assertTrue("Line number not found in error message: " + message, message.contains("25"));
}

@Test
Expand All @@ -161,7 +161,7 @@ public void undeclaredPrefix() throws Exception {
System.out.println(result.debugDump());
AssertJUnit.assertFalse(result.isSuccess());
String message = result.getMessage();
AssertJUnit.assertTrue(message.contains("Undeclared namespace prefix"));
assertThat(message).contains("Element type \"ri:Account\" must be followed by either attribute specifications");
// Check if line number is in the error
AssertJUnit.assertTrue("Line number not found in error message: " + message, message.contains("28"));

Expand Down
Expand Up @@ -19,7 +19,6 @@
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.Validate;
import org.apache.cxf.jaxrs.ext.MessageContext;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
Expand All @@ -29,16 +28,13 @@
import com.evolveum.midpoint.audit.api.AuditEventStage;
import com.evolveum.midpoint.audit.api.AuditEventType;
import com.evolveum.midpoint.audit.api.AuditService;
import com.evolveum.midpoint.common.rest.Converter;
import com.evolveum.midpoint.common.rest.ConverterInterface;
import com.evolveum.midpoint.model.api.*;
import com.evolveum.midpoint.model.api.validator.ResourceValidator;
import com.evolveum.midpoint.model.api.validator.Scope;
import com.evolveum.midpoint.model.api.validator.ValidationResult;
import com.evolveum.midpoint.model.common.SystemObjectCache;
import com.evolveum.midpoint.model.impl.rest.PATCH;
import com.evolveum.midpoint.task.quartzimpl.rest.PATCH;
import com.evolveum.midpoint.model.impl.scripting.PipelineData;
import com.evolveum.midpoint.model.impl.scripting.ScriptingExpressionEvaluator;
import com.evolveum.midpoint.model.impl.security.SecurityHelper;
import com.evolveum.midpoint.model.impl.util.RestServiceUtil;
import com.evolveum.midpoint.prism.PrismContext;
Expand Down Expand Up @@ -70,7 +66,6 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ExecuteScriptOutputType;
import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ExecuteScriptType;
import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionType;
import com.evolveum.prism.xml.ns._public.query_3.QueryType;

/**
Expand Down Expand Up @@ -821,22 +816,10 @@ public Response scheduleTaskNow(@PathParam("oid") String taskOid, @Context Messa
return response;
}

public static class ExecuteScriptConverter implements ConverterInterface {
public ExecuteScriptType convert(@NotNull Object input) {
if (input instanceof ExecuteScriptType) {
return (ExecuteScriptType) input;
} else if (input instanceof ScriptingExpressionType) {
return ScriptingExpressionEvaluator.createExecuteScriptCommand((ScriptingExpressionType) input);
} else {
throw new IllegalArgumentException("Wrong input value: " + input);
}
}
}

@POST
@Path("/rpc/executeScript")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, RestServiceUtil.APPLICATION_YAML })
public Response executeScript(@Converter(ExecuteScriptConverter.class) ExecuteScriptType command,
public Response executeScript(ExecuteScriptType command,
@QueryParam("asynchronous") Boolean asynchronous, @Context UriInfo uriInfo, @Context MessageContext mc) {

Task task = initRequest(mc);
Expand Down
16 changes: 0 additions & 16 deletions model/model-impl/src/main/resources/ctx-model.xml
Expand Up @@ -279,22 +279,6 @@

<bean id="loggingFeature" class="com.evolveum.midpoint.model.impl.util.LoggingFeature"/>

<jaxrs:server id="restService" address="/rest/">
<jaxrs:serviceBeans>
<ref bean="modelRestService"/>
<ref bean="extensionSchemaRestService"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="jaxbProvider"/>
<ref bean="jsonProvider"/>
<ref bean="yamlProvider"/>
<ref bean="restAuthenticationHandler"/>
</jaxrs:providers>
<jaxrs:features>
<ref bean="loggingFeature"/>
</jaxrs:features>
</jaxrs:server>

<jaxrs:server id="clusterRestServer" address="/cluster/">
<jaxrs:serviceBeans>
<ref bean="clusterRestService"/>
Expand Down
27 changes: 7 additions & 20 deletions model/model-test/src/main/resources/ctx-model-test.xml
Expand Up @@ -8,26 +8,13 @@
-->

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:ssec="http://cxf.apache.org/spring-security"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/spring-security
http://cxf-spring-security.googlecode.com/svn/trunk/cxf-spring-security/src/main/resources/schemas/spring-security.xsd"
default-lazy-init="false"
default-autowire="byName">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="false">

<!-- enabling annotation driven configuration -->
<context:annotation-config/>
Expand Down
Expand Up @@ -306,7 +306,7 @@ public void test900HeapUsage() throws Exception {
int size = 2_000_000;
int count = 300;

// 50 is the default "step" in paged iterative search, so we can expect we always have 50 objects in memory
// 50 is the default "step" in paged iterative search, so we can expect we always have 50 objects in memory.
// And "times 2" is the safety margin. It might or might not be sufficient, as System.gc() is not guaranteed to
// really execute the garbage collection (only suggests JVM to do it).
long tolerance = (50 * size) * 2;
Expand Down
4 changes: 0 additions & 4 deletions repo/task-quartz-impl/pom.xml
Expand Up @@ -111,10 +111,6 @@
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
Expand Down
Expand Up @@ -7,9 +7,9 @@

package com.evolveum.midpoint.task.quartzimpl.cluster;

import com.evolveum.midpoint.common.rest.MidpointJsonProvider;
import com.evolveum.midpoint.common.rest.MidpointXmlProvider;
import com.evolveum.midpoint.common.rest.MidpointYamlProvider;
import com.evolveum.midpoint.task.quartzimpl.rest.MidpointJsonProvider;
import com.evolveum.midpoint.task.quartzimpl.rest.MidpointXmlProvider;
import com.evolveum.midpoint.task.quartzimpl.rest.MidpointYamlProvider;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.crypto.EncryptionException;
Expand Down
Expand Up @@ -6,6 +6,10 @@
*/
package com.evolveum.midpoint.task.quartzimpl.cluster;

import java.util.List;

import org.jetbrains.annotations.Nullable;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.delta.ItemDelta;
import com.evolveum.midpoint.prism.query.ObjectQuery;
Expand All @@ -24,9 +28,6 @@
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeOperationalStatusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeType;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
* Responsible for keeping the cluster consistent.
Expand Down
Expand Up @@ -7,13 +7,13 @@

package com.evolveum.midpoint.task.quartzimpl.cluster;

import java.io.Serializable;
import java.util.*;

import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SchedulerInformationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;

import java.io.Serializable;
import java.util.*;

/**
* Provides information about tasks currently executing at particular nodes in the cluster.
*
Expand Down
Expand Up @@ -7,6 +7,23 @@

package com.evolveum.midpoint.task.quartzimpl.cluster;

import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.*;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.Query;
import javax.management.QueryExp;
import javax.xml.datatype.XMLGregorianCalendar;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.RandomStringUtils;
import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.common.LocalizationService;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
Expand Down Expand Up @@ -36,22 +53,6 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;
import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.RandomStringUtils;
import org.jetbrains.annotations.NotNull;

import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.Query;
import javax.management.QueryExp;
import javax.xml.datatype.XMLGregorianCalendar;
import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.*;

/**
* Takes care about node registration in repository.
Expand Down
Expand Up @@ -10,9 +10,7 @@
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.prism.xml.XmlTypeConverter;
import com.evolveum.midpoint.schema.GetOperationOptions;
import com.evolveum.midpoint.schema.SearchResultList;
import com.evolveum.midpoint.schema.SelectorOptions;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.result.OperationResultStatus;
import com.evolveum.midpoint.task.api.*;
Expand Down

0 comments on commit c11693f

Please sign in to comment.