package rapture.kernel;

import static org.junit.Assert.assertNotNull;

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

import rapture.common.CallingContext;
import rapture.common.PluginTransportItem;
import rapture.common.api.IndexApi;
import rapture.common.api.PluginApi;

public class PluginApiTest {

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
    }

    @AfterClass
    public static void tearDownAfterClass() throws Exception {
    }

    @Before
    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void testGetPluginItem() {
        IndexApi index = Kernel.getIndex();
        PluginApi plugin = Kernel.getPlugin();
        CallingContext context = ContextFactory.getKernelUser();
        String tableUri = "table://foo/bar";
        String indexUri = "index://baz";

        index.createTable(context, tableUri, "TABLE {} USING MEMORY {}");
        index.createIndex(context, indexUri, "field1($1) number");

        String pluginName = "Jeff";

        plugin.createManifest(context, pluginName);
        plugin.addManifestItem(context, pluginName, tableUri);
        plugin.addManifestItem(context, pluginName, indexUri);
        plugin.verifyPlugin(context, pluginName);

        PluginTransportItem item1 = plugin.getPluginItem(context, tableUri);
        System.out.println(new String(item1.getContent()));
        assertNotNull(item1);

        PluginTransportItem item2 = plugin.getPluginItem(context, indexUri);
        System.out.println(new String(item2.getContent()));
        assertNotNull(item2);
    }
}

@@ -1467,57 +1467,27 @@
     
-System.out.println(new String(item1.getContent())
+assertNotNull(item1
 );%0A 
@@ -1512,16 +1512,29 @@
 ll(item1
+.getContent()
 );%0A%0A    
@@ -1618,57 +1618,27 @@
     
-System.out.println(new String(item2.getContent())
+assertNotNull(item2
 );%0A 
@@ -1659,23 +1659,36 @@
 otNull(item2
+.getContent()
 );%0A    %7D%0A%7D%0A

Fix assertions, remove println in unit test