Coverage Report - org.apache.maven.plugin.eclipse.WorkspaceConfiguration
 
Classes in this File Line Coverage Branch Coverage Complexity
WorkspaceConfiguration
43%
16/37
64%
9/14
1.706
 
 1  
 package org.apache.maven.plugin.eclipse;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *   http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import java.io.File;
 23  
 import java.net.URL;
 24  
 
 25  
 import org.apache.maven.artifact.repository.ArtifactRepository;
 26  
 import org.apache.maven.plugin.ide.IdeDependency;
 27  
 
 28  3
 public class WorkspaceConfiguration
 29  
 {
 30  
     private File workspaceDirectory;
 31  
 
 32  
     private URL codeStylesURL;
 33  
 
 34  
     private String activeCodeStyleProfileName;
 35  
 
 36  
     private ArtifactRepository localRepository;
 37  
 
 38  
     private String defaultClasspathContainer;
 39  
 
 40  
     private IdeDependency[] workspaceArtefacts;
 41  
 
 42  
     private String defaultDeployServerId;
 43  
 
 44  
     private String defaultDeployServerName;
 45  
 
 46  
     public File getWorkspaceDirectory()
 47  
     {
 48  4
         return this.workspaceDirectory;
 49  
     }
 50  
 
 51  
     public void setWorkspaceDirectory( File dir )
 52  
     {
 53  2
         this.workspaceDirectory = dir;
 54  2
     }
 55  
 
 56  
     public URL getCodeStylesURL()
 57  
     {
 58  0
         return this.codeStylesURL;
 59  
     }
 60  
 
 61  
     public void setCodeStylesURL( URL url )
 62  
     {
 63  0
         this.codeStylesURL = url;
 64  0
     }
 65  
 
 66  
     public String getActiveStyleProfileName()
 67  
     {
 68  0
         return this.activeCodeStyleProfileName;
 69  
     }
 70  
 
 71  
     public void setActiveStyleProfileName( String name )
 72  
     {
 73  0
         this.activeCodeStyleProfileName = name;
 74  0
     }
 75  
 
 76  
     public ArtifactRepository getLocalRepository()
 77  
     {
 78  0
         return localRepository;
 79  
     }
 80  
 
 81  
     public void setLocalRepository( ArtifactRepository localRepository )
 82  
     {
 83  0
         this.localRepository = localRepository;
 84  0
     }
 85  
 
 86  
     public String getDefaultClasspathContainer()
 87  
     {
 88  0
         return defaultClasspathContainer;
 89  
     }
 90  
 
 91  
     public void setDefaultClasspathContainer( String defaultClasspathContainer )
 92  
     {
 93  0
         this.defaultClasspathContainer = defaultClasspathContainer;
 94  0
     }
 95  
 
 96  
     public IdeDependency[] getWorkspaceArtefacts()
 97  
     {
 98  0
         return workspaceArtefacts;
 99  
     }
 100  
 
 101  
     public void setWorkspaceArtefacts( IdeDependency[] workspaceArtefacts )
 102  
     {
 103  0
         this.workspaceArtefacts = workspaceArtefacts;
 104  0
     }
 105  
 
 106  
     public String getDefaultDeployServerId()
 107  
     {
 108  24
         return defaultDeployServerId;
 109  
     }
 110  
 
 111  
     public void setDefaultDeployServerId( String defaultDeployServerId )
 112  
     {
 113  5
         this.defaultDeployServerId = defaultDeployServerId;
 114  5
     }
 115  
 
 116  
     public String getDefaultDeployServerName()
 117  
     {
 118  0
         return defaultDeployServerName;
 119  
     }
 120  
 
 121  
     public void setDefaultDeployServerName( String defaultDeployServerName )
 122  
     {
 123  0
         this.defaultDeployServerName = defaultDeployServerName;
 124  0
     }
 125  
 
 126  
     /**
 127  
      * @return the defined websphere server version and null if the target is no websphere.
 128  
      */
 129  
     public String getWebsphereVersion()
 130  
     {
 131  5
         if ( getDefaultDeployServerId() != null && getDefaultDeployServerId().startsWith( "was." ) )
 132  
         {
 133  5
             if ( getDefaultDeployServerId().indexOf( "v7" ) >= 0 )
 134  
             {
 135  1
                 return "7.0";
 136  
             }
 137  4
             if ( getDefaultDeployServerId().indexOf( "v61" ) >= 0 )
 138  
             {
 139  1
                 return "6.1";
 140  
             }
 141  3
             if ( getDefaultDeployServerId().indexOf( "v6" ) >= 0 )
 142  
             {
 143  1
                 return "6.0";
 144  
             }
 145  2
             if ( getDefaultDeployServerId().indexOf( "v51" ) >= 0 )
 146  
             {
 147  2
                 return "5.1";
 148  
             }
 149  0
             if ( getDefaultDeployServerId().indexOf( "v5" ) >= 0 )
 150  
             {
 151  0
                 return "5.0";
 152  
             }
 153  
         }
 154  0
         return null;
 155  
     }
 156  
 
 157  
 }