X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=misc%2Fenv%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fmisc%2Fenv%2FJU_BaseDataFactory.java;fp=misc%2Fenv%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fmisc%2Fenv%2FJU_BaseDataFactory.java;h=15049dcd7a01292f23326f87c2a4f1f794154fd3;hb=3d1706fcbe7f95830ff6fd23cf679ee55c6d0595;hp=0c21bda34e66c5bb48e9a6fbe28c4d03a15b81c8;hpb=321dce367d74092a0ba09930c3aa526abdbd5da8;p=aaf%2Fauthz.git diff --git a/misc/env/src/test/java/org/onap/aaf/misc/env/JU_BaseDataFactory.java b/misc/env/src/test/java/org/onap/aaf/misc/env/JU_BaseDataFactory.java index 0c21bda3..15049dcd 100644 --- a/misc/env/src/test/java/org/onap/aaf/misc/env/JU_BaseDataFactory.java +++ b/misc/env/src/test/java/org/onap/aaf/misc/env/JU_BaseDataFactory.java @@ -30,53 +30,53 @@ import org.onap.aaf.misc.env.impl.EnvFactory; public class JU_BaseDataFactory { - @Before - public void setUp() throws Exception { - initMocks(this); - } - - @Test - public void testGenSchemaException() { - Store env = Mockito.mock(Store.class); - Mockito.doReturn("testdir").when(env).get(null, EnvFactory.DEFAULT_SCHEMA_DIR); - try { - BaseDataFactory.genSchema(env, new String[] {}); - } catch (APIException e) { - assertTrue(e.getLocalizedMessage().contains("does not exist. You can set this with")); - } - } - - @Test - public void testGenSchemaXsdException() { - Store env = Mockito.mock(Store.class); - Mockito.doReturn(System.getProperty("user.dir")).when(env).get(null, EnvFactory.DEFAULT_SCHEMA_DIR); - String[] schemaFIles = new String[] {"../auth-client/src/main/xsd/aaf_2_0.xsd"}; - try { - BaseDataFactory.genSchema(env, schemaFIles); - } catch (APIException e) { - assertTrue(e.getLocalizedMessage().contains("for schema validation")); - } - } - - @Test - public void testGenSchemaNoException() { - Store env = Mockito.mock(Store.class); - Mockito.doReturn(System.getProperty("user.dir")).when(env).get(null, EnvFactory.DEFAULT_SCHEMA_DIR); - String[] schemaFIles = new String[] {"../../auth-client/src/main/xsd/aaf_2_0.xsd"}; - try { - BaseDataFactory.genSchema(env, schemaFIles); - } catch (APIException e) { - e.printStackTrace(); - } - } - - @Test - public void testGetQName() { - String[] schemaFIles = new String[] {"../../auth-client/src/main/xsd/aaf_2_0.xsd"}; - try { - BaseDataFactory.getQName(Api.class); - } catch (APIException e) { - assertTrue(e.getLocalizedMessage().contains("package-info does not have an XmlSchema annotation")); - } - } + @Before + public void setUp() throws Exception { + initMocks(this); + } + + @Test + public void testGenSchemaException() { + Store env = Mockito.mock(Store.class); + Mockito.doReturn("testdir").when(env).get(null, EnvFactory.DEFAULT_SCHEMA_DIR); + try { + BaseDataFactory.genSchema(env, new String[] {}); + } catch (APIException e) { + assertTrue(e.getLocalizedMessage().contains("does not exist. You can set this with")); + } + } + + @Test + public void testGenSchemaXsdException() { + Store env = Mockito.mock(Store.class); + Mockito.doReturn(System.getProperty("user.dir")).when(env).get(null, EnvFactory.DEFAULT_SCHEMA_DIR); + String[] schemaFIles = new String[] {"../auth-client/src/main/xsd/aaf_2_0.xsd"}; + try { + BaseDataFactory.genSchema(env, schemaFIles); + } catch (APIException e) { + assertTrue(e.getLocalizedMessage().contains("for schema validation")); + } + } + + @Test + public void testGenSchemaNoException() { + Store env = Mockito.mock(Store.class); + Mockito.doReturn(System.getProperty("user.dir")).when(env).get(null, EnvFactory.DEFAULT_SCHEMA_DIR); + String[] schemaFIles = new String[] {"../../auth-client/src/main/xsd/aaf_2_0.xsd"}; + try { + BaseDataFactory.genSchema(env, schemaFIles); + } catch (APIException e) { + e.printStackTrace(); + } + } + + @Test + public void testGetQName() { + String[] schemaFIles = new String[] {"../../auth-client/src/main/xsd/aaf_2_0.xsd"}; + try { + BaseDataFactory.getQName(Api.class); + } catch (APIException e) { + assertTrue(e.getLocalizedMessage().contains("package-info does not have an XmlSchema annotation")); + } + } }