Skip to content

Commit

Permalink
not throwing exceptions, since the annotation processing is not happe…
Browse files Browse the repository at this point in the history
…ning inside IDEs, instead logging warnings.
  • Loading branch information
Peter Neubauer committed Oct 7, 2011
1 parent db0ab69 commit 6819dfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
Expand Up @@ -21,7 +21,6 @@

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

import java.io.BufferedInputStream;
import java.io.File;
Expand All @@ -32,7 +31,6 @@
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.internal.runners.statements.Fail;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.kernel.impl.annotations.Documented;
Expand Down Expand Up @@ -82,19 +80,11 @@ public void can_create_docs_from_method_name() throws Exception
@Documented( value = "@@snippet1\n" )
@Test
@Graph( "I know you" )
public void will_complain_about_missing_snippets() throws Exception
public void will_not_complain_about_missing_snippets() throws Exception
{
data.get();
JavaTestDocsGenerator doc = gen.get();
try
{
doc.document( directory, sectionName );
fail();
}
catch ( IllegalArgumentException e )
{
// ok
}
doc.document( directory, sectionName );
}

/**
Expand Down
7 changes: 4 additions & 3 deletions kernel/src/test/java/org/neo4j/test/AsciiDocGenerator.java
Expand Up @@ -25,6 +25,7 @@
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

import org.neo4j.graphdb.GraphDatabaseService;

Expand All @@ -41,7 +42,7 @@
public abstract class AsciiDocGenerator
{
private static final String DOCUMENTATION_END = "\n...\n";

private Logger log = Logger.getLogger( AsciiDocGenerator.class.getName() );
protected String title = null;
protected String description = null;
protected GraphDatabaseService graph;
Expand Down Expand Up @@ -170,7 +171,7 @@ protected String replaceSnippets( String description )
description = replaceSnippet( description, key );
}
if(description.contains( SNIPPET_MARKER )) {
throw new IllegalArgumentException("missing snippet in " + description);
log.severe( "missing snippet in " + description);
}
return description;
}
Expand All @@ -183,7 +184,7 @@ private String replaceSnippet( String description, String key )
description = description.replace( snippetString + "\n",
snippets.get( key ) );
} else {
throw new IllegalArgumentException( "could not find " + snippetString + "\\n in "+ description );
log.severe( "could not find " + snippetString + "\\n in "+ description );
}
return description;
}
Expand Down

0 comments on commit 6819dfd

Please sign in to comment.