Forum Discussion

Karbert's avatar
Karbert
Occasional Contributor
9 years ago

lastOpened property causes svn conflict

Hi,

 

We store the composite projects in SVN. After closing and reopening a project, a new property is added to the project's setting.xml file: lastOpened. Unfortunately this causes SVN conflict in case more users open the same project, even if nobody changed anything. 

Is there a possibility to disable the creation of this property?

 

Best regards,

Norbert Kando

  • I've managed to "fix" this by removing the lastOpened attribute in a projectListener's beforeSave method:

     

    @Override
    public void beforeSave(Project project) {
        ProjectConfig pc = ((AbstractWsdlModelItem<ProjectConfig>) project).getConfig();
        pc.unsetLastOpened();
    }

  • Karbert's avatar
    Karbert
    Occasional Contributor

    I've managed to "fix" this by removing the lastOpened attribute in a projectListener's beforeSave method:

     

    @Override
    public void beforeSave(Project project) {
        ProjectConfig pc = ((AbstractWsdlModelItem<ProjectConfig>) project).getConfig();
        pc.unsetLastOpened();
    }

    • jmwest's avatar
      jmwest
      New Contributor

      Hi, can you share the entire java file that you used?  Also, what version of the soapui jar are you using?  I am trying to solve this exact same problem but there is no ProjectConfig.unsetLastOpened() method.  I have tried the following two artifacts to no avail:

       

      <dependency>
      <groupId>com.smartbear.soapui</groupId>
      <artifactId>soapui</artifactId>
      <version>4.6.1</version>
      </dependency>

       

      and

       

      <dependency>
      <groupId>com.smartbear.soapui</groupId>
      <artifactId>soapui</artifactId>
      <version>5.0.0</version>
      </dependency>

       

      I am not sure what I am missing.  Here is what I have so far:

       

      package soapui.listeners.project;

       

      import com.eviware.soapui.config.ProjectConfig;
      import com.eviware.soapui.impl.wsdl.AbstractWsdlModelItem;
      import com.eviware.soapui.model.project.Project;
      import com.eviware.soapui.model.support.ProjectListenerAdapter;

       

      public class MyProjectListener extends ProjectListenerAdapter
      {

          @Override
          public void beforeSave(Project project){
              ProjectConfig pc = ((AbstractWsdlModelItem<ProjectConfig>) project).getConfig();
              pc.unsetLastOpened(); //Compiler Error: "Method unsetLastOpened() is undefined for type..."
          }
      }

       

       

      My first attempt at a listener for SoapUI so any help here would be greatly appreciated.  

       

      Thanks,

      Jerry

    • linkeshkanna's avatar
      linkeshkanna
      Occasional Contributor

      I am using the latest version of Ready API - 1.9.0 and I am not able to see the BeforeSave Event Listener.