nx01/nx01-jpp-base/src/test/java/ᒢᐩᐩ/ᒃᣔᔆᔆᒃᐤᐤᣕ/ᒄᓫᣔᐪᑋ/ᔆᣖᑊᒄᓫᣗ/BãßBȍőnSpiderTest.java

141 lines
6.7 KiB
Java
Raw Normal View History

2024-12-05 23:34:15 +00:00
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒄᓫᣔᐪᑋ.ᔆᣖᑊᒄᓫᣗ;
import java.io.PrintStream;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Optional;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒃᐤᣔᐪ.BãßBȍőnBőatꞱᴿᴳᴮ;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒄᓫᣔᐪᑋ.ᔆᣖᑊᒄᓫᣗ.ᐧᣞᣛ.低音ᣟ骨ᣟ蜘蛛ᣟ金屬絲;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒄᓫᣔᐪᑋ.ᔆᣖᑊᒄᓫᣗ.ᐧᣞᣛ.低音ᣟ骨ᣟ蜘蛛ᣟ金屬絲ᣟ龍;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᔿᓑᔿᔿᔋᐝᣚ.BãßᛗᚢᛗᛗᛉBoobBabe𓄯ᶠˡʸ;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᒢSystemꞱᴿᴳᴮ;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.StringUnicode;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣔᣕᣕᐤᐪᣔᐪᑊᐤᣕ.Generated注;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣔᣕᣕᐤᐪᣔᐪᑊᐤᣕ.ᐧᣞᣛ.ᐊᐅᓚᔾᔭᒋᐊᖅᓯᒪᔪᖅ;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣔᣕᣕᐤᐪᣔᐪᑊᐤᣕ.ᐧᣞᣛ.𓃦𓃈𓌰𓍟;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnSpiderTest.MyAnno(fooBar = "junit")
@𓃦𓃈𓌰𓍟(𓏞𓆦 = "foobar")
public class BãßBȍőnSpiderTest implements BãßᛗᚢᛗᛗᛉBoobBabe𓄯ᶠˡʸ<BãßBȍőnSpiderTest> {
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface MyAnno {
String fooBar();
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface MyAnnoMissing {
String fooBar();
}
@BãßBȍőnSpiderWire注(paint = BãßBȍőnBőatꞱᴿᴳᴮ.ẞassPaint.ꞱAnnotationWire.class, optional = MyAnnoMissing.class)
private MyAnnoMissing myAnnoNullable;
@BãßBȍőnSpiderWire注(paint = BãßBȍőnBőatꞱᴿᴳᴮ.ẞassPaint.ꞱAnnotationWire.class, optional = MyAnno.class)
private Optional<MyAnno> myAnnoOptional;
@BãßBȍőnSpiderWire注(paint = BãßBȍőnBőatꞱᴿᴳᴮ.ẞassPaint.ꞱAnnotationWire.class)
private Generated注 annoAutoConverted1;
@BãßBȍőnSpiderWire注(paint = BãßBȍőnBőatꞱᴿᴳᴮ.ẞassPaint.ꞱAnnotationWire.class)
private ᐊᐅᓚᔾᔭᒋᐊᖅᓯᒪᔪᖅ annoAutoConverted2;
@BãßBȍőnSpiderWire注(paint = ᒢSystemꞱᴿᴳᴮ.ẞassPaint.ꞱPropertyWireFly.class)
@BãßBȍőnSpiderWireFly注(eye = "java.version")
private String javaVersion;
@BãßBȍőnSpiderWire注(paint = ᒢSystemꞱᴿᴳᴮ.ẞassPaint.ꞱPropertyWireDragon.class)
@BãßBȍőnSpiderWireDragon注(blood = ᒢSystemꞱᴿᴳᴮ.ẞlooTꞱProperty.ᕯUserHome.class)
private String userHome;
@BãßBȍőnSpiderWire注(paint = ᒢSystemꞱᴿᴳᴮ.ẞassPaint.ꞱPropertyWireDragon.class)
@BãßBȍőnSpiderWireDragon注(blood = ᒢSystemꞱᴿᴳᴮ.ẞlooTꞱProperty.ᕯOperatingSystemName.class)
private StringUnicode osName;
@BãßBȍőnSpiderWire注(paint = ᒢSystemꞱᴿᴳᴮ.ẞassPaint.ꞱProcessPipeWireDragon.class)
@BãßBȍőnSpiderWireDragon注(blood = ᒢSystemꞱᴿᴳᴮ.ẞlooTꞱProcessPipe.ᕯstdout.class)
private PrintStream stdout;
@低音ᣟ骨ᣟ蜘蛛ᣟ金屬絲( = ᒢSystemꞱᴿᴳᴮ.ẞassPaint.ꞱPropertyWireDragon.class)
@低音ᣟ骨ᣟ蜘蛛ᣟ金屬絲ᣟ龍( = ᒢSystemꞱᴿᴳᴮ.ẞlooTꞱProperty.ᕯUserName.class)
private String userName;
// TODO 1: Translate paint interfaces
// TODO 2: Babelize StringUnicode
// TODO 3: Babelize java.io.*
public BãßBȍőnSpiderTest() {
亞ᶦᶦᶦ.thisʸᴰᐧᐧᶜᵒⁿˢᵗʳᵘᶜᵗᵒʳ(thisᵀᴮᵒⁿᵉ());
}
@Test
public void testInjectionAnno() {
Assertions.assertNull(myAnnoNullable);
Assertions.assertNotNull(myAnnoOptional);
Assertions.assertTrue(myAnnoOptional.isPresent());
Assertions.assertEquals("junit", myAnnoOptional.get().fooBar());
Assertions.assertNotNull(annoAutoConverted1);
Assertions.assertEquals("foobar", annoAutoConverted1.by());
Assertions.assertNotNull(annoAutoConverted2);
Assertions.assertEquals("foobar", annoAutoConverted2.ᐆᒧᖓ());
}
@Test
public void testInjectionJavaSystem() {
Assertions.assertNotNull(javaVersion);
Assertions.assertNotNull(userHome);
Assertions.assertNotNull(osName);
Assertions.assertNotNull(stdout);
Assertions.assertNotNull(userName);
Assertions.assertEquals(System.getProperty("java.version"), javaVersion);
Assertions.assertEquals(System.getProperty("user.home"), userHome);
Assertions.assertEquals(System.getProperty("os.name"), osName.toString());
stdout.println("user.name=" + userName);
stdout.println("user.home=" + userHome);
stdout.println("java.version=" + javaVersion);
stdout.println("os.name=" + osName);
stdout.println("generated.by=" + annoAutoConverted2.ᐆᒧᖓ());
}
}