Package org.bladerunnerjs.model

Examples of org.bladerunnerjs.model.App$Messages


    }
  }
 
  private void createJsDocPlaceHolder(Node node) {
    if(node instanceof App) {
      App app = (App) node;
     
      try {
        JsDocCommand.copyJsDocPlaceholder( app );
      }
      catch (IOException e) {
        logger.error(Messages.IO_ERROR_WHILE_WRITING_PLACEHOLDER_DOCS_LOG_MSG, app.getName());
      }
    }
  }
View Full Code Here


      .and(logging).containsFormattedConsoleMessage(APP_DEPLOYED_CONSOLE_MSG, app.getName());
  }
 
  @Test
  public void requirePrefixIsOptional() throws Exception {
    App myApp = brjs.app("myApp");
   
    given(appJars).hasBeenCreated();
    when(brjs).runCommand("create-app", "myApp");
    then(myApp).dirExists()
      .and(myApp.appConf()).namespaceIs("myapp");
  }
View Full Code Here

    then(myApp).dirExists()
      .and(myApp.appConf()).namespaceIs("myapp");
  }
  @Test
  public void requirePrefixIsOptionalAndCorrectPrefixIsWrittenToAppConf() throws Exception {
    App myApp = brjs.app("myApp");
   
    given(appJars).hasBeenCreated();
    when(brjs).runCommand("create-app", "myApp");
    then(myApp).dirExists()
      .and(myApp).fileContentsContains("app.conf","myapp");
View Full Code Here

    if (locale.isCompleteLocale()) {
      contentPath = i18nContentPlugin.getContentPathParser().createRequest(I18nContentPlugin.LANGUAGE_AND_LOCATION_BUNDLE, locale.getLanguageCode(), locale.getCountryCode());
    } else {
      contentPath = i18nContentPlugin.getContentPathParser().createRequest(I18nContentPlugin.LANGUAGE_BUNDLE, locale.getLanguageCode());       
    }
    App app = bundleSet.getBundlableNode().app();
    String requestPath = (isDev) ? app.createDevBundleRequest(contentPath, version) : app.createProdBundleRequest(contentPath, version);
   
    writer.write("<script type=\"text/javascript\" src=\"" + requestPath + "\"></script>\n");
  }
View Full Code Here

  }
 
  @Test
  public void testGenerateAppNamespace() throws UnableToAutomaticallyGenerateAppRequirePrefixException
  {
    App app = mock(App.class);
    when(app.getName()).thenReturn("my-App");
    assertEquals("myapp", NameValidator.generateRequirePrefixFromApp(app));
  }
View Full Code Here

  }
 
  @Test
  public void testExceptionThrownIfNamespaceCantBeAutomaticallyDetirmined() throws UnableToAutomaticallyGenerateAppRequirePrefixException
  {
    App app = mock(App.class);
    when(app.getName()).thenReturn("my�App");
    exception.expectMessage( startsWith("Unable to automatically calculate app namespace") );
    NameValidator.generateRequirePrefixFromApp(app);
  }
View Full Code Here

            || contentPath.formName.equals(VERSIONED_UNBUNDLED_RESOURCES_REQUEST))
        {
          String relativeFilePath = contentPath.properties.get(FILE_PATH_REQUEST_FORM);
         
          File unbundledResourcesDir = bundleSet.getBundlableNode().file(UNBUNDLED_RESOURCES_DIRNAME);
          App app = bundleSet.getBundlableNode().app();
          File requestedFile = new File(unbundledResourcesDir, relativeFilePath);
          String requestedFilePathRelativeToApp = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), requestedFile);
         
          if (!requestedFile.isFile())
          {
            String requestedFilePathRelativeToRoot = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir().getParentFile(), requestedFile);
            throw new ContentProcessingException("The requested unbundled resource at '"+requestedFilePathRelativeToRoot+"' does not exist or is not a file.");
          }
       
          ByteArrayOutputStream outputBuffer = new ByteArrayOutputStream();
          contentAccessor.handleRequest(requestedFilePathRelativeToApp, outputBuffer);
View Full Code Here

  private List<String> getGeneratedRequests(boolean isDev, Map<String, String> tagAttributes, BundleSet bundleSet, Locale locale, String version) throws MalformedTokenException, ContentProcessingException
  {
    List<String> possibleRequests = new ArrayList<String>();
    MinifierSetting minifierSettings = new MinifierSetting(tagAttributes);
    String minifierSetting = (isDev) ? minifierSettings.devSetting() : minifierSettings.prodSetting();
    App app = bundleSet.getBundlableNode().app();
   
    if(minifierSetting.equals(MinifierSetting.SEPARATE_JS_FILES)) {
      for(ContentPlugin contentPlugin : brjs.plugins().contentPlugins("text/javascript")) {
        List<String> contentPaths = (isDev) ? contentPlugin.getValidDevContentPaths(bundleSet) : contentPlugin.getValidProdContentPaths(bundleSet);
        for (String contentPath : contentPaths) {
          String requestPath = (isDev) ? app.createDevBundleRequest(contentPath, version) : app.createProdBundleRequest(contentPath, version);
          possibleRequests.add(requestPath);
        }
      }
    }
    else {
      String bundleRequestForm = (isDev) ? "dev-bundle-request" : "prod-bundle-request";
      String contentPath = compositeJsBundlerPlugin.getContentPathParser().createRequest(bundleRequestForm, minifierSetting);
      String requestPath = (isDev) ? app.createDevBundleRequest(contentPath, version) : app.createProdBundleRequest(contentPath, version);
      possibleRequests.add( requestPath );
    }
    return possibleRequests;
  }
View Full Code Here

  {
    if (contentPath.formName.equals(APP_META_REQUEST))
    {
      try
      {
        App app = bundleSet.getBundlableNode().app();
        //NOTE: this metadata is used by the BRAppMetaService
        return new CharResponseContent( brjs, "// these variables should not be used directly but accessed via the 'br.app-meta-service' instead\n" +
            "window.$BRJS_APP_VERSION = '"+version+"';\n" +
            "window.$BRJS_VERSIONED_BUNDLE_PATH = '"+AppMetadataUtility.getRelativeVersionedBundlePath(version, "")+"';\n" +
            "window.$BRJS_LOCALE_COOKIE_NAME = '"+app.appConf().getLocaleCookieName()+"';\n" +
            "window.$BRJS_APP_LOCALES = {'" + Joiner.on("':true, '").join(app.appConf().getLocales()) + "':true};\n" );
      }
      catch (ConfigException ex)
      {
        throw new ContentProcessingException(ex);
      }
View Full Code Here

    String sourceAppName = parsedArgs.getString("source-app-name");
    String sourceBladesetName = parsedArgs.getString("source-bladeset-name");
    String targetAppName = parsedArgs.getString("target-app-name");
    String targetBladesetName = (parsedArgs.getString("target-bladeset-name") == null) ? sourceBladesetName : parsedArgs.getString("target-bladeset-name");
   
    App sourceApp = brjs.app(sourceAppName);
    Bladeset sourceBladeset = sourceApp.bladeset(sourceBladesetName);
    App targetApp = brjs.app(targetAppName);
   
    try {
      NameValidator.assertValidPackageName(targetApp, targetBladesetName);
    }
    catch (InvalidPackageNameException e) {
      throw new CommandArgumentsException(e, this);
    }
   
    Bladeset targetBladeset = targetApp.bladeset(targetBladesetName);
   
    if (!sourceApp.dirExists()) throw new NodeDoesNotExistException(sourceApp, this);
    if (!sourceBladeset.dirExists()) throw new NodeDoesNotExistException(sourceBladeset, this);
    if (!targetApp.dirExists()) throw new NodeDoesNotExistException(targetApp, this);
    if (targetBladeset.dirExists()) throw new NodeAlreadyExistsException(targetBladeset, this);
   
    try {
      NodeImporter.importBladeset(sourceBladeset.dir(), sourceApp.appConf().getRequirePrefix(), sourceApp.appConf().getRequirePrefix() + "/" + sourceBladesetName, targetBladeset);
     
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.App$Messages

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.