commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r209034 - in /jakarta/commons/sandbox/jci/trunk: ./ src/java/org/apache/commons/jci/compilers/ src/java/org/apache/commons/jci/monitor/ src/test/org/apache/commons/jci/ src/test/org/apache/commons/jci/compilers/ src/test/org/apache/commons/...
Date Mon, 04 Jul 2005 08:58:09 GMT
Author: tcurdt
Date: Mon Jul  4 01:58:06 2005
New Revision: 209034

URL: http://svn.apache.org/viewcvs?rev=209034&view=rev
Log:
added testcase skeletons,
added a method to stop the fam

Added:
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/compilers/
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/compilers/JavaCompilerFactoryTestCase.java
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/stores/
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/stores/MemoryResourceStoreTestCase.java
Modified:
    jakarta/commons/sandbox/jci/trunk/.classpath
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java

Modified: jakarta/commons/sandbox/jci/trunk/.classpath
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/.classpath?rev=209034&r1=209033&r2=209034&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/.classpath (original)
+++ jakarta/commons/sandbox/jci/trunk/.classpath Mon Jul  4 01:58:06 2005
@@ -11,5 +11,6 @@
 	<classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-api-1.0.4.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/commons-collections/jars/commons-collections-3.1.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/janino/jars/janino-2.3.0.jar"/>
+	<classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/>
 	<classpathentry kind="output" path="eclipse"/>
 </classpath>

Added: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java?rev=209034&view=auto
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java
(added)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java
Mon Jul  4 01:58:06 2005
@@ -0,0 +1,10 @@
+package org.apache.commons.jci.compilers;
+
+
+public final class JavaCompilerFactory {
+
+    public JavaCompiler createCompiler(final String compiler) {
+        return null;
+    }
+
+}

Modified: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java?rev=209034&r1=209033&r2=209034&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
Mon Jul  4 01:58:06 2005
@@ -146,12 +146,15 @@
     private final Object mutex = new Object();
     
     private long delay = 3000;
-    private boolean running = true;
-
+    private volatile boolean running = true;
+    
     public FilesystemAlterationMonitor() {
     }
 
-
+    public void stop() {
+        running = false;
+    }
+    
     public void setInterval( final long pDelay ) {
         delay = pDelay;
     }
@@ -358,7 +361,7 @@
 
 
     public void run() {
-        
+        System.out.println("fam running");
         while (running) {
             Map directories;
             
@@ -390,5 +393,6 @@
             } catch (InterruptedException e) {
             }
         }
+        System.out.println("fam exiting");
     }
 }

Added: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java?rev=209034&view=auto
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java
(added)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java
Mon Jul  4 01:58:06 2005
@@ -0,0 +1,17 @@
+package org.apache.commons.jci;
+
+import junit.framework.TestCase;
+
+
+public final class CompilingClassLoaderTestCase extends TestCase {
+    
+    public void testCreateCompilation() {        
+    }
+
+    public void testChangeCompilation() {        
+    }
+
+    public void testDeleteCompilation() {        
+    }
+
+}

Added: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java?rev=209034&view=auto
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java
(added)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java
Mon Jul  4 01:58:06 2005
@@ -0,0 +1,17 @@
+package org.apache.commons.jci;
+
+import junit.framework.TestCase;
+
+
+public final class ReloadingClassLoaderTestCase extends TestCase {
+
+    public void testCreate() {        
+    }
+
+    public void testChange() {        
+    }
+
+    public void testDelete() {        
+    }
+    
+}

Added: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/compilers/JavaCompilerFactoryTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/compilers/JavaCompilerFactoryTestCase.java?rev=209034&view=auto
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/compilers/JavaCompilerFactoryTestCase.java
(added)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/compilers/JavaCompilerFactoryTestCase.java
Mon Jul  4 01:58:06 2005
@@ -0,0 +1,13 @@
+package org.apache.commons.jci.compilers;
+
+import junit.framework.TestCase;
+
+
+public final class JavaCompilerFactoryTestCase extends TestCase {
+    public void testEclipseCompilerCreation() {
+    }
+    public void testJaninoCompilerCreation() {
+    }
+    public void testGroovyCompilerCreation() {
+    }
+}

Added: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java?rev=209034&view=auto
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java
(added)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java
Mon Jul  4 01:58:06 2005
@@ -0,0 +1,92 @@
+package org.apache.commons.jci.monitor;
+
+import java.io.File;
+import junit.framework.TestCase;
+
+
+
+public final class FilesystemAlterationMonitorTestCase extends TestCase {
+
+    class MyFilesystemAlterationListener implements FilesystemAlterationListener {
+        private int started;
+        private int stopped;
+        private int createdFiles;
+        private int changedFiles;
+        private int deletedFiles;
+        private int createdDirs;
+        private int changedDirs;
+        private int deletedDirs;
+ 
+        public int getChangedDirs() {
+            return changedDirs;
+        }
+        public int getChangedFiles() {
+            return changedFiles;
+        }
+        public int getCreatedDirs() {
+            return createdDirs;
+        }
+        public int getCreatedFiles() {
+            return createdFiles;
+        }
+        public int getDeletedDirs() {
+            return deletedDirs;
+        }
+        public int getDeletedFiles() {
+            return deletedFiles;
+        }
+        public int getStarted() {
+            return started;
+        }
+        public int getStopped() {
+            return stopped;
+        }
+                 
+        public void onStart() {
+            ++started;
+        }
+        public void onStop() {
+            ++stopped;
+        }
+        public void onCreateFile( final File file ) {
+            ++createdFiles;
+        }
+        public void onChangeFile( final File file ) {                
+            ++changedFiles;
+        }
+        public void onDeleteFile( final File file ) {
+            ++deletedFiles;
+        }
+        public void onCreateDirectory( final File file ) {                
+            ++createdDirs;
+        }
+        public void onChangeDirectory( final File file ) {                
+            ++changedDirs;
+        }
+        public void onDeleteDirectory( final File file ) {
+            ++deletedDirs;
+        }       
+    }
+    
+    public void testCreateDetection() {
+        final File repository = new File("");
+        final FilesystemAlterationMonitor fam = new FilesystemAlterationMonitor(); 
+        final MyFilesystemAlterationListener listener = new MyFilesystemAlterationListener();
+        
+        fam.addListener(listener, repository);
+        
+        Thread myThread = new Thread(fam); 
+        myThread.start();
+        
+        fam.stop();
+    }
+
+    public void testDeleteDetection() {
+        
+    }
+
+    public void testModifyDetection() {
+        
+    }
+
+}

Added: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/stores/MemoryResourceStoreTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/stores/MemoryResourceStoreTestCase.java?rev=209034&view=auto
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/stores/MemoryResourceStoreTestCase.java
(added)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/stores/MemoryResourceStoreTestCase.java
Mon Jul  4 01:58:06 2005
@@ -0,0 +1,11 @@
+package org.apache.commons.jci.stores;
+
+import junit.framework.TestCase;
+
+
+public final class MemoryResourceStoreTestCase extends TestCase {
+
+    public void testStoring() {
+        
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message