package com.adaptris.core.management.config;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ClasspathDupConfigurationCheckerTest {

  private ClasspathDupConfigurationChecker checker;
  
  @Before
  public void setUp() throws Exception {
    checker = new ClasspathDupConfigurationChecker();
    
    checker.setDebug(true);
  }
  
  @After
  public void tearDown() throws Exception {
    
  }
  
  @Test
  public void testDeDup() throws Exception {
    // this one may actually fail occassionally.
    ConfigurationCheckReport report = checker.performConfigCheck(null, null);
    if(!report.isCheckPassed()) {
      assertTrue(report.getWarnings().size() > 0);
    }
    assertNotNull(report.toString());
  }
  
  @Test
  public void testDeDupWithNoLogging() throws Exception {
    // this one may actually fail occassionally.
    checker.setDebug(false);
    ConfigurationCheckReport report = checker.performConfigCheck(null, null);
    if(!report.isCheckPassed()) {
      assertTrue(report.getWarnings().size() > 0);
    }
    assertNotNull(report.toString());
  }
  
}

@@ -307,19 +307,17 @@
 hecker;%0A
-  
 %0A
+
   @Befor
@@ -413,21 +413,17 @@
 cker();%0A
-    
 %0A
+
     chec
@@ -446,19 +446,17 @@
 e);%0A  %7D%0A
-  
 %0A
+
   @After
@@ -504,20 +504,14 @@
 n %7B%0A
-    
 %0A
+
   %7D%0A
-  
 %0A
+
   @T
@@ -590,33 +590,32 @@
 ually fail occas
-s
 ionally.%0A    Con
@@ -818,19 +818,17 @@
 ));%0A  %7D%0A
-  
 %0A
+
   @Test%0A
@@ -924,17 +924,16 @@
 il occas
-s
 ionally.
@@ -1173,13 +1173,11 @@
 ));%0A  %7D%0A
-  
 %0A%7D%0A

Fix typo