continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r649340 - in /continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration: ./ ConfigurationServiceMock.java
Date Fri, 18 Apr 2008 00:59:06 GMT
Author: carlos
Date: Thu Apr 17 17:59:04 2008
New Revision: 649340

URL: http://svn.apache.org/viewvc?rev=649340&view=rev
Log:
Add a ConfigurationService mock from continuum-notifier-wagon

Added:
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
  (with props)

Added: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java?rev=649340&view=auto
==============================================================================
--- continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
(added)
+++ continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
Thu Apr 17 17:59:04 2008
@@ -0,0 +1,214 @@
+package org.apache.maven.continuum.configuration;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.util.Map;
+
+import org.apache.maven.continuum.configuration.ConfigurationException;
+import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
+import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.configuration.ConfigurationStoringException;
+import org.apache.maven.continuum.model.project.Schedule;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+
+/**
+ * Mock class for testing WagonContinuumNotifier's call to ConfigurationService.getBuildOutputFile()
+ *
+ * @author <a href="mailto:nramirez@exist">Napoleon Esmundo C. Ramirez</a>
+ */
+public class ConfigurationServiceMock
+    implements ConfigurationService
+{
+    private String basedir;
+
+    public ConfigurationServiceMock()
+    {
+        basedir = System.getProperty( "basedir" );
+    }
+
+    public File getBuildOutputDirectory()
+    {
+        return new File( basedir, "src/test/resources" + "/" + "build-output-directory" );
+    }
+
+    public File getBuildOutputDirectory( int projectId )
+    {
+        return new File( getBuildOutputDirectory(), Integer.toString( projectId ) );
+    }
+
+    public File getBuildOutputFile( int buildId, int projectId )
+        throws ConfigurationException
+    {
+        File dir = getBuildOutputDirectory( projectId );
+
+        if ( !dir.exists() && !dir.mkdirs() )
+        {
+            throw new ConfigurationException(
+                "Could not make the build output directory: " + "'" + dir.getAbsolutePath()
+ "'." );
+        }
+
+        return new File( dir, buildId + ".log.txt" );
+    }
+
+    public File getWorkingDirectory()
+    {
+        return new File( basedir, "src/test/resources" + "/" + "working-directory" );
+    }
+
+    public File getTestReportsDirectory( int buildId, int projectId )
+        throws ConfigurationException
+    {
+        File dir = getBuildOutputDirectory( projectId );
+
+        if ( !dir.exists() && !dir.mkdirs() )
+        {
+            throw new ConfigurationException(
+                "Could not make the build output directory: " + "'" + dir.getAbsolutePath()
+ "'." );
+        }
+        return new File( dir.getPath() + File.separatorChar + buildId + File.separatorChar
+ "surefire-reports " );
+    }
+
+    public File getApplicationHome()
+    {
+        return null;
+    }
+
+    public boolean isInitialized()
+    {
+        return false;
+    }
+
+    public void setInitialized( boolean initialized )
+    {
+    }
+
+    public String getUrl()
+    {
+        return null;
+    }
+
+    public void setUrl( String url )
+    {
+    }
+
+    public void setBuildOutputDirectory( File buildOutputDirectory )
+    {
+    }
+
+    public void setWorkingDirectory( File workingDirectory )
+    {
+    }
+
+    public File getDeploymentRepositoryDirectory()
+    {
+        return null;
+    }
+
+    public void setDeploymentRepositoryDirectory( File deploymentRepositoryDirectory )
+    {
+    }
+
+    public void setJdks( Map jdks )
+    {
+    }
+
+    public String getCompanyLogo()
+    {
+        return null;
+    }
+
+    public void setCompanyLogo( String companyLogoUrl )
+    {
+    }
+
+    public String getCompanyName()
+    {
+        return null;
+    }
+
+    public void setCompanyName( String companyName )
+    {
+    }
+
+    public String getCompanyUrl()
+    {
+        return null;
+    }
+
+    public void setCompanyUrl( String companyUrl )
+    {
+    }
+
+    public boolean isGuestAccountEnabled()
+    {
+        return false;
+    }
+
+    public void setGuestAccountEnabled( boolean enabled )
+    {
+    }
+
+    public String getBuildOutput( int buildId, int projectId )
+        throws ConfigurationException
+    {
+        return null;
+    }
+
+    public File getFile( String filename )
+    {
+        return null;
+    }
+
+    public boolean isLoaded()
+    {
+        return false;
+    }
+
+    public void load()
+        throws ConfigurationLoadingException
+    {
+    }
+
+    public void store()
+        throws ConfigurationStoringException
+    {
+    }
+
+    public Schedule getDefaultSchedule()
+        throws ContinuumStoreException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public File getChrootJailDirectory()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void setChrootJailDirectory( File chrootJailDirectory )
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+}

Propchange: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message