예제 #1
0
 @Test
 public void testGetValueOPT3() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   so1.setOption(OPT.CLASS_SECTION, "foo");
   so0.setOption(OPT.CLASS_SECTION, "bar");
   assertEquals("bar", so0.getValue(OPT.CLASS_SECTION).asLiteral().getString());
 }
예제 #2
0
 @Test
 public void testGetOption5() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   so0.setOption(OPT.CLASS_SECTION, "test.child");
   so1.setOption(OPT.CLASS_SECTION, "test.parent");
   assertEquals("test.child", so0.getOption(OPT.CLASS_SECTION).asLiteral().getString());
 }
예제 #3
0
 @Test
 public void testGetResourceValueOPT3() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   Resource r0 = ResourceFactory.createResource("http://example.org/foo");
   Resource r1 = ResourceFactory.createResource("http://example.org/bar");
   so0.setOption(OPT.ROOT, r0);
   so1.setOption(OPT.ROOT, r1);
   assertEquals(r0, so0.getResource(OPT.ROOT));
 }
예제 #4
0
 @Test
 public void testGetResourceValueOPT1() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   Resource r = ResourceFactory.createResource("http://example.org/foo");
   so0.setOption(OPT.ROOT, r);
   assertEquals(r, so0.getResource(OPT.ROOT));
 }
예제 #5
0
 @Test
 public void testHasValueOPT2() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   so1.setOption(OPT.CLASS_SECTION, "foo");
   assertTrue(so0.hasValue(OPT.CLASS_SECTION));
 }
예제 #6
0
 @Test
 public void testGetAllValuesOPT1() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   so0.setOption(OPT.INCLUDE, "foo");
   List<String> l = so0.getAllValues(OPT.INCLUDE);
   assertNotNull(l);
   assertEquals(1, l.size());
   assertTrue(l.contains("foo"));
 }
예제 #7
0
 @Test
 public void testHasResourceValueOPT2() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   Resource r = ResourceFactory.createResource("http://example.org/foo");
   so1.setOption(OPT.ROOT, r);
   assertTrue(so0.hasResourceValue(OPT.ROOT));
 }
예제 #8
0
 @Test
 public void testIsTrueOPT1() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   so0.setOption(OPT.DOS, true);
   assertTrue(so0.isTrue(OPT.DOS));
 }
예제 #9
0
 /**
  * Test method for {@link SchemagenOptions#setOption(java.lang.String, java.lang.String)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testSetOptionStringString() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   so0.setOption("CLASS_SECTION", "test123");
   assertEquals("test123", so0.getOption(OPT.CLASS_SECTION).asLiteral().getString());
 }