From 82efa7f7b2f4b1079d01d0f9c0a2b4ca43e9a24d Mon Sep 17 00:00:00 2001 From: Instrumental Date: Mon, 26 Mar 2018 11:37:12 -0700 Subject: Remove Code from inno, it is now in authz Issue-ID: AAF-193 Change-Id: I5b80daa8344559bc86c82cbaa85c29e0eea54ebb Signed-off-by: Instrumental --- rosetta/src/test/java/com/data/test/JU_Types.java | 303 ---------------------- 1 file changed, 303 deletions(-) delete mode 100644 rosetta/src/test/java/com/data/test/JU_Types.java (limited to 'rosetta/src/test/java/com/data/test/JU_Types.java') diff --git a/rosetta/src/test/java/com/data/test/JU_Types.java b/rosetta/src/test/java/com/data/test/JU_Types.java deleted file mode 100644 index 3fef743..0000000 --- a/rosetta/src/test/java/com/data/test/JU_Types.java +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************************* - * ============LICENSE_START==================================================== - * * org.onap.aaf - * * =========================================================================== - * * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * * =========================================================================== - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * * ============LICENSE_END==================================================== - * * - * * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * * - ******************************************************************************/ -package com.data.test; - -import java.io.StringWriter; - -import javax.xml.datatype.XMLGregorianCalendar; -import javax.xml.namespace.QName; - -import org.junit.Test; -import org.onap.aaf.inno.env.Data; -import org.onap.aaf.inno.env.Env; -import org.onap.aaf.inno.env.Trans; -import org.onap.aaf.inno.env.Data.TYPE; -import org.onap.aaf.inno.env.Trans.Metric; -import org.onap.aaf.inno.env.jaxb.JAXBmar; -import org.onap.aaf.inno.env.jaxb.JAXBumar; -import org.onap.aaf.inno.env.util.Chrono; -import org.onap.aaf.inno.env.util.StringBuilderWriter; -import org.onap.aaf.rosetta.OutJson; -import org.onap.aaf.rosetta.OutRaw; -import org.onap.aaf.rosetta.OutXML; -import org.onap.aaf.rosetta.env.RosettaDF; -import org.onap.aaf.rosetta.env.RosettaData; -import org.onap.aaf.rosetta.env.RosettaEnv; -import org.onap.aaf.rosetta.marshal.DocMarshal; - -import com.data.test.obj.MultiMarshal; -import com.data.test.obj.SingleMarshal; - -import types.xsd.Multi; -import types.xsd.Multi.Single; - -public class JU_Types { - - @Test - public void single() throws Exception { - Single single = setSData(); - SingleMarshal psingle = new SingleMarshal(); - - OutRaw raw = new OutRaw(); - OutJson json = new OutJson(); - OutXML xml = new OutXML("Single","xmlns=urn:types:xsd"); - - - System.out.println("===== RAW ====="); - raw.extract(single, System.out, psingle); - - System.out.println("\n===== JSON ====="); - json.extract(single, System.out, psingle); - - System.out.println("\n\n===== Pretty JSON ====="); - json.extract(single, System.out, psingle, true); - - System.out.println("\n\n===== XML ====="); - xml.extract(single, System.out, psingle,false); - - System.out.println("\n\n===== Pretty XML ====="); - xml.extract(single, System.out, psingle, true); - - RosettaEnv env = new RosettaEnv(); - StringWriter sw = new StringWriter(); - xml.extract(single, sw, psingle, true); - JAXBumar jumar = new JAXBumar(single.getClass()); - JAXBmar jmar = new JAXBmar(new QName("Single","urn.types.xsd"),single.getClass()); - jmar.pretty(true); - sw = new StringWriter(); - jmar.marshal(env.info(), single, sw); - System.out.println(sw); - Single news = jumar.unmarshal(env.info(), sw.toString()); -// System.out.println(news.getDatetime()); -// sw = new StringWriter(); -// news.setDatetime(Chrono.timeStamp()); -// xml.extract(single, sw, psingle, true); - news = jumar.unmarshal(env.info(), sw.toString()); - System.out.println(sw.toString()); - - String sample = "" - + "\n" - + "\nMyString" - + "\n2147483647" - + "\n9223372036854775807" - + "\n2015-05-27-05:00" - + "\n2015-05-27T07:05:04.234-05:00" - + "\nFF00FF0E082507807F" - + "\nString 1" - + "\nString 2" - + "\n"; - System.out.println(sample); - news = jumar.unmarshal(env.info(), sample); - - System.out.println(news.getDatetime()); - - } - - @Test - public void multi() throws Exception { - OutRaw raw = new OutRaw(); - OutJson json = new OutJson(); - OutXML xml = new OutXML("Multi","xmlns=urn:types:xsd"); - - Multi multi = new Multi(); - MultiMarshal pmulti = new MultiMarshal(); - - for(int i=0;i<10;++i) { - System.out.println("===== Multi Iteration " + i + " ====="); - if(i>0) { - multi.getSingle().add(setSData()); - } - System.out.println(" ===== RAW ====="); - raw.extract(multi, System.out, pmulti); - - System.out.println("\n ===== JSON ====="); - json.extract(multi, System.out, pmulti); - - System.out.println("\n\n ===== Pretty JSON ====="); - json.extract(multi, System.out, pmulti, true); - - System.out.println("\n\n ===== XML ====="); - xml.extract(multi, System.out, pmulti,false); - - System.out.println("\n\n ===== Pretty XML ====="); - xml.extract(multi, System.out, pmulti, true); - } - } - - @Test - public void doc() throws Exception { - OutRaw raw = new OutRaw(); - OutJson json = new OutJson(); - OutXML xml = new OutXML("Multi","xmlns=urn:types:xsd"); - - Multi multi = new Multi(); - DocMarshal doc = DocMarshal.root(new MultiMarshal()); - - for(int i=0;i<3;++i) { - System.out.println("===== Multi Iteration " + i + " ====="); - if(i>0) { - multi.getSingle().add(setSData()); - } - System.out.println(" ===== RAW ====="); - raw.extract(multi, System.out, doc); - - System.out.println("\n ===== JSON ====="); - json.extract(multi, System.out, doc); - - System.out.println("\n\n ===== Pretty JSON ====="); - json.extract(multi, System.out, doc, true); - - System.out.println("\n\n ===== XML ====="); - xml.extract(multi, System.out, doc,false); - - System.out.println("\n\n ===== Pretty XML ====="); - xml.extract(multi, System.out, doc, true); - } - } - - -// @Test -// public void saved() throws Exception { -// Saved saved = new Saved(); -// saved.extract(in, ignore, parser, options); -// } - - @Test - public void df() throws Exception { - RosettaEnv env = new RosettaEnv(); - RosettaDF df = env.newDataFactory(Multi.class); - df.out(TYPE.JSON).option(Data.PRETTY); - - Multi multi = new Multi(); - multi.getSingle().add(setSData()); - - - System.out.println("========== Original loading"); - Trans trans = env.newTrans(); - RosettaData data = df.newData(trans); - // Prime pump - for(int i=0;i<100;++i) { - data.load(multi); - } - trans = env.newTrans(); - data = df.newData(trans); - - int iters = 10000; - for(int i=0;i jin = new InJson(); -// Out jout = new OutJson(); -// -//// go(jin, jout, "{\"id\":\"Me, Myself\",\"date\":1353094689100}"); -// -// } - - - /* - private void go(Parse in, Out out, String str) throws IOException, ParseException { - - System.out.println(str); - StringWriter sw = new StringWriter(1024); - out.extract(new StringReader(str), sw, in); - System.out.println(sw); - String result = sw.toString(); - - if(!result.equals(str)) { - sw.getBuffer().setLength(0); - new OutRaw().extract(new StringReader(str), sw, in); - System.out.println(sw); - } - - Assert.assertEquals(str,result); - System.out.println(); - - } - */ -} -- cgit 1.2.3-korg