| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
package net.sourceforge.pebble.domain; |
| 33 |
|
|
| 34 |
|
import junit.framework.TestCase; |
| 35 |
|
import net.sourceforge.pebble.util.FileUtils; |
| 36 |
|
import net.sourceforge.pebble.PebbleContext; |
| 37 |
|
import net.sourceforge.pebble.Configuration; |
| 38 |
|
import org.acegisecurity.context.SecurityContextHolder; |
| 39 |
|
|
| 40 |
|
import java.io.File; |
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
@author |
| 46 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 3 |
Complexity Density: 0,25 |
|
| 47 |
|
public abstract class PebbleTestCase extends TestCase { |
| 48 |
|
|
| 49 |
|
protected static final File TEST_BLOG_LOCATION; |
| 50 |
|
protected static final File TEST_RESOURCE_LOCATION; |
| 51 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
| 52 |
2
|
static {... |
| 53 |
2
|
TEST_BLOG_LOCATION = new File(System.getProperty("java.io.tmpdir"), "pebble"); |
| 54 |
2
|
TEST_RESOURCE_LOCATION = new File("src/test/resources"); |
| 55 |
|
} |
| 56 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0,12 |
|
| 57 |
1250
|
protected void setUp() throws Exception {... |
| 58 |
1250
|
super.setUp(); |
| 59 |
|
|
| 60 |
|
|
| 61 |
1250
|
SecurityContextHolder.getContext().setAuthentication(null); |
| 62 |
|
|
| 63 |
1250
|
TEST_BLOG_LOCATION.mkdir(); |
| 64 |
1250
|
new File(TEST_BLOG_LOCATION, "blogs").mkdir(); |
| 65 |
|
|
| 66 |
1250
|
Configuration config = new Configuration(); |
| 67 |
1250
|
config.setUrl("http://www.yourdomain.com/blog/"); |
| 68 |
1250
|
config.setDataDirectory(TEST_BLOG_LOCATION.getAbsolutePath()); |
| 69 |
1250
|
PebbleContext.getInstance().setConfiguration(config); |
| 70 |
|
} |
| 71 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
| 72 |
1250
|
protected void tearDown() throws Exception {... |
| 73 |
1250
|
FileUtils.deleteFile(TEST_BLOG_LOCATION); |
| 74 |
|
|
| 75 |
1250
|
super.tearDown(); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
} |