could not find or load class org.testng.TestNg - ant

I am trying to understand how to use Ant script and testNG. I am new to Ant
I am following this tutorial Link http://seleniumeasy.com/ant-tutorials/how-to-run-testng-tests-using-build-xml-file
The build seems to be successful however i get the following error in cmd :
Error: Could not find or load main class org.testing.Test

I'm guessing you have local code that declares a package of "org.testing"? Much better idea to ensure your classes belong to a namespace peculiar to you.
The Selenium imports are:
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

Related

Cannot import hamcrest matchers for some reason

I am super new to unit testing and java in general, so my apologies for the basic question. However, when I try to import import static org.hamcrest.Matchers.hasEntry; I get a message saying "cannot resolve symbol 'Matchers'. I'm trying to use hasEntry to unit test a method that returns a map.
Here are the imports I have
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasEntry;
the top two are working fine, but I can't get the last one to work. If anyone has any suggestions as to how to fix the problem, or if there is another way I can import hasEntry, please let me know! Thank you
Which version of Hamcrest are you using?
It would be great if you put your pom.xml file here to facilitate the analysis.
Maybe you only need to trigger another import maven command (with force update snapshots) in your IDE, for example, to refresh your local dependencies.
Or you can try this:
mvn --batch-mode --update-snapshots clean package

Agda Installation PLFA Configuration

I am trying to use the Programming Language Foundation with Agda plfa library, however the import does not appear to be working properly.
I have cloned the repository and added the repository path to: ~/.agda/libraries and plfa to ~/.agda/defaults.
When I create a test.agda file and check a single line
module plfa.part1.Naturals where
I get an import error:
You tried to load /Users/johngfisher/Desktop/agda_test/nats.agda
which defines the module plfa.part1.Naturals. However, according to
the include path this module should be defined in
/Users/johngfisher/agda_env/libraries/plfa/src/plfa/part1/Naturals.lagda.md
The file is present in the location the import is coming from so I am unsure of why Agda is unable to find it. Any help would be appreciated.
module plfa.part1.Naturals where
defines a module named plfa.part1.Naturals
Did you mean to type
module test where
open import plfa.part1.Naturals
instead?

Import Resource keyword fails while executing --dryrun command in Robot Framework

Impoort Resource keyword fails at --dryrun with error: No keyword found but execution passes.
Import Resource MyResource.robot
MyResource.ABCKeyword argument
In above example, ABCKeyword fails at --dryrun but while executing this keyword in a test case passes. I want it to pass this at --dryrun also as it's failing in Jenkins build at --dryrun.
Let me know what's the alternate to this.
This is behaving as expected. Import Resource will not import the resource during a dry run. Since the file isn't imported, the keywords in it won't be known to robot.
I don't think there's an alternate solution, other than to import the resource file in the settings block rather than with the import resource keyword.

Flutter - Is there an effect on having a single import rather than multiple?

Basically I have a lot of widgets and services and stuff, like most people do, that I need to access throughout the app. I was wondering if have a single file with an export of every single file and then just simply importing that one file in every page/file i need to access something rather than just importing specific files that the page needs, will it slow down the app or cause any issues or increase file size, etc... or will it behave the same?
Example
login_page.dart
import '1.dart'
import '2.dart'
home_page.dart
import '2.dart'
import '3.dart'
import '9.dart'
import '10.dart'
settings_page.dart
import '1.dart'
import '2.dart'
import '9.dart'
import '10.dart'
or...
all_imports.dart:
export '1.dart'
export '2.dart'
export '3.dart'
... (up until)
export '10.dart'
in every dart file:
import 'all_imports.dart'
Using 'all_imports.dart' may cause unneeded dependencies but dart knows how to handle dependencies that called but not used.
Same implementation of 'all_imports.dart' is used by flutter team on 'material.dart'
You may wish to just make simple design but when you import 'material.dart' it brings everything to the table ('about.dart', 'app.dart', 'banner.dart') and many others.
I would advise you structure your application using 'all_import.dart' pattern
actually, it dosent make a difference, lets imagine this case
in login_page.dart
import '1.dart'
import '2.dart'
here you are being explicit about the dependencies of this module/file/widget, which means it only uses what it needs. which is better for maintenance and redablity of the modules dependanices.
the other case where you have all of your imports in one file
import 'all_imports.dart'
lets see what happens here:
Dart executes the file all_imports.dart
that file is importing every module that you have listed in that file
so the import calls happend again
which means that wont affect your software's performance if you dont have an all_imports.dart file.
actulally i find that this method(the all_imports.dart) will affect your program in a bad way if any.
why? lets say we have a module A that depends on both module B and module C , you would import them this way
moduleA.dart
import 'moduleB'
import 'moduleC'
the advantages is that the module is now explicit in its dependencies and anyone who looks at this module/file in the future will know what they are.
however
the other method where you have all of your imports in a single all_imports.dart file, will cause unneeded dependencies to be loaded for a certain module
lets have the same example above, module A depends on moduleB and moduleC and you listed them in the all_imports.dart file, it will look like this
export `moduleA'
export 'moduleB'
/// some other modules that you are exporting
and in the moduleA.dart file you import it this way
import 'all_imports.dart`
now
the module A has successfully imported moduleB and moduleC which it needs. BUT, now it has all the other dependancies that it dose not need loaded for it although it only needs moduleA and moduleB.

Unable to import org.apache.common.collections.list

I am using Groovy Grails Tool Suite for my Grails project.
I am trying to use LazyList.decorate in one of my domain classes and so want to import org.apache.common.collections.list within the domain class.
I see that org.apache.commons.collections_3.2.0.v2013030210310.jar is available under the GGTS plugins folder.
However, the editor shows an error at the import statement saying "Groovy: Unable to resolve org.apache.common.collections.list".
Please help!
Since the question is missing a code snippet I suspect you have a line like this import org.apache.common.collections.list. You should do import org.apache.common.collections.list.* - or if only LazyList is what you want: import org.apache.common.collections.list.LazyList

Resources