Package integration.tests

Examples of integration.tests.ToDoItemIntegTest$Properties$Category


    public void test_0() throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ObjectOutputStream objectOut = new ObjectOutputStream(out);

        Category p = new Category();
        p.setId(1);
        p.setName("root");
        {
            Category child = new Category();
            child.setId(2);
            child.setName("child");
            p.getChildren().add(child);
            child.setParent(p);
        }
        objectOut.writeObject(p);
    }
View Full Code Here


    private Object object;

    public CategoryEncode(){
        super("CategoryEncode");

        Category category = new Category();
        category.setId(1);
        category.setName("root");
        {
            Category child = new Category();
            child.setId(2);
            child.setName("child");
            category.getChildren().add(child);
            child.setParent(category);
        }

        object = category;
    }
View Full Code Here

        Property[] properties = new Property[3];
        properties[0] = new Property(SystemStatistics.ORGANIZATION_COUNT.name(), Long.toString(organizationService.countAll()), SystemStatistics.ORGANIZATION_COUNT.getDescription());
        properties[1] = new Property(SystemStatistics.USER_COUNT.name(), Long.toString(userService.countAll()), SystemStatistics.USER_COUNT.getDescription());
        properties[2] = new Property(SystemStatistics.APPLICATION_COUNT.name(), Long.toString(applicationService.countAll()), SystemStatistics.APPLICATION_COUNT.getDescription());

        Properties props = new Properties();
        props.setProperties(properties);

        return props;
    }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.CATEGORY: {
            Category category = (Category) theEObject;
            T result = caseCategory(category);
            if (result == null)
                result = caseRootElement(category);
            if (result == null)
                result = caseBaseElement(category);
View Full Code Here

            doc.appendChild(rootElement);
        }

      for (Object object : categories) {
      if (object instanceof Category){
        Category cat=(Category)object;
        Element categoryDef = doc.createElement("category-def");
        categoryDef.setAttribute("name", cat.getId());
        categoryDef.setAttribute("label", cat.getLabel());
        rootElement.appendChild(categoryDef);
        Element descriptionElement = doc.createElement("description");
        descriptionElement.setTextContent(cat.getDescription());
        categoryDef.appendChild(descriptionElement);
        ArrayList processedFeatures = cat.getProcessedFeatures(project, artifactFactory, remoteRepositories, localRepository, resolver);
        for (Object obj : processedFeatures) {
          FeatureArtifact feature=(FeatureArtifact)obj;
          if (!featureCategories.containsKey(feature.getArtifactId())){
            ArrayList list = new ArrayList();
            featureCategories.put(feature.getArtifactId(), list);
            list.add(feature);
          }
          ArrayList list = (ArrayList)featureCategories.get(feature.getArtifactId());
          list.add(cat.getId());
        }
      }
    }
     
      for (Object key : featureCategories.keySet()) {
View Full Code Here

  }

 
  public static String loadWithNewPattern(S3 s3,RefInteger storage, String path) {
    PageContext pc = ThreadLocalPageContext.get();
    Properties prop=null;
    if(pc!=null){
      prop=pc.getApplicationContext().getS3();
    }
    if(prop==null) prop=new PropertiesImpl();
   
    int defaultLocation = prop.getDefaultLocation();
    storage.setValue(defaultLocation);
    String accessKeyId = prop.getAccessKeyId();
    String secretAccessKey = prop.getSecretAccessKey();
   
    int atIndex=path.indexOf('@');
    int slashIndex=path.indexOf('/');
    if(slashIndex==-1){
      slashIndex=path.length();
      path+="/";
    }
    int index;
   
    // key/id
    if(atIndex!=-1) {
      index=path.indexOf(':');
      if(index!=-1 && index<atIndex) {
        accessKeyId=path.substring(0,index);
        secretAccessKey=path.substring(index+1,atIndex);
        index=secretAccessKey.indexOf(':');
        if(index!=-1) {
          String strStorage=secretAccessKey.substring(index+1).trim().toLowerCase();
          secretAccessKey=secretAccessKey.substring(0,index);
          //print.out("storage:"+strStorage);
          storage.setValue(S3.toIntStorage(strStorage, defaultLocation));
        }
      }
      else accessKeyId=path.substring(0,atIndex);
    }
    path=prettifyPath(path.substring(atIndex+1));
    index=path.indexOf('/');
    s3.setHost(prop.getHost());
    if(index==-1){
      if(path.equalsIgnoreCase(S3Constants.HOST) || path.equalsIgnoreCase(prop.getHost())){
        s3.setHost(path);
        path="/";
      }
    }
    else {
      String host=path.substring(0,index);
      if(host.equalsIgnoreCase(S3Constants.HOST) || host.equalsIgnoreCase(prop.getHost())){
        s3.setHost(host);
        path=path.substring(index);
      }
    }
   
View Full Code Here

    if(ac.isORMEnabled()){
      ORMConfiguration conf = ac.getORMConfiguration();
      if(conf!=null)sct.setEL(KeyConstants._orm, conf.toStruct());
    }
    // s3
    Properties props = ac.getS3();
    if(props!=null) {
      sct.setEL(KeyConstants._s3, props.toStruct());
    }
   
    // datasources
    DataSource[] sources = ac.getDataSources();
    if(!ArrayUtil.isEmpty(sources)){
View Full Code Here

TOP

Related Classes of integration.tests.ToDoItemIntegTest$Properties$Category

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.