Changeset 1945


Ignore:
Timestamp:
2011-09-01 13:15:41 (9 months ago)
Author:
mpo
Message:

cleanup and refactoring tests
no need for output in case of 1001: body is empty
(the useful info is dumped through logging forced to trace by settings in the pom)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/kauri-runtime-testfw/src/main/java/org/kauriproject/runtime/testfw/AbstractRuntimeTest.java

    r1943 r1945  
    2121import java.io.IOException; 
    2222import java.util.Collections; 
     23import java.util.HashSet; 
    2324import java.util.Set; 
    24 import java.util.HashSet; 
    2525 
    2626import junit.framework.TestCase; 
    2727 
     28import org.apache.log4j.ConsoleAppender; 
     29import org.apache.log4j.Level; 
     30import org.apache.log4j.Logger; 
     31import org.apache.log4j.PatternLayout; 
    2832import org.kauriproject.runtime.KauriRuntime; 
    2933import org.kauriproject.runtime.KauriRuntimeSettings; 
     34import org.kauriproject.runtime.configuration.ConfManager; 
    3035import org.kauriproject.runtime.configuration.ConfManagerImpl; 
    31 import org.kauriproject.runtime.configuration.ConfManager; 
     36import org.kauriproject.runtime.model.KauriRuntimeModel; 
    3237import org.kauriproject.runtime.rapi.Mode; 
    33 import org.kauriproject.runtime.model.KauriRuntimeModel; 
    3438import org.kauriproject.runtime.repository.ArtifactNotFoundException; 
    3539import org.kauriproject.runtime.repository.ArtifactRepository; 
     
    4347import org.restlet.data.Protocol; 
    4448import org.restlet.data.Reference; 
    45 import org.apache.log4j.ConsoleAppender; 
    46 import org.apache.log4j.PatternLayout; 
    47 import org.apache.log4j.Logger; 
    48 import org.apache.log4j.Level; 
    4949 
    5050public abstract class AbstractRuntimeTest extends TestCase { 
     
    8282                    if (file.exists()) 
    8383                        return new ResolvedArtifact(file, Collections.singletonList(file.getAbsolutePath()), true); 
    84                     else 
    85                         return super.tryResolve(groupId, artifactId, classifier, version); 
     84                    //else 
     85                    return super.tryResolve(groupId, artifactId, classifier, version); 
    8686                } 
    8787            }; 
     
    186186     * Creates a configuration dir based on a package name. 
    187187     */ 
    188     public File createConfDir(String confName) throws IOException { 
     188    public File createConfDir(String confName) { 
    189189        String basedir = System.getProperty("basedir"); // This property is set by the Maven surefire:test goal 
    190190        if (basedir == null) { // we are not running in maven, assume the current working dir is the basedir: 
     
    334334     */ 
    335335    protected Response assertedResponseFor(final String path, final int statusCode, final String responseText) throws IOException { 
    336         Client client = getTestClientDispatcher(); 
    337         Reference ref = makeTestReference(path); 
    338         Request request = new Request(Method.GET, ref); 
    339         Response response = client.handle(request); 
    340  
    341         // start temp-code for checking test failures only @ci.outerthought.org 
    342         if (response.getStatus().getCode() != statusCode) { 
    343             // dump response body before assertion to retrieve some more detail in the logs on hudson 
    344             System.out.println("Unexpected response code. Dumping BODY:--\n" + response.getEntityAsText() + "\n--"); 
    345         } 
    346         // end temp-code 
     336        final Client client = getTestClientDispatcher(); 
     337        final Reference ref = makeTestReference(path); 
     338        final Request request = new Request(Method.GET, ref); 
     339        final Response response = client.handle(request); 
    347340         
    348341        assertEquals(statusCode, response.getStatus().getCode()); 
  • trunk/modules/kauri-template/kauri-template-service-impl/src/test/java/org/kauriproject/template/service/test/TemplateConfTest.java

    r1938 r1945  
    11package org.kauriproject.template.service.test; 
    22 
    3 import org.kauriproject.runtime.testfw.AbstractRuntimeTest; 
    4 import org.kauriproject.runtime.model.*; 
     3import java.io.File; 
     4import java.util.Collections; 
     5 
     6import javax.xml.parsers.DocumentBuilderFactory; 
     7 
    58import org.kauriproject.runtime.configuration.ConfManager; 
    69import org.kauriproject.runtime.configuration.ConfManagerImpl; 
     10import org.kauriproject.runtime.model.ClientConnectorDefinition; 
     11import org.kauriproject.runtime.model.KauriRuntimeModel; 
     12import org.kauriproject.runtime.model.ModuleDefinition; 
     13import org.kauriproject.runtime.model.ModuleSourceType; 
     14import org.kauriproject.runtime.model.MountDefinition; 
     15import org.kauriproject.runtime.model.ServerConnectorDefinition; 
     16import org.kauriproject.runtime.testfw.AbstractRuntimeTest; 
    717import org.kauriproject.util.xml.XPathUtils; 
    8 import org.restlet.Request; 
    918import org.restlet.Response; 
    10 import org.restlet.data.Method; 
    1119import org.w3c.dom.Document; 
    12  
    13 import javax.xml.parsers.DocumentBuilderFactory; 
    14 import java.io.File; 
    15 import java.util.Collections; 
    1620 
    1721/** 
Note: See TracChangeset for help on using the changeset viewer.