I have a Java Soap service with method
public void helloStudentsName(String[] names)
And user robot framework (SudsLibrary) to call this, because i didn't fine Array in Robot so i use List in code
${names} Create List name1 name2 name3
Call Soap Method helloStudentsName ${names}
I got error
TypeNotFound: Type not found: 'arg0'
And replace $ by # in list declare
#{names} Create List name1 name2 name3
Call Soap Method helloStudentsName #{names}
No error but in Java method receive an empty array.
Can you show me how to call this method?
I think you need to create a special WSDL array object, rather than using a plain robot list. SudsLibrary has a keyword for this, and uses it in an example.
Assuming your WSDL defines a type of ArrayOfString, you might do something like this:
| | ${string array}= | Create Wsdl Object | ArrayOfString
| | Append To List | ${string array} | name1
| | Append To List | ${string array} | name2
| | Append To List | ${string array} | name3
| | ${result}= | Call Soap Method | helloStudentsName | ${string array}
This will only work if your WSDL defines a type of ArrayOfString. Your actual WSDL might call it by some other name.
Related
i' have created label schema using graph.OpenManagement() as described in https://docs.janusgraph.org/basics/schema/#schema-constraints
mgmt = graph.openManagement()
person = mgmt.makeVertexLabel('person').make()
name = mgmt.makePropertyKey('name').dataType(String.class).cardinality(Cardinality.SET).make()
birthDate = mgmt.makePropertyKey('birthDate').dataType(Long.class).cardinality(Cardinality.SINGLE).make()
mgmt.addProperties(person, name, birthDate)
mgmt.commit()
How can I get the person label schema. What is the gremlin query to get the properties list along with the datatype and cardinality info for a label.
Im using the following query to get the properties list with the data type, but there is no map for property to the label
gremlin> mgmt.printPropertyKeys()
==>------------------------------------------------------------------------------------------------
Property Key Name | Cardinality | Data Type |
---------------------------------------------------------------------------------------------------
name2 | SINGLE | class java.lang.String |
age2 | SINGLE | class java.lang.Integer |
name3 | SET | class java.lang.String |
birthDate3 | SINGLE | class java.lang.Long |
name4 | SET | class java.lang.String |
birthDate4 | SINGLE | class java.lang.Long |
name6 | SINGLE | class java.lang.String |
age6 | SINGLE | class java.lang.Integer |
name5 | SINGLE | class java.lang.String |
age5 | SINGLE | class java.lang.Integer |
mean_radius | SINGLE | class java.lang.Integer |
distance_in_kms | SINGLE | class java.lang.Integer |
new_field | SINGLE | class java.lang.String |
radius_in_kms | SINGLE | class java.lang.Integer |
name | SINGLE | class java.lang.String |
---------------------------------------------------------------------------------------------------
Getting vertex labels and their basic information:
mgmt.getVertexLabels().forEach(vertexLabel -> {
System.out.println("Vertex label: "+vertexLabel.name()+" isPartitioned: "+vertexLabel.isPartitioned()+" isStatic: "+vertexLabel.isStatic());
});
Getting edge labels and their basic information:
mgmt.getRelationTypes(EdgeLabel.class).forEach(edgeLabel ->{
System.out.println("Edge label: "+edgeLabel.name()+" Multiplicity: "+edgeLabel.multiplicity().name()+" isUnidirected:"+edgeLabel.isUnidirected());
});
Getting properties and their basic information:
mgmt.getRelationTypes(PropertyKey.class).forEach(propertyKey -> {
System.out.println("Property key: "+propertyKey.name()+" Cardinality: "+propertyKey.cardinality().name()+" Datatype: "+propertyKey.dataType().getName());
});
Now, when you got a specific Vertex label or a specific Edge label (as shown above), you can ask for the schema constraints information as shown below. Same methods are available for both VertexLabel and EdgeLabel.
Getting vertex label properties:
VertexLabel vertexLabel = mgmt.getVertexLabel("myVertexLabel");
vertexLabel.mappedProperties().forEach(propertyKey -> {
// get information about `propertyKey` as shown above in `Getting properties and their basic information` section
});
Getting vertex label connections:
VertexLabel vertexLabel = mgmt.getVertexLabel("myVertexLabel");
vertexLabel.mappedConnections().forEach(connection -> {
// connection.getEdgeLabel() - return the label of the edge. You can use it to access the edge itself if needed like:
EdgeLabel edgeLabel = mgmt.getEdgeLabel(connection.getEdgeLabel());
// You can access JanusGraphEdge via:
JanusGraphEdge janusGraphEdge = connection.getConnectionEdge();
// Having JanusGraphEdge you can access EdgeLabel directly via:
edgeLabel = janusGraphEdge.edgeLabel();
// You can also access incoming or outgoing vertices of this connection via: connection.getIncomingVertexLabel() or connection.getOutgoingVertexLabel()
});
I am new to Cucumber. I have a requirement to use variables instead of actual values in a feature file example. Actual values are to be populated in a separate property file.
Sample feature file:
#tag
Feature: Add an element to stack
The user pushes an element. It gets added to stack
#tag1
Scenario: Push element to empty stack
Given Stack is empty
When User pushes an element
Then stack should have only one element
#tag2
Scenario Outline: Push element to stack
Given Stack has {initial} elements
When User adds {new} element
Then Length of stack increases to {new_size}
| initial | new | new_size |
| 1 | 2 | 2|
| 5 | 9 | 6|
| 0 | 3 | 1|
The output example should be like:
| initial | new | new_size |
| {val1_1} |{val1_2} | {val1_3}|
| {val2_1} |{val2_2} | {val2_3}|
I have used "{}" instead of "<>" as am not able to print elements inside <> in pre-formatted code
Use scenario outlines with examples. Its will solve you data input based queries. For example,
#tag2
Scenario Outline: Push element to stack
Given Stack has <initial> elements
When User adds <new> element
Then Length of stack increases to <new_size>
Examples:
| initial | new | new_size |
| 1 | 2 | 2 |
| 5 | 9 | 6 |
| 0 | 3 | 1 |
And your step definition would be like this,
Given("^Stack has (.*) elements$", (String initial) -> {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
});
Similarly do for the other query parameters like (name, new_size).
I'm working on building a Typescript .ds file for reactive-coffee (http://yang.github.io/reactive-coffee/api.html), and I'm running into trouble trying to figure out the type signature for the flatten function. An example:
flatten(rx.array([1, [2, 3], rx.cell(4), rx.array([rx.cell([5, rx.cell(6)])])]))
// -> [1,2,3,4,5,6]
flatten([1, [2, 3], rx.cell(4), rx.array([rx.cell([5, rx.cell(6)])])])
// -> [1,2,3,4,5,6]
The question I'm running into trouble with is: what is the correct Typescript type signature for xs? So far I've come up with something like this:
interface NestableCell<T> extends ObsCellInterface<T | NestableCell<T>> {}
type Flattenable<T> = (
Array<T| NestableCell<T | Flattenable<T>> | Flattenable<T>> |
ObsArrayInterface<T | NestableCell<T | Flattenable<T>> | Flattenable<T>>
)
function flatten<T>(xs:Flattenable<T>) => ObsArrayInterface<T>
ObsCellInterface and ObsArrayInterface are typed versions of RC's ObsCell and ObsArray objects, respectively.
Unfortunately, Typescript does not allow recursive types, only recursive interfaces. And at this point I'm really not sure how to convert that type to an interface.
The following seems to work, though I haven't yet had time to prove that it satisfies all possible cases:
interface NestableCell<T> extends ObsCell<T | NestableCell<T>> {}
interface FlattenableRX<T> extends ObsArray<
T |
NestableCell<T | FlattenableJS<T> | FlattenableRX<T>> |
FlattenableJS<T> |
FlattenableRX<T>
> {}
interface FlattenableJS<T> extends Array<
T |
NestableCell<T | FlattenableJS<T> | FlattenableRX<T>> |
FlattenableJS<T> |
FlattenableRX<T>
> {}
export type Flattenable<T> = FlattenableRX<T> | FlattenableJS<T>
Using two mutually recursive interfaces appears to avoid the worst complications from having to support both primitive and reactive arrays.
As I said, I cannot yet prove that this works, but it at least seems plausible.
I have a very simple LibreOffice Calc spreadsheet with column headers and columns (cell can be multiline), someting like:
| id | Prio | Domain | Comment | ... |
|----|------|--------|----------------|-----|
| 1 | A | Foo | Something | |
|----|------|--------|----------------|-----|
| 2 | A | Bar | Something else | |
| | | | Possibly on | |
| | | | multiple lines | |
|----|------|--------|----------------|-----|
| 1 | C | Baz | Something else | |
I would like to obtain, in a (semi) automated way a plain text file containing something like:
id: 1
Prio: A
Domain: Foo
Comment: Something
...
id: 2
Prio: A
Domain: Bar
Comment: Something else
Possibly on
multiple lines
...
id: 3
Prio: C
Domain: Baz
Comment: Something else
...
Is this possible somehow?
I am aware of LO macro capabilities (e.g.: this ), so the trivial answer is probably "yes", but I never used them so I would need some guidance (I don't even know how to use such a thing).
There are a lot of different ways this could be done. One idea is to go to File -> Save As and save as type CSV. In the filter settings, check Quote all text cells to make it easier to handle newlines.
Then write a script that uses the python csv module, for example:
import csv
with open('Untitled 1.csv') as csvfile:
spamreader = csv.reader(csvfile, dialect='excel',)
for row in spamreader:
print("row: ", end="")
print(', '.join(row))
To avoid the Save As step, you could write a macro instead. It might be easier to write it in python rather than Basic, because file handling and string manipulation can be difficult in Basic.
I'm doing a bit of Powershell scripting ( for the first time ) to look at some stuff in a Sharepoint site and what I would like to be able to do is to go through a list of properties of an object and just output their values in a "property-name = value" kind of format.
Now I can find the list of elements using this:
$myObject | get-member -membertype property
Which will return a list of all the properties in a very clear and readable fashion. But what I need is to find a value for those properties.
In some scripting languages I could have a kind of eval( "$myObject.$propertyName" ) call - where I have extracted $propertyName from the get-member output - and have it evaluate the string as code, which for the kind of quick-and-dirty solution I need would be fine.
Does this exist in Powershell or is there a more convenient way to do it? Should I be using reflection instead?
To get the value of properties of an object, you can use several methods.
First off, you could use Select-Object and use the -Property parameter to specify which property values you would like returned. The how that is displayed will depend on the number of properties you specify and the type of object that it is. If you want all the properties, you can use the wildcard ( * ) to get them all.
Example -
$myobject | Select-Object -Property name, length
$myobject | Select-Object -Property *
You can also control the formatting of the outputs in a similar manner, using Format-List or Format-Table.
Example -
$myobject | Format-List -Property *
$myobject | Format-Table -Property name, length
Finally, to do an "eval" style output you could simply type
$myobject."$propertyname"
and the value of the property will be returned.
For you purpose the best choice is Format-Custom.
get-date | Format-Custom -Depth 1 -Property *
get-childitem . | select-object -first 1 | Format-Custom -Depth 1 -Property *
It's maybe too verbose, but useful ;)
Or you can really use Get-Member
$obj = get-date
$obj |
gm -MemberType *property |
% { write-host ('{0,-12} = {1}' -f $_.Name, $obj.($_.Name)) }
For this I would recommend using Format-List -force e.g.:
Get-Process | Format-List * -Force
-Force is optional but sometimes PowerShell hides properties I really want to see.