Revision 990 org.gvsig.raster.cache/trunk/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.impl/src/test/java/org/gvsig/raster/cache/tile/impl/download/TestThreadPool.java

View differences:

TestThreadPool.java
28 28
import org.gvsig.raster.cache.tile.Tile;
29 29
import org.gvsig.raster.cache.tile.exception.TileGettingException;
30 30
import org.gvsig.raster.cache.tile.impl.TileImpl;
31
import org.gvsig.raster.cache.tile.impl.pool.ThreadPool;
31
import org.gvsig.raster.cache.tile.impl.pool.ThreadPoolImpl;
32
import org.gvsig.raster.cache.tile.pool.ThreadPool;
32 33
import org.gvsig.raster.cache.tile.provider.Downloader;
33 34

  
34 35
/**
......
56 57
			// TODO Auto-generated method stub
57 58
			return null;
58 59
		}
59
		
60

  
61
		public void cancelDownloading(boolean cancel) {
62
			// TODO Auto-generated method stub
63
			
64
		}
65

  
66
		public Object[] getCrashImage(int w, int h) {
67
			// TODO Auto-generated method stub
68
			return null;
69
		}
70

  
71
		public Object[] getDownloadingImage(int w, int h) {
72
			// TODO Auto-generated method stub
73
			return null;
74
		}
60 75
	}
61 76
	
62 77
	public void start() {
......
70 85
	}
71 86
	
72 87
	public void testStack() {
73
		ThreadPool pool = new ThreadPool(false);
88
		ThreadPool pool = new ThreadPoolImpl(false);
74 89
		MyDownloader d = new MyDownloader();
75
		org.gvsig.raster.cache.tile.impl.pool.TilePipe pipe = new org.gvsig.raster.cache.tile.impl.pool.TilePipe();
76 90
		
77 91
		for (int x = 0; x < HEIGHT; x++) {
78 92
			for (int y = 0; y < WIDTH; y++) {
79 93
				TileImpl t = new TileImpl(0, x, y);
80
				t.setSharedPipe(pipe);
94
				t.setSharedPipe(pool.getTilePipe());
81 95
				t.setDownloader(d);
82 96
				t.setFile(new File(""));
83 97
				pool.addTask(t);
......
86 100
		
87 101
		int nCollected = 0;
88 102
		while (nCollected < (WIDTH * HEIGHT)) {
89
			Tile tile = pipe.getTile();
103
			Tile tile = (Tile)pool.getTilePipe().getAtomicTask();
90 104
			System.out.println("Getting " + tile.getRow() + " " + tile.getCol() + " P:" + tile.getPriority());
91 105
			nCollected ++;
92 106
		}

Also available in: Unified diff