Пример #1
0
 /**
  * Test method for {@link SchemagenOptions#getAllValues(jena.schemagen.SchemagenOptions.OPT)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testGetAllValuesOPT0() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   List<String> l = so0.getAllValues(OPT.INCLUDE);
   assertNotNull(l);
   assertTrue(l.isEmpty());
 }
Пример #2
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));
 }
Пример #3
0
 /**
  * Test method for {@link SchemagenOptions#setParent(SchemagenOptions)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testSetParent() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   assertSame(so1, so0.getParent());
 }
Пример #4
0
 @Test
 public void testGetOption1() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   assertNull(so0.getOption(OPT.CLASS_SECTION));
 }
Пример #5
0
 /**
  * Test method for {@link SchemagenOptions#hasParent()}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testHasParent() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   assertTrue(so0.hasParent());
   assertFalse(so1.hasParent());
 }
Пример #6
0
 @Test
 public void testGetValueOPT2() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   SchemagenOptions so1 = new SchemagenOptions();
   so0.setParent(so1);
   so1.setOption(OPT.CLASS_SECTION, "foo");
   assertEquals("foo", so0.getValue(OPT.CLASS_SECTION).asLiteral().getString());
 }
Пример #7
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));
 }
Пример #8
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"));
 }
Пример #9
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));
 }
Пример #10
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));
 }
Пример #11
0
 /**
  * Test method for {@link SchemagenOptions#hasResourceValue(jena.schemagen.SchemagenOptions.OPT)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testHasResourceValueOPT0() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   assertFalse(so0.hasResourceValue(OPT.ROOT));
 }
Пример #12
0
 /**
  * Test method for {@link SchemagenOptions#asOption(java.lang.String)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testAsOption() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   assertSame(OPT.DOS, so0.asOption("DOS"));
 }
Пример #13
0
 /**
  * Test method for {@link SchemagenOptions#getParent()}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testGetParent() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so = new SchemagenOptions();
   assertNull(so.getParent());
 }
Пример #14
0
 /**
  * Test method for {@link SchemagenOptions#isTrue(jena.schemagen.SchemagenOptions.OPT)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testIsTrueOPT0() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   assertFalse(so0.isTrue(OPT.DOS));
 }
Пример #15
0
 @Test
 public void testIsTrueOPT1() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   so0.setOption(OPT.DOS, true);
   assertTrue(so0.isTrue(OPT.DOS));
 }
Пример #16
0
 /**
  * Test method for {@link SchemagenOptions#getResource(jena.schemagen.SchemagenOptions.OPT)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testGetResourceOPT0() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   assertNull(so0.getResource(OPT.ROOT));
 }
Пример #17
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());
 }
Пример #18
0
 /**
  * Test method for {@link SchemagenOptions#getValue(jena.schemagen.SchemagenOptions.OPT)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testGetValueOPT0() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   assertNull(so0.getValue(OPT.CLASS_SECTION));
 }
Пример #19
0
 /**
  * Test method for {@link SchemagenOptions#hasValue(jena.schemagen.SchemagenOptions.OPT)}.
  *
  * @throws SchemagenOptionsConfigurationException
  */
 @Test
 public void testHasValueOPT0() throws SchemagenOptionsConfigurationException {
   SchemagenOptions so0 = new SchemagenOptions();
   assertFalse(so0.hasValue(OPT.CLASS_SECTION));
 }