Ejemplo n.º 1
0
  public void execute() throws Exception {
    // zws.util.Logwriter.printOnConsole(this,"execute",getCriteria());
    TC10RepositoryBase rep = getRepository();
    SearchAgent agent = rep.materializeSearchAgent();
    agent.setAuthenticationToken(getAuthentication());
    agent.setCriteria(getCriteria());
    agent.initializeStorage();
    agent.execute();

    WaitForThreads waiter = new WaitForThreads();
    waiter.addThread(agent.getThread());
    waiter.run();

    Collection c = agent.getResults();
    storeAll(c);
    PrintUtil.print("agentResults from TC10Searcher.execute " + c);
    // {} //System.out.println("**********TC10Searcher.exexute********");
    // {} //System.out.println(c.toString());
    // {} //System.out.println("**********TC10Searcher.exexute********");
  }
Ejemplo n.º 2
0
  // Option 1
  public void createTest(
      String hostname,
      String port,
      String username,
      String password,
      String itemId,
      String revision,
      String type,
      String name,
      String desc,
      String uom) {

    {
    } // System.out.println("");
    {
    } // System.out.println("---------------Create Test----------------");

    TC10RepositoryBase tc10 = new TC10RepositoryBase();
    tc10.setDomainName("zws");
    tc10.setServerName("node-0");
    tc10.setRepositoryName("TC-QA-server");
    tc10.setHostName(hostname);
    tc10.setPort(port);
    tc10.setServicesPath("tc/services/PLMGatewayService");

    try {

      RepositoryMetadataTarget target = tc10.materializeMetadataTarget();
      QxContext ctx = new QxContext();
      Authentication id = new Authentication(username, password);

      tc10.login(id);

      // Create a new item/item revision
      TC10ItemRevOrigin o = (TC10ItemRevOrigin) materializeTC10ItemRevOrigin(itemId, revision);
      MetadataBase data = new MetadataBase();
      /*
            {} //System.out.println("+itemId: "+itemId);
            {} //System.out.println("+revId: "+revision);
            {} //System.out.println("+type: "+type);
            {} //System.out.println("+name: "+name);
            {} //System.out.println("+desc: "+desc);
            {} //System.out.println("+uom: "+uom);
      */
      data.setOrigin(o);
      data.set(TC10Constants.ITEM_ID, itemId);
      data.set(TC10Constants.REVISION, revision);
      data.set(TC10Constants.TYPE, type);
      data.set(TC10Constants.NAME, name);
      data.set(TC10Constants.DESCRIPTION, desc);
      data.set(TC10Constants.UNIT_OF_MEASURE, uom);

      Origin tcOrig = target.create(ctx, data, null, id);
      PrintUtil.print(tcOrig);

      tc10.logout(id);
    } catch (Exception e) {
      {
      } // System.out.println(e.getMessage());
      e.printStackTrace();
    }
    {
    } // System.out.println("");
    {
    } // System.out.println("---------------Create Test End--------------");
  }