JBehave - loading stories from an external folder - jbehave

We have to load all stories from an external folder, where stories exist in the root external folder and inside subfolders. JUnit-runnable entry-point is used to run the stories (a class which extends JUnitStories class) . How I should implement storyPaths method , I'tried with codeLocationsFromUrl, codeLocationsFromPath but JBehave was not able to locate stories in both cases.

Related

How can we call a substory within a jbehave story that does not create a new browser instance?

I wish to load a sub story within a story of jbehave , which should not create a new browser session , just like GivenStories syntax but not as a pre-condition
Scenario: Main Story
Given I login
Then I load another story by providing story path (execution runs on the same browser)
We have developed a custom framework on top of jbehave which is compiled into an executable jar file using maven.
Story path is provided in a .properties file which is loaded and parsed by the executable jar . Using the properties file , a new browser is instantiated in the constructor of a class every time a story is executed
I wish that I load a story in between a story and the execution keeps running on the same browser

Creating directory page from single source for multiple sub directories (Doxygen)

For my doxygen project, I have setup the program such that every directory in a large, multilevel project is doxygenized while linking itself to its subdirectories by way of tagfiles.
Because the files tab does not account for this nested tagging method, I decided to use an external File Tree plugin for jquery that dynamically loads the subdirectory tree dynamically via PHP. I have the code setup in external/directories.txt with standard page comments so that every subdirectory doxygen uses the same external folder as an input.
However, when I attempt to create a page called Directory with the name of directory.html, it no longer generates the page after a few doxygen runs through subdirectories. When I changed the name to directory_tree, it begins to generate again for some time until it exhausts most subdirectories. Is there any way to have pages with the same name on a per directory basis even when tagfiles are used? Thanks.
Edit: My original post is extremely confusing, so I'm clarifying it here.
I have a generic file called directories.txt in a folder called input that looks like this:
/**
#page directory Directories
<h2>Click on text to go to directory, Click on tab to see subdirectories</h2>
<div id="fileTree" class="demo"></div>
*/
The idea is that every time i run doxygen on a directory, I would pull from this generic file to create a page called directories since the fileTree is a generic template to create a directory map for all subdirectories underneath the directory. However, because doxygen does not allow for the same named pages for linked projects via tagfiles, I can't generate a file called directory.html for every directory automatically. Is there a work around for this?

New file in template is not accessed

I am trying to display results in a web page. I want to link this from the waterfall page of buildbot. But when I useclick , the required web page does not open. I have placed this new web page in the templates directory. Is there something more that needs to be done?
Since the results you want to display are produced by one of your builds,
the waterfall web templates are not relevant, since they are templates
for the whole waterfall, including all builds, whether or not they
are builds that produce these particular results.
If you wish to provide links to some files generated by a build, you select
a buildstep in the build, or create one for the purpose, that will provide
those links within its status box in the waterfall display (e.g. in the
way that a ShellCommand buildstep provides a link to its stdio log).
For example, you might just add a final step to the build with the description
Report or Publish.
You must write a customized BuildStep class to execute the step that you select
or create. Your customized BuildStep class must be derived from LoggingBuildStep,
or from a class, such as ShellCommand, that is already derived from LoggingBuildStep.
The necessary customization is to override the createSummary method with
your own implementation, and in that implementation call the addURL method to adds URL(s)
to the file(s) you want to publish to the buildstep's status box. You can add as
many URLs as you like. Here is an outline example:
class ReportingStep(ShellCommand):
...
command = ['upload','report',to','some','server']
...
def createSummary(self,log):
...
url = "url/to/the/report/on/the/server"
self.addURL("Report", url)
Now, when ReportingStep completes, its status box will contain
a link labelled Report to the report that the step has uploaded to the server.
Google "buildbot buildstep createSummary" for more leads.
What if my files are saved locally and for now I just want the user to have a link to download the zipped files?
From what I understand, the above customization will help provide an external url.
The user clicks a link that is served from your buildmaster. If your
build just saves these files locally, then they're saved on the buildslave.
So unless your buildslave is on the same machine as the buildmaster then the link has to be URL to an "external" file.
On the other hand, if your buildstep uploads the file to the buildmaster,
then the link can be a link to local file - local on the buildmaster, which
is serving the link.
If your buildslave is on the same machine as your buildmaster, then obviously
you don't need to do any uploading:
addURL("Report",file:///path/to/the/zipfile.zip)
But remember, if you want the content at these links to be persistent then
/path/to/the/zipfile.zip had better not be somewhere that gets clobbered
by every build.

Not able to access image on jsp file

Attaches is the image of my project hierarchy. I am trying to call image from images directory to the jsp file in jsp directory but I am getting blank screen.
So far I have tried :
/WEB-INF/images/'<'imageFileName'>'
/images/'<'imageFileName'>'
/'<'imageFileName'>'
src/main/webapp/WEB-INF/images/'<'imageFileName'>'
Please help me on this.
You can't access any resources that are under WEB-INF folder, it serves just that purpose, to hold the resources that are not directly visible for the public but available to the classloader (servlets) of your web app.
You should make a mapping by the means of mvc:resources element, you should checkout the docs
for your particular case a mapping like
<mvc:resources mapping="/images/**" location="/WEB-INF/images"/>
should work out, and you'll be able to browse your images via request such as
/images/'<'imageFileName'>'
You can place your images and jsp folder under the web-app folder rather than WEB-INF folder. Then you can access the images using:
/images/'<'imageFileName'>'
The JSPs cannot access files inside WEB-INF folder directly, since it's not publicly available. But you can access it indirectly through a Servlet which will return the Image's stream object.
The sample code to access files in WEB-INF folder is in the below link. Have a look.
http://simple.souther.us/ar01s10.html

Where do I put static files for GWT app? war folder or public folder?

I have some JavaScript files, a main HTML file, a main CSS file, and some CSS files that get imported into the main one.
I understand that I can put static files in two places: a) the 'war' folder; or b) the 'public' folder.
Where is the best place to put my static files? Are the two locations treated differently? Is there a 'best practice' on this issue?
The difference between the 2 locations is that files in the public folders are copied by the gwt compiler to the 'your module' folder in the 'war' folder. This is means if you deploy the 'war' (for example via the google plugin to the google appengine) the files from the 'public' folder are not at the toplevel.
For example, if you have an index.html in the 'public' folder with gwt module named 'mymodule' and you deploy it to www.example.com it looks as follows, you need to access it via:
www.example.com/mymodule/index.html
If you have the index.html in the 'war' folder, you get:
www.example.com/index.html
Summarizing. Your landing page should be in the 'war' folder. Resource files used by the landing page can also be stored here (css, images). Any other resource file that is referred to in any gwt module file (or code, like images) should be stored in the 'public' folder related to the gwt module.
The new way of working in GWT is to use the war folder.
But, if you project is a reusable widget library which is used in a GWT application then you should put the resources in the public folder. The compiler will make sure that the files are automatically included in the generated package.
As I see it, it depends on your requirements, but let's start at a speaking example first ...
I find the documentation (should be GWT 2.6.0) about this to be incorrect or at least incomplete/confusing. As I see it (I am not a guru so please correct me if my investigations are wrong!) I am looking at the following example proj structure
myproj/
src/my/gwtproj/
client/
img/
foo1.png
AppClientBundle.java
foo2.png
public/
img/
foo3.png
foo4.png
war/
img/foo5.png
foo6.png
.classpath
.project
Imagine we may (or may not) need to reference such resources in some AppClientBundle interface (or other application reference context):
interfaces AppClientBundle extends ClientBundle {
#Source("img/foo1.png")
ImageResource fooImg();
}
Then it seems to depend on your Requirements, e.g.:
R.a) these resources (like images) are refered to in the application code, e.g. in our AppClientBundle interface via #Source annotations
R.b) these resources are to be grouped by folders, e.g. foo2.png vs. img/foo1.png
R.c) these resources should be available outside some specific application URL context path, e.g. if used as widget library, e.g. http://host1/gwtapp1/foo4.png vs. http://host1/gwtapp2/foo4.png
R.d) these resources need to be application-independently (e.g. externally) URL-referenced, e.g. http://host1/gwtapp1/foo4.png vs. http://host1/foo6.png
Here's what one can do (Possibilities) and it's implications regarding R.* above:
P.1) (generally recommended as I see it) put nicely folder-structured resources under my.gwtproj.client (here e.g. foo1.png)
this way #Source("img/foo1.png")... works fine
in the docs above they speek about some public folder (in my case my.gwtproj.public), but creating it as a package in Eclipse does not me allow this (since public is a reserved Java key word, but creating it via the Navigator view works)
however, this way the #Source above does not work (likely because it's an issue with the relative AppClientBundle file system location)
nevertheless if the resource should be publicly available under the application context one may have to do it via this public folder
P.2) put "ungrouped" resources directly under myproj/war, e.g. projdir/war/foo6.png
this way it can be used/found within annotations, e.g. #Source
and it can be referenced outside the application itself via e.g. http://host1/foo6.png
P.3) put folder-structured resources under myproj/war, e.g. projdir/war/img/foo5.png
in contrast to P.2) #Source("img/foo5.png") would not work anymore