Package org.bladerunnerjs.model.exception.command

Examples of org.bladerunnerjs.model.exception.command.CommandOperationException


    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException e) {
      throw new CommandOperationException("Cannot create blade '" + blade.dir().getPath() + "'", e);
    }
   
    logger.println(Messages.BLADE_CREATE_SUCCESS_CONSOLE_MSG, bladeName);
    logger.println(Messages.BLADE_PATH_CONSOLE_MSG, blade.dir().getPath());
   
View Full Code Here


            bladeset.create();
          }
        }
        catch (InvalidNameException | ModelUpdateException e)
        {
          throw new CommandOperationException(e);
        }
    }
    return bladeset;
  }
View Full Code Here

    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException e) {
      throw new CommandOperationException("Cannot create library '" + library.dir().getPath() + "'", e);
    }
   
    logger.println(Messages.LIBRARY_CREATE_SUCCESS_CONSOLE_MSG, libraryName);
    logger.println(Messages.LIBRARY_PATH_CONSOLE_MSG, library.dir().getPath());
   
View Full Code Here

      manifest = new ThirdpartyLibManifest( library.assetLocation(".") );
      manifest.write();
    }
    catch (ConfigException | IOException e)
    {
      throw new CommandOperationException("Cannot create library manifest for '" + library.dir().getPath() + "'", e);
    }
  }
View Full Code Here

      throw new CommandArgumentsException(Messages.INVALID_PORT_MESSAGE + " '" + parsedArgs.getString("port") + "' ", e, this);
    }
   
    catch (IOException e)
    {
      throw new CommandOperationException(e);
    }
    catch (Exception ex)
    {
      throw new CommandOperationException("Error creating application server.", ex);
    }
   
    return 0;
  }
View Full Code Here

    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException | TemplateInstallationException e) {
      throw new CommandOperationException("Cannot create application '" + app.dir().getPath() + "'", e);
    }
    return 0;
  }
View Full Code Here

      {
        compiledClassDir = getCompiledClassDir(brjs, testContainerDir);
      }
      catch (IOException ex)
      {
        throw new CommandOperationException("Error creating directory for compiled tests.", ex);
      }
     
      // see http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm for command line args
      String[] compilerArgs = new String[]{ "-1.6", "-sourcepath", sourcePath.toString(), "-d", compiledClassDir.getPath(), "-encoding", "UTF-8", "-nowarn", testContainerDir.getPath() };
     
      boolean compileReturnValue = org.eclipse.jdt.core.compiler.batch.BatchCompiler.compile(
          compilerArgs,
          new PrintWriter(System.out),
          new PrintWriter(System.err),
          null );
      if (!compileReturnValue)
      {
        throw new CommandOperationException("Error compiling files in '" + testContainerDir.getPath() + "'.");
      }
      classRoots.add(compiledClassDir);
    }
    return classRoots;
  }
View Full Code Here

     
      if(isTestDir != isTestClass)
      {
        if(isTestDir)
        {
          throw new CommandOperationException("'" + sourceFile.getName() +
            "' doesn't end 'Test.java' but has been placed into a 'tests' directory ('" + sourceFile.getAbsolutePath() + "').");
        }
        else
        {
          throw new CommandOperationException("'" + sourceFile.getName() +
            "' ends with 'Test.java' but has been placed outside of 'tests' directory ('" + sourceFile.getAbsolutePath() + "').");
        }
      }
    }
  }
View Full Code Here

          Class<?> nextClass = classloader.loadClass(getTestClassName(classFile));
          loadedClasses.add(nextClass);
        }
        catch (MalformedURLException ex)
        {
          throw new CommandOperationException(ex);
        }
        catch (ClassNotFoundException ex)
        {
          throw new CommandOperationException(ex);
        }
      }
    }
    return loadedClasses;
  }
View Full Code Here

    {
      classesRoot = testCompiler.getClassesRoot(testRoot);
    }
    catch (IOException ex)
    {
      throw new CommandOperationException("Error creating directory for compiled tests.", ex);
    }
    if (classesRoot.exists())
    {
      FileUtils.deleteQuietly(classesRoot);
    }
   
    List<File> testContainerDirs = new IntegrationTestFinder().findTestContainerDirs(brjs, testRoot, ignoreWorkbenches(args));
    if (testContainerDirs.size() < 1)
    {
      throw new CommandOperationException("No tests found.");
    }
    logger.println("Found tests in " + testContainerDirs.size() + " location(s).");
   
    List<File> classDirs = testCompiler.compileTestDirs(brjs, testContainerDirs);
   
    List<Class<?>> testClasses = testCompiler.loadClasses(classDirs);
   
    Result testResult = null;
    try {
      File runnerConf = TestRunnerConfLocator.getTestRunnerConf();
      testResult = new IntegrationTestRunner().runTests(runnerConf, testClasses);
    }
    catch (Exception ex)
    {
      throw new CommandOperationException(ex);
    }
   
    printTestReport(testResult);
    if (testResult.getFailures().size() > 0)
    {
      throw new CommandOperationException("There were failing tests.");
    }
    return 0;
  }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.exception.command.CommandOperationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.