Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1653 - in development/main/transit/core/handler: etc/test src/main/net/dpml/transit/artifact src/test/net/dpml/transit/artifact

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1653 - in development/main/transit/core/handler: etc/test src/main/net/dpml/transit/artifact src/test/net/dpml/transit/artifact
  • Date: Sun, 30 Jan 2005 21:58:08 +0100

Author: niclas
Date: Sun Jan 30 21:58:07 2005
New Revision: 1653

Modified:
development/main/transit/core/handler/etc/test/cache.properties
development/main/transit/core/handler/etc/test/test.authority

development/main/transit/core/handler/src/main/net/dpml/transit/artifact/CacheHandlerFactory.java

development/main/transit/core/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java

development/main/transit/core/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java

development/main/transit/core/handler/src/test/net/dpml/transit/artifact/OnlineTestCase.java
Log:
Fixed a trailing slash problem for the authorative location. Also whitespace
clean ups, I think.

Modified: development/main/transit/core/handler/etc/test/cache.properties
==============================================================================
--- development/main/transit/core/handler/etc/test/cache.properties
(original)
+++ development/main/transit/core/handler/etc/test/cache.properties Sun
Jan 30 21:58:07 2005
@@ -1,6 +1,6 @@

# The location of the cache system
-dpml.transit.cache.location=${user.dir}/target/test/cache
+dpml.transit.cache.location=${basedir}/target/test/cache

# The class that implements the cache handler
dpml.transit.cache.class=net.dpml.transit.artifact.FileCacheHandler

Modified: development/main/transit/core/handler/etc/test/test.authority
==============================================================================
--- development/main/transit/core/handler/etc/test/test.authority
(original)
+++ development/main/transit/core/handler/etc/test/test.authority Sun
Jan 30 21:58:07 2005
@@ -1,3 +1,3 @@

-dpml.transit.authority=file:${user.dir}/target/test
+dpml.transit.authority=file:${basedir}/target/test


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/CacheHandlerFactory.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/CacheHandlerFactory.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/CacheHandlerFactory.java
Sun Jan 30 21:58:07 2005
@@ -45,7 +45,7 @@
/**
* The default cache hanlder classname.
*/
- static final String TRANSIT_CACHE_DEFAULT_HANDLER_CLASSNAME =
+ static final String TRANSIT_CACHE_DEFAULT_HANDLER_CLASSNAME =
"net.dpml.transit.artifact.FileCacheHandler";

//
------------------------------------------------------------------------
@@ -90,7 +90,7 @@
{
Properties props = getCacheProperties();

- String classname =
+ String classname =
props.getProperty( CacheHandler.CACHE_CLASS_KEY,
TRANSIT_CACHE_DEFAULT_HANDLER_CLASSNAME );
try
{
@@ -107,7 +107,7 @@
};
Constructor cons = cls.getConstructor( params );
return (CacheHandler) cons.newInstance( args );
- }
+ }
catch( Exception e )
{
throw new TransitException( "Unable to create CacheHandler: " +
classname, e );
@@ -123,7 +123,7 @@
}
catch( FileNotFoundException fnfe )
{
- URL url = getClass().getClassLoader().getResource(
+ URL url = getClass().getClassLoader().getResource(
"transit/authority/" + TRANSIT_CACHE_PROPERTIES_FILENAME );
return Util.readProps( url );
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
Sun Jan 30 21:58:07 2005
@@ -248,10 +248,10 @@
}

/**
- * Create the file to the root of the cache directory. If the cache key
is
- * declared as a system property, the value will take precidence over the
+ * Create the file to the root of the cache directory. If the cache key is
+ * declared as a system property, the value will take precidence over the
* cache configuration properties.
- *
+ *
* @param props the configuration properties
* @return the cache root directory
*/
@@ -265,6 +265,8 @@
cachedir = new File( Transit.DPML_HOME, cache );
}
cachedir.mkdirs();
+System.out.println( "Cache Dir: " + cachedir );
+System.out.println( "Properties: " + props );
return cachedir;
}
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
Sun Jan 30 21:58:07 2005
@@ -236,7 +236,7 @@
}
catch( FileNotFoundException fnfe )
{
- URL url = getClass().getClassLoader().getResource(
+ URL url = getClass().getClassLoader().getResource(
"transit/authority/" + TRANSIT_PROPERTIES_FILENAME );
return Util.readProps( url );
}
@@ -433,6 +433,11 @@
{
throw new TransitException( "No " + AUTHORITY_KEY + " could
be found in " + authFile );
}
+ if( ! authority.endsWith( "/" ) )
+ {
+ authority = authority + "/";
+ }
+
File f = new File( authority );
if( !f.isAbsolute() )
{

Modified:
development/main/transit/core/handler/src/test/net/dpml/transit/artifact/OnlineTestCase.java
==============================================================================
---
development/main/transit/core/handler/src/test/net/dpml/transit/artifact/OnlineTestCase.java
(original)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/artifact/OnlineTestCase.java
Sun Jan 30 21:58:07 2005
@@ -43,61 +43,61 @@

public void testStackedJarUrl() throws Exception
{
- URL url = new URL(
"jar:artifact:jar:dpml/test/dpml-test-testb!/net/dpml/test/testb/B.class" );
+ URL url = new URL(
"jar:artifact:jar:testcasegroup/dpml-test-testb!/net/dpml/test/testb/B.class"
);
Object obj = url.getContent();
System.out.println( obj.getClass() );
}
-
+
public void testDownloadNoVersion() throws Exception
{
- URL url = new URL( "artifact:testfile:dpml/test/1" );
+ URL url = new URL( "artifact:testfile:testcasegroup/1" );
String content = getContent( url );
assertEquals( "Content not retrieved.", "abc\n", content );
}

public void testDownloadWithVersion() throws Exception
{
- URL url = new URL( "artifact:testfile:dpml/test/abc#1.0.1" );
+ URL url = new URL( "artifact:testfile:testcasegroup/abc#1.0.1" );
String content = getContent( url );
assertEquals( "Content not retrieved.", "abc\ndef\n", content );
}

public void testClassLoader1() throws Exception
{
- URL url = new URL( "artifact:jar:dpml/test/dpml-test-testa" );
+ URL url = new URL( "artifact:jar:testcasegroup/dpml-test-testa" );
ClassLoader classloader = new URLClassLoader( new URL[]{ url } );
classloader.loadClass( "net.dpml.test.testa.A" );
}

public void testClassLoader2() throws Exception
{
- URL url = new URL( "artifact:jar:dpml/test/dpml-test-testb" );
+ URL url = new URL( "artifact:jar:testcasegroup/dpml-test-testb" );
ClassLoader classloader = new URLClassLoader( new URL[]{ url } );
classloader.loadClass( "net.dpml.test.testb.B" );
}

public void testInternalResource() throws Exception
{
- URL url = new URL( "artifact:jar:dpml/test/dpml-test-testb" );
+ URL url = new URL( "artifact:jar:testcasegroup/dpml-test-testb" );
ClassLoader classloader = new URLClassLoader( new URL[]{ url } );
Class clazz = classloader.loadClass( "net.dpml.test.testb.B" );
URL resourceUrl = clazz.getResource( "TestB.xinfo" );
- String external =
-
"artifact:jar:dpml/test/dpml-test-testb!/net/dpml/test/testb/TestB.xinfo";
+ String external =
+
"artifact:jar:testcasegroup/dpml-test-testb!/net/dpml/test/testb/TestB.xinfo";
assertEquals( "external", external, resourceUrl.toExternalForm() );
resourceUrl.openStream();
}

public void testContentConversionA() throws Exception
{
- URL url = new URL( "artifact:jar:dpml/test/dpml-test-testa" );
+ URL url = new URL( "artifact:jar:testcasegroup/dpml-test-testa" );
Object content = url.getContent();
assertTrue( "Content type not correct.", content instanceof
InputStream );
}

public void testContentConversionB() throws Exception
{
- URL url = new URL( "artifact:png:dpml/test/sample" );
+ URL url = new URL( "artifact:png:testcasegroup/sample" );
Object content = url.getContent();
assertTrue( "Content type not correct.", content instanceof
java.awt.image.ImageProducer );
}



  • svn commit: r1653 - in development/main/transit/core/handler: etc/test src/main/net/dpml/transit/artifact src/test/net/dpml/transit/artifact, niclas, 01/30/2005

Archive powered by MHonArc 2.6.24.

Top of Page