Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: Java  |  size: 1.51 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package test.bigs.core.commands;
  2.  
  3. import static org.junit.Assert.*;
  4.  
  5. import java.io.StringReader;
  6. import java.util.Properties;
  7.  
  8. import org.junit.After;
  9. import org.junit.AfterClass;
  10. import org.junit.Before;
  11. import org.junit.BeforeClass;
  12. import org.junit.Ignore;
  13. import org.junit.Test;
  14.  
  15. import bigs.api.core.Task;
  16. import bigs.core.utils.Core;
  17. import bigs.modules.fe.global.SobelHistogram;
  18.  
  19. import test.helper.TestHelper;
  20. import test.helper.TestTask;
  21.  
  22. public class TestTaskTest {
  23.  
  24.         @BeforeClass
  25.         public static void setUpBeforeClass() throws Exception {
  26.                 TestHelper.loadBigsParam();
  27.         }
  28.  
  29.         @AfterClass
  30.         public static void tearDownAfterClass() throws Exception {
  31.         }
  32.  
  33.         @Before
  34.         public void setUp() throws Exception {
  35.         }
  36.  
  37.         @After
  38.         public void tearDown() throws Exception {
  39.         }
  40.  
  41.         @Test
  42.         public void test_CompliteTask() throws Exception {
  43.                 TestTask.runTest(bigs.modules.learning.KMeans.class.getName());
  44.         }
  45.  
  46.         @Test
  47.         public void test_getPipeline() throws Exception {
  48.                 Task1 task = new Task1();
  49.                 task.codeBookID = "codeBookID";
  50.                 task.featureExtractorID = "featureExtractorID";
  51.                 task.patchExtractorID = "patchExtractorID";
  52.                 SobelHistogram sobelHistogram = new SobelHistogram();
  53.                 sobelHistogram.rangeSize = 1;
  54.                 task.feAlgorithm = sobelHistogram;
  55.                 Properties properties = new Properties();
  56.                 properties.load(new StringReader(TestTask.getPipeline(task)));
  57.  
  58.                 Task result = Core.getPreparedObject("task", Task.class, properties,
  59.                                 "stage.01");
  60.  
  61.                 assertTrue(task.equals(result));
  62.  
  63.         }
  64. }