package test.bigs.core.commands;
import static org.junit.Assert.*;
import java.io.StringReader;
import java.util.Properties;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import bigs.api.core.Task;
import bigs.core.utils.Core;
import bigs.modules.fe.global.SobelHistogram;
import test.helper.TestHelper;
import test.helper.TestTask;
public class TestTaskTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
TestHelper.loadBigsParam();
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void test_CompliteTask() throws Exception {
TestTask.runTest(bigs.modules.learning.KMeans.class.getName());
}
@Test
public void test_getPipeline() throws Exception {
Task1 task = new Task1();
task.codeBookID = "codeBookID";
task.featureExtractorID = "featureExtractorID";
task.patchExtractorID = "patchExtractorID";
SobelHistogram sobelHistogram = new SobelHistogram();
sobelHistogram.rangeSize = 1;
task.feAlgorithm = sobelHistogram;
Properties properties = new Properties();
properties.load(new StringReader(TestTask.getPipeline(task)));
Task result = Core.getPreparedObject("task", Task.class, properties,
"stage.01");
assertTrue(task.equals(result));
}
}