Class test in SAP class builder - sap

Im trying to test class from within of SAP class builder. I pressed F8 (Test) but Create instance menu item is not active on test screen:
My class has both static and instance constructors. Where is my mistake? How to force this menu item to be active?

Is this parameter set to public?
Moreover, if it is, then it is probably because your class implements an interface. Just click the magnifying glass icon next to the interface name and you will both be able to execute static and instance methods.

Related

intelij idea shortcut to implement interface as a new class

suppose i have a interface like this:
public interface Dumb{
String getDumbName();
}
Is there any shortcut or menu in intellij-idea to create new classes implementing the interface with dummy implement methods like this:
public class Dumber{
public String getDumbName(){
return null;
}
}
There are multiple ways to go about this.
On the interface name itself, you can hit Alt+Enter (Option+Enter on Mac), then pick 'Implement interface'. IDEA will prompt for a class name and a package to put the new class in, then generate an implementation class.
Alternatively, create the class, then add implements Dumb after the name (im<tab> Dumb). IDEA will complain that your class doesn't implement the correct methods, and offer (Alt+Enter Enter Enter) to generate them for you. Hitting Ctrl+I or clicking 'Implement methods' in the Code menu also works.

Xamarin Prism MasterDetailPage.IsPresented from child ViewModel

Does anyone have a clue on how to control IsPresented property from a child view model?
I'm implementing a custom NavBar where I want to simulate the Hamburger icon behavior so my child page on load has
NavigationPage.SetHasNavigationBar(this, false);
which hides the navigation par.
Inside Xaml file I have a button which I want to bind to a PropertyCommand of child viewmodel and show Master page, basically somehow to call Master's IsPresented.
Thanks.
There are a couple of ways to go about it.
The way I would do it would be to use MVVM and use an interface to access the 'presenting the Master page' functionality where its needed.
public interface ICustomMasterDetail
{
void SetMasterPresented(bool isPresented);
}
Now extend on the MasterDetailPage and also implement the above interface
public class CustomMasterDetail : MasterDetailPage, IRootMasterDetail
{
public CustomMasterDetail() : base()
{
//constructor code
}
public void SetMasterPresented(bool isPresented)
{
IsPresented = isPresented;
}
}
Using using an IoC container to register and resolve the interface will let you use its functionality from where ever you want.
The other solution would be to just use a static variable to store the instance of your MasterDetailPage and access that directly to change the IsPresented property

Shortcut for display sub class method in intellij

Say I have one base class, and serveral sub class will override the method f() in the base class. I move mouse on the method f() in base class, is there any shortcut to show me the methods in its subclasses. Thanks.
Navigate > Implementations (Ctrl + Alt + B in default keymap for Windows/Linux, Cmd + Alt + B for Mac) will show you the methods that either override or implement (if the method is in a interface, not class) the currently selected method.

Is TestNG's ITestResult Interface or a Class? if interface which class implemented this interface?

Is TestNG's "ITestResult" an Interface or a Class? we are using the below code to take the screenshot of the webpage whenever there is a failure. we are getting the status of the test by using ITestResult. I have checked the TestNG's API and it is showing as ITestResult as a interface, then which class is implemented this interface? And how we are accessing the method getStatus() using Interface reference? Can anyone clarify my doubt?
#AfterMethod(alwaysRun=true)
public void takeScreenShot(ITestResult result){
if(result.getStatus()==2){
ITestNGMethod instance = result.getMethod();
String testName = instance.getMethodName();
TestUtil.captureScreen("xyz", testName,"Failure_Screenshots");--> method to take screen shot and save the image file in specific directory
}
}
Thanks in Advance!!
org.testng.internal.TestResult is the class which implements the ITestResult interface.
In eclipse, you can click on a type and click Ctrl+T to see the Type Hierarchy to get this data for any type.

marked and unmarked class in pharo 2.0 smalltalk

i need to implement the message markedSubclass in pharo that works just like subclass but i need the class that gets created to be somehow marked,for example i tried adding a unique instance variable to it after creating it but it's just not working,maybe i'm adding it to a wrong place.
the requirments are:
every subclass of this marked class should also be marked even if it
was created via subclass (not markedSubclass).
other than that a marked class should function just as a regular class should.
any help would be appreciated.
example:
User markedSubclass: #MarkedUser
User subClass: #UnmarkedUser
MarkedUser subclass: #MarkerUser2
i need to somehow know that MarkedUser and UnmarkedUser are both marked classes.
what i thought of lately is adding the method "isMarked" to Class class and this way all
the classes will have it, and each class will override it accordingly so if we write
User class isMarked.
it will return false but if we write:
MarkedUser class isMarked.
MarkedUser2 class isMarked.
it will return true for both.
but where can i add this method?and how can i make a class override the method in runtime?
Add a class method like the following to your User class:
markedSubclass: className
| subclass |
subclass := self subclass: className asSymbol.
subclass class compile: 'isMarked', String cr, String tab, ' ^ true'.
^ subclass
Then try in a workspace:
User markedSubclass: 'MyMarkedSubclass'
Add an #unmarkedSubclass: class method accordingly.
You could then override the general #subclass: method in your User class to set the same marker as the receiver.