Unexpected element: CDATA soapUI maven plugin - json

I'm writing tests for a rest API. I'm using property and property transfer.
When I run my TestCase using SoapUI, everything goes fine. However, when I run it using maven and the com.smartbear.soapui:soapui-maven-plugin:4.6.1 I got this error:
Status: FAILED
Time Taken: 64
Size: 0
Timestamp: Fri Dec 21 14:15:12 GMT+01:00 2018
TestStep: Property Transfer 1
Error:com.eviware.soapui.impl.wsdl.teststeps.PropertyTransferException: error: Unexpected element: CDATA
----------------- Messages ------------------------------
Error performing transfer [city] - error: Unexpected element: CDATA
----------------------------------------------------
city transferred [[error: Unexpected element: CDATA]] from [Personal_data.city] to [eligibility.Request]
------------ target path -------------
$..city
I'm thinking of using a Groovy script to do my properties transfers but first, I would realy like to understand why I have this error and if there is a way to fix it who doesn't involve a Groovy script.

After looking and looking again, I finally manage to solve the issue:
The problem was that I was using SoapUI 5.4.0 with a (very) old version of soapui-maven-plugin. So, I just change the version of the soapUI plugin in maven to match the one of my SoapUI interfaces and it's now working fine.

Related

Can the ConfigurationAPI in Liferay DXP be used for Plugin sdk portlet?

I have followed given 2 tutorials to use COnfigurationAPI in a Liferay dxp plugins SDK portlet built using Ant/Ivy.
COnfiguration API 1
COnfiguration API 2.
Below is the configuration class used:
package com.preferences.interfaces;
import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
import aQute.bnd.annotation.metatype.Meta;
#ExtendedObjectClassDefinition(
category = "preferences",
scope = ExtendedObjectClassDefinition.Scope.GROUP
)
#Meta.OCD(
id = "com.preferences.interfaces.UnsupportedBrowserGroupServiceConfiguration",
name = "UnsupportedBrowser.group.service.configuration.name"
)
public interface UnsupportedBrowserGroupServiceConfiguration {
#Meta.AD(deflt = "", required = false)
public String displayStyle();
#Meta.AD(deflt = "0", required = false)
public long displayStyleGroupId(long defaultDisplayStyleGroupId);
}
Post following the steps,I am getting the below error:
ERROR [CM Configuration Updater (ManagedService Update: pid=[com.preferences.interfaces.UnsupportedBrowserGroupServiceConfiguration])][org_apache_felix_configadmin:97] [org.osgi.service.cm.ManagedService, id=7082, bundle=297//com.liferay.portal.configuration.settings-2.0.15.jar?lpkgPath=C:\dev\Liferay\osgi\marketplace\Liferay Foundation.lpkg]: Unexpected problem updating configuration com.preferences.interfaces.UnsupportedBrowserGroupServiceConfiguration {org.osgi.service.cm.ConfigurationAdmin}={service.vendor=Apache Software Foundation, service.pid=org.apache.felix.cm.ConfigurationAdmin, service.description=Configuration Admin Service Specification 1.2 Implementation, service.id=56, service.bundleid=643, service.scope=bundle}
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
So,does this process need a osgi module as mandatory or can we do it using plusings sdk portlet built using ant as well?
Without disecting the error message Caused by: java.lang.IllegalArgumentException: wrong number of arguments:
The way you build your plugin (Ant, Maven, Gradle, manually) doesn't make a difference, as long as you build a plugin that will be understood by the runtime. aQute.bnd.annotation.metatype.Meta points firmly into the OSGi world, and makes it almost certain that you'll need an OSGi module. You can build this with Ant, of course. Even in Ant you can embed tools like bnd, or you can write the proper Manifest.mf to include in your module manually (just kidding - you don't want to do it manually, but it would work).
Recommendation: Instead of moving everything over: Try to reproduce this with a minimal example in gradle or better Liferay Workspace (which is gradle based), just to get all the automatic wiring in. Check if it makes a difference and compare the generated output from your Ant build process with the workspace output. Pay specific attention to the Manifest.
In order to build the proper Manifest, you want to use bnd - if the Manifest turns out to be your issue: Find a way to embrace bnd - if that's by saying goodby to Ant, or by tweaking your build script remains your decision.

java.lang.NoSuchFieldError: USE_DEFAULTS thrown while validating json schema through json schema validator

I am new to RestAPI testing. I am trying to use Jsonschemavalidor. I added the jar file and all the dependencies. Still I get following error. Can anyone give solution to the problem.
Exception in thread "main" java.lang.NoSuchFieldError: USE_DEFAULTS
at com.fasterxml.jackson.annotation.JsonInclude$Value.<clinit>(JsonInclude.java:205)
at com.fasterxml.jackson.databind.cfg.MapperConfig.<clinit>(MapperConfig.java:45)
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:543)
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:460)
at com.github.fge.jackson.JacksonUtils.newMapper(JacksonUtils.java:155)
at com.github.fge.jackson.JacksonUtils.<clinit>(JacksonUtils.java:55)
at com.github.fge.jackson.JsonNodeReader.<init>(JsonNodeReader.java:82)
at com.github.fge.jackson.JsonLoader.<clinit>(JsonLoader.java:50)
at com.jayway.restassured.module.jsv.JsonSchemaValidator$4.createJsonNodeInstance(JsonSchemaValidator.java:164)
at com.jayway.restassured.module.jsv.JsonSchemaValidator$4.createJsonNodeInstance(JsonSchemaValidator.java:161)
at com.jayway.restassured.module.jsv.JsonSchemaValidator$JsonSchemaValidatorFactory.create(JsonSchemaValidator.java:254)
at com.jayway.restassured.module.jsv.JsonSchemaValidator.matchesJsonSchema(JsonSchemaValidator.java:161)
at com.jayway.restassured.module.jsv.JsonSchemaValidator.matchesJsonSchemaInClasspath(JsonSchemaValidator.java:117)
at com.nasdaq.api.GenericLib.validateJsonSchema(GenericLib.java:441)
Did you add the latest version of jackson-annotations? The USE_DEFAULTS enum constant was added in 2.6:

SSIS TargetServerVersion causes null rows in script component

When I set the TargetServerVersion = SqlServer2012 in my SSIS project, my script component throws a null object exception.
I am importing about 140,000 records from a CSV file. To confirm I do get records, I removed my script component step and ran the flow with no issues.
I then added back in the Script Component (which has worked fine with this very data file) and I get the null exception.
When I debug the script and check the value of the Row property it says the following:
?Row
{Input0Buffer}
Buffer: {Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer}
BufferColumnIndexes: {int[2]}
MembershipPlanName: 'Row.MembershipPlanName' threw an exception of type 'System.NullReferenceException'
MembershipPlanName_IsNull: 'Row.MembershipPlanName_IsNull' threw an exception of type 'System.NullReferenceException'
The script then fails when the rest of the lines try to reference Row. When I change the TargetServerVersion back to 2016 or 2014, the package works fine.
During debegging I also looked at BufferWrapper.cs and there seems to be some data in there
?Buffer
{Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer}
ColumnCount: 2
ColumnInfo: 0x0000000000000000
CurrentRow: 0
EndOfRowset: false
Mode: Input
RowCount: 9936
RowSize: 260145280
RowStarts: 0x000000000f82b700
Out of frustration I installed SSDT for VS2012. For some reason, that made everything work fine in VS2015. Not sure why it worked, but posting this if anyone has a similar issue.

Trouble using json-jackson in camel-blueprint-test

I am trying to test a Camel Blueprint route in camel-blueprint-test. This route can load in karaf and it also worked when using Camel and Spring. At this point I am getting:
org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> Unmarshal[ref:IssRequest] <<< in route: Route(route1)[[From[seda:from_rraa]] -> [process[ref:issPrep... because of Data format 'json-jackson' could not be created. Ensure that the data format is valid and the associated Camel component is present on the classpath
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1028)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:185)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:841)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2911)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2634)
...
Other posts have suggested adding camel-jackson in the pom.xml, but I have that already. Also suggested was loading the feature in the karaf container, but this is when running unit tests in camel-blueprint-test, not in real karaf.
There is a bug in that version, use 2.15.2 or 2.16.0 or wait for 2.15.4

Sonar Unit tests report parameter - sonar.junit.reportPath vs sonar.java.junit.reportPath

I found that my Sonar instance 5.1 or 5.1.1 (with latest sonar-runner 2.x) stopped showing part of the Unit test info (Unit test widget) on the project's dashboard.
The properties I had were (in Gradle's sonarRunner > sonarProperties section):
property "sonar.junit.reportsPath", "build/test-results/UT"
property "sonar.surefire.reportsPath", "build/test-results/UT"
To fix it, I had to include the following properties as well:
property "sonar.java.junit.reportsPath", "build/test-results/UT"
property "sonar.java.surefire.reportsPath", "build/test-results/UT"
Just FYI: All my Unit tests reports go under build/test-results/UT folder, all Integration Tests result files go unedr build/test-results/IT folder and etc.
I'm wondering if this is due to Gradle version that I'm using (2.3) or is it due to a later version of SonarQube (4.5+) as I have both SQ 5.1 and 5.1.1 instance.
I know SonarQube team started Multi language support since SonarQube version 4.12
Since SonarQube 4.2, it is possible to run an analysis on a multi-language project.
Now, it raises a question. For Getting the same Unit test info for Groovy based projects, do I need to use:
property "sonar.groovy.junit.reportsPath", "build/test-results/UT"
property "sonar.groovy.surefire.reportsPath", "build/test-results/UT"
something like that if my project has Groovy code instead of java?
Searching "**sonar.java.junit.reportPath"** with using double quotes shows No results found in Google and it forces me to try and see google results if I can run the search again without using " double quotes (for this property).
Doing the same in SonarQube site "search box" shows:
No results found for sonar.java.junit.reportPath. Please try one of the following suggestions:
Though in Gradle, inside
sonarRunner task {
.. inside ..
sonarProperties {
... section ... where I define various sonar props..
}
...
}
I can define both sonar.junit.reportPath, sonar.java.junit.reportPath and similarly, sonar.surefire.reporPath and sonar.java.surefire.reportPath and while running sonarRunner task in Gradle, it doesn't error out. Thus it makes me believe that the property variables are valid.
There are also issues with running sonarRunner or stand alone sonar-runner command for a mixed Java and Groovy based project (i.e. source code in Java but tests in Groovy). Setting sonar.language=java,grvy didn't help. I posted this question on stackoverflow but so far I have no perfect result/answer on how to get a full fledged sonar dashboard up and running for a Groovy projects like I get for a Java project.
Groovy project - Sonar - Publish project and Unit + Integration Test code coverage data
PS: I have tried various values for setting sonar.. variables (as far a sonar source, tests, etc, etc properties are concerned, which they have mentioned on their site's docs section)
The only valid property to use as of now is sonar.junit.reportsPath which will tell the java sonarqube plugin where to import your result of unit tests.
For groovy, this is work in progress, see : http://jira.sonarsource.com/browse/SONARGROOV-2
All the other properties you mentioned do not exist and are not taken into account.