Beispiel #1
0
 public void testJdk() {
   try {
     CommandLineBuilder.createFromJavaParameters(new JavaParameters());
     fail("CantRunException (main class is not specified) expected");
   } catch (CantRunException e) {
     Assert.assertEquals(
         ExecutionBundle.message("run.configuration.error.no.jdk.specified"), e.getMessage());
   }
 }
Beispiel #2
0
 public void testMainClass() {
   try {
     JavaParameters javaParameters = new JavaParameters();
     javaParameters.setJdk(getProjectJDK());
     CommandLineBuilder.createFromJavaParameters(javaParameters);
     fail("CantRunException (main class is not specified) expected");
   } catch (CantRunException e) {
     assertEquals(
         ExecutionBundle.message("main.class.is.not.specified.error.message"), e.getMessage());
   }
 }
 protected PsiPackage getPackage(JUnitConfiguration.Data data) throws CantRunException {
   final Project project = myConfiguration.getProject();
   final String packageName = data.getPackageName();
   final PsiManager psiManager = PsiManager.getInstance(project);
   final PsiPackage aPackage =
       JavaPsiFacade.getInstance(psiManager.getProject()).findPackage(packageName);
   if (aPackage == null) throw CantRunException.packageNotFound(packageName);
   return aPackage;
 }