how to use #step annotation for lambda expression in allure-junit-adaptor - allure

use:
ru.yandex.qatools.allure:allure-junit-adaptor 1.5.0
want use #Step annotation for field with lambda expression:
#Step("Assert screens")
protected AssertScreenshotsInterface compareScreenshots = () -> assertThat(compareImages(getEtalonScreenshotPath(), getCurrentScreenshotPath(),
getDifferentScreenshotPath())).isTrue();
ide show hint: "#Step not applicable to field". I use it function in every test, how to support lambda in allure report?

It's not possible at moment, as Steps's target is METHOD.
But you can create a feature request in allure-java project, if it's really important for you.

Related

Compile error when trying to use jooq any operator in kotlin

I have problems using jooq with kotlin and the any clause.
Given the following:
I have a Database field in a postgreSQL database which is an array
I have search parameters which are a List of Strings
I want to use jooq any operator to search in the array
I have the following code which is not working:
fun findAll(
someArrayListOfStrings: List<String>?
): List<SomeDTO> {
val filters = ArrayList<Condition>()
filters.add(TABLE.SOME_FIELD.eq(DSL.any(someArrayListOfStrings)))
}
Here I want to dynamically create filters (jooq Conditions) to be added to some SQL statement. It should work to look if SOME_FIELD (PostgreSQL Array Type) contains one of the following strings using the ANY clause (PostgreSQL jooq binding). However I get the following compile-time error:
None of the following functions can be called with the arguments supplied:
public abstract fun eq(p0: Array<(out) String!>!): Condition defined in org.jooq.TableField
public abstract fun eq(p0: Field<Array<(out) String!>!>!): Condition defined in org.jooq.TableField
public abstract fun eq(p0: QuantifiedSelect<out Record1<Array<(out) String!>!>!>!): Condition defined in org.jooq.TableField
public abstract fun eq(p0: Select<out Record1<Array<(out) String!>!>!>!): Condition defined in org.jooq.TableField
But my function call should match the third type where QuantifiedSelect is used.
I looked for hours on the internet but was not able to find any solution. Any site I found told me to try the solution I already have. Does anyone have an idea what I could try and why it does not work?
Thank you!
The method you're calling here is DSL.any(T...), which takes a generic varargs array (in Java). You're passing a List<String>, so this binds T = List<String>, which doesn't satisfy the type constraint on the eq() method.
But even if you changed that to an Array<String>, it wouldn't work because the jOOQ ANY operator doesn't do the exact same thing as the PostgreSQL any(array) operator. So, just resort to either plain SQL templating:
condition("{0} = any({1})", TABLE.SOME_FIELD,
DSL.value(someArrayListOfStrings.toTypedArray()))
Or just use the IN predicate
TABLE.SOME_FIELD.in(someArrayListOfStrings)

flink assign uid to window function

is there a way to assign uid to a window function (such as apply(ApplyCustomFunction)) as we do for map/flatmap (or other) functions in Flink. The Flink version is 1.13.1.
I would like to specify the case with an example
DataStream<RECORD> outputDataStream = dataStream
.coGroup(otherDataStream)
.where(DATA::getKey)
.equalTo(OTHERDATA::getKey)
.window(TumblingProcessingTimeWindows.of(Time.seconds(2)))
.apply(new CoGroupFunction());
Thanks
CoGroupedStreams.WithWindow#apply(CoGroupFunction<T1,T2,T>) doesn't have the return type that's needed for setting a UID or per-operator parallelism (among other things). This was done in order to keep binary backwards compatibility, and can't be fixed before Flink 2.0.
You can work around this by using the (deprecated) with method instead of apply, as in
DataStream<RECORD> outputDataStream = dataStream
.coGroup(otherDataStream)
.where(DATA::getKey)
.equalTo(OTHERDATA::getKey)
.window(TumblingProcessingTimeWindows.of(Time.seconds(2)))
.with(new CoGroupFunction())
.uid("window");
The with method will be removed once it is no longer needed.
Use with() instead of apply(). It will be fixed in 2.0 version, how it sayed in documentation

Angular.js and Play Framework 2.1 Integration with helper functions

I want to use Angular.js with the Play Framework view helper functions (e.g #helper.form(...))
How do I insert an Angular directive (e.g: ng-controller)
As I'm sure you discovered, you can't directly make a Scala Symbol with a dash like 'some-word. Instead, just wrap it:
scala> Symbol("ng-controller")
res4: Symbol = 'ng-controller
We're currently using Play Framework 2 and AngularJS.
We added a special method to handle this:
implicit class SymbolString( str: String ) {
def s = Symbol(str)
}
And then we just call it as such:
"ng-model".s -> "datasetName"

Help with atk4-web, atk4-example ver. 4.03

I don't now where can I find help. None forums about atk4.
Can you help me, please?
atk4-web (4.0.3):
How run atk4-web localy, where is site dump (mysql database)?
What is mean this error:
No such tag (version) in template for Object AgileToolkitWeb(agile_project). Tags are: page_title, page_title#1, seo_keywords, seo_keywords#2, seo_descr, seo_descr#3, template, template#4, template#5, template#6, template#7, template#8, template#9, os, os#10, js_include, js_include#11, document_ready, document_ready#12, section, section#13, template#14, menu_about, menu_about#15, page, page#16, menu_doc, menu_doc#17, page#18, menu_develop, menu_develop#19, page#20, menu_services, menu_services#21, page#22, menu_download, menu_download#23, page#24, menu_blog, menu_blog#25, page#26, link_comparison, link_comparison#27, link_example, link_example#28, link_tour, link_tour#29, Content, Content#30, TabContent, TabContent#40
D:\Www\atk4web\atk4\lib\SMlite.php:341
atk4-example (4.0.3):
Why page has not javascrip included, when I allow ->check() in Frontend?
What is difference between empty.html and shared.html?
empty.html:
shared.html:
Why I got error when I did change in empty.html to:
Thanks.
Agile Toolkit uses template engine called 'SMlite'. Its very basic and allows you to load template, then set tags to a certain value.
$tpl->trySet('mytag',123);
Views in Agile Toolkit rely on this template engine and will try to generate their output and place inside parent's template. In your case object was instructed to use spot which did not exist in the template.
Read section about adding here: http://agiletoolkit.org/doc/learn, it should be helpful.
There are no need for JavaScript on auth login form. It also bypasses some of the UI/functionality due to security reasons. You can either create your own empty.html by placing it into template/jui/empty.html (without atk4) and enable javascript in there.
Also sequence of adding jUI and executing auth->check() might change this, but I'm not sure.

Using Linq to filter parents by their children

Having some problems with my Silverlight app (with RIA services) filtering my results. The idea is on the client I set up the EntityQuery and its filters and call load. However this isn't working for me.
Heres my code.
public void FireQuery(string filterValue)
{
EntityQuery<Parent> query = m_ParentDomainContext.GetParentQuery();
query = query.Where(p => p.Children.Any(c => c.Name.Contains(filterValue)));
m_ParentDomainContext.Load(query, Query_Completed, null);
}
Compiles just fine, however, runtime I get "Query operator 'Any' is not supported." Exception.
Does anyone know of a good way to filter like this? Again, I'm looking for a way to set this up on the client.
EDIT: I should note, I've tried a few other queries as well, with similar results:
query = query.Where(p => p.Children.Where(c => c.Name.Contains(filterValue)).Count() != 0);
query = query.Where(p => p.Children.Where(c => c.Name.Contains(filterValue)).FirstOrDefault != null);
query = query.Where(p => p.Children.Where(c => c.Name.Contains(filterValue)).Any());
Query Operator 'Count/FirstOrDefault/Any' is not supported. I'm clearly missing something here...
As I tried to play around a little with this, I figured out that methods like First, Any and Count can't be used with LINQ to Entities (and, I believe, even NHibernate) over WCF RIA Services because they're not defined on the IQueryable itself, but, instread, are extention methods defined in the System.Linqnamespace. That is precisely why this shows as a run-time exception and not a compile-time error. The only extension methods that can be used here are those found in System.ServiceModel.DomainServices.Client (such as Where, Skip, Take, OrderBy, etc.).
This has to do with the "EntityQuery" objects, because those need to be composed and sent back to the server, whereas for the collections (such as m_ParentDomainContext.Parents in your case), you can use the System.Linq extension methods freely.
In order to implement this functionality, I suggest, as Thomas Levesque said, to expose it from the server in order to only get the data you want, or, alternatively, you can compose a query using the available constructs (the ones in System.ServiceModel.DomainServices.Client) and then apply the other filters on the resulting data (where you can use extension methods from the System.Linq namespace).
PS: I tried this with both classic Entity Framework and Entity Framework CodeFirst, and had the same results.
I hope this helps

Resources